1 		/*===============================
2 		    header file for hpscat v1.3
3 		 ================================*/
4 
5 /*--- user-definable part ---*/
6 
7 /* titling fonts stuff */
8 
9 #define  NameFont1   "AvantGarde-Book"		/* for "filename:" */
10 #define  NameFont2   "AvantGarde-Demi"		/* for real filename */
11 #define  PageNoFont  "AvantGarde-Demi"		/* for "page #" */
12 #define  TimeFont    "Palatino-BoldItalic"	/* for timestamp */
13 #define  LogoFont    "AvantGarde-Demi"
14 #define  DEF_TFONT   "NewCenturySchlbk-Bold"    /* for document title */
15 
16 /* currently `hcode' is used for code-conversion */
17 
18 #define  Converter  "hcode"
19 
20 /** NOTE: you may give the compile option -DHPS in the Makefile
21 	only if you have hangul PS printer,
22 	for example, Trigem TG850, Qnix PSmII and so on. */
23 
24 #ifdef  HPS
25 /* # define  HFont  "SMmu" */		/* this is set to QLBP PSmII font name */
26  				/* change to whatever font-name you have */
27 # define  DEF_HFONT  "SMmu"
28 # define  fromJH  "-tk"
29 # define  fromN   "-nk"
30 # define  fromI   "-ik"
31 #else
32 /* # define  HFont  "MunjoHan"  */
33 #ifdef ADV_HFONT           /* See Makefile for this option */
34 # define  DEF_HFONT Munjo  /* Choose default Hangul font */
35                            /* Hangul fonts are defined below */
36 #else
37 # define  DEF_HFONT  "MunjoHan"  /* Choose default Hangul font. */
38                                  /* You have to use exact font name */
39 #endif
40 
41 
42 # define  fromKS  "-kt"
43 # define  fromN   "-nt"
44 # define  fromI   "-it"
45 #endif  /* HPS */
46 
47 /*------------------------------*\
48 |     don't touch below here     |
49 \*------------------------------*/
50 
51 #include <stdio.h>
52 #include <stdlib.h>
53 #include <string.h>
54 #include <unistd.h>
55 #include <sys/time.h>
56 #include <sys/wait.h>
57 
58 #ifdef __GNUC__
59 # define  PROT(x)  x
60 #else
61 # define  PROT(x)  ()
62 #endif
63 
64 typedef enum { False, True } bool;
65 
66 typedef enum { Korean, English } _cmode;
67 typedef enum { Plain, Bold } _efont;
68 typedef enum { Garo, Garo3, Sero, Sero2 } _layout;
69 typedef enum { KSC, Johap, Nbyte,ISO } _hcode;
70 
71 #ifdef ADV_HFONT
72 /* Add mnimonics for Hangul fonts available before userfont
73    and list exact names for them in 'hfontname' in init.c */
74 typedef enum { Munjo,PCMunjo,MunjoBold,Gotic,userfont} _hfont;
75 #endif
76 
77 #define HOR_SCALE_FAC 0.9  /* See showbuf.c */
78 
79 /* For some mysterious asthetical reason, all horizontal scale
80    in PS output is scaled by factor of 0.9 */
81 /* All horizontal values defined below are scaled by 1.0 / 0.9
82    expecting horizontal scaling down by factor 0.9 in PS output */
83 
84 /*---  constants for layout  ---*/
85 
86 #define   DEF_SW      24   /*  width of shadowed area  */
87 #define   DEF_SW_NL    3  /*  width of shaded area when no line # is to
88                                 be printed */
89 
90 #define   HEAD_height  20    /* height of header */
91 #define   FOOT_height  20    /* height of footer */
92 
93 /*  landscape 2 column  */
94 
95 
96 /*
97 #define   L_width     420
98 #define   L_height    510
99 
100 #define   L_LM1        53
101 #define   L_LM2      (L_LM1 + L_width)
102 #define   L_BM         45
103 #define   L_TM       (L_BM + L_height)
104 */
105 
106 
107 /*  landscape 3 column  */
108 
109 /*
110 #define   L3_width   (L_width*2/3)
111 #define   L3_height   L_height
112 
113 #define   L3_LM1      L_LM1
114 #define   L3_LM2     (L3_LM1 + L3_width)
115 #define   L3_LM3     (L3_LM1 + L3_width*2)
116 #define   L3_BM       L_BM
117 #define   L3_TM       L_TM
118 */
119 
120 /*  portrait 1 column  */
121 
122 /*
123 #define   P_width     575
124 #define   P_height    735
125 
126 #define   P_LM         45
127 #define   P_BM         50
128 #define   P_TM       (P_BM + P_height)
129 */
130 
131 /*  portrait 2 column  */
132 
133 /*
134 #define   P2_width   (P_width/2)
135 #define   P2_height   P_height
136 
137 #define   P2_LM1      P_LM
138 #define   P2_LM2     (P2_LM1+P2_width)
139 #define   P2_BM       P_BM
140 #define   P2_TM       P_TM
141 */
142 
143 #define   Smallest    6
144 #define   Largest     30
145 #define   Defaultsize 8
146 #define   TI_FS       18 /* Document Title font size */
147 
148 /* #define   Maxline    (P_height/Smallest)  */
149 /* #define   Maxchar    (P_width/Smallest*2) */
150 
151 typedef struct {
152     int  linenum;
153     char *line;
154 } aline;
155 
156 extern _hcode  hcode;      /*  input hangul code  */
157 extern _efont  efont;      /*  english font   - plain or bold */
158 extern _layout layout;     /*  layout format  - portrait or landscape  */
159 
160 #ifdef ADV_HFONT
161 extern  _hfont hfont;
162 extern char *hfontname[userfont+1];
163 #else
164 extern char *hfont;
165 #endif
166 
167 extern char *tfont;  /* font for the document title */
168 
169 extern char   *nalza;      /*  day & time  */
170 
171 extern int     prows;      /*  # of rows a paper  */
172 extern int     fsize;      /*  font size  */
173 extern int     width;      /*  page buffer width  */
174 extern char    *title;     /*  document title */
175 
176 extern _cmode  cmode;      /*  character mode - hangul or english  */
177 extern int     cpl;        /*  current line  */
178 extern int     pageno;     /*  current page  */
179 extern bool    nolnum;     /*  false if linenumber is required  */
180 extern bool    nobox;      /*  false if outlinebox is to be drawn  */
181 extern bool    noheader;   /*  false if header is to be put  */
182 extern bool    nofooter;   /*  false if footer is to be put  */
183 extern bool    notitle;    /*  false if document title is not known */
184 extern bool    cont;       /*  true if long line is to be wrapped   */
185 extern bool    to_stdout;  /*  true if write to stdout */
186 extern bool    cheat;      /*  true if cheating */
187 extern bool    narrow;     /*  false if normal courier is used */
188 extern FILE   *fp;         /*  file pointer to input file  */
189 extern FILE   *ofp;        /*  file pointer to output file  */
190 
191 void	endfile(void);
192 void	fatal(char *);
193 int	fillpagebuf(void);
194 int	find_f(int, int, int);
195 int	find_l(int, int, int);
196 int	find_m(int, int, int);
197 int	find_set(int);
198 
199 /***  EOF  ***/
200