1:
2: /* @(#)mp.h 1.4 92/02/17
3: *
4: * Contains all the global definitions used by mp.
5: *
6: * Copyright (c) Steve Holden and Rich Burridge.
7: * All rights reserved.
8: *
9: * Permission is given to distribute these sources, as long as the
10: * copyright messages are not removed, and no monies are exchanged.
11: *
12: * No responsibility is taken for any errors or inaccuracies inherent
13: * either to the comments or the code of this program, but if
14: * reported to me then an attempt will be made to fix them.
15: */
16:
17: #include <stdio.h>
18: #include <sys/types.h>
19: #include <sys/file.h>
20: #include <sys/param.h>
21: #include <ctype.h>
22: #include <time.h>
23: #include <pwd.h>
24:
25: #ifdef SYSV
26: #include <string.h>
27: #endif /*SYSV*/
28:
29: #define FCLOSE (void) fclose
30: #define FPRINTF (void) fprintf
31: #define FPUTS (void) fputs
32: #define PRINTF (void) printf
33: #define PUTC (void) putc
34: #define SPRINTF (void) sprintf
35: #define SSCANF (void) sscanf
36: #define STRCPY (void) strcpy
37: #define STRNCPY (void) strncpy
38: #define UNGETC (void) ungetc
39:
40: /* For all function declarations, if ANSI then use a prototype. */
41:
42: #if defined(__STDC__)
43: #define P(args) args
44: #else /* ! __STDC__ */
45: #define P(args) ()
46: #endif /* STDC */
47:
48: /* Configuration constants */
49:
50: #ifndef PROLOGUE /* PostScript prologue file */
51: #define PROLOGUE "/usr/local/lib"
52: #endif /*PROLOGUE*/
53:
54: #define EQUAL(val) (!strncmp(val, nextline, strlen(val)))
55: #define INC argc-- ; argv++ ;
56:
57: #ifdef NOSTRCHR
58: #define strchr index
59: #endif /*NOINDEX*/
60:
61: #define LINELENGTH 80 /* Number of characters per line. */
62:
63: #ifndef MAXPATHLEN
64: #define MAXPATHLEN 1024
65: #endif /*MAXPATHLEN*/
66:
67: #define MAXSIZES 4 /* Maximum number of different sizes. */
68:
69: #define NAMEFIELDS 3 /* Default no. of "words" from passwd gecos. */
70: #define NAMELENGTH 18 /* Maximum allowable real user name. */
71: #define PAGELENGTH 60 /* Number of lines per page. */
72: #define MAXCONT 10 /* Maximum no of continuation header lines */
73: #define MAXLINE 256 /* Maximum string length. */
74:
75: #ifndef TRUE
76: #define TRUE 1
77: #define FALSE 0
78: #endif /*TRUE*/
79:
80: typedef enum {DO_MAIL, DO_NEWS, DO_TEXT} document_type ;
81: typedef enum { A4, US } paper_type ;
82: typedef char bool ;
83:
84: extern time_t time P((time_t *)) ;
85: extern struct tm *localtime P((const time_t *)) ;
86:
87: bool emptyline P((char *)) ;
88:
89: extern FILE *fopen P((const char *, const char *)) ;
90: extern void exit P((int)) ;
91: extern char *asctime P((const struct tm *)) ;
92: extern char *getenv P((char *)) ;
93: extern char *getlogin P(()) ;
94: extern char *gets P((char *)) ;
95: extern char *malloc P((unsigned int)) ;
96:
97: #ifndef SYSV
98: extern char *realloc P((char *, unsigned int)) ;
99: extern char *strchr P((char *, int)) ;
100: extern char *strcpy P((char *, char *)) ;
101: extern char *strncpy P((char *, char *, int)) ;
102: #endif /*SYSV*/
103:
104: int boldshow P((char *, char *)) ;
105: int endcol P(()) ;
106: int endfile P(()) ;
107: int endline P(()) ;
108: int endpage P(()) ;
109: int expand P((unsigned char *)) ;
110: int get_opt P((int, char **, char *)) ;
111: int get_options P((int, char **)) ;
112: int hdr_equal P((char *)) ;
113: int main P((int, char **)) ;
114: int mixedshow P((char *, char *)) ;
115: int printfile P(()) ;
116: int process_name_field P((char *, char *, int, int)) ;
117: int process_postscript P(()) ;
118: int psdef P((char *, char *)) ;
119: int romanshow P((char *)) ;
120: int show_prologue P((char *)) ;
121: int show_trailer P(()) ;
122: int startline P(()) ;
123: int startfile P(()) ;
124: int startpage P(()) ;
125: int textshow P((char *)) ;
126: int usage P(()) ;
127: int useline P(()) ;
128:
129: void do_date P(()) ;
130: void P((char *, char **)) ;
131: void get_mult_hdr P((char *, char **)) ;
132: void init_setup P(()) ;
133: void P((int)) ;
134: void readline P(()) ;
135: void P(()) ;
136: void set_defs P(()) ;
137: void P((int)) ;
138: void show_mult_hdr P((char *, char **)) ;