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