home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / MLNK10CS.ZIP / TYPES.H < prev   
Text File  |  1990-06-09  |  12KB  |  387 lines

  1. /*
  2.                        Message Base Reply Chain Linker
  3.  
  4.               This module was originally written by Bob Hartman
  5.                        Sysop of FidoNet node 1:132/101
  6.  
  7.    Spark Software, 427-3 Amherst St, CS 2032, Suite 232, Nashua, NH 03061
  8.  
  9.  This program source code is being released with the following provisions:
  10.  
  11.  1.  You are  free to make    changes to this source    code for use on your own
  12.  machine,  however,  altered source files may not be distributed without the
  13.  consent of Spark Software.
  14.  
  15.  2.  You may distribute "patches"  or  "diff" files for any changes that you
  16.  have made, provided that the "patch" or "diff" files are also sent to Spark
  17.  Software for inclusion in future releases of the entire package.    A "diff"
  18.  file for the source archives may also contain a compiled version,    provided
  19.  it is    clearly marked as not  being created  from the original source code.
  20.  No other  executable  versions may be    distributed without  the  consent of
  21.  Spark Software.
  22.  
  23.  3.  You are free to include portions of this source code in any program you
  24.  develop, providing:  a) Credit is given to Spark Software for any code that
  25.  may is used, and  b) The resulting program is free to anyone wanting to use
  26.  it, including commercial and government users.
  27.  
  28.  4.  There is  NO  technical support  available for dealing with this source
  29.  code, or the accompanying executable files.  This source  code  is provided
  30.  as is, with no warranty expressed or implied (I hate legalease).    In other
  31.  words, if you don't know what to do with it,  don't use it,  and if you are
  32.  brave enough to use it, you're on your own.
  33.  
  34.  Spark Software may be contacted by modem at (603) 888-8179 (node 1:132/101)
  35.  on the public FidoNet network, or at the address given above.
  36.  
  37. */
  38.  
  39. /*
  40.    Message header structure.  The message text is
  41.    just a long string after the header.
  42. */
  43.  
  44. struct     _stamp {
  45.       unsigned int date;
  46.       unsigned int time;
  47.     };
  48.  
  49. typedef struct {
  50.     char from[36];    /* who from */
  51.     char to[36];        /* who to */
  52.     char subj[72];    /* message subject */
  53.     char date[20];    /* creation date */
  54.     int times;            /* number of times read */
  55.     int dest;            /* destination node */
  56.     int orig;            /* originating node */
  57.     int cost;            /* actual cost of msg */
  58.     int orig_net;        /* originating net */
  59.     int dest_net;        /* destination net */
  60.      struct _stamp _date_written;  /* When user wrote the msg (GMT)        */
  61.     struct _stamp _date_arrived;  /* When msg arrived on-line (GMT)       */
  62. /*      int caca[4]; obsolete *//* extra space */
  63.     int reply;            /* thread to previous message */
  64.     int attr;            /* message type, below */
  65.     int up;             /* thread to next message */
  66. }
  67. MSG, *MSG_PTR;
  68.  
  69. /*
  70.     CONFIG.DOG structure used by get_sea_config()
  71. */
  72.  
  73. typedef struct {
  74.     int num_addrs;            /* Number of addresses that follow */
  75.     int zone[20];            /* Zone numbers for addresses */
  76.     int net[20];            /* Net numbers */
  77.     int node[20];            /* Node numbers */
  78.     int point[20];            /* Point numbers */
  79.     char mailpath[80];    /* Path to mail directory */
  80.     char filepath[80];    /* Path to attached file directory */
  81.     int baud;                /* Maximum baud rate */
  82.     int comport;            /* Communications port used */
  83. }
  84. SEACONFIG, *SEACONFIG_PTR;
  85.  
  86. /*
  87.     AREAS.BBS in FastEcho format
  88. */
  89. typedef struct {
  90.     char *msg_path;
  91.     char *area_name;
  92.     int num_nodes;
  93.     int *msgs_in_area;
  94.     int *net;
  95.     int *node;
  96.    int *handle;
  97.    char **aname;
  98.    unsigned int flags;
  99. }
  100. AREAS, *AREAS_PTR;
  101.  
  102. /*
  103.    Passworded structure format
  104. */
  105. typedef struct {
  106.    int net;
  107.    int node;
  108.    char *password;
  109. }
  110. PW, *PW_PTR;
  111.  
  112.  
  113. /*
  114.     MAIL.SYS file structure
  115. */
  116.  
  117. typedef struct {
  118.     int node;            /* local node number */
  119.     float fudge;            /* cost fudge factor */
  120.     int rate;            /* baud rate */
  121.     char mailpath[80];        /* path to find mail in */
  122.     char filepath[80];        /* mail file path */
  123.     int net;            /* net number */
  124.     int alt_node;            /* alternate node number */
  125.     int alt_net;            /* alternate net number */
  126. }
  127. MAIL, *MAIL_PTR;
  128.  
  129. /*
  130.     Node descriptor (NODELIST.SYS)
  131. */
  132.  
  133. typedef struct {
  134.     int number;         /* node number */
  135.     int net;            /* net number */
  136.     int cost;            /* cost per minute to call */
  137.     int rate;            /* baud rate */
  138.     char name[20];            /* node name */
  139.     char phone[40];         /* phone number */
  140.     char city[40];            /* city and state */
  141. }
  142. NODE, *NODE_PTR;
  143.  
  144. typedef struct {
  145.     int orig_node;            /* originating node */
  146.     int dest_node;            /* destination node */
  147.     int year,
  148.     month,
  149.     day,
  150.     hour,
  151.     minute,
  152.     second;
  153.     int rate;            /* baud rate */
  154.     int ver;            /* packet version */
  155.     int orig_net;            /* originating net */
  156.     int dest_net;            /* destination net */
  157.      char product;         /* Product code */
  158.     char rev_lev;        /* revision level */
  159.     char password[8];    /* pickup password */
  160.     char extra[20];     /* extra space */
  161.     long pr_data;        /* product dependent data */
  162. }
  163. PKTHDR, *PKTHDR_PTR;
  164.  
  165. typedef struct {
  166.     int ver;
  167.     int orig_node;
  168.     int dest_node;
  169.     int orig_net;
  170.     int dest_net;
  171.     int attr;
  172.     int cost;
  173. }
  174. PACKED, *PACKED_PTR;
  175.  
  176. /*
  177.     User records
  178. */
  179.  
  180. typedef struct {
  181.     char name[36];            /* user name */
  182.     char city[36];            /* city and state */
  183.     struct {            /* This structure holds the last */
  184.     int area;            /* message read counters.  It is */
  185.     int last_read;            /* used in place of the commented */
  186.     }
  187.     msgs_read[10];        /* out 'int date[20];' */
  188.     /*    int date[20];*/         /* initial date */
  189.     char pwd[16];            /* password */
  190.     int times;            /* # times called */
  191.     int help;            /* last help setting */
  192.     int tabs;            /* 1 == expand tabs */
  193.     int nulls;            /* number of nulls */
  194.     int msg;            /* last message area */
  195.     int more;            /* last MORE setting */
  196.     int priv;            /* privilege setting */
  197.     char ldate[20];         /* last time called */
  198.     int time;            /* time on system in 1 day */
  199.     unsigned flag;            /* various bit flags */
  200.     unsigned upld;            /* total K bytes uploaded */
  201.     unsigned dnld;            /* total K bytes downloaded */
  202.     unsigned dnldl;         /* download limiting */
  203.     int files;            /* last file area */
  204.     char width;         /* screen width */
  205.     char len;            /* screen length */
  206.     int credit;         /* credit, in cents */
  207.     int debit;            /* debit, in cents */
  208. }
  209. USR, *USR_PTR;
  210.  
  211. typedef struct {
  212.     int calls;            /* # calls in log */
  213.     char fdate[20];         /* logging started */
  214.     char ldate[20];         /* logging ended */
  215.     int log[7][24];         /* the counters */
  216. }
  217. TLOG, *TLOG_PTR;
  218.  
  219. /*
  220.     Structure for each virtual bulletin board.
  221.     SYSTEM<n>.BBS files
  222. */
  223.  
  224. typedef struct {
  225.     int caller;         /* caller number */
  226.     int priv;            /* min privilege */
  227.     char msgpath[40];        /* path for message base */
  228.     char bbspath[40];        /* path for .BBS files */
  229.     char hlppath[40];        /* path for .HLP files */
  230.     char uppath[40];        /* path for uploads */
  231.     char filepath[40];        /* path for file area */
  232.     int attrib;         /* attributes */
  233. }
  234. SYS, *SYS_PTR;
  235.  
  236. /* Standard time of day structure. */
  237.  
  238. typedef struct {
  239.      int year;
  240.       int month;
  241.       int day;
  242.       int daywk;
  243.      int hour;
  244.       int mins;
  245.       int sec;
  246. /* (daywk == 7 == every day. Month, day, year,
  247. sec not used by sched) */
  248. } TIMESTRCT, *TIMEPTR;
  249.  
  250. /* Scheduler time structure. */
  251.  
  252. typedef struct {
  253.      TIMESTRCT time;
  254.      int len;
  255.      int enable;         /* 1 == enabled -1 ==
  256.                             disabled 0 == deleted */
  257.      int trigger;         /* not used (yet) */
  258.      int result;         /* returned value */
  259.      char tag;             /* schedule tag */
  260.       char extra;             /* spacer */
  261.      int a,b,c,d,e;      /* extra garbage */
  262. } SCHED, *SCHEDPTR;
  263.  
  264. typedef struct {
  265.    char far *wbuff;
  266.    char far *wptr;
  267.    int wsize;
  268. } WBUFFER, *WBUFFPTR;
  269.  
  270. typedef struct {
  271.     long seconds;
  272.     unsigned int from;
  273.     unsigned int to;
  274.     unsigned int subject;
  275. } KILL, *KILLPTR;
  276.  
  277. typedef struct {
  278.    KILLPTR klink;
  279.     int msg_num;
  280.    char deleted;
  281.    char replied;
  282. } KILL2, *KILL2PTR;
  283.  
  284. /* PtMapper structure for holding point names */
  285. typedef struct PTSTRUCT {
  286.    char *pt_name;           /* Who it is */
  287.    int     pt_num;           /* Their point number */
  288.    char  ci;
  289.    char  co;
  290.    char  fi;
  291.    char  fo;
  292.    struct PTSTRUCT *next;  /* The next in this structure */
  293. } PTTYPE;
  294.  
  295. typedef struct {
  296.    char *mtxt;      /* Message text */
  297.    int     txtcnt;  /* Number of characters in text (not null terminated) */
  298. } MDSCR;
  299.  
  300.  
  301. /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
  302. /*%                                                                       %*/
  303. /*%                                                                       %*/
  304. /*%               S Y S T E M    F I L E   S T R U C T U R E               %*/
  305. /*%                                                                       %*/
  306. /*%                                                                       %*/
  307. /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
  308. /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
  309. /*                                                                           */
  310. /* Opus uses a single file called a System File to define each of up to    */
  311. /* 256 separate system areas numbered 0-255 and use the file name format   */
  312. /* of "SYSTEM##.DAT" where the '##' is the hexadecimal value of the system */
  313. /* number.    Please note that although the Opus user and sysop interfaces   */
  314. /* refer to system areas in decimal notation, the file names use hex.       */
  315. /*                                                                           */
  316. /* Although each system area file defines both message and file areas of   */
  317. /* the same number, those two systems are almost fully independent.        */
  318. /*                                                                           */
  319. /* For a related discussion on the meaning and use of 'locks' and 'keys'   */
  320. /* see the comments for ClassLock in the user record.                       */
  321. /*                                                                           */
  322. /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
  323.  
  324. typedef struct     {
  325.       /*........ (mostly) Common System Data ..............................*/
  326.  
  327.       word version;           /* System Record version = 110 = v1.10       */
  328.       word menu;              /* Alternate Menu file extension, 0=MNU       */
  329.       word attrib;              /* Area attributes (see below)               */
  330.       byte fillc1[10];          /* Reserved filler                           */
  331.       byte barrpath[ 40 ];      /* Barricade File path.                       */
  332.       byte fillc2[24];          /* Reserved filler                           */
  333.  
  334.       /*........ File System Information ..................................*/
  335.  
  336.       byte filtitle[ 50 ];      /* File Area Title                           */
  337.       byte filepath[ 40 ];      /* Path to the file download directory       */
  338.       byte uppath[     40 ];      /* Path to the file upload directory           */
  339.       byte listpath[ 40 ];      /* Path to FILES.BBS equivalent               */
  340.       byte fillf1[22];          /* Reserved filler                           */
  341.  
  342.       byte FilePriv;          /* Min priv for file area                    */
  343.       byte DownPriv;          /* If not 0, min priv to download            */
  344.       byte UpPriv;              /* If not 0, min priv to upload               */
  345.       byte FileExtPriv;       /* If not 0, min priv to go Outside           */
  346.       byte fillf2[12];          /* Reserved filler                           */
  347.  
  348.       long FileLock;          /* Locks for File Area                       */
  349.       long DownLock;          /* If not 0, keys needed to download           */
  350.       long UpLock;              /* If not 0, keys needed to upload           */
  351.       long FileExtLock;       /* If not 0, keys needed to go Outside       */
  352.       byte fillf3[32];          /* Reserved filler                           */
  353.  
  354.       /*........ Message System Information ...............................*/
  355.  
  356.       byte msgtitle[ 50 ];      /* Msg  Area Title                           */
  357.       byte msgpath[  40 ];      /* Path to messages                           */
  358.       byte fillm1[ 22 ];      /* Reserved filler                           */
  359.  
  360.       byte MsgPriv;           /* Min priv for msg area                       */
  361.       byte EditPriv;          /* If not 0, min priv to Enter or Reply       */
  362.       byte MsgExtPriv;          /* If not 0, min priv to go Outside           */
  363.       byte fillm2[13];          /* Reserved filler                           */
  364.  
  365.       long MsgLock;           /* Locks for Msg Area                        */
  366.       long EditLock;          /* If not 0, keys needed to Enter or Reply   */
  367.       long MsgExtLock;          /* If not 0, keys needed to go Outside       */
  368.       byte fillm3[4];          /* Reserved filler                           */
  369.       byte EchoName[32];      /* Echo Area 'Tag' Name                      */
  370.  
  371.       /*=================================== Total Record Size    = 512 =====*/
  372. }
  373. _sys, *_sys_ptr;
  374.  
  375.  
  376. /*-------------------------------------------------------------------------*/
  377. /*    'attrib' -- Area attributes (limit or describe area's behavior)        */
  378. /*-------------------------------------------------------------------------*/
  379.  
  380. /* #define    SYSMAIL   0x01 */    /* OPUS: Netmail Area                            */
  381. #define  NOPUBLIC  0x04    /* OPUS: Disallow Public messages               */
  382. #define  NOPRIVATE 0x08    /* OPUS: Disallow Private messages               */
  383. #define  ANON_OK   0x10    /* OPUS: Allow Anonymous messages               */
  384. #define  ECHOMAIL  0x20    /* OPUS: EchoMail Area                           */
  385.  
  386. /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
  387.