home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / OSTRUCT.ZIP / OPUS.H < prev   
Encoding:
C/C++ Source or Header  |  1993-01-04  |  41.6 KB  |  832 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*               The Opus Computer-Based Conversation System                */
  3. /*       (c) Copyright 1986, Wynn Wagner III, All Rights Reserved           */
  4. /*                                                                          */
  5. /*                                                                          */
  6. /*                   YOOHOO is a trademark of Wynn Wagner III               */
  7. /*                                                                          */
  8. /*                        YOOHOO-YOOHOO/2U2 & WaZOO are                     */
  9. /*           Copyright 1987, Wynn Wagner III, All Rights Reserved           */
  10. /*                                                                          */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /* This material is available for use by anybody with no strings and        */
  14. /* no guarantees.                                                           */
  15. /*                                                                          */
  16. /*--------------------------------------------------------------------------*/
  17.  
  18.  
  19.  
  20. /*--------------------------------------------------------------------------*/
  21. /* LEGIBLE SECTION.  Definitions to make "C" look like a real language.     */
  22. /*--------------------------------------------------------------------------*/
  23. #define begin        {
  24. #define end          }
  25.  
  26. #define true         (-1)
  27. #define false        0
  28. #define Procedure    void
  29.  
  30. #define shl          <<
  31. #define shr          >>
  32. #define xor          ^
  33. #define and          &&
  34. #define or           ||
  35. #define not          !
  36. #define mod          %
  37.  
  38. #ifndef max
  39. #define max(a,b)     ((a)>(b)?(a):(b))
  40. #endif
  41.  
  42. #ifndef min
  43. #define min(a,b)     ((a)<=(b)?(a):(b))
  44. #endif
  45.  
  46. typedef unsigned      bit;
  47. typedef unsigned int  word;
  48. typedef unsigned char byte;
  49.  
  50.  
  51.  
  52. /*--------------------------------------------------------------------------*/
  53. /* Bit flags for EchoScan                                                   */
  54. /*--------------------------------------------------------------------------*/
  55. #define NUM_BITS 100
  56. extern char bits[ 1+(NUM_BITS/8) ];
  57.  
  58.  
  59.  
  60. /*--------------------------------------------------------------------------*/
  61. /* TIME STAMP                                                               */
  62. /*--------------------------------------------------------------------------*/
  63. struct _stamp
  64.    begin
  65.        unsigned int   date;
  66.       unsigned int   time;
  67.    end;
  68.  
  69.  
  70.  
  71.  
  72. /*--------------------------------------------------------------------------*/
  73. /* NodeList.Sys                                                             */
  74. /*                                                                          */
  75. /*    NET > 0 and NODE > 0    Normal node                                   */
  76. /*                                                                          */
  77. /*    NET > 0 and NODE <= 0   Host node                                     */
  78. /*                               Net host........node== 0                   */
  79. /*                               Regional host...node==-1                   */
  80. /*                               Country host....node==-2                   */
  81. /*                                                                          */
  82. /*    NET == -1      Nodelist.Sys revision                                  */
  83. /*                                                                          */
  84. /*    NET == -2      Nodelist statement                                     */
  85. /*                                                                          */
  86. /*--------------------------------------------------------------------------*/
  87.  
  88.  
  89. /*--------------------------------------------------------------------------*/
  90. /* NODE                                                                     */
  91. /* Please note the NewStyle structure (below).  Time is running out for the */
  92. /* existing `_node' structure!  Opus currently uses the old style node      */
  93. /* structure, but not for long.                                             */
  94. /*--------------------------------------------------------------------------*/
  95. struct _node
  96.    begin
  97.       int   number;        /* node number                                   */
  98.       int   net;           /* net number                                    */
  99.       int   cost;          /* cost of a message to this node                */
  100.       int   rate;          /* baud rate                                     */
  101.       char  name[20];      /* node name                                     */
  102.       char  phone[40];     /* phone number                                  */
  103.       char  city[40];      /* city and state                                */
  104.    end;
  105.  
  106.  
  107. /*--------------------------------------------------------------------------*/
  108. /* THE NEWSTYLE NODE LIST IS *NOT* USED RIGHT NOW                           */
  109. /*--------------------------------------------------------------------------*/
  110. #ifdef NEWSTYLE
  111.   struct _node {
  112.     int  number;           /* node number, */
  113.     int  net;                /* net number */
  114.     int  cost;                /* cost per minute to call */
  115.     int  rate;                /* baud rate */
  116.     char name[35];         /* node name */
  117.     char phone[40];        /* phone number */
  118.     char city[30];         /* city and state, */
  119.  
  120.     char password[7];       /* reserved for future use by IBM */
  121.     int  realcost;          /* phone company's charge */
  122.     int  hubnode;          /* node # of this node's hub or 0 if none */
  123.     int  modem;              /* modem type code ... I'll let the hardware
  124.                                  guys come up with coding */
  125.     unsigned int flags1;   /* set of flags (see below) */
  126.    };
  127.  
  128.  
  129. /*------------------------------------------------------------------------*/
  130. /* Values for the `flags1' field                                          */
  131. /*------------------------------------------------------------------------*/
  132. #define B_hub      0x0001  /* node is a net hub       0000 0000 0000 0001 */
  133. #define B_host     0x0002  /* node is a net host      0000 0000 0000 0010 */
  134. #define B_region   0x0004  /* node is region coord    0000 0000 0000 0100 */
  135. #define B_hold     0x0008  /* node is on hold         0000 0000 0000 1000 */
  136. #define B_unlisted 0x0010  /* node is down            0000 0000 0001 0000 */
  137. #define B_down     0x0020  /* number is unlisted      0000 0000 0010 0000 */
  138. #define B_CM       0x0040  /* runs continuous mail    0000 0000 0100 0000 */
  139. #define B_NA       0x0080  /* runs No.American NMH    0000 0000 1000 0000 */
  140. #define B_Europe   0x0100  /* runs European NMH       0000 0001 0000 0000 */
  141. #define B_Pacific  0x0200  /* runs Pacific NMH        0000 0010 0000 0000 */
  142. #define B_res1     0x0400  /* reserved by Opus        0000 0100 0000 0000 */
  143. #define B_res2     0x0800  /* reserved by Opus        0000 1000 0000 0000 */
  144. #define B_res3     0x1000  /* reserved by Opus        0001 0000 0000 0000 */
  145. #define B_res4     0x2000  /* reserved by Opus        0010 0000 0000 0000 */
  146. #define B_res5     0x4000  /* reserved by Opus        0100 0000 0000 0000 */
  147. #define B_res6     0x8000  /* reserved by Opus        1000 0000 0000 0000 */
  148.  
  149.  
  150. #endif
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157. /*--------------------------------------------------------------------------*/
  158. /* Nodelist.Idx                                                             */
  159. /* (File is terminated by EOF)                                              */
  160. /*--------------------------------------------------------------------------*/
  161. struct _ndi
  162.    begin
  163.       int   node;          /* node number  */
  164.       int   net;           /* net number   */
  165.    end;
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172. #define MAXEXPAND 30          /* max download files (wildcard expansion)    */
  173. #define CMDLEN    60          /* size of the command typeahead buffer       */
  174. #define CARRYLEN  20          /* LORE editor's carry buffer                 */
  175. #define MAXLEN    85          /* size of primary line-input buffer          */
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182. /*--------------------------------------------------------------------------*/
  183. /* OPUS CONTROL FILE AND PARM FILE DECLARATIONS                             */
  184. /*--------------------------------------------------------------------------*/
  185.  
  186. #define  THIS_CTL_VERSION  14       /* ASSEMBLER VERSION NUMBER             */
  187.  
  188.  
  189. #ifdef   COMPILER
  190. #           define CTLSIZE 0x7fff   /* Only used when compiling OPUS_CTL    */
  191. #           define OFS     int
  192. #else
  193. #           define CTLSIZE 1
  194. #           define OFS     char*
  195. #endif
  196.  
  197.  
  198. #define  MAX_EXTERN         8       /* max. number of external programs     */
  199. #define  MAXCLASS          12       /* number of possible priv levels       */
  200. #define  ALIAS_CNT         15       /* number of matrix addresses           */
  201.  
  202.  
  203.                /*-----------------------------------------------------------*/
  204.                /* Information about a class of users.  Warning: This is NOT */
  205.                /* a stable structure.                                       */
  206.                /*-----------------------------------------------------------*/
  207. struct   class_rec
  208.             {
  209.                int          priv;
  210.                int          max_time;      /* max cume time per day         */
  211.                int          max_call;      /* max time for one call         */
  212.                int          max_dl;        /* max dl bytes per day          */
  213.                unsigned int ratio;         /* ul:dl ratio                   */
  214.                unsigned int min_baud;      /* speed needed for logon        */
  215.                unsigned int min_file_baud; /* speed needed for file xfer    */
  216.             };
  217.  
  218.  
  219.  
  220.  
  221.                /*-----------------------------------------------------------*/
  222.                /* The structure of a PRM file created                       */
  223.                /*                                                           */
  224.                /* This is *NOT* a stable structure, check the assembler's   */
  225.                /* version number.  If the version (above) doesn't match the */
  226.                /* number in the file you are reading, you are GUARANTEED    */
  227.                /* that the structure has changed because that's what the    */
  228.                /* version means.  The location of the version number at     */
  229.                /* offset zero is assured for all future versions.           */
  230.                /*                                                           */
  231.                /*-----------------------------------------------------------*/
  232. struct pointers {
  233.  
  234.                /*-----------------------------------------------------------*/
  235.                /* DATA                                                      */
  236.                /*-----------------------------------------------------------*/
  237.          byte  version;        /* for safety                                */
  238.          byte  testmode;       /* input from keyboard, not modem            */
  239.          long  total_callers;  /* total number of callers to system         */
  240.          long  quote_position; /* last position used in last quote file     */
  241.          byte  multitasker;    /* flag for DoubleDos (see below)            */
  242.          byte  snooping;       /* Local monitor active                      */
  243.          byte  edit_exit;      /* 1= use new user questionaire              */
  244.          byte  verbose;        /* wordy sysop log                           */
  245.          byte  terse;          /* brief sysop log                           */
  246.          byte  trace;          /* log trace mode                            */
  247.          byte  show_areapath;  /* use path not Dir.Bbs                      */
  248.          byte  task_num;       /* for multi-tasking systems                 */
  249.          byte  exit_val;       /* ERRORLEVEL to use after caller            */
  250.          byte  val_outside;    /* ERRORLEVEL for O)utside                   */
  251.          byte  val_zero;       /* ERRORLEVEL for sysop 0 command            */
  252.          byte  no_crashmail;   /* 1 = don't accept crashmail                */
  253.          byte  auto_kill;      /* RECD PVT msgs. 0=no 1=ask 2=yes           */
  254.          byte  crashexit;      /* non-zero= ErrorLevel exit                 */
  255.          byte  unpack_arc;     /* 1=unpack incomming arcmail                */
  256.          byte  toss_echo;      /* 1=toss incomming echomail                 */
  257.          byte  arc_exit;       /* ErrorLevel for after incomming ARCmail    */
  258.          byte  old_dtr;        /* 1 drop dtr to look busy, 0 go off hook    */
  259.          int   carrier_mask;
  260.          int   handshake_mask;
  261.          int   ctla_priv;      /* Priv to see CONTROL-A lines in messages   */
  262.          int   max_baud;       /* fastest speed we can use                  */
  263.          int   min_baud;       /* minimum baud to get on-line               */
  264.          int   speed_graphics; /* min baud for graphics                     */
  265.          int   com_port;       /* Com1=0, Com2=1                            */
  266.          int   logon_priv;     /* Access level for new users                */
  267.          int   date_style;     /* Used for FILES.BBS display                */
  268.          int   seenby_priv;    /* Min priv to see SEEN_BY line              */
  269.  
  270.          int   msg_ask[16];    /* Array of privs. for message attr ask's    */
  271.          int   msg_assume[16]; /* Array of privs. for message attr assume's */
  272.          int   msg_fromfile;   /* Priv. for doing message from file         */
  273.  
  274.          byte  watchdog;       /* 1=Set Fossil to reboot during outside     */
  275.          byte  video;          /* 0=Dos, 1=Fossil 2=IBM                     */
  276.  
  277.          byte  filler[8];
  278.  
  279.          word  logon_time;     /* time to give for logons                   */
  280.  
  281.          byte  echo_exit;      /* ERRORLEVEL for after inbound echomail     */
  282.  
  283.          byte  bfill;
  284.          byte  Flags;          /* See "FLAGS" below                         */
  285.  
  286.          word  our_zone;
  287.          word  matrix_mask;
  288.          
  289.          struct class_rec class[MAXCLASS];
  290.          struct _ndi alias[ALIAS_CNT];
  291.  
  292.  
  293.                /*-----------------------------------------------------------*/
  294.                /* OFFSETS                                                   */
  295.                /*-----------------------------------------------------------*/
  296.          OFS   m_init;         /* modem initialization string               */
  297.          OFS   predial;        /* modem dial command sent before number     */
  298.          OFS   postdial;       /* modem command sent after dialed number    */
  299.          OFS   timeformat;
  300.          OFS   dateformat;
  301.          OFS   fkey_path;      /* path to `F-key files'                     */
  302.          OFS   parm_outside;   /* prog/parms for O)utside                   */
  303.          OFS   parm_zero;      /* parm for sysop 0 command                  */
  304.          OFS   sys_path;       /* path to SYSTEM?.BBS files                 */
  305.          OFS   user_file;      /* path/filename of User.Bbs                 */
  306.          OFS   net_info;       /* path to NODELIST files                    */
  307.          OFS   sched_name;     /* name of file with _sched array            */
  308.          OFS   logo;           /* first file shown to a caller              */
  309.          OFS   welcome;        /* shown after logon                         */
  310.          OFS   bulletin;       /* shown after the welcome file              */
  311.          OFS   editorial;
  312.          OFS   quote;
  313.          OFS   question;       /* Questionnaire available on the main menu  */
  314.          OFS   request_list;   /* list of files approved for file requests  */
  315.          OFS   newuser1;
  316.          OFS   newuser2;
  317.          OFS   rookie;
  318.          OFS   application;    /* new user questionnaire                    */
  319.          OFS   avail_list;     /* file to send when FILES is file requested */
  320.          OFS   hlp_editor;     /* Intro to msg editor for novices.          */
  321.          OFS   hlp_replace;    /* Explain the Msg.Editor E)dit command      */
  322.          OFS   msg_inquire;    /* Explain the Msg. I)nquire command         */
  323.          OFS   hlp_locate;     /* Explain the Files L)ocate command         */
  324.          OFS   hlp_contents;   /* Explain the Files C)ontents command       */
  325.          OFS   out_leaving;    /* Bon Voyage                                */
  326.          OFS   out_return;     /* Welcome back from O)utside                */
  327.          OFS   daylimit;       /* Sorry, you've been on too long...         */
  328.          OFS   timewarn;       /* warning about forced hangup               */
  329.          OFS   sysop;          /* sysop's name                              */
  330.          OFS   tooslow;        /* explains minimum logon baud rate          */
  331.          OFS   xferbaud;       /* explains minimum file transfer baud rate  */
  332.          OFS   msgarea_list;   /* dump file... used instead of Dir.Bbs      */
  333.          OFS   file_area_list; /* dump file... used instead of Dir.Bbs      */
  334.          OFS   maillist_file;  /* default "nodelist" file                   */
  335.          OFS   byebye;         /* file displayed at logoff                  */
  336.          OFS   protocols[MAX_EXTERN]; /* external file protocol programs    */
  337.          OFS   local_editor;
  338.          OFS   file_mgt;       /* external file section management          */
  339.          OFS   hold_area;      /* path to pending outbound matrix traffic   */
  340.          OFS   barricade;
  341.          OFS   badaccess;
  342.          OFS   msg_mgt;        /* external message section maintenance      */
  343.  
  344.          OFS   mailpath;       /* path to inbound bundles                   */
  345.          OFS   filepath;       /* path for inbound matrix files             */
  346.          OFS   oped_help;      /* help file for the full-screen editor      */
  347.          OFS   temppath;       /* place to put temporary files              */
  348.          OFS   m_busy;         /* mdm cmd to take modem off hook            */
  349.          OFS   system_name;    /* board's name                              */
  350.          OFS   freq_about;     /* File Request: ABOUT file                  */
  351.  
  352.                /*-----------------------------------------------------------*/
  353.                /* Log_Name must always be the last offset in this struct    */
  354.                /* because Bbs_Init uses that symbol to flag the end of      */
  355.                /* the offsets.                                              */
  356.                /*-----------------------------------------------------------*/
  357.          OFS   log_name;       /* name of the log file                      */
  358.  
  359.  
  360.                /*-----------------------------------------------------------*/
  361.                /* Big blob of stuff                                         */
  362.                /* It's a sequence of null-terminated character arrays...    */
  363.                /* pointed-to by the offsets (above).                        */
  364.                /*-----------------------------------------------------------*/
  365.          char  buf[CTLSIZE];
  366.    };
  367.  
  368.  
  369. /*--------------------------------------------------------------------------*/
  370. /* Multitaskers (possible values for `ctl.multitasker'                      */
  371. /*              NOTE: 0 means no multitasker in use                         */
  372. /*--------------------------------------------------------------------------*/
  373. #define DoubleDOS 1
  374. #define DesqView  2
  375. #define TopView   3
  376. #define TaskView  4
  377. #define MsWindows 5  /* <-- not supported */
  378.  
  379.  
  380. /*--------------------------------------------------------------------------*/
  381. /* Matrix mask                                                              */
  382. /* Undefined bits are reserved by Opus                                      */
  383. /*--------------------------------------------------------------------------*/
  384. #define NO_TRAFFIC 0x0001  /* ok to send outbound local 0000 0000 0000 0001 */
  385. #define LOCAL_ONLY 0x0002  /* ok to send outbound local 0000 0000 0000 0010 */
  386. #define OPUS_ONLY  0x0004  /* only send to #CM systems  0000 0000 0000 0100 */
  387.  
  388. #define NO_EXITS   0x2000  /* crash/arc exits ignored   0010 0000 0000 0000 */
  389. #define MAIL_ONLY  0x4000  /* no human callers allowed  0100 0000 0000 0000 */
  390. #define TAKE_REQ   0x8000  /* file requests are ok      1000 0000 0000 0000 */
  391.  
  392.  
  393. /*--------------------------------------------------------------------------*/
  394. /* FLAGS                                                                    */
  395. /*--------------------------------------------------------------------------*/
  396. #define LOGECHO    0x0001  /* log echomail areas        0000 0000 0000 0001 */
  397. #define STEADY     0x0002  /* never change baud rate    0000 0000 0000 0010 */
  398. #define ECHOSCAN   0x0004  /* automatically scan echo's 0000 0000 0000 0100 */
  399. #define ECHO_GUARD 0x0008  /* no toss un-pwd echo arc   0000 0000 0000 1000 */
  400. #define NO_FWD     0x0010  /* No IN TRANSIT netmail   * 0000 0000 0001 0000 */
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.    
  415. /*--------------------------------------------------------------------------*/
  416. /* The rest of this file contains structure definitions similar to those    */
  417. /* used by Fido<tm> version 11w.  No claim is made that Opus will maintain  */
  418. /* compatibility with these structures beyond Opus version 0.               */
  419. /*                                                                          */
  420. /* The original version of the following items can be found in STRUCT.H, an */
  421. /* include file writte (and probably copyrighted by) Tom Jennings.          */
  422. /*--------------------------------------------------------------------------*/
  423.  
  424.  
  425.  
  426.  
  427.  
  428. /*--------------------------------------------------------------------------*/
  429. /* THE USER FILE                                                            */
  430. /* Please note that the user structure will be changed in the near future.  */
  431. /*--------------------------------------------------------------------------*/
  432.    
  433. #define  MAXLREAD  0x0a    /* Number of msg area pointers to maintain       */
  434.  
  435. struct   _usr
  436.    begin
  437.       char name[36];       /* Caller's first and last names                 */
  438.       char city[36];       /* Caller's location                             */
  439.  
  440.       struct {             /* Last message read for the prior 10 areas      */
  441.         word area;
  442.         word msg;
  443.       } lastmsg[MAXLREAD];
  444.  
  445.       char pwd[16];        /* Password                                      */
  446.       word times;          /* Number of previous calls to this system       */
  447.       int  help;           /* Help level (see below)                        */
  448.       word tabs;           /* 0=transmit <sp> instead of <tab>              */
  449.       word nulls;          /* Number of Nulls (delays) after <cr>           */
  450.       word msg;            /* Last message area visited                     */
  451.       bit  filler   : 3;
  452.       bit  use_lore : 1;   /* Use the line-oriented editor */
  453.       bit  more     : 1;   /* Wants the "MORE?" prompt                      */
  454.       bit  ansi     : 1;   /* OPUS: set=wants Ansi                          */
  455.       bit  kludge   : 1;   /* OPUS: set=used Opus before                    */
  456.       bit  formfeed : 1;   /* OPUS: set=transmit <ff>, clear=ignore <ff>    */
  457.       int  priv;           /* Access level (see below)                      */
  458.       char ldate[20];      /* Date of previous date (AsciiZ string)         */
  459.       int  time;           /* Time on-line so-far today                     */
  460.       word flag;           /* Used to hold baud rate on O)utside command    */
  461.       int  upld;           /* K-bytes uploaded, all calls                   */
  462.       int  dnld;           /* K-bytes downloaded, all calls                 */
  463.       int  dnldl;          /* K-bytes downloaded, today                     */
  464.       word files;          /* Last file area visited                        */
  465.       byte width;          /* Width of the caller's monitor                 */
  466.       byte len;            /* Height of the caller's */
  467.       int  credit;
  468.       int  debit;
  469.    end;
  470.  
  471.  
  472.  
  473. /*--------------------------------------------------------------------------*/
  474. /* Access levels                                                            */
  475. /* For information on how these are used in Opus, read the TechRef pamphlet */
  476. /* called REF_PRIV.DOC and the sample control file called OPUS.CTL          */
  477. /*--------------------------------------------------------------------------*/
  478. #define  TWIT        0xFFFE
  479. #define  DISGRACE    0x0000
  480. #define  NORMAL      0x0002
  481. #define  PRIVEL      0x0004
  482. #define  EXTRA       0x0006
  483. #define  ASSTSYSOP   0x0008
  484. #define  SYSOP       0x000A
  485. #define  HIDDEN      0x000B
  486.  
  487.  
  488.  
  489.  
  490. /*--------------------------------------------------------------------------*/
  491. /* User help levels                                                         */
  492. /*--------------------------------------------------------------------------*/
  493. #define  EXPERT      0x02  /* grizzled veteran, no menus at all             */
  494. #define  REGULAR     0x04  /* experienced user, brief menus                 */
  495. #define  NOVICE      0x06  /* Full menus plus additional hand-holding       */
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506. /*--------------------------------------------------------------------------*/
  507. /*                                                                          */
  508. /* MESSAGE AND FILE AREAS                                                   */
  509. /*                                                                          */
  510. /*--------------------------------------------------------------------------*/
  511.  
  512.  
  513. /*--------------------------------------------------------------------------*/
  514. /* System?.Bbs structure                                                    */
  515. /* Please note that the `_sys' structure should NOT be considered stable.   */
  516. /*--------------------------------------------------------------------------*/
  517. struct _sys {
  518.     word ls_caller;        /* Used in SYSTEM.BBS only: number of callers    */
  519.     int  priv;             /* Minimum privs required to get to the area     */
  520.     byte msgpath[40];      /* Path to messages                              */
  521.     byte bbspath[40];      /* Path to BBS/GBS files *or* the barricade file */
  522.     byte hlppath[40];      /* Path to the user-help system                  */
  523.     byte uppath[40];       /* Path to the file upload sub-directory         */
  524.     byte filepath[40];     /* Path to the file download sub-directory       */
  525.     word attrib;           /* Area attribute (see below)                    */
  526.     word ms_caller;        /* Unused by Opus v0.0                           */
  527.     long quote_pos;        /* Position of next usable byte in Quote file    */
  528. };
  529.  
  530. /*--------------------------------------------------------------------------*/
  531. /* Area attributes (limit or describe the behavior of an area)              */
  532. /*--------------------------------------------------------------------------*/
  533. #define  SYSMAIL   0x01    /* is a mail area                                */
  534. #define  SYSOVR    0x02    /* overwriting files OK                          */
  535. #define  NOPUBLIC  0x04    /* OPUS: Disallow public messages                */
  536. #define  NOPRIVATE 0x08    /* OPUS: Disallow private messages               */
  537. #define  ANON_OK   0x10    /* OPUS: Enable anonymous messages               */
  538. #define  ECHOMAIL  0x20    /* OPUS: Set=Echomail Clear=Not Echomail         */
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546. /*--------------------------------------------------------------------------*/
  547. /* THE MENU SYSTEM                                                          */
  548. /* A "priv" file is a sequence of these structures.  Note that the "priv"   */
  549. /* file system is fairly high on Wynn's DOOMED LIST.                        */
  550. /*--------------------------------------------------------------------------*/
  551.  
  552. struct _cmd
  553.    begin
  554.       char  name[20];
  555.       int   priv;
  556.    end;
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563. /*--------------------------------------------------------------------------*/
  564. /*                                                                          */
  565. /* MESSAGES                                                                 */
  566. /*                                                                          */
  567. /*--------------------------------------------------------------------------*/
  568.  
  569. /*--------------------------------------------------------------------------*/
  570. /* Message header                                                           */
  571. /*--------------------------------------------------------------------------*/
  572. struct _msg
  573.    begin
  574.       byte from[36];
  575.       byte to[36];
  576.       byte subj[72];
  577.       byte date[20];       /* Obsolete/unused ASCII date information        */
  578.       word times;          /* FIDO<tm>: Number of times read                */
  579.       word dest;           /* Destination node                              */
  580.       word orig;           /* Origination node number                       */
  581.       word cost;           /* Unit cost charged to send the message         */
  582.  
  583.       word orig_net;       /* Origination network number                    */
  584.       word dest_net;       /* Destination network number                    */
  585.                            
  586.                            /* A TIMESTAMP is a 32-bit integer in the Unix   */
  587.                            /* flavor (ie. the number of seconds since       */
  588.                            /* January 1, 1970).  Timestamps in messages are */
  589.                            /* always Greenwich Mean Time, never local time. */
  590.  
  591.       struct _stamp date_written;   /* When user wrote the msg              */
  592.       struct _stamp date_arrived;   /* When msg arrived on-line             */
  593.  
  594.       word reply;          /* Current msg is a reply to this msg number     */
  595.       word attr;           /* Attribute (behavior) of the message           */
  596.       word up;             /* Next message in the thread                    */
  597.    end;
  598.  
  599.  
  600.  
  601. /*--------------------------------------------------------------------------*/
  602. /* Message attributes                                                       */
  603. /*--------------------------------------------------------------------------*/
  604. #define MSGPRIVATE 0x0001  /* private message         * 0000 0000 0000 0001 */
  605. #define MSGCRASH   0x0002  /* squirtmail              * 0000 0000 0000 0010 */
  606. #define MSGREAD    0x0004  /* read by addressee       * 0000 0000 0000 0100 */
  607. #define MSGSENT    0x0008  /* sent OK (remote)          0000 0000 0000 1000 */
  608. #define MSGFILE    0x0010  /* file attached to msg    * 0000 0000 0001 0000 */
  609. #define MSGFWD     0x0020  /* in transit                0000 0000 0010 0000 */
  610. #define MSGORPHAN  0x0040  /* unknown dest node         0000 0000 0100 0000 */
  611. #define MSGKILL    0x0080  /* kill after bundling     * 0000 0000 1000 0000 */
  612. #define MSGLOCAL   0x0100  /* FidoNet vs. local         0000 0001 0000 0000 */
  613. #define MSGHOLD    0x0200  /* Hold, don't send        * 0000 0010 0000 0000 */
  614. #define MSGXX2     0x0400  /* <reserved>             X? 0000 0100 0000 0000 */
  615. #define MSGFRQ     0x0800  /* file request            * 0000 1000 0000 0000 */
  616. #define MSGRRQ     0x1000  /* receipt requested      X* 0001 0000 0000 0000 */
  617. #define MSGCPT     0x2000  /* is a return receipt    X* 0010 0000 0000 0000 */
  618. #define MSGARQ     0x4000  /* audit trail requested  X* 0100 0000 0000 0000 */
  619. #define MSGURQ     0x8000  /* update request         X* 1000 0000 0000 0000 */
  620.                                                    /*-----------------------*/
  621.                                                    /* ^                     */
  622.                                                    /* |                     */
  623.                                                    /*  * = preserved by     */
  624.                                                    /*      the network      */
  625.                                                    /*  ? = stripped by the  */
  626.                                                    /*      net (FTSC spec)  */
  627.                                                    /*      but preserved    */
  628.                                                    /*      by seadog<tm>    */
  629.                                                    /*  X = not used by Opus */
  630.                                                    /*-----------------------*/
  631.  
  632.  
  633.  
  634.  
  635. /*--------------------------------------------------------------------------*/
  636. /*                                                                          */
  637. /* EVENTS                                                                   */
  638. /*                                                                          */
  639. /*--------------------------------------------------------------------------*/
  640. #define EXT_EVENT   'X'    /* External event (return to Dos)                */
  641. #define YELL_EVENT  'Y'    /* Yell event (when Yell is on)                  */
  642. #define SCHEDS      35     /* Maximum number of events                      */
  643.  
  644. struct _time
  645.    begin
  646.       word  year;          /* Usable but doesn't make much sense            */
  647.       word  month;         /* For events only in 1 month                    */
  648.       word  day;           /* Day of the month                              */
  649.       word  daywk;         /* Day of the week (0=Sun,6=Sat,7=ALL)           */
  650.       word  hour;          /* 0..23                                         */
  651.       word  mins;          /* 0..59                                         */
  652.       word  sec;           /* Unused                                        */
  653.    end;
  654.  
  655.  
  656. /*--------------------------------------------------------------------------*/
  657. /* Schedule file record                                                     */
  658. /*--------------------------------------------------------------------------*/
  659. struct _sched
  660.    begin
  661.       struct _time time;   /* Starting time of the event                    */
  662.       word  len;           /* Duration of event in minutes                  */
  663.       int   enable;        /* 1==Enabled                                    */
  664.       word  trigger;       /* Unknown/unused                                */
  665.       word  result;        /* X errorlevel; OPUS: Yell bell duration        */
  666.       byte  tag;           /* Event type ('A'..'Z')                         */
  667.       byte  junk_1;        /* OPUS: ADDED TO MAKE THIS WORD-ALIGNED         */
  668.       word  last_ran;      /* OPUS: Day of the month executed last          */
  669.       word  b;             /* OPUS: Reserved for Opus                       */   
  670.       word  c;             /* OPUS: Reserved for external utilities         */
  671.       word  behavior;      /* (See below)                                   */
  672.       byte  event_mask;    /* OPUS: Force this event                        */
  673.       byte  GMT;           /* OPUS: Set=GMT, Clear=local time               */
  674.    end;
  675.  
  676.  
  677. /* MASKS */
  678. #define  FORCE_EVENT 0x0001 /* Execute this always */
  679.  
  680.  
  681. /* Z EVENTS BEHAVIOR...                                                     */
  682. /*    If RESULT==1, the `behavior' field contains a "matrix mask".  Those   */
  683. /*                  are described in #define's near the CTL declaration.    */
  684. /*    If RESULT==2, it is an internal housekeeping event                    */
  685.  
  686.  
  687. /* HOUSEKEEPING  */
  688. #define CLEAN_HOLD 0x0001  /* del HoldArea "$" files    0000 0000 0000 0001 */
  689. #define SCAN_ALL   0x0002  /* scan all echomail areas   0000 0000 0000 0010 */
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698. /*--------------------------------------------------------------------------*/
  699. /* Message bundle header                                                    */
  700. /*--------------------------------------------------------------------------*/
  701.  
  702. #define PKTVER       2        /* Used for `ver' (below)                     */
  703.  
  704.                               /*--------------------------------------------*/
  705.                               /* POSSIBLE VALUES FOR `product' (below)      */
  706.                               /*                                            */
  707.                               /* NOTE: These product codes are assigned by  */
  708.                               /* the FidoNet<tm> Technical Stardards Com-   */
  709.                               /* mittee.  If you are writing a program that */
  710.                               /* builds bundles, you will need a product    */
  711.                               /* code.  Please use ZERO until you get your  */
  712.                               /* own.  For more information on codes, write */
  713.                               /* to FTSC at 220/1.                          */
  714.                               /*                                            */
  715.                               /*--------------------------------------------*/
  716. #define isFIDO       0        /* Fido<tm>'s product code                    */
  717. #define isSPARK      1        /* FastScan, Rover, etc                       */
  718. #define isSEA        2        /* Seadog<tm>'s product code                  */
  719. #define isOPUS       5        /* Opus<no_tm>'s product code (a PRIME number)*/
  720. #define isHENK       6        /* Dutchie product code                       */
  721. #define isBRINKERS   7
  722. #define isTABBIE     8
  723. #define isDOUG       9
  724.  
  725.  
  726. struct _pkthdr
  727.    begin
  728.       int   orig_node;        /* originating node               */
  729.       int   dest_node;        /* destination node               */
  730.       int   year;             /* 0..99  when packet was created */
  731.       int   month;            /* 1..12  when packet was created */
  732.       int   day;              /* 1..31  when packet was created */
  733.       int   hour;             /* 0..23  when packet was created */
  734.       int   minute;           /* 0..59  when packet was created */
  735.       int   second;           /* 0..59  when packet was created */
  736.       int   rate;             /* destination's baud rate        */
  737.       int   ver;              /* packet version                 */
  738.       int   orig_net;         /* originating network number     */
  739.       int   dest_net;         /* destination network number     */
  740.       char  product;          /* product type                   */
  741.       char  x1;               /* filler (used by some systems)  */
  742.  
  743.                               /* ------------------------------ */
  744.                               /* THE FOLLOWING SECTION IS NOT   */
  745.                               /* THE SAME ACROSS SYSTEM LINES:  */
  746.                               /* ------------------------------ */
  747.       byte pwd_kludge[8];     /* ONLY 6 CHARS ARE SIGNIFICANT!! */
  748.       char extra[24];         /* extra bytes                    */
  749.                               /* ------------------------------ */
  750.    end;
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760. /*--------------------------------------------------------------------------*/
  761. /* WAZOO                                                                    */
  762. /*--------------------------------------------------------------------------*/
  763.  
  764. #ifdef WAZOO_SECTION
  765.  
  766. #ifndef ACK
  767. #define ACK    0x06
  768. #endif
  769.  
  770. #ifndef NAK
  771. #define NAK    0x15
  772. #endif
  773.  
  774. #ifndef ENQ
  775. #define ENQ    0x05
  776. #endif
  777.  
  778. #ifndef YOOHOO
  779. #define YOOHOO 0x00f1     /* 241 (a prime number, I think) */
  780. #endif
  781.  
  782. #ifndef  TSYNC    
  783. #define  TSYNC 0x00ae
  784. #endif
  785.  
  786. struct   _Hello
  787.    begin
  788.       word     signal;           /* always 'o'     (0x6f)                   */
  789.       word     hello_version;    /* currently 1    (0x01)                   */
  790.       word     product;          /* product code                            */
  791.       word     product_maj;      /* major revision of the product           */
  792.       word     product_min;      /* minor revision of the product           */
  793.       char     my_name[60];      /* Other end's name                        */
  794.       char     sysop[20];        /* sysop's name                            */
  795.       word     my_zone;          /* 0== not supported                       */
  796.       word     my_net;           /* out primary net number                  */
  797.       word     my_node;          /* our primary node number                 */
  798.       word     my_point;         /* 0== not supported                       */
  799.       byte     my_password[8];   /* ONLY 6 CHARACTERS ARE SIGNIFICANT !!!!! */
  800.       byte     reserved2[8];     /* reserved by Opus                        */
  801.       word     capabilities;     /* see below                               */
  802.       byte     reserved3[12];    /* available to non-Opus systems by prior  */
  803.                                  /* "approval" of 124/108.                  */
  804.    end; /* size 128 bytes */
  805.  
  806.  
  807. /*--------------------------------------------------------------------------*/
  808. /* YOOHOO<tm> CAPABILITY VALUES                                             */
  809. /*--------------------------------------------------------------------------*/
  810. #define Y_DIETIFNA 0x0001  /* Can do LoTek            0000 0000 0000 0001 */
  811. #define Bit_1      0x0002  /* reserved by Opus        0000 0000 0000 0010 */
  812. #define Bit_2      0x0004  /* reserved by Opus        0000 0000 0000 0100 */
  813. #define ZED_ZAPPER 0x0008  /* Can do ZModem/plain     0000 0000 0000 1000 */
  814. #define Bit_4      0x0010  /* reserved by Opus        0000 0000 0001 0000 */
  815. #define Bit_5      0x0020  /* reserved by Opus        0000 0000 0010 0000 */
  816. #define Bit_6      0x0040  /* reserved by Opus        0000 0000 0100 0000 */
  817. #define Bit_7      0x0080  /* reserved by Opus        0000 0000 1000 0000 */
  818. #define Bit_8      0x0100  /* reserved by Opus        0000 0001 0000 0000 */
  819. #define Bit_9      0x0200  /* reserved by Opus        0000 0010 0000 0000 */
  820. #define Bit_a      0x0400  /* reserved by Opus        0000 0100 0000 0000 */
  821. #define Bit_b      0x0800  /* reserved by Opus        0000 1000 0000 0000 */
  822. #define Bit_c      0x1000  /* reserved by Opus        0001 0000 0000 0000 */
  823. #define Bit_d      0x2000  /* reserved by Opus        0010 0000 0000 0000 */
  824. #define Bit_e      0x4000  /* reserved by Opus        0100 0000 0000 0000 */
  825. #define WZ_FREQ    0x8000  /* accepts file requests   1000 0000 0000 0000 */
  826.  
  827. #endif /* WaZOO_Section */
  828.  
  829. /* END OF FILE: opus.h */
  830.  
  831.  
  832.