1 /* Include file for the document preparation system. */ 2 3 #ifndef _DOCTEXT 4 #include <stdio.h> 5 /* #include <stdlib.h> */ 6 #include <ctype.h> 7 8 #ifdef ANSI_ARGS 9 #undef ANSI_ARGS 10 #endif 11 #ifdef __STDC__ 12 #define ANSI_ARGS(a) a 13 #else 14 #define ANSI_ARGS(a) () 15 #endif 16 17 #define MAX_FILE_SIZE 1024 18 #define MAX_ROUTINE_NAME 64 19 #define MAX_LINE 512 20 21 #define MATCH_CHARS "@DFHMNI" 22 #define MATCH_ALL_CHARS "@DFHIMN+" 23 #define ROUTINE '@' 24 #define DESCRIPTION 'D' 25 #define FORTRAN 'F' 26 #define INTERNAL '+' 27 #define HELP 'H' 28 #define MACRO 'M' 29 #define INCLUDE 'I' 30 #define TEXT 'N' 31 32 /* Special lead character types (only in the first column in a comment) */ 33 #define ARGUMENT '.' 34 #define VERBATIM '$' 35 36 37 /* Redefinitions of routines to system/txt.c */ 38 #define FindNextToken(fd,token,nsp) SYTxtFindNextToken(fd,token,1024,nsp) 39 #define SkipWhite( fd ) SYTxtSkipWhite( fd ) 40 #define SkipLine( fd ) SYTxtDiscardToEndOfLine( fd ) 41 #define SkipOver( fd, str ) SYTxtSkipOver( fd, str ) 42 #define GetLine( fd, buf ) SYTxtGetLine( fd, buf, 1024 ) 43 #define TrimLine( s ) SYTxtTrimLine( s ) 44 #define UpperCase( s ) SYTxtUpperCase( s ) 45 #define LowerCase( s ) SYTxtLowerCase( s ) 46 #define LastChangeToFile(fname,date) \ 47 SYLastChangeToFile( fname, date, (void*)0 ) 48 49 #ifdef FOO 50 /* This structure contains the output routines; to add a new output format, 51 specify the routines for these output actions */ 52 typedef struct { 53 void (*outbof)(), /* Output beginning of file */ 54 (*outchar)(), /* Output a character */ 55 (*outraw)(), /* Output a character without processing */ 56 (*outstring)(), /* Output a string */ 57 (*outblank)(), /* Output a blank */ 58 (*outlocation)(), /* Output "location" information */ 59 (*outtitle)(), /* Output "title" information */ 60 (*outsection)(), /* Output a new section */ 61 (*outlinebreak)(), /* Output a mandatory line break */ 62 (*outargbegin)(), /* Output start of an argument list */ 63 (*outargdefn)(), /* Output an argument definition */ 64 (*outargend)(), /* Output end of an argument definition */ 65 (*outverbatimbegin)(), /* Output begin of verbatim mode */ 66 (*outverbatimend)(), /* Output end of verbatim mode */ 67 (*outendpage)(), /* Output end of "page" */ 68 (*outendpar)(), /* Output end of paragraph */ 69 (*outstartem)(), /* Output begining of emphasis */ 70 (*outendem)(), /* Output end of emphasis */ 71 (*outstarttt)(), /* Output begining of tt */ 72 (*outendtt)(), /* Output end of tt */ 73 (*outpicture)(), /* Output a postscript picture */ 74 (*outstartcaption)(), /* Output the beginning of a caption */ 75 (*outendcaption)(); /* Output the end of a caption */ 76 } DocOutput; 77 78 /* These provide access to the output routines if "outfcn" is set to 79 a DocOutput structure */ 80 #define OutputBOF( fout, dirname ) (*(outfcn)->outbof)( fout, dirname ) 81 #define OutputChar( fout, c ) (*(outfcn)->outchar)( fout, c ) 82 #define OutputRawChar( fout, c ) (*(outfcn)->outraw)( fout, c ) 83 #define OutputString( fout, s ) (*(outfcn)->outstring)( fout, s ) 84 #define OutputBlank( fout ) (*(outfcn)->outblank)( fout ) 85 #define OutputLocation( fout, s ) (*(outfcn)->outlocation)( fout, s ) 86 #define OutputTitle( fout, name, level, date, heading ) \ 87 (*(outfcn)->outtitle)( fout, name, level, date, heading ) 88 #define OutputSection( fout, name ) (*(outfcn)->outsection)( fout, name ) 89 #define OutputLineBreak( lastnl, fout ) \ 90 (*(outfcn)->outlinebreak)( lastnl, fout ) 91 #define OutputArgBegin( fout ) (*(outfcn)->outargbegin)( fout ) 92 #define OutputArgDefn( fin, fout ) (*(outfcn)->outargdefn)( fin, fout ) 93 #define OutputArgEnd( fout ) (*(outfcn)->outargend)( fout ) 94 #define OutputVerbatimBegin( fout ) (*(outfcn)->outverbatimbegin)( fout ) 95 #define OutputVerbatimEnd( fout ) (*(outfcn)->outverbatimend)( fout ) 96 #define OutputEndPage( fout ) (*(outfcn)->outendpage)( fout ) 97 #define OutputEndPar( fout ) (*(outfcn)->outendpar)( fout ) 98 99 #define OutputStartEm( fout ) (*(outfcn)->outstartem)( fout ) 100 #define OutputEndEm( fout ) (*(outfcn)->outendem)( fout ) 101 #define OutputStartTt( fout ) (*(outfcn)->outstarttt)( fout ) 102 #define OutputEndTt( fout ) (*(outfcn)->outendtt)( fout ) 103 104 #define OutputPicture( fout, name ) (*(outfcn)->outpicture)( fout, name ) 105 #define OutputStartCaption( fout ) (*(outfcn)->outstartcaption)( fout ) 106 #define OutputEndCaption( fout ) (*(outfcn)->outendcaption)( fout ) 107 108 109 /* Known output formats */ 110 extern DocOutput *CreateOutputLaTeX( ), *CreateOutputMan(), 111 *CreateOutputHTML(); 112 113 #endif 114 115 extern int DocGetChar ANSI_ARGS(( FILE * )); 116 extern void DocUnGetChar ANSI_ARGS(( char, FILE * )); 117 extern void DocSetPushback ANSI_ARGS(( char * )); 118 extern void ResetLineNo ANSI_ARGS(( void )); 119 extern int GetLineNo ANSI_ARGS(( void )); 120 extern char GetSubClass ANSI_ARGS(( void )); 121 extern int GetIsX11Routine ANSI_ARGS(( void )); 122 extern void FindToken ANSI_ARGS(( FILE *, char * )); 123 extern int FoundLeader ANSI_ARGS(( FILE *, char *, char * )); 124 extern int MatchLeader ANSI_ARGS(( FILE *, char *, char * )); 125 extern void CopyIncludeName ANSI_ARGS(( FILE *, char * )); 126 extern void ExpandFileName ANSI_ARGS(( char *, int )); 127 extern int GetToolsDirLength ANSI_ARGS(( void )); 128 extern int MatchTokens ANSI_ARGS(( char *, char * )); 129 130 #endif 131