113111Srrh /* 2*60507Sbostic * @(#)bib.h 2.8 05/27/93 313111Srrh */ 412917Sgarrison /* various arguments for bib and listrefs processors */ 512917Sgarrison 612917Sgarrison /* constants */ 712917Sgarrison 812917Sgarrison # define true 1 912917Sgarrison # define false 0 10*60507Sbostic # define bool unsigned char 1112917Sgarrison # define err -1 1223488Sgarrison # define REFSIZE 2048 /* maximum size of reference string */ 1315060Sgarrison # define MAXFIELD 512 /* maximum size of any field in referece*/ 1412917Sgarrison 1512917Sgarrison /* reference citation marker genrated in pass 1 */ 1612917Sgarrison 1712917Sgarrison # define CITEMARK (char) 02 1812917Sgarrison # define CITEEND (char) 03 1916244Srrh # define FMTSTART (char) 04 2016244Srrh # define FMTEND (char) 05 2112917Sgarrison 2212917Sgarrison /* file names */ 2312917Sgarrison 2412917Sgarrison /* output of invert, input file for references */ 2512917Sgarrison # define INDXFILE "INDEX" 2612917Sgarrison /* pass1 reference collection file */ 2715904Srrh # define TMPREFFILE "/tmp/bibrXXXXXX" 2812917Sgarrison /* pass2 text collection file */ 2915904Srrh # define TMPTEXTFILE "/tmp/bibpXXXXXX" 3012917Sgarrison /* temp file used in invert */ 3115904Srrh # define INVTEMPFILE "/tmp/invertXXXXXX" 3217249Srrh # define SYSINDEX "/usr/dict/papers/INDEX" /* default system dictionary */ 3312917Sgarrison 34*60507Sbostic #ifndef BASEDIR 35*60507Sbostic # define BASEDIR "" 36*60507Sbostic # endif 3717249Srrh 38*60507Sbostic # define N_BMACLIB "/lib/bmac" /* where macro libraries live */ 39*60507Sbostic # define N_COMFILE "/lib/bmac/common" /* common words */ 40*60507Sbostic # define N_DEFSTYLE "/lib/bmac/bib.stdsn" /* default style of refs */ 41*60507Sbostic 42*60507Sbostic # define InitDirectory(arr,str) \ 43*60507Sbostic strcpy(arr,BASEDIR); strcat(arr,str); 44*60507Sbostic 45*60507Sbostic char BMACLIB[100], COMFILE[100], DEFSTYLE[100]; 46*60507Sbostic 4712917Sgarrison /* size limits */ 4812917Sgarrison 4912917Sgarrison /* maximum number of characters in common file */ 5015060Sgarrison # define MAXCOMM 1000 5112917Sgarrison 5212917Sgarrison char *malloc(); 5315060Sgarrison 5415060Sgarrison /* fix needed for systems where open [w]+ doesn't work */ 5515060Sgarrison # ifdef READWRITE 5615060Sgarrison 5715060Sgarrison # define READ 1 5815060Sgarrison # define WRITE 0 5915060Sgarrison 6015060Sgarrison #endif 6115904Srrh /* 6215904Srrh * Reference information 6315904Srrh */ 6415904Srrh struct refinfo{ 6516244Srrh char *ri_ref; /* actual value, base value */ 6615904Srrh char *ri_cite; /* citation string */ 6716244Srrh char ri_disambig[2]; /* disambiguation string */ 6815904Srrh int ri_length; /* length of reference string, plus null */ 6915904Srrh long int ri_pos; /* reference seek position */ 7015904Srrh int ri_n; /* number of citation in pass1 */ 7115904Srrh struct refinfo *ri_hp; /* hash chain */ 7215904Srrh }; 7315904Srrh struct wordinfo{ 7415904Srrh char *wi_word; /* actual word */ 7515904Srrh char *wi_def; /* actual definition */ 7615904Srrh int wi_length; /* word length */ 77*60507Sbostic bool wi_expanding; /* is it being expanded? */ 7815904Srrh struct wordinfo *wi_hp; /* hash chain */ 7915904Srrh }; 8015904Srrh int strhash(); 8115904Srrh #define HASHSIZE 509 8215904Srrh 8315904Srrh #define reg register 84*60507Sbostic 85