annotate pkg-src/tree-x/input.h @ 167:85ec50267440 r20-3b10

Import from CVS: tag r20-3b10
author cvs
date Mon, 13 Aug 2007 09:45:46 +0200
parents 0132846995bd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1 /* ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
2 * File : input.h
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
3 * Purpose : header file for input.c
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
4 * ----------------------------------------------------------------------------
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
5 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
6
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
7 #define TOKEN_MAXSIZ 1023 /* maximum size of token */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
8 #define INPUT_BUFSIZ TOKEN_MAXSIZ + 1 /* allow for terminating null */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
9 /*
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
10 * #define DELIMITER_BEGIN_LIST '{'
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
11 * #define DELIMITER_END_LIST '}'
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
12 */
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
13
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
14 /* Possible token types in file */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
15
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
16 enum { TOKEN_LABEL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
17 /*
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
18 * TOKEN_BEGIN_LIST,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
19 * TOKEN_END_LIST,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
20 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
21 TOKEN_EOF };
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
22
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
23
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
24 typedef enum {
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
25 ERR_OPENFAIL,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
26 ERR_EMPTYFILE,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
27 ERR_MEMALLOC,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
28 ERR_NOBEGIN,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
29 ERR_NOEND,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
30 ERR_NOROOT,
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
31 ERR_MANYROOT,
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
32 ERR_NONE
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
33 } ErrCode;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
34
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
35 #define NUM_ERRS 7 /* don't count ERR_NONE */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
36
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
37
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
38 Tree* ReadTreeFromFile(char *fname, ErrCode *error);
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
39 void SetNodeLabelAndValue(Tree *node, char *label_and_value);
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
40 int SaveTreeToFile(Tree *tree, char *fname);