1 /*# name=.PRM file structure and definitions
2 */
3 
4 #if !defined(__PRM_H_DEFINED) || defined(FORCE)
5 
6 #if defined(FORCE)
7     #undef OFS
8     typedef char OFS[PATHLEN];
9 #else
10     #define OFS word
11 #endif
12 
13 
14 #ifndef __PRM_H_DEFINED
15 #ifndef MAX_DRIVES
16   #define MAX_DRIVES         26   /* Maximum number of drives on system      */
17 #endif
18 
19 #ifndef CHAR_BITS
20   #define CHAR_BITS           8   /* Number of bits in a 'char'              */
21 #endif
22 
23   #define CTL_VER             9   /* Version number of BBS.PRM               */
24 
25   /* This macro is ONLY used for accessing *pointers* in the `prm' structure.
26      This is required, due to the way Wynn has made OPUS_CTL write the strings
27      out (which uses a lot less memory than some other ways).  If you want
28      to access an INT, or a non-pointer in the structure, then you can use
29      a `prm.var_name'-style reference.                                       */
30 
31   #define PRM(s) (offsets+(prm.s))
32 
33   #define MAX_LANG           8       /* Max. number of possible languages    */
34   #define MAX_YELL          10       /* Max number of yell slots             */
35   #define MAX_EXTERNP       16       /* max. number of external programs     */
36   #define ALIAS_CNT         15       /* number of matrix addresses           */
37   #define MAXCLASS          12       /* OBSOLETE!  Only used for             *
38                                       * compatibility with Max 2.x.          */
39             /** Definitions for the `prm.flags' variable **/
40 
41   #define FLAG_keyboard    0x0001 /* If local mode is on by default         1*/
42   #define FLAG_watchdog    0x0002 /* Use watchdog for outside commands      2*/
43   #define FLAG_snoop       0x0004 /* If snoop is on by default              3*/
44   #define FLAG_norname     0x0008 /* If we should disable ^aREALNAME kludge 4*/
45   #define FLAG_close_sf    0x0010 /* Close all standard files for O)utside  5*/
46   #define FLAG_break_clr   0x0020 /* Send a break signal to dump modem's    6*
47                                    * internal buffer                         */
48   #define FLAG_log_echo    0x0040 /* Log user-written echomail              7*/
49   #define FLAG_no_ulist    0x0080 /* User can't press '?' to list users in  8*
50                                    * msg.                                    */
51   #define FLAG_no_magnet   0x0100 /* Disable the MagnEt editor              9*/
52   #define FLAG_autodate    0x0200 /* Automatically search directory for     0*/
53                                   /* file size & date.                       */
54   #define FLAG_statusline  0x0400 /* If SysOp wants a status line on screen 1*/
55   #define FLAG_ask_phone   0x0800 /* If we should ask user for phone number 2*/
56   #define FLAG_noyell      0x1000 /* If yell is toggled on or off by Sysop  3*/
57   #define FLAG_lbaud96     0x2000 /* If we should use 9600 baud for local   4*
58                                    * callers... (For Opus compatibility!)    */
59   #define FLAG_alias       0x4000 /* If we're running a system which allows 5*
60                                    * aliases or handles                      */
61   #define FLAG_ask_name    0x8000 /* If we should ask user for their alias  6*
62                                    * name too -- Only needed if using        *
63                                    * FLAG_alias.                             */
64 
65   #define FLAG2_gate       0x0001 /* Gate netmail messages, use zonegate!   1*/
66   #define FLAG2_has_snow   0x0002 /* Video adapter is slow CGA w/snow       2*/
67   #define FLAG2_CHKRIP     0x0004 /* Check for RIP setting on login         3*/
68   #define FLAG2_ltimeout   0x0008 /* Local keyboard timeout                 4*/
69   #define FLAG2_noshare    0x0010 /* SHARE not used -- don't lock files!    5*/
70   #define FLAG2_CAPTURE    0x0020 /* Sysop chat capture automatically on    6*/
71   #define FLAG2_NOCRIT     0x0040 /* Don't use internal crit.err handler    7*/
72   #define FLAG2_CHECKDUPE  0x0080 /* Check for duplicate uploads            8*/
73   #define FLAG2_CHECKEXT   0x0100 /* Compare extension for duplicate uploads9*/
74   #define FLAG2_GLOBALHB   0x0200 /* Global high bit allowed               10*/
75   #define FLAG2_1NAME      0x0400 /* Allow one-word names                  11*/
76   #define FLAG2_UMSGID     0x0800 /* Display UMSGIDs to user instead of    12*/
77                                   /* virtual message numbers.                */
78   #define FLAG2_SWAPOUT    0x1000 /* Swap to disk when shelling            13*/
79   #define FLAG2_NOENCRYPT  0x2000 /* Disable password encryption           14*/
80   #define FLAG2_STRICTXFER 0x4000 /* Kick users off in file transfers if   15*/
81                                   /* time limit exceeded.                    */
82   #define FLAG2_CHKANSI    0x8000 /* Check for ANSI setting on login       16*/
83 
84   #define LOG_TERSE       0x02
85   #define LOG_VERBOSE     0x04
86   #define LOG_TRACE       0x06
87 
88   #define LOG_terse       LOG_TERSE
89   #define LOG_verbose     LOG_VERBOSE
90   #define LOG_trace       LOG_TRACE
91 
92   #define MULTITASKER_AUTO        -1
93   #define MULTITASKER_NONE        0
94   #define MULTITASKER_DOUBLEDOS   1
95   #define MULTITASKER_DESQVIEW    2
96   #define MULTITASKER_TOPVIEW     3
97   #define MULTITASKER_MLINK       4
98   #define MULTITASKER_MSWINDOWS   5
99   #define MULTITASKER_OS2         6
100   #define MULTITASKER_PCMOS       7
101   #define MULTITASKER_NT          8
102 
103   #define MULTITASKER_auto        MULTITASKER_AUTO
104   #define MULTITASKER_none        MULTITASKER_NONE
105   #define MULTITASKER_doubledos   MULTITASKER_DOUBLEDOS
106   #define MULTITASKER_desqview    MULTITASKER_DESQVIEW
107   #define MULTITASKER_topview     MULTITASKER_TOPVIEW
108   #define MULTITASKER_mlink       MULTITASKER_MLINK
109   #define MULTITASKER_mswindows   MULTITASKER_MSWINDOWS
110   #define MULTITASKER_os2         MULTITASKER_OS2
111   #define MULTITASKER_pcmos       MULTITASKER_PCMOS
112   #define MULTITASKER_nt          MULTITASKER_NT
113 
114 
115 
116 
117   /* Special values for the character set byte */
118 
119   #define CHARSET_SWEDISH   0x01
120   #define CHARSET_CHINESE   0x02
121 
122   #define XTERNEXIT       0x40      /* If external protocl has erlvl exit */
123   #define XTERNBATCH      0x80      /* If protocol can do batch transfers */
124 
125   #define NLVER_5         5
126   #define NLVER_6         6
127   #define NLVER_7         7
128   #define NLVER_FD       32
129 
130   /* OBSOLETE!  Only used for compatibility purposes */
131 
132   struct   cl_rec
133   {
134     sword    priv;
135     word     max_time;      /* max cume time per day         */
136     word     max_call;      /* max time for one call         */
137     word     max_dl;        /* max dl kbytes per day         */
138     word     ratio;         /* ul:dl ratio                   */
139     word     min_baud;      /* speed needed for logon        */
140     word     min_file_baud; /* speed needed for file xfer    */
141   };
142 
143 #endif /* !__PRM_H_DEFINED */
144 
145 /* Note: To read in the *.PRM structure, first read in the m_pointers       *
146  * structure, which is always contained at the beginning of the file.       *
147  * Then, seek to the offset prm.heap_offset, and read in everything         *
148  * from there to EOF into heap[].  All of the 'OFS' type variables          *
149  * are simply offsets into the variable-length heap which started at        *
150  * heap_offset. To obtain a string from the .PRM heap, simply               *
151  * add the offset in the m_pointers structure to the address of the         *
152  * heap[] variable that the heap was read into.  For example, to access     *
153  * the string for 'system_name', you'd use '(heap+prm.system_name)'.        *
154  * Alternatively, you can declare a macro to do this, such as the           *
155  * PRM() macro shown above.  (Maximus itself uses the variable              *
156  * 'strings' instead of 'heap' to hold the varible-length strings,          *
157  * but the concept is the same.)  When using the PRM() macro to             *
158  * access the string for 'system_name', you'd simply write:                 *
159  * 'PRM(system_name)', which is a lot clearer.  Also, please note that      *
160  * NON-OFS variables should be accessed normally!  That means that          *
161  * 'task_num', 'auto_kill', can be access with 'prm.task_num',              *
162  * 'prm.auto_kill', etc.  The special heap manipulation is only needed      *
163  * for strings.                                                             */
164 
165 #ifdef FORCE
166 struct mfpointers
167 #else
168 struct m_pointers
169 #endif
170 {
171 
172         /*-----------------------------------------------------------*/
173         /* DATA                                                      */
174         /*-----------------------------------------------------------*/
175 
176   byte  id;             /* Always equal to 'M'               STABLE  */
177   byte  version;        /* for safety                        STABLE  */
178   word  heap_offset;    /* OFFSET OF BEGINNING OF HEAP!      STABLE  */
179   byte  task_num;       /* for multi-tasking systems         STABLE  */
180   sword com_port;       /* Com1=0, Com2=1, etc               STABLE  */
181   byte  noise_ok;       /* If yell noise is currently on     STABLE  */
182 
183   /* Miscellanious system information */
184 
185   byte  video;          /* Mode for local video display              */
186   byte  log_mode;       /* What style of logging to use              */
187   word  max_baud;    /* fastest speed we can use                  */
188   sbyte multitasker;    /* flag for DoubleDos (see below)            */
189   byte  nlver;          /* Which nodelist version we use (NLVER_XXX) */
190 
191   sword min_ulist;      /* OBSOLETE!  Only used for compatibility    */
192   sword max_ulist;      /* with Maximus 2.x!                         */
193 
194   /* Information about errorlevels */
195 
196   byte  exit_val;       /* Erl to use after caller if none of below  */
197   byte  edit_exit;      /* erl to use after matrix mail written      */
198   byte  echo_exit;      /* ERRORLEVEL for after inbound echomail     */
199   byte  local_exit;     /* Errorlevel after entering local msgs      */
200 
201   /* Modem information */
202 
203   sword carrier_mask;
204   sword handshake_mask;
205 
206   /* Log-on information */
207 
208   word logon_priv;      /* Access level for new users                */
209   word  logon_time;     /* time to give for logons                   */
210   word  min_baud;    /* minimum baud to get on-line               */
211   word  speed_graphics; /* min baud for graphics                  */
212 
213   /* Information about message areas */
214 
215   byte  auto_kill;      /* RECD PVT msgs. 0=no 1=ask 2=yes            */
216 
217   word ctla_priv;       /* Priv to see CONTROL-A lines in messages    */
218   word seenby_priv;     /* Min priv to see SEEN-BY line               */
219   word pvt_priv;        /* Min priv to read pvt msgs                  */
220 
221   word msg_ask[16];     /* Array of privs. for message attr ask's     */
222   word msg_assume[16];  /* Array of privs. for message attr assume's  */
223   word  msg_fromfile;   /* Priv. for doing message from file          */
224   word  speed_rip;      /* min baud for rip graphics                  */
225   byte  rsvd1[2];       /* used to be high_msgarea, begin_msgarea     */
226   word unlisted_priv;   /* Priv needed to send to unlisted node       */
227   sword unlisted_cost;  /* Charge to send to unlisted node            */
228 
229   word mc_reply_priv;   /* Priv to reply to msg with mailchecker     */
230   word mc_kill_priv;    /* Priv to kill msg with mailchecker         */
231 
232 
233   /* Information about file areas */
234 
235   sword date_style;     /* Used for FILES.BBS display                */
236   word rsvd20;          /* Reserved (used to be dlall_priv)          */
237   word rsvd21;          /* Reserved (used to be ulbbs_priv)          */
238   dword k_free;         /* The number of disk space (in K) which     *
239                          * must be available before we let a user    *
240                          * upload.                                   */
241   word  rsvd7;          /* reserved - used to be upload reward       */
242   word  ratio_threshold;/* OBSOLETE!  Only used for Max 2.x compat.  */
243   byte  rsvd2[4];       /* used to be high_filearea, begin_filearea  */
244 
245   /* Our matrix address(es) */
246 
247   NETADDR address[ALIAS_CNT];
248 
249 
250   /*  struct _yell yell[MAX_YELL]; */  /* Yell info moved to event file */
251   byte rsvd3[60]; /* Reserved by Maximus for future use */
252 
253 
254   /* About the users */
255   struct cl_rec cls[MAXCLASS];  /* OBSOLETE!  Only used for compatibility */
256                                 /* with Maximus 2.x.                      */
257 
258   /* Flags for external protocols */
259 
260   sword protoexit;              /* Errorlevel for protocol exit      */
261   char  protoflag[MAX_EXTERNP];
262 
263   /* General-purpose bit-flags  (See FLAGx_xxx definitions above.) */
264 
265   word  flags;
266   word  flags2;
267   word  flags3;
268   word  flags4;
269 
270   /* Bit field containing drive letters to save when going outside */
271   char  drives_to_save[(MAX_DRIVES/CHAR_BITS)+1];
272 
273   byte  fbbs_margin;      /* Margin to use for wrapping FILES.BBS comments */
274   byte  kill_attach;      /* Kill file attaches 0=no 1=ask 2=yes           */
275 
276   word  max_ptrs;         /* Maximum size of pointers of ALL *.LTFs */
277   word  max_heap;         /* Maximus heap size of all *.LTFs */
278   byte  max_lang;         /* Current number of languages */
279   byte  rsvd_lang;
280 
281   word  max_glh_ptrs;
282   word  max_glh_len;
283 
284   word  max_syh_ptrs;
285   word  max_syh_len;
286 
287   byte  input_timeout;   /* # of mins until Max hangs up due to no input    */
288 
289   byte  charset;         /* Character set support - see CHARSET_XXXX, above */
290   word  max_pack;        /* Maximum # of msgs to pack into a .QWK packet    */
291   word  msg_localattach; /* Priv. for doing local file attaches             */
292   word  kill_attach_priv;/* Priv. for killing local file attaches           */
293   word  mcp_sessions;    /* Max number of MCP sessions                      */
294   dword max_msgsize;     /* Truncate uploaded messages to this size         */
295 
296   byte  rsvd65[2];       /* Reserved by Maximus for future use              */
297 
298 
299 
300   /* --------------------------------------------------------------- */
301   /* -------------------------- OFFSETS ---------------------------- */
302   /* --------------------------------------------------------------- */
303 
304   /* About your system */
305 
306 #define PRM_HEAP_START sysop
307 
308   OFS   sysop;          /* sysop's name. MUST be first offset in prm file */
309   OFS   system_name;    /* board's name                              */
310 
311   /* Modem commands */
312 
313   OFS   m_busy;         /* mdm cmd to take modem off hook            */
314 
315   /* Paths to various places */
316 
317   OFS   sys_path;       /* path to SYSTEM?.BBS files                 */
318   OFS   misc_path;      /* path to `F-key files'                     */
319   OFS   net_info;       /* path to NODELIST files                    */
320   OFS   temppath;       /* place to put temporary files              */
321   OFS   ipc_path;       /* path for inter-process communications     */
322 
323   /* General files needed by the system */
324 
325   OFS   user_file;      /* path/filename of User.Bbs                 */
326   OFS   log_name;       /* name of the log file                      */
327   OFS   chat_prog;      /* External chat program, if any             */
328   OFS   chat_fbegin;    /* File to display instead of "CHAT: begin"  */
329   OFS   chat_fend;      /* File to display instead of "END CHAT"     */
330   OFS   local_editor;   /* Command for local editor, if any          */
331   OFS   notfound;       /* User name not found in user file          */
332   OFS   junk;           /* Don't use this for anything!              */
333 
334   /* General *.?BS files needed everywhere */
335 
336   OFS   logo;           /* first file shown to a caller              */
337   OFS   bad_logon;      /* if user's last logon attempt was bad      */
338   OFS   welcome;        /* shown after logon                         */
339   OFS   quote;          /* For displaying "random" quotes from       */
340   OFS   newuser1;       /* Asks user to type in password             */
341   OFS   newuser2;       /* Replaces `welcome' for a new user         */
342   OFS   rookie;         /* Replaces `welcome' for rookies            */
343   OFS   application;    /* new user questionnaire                    */
344   OFS   byebye;         /* file displayed at logoff                  */
345   OFS   out_leaving;    /* Bon Voyage                                */
346   OFS   out_return;     /* Welcome back from O)utside                */
347   OFS   daylimit;       /* Sorry, you've been on too long...         */
348   OFS   timewarn;       /* warning about forced hangup               */
349   OFS   tooslow;        /* explains minimum logon baud rate          */
350   OFS   barricade;      /* Displayed before prompt for access code   */
351   OFS   shelltodos;     /* Displayed when Sysop hits Alt-J           */
352   OFS   backfromdos;    /* Displayed when Sysop returns from Alt-J   */
353   OFS   areanotexist;   /* File to display instead of "That area     *
354                          * doesn't exist!"                           */
355 
356   /* User priv levels database */
357 
358   OFS   access;         /* Database of user privilege levels         */
359 
360   /* File-area items */
361 
362   OFS   xferbaud;       /* explains minimum file transfer baud rate  */
363   OFS   file_area_list; /* dump file... used instead of Dir.Bbs      */
364   OFS   no_space;       /* File to display if trying to UL with      *
365                          * less than k_free space left on drive.     */
366   OFS   fname_format;   /* Essay on MS-DOS filenames for U)ploads    */
367   OFS   ul_log;         /* Log file for uploads                      */
368 
369   OFS   file_header;    /* Format for file area's A)rea command      */
370   OFS   file_format;    /* Format for A)rea command entries          */
371   OFS   file_footer;    /* Format for footer for file.area menu      */
372 
373   OFS   proto_dump;      /* Dump file for protocol screen            */
374 
375   /* Message-area items */
376 
377   OFS   msgarea_list;   /* dump file... used instead of Dir.Bbs      */
378   OFS   echotoss_name;  /* Name of your echomail tosslog             */
379   OFS   nomail;         /* Display by mailchecker if no mail wtng.   */
380 
381   OFS   msg_header;     /* Format for msg.area's A)rea command       */
382   OFS   msg_format;     /* Format for A)reas command entries         */
383   OFS   msg_footer;     /* Format for footer for msg.area menu       */
384 
385   /* Help files:  Used to explain various things */
386 
387   OFS   hlp_editor;     /* intro to msg editor for novices.          */
388   OFS   hlp_replace;    /* Explain the Msg.Editor E)dit command      */
389   OFS   msg_inquire;    /* Explain the Msg. I)nquire command         */
390   OFS   hlp_locate;     /* Explain the Files L)ocate command         */
391   OFS   hlp_contents;   /* Explain the Files C)ontents command       */
392   OFS   oped_help;      /* help file for the full-screen editor      */
393   OFS   hlp_scan;       /* help file for S)can                       */
394   OFS   hlp_list;       /* help file for L)ist                       */
395 
396   /* External protocols */
397 
398   OFS   protocols[MAX_EXTERNP]; /* external file protocol programs   */
399   OFS   protoname[MAX_EXTERNP]; /* name of protocol, on menu         */
400 
401   /* Date/Time format strings */
402 
403   OFS   timeformat;
404   OFS   dateformat;
405 
406   /* **OBSOLETE** names of the old Max 2.x area.dat/idx files */
407 
408   OFS   adat_name;
409   OFS   aidx_name;
410 
411   /* Menu paths/names */
412 
413   OFS   menupath;        /* The default place to look for the menus */
414   OFS   first_menu;      /* The name of the first menu to display */
415   OFS   edit_menu;       /* Name of the EDIT menu */
416 
417   /* Miscellaneous */
418 
419   OFS   achg_keys;       /* Characters used to change area -/+ */
420   OFS   tune_file;       /* Path to TUNES.MAX */
421   OFS   lang_path;       /* Path to *.LTF files */
422 
423   OFS   lang_file[MAX_LANG]; /* Array of all *.LTF names */
424 
425   OFS   m_init;          /* Modem initialization string */
426   OFS   m_ring;          /* Command modem sends when phone ringing */
427   OFS   m_answer;        /* Cmd to send to modem when ring detect */
428   OFS   m_connect;       /* Connect string, as returned by modem */
429 
430   OFS   high_msgarea;
431   OFS   begin_msgarea;  /* Msg area to put new users in              */
432 
433   OFS   high_filearea;
434   OFS   begin_filearea; /* File area to put new users in             */
435 
436   OFS   fidouser;       /* Name of FIDOUSER.LST file to use          */
437   OFS   cmtarea;        /* Message area to put comments in           */
438 
439   OFS   arc_ctl;        /* Control file for archiving programs       */
440   OFS   olr_name;       /* OLR: Filename to use for DL packets       */
441   OFS   olr_dir;        /* OLR: Directory for off-line stuff         */
442   OFS   phone_num;
443   OFS   viruschk;       /* Name of batch file to call for virus check*/
444   OFS   protocol_max;   /* Name of compiled protocol data file       */
445   OFS   track_privview; /* Priv req'd to see tracking info owned by others */
446   OFS   track_privmod;  /* Priv req'd to modify track info owned by others */
447   OFS   track_base;     /* Base name of the tracking database files  */
448   OFS   track_exclude;  /* File containing list of names to exclude  */
449   OFS   stagepath;      /* Path for staged CD-ROM transfers          */
450   OFS   attach_base;    /* Base name of the local attach database    */
451   OFS   attach_path;    /* Default path for local file attaches      */
452   OFS   attach_archiver;/* File attach archiver                      */
453   OFS   inbound_files;  /* Inbound FTS-1 attaches for users          */
454   OFS   rippath;        /* Default icon & RIP screens path           */
455 
456   /* More help files */
457 
458   OFS   hlp_hdrentry;   /* Help screen for message header entry      */
459   OFS   hlp_msgentry;   /* Help screen for start of message entry    */
460   OFS   not_configured; /* Displayed if user is not configured       */
461 
462   /* MCP stuff */
463 
464   OFS   mcp_pipe;       /* Default MCP pipe                          */
465 
466   /* Paths to the new marea/farea message/file data files */
467 
468   OFS   marea_name;     /* Name of message area data file            */
469   OFS   farea_name;     /* Name of file area data file               */
470 
471   /* Caller information log */
472 
473   OFS   caller_log;     /* Caller information log                    */
474 
475 #define PRM_HEAP_END caller_log
476 };
477 
478 #define __PRM_H_DEFINED
479 #endif
480 
481