xref: /original-bsd/contrib/bib/src/bib.h (revision 99c1622c)
1 /*
2  *	@(#)bib.h	2.8	05/27/93
3  */
4 /*   various arguments for bib and listrefs processors */
5 
6 /* constants */
7 
8 # define true  1
9 # define false 0
10 # define bool unsigned char
11 # define err  -1
12 # define REFSIZE 2048                /* maximum size of reference string    */
13 # define MAXFIELD 512                /* maximum size of any field in referece*/
14 
15 /* reference citation marker genrated in pass 1 */
16 
17 # define CITEMARK (char) 02
18 # define CITEEND  (char) 03
19 # define FMTSTART (char) 04
20 # define FMTEND   (char) 05
21 
22 /* file names */
23 
24         /* output of invert, input file for references */
25 # define INDXFILE "INDEX"
26         /* pass1 reference collection file */
27 # define TMPREFFILE  "/tmp/bibrXXXXXX"
28         /* pass2 text collection file */
29 # define TMPTEXTFILE "/tmp/bibpXXXXXX"
30         /* temp file used in invert */
31 # define INVTEMPFILE "/tmp/invertXXXXXX"
32 # define SYSINDEX "/usr/dict/papers/INDEX"	/* default system dictionary */
33 
34 #ifndef BASEDIR
35 # define BASEDIR   ""
36 # endif
37 
38 # define N_BMACLIB "/lib/bmac"       /* where macro libraries live */
39 # define N_COMFILE "/lib/bmac/common"	/* common words */
40 # define N_DEFSTYLE "/lib/bmac/bib.stdsn" /* default style of refs */
41 
42 # define InitDirectory(arr,str) \
43    strcpy(arr,BASEDIR); strcat(arr,str);
44 
45 char BMACLIB[100], COMFILE[100], DEFSTYLE[100];
46 
47 /* size limits */
48 
49 	/* maximum number of characters in common file */
50 # define MAXCOMM 1000
51 
52 char *malloc();
53 
54 /* fix needed for systems where open [w]+ doesn't work */
55 # ifdef READWRITE
56 
57 # define READ 1
58 # define WRITE 0
59 
60 #endif
61    /*
62     *	Reference information
63     */
64    struct refinfo{
65 	char	*ri_ref;	/* actual value, base value */
66 	char	*ri_cite;	/* citation string */
67 	char	ri_disambig[2];	/* disambiguation string */
68 	int	ri_length;	/* length of reference string, plus null */
69 	long int ri_pos;	/* reference seek position */
70 	int	ri_n;		/* number of citation in pass1 */
71 	struct	refinfo	*ri_hp;	/* hash chain */
72    };
73    struct wordinfo{
74 	char	*wi_word;	/* actual word */
75 	char	*wi_def;	/* actual definition */
76 	int	wi_length;	/* word length */
77 	bool	wi_expanding;	/* is it being expanded? */
78 	struct wordinfo *wi_hp;	/* hash chain */
79    };
80    int	strhash();
81 #define HASHSIZE	509
82 
83 #define reg register
84 
85