-
Notifications
You must be signed in to change notification settings - Fork 0
/
compta.h
42 lines (33 loc) · 875 Bytes
/
compta.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef _COMPTA_H
#define _COMPTA_H
#include <stdio.h>
struct account {
int number;
char *description;
struct account_op *operations;
struct account *next;
};
struct account_op {
int amount; //positive means debit
int number; //FIXME
struct account_op *next;
};
struct hook {
//TODO add a version field? how should we handle it?
void (*header)(void);
void (*raw)(const char *filename, char *s);
void (*operation_header)(const char *filename, int line);
void (*operation)(const char *filename,
const struct account *account, const struct account_op *op, int line);
void (*operation_footer)(const char *filename);
void (*printaccounts)(void);
};
extern struct account *accounts;
extern int verbose;
extern FILE *output;
extern int op_num;
extern char *s;
extern size_t l;
extern struct hook hook;
void setuphook(const char *driver);
#endif //_COMPTA_H