Date:2012-06-02 10:48:22 (11 years 9 months ago)
Author:Werner Almesberger
Commit:22412764d9e3c04a9a7ae396d92e47c6444b8df7
Message:b2/db.c: new function parts_dump to dump the whole parts database

Files: b2/db.c (2 diffs)
b2/db.h (1 diff)

Change Details

b2/db.c
168168}
169169
170170
171/* ----- Dumping ----------------------------------------------------------- */
172
173
171174static void dump_stock(FILE *file, const struct stock *s)
172175{
173176    const struct price *p;
...... 
199202}
200203
201204
205static gboolean dump_prm_traverse(gpointer key, gpointer value, gpointer data)
206{
207    struct part *p = key;
208    FILE *file = data;
209
210    (void) value;
211    part_dump(file, p);
212    return FALSE;
213}
214
215
216void parts_dump(FILE *file)
217{
218    g_tree_foreach(tree, dump_prm_traverse, (void *) file);
219}
220
221
202222/* ----- Currencies -------------------------------------------------------- */
203223
204224
b2/db.h
9898void part_finalize(struct part *part, const struct action *act);
9999void part_add_stock(struct part *part, struct stock *s);
100100void part_dump(FILE *file, const struct part *part);
101void parts_dump(FILE *file);
101102
102103const struct currency *currency_lookup(const char *name);
103104double currency_convert(const struct currency *from, const struct currency *to,

Archive Download the corresponding diff file

Branches:
master



interactive