Change Details
b2/db.c |
11 | 11 | |
12 | 12 | |
13 | 13 | #include <stdlib.h> |
| 14 | #include <stdio.h> |
14 | 15 | #include <glib.h> |
15 | 16 | |
16 | 17 | #include "util.h" |
... | ... | |
154 | 155 | param = next; |
155 | 156 | } |
156 | 157 | } |
| 158 | |
| 159 | |
| 160 | void part_dump(FILE *file, const struct part *part) |
| 161 | { |
| 162 | const struct param *p; |
| 163 | |
| 164 | fprintf(file, "%s %s\n", part->domain, part->name); |
| 165 | if (part->param) { |
| 166 | fprintf(file, " "); |
| 167 | for (p = part->param; p; p = p->next) { |
| 168 | fprintf(file, " %s=", p->u.field->name); |
| 169 | dump(file, p->u.field->fmt, &p->value); |
| 170 | } |
| 171 | fprintf(file, "\n"); |
| 172 | } |
| 173 | if (part->stock); |
| 174 | } |
b2/db.h |
13 | 13 | #ifndef DB_H |
14 | 14 | #define DB_H |
15 | 15 | |
| 16 | #include <stdio.h> |
| 17 | |
| 18 | |
16 | 19 | struct exchange { |
17 | 20 | const struct currency *dst; |
18 | 21 | double factor; |
... | ... | |
63 | 66 | struct part *part_add(const char *domain, const char *name); |
64 | 67 | void part_alias(struct part *a, struct part *b); |
65 | 68 | void part_finalize(struct part *part, const struct field *field); |
| 69 | void part_dump(FILE *file, const struct part *part); |
66 | 70 | |
67 | 71 | #endif /* !DB_H */ |
b2/lang.y |
353 | 353 | | part characteristics |
354 | 354 | { |
355 | 355 | part_finalize($1, hierarchy); |
| 356 | part_dump(stderr, $1); |
356 | 357 | } |
357 | 358 | ; |
358 | 359 | |
Download the corresponding diff file