/[cvs]/dary/db.h
ViewVC logotype

Annotation of /dary/db.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations)
Tue Oct 5 19:56:29 2004 UTC (14 years, 8 months ago) by riso
Branch point for: riso, MAIN
File MIME type: text/plain
Initial revision

1 riso 1.1 #ifndef __db_h
2     #define __db_h
3    
4     struct tindices {
5     int i;
6     };
7    
8     struct pindices {
9     int i;
10     };
11    
12     typedef struct address {
13     char *title, *name, *street, *city, *zip;
14     } tAddress;
15    
16     typedef struct person {
17     long sum;
18     char *name, *surname;
19     tAddress address;
20     struct pindices priv;
21     } tPerson;
22    
23     typedef tPerson *tPersonId;
24    
25     typedef struct entry {
26     tPersonId person;
27     int date;
28     long sum;
29     struct tindices priv;
30     } tEntry;
31    
32     typedef tEntry *tEntryId;
33    
34     tPersonId GetPerson(const char *name, const char *surname);
35     tPersonId NewPerson(const char *name, const char *surname);
36     void UpdatePerson(tPersonId id, const char *name, const char *surname, const tAddress *address); // may be NULL
37     void DelPerson(tPersonId id);
38    
39     tEntryId NewEntry(tPersonId person, int date, long sum);
40     void UpdateEntry(tEntryId id, tPersonId person, int date, long sum);
41     void DelEntry(tEntryId id);
42    
43     int OpenDb(const char *filename);
44     void CloseDb();
45    
46     void FreeAddress(tAddress *addr);
47     void AddressCpy(tAddress *dst, const tAddress *src);
48    
49     // ---- //
50    
51     #include "util.h"
52     extern tAllocator *persons, *entries;
53    
54    
55     #endif

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.26