File: input.h

package info (click to toggle)
xemacs21-packages 2009.02.17.dfsg.1-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 116,928 kB
  • ctags: 88,975
  • sloc: lisp: 1,232,060; ansic: 16,570; java: 13,514; xml: 6,477; sh: 4,611; makefile: 4,036; asm: 3,007; perl: 839; cpp: 500; ruby: 257; csh: 96; haskell: 93; awk: 49; python: 47
file content (40 lines) | stat: -rw-r--r-- 971 bytes parent folder | download | duplicates (12)
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
/* ----------------------------------------------------------------------------
 * File    : input.h
 * Purpose : header file for input.c
 * ----------------------------------------------------------------------------
 */

#define TOKEN_MAXSIZ          1023             /* maximum size of token      */
#define INPUT_BUFSIZ          TOKEN_MAXSIZ + 1 /* allow for terminating null */
/*
 *  #define DELIMITER_BEGIN_LIST '{'
 *  #define DELIMITER_END_LIST   '}'
 */

/* Possible token types in file */

enum { TOKEN_LABEL,
/*
 *     TOKEN_BEGIN_LIST,
 *     TOKEN_END_LIST,
 */
       TOKEN_EOF };


typedef enum {
   ERR_OPENFAIL,
   ERR_EMPTYFILE,
   ERR_MEMALLOC,
   ERR_NOBEGIN,
   ERR_NOEND,
   ERR_NOROOT,
   ERR_MANYROOT,
   ERR_NONE
} ErrCode;

#define NUM_ERRS             7	/* don't count ERR_NONE */


Tree*	ReadTreeFromFile(char *fname, ErrCode *error);
void	SetNodeLabelAndValue(Tree *node, char *label_and_value);
int	SaveTreeToFile(Tree *tree, char *fname);