1: /* $Header$ */
2:
3: /*
4: * Project database definitions
5: *
6: * Author: Peter J. Nicklin
7: */
8:
9: /*
10: * Buffer sizes
11: */
12: #define PBUFSIZE 1024 /* project database buffer size */
13: #define PDBERRSIZE 256 /* database error message buffer size */
14: /*
15: * Database access mode definitions
16: */
17: #define _PACCESS 007 /* access mask */
18: #define _PREAD 001 /* database open for reading */
19: #define _PWRITE 002 /* database open for writing */
20: #define _PAPPEND 004 /* database open for appending */
21: /*
22: * Database status definitions
23: */
24: #define _PSTAT 070 /* status mask */
25: #define _PUPDATE 010 /* database updated */
26: #define _PEOF 020 /* EOF */
27: #define _PERR 040 /* error */
28: /*
29: * Project database structure
30: */
31: typedef struct _pdbdesc /* database description struct */
32: {
33: char root[PATHSIZE]; /* database directory pathname */
34: char path[PATHSIZE]; /* database pathname */
35: FILE *fp; /* database file pointer */
36: char tpath[PATHSIZE]; /* temporary database pathname */
37: FILE *tfp; /* temporary database file ptr */
38: unsigned short flag; /* mode of database access */
39: char pbuf[PBUFSIZE]; /* database line buffer */
40: char perr[PDBERRSIZE]; /* database error message buffer */
41: } PDB;
42: /*
43: * Functions defined for project databases
44: */
45: extern int _closepdb(); /* close database without updating */
46: extern int closepdb(); /* close database */
47: extern int errpdb(); /* print database error message */
48: extern PDB *mustopenpdb(); /* must open database or die */
49: extern PDB *openpdb(); /* open database */
50: extern void renamepdb(); /* rename database */
51: extern void resetpdb(); /* reset current database ptr */
52: extern void rewindpdb(); /* rewind database */
53: extern int pfndent(); /* find and load database entry */
54: extern int pgetent(); /* load next entry into buffer */
55: extern int pputent(); /* write buffer to database */
56: extern void prment(); /* remove database entry */
57: extern void paddkey(); /* add key to specified entries */
58: extern void pchgkey(); /* change specified key */
59: extern void prmkey(); /* remove specified key */
60: extern void paddflag(); /* add flags */
61: extern void pchgflag(); /* change flags */
62: extern void pputflag(); /* add or change flags */
63: extern void prmflag(); /* remove flags */
64: extern void paddstring(); /* add or change strings */
65: extern void pchgstring(); /* change strings */
66: extern void pputstring(); /* add or change strings */
67: extern void prmstring(); /* remove strings */
Defined struct's
Defined typedef's
PDB
defined in line
41; used 2 times
Defined macros
_PEOF
defined in line
26;
never used
_PERR
defined in line
27;
never used