Add to git.
[monolith.git] / examples / expenses_widget.h
1 /* Expenses widget.
2  * - by Richard W.M. Jones <rich@annexia.org>
3  */
4
5 #ifndef EXPENSES_WIDGET_H
6 #define EXPENSES_WIDGET_H
7
8 #include <monolith.h>
9
10 struct expenses_widget;
11 typedef struct expenses_widget *expenses_widget;
12
13 /* The "data model" is simply a vector of these structures. */
14 struct expense_row
15 {
16   int type;                     /* Index into expense_types table. */
17   const char *detail;           /* Details of the expense. */
18   int amount;                   /* Amount in PENCE/CENTS. */
19 };
20
21 extern const char *expense_types[];
22 extern int nr_expense_types;
23
24 /* Function: new_expenses_widget - expenses widget
25  *
26  */
27 extern expenses_widget new_expenses_widget (pool pool, ml_session session, vector expenses);
28
29 #endif /* EXPENSES_WIDGET_H */