1 /*
2    ATP QWK MAIL READER FOR READING AND REPLYING TO QWK MAIL PACKETS.
3    Copyright (C) 1992, 1993, 1997  Thomas McWilliams
4    Copyright (C) 1990  Rene Cougnenc
5 
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2, or (at your option)
9    any later version.
10 
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15 
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20 
21 /*
22 reader.h
23 */
24 
25 #ifndef _ATP_READER_H
26 #define _ATP_READER_H 1
27 
28 #include "globals.h"
29 #include "atptypes.h"
30 
31 #if defined(HAVE_TERMCAP_H)
32 #ifndef HAVE_LIBTERMCAP
33 #define HAVE_LIBTERMCAP
34 #endif
35 #endif
36 
37 #define PCBLONG (pcbext)
38 
39 /* various constants */
40 #define SEPDOS '\\'
41 #define EOS     0  /* End of string */
42 #define DEL_CHAR '\177'
43 #define SPC_CHAR '\040'
44 #define CR_CHAR  '\015'
45 #define LF_CHAR  '\012'
46 #define TAB_CHAR '\011'
47 #define BS_CHAR  '\010'
48 #define NUL_CHAR '\0'
49 #define HIGH_ASCII (byte)0x80
50 #define LF 0x0A
51 #define CR 0x0D
52 #define SUB_CHAR 0x1A
53 #define CNTRL_Z SUB_CHAR
54 #define DOS_SPACE (byte)0xFF
55 #define ASTERISK '*'
56 #define PRIVATE_MSG ASTERISK
57 #define PUBLIC_MSG SPC_CHAR
58 #define ACTIVE_MSG (byte)0xE1
59 #define INACTIVE_MSG (byte)0xE2
60 #define QWK_LINE_FEED (byte)0xE3
61 #define QWK_FIELD_LEN 25
62 
63 #define MSG_EXT     ".msg"         /* Extension of reply file            */
64 #define CNF_EXT     ".cnf"         /* Extension of conference file       */
65 #define IDX_EXT     ".idx"         /* Extension of index files           */
66 
67 #define BEEP '\07'
68 #define BELL (silent? (char) SPC_CHAR :(char) BEEP )
69 #define IDXSIZE sizeof(struct MyIndex)
70 #define STRING_LEN(X) (sizeof(X)-1)
71 #define DATE_LEN 24
72 #define SHORT_SUBJ_LEN 25
73 #define LSUBJ_HEAD_LEN 10
74 #define LSUBJ_NAME_LEN 8
75 #define LSUBJ_BODY_LEN 54
76 #define LSUBJ_TAIL_LEN 8
77 #define LSUBJ_BUF_LEN  LSUBJ_HEAD_LEN + LSUBJ_BODY_LEN + LSUBJ_TAIL_LEN
78 #define LSUBJ_LEN 54
79 #define LSUBJ_TAIL "      N\n"
80 #define LSUBJ_HEAD " @SUBJECT:"
81 
82 /* test for MS-DOS block graphic line drawing character */
83 #define vtspecial(c)  ((((c)>(byte)0xaf)&&((c)<(byte)0xe0)) ? 1 : 0 )
84 
85 #define CONFIG_FILE "atprc"
86 #define WORK_DIR    "atpwork"
87 #define TAGFILE     "taglines.atp" /* taglines file                      */
88 
89 
90 /* various memory model configurations */
91 /* MS-DOS 16 bit */
92 #ifdef _ATP16_
93 
94 /* large model */
95 #define MAXCONF     4000  /* Increase if you need more conferences         */
96 #define MYBUF   (size_t)12800U  /* MAX message len buffer received message */
97 #define MAXBUF  (size_t)61440U  /* Worst case buffer size 60K              */
98 #define MAXSEND (size_t)61440U  /* MAX message len buffer sent message     */
99                            /* (40000 = about 600 lines with 65 chars/line) */
100 #else /* use huge model 32 bit */
101 
102 /*  huge model  */
103 #define MAXCONF       8191        /* Can not exceed 8191 but could be less.  */
104 /* #ifndef no_proto */
105 #define MYBUF   (size_t)(256*128)    /* about 32K */
106 #define MAXBUF  (size_t)(MYBUF*8)    /* about 260K */
107 #define MAXSEND (size_t)  65408      /* MAX message len buffer sent message  */
108 /*
109  *#else
110  *#define MYBUF 32768L
111  *#define MAXBUF 179200L
112  *#define MAXSEND 65408L
113  *#endif
114  */
115 #endif  /* memory models */
116 
117 #ifndef CLSCRN
118 #define CLSCRN cls
119 #endif
120 
121 /* read.c */
122 /* lower 2 bits used for display mode repeat constant */
123 #define RPT_MASK 0x03
124 #define BBS_NM_LEN 74
125 #define NO_CHILD -1
126 
127 /* text.c */
128 extern const char CONSPTR txt[];       /* Language-dependant text messages ( general)*/
129 extern const char CONSPTR taghlp[];    /* Language-dependant text messages ( tag help)*/
130 extern const char CONSPTR Months[];    /* Language-dependant text messages (Dates)*/
131 extern const char CONSPTR terms[];     /* Gnu copyleft message */
132 
133 /* editline.c */
134 #include "editline/edpublic.h"
135 
136 
137 /* various macros. */
138 
139 #if defined(__cplusplus)
140 
141 ATP_INLINE void
cnf_path(char * targ,const int cnum)142 cnf_path(char *targ, const int cnum)
143 {
144     sprintf(targ, "%s%s%c%d%s", HomePath, CurBoard, SEP, cnum, CNF_EXT);
145 }
146 
147 ATP_INLINE void
idx_path(char * targ,const int cnum)148 idx_path(char *targ, const int cnum)
149 {
150     sprintf(targ, "%s%s%c%d%s", HomePath, CurBoard, SEP, cnum, IDX_EXT);
151 }
152 
153 ATP_INLINE void
make_c_i_paths(char * C,char * I,const int N)154 make_c_i_paths(char *C, char *I, const int N)
155 {
156     sprintf(C, "%s%s%c%d%s", HomePath, CurBoard, SEP, N, CNF_EXT);
157     sprintf(I, "%s%s%c%d%s", HomePath, CurBoard, SEP, N, IDX_EXT);
158 }
159 
160 #else
161 #define cnf_path(targ,cnum) sprintf(targ, "%s%s%c%d%s", HomePath, CurBoard, SEP, (cnum), CNF_EXT);
162 #define idx_path(targ,cnum) sprintf(targ, "%s%s%c%d%s", HomePath, CurBoard, SEP, (cnum), IDX_EXT);
163 #define make_c_i_paths(C,I,N) \
164   sprintf(C, "%s%s%c%d%s", HomePath, CurBoard, SEP, (N), CNF_EXT); \
165   sprintf(I, "%s%s%c%d%s", HomePath, CurBoard, SEP, (N), IDX_EXT);
166 
167 #endif
168 
169 #endif /* _ATP_READER_H */
170 
171