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 get_header             P((char *, char **)) ;
 131: void get_mult_hdr           P((char *, char **)) ;
 132: void init_setup             P(()) ;
 133: void parse_headers          P((int)) ;
 134: void readline               P(()) ;
 135: void reset_headers          P(()) ;
 136: void set_defs               P(()) ;
 137: void show_headers           P((int)) ;
 138: void show_mult_hdr          P((char *, char **)) ;

Defined variables

boldshow defined in line 104; used 1 times
do_date defined in line 129; used 1 times
emptyline defined in line 87; used 4 times
endcol defined in line 105; used 3 times
endfile defined in line 106; used 2 times
endline defined in line 107; used 4 times
endpage defined in line 108; used 4 times
expand defined in line 109; used 7 times
get_header defined in line 130; used 11 times
get_mult_hdr defined in line 131; used 2 times
get_opt defined in line 110; used 1 times
get_options defined in line 111; used 1 times
hdr_equal defined in line 112; used 19 times
init_setup defined in line 132; used 1 times
main defined in line 113; never used
mixedshow defined in line 114; used 11 times
parse_headers defined in line 133; used 4 times
printfile defined in line 115; used 2 times
process_name_field defined in line 116; used 2 times
process_postscript defined in line 117; used 1 times
psdef defined in line 118; used 5 times
readline defined in line 134; used 6 times
reset_headers defined in line 135; used 2 times
romanshow defined in line 119; used 1 times
set_defs defined in line 136; used 2 times
show_headers defined in line 137; used 4 times
show_mult_hdr defined in line 138; used 2 times
show_prologue defined in line 120; used 1 times
show_trailer defined in line 121; used 1 times
startfile defined in line 123; used 2 times
startline defined in line 122; used 4 times
startpage defined in line 124; used 4 times
textshow defined in line 125; used 1 times
usage defined in line 126; used 1 times
useline defined in line 127; used 4 times

Defined typedef's

bool defined in line 82; used 15 times

Defined macros

EQUAL defined in line 54; never used
FALSE defined in line 77; used 26 times
FCLOSE defined in line 29; used 3 times
FPRINTF defined in line 30; used 10 times
FPUTS defined in line 31; used 20 times
INC defined in line 55; never used
LINELENGTH defined in line 61; used 1 times
MAXCONT defined in line 72; used 4 times
MAXLINE defined in line 73; used 8 times
MAXPATHLEN defined in line 64; used 1 times
  • in line 63
MAXSIZES defined in line 67; never used
NAMEFIELDS defined in line 69; used 1 times
NAMELENGTH defined in line 70; used 1 times
P defined in line 45; used 48 times
PAGELENGTH defined in line 71; used 1 times
PRINTF defined in line 32; used 11 times
PROLOGUE defined in line 51; used 3 times
PUTC defined in line 33; never used
SPRINTF defined in line 34; used 8 times
SSCANF defined in line 35; used 2 times
STRCPY defined in line 36; used 7 times
STRNCPY defined in line 37; used 2 times
TRUE defined in line 76; used 33 times
UNGETC defined in line 38; used 3 times
strchr defined in line 58; used 2 times

Usage of this include

Last modified: 1992-02-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3917
Valid CSS Valid XHTML 1.0 Strict