1 //  This may look like C code, but it is really -*- C++ -*-
2 
3 //  ------------------------------------------------------------------
4 //  The Goldware Library
5 //  Copyright (C) 1990-1999 Odinn Sorensen
6 //  ------------------------------------------------------------------
7 //  This library is free software; you can redistribute it and/or
8 //  modify it under the terms of the GNU Library General Public
9 //  License as published by the Free Software Foundation; either
10 //  version 2 of the License, or (at your option) any later version.
11 //
12 //  This library is distributed in the hope that it will be useful,
13 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 //  Library General Public License for more details.
16 //
17 //  You should have received a copy of the GNU Library General Public
18 //  License along with this program; if not, write to the Free
19 //  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 //  MA 02111-1307, USA
21 //  ------------------------------------------------------------------
22 //  $Id: gs_opus.h,v 1.5 2005/10/23 04:39:24 ssianky Exp $
23 //  ------------------------------------------------------------------
24 
25 #if defined(GOLD_CANPACK)
26 #pragma pack(1)
27 #endif
28 
29 //  ------------------------------------------------------------------
30 
31 /////////////////////////////////////////////////////////////////////////////
32 //
33 //
34 //    OPUS 1.1x
35 //
36 //
37 /////////////////////////////////////////////////////////////////////////////
38 
39 
40 /*-------------------------------------------------------------------------*/
41 /* System*.DAT structure                                                   */
42 /*-------------------------------------------------------------------------*/
43 
44 typedef struct {
45   /*........ Common System Data ....................................*/
46 
47   word  version;          /* System Record version = 110 = v1.10    */
48   word  menu;             /* Alternate Menu file extension, 0=MNU   */
49   word  attrib;           /* Area attributes (see below)            */
50   byte  fillc1[10];       /* Fill to 16th                           */
51   byte  barrpath[ 40 ];   /* Barricade File path.                   */
52   byte  fillc2[24];       /* Fill to 16th                           */
53 
54   /*........ File System Information ...............................*/
55 
56   char  filtitle[50];     /* File Area Title (as per old Dir.Bbs)   */
57   char  filepath[40];     /* Path to the file download sub-dir      */
58   char  uppath[40];       /* Path to the file upload sub-directory  */
59   char  listpath[40];     /* Path to FILES.BBS equivilent           */
60   byte  fillf1[22];       /* Fill to 16th                           */
61 
62   byte  FilePriv;         /* Min priv for file area                 */
63   byte  DownPriv;         /* Override priv to download              */
64   byte  UpPriv;           /* Override priv to upload                */
65   byte  FileExtPriv;      /* Override priv for outside              */
66   byte  fillf2[12];       /* Fill to 16th                           */
67 
68   long  FileLock;         /* Locks for File Area                    */
69   long  DownLock;         /* Override Locks to download             */
70   long  UpLock;           /* Override Locks to upload               */
71   long  FileExtLock;      /* Override Locks for Outside             */
72   byte  fillf3[32];       /* Fill to 16th                           */
73 
74   /*........ Message System Information ............................*/
75 
76   char  msgtitle[50];     /* Msg  Area Title (as per old Dir.Bbs)   */
77   char  msgpath[40];      /* Path to messages                       */
78   byte  fillm1[22];       /* Fill to 16th                           */
79 
80   byte  MsgPriv;          /* Min priv for msg area                  */
81   byte  EditPriv;         /* Override priv for Enter/Rep            */
82   byte  MsgExtPriv;       /* Override priv fot outside              */
83   byte  fillm2[13];       /* Fill to 16th                           */
84 
85   long  MsgLock;          /* Locks for Msg Area                     */
86   long  EditLock;         /* Override Locks for Enter/Rep           */
87   long  MsgExtLock;       /* Override Locks for Outside             */
88   byte  fillm3[4];        /* Fill to 16th                           */
89   char  EchoName[32];     /* If an echo area, its name              */
90 
91   /*=================================== Total Record Size   = 512 ==*/
92 } _systemdat;
93 
94 
95 
96 
97 //////////////////////////////////////////////////////////////////////////////
98 //
99 //
100 //    OPUS 1.7x
101 //
102 //
103 //////////////////////////////////////////////////////////////////////////////
104 
105 
106 // INCLUDE OPUS.H ////////////////////////////////////////////////////////////
107 
108 /*--------------------------------------------------------------------------*/
109 /*                                                                          */
110 /*               The Opus Computer-Based Conversation System                */
111 /*    (c) Copyright 1986-1991, Wynn Wagner III, All Rights Reserved         */
112 /*                                                                          */
113 /*                                                                          */
114 /*                   YOOHOO is a trademark of Wynn Wagner III               */
115 /*                                                                          */
116 /*                        YOOHOO-YOOHOO/2U2 & WaZOO are                     */
117 /*           Copyright 1987, Wynn Wagner III, All Rights Reserved           */
118 /*                                                                          */
119 /*                                                                          */
120 /* This material is available for use by anybody with no strings and        */
121 /* no guarantees.                                                           */
122 /*                                                                          */
123 /*                                                                          */
124 /*--------------------------------------------------------------------------*/
125 
126 
127 /*--------------------------------------------------------------------------*/
128 /* LEGIBLE SECTION.  Definitions to make "C" look like a real language.     */
129 /*--------------------------------------------------------------------------*/
130 #undef log
131 
132 #ifndef begin
133 # define begin        {
134 # define end          }
135 #endif
136 
137 
138 
139 /*--------------------------------------------------------------------------*/
140 /* TIME STAMP                                                               */
141 /*--------------------------------------------------------------------------*/
142 struct _stamp
143    begin
144       uint16_t date;
145       uint16_t time;
146    end;
147 
148 
149 /*--------------------------------------------------------------------------*/
150 /* FIDONET ADDRESS STRUCTURE                                                */
151 /*--------------------------------------------------------------------------*/
152 typedef struct _ADDRESS
153    begin
154       short   Zone;
155       short   Net;
156       short   Node;
157       short   Point;
158    end ADDR;
159 
160 
161 
162 
163 
164 /*--------------------------------------------------------------------------*/
165 /* NodeList.Sys                                                             */
166 /*                                                                          */
167 /*    NET > 0 and NODE > 0    Normal node                                   */
168 /*                                                                          */
169 /*    NET > 0 and NODE <= 0   Host node                                     */
170 /*                               Net host........node== 0                   */
171 /*                               Regional host...node==-1                   */
172 /*                               Country host....node==-2                   */
173 /*                                                                          */
174 /*    NET == -1      Nodelist.Sys revision                                  */
175 /*                                                                          */
176 /*    NET == -2      Nodelist statement                                     */
177 /*                                                                          */
178 /*--------------------------------------------------------------------------*/
179 
180 /*--------------------------------------------------------------------------*/
181 /* THE NEWSTYLE NODE LIST                                                   */
182 /*--------------------------------------------------------------------------*/
183   struct _node
184      begin
185         short  NetNumber;
186         short  NodeNumber;
187         word MsgFee;           /* Amount charged to user for a message */
188         byte SystemName[34];   /* node name */
189         byte PhoneNumber[40];  /* phone number */
190         byte MiscInfo[30];     /* city and state */
191         byte Password[8];      /* WARNING: not necessarily null-terminated */
192         word CallCost;         /* phone company's charge */
193         word HubNode;          /* node # of this node's hub or 0 if none */
194         byte BaudRate;         /* baud rate divided by 300 */
195         byte ModemType;        /* RESERVED for modem type */
196         word NodeFlags;        /* set of flags (see below) */
197         word NodeFiller;
198      end;
199 
200 
201 #define B_hub    0x0001  /* node is a net hub     0000 0000 0000 0001 */
202 #define B_host   0x0002  /* node is a net host    0000 0000 0000 0010 */
203 #define B_region 0x0004  /* node is region coord  0000 0000 0000 0100 */
204 #define B_zone   0x0008  /* is a zone gateway     0000 0000 0000 1000 */
205 #define B_CM     0x0010  /* runs continuous mail  0000 0000 0001 0000 */
206 #define B_res1   0x0020  /* reserved by Opus      0000 0000 0010 0000 */
207 #define B_res2   0x0040  /* reserved by Opus      0000 0000 0100 0000 */
208 #define B_res3   0x0080  /* reserved by Opus      0000 0000 1000 0000 */
209 #define B_res4   0x0100  /* reserved by Opus      0000 0001 0000 0000 */
210 #define B_res5   0x0200  /* reserved for non-Opus 0000 0010 0000 0000 */
211 #define B_res6   0x0400  /* reserved for non-Opus 0000 0100 0000 0000 */
212 #define B_res7   0x0800  /* reserved for non-Opus 0000 1000 0000 0000 */
213 #define B_point  0x1000  /* node is a point       0001 0000 0000 0000 */
214 #define B_res9   0x2000  /* reserved for non-Opus 0010 0000 0000 0000 */
215 #define B_resa   0x4000  /* reserved for non-Opus 0100 0000 0000 0000 */
216 #define B_resb   0x8000  /* reserved for non-Opus 1000 0000 0000 0000 */
217 
218 
219 
220 /*--------------------------------------------------------------------------*/
221 /* Nodelist.Idx                                                             */
222 /* (File is terminated by EOF)                                              */
223 /*--------------------------------------------------------------------------*/
224 struct _ndi
225    begin
226       short   node;          /* node number  */
227       short   net;           /* net number   */
228    end;
229 
230 #define MAXEXPAND 30          /* max download files (wildcard expansion)    */
231 #define CMDLEN    80          /* size of the command typeahead buffer       */
232 #define CARRYLEN  20          /* LORE editor's carry buffer                 */
233 #define MAXLEN    85          /* size of primary line-input buffer          */
234 
235 
236 
237 /*--------------------------------------------------------------------------*/
238 /* OPUS CONTROL FILE and PARM FILE DECLARATIONS                             */
239 /*--------------------------------------------------------------------------*/
240 //#include "prm18.h"
241 // SUB-INCLUDE PRM18.H ///////////////////////////////////////////////////////////
242 
243 /*--------------------------------------------------------------------------*/
244 /*                                                                          */
245 /*               The Opus Computer-Based Conversation System                */
246 /*    (c) Copyright 1986-1991, Wynn Wagner III, All Rights Reserved         */
247 /*                                                                          */
248 /*                                                                          */
249 /*                   YOOHOO is a trademark of Wynn Wagner III               */
250 /*                                                                          */
251 /*                        YOOHOO-YOOHOO/2U2 & WaZOO are                     */
252 /*           Copyright 1987, Wynn Wagner III, All Rights Reserved           */
253 /*                                                                          */
254 /*                                                                          */
255 /* This material is available for use by anybody with no strings and        */
256 /* no guarantees.                                                           */
257 /*                                                                          */
258 /*                                                                          */
259 /*--------------------------------------------------------------------------*/
260 /*                                                                          */
261 /* OPUS 1.20 Message/File area database structures.                         */
262 /* Copyright 1991 Wynn Wagner III, Doug Boone and John Valentyn.            */
263 /*                                                                          */
264 /*--------------------------------------------------------------------------*/
265 
266 #define  THIS_CTL_VERSION  18       /* PRM structure version number         */
267 
268 #if      COMPILER
269 #           define CTLSIZE 0x7fff   /* Only used when compiling OPUS_CTL    */
270 #           define OFS     short
271 #elif    UTILS
272 #           define CTLSIZE 1   /* Only used when compiling Utilities*/
273 #           define OFS     short
274 #else
275 #           define CTLSIZE 1
276 #           define OFS     char*
277 #endif
278 
279 
280 #define  MAX_EXTERN        16       /* max. number of external programs     */
281 #define  MAXCLASS          12       /* number of possible priv levels       */
282 #define  ALIAS_CNT         15       /* number of matrix addresses           */
283 
284 #define  _TWIT             0x10
285 #define  _DISGRACE         0x30
286 #define  _LIMITED          0x40
287 #define  _NORMALL          0x50
288 #define  _WORTHY           0x60
289 #define  _PRIVEL           0x70
290 #define  _FAVORED          0x80
291 #define  _EXTRA            0x90
292 #define  _CLERK            0xA0
293 #define  _ASSTSYSOP        0xB0
294 #define  _SYSOP            0xD0
295 #define  _HIDDEN           0xE0
296 
297 #define  Twit              _TWIT
298 #define  Disgrace          _DISGRACE
299 #define  Limited           _LIMITED
300 #define  Normal            _NORMALL
301 #define  Worthy            _WORTHY
302 #define  Privil            _PRIVEL
303 #define  Favored           _FAVORED
304 #define  Extra             _EXTRA
305 #define  Clerk             _CLERK
306 #define  AsstSysop         _ASSTSYSOP
307 #define  Sysop             _SYSOP
308 #define  Hidden            _HIDDEN
309 
310 
311 
312 struct   class_rec
313    begin
314       byte  ClassPriv;
315       byte  class_fill;
316       short   max_time;      /* max cume time per day         */
317       short   max_call;      /* max time for one call         */
318       word  max_dl;        /* max dl bytes per day          */
319       byte  ratio_down;
320       byte  ratio_up;
321       word  min_baud;      /* speed needed for logon        */
322       word  min_file_baud; /* speed needed for file xfer    */
323    end;
324 
325 struct _FOSREGS
326    begin
327       word  ax;
328       word  bx;
329       word  cx;
330       word  dx;
331    end;
332 
333 
334 /*--------------------------------------------------------------------------*/
335 /* The format of the PRM file, VERSION 18                                   */
336 /*                                                                          */
337 /* THIS IS AN EXPLOSIVE STRUCTURE.  IT IS SUBJECT TO CHANGE WITH NO NOTICE. */
338 /*                                                                          */
339 /* Offsets to the following item(s) are guaranteed:                         */
340 /*                                                                          */
341 /*      byte   version;           OFFSET 0, all versions                    */
342 /*      byte   task_num;          OFFSET 1, 16+                             */
343 /*                                                                          */
344 /*--------------------------------------------------------------------------*/
345 struct _PRM
346    begin
347                /*-----------------------------------------------------------*/
348                /* DATA                                                      */
349                /*-----------------------------------------------------------*/
350          byte  version;        /* for safety                          STABLE*/
351          byte  task_num;       /* for multi-tasking systems           STABLE*/
352          ADDR  alias[ALIAS_CNT];
353 
354          byte  video;          /* 0=Dos, 1=Fossil 2=IBM                     */
355          byte  testmode;       /* input from keyboard, not modem            */
356 
357          word  carrier_mask;
358          word  handshake_mask;
359          word  max_baud;       /* fastest speed we can use                  */
360          word  com_port;       /* Com1=0, Com2=1, FF=keyboard               */
361 
362          byte  multitasker;    /* flag for DoubleDos (see below)            */
363          byte  mailer_type;    /* 0=Opus, 1=load external, 2=call external  */
364 
365          byte  ModemFlag;      /* (See MODEM FLAG below)                    */
366          byte  LogFlag;        /* (See LOG FLAG below)                      */
367 
368          byte  StyleFlag;      /* (See STYLE FLAG below)                    */
369          byte  FWDflag;        /* Bits to control IN TRANSIT messages       */
370 
371          byte  flags;          /* See "FLAGS" below                         */
372          byte  Flags2;         /* See "FLAGS 2" below                       */
373 
374          byte  edit_exit;      /* ERRORLEVEL to use if Matrix area changed  */
375          byte  exit_val;       /* ERRORLEVEL to use after caller            */
376 
377          byte  crashexit;      /* non-zero= ErrorLevel exit                 */
378          byte  arc_exit;       /* ErrorLevel for after incomming ARCmail    */
379 
380          byte  echo_exit;      /* ERRORLEVEL for after inbound echomail     */
381          byte  UDB_Flags;      /* User data base flags                      */
382 
383          word  min_baud;       /* minimum baud to get on-line               */
384          word  color_baud;     /* min baud for graphics                     */
385          word  date_style;     /* Used for FILES.BBS display                */
386 
387          byte  logon_priv;     /* Access level for new users                */
388          byte  seenby_priv;    /* Min priv to see SEEN_BY line              */
389 
390          byte  ctla_priv;      /* Priv to see CONTROL-A lines in messages   */
391          byte  Interline_Flags;  /* Flags relating to interline systems     */
392 
393          byte  AskPrivs[16];   /* Array of privs. for message attr ask's    */
394          byte  AssumePrivs[16];/* Array of privs. for message attr assume's */
395 
396          word  logon_time;     /* time to give for logons                   */
397 
398          word  matrix_mask;
399 
400          word  MinNetBaud;     /* minimum baud rate for remote netmail      */
401          byte   exit_mailer;        /* Exit when mailer is running        */
402          byte   num_crashes;        /* Number of tries when sending crash */
403 
404          struct class_rec Class[MAXCLASS];
405          struct _FOSREGS FosRegs[10];
406 
407          word  F_Reward;       /* File upload time reward percentage        */
408          word  last_area;      /* Highest msg area presumed to exist        */
409          word  last_farea;     /* Highest file area presumed to exist       */
410 
411          byte  return_secure;  /* 0=ignore LASTUSER, >1 re-read LASTUSER    */
412 
413        /*  New for Version 17 */
414 
415          byte xuflags;         /* ExtUser Flags: 1=Alias, 2=UserTel         */
416          word xlmin;           /* Lead mins for expiry warning              */
417          char xlday;           /* Lead days for expiry warning              */
418          byte expriv;          /* Expiry privilege                          */
419          char totlang;         /* Total languages present (1-6)             */
420          byte sylno;           /* Def Sysop Language no.  (0-5)             */
421          byte uslno;           /* Def User Language no.   (0-5)             */
422          byte relog_exit;      /* Exit after -o relog                       */
423          word Scrn_Size;        /* Local monitor's size, high byte = len    */
424 
425 /* New for version 18 */
426 
427          word default_expire_days;      /* Number of days before new users  */
428          word default_expire_mins;      /* Number of days before new users  */
429          long default_keys;     /* New user's default keys                  */
430          long default_section;  /* New user's default section               */
431          word   Point_Net;      /* My point net                             */
432          word   Boss_Node;      /* My point net                             */
433          byte   NoPwd_Priv;     /* Priv if you want to allow users without password */
434          byte   Local_Exit;     /* Exit after local messages                */
435          byte   Upload_Exit;        /* Exit after an upload for checking  */
436          byte   ExtMail_Exit;       /* Exit for externmail                */
437          byte   Max_Echo;       /* Longest echomail message to handle 3-60k */
438          byte   WhoPriv;        /* Priv to see who uploaded a file           */
439 
440          ADDR   GUUCP;      /* Where to send gated UUCP messages             */
441          long   making_section;
442          byte   ListSysop;      /* Privilege neeeded to see sysops in net list */
443          byte   rawpriv;        /* Privilege needed to see/download files not listed */
444          byte   uucp_priv;      /* Privilege needed to turn off uucp addresses */
445          byte   Flags3;     /* More flags.                               */
446          byte   Mail_Exit;      /* Exit after mail connect                   */
447          byte   byte_fill;
448 
449          word   PRM_FILL3[18];
450 
451 
452                /*-----------------------------------------------------------*/
453                /* OFFSETS                                                   */
454                /*-----------------------------------------------------------*/
455 
456                                /*-------------------------------------------*/
457                                /* MODEM COMMAND STRINGS                     */
458                                /*-------------------------------------------*/
459          OFS   MDM_Init;       /* modem initialization string               */
460          OFS   MDM_PreDial;    /* modem dial command sent before number     */
461          OFS   MDM_PostDial;   /* modem command sent after dialed number    */
462          OFS   MDM_LookBusy;   /* mdm cmd to take modem off hook            */
463 
464                                /*-------------------------------------------*/
465                                /* PRIMROSE PATHS                            */
466                                /*-------------------------------------------*/
467          OFS   misc_path;      /* path to BBS/GBS files                     */
468          OFS   sys_path;       /* path to SYSTEM?.BBS files                 */
469          OFS   temppath;       /* place to put temporary files              */
470          OFS   net_info;       /* path to NODELIST files                    */
471          OFS   mailpath;       /* place to put received netmail bundles     */
472          OFS   filepath;       /* place to put received netmail files       */
473          OFS   hold_area;      /* path to pending outbound matrix traffic   */
474 
475                                /*-------------------------------------------*/
476                                /* DATA FILE NAMES                           */
477                                /*-------------------------------------------*/
478          OFS   user_file;      /* path/filename of User.Bbs                 */
479          OFS   sched_name;     /* name of file with _sched array            */
480          OFS   langdir;        /* Langauge file dir. (Was Syl in v16)       */
481          OFS   spcldir;        /* Spcl Ann Text dir. (Was Usl in v16)       */
482 
483                                /*-------------------------------------------*/
484                                /* MISCELLANEOUS TEXT                        */
485                                /*-------------------------------------------*/
486          OFS   system_name;    /* board's name                              */
487          OFS   sysop;          /* sysop's name                              */
488          OFS   timeformat;
489          OFS   dateformat;
490          OFS   OFS_Filler1[8];
491 
492                                /*-------------------------------------------*/
493                                /* BBS/GBS SUPPORT FILES                     */
494                                /*-------------------------------------------*/
495          OFS   logo;           /* first file shown to a caller              */
496          OFS   welcome;        /* shown after logon                         */
497          OFS   newuser1;
498          OFS   newuser2;
499          OFS   rookie;
500 
501          OFS   HLP_Editor;     /* Intro to msg editor for novices.          */
502          OFS   HLP_Replace;    /* Explain the Msg.Editor E)dit command      */
503          OFS   HLP_Inquire;    /* Explain the Msg. I)nquire command         */
504          OFS   HLP_Locate;     /* Explain the Files L)ocate command         */
505          OFS   HLP_Contents;   /* Explain the Files C)ontents command       */
506          OFS   HLP_OPed;       /* help file for the full-screen editor      */
507          OFS   OUT_Leaving;    /* Bon Voyage                                */
508          OFS   OUT_Return;     /* Welcome back from O)utside                */
509          OFS   ERR_DayLimit;   /* Sorry, you've been on too long...         */
510          OFS   ERR_TimeWarn;   /* warning about forced hangup               */
511          OFS   ERR_TooSlow;    /* explains minimum logon baud rate          */
512          OFS   ERR_XferBaud;   /* explains minimum file transfer baud rate  */
513          OFS   LIST_MsgAreas;  /* dump file... used instead of Dir.Bbs      */
514          OFS   LIST_FileAreas; /* dump file... used instead of Dir.Bbs      */
515 
516          OFS   FREQ_MyFiles;   /* file to send when FILES is file requested */
517          OFS   FREQ_OKList;    /* list of files approved for file requests  */
518          OFS   FREQ_About;     /* File Request: ABOUT file                  */
519 
520          OFS   OEC_Quotes;
521          OFS   byebye;         /* file displayed at logoff                  */
522          OFS   local_editor;   /* text editor to use in keyboard mode       */
523          OFS   barricade;
524          OFS   STATUS_dir;     /* Where to find INMAIL/ACTIVE/LASTUSER      */
525          OFS   mailer;         /* full external mailer command              */
526          OFS   common;         /* File with data common to all tasks        */
527 
528              /*  New for Version 17 */
529 
530          OFS   xdwarn;         /* Date Warning OEC BBS                      */
531          OFS   xtwarn;         /* Time Warning OEC BBS                      */
532          OFS   xdexpd;         /* Expired due-to-Date OEC BBS               */
533          OFS   xtexpd;         /* Expired due-to-Time used OEC BBS          */
534          OFS   lang[12];       /* 12 Language File Root Name pointers       */
535 
536          OFS   badpath;         /* Path for unrecognized echo names         */
537 /*--------------------------------------------------------------------------*/
538 /* New for version 18                                                       */
539 /*--------------------------------------------------------------------------*/
540          OFS   ConfHelp;        /* Help file for newuser configure          */
541          OFS   Mainmenu;        /* ASCII menu at MAIN                       */
542          OFS   Confmenu;        /* ASCII menu at Config                     */
543          OFS   Sectmenu;        /* ASCII menu at Section menu               */
544          OFS   Sysopmenu;       /* ASCII menu at Sysop menu                 */
545          OFS   Echotoss;       /* Where to find EchoToss.Log               */
546          OFS   MDM_Answer;     /* String to force autoanswer               */
547          OFS   BAD_PWD;     /* File shown to users who've forgottent thiers */
548          OFS   charset;         /* File that contains character translation tables */
549          OFS   DL_Log;          /* Who's downloaded what                    */
550          OFS   UL_Log;          /* Who uploaded what                        */
551          OFS   Name_Filter; /* Old USERNAME.TXT                         */
552          OFS   Bad_Name;        /* What to show user if filter catches them */
553          OFS   CUSTOM1_menu;    /* What to show before CUSTOM1 menu         */
554          OFS   CUSTOM2_menu;    /* What to show before CUSTOM2 menu         */
555          OFS   CUSTOM3_menu;    /* What to show before CUSTOM3 menu         */
556          OFS   CUSTOM4_menu;    /* What to show before CUSTOM4 menu         */
557          OFS   CUSTOM5_menu;    /* What to show before CUSTOM5 menu         */
558          OFS   CUSTOM6_menu;    /* What to show before CUSTOM6 menu         */
559          OFS   EXT_mail_string;     /* What we see when UUCP is coming    */
560          OFS   MaybeNew;        /* File shown if didn't find user name       */
561          OFS   Histmenu;        /* ASCII menu at History                     */
562          OFS   My_Question;     /* Sysop configured question             */
563          OFS   HLP_make;        /* How to make a section                     */
564          OFS   MDM_FDial[4];        /* Special dialing instructions          */
565          OFS   Yell;        /* Yell OEC                                      */
566          OFS   HLP_Macro;       /* Help for macro menu                       */
567          OFS   UUCP_list;       /* Address list for UUCP                     */
568          OFS   HLP_IChat;       /* Interline chat help                       */
569          OFS   protocols[MAX_EXTERN]; /* external file protocol programs    */
570 
571 /*v18*/  OFS   OFS_Filler[7];
572 
573                /*-----------------------------------------------------------*/
574                /* Log_Name must always be the last offset in this struct    */
575                /* because Bbs_Init uses that symbol to flag the end of      */
576                /* the offsets.                                              */
577                /*-----------------------------------------------------------*/
578          OFS   log_name;       /* name of the log file                      */
579 
580 
581                /*-----------------------------------------------------------*/
582                /* Big blob of stuff                                         */
583                /* It's a sequence of null-terminated character arrays...    */
584                /* pointed-to by the offsets (above).                        */
585                /*-----------------------------------------------------------*/
586          char  buf[CTLSIZE];
587    end;
588 
589 #define ASK_PHONE       0x01        /* Used with xuflags                  */
590 #define ASK_ALIAS       0x02        /* Used with xuflags                  */
591 #define ASK_REAL        0x04        /* Used with xuflags                  */
592 #define ASK_CITY        0x08        /* Used with xuflags                  */
593 #define CAN_ALIAS       0x10        /* Allow ALIAS' in some situations    */
594 #define ASK_BDAY        0x20        /* Ask user for birthday              */
595 #define ASK_ADDRESS     0x40        /* Ask user for street address        */
596 
597          /* Means no privilege level is set and/or applicable At LOGON,     */
598          /* for example, it means system is for PRE-REGISTERED users only.  */
599 #define  NO_PRIV  0xFF
600 
601 struct _common_data {
602 
603    char  Opus[16];        /* "OPUS-CBCS 1.20"                               */
604    long  QuotePosition;   /* Quote file position                            */
605    long  CallerCount;     /* Number of callers                              */
606    long  Caller_ID;       /* ID of current newest user                      */
607    long  MSG_ID;          /* Last used MSGID                                */
608    word  FILLER[15];      /* RESERVED - do not use                          */
609    word  MAX_task;        /* Highest task number                            */
610 };
611 
612 /* Explanation of _common_data:
613 
614    Opus will EXPECT to find "OPUS-CBCS 1.20" at the beginning of this file.
615    If it does not find it, Opus will assume the file belongs to someone
616    else and will ignore the file.
617 
618    File ctl.common is optional. It should be used only by systems that
619    multitask. Its purpose is to allow separate schedule files for each
620    task. If the file does not exist, Last quote pointer and Caller count
621    are read from and updated in the scheduler.
622 
623    On the other hand, if this file exists the quote pointer is only updated
624    in this file. Caller Count is updated separately both in the scheduler
625    and this file, to allow separate statistics for each task, plus total
626    statistics.
627 
628    MAX_task is informative only and should be set by the sysop. Its purpose
629    is to help external intertask programs figure out how many tasks there
630    exist. Its purpose is defeated if task numbers are not consecutive.
631 
632    More data may be added in the future. If so, either the FILLER field
633    will be used, or the data will be appended. Existing definitions will
634    remain it their respective places. Any FILLER bytes will be set to 0.
635                                                                             */
636 
637 
638 
639 /*--------------------------------------------------------------------------*/
640 /* MATRIX_CHANGED flags                                                     */
641 /*--------------------------------------------------------------------------*/
642 
643 #define     MATRIX_CHANGED  0x0001    /* Changed matrix area. Scan          */
644 #define     LOCAL_CHANGED   0x0002    /* Changed Local area.                */
645 #define     GOT_BUNDLE      0x0100      /* Received a PKT file              */
646 #define     GOT_ARCMAIL     0x0200      /* Received an archived file        */
647 #define     GOT_REQUESTS    0x0400      /* Got file requests to handle      */
648 #define     GOT_ECHOMAIL    0x1000      /* Received Echomail                */
649 
650 /*--------------------------------------------------------------------------*/
651 /* INTERLINE FLAGS                                                          */
652 /*--------------------------------------------------------------------------*/
653 #define     CAN_CHAT    0x01        /* Multiline systems can do chats     */
654 
655 // END OF SUB-INCLUDE PRM18.H ////////////////////////////////////////////////////
656 
657 
658 /*--------------------------------------------------------------------------*/
659 /* Multitaskers (possible values for `ctl.multitasker'                      */
660 /*              NOTE: 0 means no multitasker in use                         */
661 /*--------------------------------------------------------------------------*/
662 #define DoubleDOS 1
663 #define DesqView  2
664 #define TopView   3
665 #define TaskView  3
666 #define LAN       0x80
667 
668 /*--------------------------------------------------------------------------*/
669 /* Matrix mask                                                              */
670 /* Undefined bits are reserved by Opus  See EVENT.H                         */
671 /*--------------------------------------------------------------------------*/
672 
673 
674 /*--------------------------------------------------------------------------*/
675 /* FLAGS                                                                    */
676 /*--------------------------------------------------------------------------*/
677 #define LOGECHO    0x01    /* log echomail areas                  0000 0001 */
678 #define STEADY     0x02    /* never change baud rate              0000 0010 */
679 #define ECHOSCAN   0x04    /* automatically scan echo's           0000 0100 */
680 #define ECHO_GUARD 0x08    /* no toss un-pwd echo arc             0000 1000 */
681 #define LEAVE_ESCN 0x10    /* Leave echotoss.log after Scanning   0001 0000 */
682 #define DO_MSGID   0x20    /* Put MSGID lines into echomail       0010 0000 */
683 #define F_NOCRASH  0x40    /* Don't accept crash mail             0100 0000 */
684 #define F_UNPK     0x80    /* Unpack incomming arcmail            1000 0000 */
685 
686 
687 /*--------------------------------------------------------------------------*/
688 /* FLAGS 2                                                                  */
689 /*--------------------------------------------------------------------------*/
690 #define NO_USRLIST 0x01    /* no user list (enter msg)            0000 0001 */
691 #define WATCHDOG   0x02    /* Reboot during outside               0000 0010 */
692 #define F2_TOSS    0x04    /* Toss incomming echomail             0000 0100 */
693 #define F2_LASTREAD 0x08   /* Uses LASTREAD for Sysop             0000 1000 */
694 #define F2_DOSFILE 0x10    /* Close stdAUX and stdPRN             0001 0000 */
695 #define F2_PRIMARY 0x20    /* MultiTasker Primary task            0010 0000 */
696 #define F2_SECOND  0x40    /* MultiTasker Secondary task          0100 0000 */
697 #define F2_ECON    0x80    /* Econo Echo handling                 1000 0000 */
698 
699 
700 /*--------------------------------------------------------------------------*/
701 /* FLAGS 3                                                                  */
702 /*--------------------------------------------------------------------------*/
703 #define F3STEADY   0x01     /* Can do ARQ steady. &B2                    */
704 #define F3GMENU    0x02     /* Will let users do graphics menus          */
705 #define F3LOGOFF   0x04     /* Collect logoff messages                   */
706 #define F3NOALIAS  0x08     /* Don't put alias' in SEEN-BY               */
707 #define F3HINAMES  0x10     /* Allow users with hi-bit names             */
708 
709 /*--------------------------------------------------------------------------*/
710 /* FWDflags (bits to control IN TRANSIT messages)                           */
711 /*--------------------------------------------------------------------------*/
712 #define FWD_NONE   0x01    /* No IN TRANSIT netmail               0000 0001 */
713 #define FWD_PWD    0x02    /* IN TRANSIT by pwd only              0000 0010 */
714 #define FWD_TONET  0x04    /* Accept IN TRANSIT only to my net    0000 0100 */
715 #define FWD_NOBITS 0x08    /* No IN TRANSIT if extended bits used 0000 1000 */
716 #define FWD_HOST   0x10     /* Send mail to host if can't find.          */
717 #define VERSION6   0x40 /* Use Version 6 nodelist                        */
718 #define IMAPOINT   0x80 /* This is a point                              */
719 
720 /*--------------------------------------------------------------------------*/
721 /* LOG FLAGS                                                                */
722 /*--------------------------------------------------------------------------*/
723 #define LOG_TERSE  0x01    /* brief log                           0000 0001 */
724 #define LOG_wordY  0x02    /* wordy log                           0000 0010 */
725 #define LOG_TRACE  0x04    /* very wordy log                      0000 0100 */
726 
727 
728 /*--------------------------------------------------------------------------*/
729 /* MODEM FLAGS                                                              */
730 /*--------------------------------------------------------------------------*/
731 #define M_SNOOP    0x01    /* sysop display on                    0000 0001 */
732 #define MOUSE      0x02    /* sysop mouse on                      0000 0010 */
733 #define M_BRKCLEAR 0x04    /* Use BREAK to clear outbound buffer  0000 0100 */
734 #define SLOW_MODEM 0x08     /* Slow modem and fast computer                 */
735 
736 /*--------------------------------------------------------------------------*/
737 /* STYLE FLAGS                                                              */
738 /*--------------------------------------------------------------------------*/
739 #define SF_PATH    0x01    /* use path, not Dir.Bbs               0000 0001 */
740 #define SF_KILL    0x02    /* Kill rec'd pvt messages             0000 0010 */
741 #define SF_ASKKILL 0x04    /* ASK about killing msgs              0000 0100 */
742 #define SF_EUROPE  0x08     /* European date strings */
743 #define SF_TIME    0x10 /* Show time remaining on menu         0001 0000 */
744 #define SF_NOFLAG  0x20 /* Don't allow user config at logon    0010 0000 */
745 #define SF_HANDHOLD 0x40    /* Track user's errors and add help    0100 0000 */
746 #define SF_NOHIGH  0x80 /* Track user's errors and add help    0100 0000 */
747 
748 
749 #define SET_FLAG(x,y)    ((x)|=(y))
750 #define CLEAR_FLAG(x,y)  ((x)&=(~(y)))
751 #define isFLAG(x,y)      ((x)&(y))
752 
753 
754 
755 
756 
757 /*--------------------------------------------------------------------------*/
758 /* The rest of this file contains structure definitions similar to those    */
759 /* used by Fido<tm> version 11w.  No claim is made that Opus will maintain  */
760 /* compatibility with these structures beyond Opus version 0.               */
761 /*                                                                          */
762 /* The original version of the following items can be found in STRUCT.H, an */
763 /* include file writte (and probably copyrighted by) Tom Jennings.          */
764 /*--------------------------------------------------------------------------*/
765 
766 
767 
768 
769 /*--------------------------------------------------------------------------*/
770 /*   THE USER DATABASE                                                      */
771 /*--------------------------------------------------------------------------*/
772 
773 #define    MAX_USEC    80       /* Maximum number of areas in "user" section */
774 
775    struct   _usr
776    {
777       char name[36];       /* Caller's first and last names                 */
778       char city[36];       /* Caller's location                             */
779       char pwd[16];        /* Password                                      */
780       char usrtel[16];     /* User Tel# for ref or future callback .........*/
781       char alias[32];      /* User alias if ID is not it ...................*/
782 /* 136 bytes */
783       word times;          /* Number of previous calls to this system       */
784       byte ClassPriv;      /* User Access Privilege                         */
785       byte help;           /* Help level (see below)                        */
786       byte tabs;           /* 0=transmit <sp> instead of <tab>              */
787       byte language;       /* 0=english, 1=french                           */
788       word nulls;          /* Number of Nulls (delays) after <cr>           */
789       word msg;            /* Last message area visited                     */
790       word Bits;           /* SEE BELOW                                     */
791 /* 148 bytes */
792       long ClassLock;      /* 32 User Keys                                  */
793 
794       long ludate;         /* Last UNIX Date on system                      */
795 /* 156 bytes */
796       short  time;           /* Time on-line so-far today                     */
797 
798       word flag;           /* Used to hold User maintainence information    */
799                            /* -------1 0x01 Reuse record for next new user  */
800                            /* xxxxxxx0 ---- Reserved reserved for opus Mgr  */
801 
802       long upld;           /* K-bytes uploaded, all calls                   */
803       long dnld;           /* K-bytes downloaded, all calls                 */
804       short  dnldl;          /* K-bytes downloaded, today                     */
805       word files;          /* Last file area visited                        */
806       byte width;          /* Width of the caller's monitor                 */
807       byte len;            /* Height of the caller's                        */
808       word credit;         /* FidoNet usage credit in cents                 */
809       word debit;          /* FidoNet usage in cents                        */
810 
811       char spcoec[8];      /* Special OECC to show after logon .............*/
812                            /* Good for clubs, stores, user groups ..........*/
813                            /* Eg, "Welcome to the dBase User Group" ........*/
814 
815       byte saccnt[5];      /* Array of 5 special announcement cntrs ........*/
816                            /* If any is > 0 than the user is shown .........*/
817                            /* a corresponding announcement file & the ......*/
818                            /* counter is decremented till zero .............*/
819 
820       byte exflag;         /* Flag of expiration control bits ..............*/
821                            /* -------- 000 No expiry actions ...............*/
822                            /* -------1 001 Expire AFTER xdate ..............*/
823                            /* ------1- 002 Expire when dbmin GE crmin ......*/
824                            /* -----:-- 004 ... Reserved ...  ...............*/
825                            /* ----:--- 008 ... Reserved ...  ...............*/
826                            /* ---1---- 016 Demote user priv to (expriv) ....*/
827                            /* --1----- 032 Axe user when expired  ..........*/
828                            /* -:------ 064 ... Reserved ...  ...............*/
829                            /* :------- 128 ... Reserved ...  ...............*/
830 
831 
832       long xdate;          /* Expiry date (UNIX style for math/futr)........*/
833       long crmin;          /* Total minutes given to user ..................*/
834       long dbmin;          /* Total minutes used  to user ..................*/
835 
836       char u_section[16];   /* String for user current section          */
837       char ulikes[16];      /* String of user interest keywords .............*/
838       int32_t  fudate;      /* First time user called system in seconds      */
839       uint32_t caller_id;   /* Unique ID for this user. fudate        */
840       uint32_t Section;     /* What "section" of the bbs the user is in.    */
841       word  menu_mode;      /* What menu the user was at last ...............*/
842       word  TwoBits;        /* More user configuration flags                */
843       word  After_Externs;  /* Any special flags from external?         */
844       byte  msecs;     /* Number of message areas in User sections defined  */
845       byte  fsecs;     /* Number of file areas in User sections defined     */
846 
847 /* terminated!! */
848 #ifdef OLD
849       word lastmsg[MAXLREAD];       /* All the last message read stuff .....*/
850 #else
851 /* New for Opus 1.20 */
852        char    Address[32];   /* User's address                        */
853        char    My_Ans[64];    /* Reply to prm.My_Question              */
854        char    Strfill[32];   /* Filler for more strings               */
855        char    bday_mon;      /* User's birthday/month                 */
856        char    bday_day;      /* User's birthday/day                   */
857        short   bday_year;     /* User's birthday/year                  */
858        uint32_t messages_read;  /* Total number of messages read */
859        int32_t  messages_sent;  /* Number of messages entered by user    */
860 
861        word     my_section[MAX_USEC];       /* This is just a block of area  */
862                                             /* numbers in the user's Section */
863                                             /* Message areas are first, then */
864                                             /* file areas. The first file    */
865                                             /* area is at my_section[msecs]  */
866 
867        word    big_fill[40];        /* Fill out to 512 bytes                 */
868        word    Opus_Flags;      /* Stores Opus temporary configuration */
869        byte    byte_fill;
870        byte    Default_Protocol;        /* Default transfer protocol           */
871        byte    User_MMacro[16];     /* Message User's keyboard Macro       */
872        byte    User_FMacro[16];     /* File User's keyboard Macro          */
873        byte    User_DMacro[16];     /* Default User's keyboard Macro       */
874        byte    Sysop_Comment[80];       /* Anything you want to say about 'em  */
875 #endif
876       uint32_t OPUS_id;
877 
878                            /* The next 7 sets of id and inf data are for    */
879                            /* external programs to use for auxialliary inf. */
880                            /* Opus Mgr uses 1st 2 for reamrks about user.   */
881 
882       long extern_id[7];            /* LONG ID number for external programs */
883                                     /* Must be registered with OpusInfo ....*/
884       byte extern_inf[7][32];       /* 7 32-byte external util data blocks  */
885 
886       /* Total record size = 1024b .........................................*/
887    };
888 
889 
890 /*--------------------------------------------------------------------------*/
891 /* USER OPTIONS bit weights (undefined bits are reserved)                   */
892 /*--------------------------------------------------------------------------*/
893 #define  FillerBit   0x0001 /* Reserved                                     */
894 #define  ASKED_LEN   0x0002 /* Asked user for screen length?                */
895 #define  NO_IBMCHAR  0x0004 /* Cannot receive IBM textmode graphics         */
896 #define  USE_LORE    0x0008 /* Wants LORE editor instead of OPed            */
897 #define  MORE_PROMPT 0x0010 /* Wants the page break "MORE?" question        */
898 #define  ANSI        0x0020 /* Can handle ANSI video                        */
899 #define  CONFIG_SET  0x0040 /* OPUS logon questions answered                */
900 #define  FORMFEED    0x0080 /* SET=xmit clearscreen, CLEAR=eat formfeed     */
901 #define  AVATAR      0x0100 /* Can handle AVATAR (aka "oANSI") video        */
902 #define  TALKER      0x0200 /* Wants limited graphics for speech            */
903 
904 #define  USE_PHONE   0x0400 /* Call Back User Modem                         */
905 #define  USE_ALIAS   0x0800 /* Enable ALIAS searches, message entry, etc    */
906 
907 #define  NO_NAME    0x1000 /* User List Name                               */
908 #define  NO_TIME    0x2000 /* User List Time                               */
909 #define  NO_CITY    0x4000 /* User List City                               */
910 
911 
912 #define  CURSOR_CONTROL (ANSI|AVATAR)
913 
914 /*--------------------------------------------------------------------------*/
915 /* 2Bits flags (More user configuration choices....                         */
916 /*--------------------------------------------------------------------------*/
917 #define  HOTKEYS     0x0001 /* Wants HotKeys at all help levels             */
918 #define  QMENU       0x0002 /* Wants to return to last menu instead of MAIN */
919 #define  ASKGRAPH    0x0004 /* Wants to be asked about graphics every logon */
920 #define  ASCIIMENU   0x0008     /* Wants long tedious graphics menus        */
921 #define  SHOW_TIME   0x0010     /* Show time remaining at prompts        */
922 #define  BLOCKCHAT   0x4000     /* User doesn't want to be sociable.     */
923 #define  INCRITAREA  0x8000     /* Opus is in critical area              */
924 
925 
926 /*--------------------------------------------------------------------------*/
927 /* eXpiration flags                                                         */
928 /*--------------------------------------------------------------------------*/
929 #define BY_DATE     0x0001              /* Zap users by date                        */
930 #define BY_TIME     0x0002              /* Zap users when they run out of credit    */
931 #define DEMOTE      0x0010              /* Demote user instead of deleting them     */
932 #define AXE         0x0020              /* Delete user                              */
933 
934 
935 /*--------------------------------------------------------------------------*/
936 /* User help levels                                                         */
937 /*--------------------------------------------------------------------------*/
938 #define  HITECH      0x00  /* Lotus style, top-of-screen, menu bars         */
939 #define  EXPERT      0x02  /* grizzled veteran, no menus at all             */
940 #define  REGULAR     0x04  /* experienced user, brief menus                 */
941 #define  NOVICE      0x06  /* Full menus plus additional hand-holding       */
942 #define  USING_FTB   0xff  /* caller is using the Full-Tilt-Boogie method   */
943 
944 /*--------------------------------------------------------------------------*/
945 /* Flags for After_Externs                                                  */
946 /*--------------------------------------------------------------------------*/
947 #define NEW_ECHOS   0x0001      /* New Echomail entered by user             */
948 #define NEW_MATRIX  0x0002      /* New Matrix entered by user               */
949 #define NEW_LOCAL   0x0004      /* New Local mail entered by user           */
950 #define UPLOADED    0x0008      /* User uploaded something                  */
951 #define DUP_UPLOAD  0x0010      /* User uploaded a duplicate file           */
952 
953 /*--------------------------------------------------------------------------*/
954 /* LASTUSER.BBS file structure                                              */
955 /*--------------------------------------------------------------------------*/
956 /* Struct of LASTUSE#.BBS file that is written everytime a user logons on   */
957 /* or when Opus does an OUTSIDE exit.  It contains a complete and exact     */
958 /* copy of the user record, following by extended data for session control. */
959 /* If PRM is configured to reload user data upon return from an OUTSIDE     */
960 /* exit, then Opus reloads user record portion, making it the active copy.  */
961 /*--------------------------------------------------------------------------*/
962 
963 #ifdef _TM_DEFINED
964 struct _lu_file
965    begin
966       struct _usr user;    /* Copy of user record                           */
967       word  baud;          /* Current user's baud (0 == keyboard!)          */
968       word  port;          /* Current port #                                */
969       word  task;          /* Active task number                            */
970       word  mins;          /* User's minutes remaining                      */
971       word  msgarea;       /* Which message area user is in                 */
972       word  filearea;      /* Which file area user is in                    */
973       long   timeoff;      /* UNIX GMT of latest time user stays on till    */
974       struct tm tmoff;     /* MS-C 'tm' struct of above but as local time   */
975       char   laston[25];   /* Orig Last Call Date as ASCIIZ string because  */
976                            /* same field in user rec now is curr logon time */
977    end;
978 #endif
979 
980 
981 /*-------------------------------------------------------------------------*/
982 /*                                                                         */
983 /* MESSAGE and FILE AREAS                                                  */
984 /*                                                                         */
985 /*-------------------------------------------------------------------------*/
986 
987 /* See SYSTEM.H */
988 
989 
990 
991 /*--------------------------------------------------------------------------*/
992 /*                                                                          */
993 /* MESSAGES                                                                 */
994 /*                                                                          */
995 /*--------------------------------------------------------------------------*/
996 
997 /*--------------------------------------------------------------------------*/
998 /* Message header                                                           */
999 /*--------------------------------------------------------------------------*/
1000 struct opus_msg
1001    begin
1002       byte from[36];
1003       byte to[36];
1004       byte subj[72];
1005       byte date[20];       /* Obsolete/unused ASCII date information        */
1006       word times;          /* FIDO<tm>: Number of times read                */
1007       word dest;           /* Destination node                              */
1008       word orig;           /* Origination node number                       */
1009       word cost;           /* Unit cost charged to send the message         */
1010 
1011       word orig_net;       /* Origination network number                    */
1012       word dest_net;       /* Destination network number                    */
1013 
1014                            /* A TIMESTAMP is a 32-bit integer in the Unix   */
1015                            /* flavor (ie. the number of seconds since       */
1016                            /* January 1, 1970).  Timestamps in messages are */
1017                            /* always Greenwich Mean Time, never local time. */
1018 
1019       struct _stamp date_written;   /* When user wrote the msg              */
1020       struct _stamp date_arrived;   /* When msg arrived on-line             */
1021 
1022       word reply;          /* Current msg is a reply to this msg number     */
1023       word attr;           /* Attribute (behavior) of the message           */
1024       word up;             /* Next message in the thread                    */
1025    end;
1026 
1027 
1028 
1029 /*--------------------------------------------------------------------------*/
1030 /* Message attributes                                                       */
1031 /*--------------------------------------------------------------------------*/
1032 #define MSGPRIVATE 0x0001  /* private message         * 0000 0000 0000 0001 */
1033 #define MSGCRASH   0x0002  /* squirtmail              * 0000 0000 0000 0010 */
1034 #define MSGREAD    0x0004  /* read by addressee       * 0000 0000 0000 0100 */
1035 #define MSGSENT    0x0008  /* sent OK (remote)          0000 0000 0000 1000 */
1036 #define MSGFILE    0x0010  /* file attached to msg    * 0000 0000 0001 0000 */
1037 #define MSGFWD     0x0020  /* in transit                0000 0000 0010 0000 */
1038 #define MSGORPHAN  0x0040  /* unknown dest node         0000 0000 0100 0000 */
1039 #define MSGKILL    0x0080  /* kill after bundling     * 0000 0000 1000 0000 */
1040 #define MSGLOCAL   0x0100  /* FidoNet vs. local         0000 0001 0000 0000 */
1041 #define MSGHOLD    0x0200  /* Hold, don't send        * 0000 0010 0000 0000 */
1042 #define MSGXX2     0x0400  /* <reserved>             X? 0000 0100 0000 0000 */
1043 #define MSGFRQ     0x0800  /* file request            * 0000 1000 0000 0000 */
1044 #define MSGRRQ     0x1000  /* receipt requested      X* 0001 0000 0000 0000 */
1045 #define MSGCPT     0x2000  /* is a return receipt    X* 0010 0000 0000 0000 */
1046 #define MSGARQ     0x4000  /* audit trail requested  X* 0100 0000 0000 0000 */
1047 #define MSGURQ     0x8000  /* update request         X* 1000 0000 0000 0000 */
1048                                                    /*-----------------------*/
1049                                                    /* ^                     */
1050                                                    /* |                     */
1051                                                    /*  * = preserved by     */
1052                                                    /*      the network      */
1053                                                    /*  ? = stripped by the  */
1054                                                    /*      net (FTSC spec)  */
1055                                                    /*      but preserved    */
1056                                                    /*      by seadog<tm>    */
1057                                                    /*  X = not used by Opus */
1058                                                    /*-----------------------*/
1059 
1060 
1061 
1062 
1063 /*--------------------------------------------------------------------------*/
1064 /*                                                                          */
1065 /* EVENTS                                                                   */
1066 /*                                                                          */
1067 /*--------------------------------------------------------------------------*/
1068 /*  #include <event.h>  */
1069 
1070 /*--------------------------------------------------------------------------*/
1071 /* Message bundle header                                                    */
1072 /*--------------------------------------------------------------------------*/
1073 
1074 #define PKTVER       2        /* Used for `ver' (below)                     */
1075 
1076 struct _pkthdr
1077    begin
1078       short   orig_node;        /* originating node               */
1079       short   dest_node;        /* destination node               */
1080       short   year;             /* 0..99  when packet was created */
1081       short   month;            /* 1..12  when packet was created */
1082       short   day;              /* 1..31  when packet was created */
1083       short   hour;             /* 0..23  when packet was created */
1084       short   minute;           /* 0..59  when packet was created */
1085       short   second;           /* 0..59  when packet was created */
1086       short   rate;             /* destination's baud rate        */
1087       short   ver;              /* packet version                 */
1088       short   orig_net;         /* originating network number     */
1089       short   dest_net;         /* destination network number     */
1090       char  product;          /* product type                   */
1091       char  x1;               /* filler (used by some systems)  */
1092 
1093                               /* ------------------------------ */
1094                               /* THE FOLLOWING SECTION IS not   */
1095                               /* THE SAME ACROSS SYSTEM LINES:  */
1096                               /* ------------------------------ */
1097       byte pktpwd[6];
1098       byte B_fill1[2];
1099       word Orig_Zone;
1100       word Dest_Zone;
1101       byte B_fill2[16];
1102       long B_fill3;
1103    end;
1104 
1105 
1106 
1107 
1108 
1109 
1110 
1111 
1112 
1113 /*--------------------------------------------------------------------------*/
1114 /* WAZOO                                                                    */
1115 /*--------------------------------------------------------------------------*/
1116 
1117 #ifndef ACK
1118 #define ACK    0x06
1119 #endif
1120 
1121 #ifndef NAK
1122 #define NAK    0x15
1123 #endif
1124 
1125 #ifndef ENQ
1126 #define ENQ    0x05
1127 #endif
1128 
1129 #ifndef YOOHOO
1130 #define YOOHOO 0x00f1     /* 241 (a prime number, I think) */
1131 #endif
1132 
1133 #ifndef  TSYNC
1134 #define  TSYNC 0x00ae
1135 #endif
1136 
1137 struct   _Hello
1138    begin
1139       word     signal;           /* always 'o'     (0x6f)                   */
1140       word     hello_version;    /* currently 1    (0x01)                   */
1141       word     product;          /* product code                            */
1142       word     product_maj;      /* major revision of the product           */
1143       word     product_min;      /* minor revision of the product           */
1144       char     my_name[60];      /* Other end's name                        */
1145       char     sysop[20];        /* sysop's name                            */
1146       ADDR     my_address;
1147       byte     my_password[8];   /* ONLY 6 CHARACTERS ARE SIGNIFICANT !!!!! */
1148       byte     reserved2[8];     /* reserved by Opus                        */
1149       word     capabilities;     /* see below                               */
1150       byte     reserved3[12];    /* available to non-Opus systems by prior  */
1151                                  /* "approval" of 124/108.                  */
1152    end; /* size 128 bytes */
1153 
1154 
1155 /*--------------------------------------------------------------------------*/
1156 /* YOOHOO<tm> CAPABILITY VALUES                                             */
1157 /*--------------------------------------------------------------------------*/
1158 #define Y_DIETIFNA 0x0001  /* Can do LoTek            0000 0000 0000 0001 */
1159 #define FTB_USER   0x0002  /* reserved by Opus        0000 0000 0000 0010 */
1160 #define Bit_2      0x0004  /* reserved by Opus        0000 0000 0000 0100 */
1161 #define ZED_ZAPPER 0x0008  /* Can do ZModem/plain     0000 0000 0000 1000 */
1162 #define DOES_IANUS 0x0010  /* Does Opus Janus         0000 0000 0001 0000 */
1163 #define Bit_5      0x0020  /* reserved by Opus        0000 0000 0010 0000 */
1164 #define Bit_6      0x0040  /* reserved by Opus        0000 0000 0100 0000 */
1165 #define Bit_7      0x0080  /* reserved by Opus        0000 0000 1000 0000 */
1166 #define Bit_8      0x0100  /* reserved by Opus        0000 0001 0000 0000 */
1167 #define Bit_9      0x0200  /* reserved by Opus        0000 0010 0000 0000 */
1168 #define Bit_a      0x0400  /* reserved by Opus        0000 0100 0000 0000 */
1169 #define Bit_b      0x0800  /* reserved by Opus        0000 1000 0000 0000 */
1170 #define Bit_c      0x1000  /* reserved by Opus        0001 0000 0000 0000 */
1171 #define Bit_d      0x2000  /* reserved by Opus        0010 0000 0000 0000 */
1172 #define Bit_e      0x4000  /* reserved by Opus        0100 0000 0000 0000 */
1173 #define WZ_FREQ    0x8000  /* accepts file requests   1000 0000 0000 0000 */
1174 
1175 
1176 /*
1177 
1178    User Indexing Support Items
1179 
1180    Bit setting of (word) UDB_Flags
1181 
1182    & 1 ... Set ON if user name CRC indexing is expected.  The general
1183            init func should look for User.Idx and check its size for
1184            a match to the user file size.  Must be nrecs * sizeof(long).
1185 
1186            Or, can simply be forced on and the first func that finds the
1187            index to be missing or inconsistent will give a short status
1188            error and turn the bit off, stopping further index attempts.
1189 
1190    & 2 ... Set ON if user file locking is to be attempted which requires
1191            SHARE.EXE to be loaded.  This is desired as updates to the
1192            user file index should be controlled as access to 2 separate
1193            files in a multitasked scenario can span some time and the
1194            chance of indexing errors is quite high.  When ON, the 1st byte
1195            of ONLY the user file is locked to mean that the user database
1196            is being updated.  There should be no need to lock the index
1197            as the user file is always accessed first.
1198 
1199            It has to be tested to see if the effect of other read accesses
1200            to the user file (eg, user listing, searching) will fail if
1201            the file is locked during an update.  I suspect that other
1202            activities will be transparent to it and ONLY other LOCKING
1203            attempts will be foiled.  This would allow compatibility with
1204            other existing R/O accesses to the file.
1205 
1206            If it proves to be safe, we can force this ON and allow the
1207            the first function wherein it fails to turn it off with a
1208            single short message.
1209 
1210 */
1211 
1212 #define UsrIdx  1                         /* Says, Attempt CRC indexing     */
1213 #define UsrLok  2                         /* Says, Attempt File Locking     */
1214 #define UsrPwd  4
1215 
1216 #define HAS_UF(v)  (ctl.UDB_Flags & v)    /* Check if Ufile feature used    */
1217 #define STOP_UF(v) ctl.UDB_Flags &= ~v    /* Turn off Ufile feature         */
1218 
1219 /* END OF FILE: opus.h */
1220 
1221 
1222 // INCLUDE SYSTEM.H //////////////////////////////////////////////////////////
1223 
1224 /*--------------------------------------------------------------------------*/
1225 /*                                                                          */
1226 /*               The Opus Computer-Based Conversation System                */
1227 /*    (c) Copyright 1986-1991, Wynn Wagner III, All Rights Reserved         */
1228 /*                                                                          */
1229 /*                                                                          */
1230 /*                   YOOHOO is a trademark of Wynn Wagner III               */
1231 /*                                                                          */
1232 /*                        YOOHOO-YOOHOO/2U2 & WaZOO are                     */
1233 /*           Copyright 1987, Wynn Wagner III, All Rights Reserved           */
1234 /*                                                                          */
1235 /*                                                                          */
1236 /* This material is available for use by anybody with no strings and        */
1237 /* no guarantees.                                                           */
1238 /*                                                                          */
1239 /*                                                                          */
1240 /*--------------------------------------------------------------------------*/
1241 /*                                                                          */
1242 /* OPUS 1.20 Message/File area database structures.                         */
1243 /* Copyright 1991 Wynn Wagner III, Doug Boone and John Valentyn.            */
1244 /*                                                                          */
1245 /*--------------------------------------------------------------------------*/
1246 
1247 /*--------------------------------------------------------------------------*/
1248 /* Structure for SYSMSG.DAT                                                 */
1249 /* A single-file message area database                                      */
1250 /*--------------------------------------------------------------------------*/
1251 
1252 struct  _filesys {
1253 
1254     char    Area_Name[32];      /* Area's primary name */
1255 
1256     word    Area_Number;        /* area number */
1257     word    Area_Menu;      /* which menu? */
1258     word    Total_Size;
1259 
1260     byte    Area_Priv;      /* Area Privilege */
1261     byte    Down_Priv;      /* Download Privilege */
1262 
1263     byte    Up_Priv;
1264     byte    Priv_Up;        /* Uploads from users with Priv>= Priv_Up */
1265     byte    Ratio_Priv;     /* Privilege where u/d ratios start */
1266     byte    New_Priv;
1267 
1268     byte    fill_byte1[2];
1269 /* 48 */
1270     word    Attrib;     /* Area Attribute */
1271     word    Status;     /* Area Status, extended Attribute? */
1272 
1273     long    Start_Pos;      /* start of Area in sysfile.dat */
1274 /* 56 */
1275     long    Area_Lock;      /* Area Lock */
1276 
1277     long    Up_Lock;
1278 
1279     long    Down_Lock;      /* edit Lock */
1280 
1281     long    Priv_Key;       /* Private Key path */
1282 
1283 /* 72 */
1284     long    Section;        /* edit Lock */
1285 
1286     long    fill_long[2];
1287 
1288     byte    Title_Len;      /* length of Title */
1289     byte    Prefiles_Len;   /* files shown at Area access like Areainfo */
1290 
1291     byte    Downpath_Len;       /* length of path */
1292     byte    Uppath_Len;     /* length of path */
1293 /* 88 */
1294     byte    Barricade_Len;      /* Barricade length if used */
1295     byte    Rules_Len;
1296 
1297     byte    Privkey_Len;        /* Uploads from users with "key" go here */
1298     byte    PrivUp_Len;     /* Private Upload path */
1299     byte    Menu_Len;       /* file name for this area's ascii menu */
1300     byte    Vol_Len;        /* Length of volume name */
1301     byte    Help_Len;       /* Length of help name for this area */
1302 
1303     byte    fill_byte2[5];      /* more filler */
1304 /* 100 */
1305     word    Other_Len;      /* external programs use this number bytes */
1306 
1307     word    Def_Upload;     /* Area number for default uploads */
1308     word    Priv_Upload;        /* Area number for Priv uploads */
1309     word    Key_Upload;     /* Area number for Lock uploads */
1310 
1311     word    fill_word[10];      /* more filler to 128 bytes*/
1312 };
1313 
1314 /*  Title */
1315 /*  Prefiles */
1316 /*  Downpath */
1317 /*  Barricade */
1318 /*  Rules */
1319 /*  Menu */
1320 /*  Help */
1321 /*  Upload */
1322 /*  Priv Upload */
1323 /*  Key Upload */
1324 /* File area help file */
1325 /*  Volume */
1326 /*  "Other" field. Reserved for external programs */
1327 
1328 /*--------------------------------------------------------------------------*/
1329 /* Structure for SYSMSG.DAT                                                 */
1330 /* A single-file message Area database                                      */
1331 /*--------------------------------------------------------------------------*/
1332 
1333 struct  _msgsys {
1334 
1335     char    Area_Name[32];      /* Area's primary name */
1336     char    Echo_Name[32];      /* Area's echo name */
1337     word    Area_Number;        /* Area number */
1338     word    Area_Menu;      /* which menu? */
1339     word    Total_Size;     /* Total size of this Area in SYSMSG.DAT */
1340 
1341     byte    Area_Priv;      /* Area Privilege */
1342     byte    Edit_Priv;      /* Edit Privilege */
1343     byte    Private_Priv;       /* Privilege to read Private messages*/
1344     byte    Upload_Priv;
1345     byte    fill_0[3];
1346     byte    Translate;      /* Which character set to use 1, 2.... */
1347 /* 80 */
1348     long    Area_Lock;      /* Area Lock */
1349     long    Edit_Lock;      /* Edit Lock */
1350 
1351     long    Private_Lock;       /* Lock to read Private messages*/
1352     long    Upload_Lock;
1353 
1354     word    Attrib;     /* Area Attribute */
1355     word    Status;     /* Area Status, extended Attribute? */
1356 
1357     long    Start_Pos;      /* start of Area in sysmsg.dat */
1358     long    Section;
1359     byte    Max_Lines;      /* Maximum number of lines in messages */
1360     byte    fill_1[3];
1361 /* 112 */
1362 
1363     word    Zone;
1364     word    Net;
1365     word    Node;
1366     word    Point;
1367 
1368     byte    Path_Len;       /* length of Path */
1369     byte    Title_Len;      /* length of Title */
1370 
1371     byte    Barricade_Len;      /* Barricade length if used */
1372     byte    Origin_Len;     /* non-default Origin line */
1373 
1374     byte    Domain_Len;     /* Domain (if used) length */
1375     byte    Menu_Len;       /* file name for this area's ascii menu */
1376     byte    Vol_Len;        /* Length of volume name */
1377     byte    Help_Len;       /* Length of help name for this area */
1378 /* 144 */
1379 
1380     byte    Scan_Len;       /* number of boards that Area is Scanned to */
1381     byte    Scan_Pos;       /* where Opus is in the Scan right now */
1382     word    Other_Len;      /* external programs use this number bytes */
1383     word    Extern_Flags;
1384     word    word_fill[5];
1385 /* 160 */
1386 };
1387 
1388 /*--------------------------------------------------------------------------*/
1389 /* Then some strings/structures follow as needed                            */
1390 /*--------------------------------------------------------------------------*/
1391      /* Path string  */
1392     /* Title string */
1393     /* Barricade string */
1394     /* Origin string */
1395     /* Domain string */
1396     /* Menu string */
1397     /* Message area help file */
1398     /* Volume ID */
1399     /* aScan[Scan_Len] echoScan addresses */
1400     /*  "Other" field. Reserved for external programs */
1401 
1402 /*--------------------------------------------------------------------------*/
1403 /* end of strings                                                           */
1404 /*--------------------------------------------------------------------------*/
1405 
1406 
1407 struct  _ascan {        /* structure of address for echoScanning */
1408     word    Net;
1409     word    Node;
1410 };
1411 
1412 /*--------------------------------------------------------------------------*/
1413 /* LMR is used in LREAD.DAT to store the user's last message read counter   */
1414 /*--------------------------------------------------------------------------*/
1415 struct  _lmr {
1416     uint32_t  user_id;
1417     word      high_msg;
1418     word      last_msg;
1419 };
1420 
1421 /*--------------------------------------------------------------------------*/
1422 /* LF is used to store the last time a user has accessed each area          */
1423 /*--------------------------------------------------------------------------*/
1424 struct  _lf {
1425     uint32_t  user_id;
1426     uint32_t  last_timestamp;
1427 };
1428 
1429 /*--------------------------------------------------------------------------*/
1430 /* File Area attributes (limit or describe the behavior of an area)         */
1431 /*--------------------------------------------------------------------------*/
1432 
1433 #define    F_DUPE  0x0001       /* Allow duplicate uploads in this area      */
1434 #define    F_FREE  0x0002       /* Downloads from this area area all 0K      */
1435 
1436 
1437 /*--------------------------------------------------------------------------*/
1438 /* Area attributes (limit or describe the behavior of an area)              */
1439 /*--------------------------------------------------------------------------*/
1440 #define  SYSMAIL   0x01    /* is a mail area                                */
1441 #define  P_REP     0x02    /* Net mail private echomail back                */
1442 #define  NOPUBLIC  0x04    /* OPUS: Disallow public messages                */
1443 #define  NOPRIVATE 0x08    /* OPUS: Disallow private messages               */
1444 #define  ANON_OK   0x10    /* OPUS: Enable anonymous messages               */
1445 #define  _ECHOMAIL  0x20    /* OPUS: Set=Echomail Clear=Not Echomail         */
1446 #define  USEALIAS  0x40    /* OPUS: Use user's alias in this area if.....   */
1447 //#define  PASSTHROUGH   0x80     /* OPUS: Allow high-bit characters in echo area  */
1448 #define  INBOUND   0x0100       /* Inbound Only area */
1449 
1450 
1451 /*--------------------------------------------------------------------------*/
1452 /* msgsys.Extern_Flags                                                      */
1453 /* Opus will not use these flags, set them or anything. The ones that are   */
1454 /* marked as RESERVED will be defined in the future for "standard" uses.    */
1455 /* The ones marked as EXTERN will have no "standard" meaning so conflicting */
1456 /* programs MAY have conflicting uses.                                      */
1457 /*--------------------------------------------------------------------------*/
1458 
1459 #define RENUMBER   0x0001       /* This area gets renumbered                 */
1460 #define MAILCHECK   0x0002      /* The mail check program will do this area  */
1461 #define RESERVED2   0x0004      /* Reserved for Opus-defined flags           */
1462 #define RESERVED3   0x0008      /* Reserved for Opus-defined flags           */
1463 #define RESERVED4   0x0010      /* Reserved for Opus-defined flags           */
1464 #define RESERVED5   0x0020      /* Reserved for Opus-defined flags           */
1465 #define RESERVED6   0x0040      /* Reserved for Opus-defined flags           */
1466 #define RESERVED7   0x0080      /* Reserved for Opus-defined flags           */
1467 #define EXTERN1 0x0100      /* Undefined! Meaning varies for each program*/
1468 #define EXTERN2 0x0200      /* Undefined! Meaning varies for each program*/
1469 #define EXTERN3 0x0400      /* Undefined! Meaning varies for each program*/
1470 #define EXTERN4 0x0800      /* Undefined! Meaning varies for each program*/
1471 #define EXTERN5 0x1000      /* Undefined! Meaning varies for each program*/
1472 #define EXTERN6 0x2000      /* Undefined! Meaning varies for each program*/
1473 #define EXTERN7 0x4000      /* Undefined! Meaning varies for each program*/
1474 #define EXTERN8 0x8000      /* Undefined! Meaning varies for each program*/
1475 
1476 
1477 //  ------------------------------------------------------------------
1478 
1479 #if defined(GOLD_CANPACK)
1480 #pragma pack()
1481 #endif
1482 
1483 //  ------------------------------------------------------------------
1484 
1485