mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-16 19:58:26 +02:00
b2/: dump part records (for debugging only)
This commit is contained in:
parent
edcc61a6f4
commit
6c49fdd789
18
b2/db.c
18
b2/db.c
@ -11,6 +11,7 @@
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "util.h"
|
||||
@ -154,3 +155,20 @@ void part_finalize(struct part *part, const struct field *field)
|
||||
param = next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void part_dump(FILE *file, const struct part *part)
|
||||
{
|
||||
const struct param *p;
|
||||
|
||||
fprintf(file, "%s %s\n", part->domain, part->name);
|
||||
if (part->param) {
|
||||
fprintf(file, " ");
|
||||
for (p = part->param; p; p = p->next) {
|
||||
fprintf(file, " %s=", p->u.field->name);
|
||||
dump(file, p->u.field->fmt, &p->value);
|
||||
}
|
||||
fprintf(file, "\n");
|
||||
}
|
||||
if (part->stock);
|
||||
}
|
||||
|
4
b2/db.h
4
b2/db.h
@ -13,6 +13,9 @@
|
||||
#ifndef DB_H
|
||||
#define DB_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
struct exchange {
|
||||
const struct currency *dst;
|
||||
double factor;
|
||||
@ -63,5 +66,6 @@ struct part *part_lookup(const char *domain, const char *name);
|
||||
struct part *part_add(const char *domain, const char *name);
|
||||
void part_alias(struct part *a, struct part *b);
|
||||
void part_finalize(struct part *part, const struct field *field);
|
||||
void part_dump(FILE *file, const struct part *part);
|
||||
|
||||
#endif /* !DB_H */
|
||||
|
Loading…
Reference in New Issue
Block a user