home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / VP2SRC.ZIP / TYPES.H < prev    next >
C/C++ Source or Header  |  1988-08-04  |  10KB  |  338 lines

  1. /*
  2.   $Header: TYPES.H 3.3 87/12/12 00:46:54 Bob Exp $
  3.  
  4.                           The Conference Mail System
  5.  
  6.               This module was originally written by Bob Hartman
  7.                        Sysop of FidoNet node 1:132/101
  8.  
  9.    Spark Software, 427-3 Amherst St, CS 2032, Suite 232, Nashua, NH 03061
  10.  
  11.  The Conference Mail System  is a  complete Echomail processing package.  It
  12.  is a superset of the original  Echomail utilities created by Jeff Rush, and
  13.  also contains ideas gleaned from the  ARCmail,  Renum,  oMMM, MGM, and Opus
  14.  programs that were created by various software authors.
  15.  
  16.  This program source code is being released with the following provisions:
  17.  
  18.  1.  You are  free to make  changes to this source  code for use on your own
  19.  machine,  however,  altered source files may not be distributed without the 
  20.  consent of Spark Software.
  21.  
  22.  2.  You may distribute "patches"  or  "diff" files for any changes that you
  23.  have made, provided that the "patch" or "diff" files are also sent to Spark
  24.  Software for inclusion in future releases of the entire package.   A "diff"
  25.  file for the source archives may also contain a compiled version,  provided
  26.  it is  clearly marked as not  being created  from the original source code.
  27.  No other  executable  versions may be  distributed without  the  consent of
  28.  Spark Software.
  29.  
  30.  3.  You are free to include portions of this source code in any program you
  31.  develop, providing:  a) Credit is given to Spark Software for any code that
  32.  may is used, and  b) The resulting program is free to anyone wanting to use
  33.  it, including commercial and government users.
  34.  
  35.  4.  There is  NO  technical support  available for dealing with this source
  36.  code, or the accompanying executable files.  This source  code  is provided
  37.  as is, with no warranty expressed or implied (I hate legalease).   In other
  38.  words, if you don't know what to do with it,  don't use it,  and if you are
  39.  brave enough to use it, you're on your own.
  40.  
  41.  Spark Software may be contacted by modem at (603) 888-8179 (node 1:132/101)
  42.  on the public FidoNet network, or at the address given above.
  43.  
  44.  To use this code you will need Microsoft C version 4.0, and also Microsoft
  45.  Macro Assembler version 4.0.
  46.  
  47. */
  48.  
  49. /*
  50.    $Log:    TYPES.H $
  51.  * Revision 3.3  87/12/12  00:46:54  Bob
  52.  * Source code release
  53.  * 
  54. */
  55.  
  56. /*lint -e29 */
  57.  
  58. /*
  59.    Message header structure.  The message text is
  60.    just a long string after the header.
  61. */
  62.  
  63. struct   _stamp {
  64.       unsigned int date;
  65.       unsigned int time;
  66.     };
  67.  
  68. typedef struct {
  69.     char from[36];    /* who from */
  70.     char to[36];        /* who to */
  71.     char subj[72];    /* message subject */
  72.     char date[20];    /* creation date */
  73.     int times;            /* number of times read */
  74.     int dest;            /* destination node */
  75.     int orig;            /* originating node */
  76.     int cost;            /* actual cost of msg */
  77.     int orig_net;        /* originating net */
  78.     int dest_net;        /* destination net */
  79.      struct _stamp _date_written;  /* When user wrote the msg (GMT)        */
  80.     struct _stamp _date_arrived;  /* When msg arrived on-line (GMT)       */
  81. /*    int caca[4]; obsolete *//* extra space */
  82.     int reply;            /* thread to previous message */
  83.     int attr;            /* message type, below */
  84.     int up;                /* thread to next message */
  85. MSG, *MSG_PTR;
  86.  
  87. /*
  88.     CONFIG.DOG structure used by get_sea_config()
  89. */
  90.  
  91. typedef struct {
  92.     int num_addrs;            /* Number of addresses that follow */
  93.     int zone[20];            /* Zone numbers for addresses */
  94.     int net[20];            /* Net numbers */
  95.     int node[20];            /* Node numbers */
  96.     int point[20];            /* Point numbers */
  97.     char mailpath[80];    /* Path to mail directory */
  98.     char filepath[80];    /* Path to attached file directory */
  99.     int baud;                /* Maximum baud rate */
  100.     int comport;            /* Communications port used */
  101. }
  102. SEACONFIG, *SEACONFIG_PTR;
  103.  
  104. /*
  105.     AREAS.BBS in FastEcho format
  106. */
  107. typedef struct {
  108.     char *msg_path;
  109.     char *area_name;
  110.     int num_nodes;
  111.     int *msgs_in_area;
  112.     int *zone;
  113.     int *net;
  114.     int *node;
  115.    int *handle;
  116.    char **aname;
  117.    unsigned int flags;
  118. }
  119. AREAS, *AREAS_PTR;
  120.  
  121. /*
  122.    Passworded structure format
  123. */
  124. typedef struct {
  125.    int net;
  126.    int node;
  127.    char *password;
  128. }
  129. PW, *PW_PTR;
  130.  
  131.  
  132. /*
  133.     MAIL.SYS file structure
  134. */
  135.  
  136. typedef struct {
  137.     int node;            /* local node number */
  138.     float fudge;            /* cost fudge factor */
  139.     int rate;            /* baud rate */
  140.     char mailpath[80];        /* path to find mail in */
  141.     char filepath[80];        /* mail file path */
  142.     int net;            /* net number */
  143.     int alt_node;            /* alternate node number */
  144.     int alt_net;            /* alternate net number */
  145. MAIL, *MAIL_PTR;
  146.  
  147. /*
  148.     Node descriptor (NODELIST.SYS)
  149. */
  150.  
  151. typedef struct {
  152.     int number;            /* node number */
  153.     int net;            /* net number */
  154.     int cost;            /* cost per minute to call */
  155.     int rate;            /* baud rate */
  156.     char name[20];            /* node name */
  157.     char phone[40];            /* phone number */
  158.     char city[40];            /* city and state */
  159. NODE, *NODE_PTR;
  160.  
  161. typedef struct {
  162.     int orig_node;            /* originating node */
  163.     int dest_node;            /* destination node */
  164.     int year,
  165.     month,
  166.     day,
  167.     hour,
  168.     minute,
  169.     second;
  170.     int rate;            /* baud rate */
  171.     int ver;            /* packet version */
  172.     int orig_net;            /* originating net */
  173.     int dest_net;            /* destination net */
  174.      char product;       /* Product code */
  175.     char rev_lev;       /* revision level */ 
  176.     char password[8];   /* pickup password */ 
  177.     char extra[20];     /* extra space */ 
  178.     long pr_data;       /* product dependent data */ 
  179. PKTHDR, *PKTHDR_PTR;
  180.  
  181. typedef struct {
  182.     int ver;
  183.     int orig_node;
  184.     int dest_node;
  185.     int orig_net;
  186.     int dest_net;
  187.     int attr;
  188.     int cost;
  189. }
  190. PACKED, *PACKED_PTR;
  191.  
  192. /*
  193.     User records
  194. */
  195.  
  196. typedef struct {
  197.     char name[36];            /* user name */
  198.     char city[36];            /* city and state */
  199.     struct {            /* This structure holds the last */
  200.     int area;            /* message read counters.  It is */
  201.     int last_read;            /* used in place of the commented */
  202.     } 
  203.     msgs_read[10];        /* out 'int date[20];' */
  204.     /*    int date[20];*/            /* initial date */
  205.     char pwd[16];            /* password */
  206.     int times;            /* # times called */
  207.     int help;            /* last help setting */
  208.     int tabs;            /* 1 == expand tabs */
  209.     int nulls;            /* number of nulls */
  210.     int msg;            /* last message area */
  211.     int more;            /* last MORE setting */
  212.     int priv;            /* privilege setting */
  213.     char ldate[20];            /* last time called */
  214.     int time;            /* time on system in 1 day */
  215.     unsigned flag;            /* various bit flags */
  216.     unsigned upld;            /* total K bytes uploaded */
  217.     unsigned dnld;            /* total K bytes downloaded */
  218.     unsigned dnldl;            /* download limiting */
  219.     int files;            /* last file area */
  220.     char width;            /* screen width */
  221.     char len;            /* screen length */
  222.     int credit;            /* credit, in cents */
  223.     int debit;            /* debit, in cents */
  224. USR, *USR_PTR;
  225.  
  226. typedef struct {
  227.     int calls;            /* # calls in log */
  228.     char fdate[20];            /* logging started */
  229.     char ldate[20];            /* logging ended */
  230.     int log[7][24];            /* the counters */
  231. TLOG, *TLOG_PTR;
  232.  
  233. /*
  234.     Structure for each virtual bulletin board.
  235.     SYSTEM<n>.BBS files
  236. */
  237.  
  238. typedef struct {
  239.     int caller;            /* caller number */
  240.     int priv;            /* min privilege */
  241.     char msgpath[40];        /* path for message base */
  242.     char bbspath[40];        /* path for .BBS files */
  243.     char hlppath[40];        /* path for .HLP files */
  244.     char uppath[40];        /* path for uploads */
  245.     char filepath[40];        /* path for file area */
  246.     int attrib;            /* attributes */
  247. SYS, *SYS_PTR;
  248.  
  249. typedef struct {
  250.     char name[20];            /* Command name */
  251.     int priv;            /* Command privilege level */
  252. CMD, *CMD_PTR;
  253.  
  254. typedef struct {
  255.     CMD_PTR menu;            /* Current menu */
  256.     char *bottom_line;            /* Current bottom line */
  257. MENU, *MENU_PTR;
  258.  
  259. /* Standard time of day structure. */
  260.  
  261. typedef struct {
  262.      int year;
  263.       int month;
  264.       int day;
  265.       int daywk;
  266.      int hour;
  267.       int mins;
  268.       int sec;
  269. /* (daywk == 7 == every day. Month, day, year,
  270. sec not used by sched) */
  271. } TIMESTRCT, *TIMEPTR;
  272.  
  273. /* Scheduler time structure. */
  274.  
  275. typedef struct {
  276.      TIMESTRCT time;
  277.      int len;
  278.      int enable;         /* 1 == enabled -1 == 
  279.                             disabled 0 == deleted */
  280.      int trigger;        /* not used (yet) */
  281.      int result;         /* returned value */
  282.      char tag;           /* schedule tag */
  283.       char extra;             /* spacer */
  284.      int a,b,c,d,e;      /* extra garbage */
  285. } SCHED, *SCHEDPTR;
  286.  
  287. /*
  288.     Command structure for the parser.  It is very simple.
  289.     The parser takes the line and breaks it into the first
  290.     four commands that it recognizes.  If the command is a 
  291.     number, then the 'type' field will be that number (NOTE
  292.     that negative numbers are illegal in Fido commands), and
  293.     if the command is a char, then the type will be negative,
  294.     and the command char will be in the 'cmnd' field.
  295. */
  296.  
  297. typedef struct {
  298.     int type1;                /* type of command 1 */
  299.     char cmnd1;                /* command 1 if it is a char */
  300.     int type2;                /* type of command 2 */
  301.     char cmnd2;                /* command 2 if it is a char */
  302.     int type3;                /* type of command 3 */
  303.     char cmnd3;                /* command 3 if it is a char */
  304.     int type4;                /* type of command 4 */
  305.     char cmnd4;                /* command 4 if it is a char */
  306. CMND, *CMND_PTR;
  307.  
  308. typedef struct {
  309.    char *wbuff;
  310.    char *wptr;
  311.    int wsize;
  312. } WBUFFER, *WBUFFPTR;
  313.  
  314. typedef struct ktype {
  315.     long seconds;
  316.     unsigned int from;
  317.     unsigned int to;
  318.     unsigned int subject;
  319. } KILL, *KILLPTR;
  320.  
  321. typedef struct {
  322.    KILLPTR klink;
  323.     int msg_num;
  324.    char deleted;
  325.    char replied;
  326. } KILL2, *KILL2PTR;
  327.  
  328.