Pristine Ack-5.5
[Ack-5.5.git] / util / ack / ack.h
1 /*
2  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3  * See the copyright notice in the ACK home directory, in the file "Copyright".
4  */
5 #ifndef NORCSID
6 #define RCS_ACK "$Id: ack.h,v 2.9 1994/06/24 10:12:26 ceriel Exp $"
7 #endif
8
9 /****************************************************************************/
10 /*                      User settable options                               */
11 /****************************************************************************/
12
13 #define FRONTENDS       "fe"    /* The front-end definitions */
14 #define TMPNAME         "Ack_%x"     /* Naming of temp. files */
15
16 /****************************************************************************/
17 /*         Internal mnemonics, should not be tinkered with                  */
18 /****************************************************************************/
19
20 /* The names of some string variables */
21
22 #define HOME    "EM"
23 #define RTS     "RTS"
24 #define HEAD    "HEAD"
25 #define TAIL    "TAIL"
26 #define SRC     "SOURCE"
27 #define LIBVAR  "LNAME"
28 #define SUFFIX  "SUFFIX"
29
30 /* Intended for flags, possibly in bit fields */
31
32 #define YES     1
33 #define NO      0
34 #define MAYBE   2
35
36 #define EXTERN  extern
37
38 #define SUFCHAR '.'             /* Start of SUFFIX in file name */
39 #define SPACE   ' '
40 #define TAB     '\t'
41 #define EQUAL   '='
42 #define S_VAR   '{'             /* Start of variable */
43 #define C_VAR   '}'             /* End of variable */
44 #define A_VAR   '?'             /* Variable alternative */
45 #define BSLASH  '\\'            /* Backslash */
46 #define STAR    '*'             /* STAR */
47 #define C_IN    '<'             /* Token specifying input */
48 #define C_OUT   '>'             /* Token specifying output */
49 #define S_EXPR  '('             /* Start of expression */
50 #define C_EXPR  ')'             /* End of expression */
51 #define M_EXPR  ':'             /* Middle of two suffix lists */
52 #define T_EXPR  '='             /* Start of tail */
53
54 #define NO_SCAN 0200            /* Bit set in character to defeat recogn. */
55
56 typedef struct {
57         char    *p_path;        /* points to the full pathname */
58         int     p_keeps:1;      /* The string should be thrown when unused */
59         int     p_keep:1;       /* The file should be thrown away after use */
60 } path ;
61
62 #define p_cont(elem) ((path *)l_content(elem))
63
64 /* Return values of setpath() */
65 enum f_path { F_OK, F_NOMATCH, F_NOPATH } ;
66
67 /* Library routines */
68
69 extern char *strindex();
70 extern char *strrindex();
71 extern char *strcpy();
72 extern char *strcat();
73 extern int  getpid();
74 extern int  unlink();
75 extern int  close();
76 extern int  open();
77 extern int  creat();
78
79 /* Own routines */
80 enum f_path getpath();
81 enum f_path scan_end();
82 extern void noodstop();
83 extern char *getvar();
84 extern char *keeps();
85 extern char *basename();
86 extern char *skipblank();
87 extern char *firstblank();
88 extern char *getcore();
89 extern char *changecore();
90 #define freecore(area)  free(area)
91
92 #define DEBUG   1       /* Allow debugging of Ack */
93
94 #ifndef DEBUG
95 #  define debug 0       /* To surprise all these 'if ( debug ) 's */
96 #else
97 extern  int debug ;
98 #endif