home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / PPPBCKP / SRC / SRC20A01.ZIP / VARDEC.H < prev    next >
C/C++ Source or Header  |  1999-06-05  |  56KB  |  1,505 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /*                             WWIV Version 4.3x                            */
  4. /*                Copyright (C) 1999 by WWIV Software Services              */
  5. /*                                                                          */
  6. /*      Distribution or publication of this source code, it's individual    */
  7. /*       components, or a compiled version thereof, whether modified or     */
  8. /*        unmodified, without PRIOR, WRITTEN APPROVAL of WWIV Software      */
  9. /*        Services is expressly prohibited.  Distribution of compiled       */
  10. /*            versions of WWIV is restricted to copies compiled by          */
  11. /*           WWIV Software Services.  Violators will be procecuted!         */
  12. /*                                                                          */
  13. /****************************************************************************/
  14. #ifndef _VARDEC_H_
  15. #define _VARDEC_H_
  16.  
  17. #ifdef _WIN32
  18.  #pragma pack(push, 1)
  19.  #pragma warning(push)
  20.  #pragma warning(disable : 4214)
  21. #endif
  22.  
  23. #define OK_LEVEL 0
  24. #define NOK_LEVEL 1
  25. #define QUIT_LEVEL 2
  26. #define EVENT_LEVEL 4
  27.  
  28. #define MAX_NUM_ACT 100
  29.  
  30. #define MAX_ARCS 15
  31. #define MAXMAIL 255
  32.  
  33. #define DELIMS_NORMAL " ;.!:-?,\t\r\n"
  34. #define DELIMS_WHITE  " \t\r\n"
  35.  
  36. #define AR_A 1
  37. #define AR_B 2
  38. #define AR_C 4
  39. #define AR_D 8
  40. #define AR_E 16
  41. #define AR_F 32
  42. #define AR_G 64
  43. #define AR_H 128
  44. #define AR_I 256
  45. #define AR_J 512
  46. #define AR_K 1024
  47. #define AR_L 2048
  48. #define AR_M 4096
  49. #define AR_N 8192
  50. #define AR_O 16384
  51. #define AR_P 32768
  52.  
  53.  
  54. /* DATA FOR EVERY USER */
  55. typedef struct {
  56.   unsigned char
  57.    name[31],                                /* user's name/handle */
  58.    realname[21],                            /* user's real name */
  59.    callsign[7],                             /* user's amateur callsign */
  60.    phone[13],                               /* user's phone number */
  61.    dataphone[13],                           /* user's data phone */
  62.    street[31],                              /* street address */
  63.    city[31],                                /* city */
  64.    state[3],                                /* state code [MO, CA, etc] */
  65.    country[4],                              /* country [USA, CAN, FRA, etc] */
  66.    zipcode[11],                             /* zipcode [#####-####] */
  67.    pw[9],                                   /* user's password */
  68.    laston[9],                               /* last date on */
  69.    firston[9],                              /* first date on */
  70.    note[61],                                /* sysop's note about user */
  71.    macros[3][81],                           /* macro keys */
  72.    sex;                                     /* user's sex */
  73.  
  74.   char
  75.    email[65],                              /* Internet mail address */
  76.    res_char[13];                           /* bytes for more strings */
  77.  
  78.   unsigned char
  79.    age,                                     /* user's age */
  80.    inact,                                   /* if deleted or inactive */
  81.    comp_type,                               /* computer type */
  82.    defprot,                                 /* deflt transfer protocol */
  83.    defed,                                   /* default editor */
  84.    screenchars,                             /* screen width */
  85.    screenlines,                             /* screen height */
  86.    num_extended,                            /* extended description lines */
  87.    optional_val,                            /* optional lines in msgs */
  88.    sl,                                      /* security level */
  89.    dsl,                                     /* transfer security level */
  90.    exempt,                                  /* exempt from ratios, etc */
  91.    colors[10],                              /* user's colors */
  92.    bwcolors[10],                            /* user's b&w colors */
  93.    votes[20],                               /* user's votes */
  94.    illegal,                                 /* illegal logons */
  95.    waiting,                                 /* number mail waiting */
  96.    ontoday,                                 /* num times on today */
  97.    month,                                   /* birth month */
  98.    day,                                     /* birth day */
  99.    year,                                    /* birth year */
  100.    language,                                /* language to use */
  101.    cbv;                                     /* called back */
  102.   char
  103.    res_byte[49];
  104.  
  105.   unsigned short
  106.    homeuser,                                /* user number where user can be
  107.                                              * found */
  108.    homesys,                                 /* system where user can be found */
  109.    forwardusr,                              /* mail forwarded to this user
  110.                                              * number */
  111.    forwardsys,                              /* mail forwarded to this system
  112.                                              * number */
  113.    net_num,                                 /* net num for forwarding */
  114.    msgpost,                                 /* number messages posted */
  115.    emailsent,                               /* number of email sent */
  116.    feedbacksent,                            /* number of f-back sent */
  117.    fsenttoday1,                             /* feedbacks today */
  118.    posttoday,                               /* number posts today */
  119.    etoday,                                  /* number emails today */
  120.    ar,                                      /* board access */
  121.    dar,                                     /* directory access */
  122.    restrict,                                /* restrictions on account */
  123.    ass_pts,                                 /* bad things the user did */
  124.    uploaded,                                /* number files uploaded */
  125.    downloaded,                              /* number files downloaded */
  126.    lastrate,                                /* last baud rate on */
  127.    logons,                                  /* total number of logons */
  128.    emailnet,                                /* email sent via net */
  129.    postnet,                                 /* posts sent thru net */
  130.    deletedposts,                            /* how many posts deleted */
  131.    chainsrun,                               /* how many "chains" run */
  132.    gfilesread,                              /* how many gfiles read */
  133.    banktime,                                /* how many mins in timebank */
  134.    homenet,                                 /* home net number */
  135.    subconf,                                 /* previous conference subs */
  136.    dirconf,                                 /* previous conference dirs */
  137.    subnum,                                  /* last sub at logoff */
  138.    dirnum;                                  /* last dir at logoff */
  139.   char
  140.    res_short[40];                           /* reserved for short values */
  141.  
  142.   unsigned long
  143.    msgread,                                 /* total num msgs read */
  144.    uk,                                      /* number of k uploaded */
  145.    dk,                                      /* number of k downloaded */
  146.    daten,                                   /* numerical time last on */
  147.    sysstatus,                               /* status/defaults */
  148.    wwiv_regnum,                             /* user's WWIV reg number */
  149.    filepoints,                              /* points to spend for files */
  150.    registered,                              /* numerical registration date */
  151.    expires,                                 /* numerical expiration date */
  152.    datenscan,                               /* numerical date of last new
  153.                                              * file scan */
  154.    nameinfo;                                /* bit mapping for name case */
  155.  
  156.   char
  157.    res_long[40];                            /* reserved for long values */
  158.  
  159.   float
  160.    timeontoday,                             /* time on today */
  161.    extratime,                               /* time left today */
  162.    timeon,                                  /* total time on system */
  163.    pos_account,                             /* $ credit */
  164.    neg_account,                             /* $ debit */
  165.    gold;                                    /* game money */
  166.  
  167.   char
  168.    res_float[32];                           /* reserved for real values */
  169.  
  170.   char
  171.    res_gp[94];                              /* reserved for whatever */
  172.  
  173.   unsigned short int qwk_max_msgs;
  174.   unsigned short int qwk_max_msgs_per_sub;
  175.  
  176.  unsigned short int qwk_dont_scan_mail: 
  177.    1;
  178.  unsigned short int qwk_delete_mail: 
  179.    1;
  180.  unsigned short int qwk_dontsetnscan: 
  181.    1;
  182.  unsigned short int qwk_remove_color: 
  183.    1;
  184.  unsigned short int qwk_convert_color: 
  185.    1;
  186.  unsigned short int qwk_archive: 
  187.    3;
  188.  unsigned short int qwk_leave_bulletin: 
  189.    1;
  190.  unsigned short int qwk_dontscanfiles: 
  191.    1;
  192.  unsigned short int qwk_keep_routing: 
  193.    1;
  194.  unsigned short int full_desc:
  195.    1;
  196.  unsigned short int qwk_protocol: 
  197.    4;
  198.  
  199. } userrec;
  200.  
  201.  
  202. /* SECLEV DATA FOR 1 SL */
  203. typedef struct {
  204.   unsigned short time_per_day,              /* time allowed on per day */
  205.    time_per_logon,                          /* time allowed on per logon */
  206.    messages_read,                           /* messages allowed to read */
  207.    emails,                                  /* number emails allowed */
  208.    posts;                                   /* number posts allowed */
  209.   unsigned long ability;                 /* bit mapped abilities */
  210. } slrec;
  211.  
  212.  
  213. /* AUTO-VALIDATION DATA */
  214. typedef struct {
  215.   unsigned char sl,                         /* SL */
  216.    dsl;                                     /* DSL */
  217.   unsigned short ar,                        /* AR */
  218.    dar,                                     /* DAR */
  219.    restrict;                                /* restrictions */
  220. } valrec;
  221.  
  222.  
  223. typedef struct {
  224.   char extension[4],                        /* extension for archive */
  225.    arca[32],                                /* add commandline */
  226.    arce[32],                                /* extract commandline */
  227.    arcl[32];                                /* list commandline */
  228. } oldarcrec;
  229.  
  230. typedef struct {
  231.   char name[32],                            /* name of the archiver */
  232.    extension[4],                            /* extension for archive */
  233.    arca[50],                                /* add commandline */
  234.    arce[50],                                /* extract commandline */
  235.    arcl[50],                                /* list commandline */
  236.    arcd[50],                                /* delete commandline */
  237.    arck[50],                                /* comment commandline */
  238.    arct[50];                                /* test commandline */
  239. } arcrec;
  240.  
  241.  
  242. /* STATIC SYSTEM INFORMATION */
  243. typedef struct {
  244.   char newuserpw[21],                       /* new user password */
  245.    systempw[21],                            /* system password */
  246.    msgsdir[81],                             /* path for msgs directory */
  247.    gfilesdir[81],                           /* path for gfiles dir */
  248.    datadir[81],                             /* path for data directory */
  249.    dloadsdir[81],                           /* path for dloads dir */
  250.    ramdrive,                                /* drive for ramdisk */
  251.    tempdir[81],                             /* path for temporary directory */
  252.    xmark,                                   /* 0xff */
  253.    regcode[83],                             /* registration code */
  254.    bbs_init_modem[51],                      /* modem initialization cmd */
  255.    answer[21],                              /* modem answer cmd */
  256.    connect_300[21],                         /* modem responses for */
  257.    connect_1200[21],                        /* connections made at */
  258.    connect_2400[21],                        /* various speeds */
  259.    connect_9600[21], connect_19200[21], no_carrier[21],        /* modem disconnect */
  260.    ring[21],                                /* modem ring */
  261.    terminal[21],                            /* DOS cmd for run term prg */
  262.    systemname[51],                          /* BBS system name */
  263.    systemphone[13],                         /* BBS system phone number */
  264.    sysopname[51],                           /* sysop's name */
  265.    executestr[51];                          /* mail route path name */
  266.   unsigned char newusersl,                  /* new user SL */
  267.    newuserdsl,                              /* new user DSL */
  268.    maxwaiting,                              /* max mail waiting */
  269.    comport[5],                              /* what connected to comm */
  270.    com_ISR[5],                              /* Com Interrupts */
  271.    primaryport,                             /* primary comm port */
  272.    newuploads,                              /* file dir new uploads go */
  273.    closedsystem;                            /* if system is closed */
  274.   unsigned short systemnumber,              /* BBS system number */
  275.    baudrate[5],                             /* Baud rate for com ports */
  276.    com_base[5],                             /* Com base addresses */
  277.    maxusers,                                /* max users on system */
  278.    newuser_restrict,                        /* new user restrictions */
  279.    sysconfig,                               /* System configuration */
  280.    sysoplowtime,                            /* Chat time on */
  281.    sysophightime,                           /* Chat time off */
  282.    executetime;                             /* time to run mail router */
  283.   float req_ratio,                          /* required up/down ratio */
  284.    newusergold;                             /* new user gold */
  285.   slrec sl[256];                            /* security level data */
  286.   valrec autoval[10];                       /* sysop quik-validation data */
  287.   char hangupphone[21],                     /* string to hang up phone */
  288.    pickupphone[21];                         /* string to pick up phone */
  289.   unsigned short netlowtime,                /* net time on */
  290.    nethightime;                             /* net time off */
  291.   char connect_300_a[21],                   /* alternate connect string */
  292.    connect_1200_a[21],                      /* alternate connect string */
  293.    connect_2400_a[21],                      /* alternate connect string */
  294.    connect_9600_a[21],                      /* alternate connect string */
  295.    connect_19200_a[21];                     /* alternate connect string */
  296.   oldarcrec arcs[4];                        /* old archivers */
  297.   char beginday_c[51],                      /* beginday event */
  298.    logon_c[51];                             /* logon event */
  299.   short userreclen,                         /* user record length */
  300.    waitingoffset,                           /* mail waiting offset */
  301.    inactoffset;                             /* inactive offset */
  302.   char newuser_c[51];                       /* newuser event */
  303.   unsigned long wwiv_reg_number;            /* user's reg number */
  304.   char dial_prefix[21];
  305.   float post_call_ratio;
  306.   char upload_c[51],                        /* upload event */
  307.    dszbatchdl[81], modem_type[9], batchdir[81];
  308.   short sysstatusoffset;                    /* system status offset */
  309.   char network_type;
  310.   short fuoffset, fsoffset, fnoffset;
  311.   unsigned short max_subs, max_dirs, qscn_len;
  312.   unsigned char email_storage_type;
  313.   unsigned long sysconfig1, rrd;
  314.   char menudir[81];                         /* path for menu dir */
  315.   char res[100];                            /* RESERVED */
  316. } configrec;
  317.  
  318. typedef struct {
  319.     char          * newuserpw,          /* new user password */
  320.                   * systempw,           /* system password */
  321.  
  322.                   * msgsdir,            /* path for msgs directory */
  323.                   * gfilesdir,          /* path for gfiles dir */
  324.                   * datadir,            /* path for data directory */
  325.                   * dloadsdir,          /* path for dloads dir */
  326.                   * batchdir,
  327.                   * menudir,            /* path for menu dir */
  328.                   * ansidir,            /* path for ansi dir */
  329.                   * terminal,           /* DOS cmd for run term prg */
  330.  
  331.                   * systemname,         /* BBS system name */
  332.                   * systemphone,        /* BBS system phone number */
  333.                   * sysopname,          /* sysop's name */
  334.                   * regcode,            /* registration code */
  335.                   * executestr,         /* mail route path name */
  336.  
  337.                   * beginday_c,         /* beginday event */
  338.                   * logon_c,            /* logon event */
  339.                   * newuser_c,          /* newuser event */
  340.                   * upload_c,           /* upload event */
  341.                   * dszbatchdl,
  342.                   * dial_prefix;
  343.  
  344.     unsigned char   newusersl,          /* new user SL */
  345.                     newuserdsl,         /* new user DSL */
  346.                     maxwaiting,         /* max mail waiting */
  347.                     newuploads,         /* file dir new uploads go */
  348.                     closedsystem;       /* if system is closed */
  349.  
  350.  
  351.     unsigned short  systemnumber,       /* BBS system number */
  352.                     maxusers,           /* max users on system */
  353.                     newuser_restrict,   /* new user restrictions */
  354.                     sysconfig,          /* System configuration */
  355.                     sysoplowtime,       /* Chat time on */
  356.                     sysophightime,      /* Chat time off */
  357.                     executetime,        /* time to run mail router */
  358.                     netlowtime,         /* net time on */
  359.                     nethightime,        /* net time off */
  360.                     max_subs,
  361.                     max_dirs,
  362.                     qscn_len,
  363.                     userreclen;
  364.  
  365.     float           post_call_ratio,
  366.                     req_ratio,
  367.                     newusergold;
  368.  
  369.     valrec          autoval[10];        /* sysop quik-validation data*/
  370.  
  371.  
  372.     unsigned long   wwiv_reg_number,   /* user's reg number */
  373.                     sysconfig1,
  374.                     rrd;
  375. } small_configrec;
  376.  
  377.  
  378. /* overlay information per instance */
  379. typedef struct {
  380.   unsigned char com_ISR[9], primaryport;
  381.   unsigned short com_base[9];
  382.   char modem_type[9], tempdir[81], batchdir[81];
  383.   unsigned short comflags;
  384.   char bootdrive;
  385.   char res[310];
  386. } configoverrec;
  387.  
  388.  
  389. /* DYNAMIC SYSTEM STATUS */
  390. typedef struct {
  391.   char date1[9],                            /* last date active */
  392.    date2[9],                                /* date before now */
  393.    date3[9],                                /* two days ago */
  394.    log1[13],                                /* yesterday's log */
  395.    log2[13],                                /* two days ago log */
  396.    gfiledate[9],                            /* date gfiles last updated */
  397.    filechange[7];                           /* flags for files changing */
  398.   unsigned short localposts,                /* how many local posts today */
  399.    users,                                   /* Current number of users */
  400.    callernum,                               /* Current caller number */
  401.    callstoday,                              /* Number of calls today */
  402.    msgposttoday,                            /* Messages posted today */
  403.    emailtoday,                              /* Email sent today */
  404.    fbacktoday,                              /* Feedback sent today */
  405.    uptoday,                                 /* files uploaded today */
  406.    activetoday;                             /* Minutes active today */
  407.   unsigned long qscanptr;                   /* Q-scan pointer value */
  408.   char amsganon;                            /* auto-message anony stat */
  409.   unsigned short amsguser;                  /* user who wrote a-msg */
  410.   unsigned long callernum1;                 /* caller number */
  411.   unsigned short net_edit_stuff;            /* word for net editor */
  412.   unsigned short wwiv_version;              /* tell what version it is */
  413.   unsigned short net_version;               /* tell what version of net */
  414.   float net_bias;                           /* network bias factor */
  415.   long last_connect,                        /* date last connect.net */
  416.    last_bbslist;                            /* date last bbslist.net */
  417.   float net_req_free;                       /* net free factor def 3 */
  418.   unsigned short days;                      /* # days BBS active */
  419.   char res[29];                             /* RESERVED */
  420. } statusrec;
  421.  
  422. typedef struct {
  423.   unsigned char resx[240];
  424. } colorrec;
  425.  
  426. /* MESSAGE BASE INFORMATION */
  427. typedef struct {
  428.   char name[41],                            /* board name */
  429.    filename[9],                             /* board database filename */
  430.    key;                                     /* board special key */
  431.   unsigned char readsl,                     /* sl required to read */
  432.    postsl,                                  /* sl required to post */
  433.    anony,                                   /* anonymous board? */
  434.    age;                                     /* minimum age for sub */
  435.   unsigned short maxmsgs,                   /* max # of msgs */
  436.    ar,                                      /* AR for sub-board */
  437.    storage_type,                            /* how messages are stored */
  438.    type;                                    /* 4 digit board type */
  439. } subboardrec;
  440.  
  441.  
  442.  
  443. /* UPLOAD DIRECTORY INFORMATION */
  444. typedef struct {
  445.   char name[41],                            /* directory name */
  446.    filename[9],                             /* direct database filename */
  447.    path[81];                                /* filename path */
  448.   unsigned char dsl,                        /* DSL for directory */
  449.    age;                                     /* minimum age for directory */
  450.   unsigned short dar,                       /* DAR for directory */
  451.    maxfiles,                                /* max files for directory */
  452.    mask,                                    /* file type mask */
  453.    type;                                    /* 4 digit directory type */
  454. } directoryrec;
  455.  
  456.  
  457.  
  458. /* QUICK REFERNCE TO FIND USER NUMBER FROM NAME */
  459. typedef struct {
  460.   unsigned char name[31];
  461.   unsigned short number;
  462. } smalrec;
  463.  
  464.  
  465.  
  466. /* TYPE TO TELL WHERE A MESSAGE IS STORED */
  467. typedef struct {
  468.   unsigned char storage_type;               /* how it is stored */
  469.   unsigned long stored_as;                  /* where it is stored */
  470. } messagerec;
  471.  
  472.  
  473. /* DATA HELD FOR EVERY POST */
  474. typedef struct {
  475.   char title[81];                           /* title of post */
  476.   unsigned char anony,                      /* anony-stat of message */
  477.    status;                                  /* bit-mapped status */
  478.   unsigned short ownersys,                  /* what system it came from */
  479.    owneruser;                               /* who posted it */
  480.   unsigned long qscan,                      /* qscan pointer */
  481.    daten;                                   /* numerical date posted */
  482.   messagerec msg;                           /* where to find it */
  483. } postrec;
  484.  
  485.  
  486.  
  487. /* DATA HELD FOR EVERY E-MAIL OR F-BACK */
  488. typedef struct {
  489.   char title[81];                           /* E-mail title */
  490.   unsigned char anony,                      /* anonymous mail? */
  491.    status;                                  /* status for e-mail */
  492.   unsigned short fromsys,                   /* originating system */
  493.    fromuser,                                /* originating user */
  494.    tosys,                                   /* destination system */
  495.    touser;                                  /* destination user */
  496.   unsigned long daten;                      /* date it was sent */
  497.   messagerec msg;                           /* where to find it */
  498. } mailrec;
  499.  
  500. /* USED IN READMAIL TO STORE EMAIL INFO */
  501. typedef struct {
  502.   short index;                              /* index into email.dat */
  503.   unsigned short fromsys,                   /* originating system */
  504.    fromuser;                                /* originating user */
  505.   unsigned long daten;                      /* date it was sent */
  506.   messagerec msg;                           /* where to find it */
  507. } tmpmailrec;
  508.  
  509.  
  510. /* SHORT RESPONSE FOR USER, TELLING HIS MAIL HAS BEEN READ */
  511. typedef struct {
  512.   char message[81];                         /* short message to user */
  513.   unsigned short tosys, touser;             /* who it is to */
  514. } shortmsgrec;
  515.  
  516.  
  517.  
  518. /* VOTING RESPONSE DATA */
  519. typedef struct {
  520.   char response[81];                        /* Voting question response */
  521.   unsigned short numresponses;              /* number of responses */
  522. } voting_response;
  523.  
  524.  
  525.  
  526. /* VOTING DATA INFORMATION */
  527. typedef struct {
  528.   char question[81];                        /* Question */
  529.   unsigned char numanswers;                 /* number of responses */
  530.   voting_response responses[20];            /* actual responses */
  531. } votingrec;
  532.  
  533.  
  534.  
  535. /* DATA HELD FOR EVERY UPLOAD */
  536. typedef struct {
  537.   char filename[13],                        /* filename */
  538.    description[59],                         /* file description */
  539.    date[9],                                 /* date u/l'ed */
  540.    upby[37],                                /* name of upload user */
  541.    actualdate[9];                           /* actual file date */
  542.   unsigned char filetype;                   /* file type for apples */
  543.   unsigned short numdloads,                 /* number times d/l'ed */
  544.    ownersys, ownerusr,                      /* who uploaded it */
  545.    mask;                                    /* file type mask */
  546.   unsigned long daten,                      /* date uploaded */
  547.    numbytes;                                /* number bytes long file is */
  548. } uploadsrec;
  549.  
  550.  
  551. typedef struct {
  552.   uploadsrec u;                             /* file information */
  553.   short directory;                          /* directory number */
  554.   unsigned short dir_mask;                  /* directory mask */
  555. } tagrec;
  556.  
  557.  
  558. /* ZLOG INFORMATION FOR PAST SYSTEM USAGE */
  559. typedef struct {
  560.   char date[9];                             /* zlog for what date */
  561.   unsigned short active,                    /* number minutes active */
  562.    calls,                                   /* number calls */
  563.    posts,                                   /* number posts */
  564.    email,                                   /* number e-mail */
  565.    fback,                                   /* number f-back */
  566.    up;                                      /* number uploads */
  567. } zlogrec;
  568.  
  569.  
  570.  
  571. /* DATA FOR OTHER PROGRAMS AVAILABLE */
  572. typedef struct {
  573.   char filename[81],                        /* filename for .chn file */
  574.    description[81];                         /* description of it */
  575.   unsigned char sl,                         /* seclev restriction */
  576.    ansir;                                   /* if ANSI required */
  577.   unsigned short ar;                        /* AR restriction */
  578. } chainfilerec;
  579.  
  580.  
  581. typedef struct {
  582.   short int regby[5],                       /* who registered */
  583.    usage;                                   /* number of runs */
  584.   unsigned char minage,                     /* minimum age necessary */
  585.    maxage;                                  /* maximum age allowed */
  586.   char space[50];                           /* reserved space */
  587. } chainregrec;
  588.  
  589.  
  590. /* DATA FOR EXTERNAL PROTOCOLS */
  591. typedef struct {
  592.   char description[81],                     /* protocol description */
  593.    receivefn[81],                           /* receive filename */
  594.    sendfn[81];                              /* send filename */
  595.   unsigned short ok1, ok2,                  /* if sent */
  596.    nok1, nok2;                              /* if not sent */
  597. } externalrec;
  598.  
  599. typedef struct {
  600.   char description[81],                     /* protocol description */
  601.    receivefn[81],                           /* receive filename */
  602.    sendfn[81],                              /* send filename */
  603.    receivebatchfn[81],                      /* batch receive cmd */
  604.    sendbatchfn[81],                         /* batch send cmd */
  605.    bibatchfn[81];                           /* batch send/receive cmd */
  606.   unsigned short ok1,                       /* if sent */
  607.    othr;                                    /* other flags */
  608.   char pad[22];
  609. } newexternalrec;
  610.  
  611.  
  612. /* DATA FOR EXTERNAL EDITORS */
  613. typedef struct {
  614.   char description[81],                     /* description of editor */
  615.    filename[81];                            /* how to run the editor */
  616.   unsigned long config;                     /* configuration for editor */
  617.   char filenamecon[81];                     /* how to run locally */
  618.   char res[119];
  619. } editorrec;
  620.  
  621.  
  622.  
  623. /* DATA FOR CONVERSION OF MAIN MENU KEYS TO SUB-BOARD NUMBERS */
  624. typedef struct {
  625.   char keys[5];
  626.   short subnum;
  627. } usersubrec;
  628.  
  629.  
  630. typedef struct {
  631.   short confnum;
  632. } userconfrec;
  633.  
  634.  
  635. typedef struct {
  636.   char sending;
  637.   char filename[13];
  638.   short dir;
  639.   float time;
  640.   long len;
  641. } batchrec;
  642.  
  643.  
  644. typedef enum {
  645.   xf_up, xf_down, xf_up_temp, xf_down_temp, xf_up_batch, xf_down_batch, xf_bi, xf_none
  646. } xfertype;
  647.  
  648. /* userrec.inact */
  649. #define inact_deleted  0x01
  650. #define inact_inactive 0x02
  651.  
  652. /* userrec.exempt */
  653. #define exempt_ratio 0x01
  654. #define exempt_time  0x02
  655. #define exempt_post  0x04
  656. #define exempt_all   0x08
  657. #define exempt_adel  0x10
  658.  
  659. /* userrec.restrict */
  660. #define restrict_logon           0x0001
  661. #define restrict_chat            0x0002
  662. #define restrict_validate        0x0004
  663. #define restrict_automessage     0x0008
  664. #define restrict_anony           0x0010
  665. #define restrict_post            0x0020
  666. #define restrict_email           0x0040
  667. #define restrict_vote            0x0080
  668. #define restrict_iichat          0x0100
  669. #define restrict_net             0x0200
  670. #define restrict_upload          0x0400
  671.  
  672. #define restrict_string "LCMA*PEVKNU     "
  673.  
  674. /* userrec.sysstatus */
  675. #define sysstatus_ansi              0x00000001
  676. #define sysstatus_color             0x00000002
  677. #define sysstatus_music             0x00000004
  678. #define sysstatus_pause_on_page     0x00000008
  679. #define sysstatus_expert            0x00000010
  680. #define sysstatus_smw               0x00000020
  681. #define sysstatus_full_screen       0x00000040
  682. #define sysstatus_nscan_file_system 0x00000080
  683. #define sysstatus_extra_color       0x00000100
  684. #define sysstatus_clr_scrn          0x00000200
  685. #define sysstatus_upper_ASCII       0x00000400
  686. #define sysstatus_no_tag            0x00001000
  687. #define sysstatus_conference        0x00002000
  688. #define sysstatus_nochat            0x00004000
  689. #define sysstatus_no_msgs           0x00010000
  690. #define sysstatus_menusys           0x00020000
  691. #define sysstatus_listplus          0x00040000
  692.  
  693. /* slrec.ability */
  694. #define ability_post_anony       0x0001
  695. #define ability_email_anony      0x0002
  696. #define ability_read_post_anony  0x0004
  697. #define ability_read_email_anony 0x0008
  698. #define ability_limited_cosysop  0x0010
  699. #define ability_cosysop          0x0020
  700. #define ability_val_net          0x0040
  701.  
  702. /* subboardrec.anony */
  703. #define anony_enable_anony     0x01
  704. #define anony_enable_dear_abby 0x02
  705. #define anony_force_anony      0x04
  706. #define anony_real_name        0x08
  707. #define anony_val_net          0x10
  708. #define anony_ansi_only        0x20
  709. #define anony_no_tag           0x40
  710. #define anony_require_sv       0x80
  711.  
  712. /* postrec.anony, mailrec.anony */
  713. #define anony_sender      0x01
  714. #define anony_sender_da   0x02
  715. #define anony_sender_pp   0x03
  716. #define anony_receiver    0x10
  717. #define anony_receiver_da 0x20
  718. #define anony_receiver_pp 0x30
  719.  
  720. /* directoryrec.mask */
  721. #define mask_PD            0x0001
  722. #define mask_no_uploads    0x0004
  723. #define mask_archive       0x0008
  724. #define mask_pending_batch 0x0010
  725. #define mask_no_ratio      0x0020
  726. #define mask_cdrom         0x0040
  727. #define mask_offline       0x0080
  728. #define mask_uploadall     0x0200
  729. #define mask_guest         0x4000
  730. #define mask_extended      0x8000
  731. #define mask_wwivreg       0x1000
  732.  
  733. /* postrec.status */
  734. #define status_unvalidated          0x01
  735. #define status_delete               0x02
  736. #define status_no_delete            0x04
  737. #define status_pending_net          0x08
  738. #define status_post_source_verified 0x10
  739. #define status_post_new_net         0x20
  740.  
  741. /* mailrec.status */
  742. #define status_multimail        0x01
  743. #define status_source_verified  0x02
  744. #define status_new_net          0x04
  745. #define status_seen             0x08
  746. #define status_replied          0x10
  747. #define status_forwarded        0x20
  748. #define status_file             0x80
  749.  
  750. /* configrec.sysconfig */
  751. #define sysconfig_no_local      0x0001
  752. #define sysconfig_no_beep       0x0002
  753. #define sysconfig_high_speed    0x0004
  754. #define sysconfig_off_hook      0x0008
  755. #define sysconfig_two_color     0x0010
  756. #define sysconfig_flow_control  0x0020
  757. #define sysconfig_printer       0x0040
  758. #define sysconfig_list          0x0080
  759. #define sysconfig_no_xfer       0x0100
  760. #define sysconfig_2_way         0x0200
  761. #define sysconfig_no_alias      0x0400
  762. #define sysconfig_all_sysop     0x0800
  763. #define sysconfig_shrink_term   0x1000
  764. #define sysconfig_free_phone    0x2000
  765. #define sysconfig_log_dl        0x4000
  766. #define sysconfig_extended_info 0x8000
  767.  
  768. /* configoverrec.comflags */
  769. #define comflags_buffered_uart  0x0001
  770.  
  771. /* editorrec.config */
  772. #define config_80_25 0x0001
  773.  
  774. #define ansir_ansi       0x01
  775. #define ansir_no_DOS     0x02
  776. #define ansir_no_300     0x04
  777. #define ansir_shrink     0x08
  778. #define ansir_no_pause   0x10
  779. #define ansir_local_only 0x20
  780. #define ansir_multi_user 0x40
  781.  
  782. /* newexternalrec.othr */
  783. #define othr_error_correct     0x0001
  784. #define othr_bimodem           0x0002
  785. #define othr_override_internal 0x0004
  786.  
  787. /* statusrec.filechange [0..6] */
  788. #define filechange_names  0
  789. #define filechange_upload 1
  790. #define filechange_posts  2
  791. #define filechange_email  3
  792. #define filechange_net    4
  793.  
  794. /* g_flags */
  795. #define g_flag_disable_conf   0x00000001
  796. #define g_flag_disable_pause  0x00000002
  797. #define g_flag_scanned_files  0x00000004
  798. #define g_flag_made_find_str  0x00000008
  799. #define g_flag_pipe_colors    0x00000010
  800. #define g_flag_allow_extended 0x00000020
  801. #define g_flag_disable_mci    0x00000040
  802. #define g_flag_ansi_movement  0x00000080
  803.  
  804. #define PREV 1
  805. #define NEXT 2
  806. #define DONE 4
  807. #define ABORTED 8
  808. #define NUM_ONLY 1
  809. #define UPPER_ONLY 2
  810. #define ALL 4
  811. #define SET 8
  812.  
  813. #define XFER_TIME(b) (modem_speed?\
  814.                       (((double)(((b)+127)/128))*1280.0/((double)modem_speed))\
  815.                       :0.0)
  816.  
  817. struct line {
  818.   char text[160];
  819.   struct line *prev, *next;
  820. };
  821.  
  822.  
  823. typedef struct {
  824.   short x1, y1, topline1, curatr1;
  825.   char *scrn1;
  826. } screentype;
  827.  
  828. typedef struct {
  829.   char name[13];
  830.   short len;
  831. } ext_desc_type;
  832.  
  833. typedef struct {
  834.   char name[41],                            /* g-file section name */
  835.    filename[9];                             /* g-file database filename */
  836.   unsigned char sl,                         /* sl required to read */
  837.    age;                                     /* minimum age for section */
  838.   unsigned short maxfiles,                  /* max # of files */
  839.    ar;                                      /* AR for g-file section */
  840. } gfiledirrec;
  841.  
  842. typedef struct {
  843.   char description[81],                     /* description of file */
  844.    filename[13];                            /* filename of file */
  845.   long daten;                               /* date added */
  846. } gfilerec;
  847.  
  848. typedef struct {
  849.   char curspeed[23];                        /* description of speed */
  850.   char return_code[23];                     /* modem result code */
  851.   unsigned short modem_speed,               /* speed modems talk at */
  852.    com_speed;                               /* speed com port runs at */
  853. } resultrec;
  854.  
  855.  
  856. typedef struct {
  857.   char name[20];                            /* language name */
  858.   unsigned char num;                        /* language number */
  859.   char dir[79],                             /* language directory */
  860.    mdir[79],                                /* menu directory */
  861.    adir[79];                                /* ansi directory */
  862. } languagerec;
  863.  
  864. #define INT_REAL_DOS 0x21
  865.  
  866. /****************************************************************************/
  867. /* modem info structure */
  868.  
  869. #define mode_norm     1                     /* normal status */
  870. #define mode_ring     2                     /* phone is ringing */
  871. #define mode_dis      3                     /* disconnected (no connection) */
  872. #define mode_err      4                     /* error encountered */
  873. #define mode_ringing  5                     /* remote phone is ringing */
  874. #define mode_con      6                     /* connection established */
  875. #define mode_ndt      7                     /* no dial tone */
  876. #define mode_fax      8                     /* fax connection */
  877. #define mode_cid_num  9                     /* caller-id info, phone # */
  878. #define mode_cid_name 10                    /* caller-id info, caller's name */
  879.  
  880. #define flag_as       1                     /* asymmetrical baud rates */
  881. #define flag_ec       2                     /* error correction in use */
  882. #define flag_dc       4                     /* data compression in use */
  883. #define flag_fc       8                     /* flow control should be used */
  884. #define flag_append   16                    /* description string should be
  885.                                              * appended */
  886. /****************************************************************************/
  887.  
  888. #define SECONDS_PER_HOUR  3600L
  889. #define SECONDS_PER_DAY   86400L
  890.  
  891. typedef struct {
  892.   char result[41];
  893.   char description[31];
  894.   unsigned short main_mode;
  895.   unsigned short flag_mask;
  896.   unsigned short flag_value;
  897.   unsigned short com_speed;
  898.   unsigned short modem_speed;
  899. } result_info;
  900.  
  901. typedef struct {
  902.   unsigned short ver;
  903.   char name[81];
  904.   char init[161];
  905.   char setu[161];
  906.   char ansr[81];
  907.   char pick[81];
  908.   char hang[81];
  909.   char dial[81];
  910.  
  911.   char sepr[10];
  912.  
  913.   result_info defl;
  914.   unsigned short num_resl;
  915.   result_info resl[1];
  916. } modem_info;
  917.  
  918. /****************************************************************************/
  919. /* Dropfile stuff */
  920.  
  921. typedef struct {
  922.   char
  923.    display[2], printer[2], page_bell[2], alarm[2], sysop_next, errcheck[2], graphics, nodechat, openbps[5], connectbps[5];
  924.   short int
  925.    usernum;
  926.   char
  927.    firstname[15], password[12];
  928.   short int
  929.    time_on, prev_used;
  930.   char
  931.    time_logged[5];
  932.   short int
  933.    time_limit, down_limit;
  934.   char
  935.    curconf, bitmap1[5], bitmap2[5];
  936.   short int
  937.    time_added, time_credit;
  938.   char
  939.    slanguage[4], name[25];
  940.   short int
  941.    sminsleft;
  942.   char
  943.    snodenum, seventtime[5], seventactive[2], sslide[2], smemmsg[4], scomport, packflag, bpsflag;
  944.  
  945.   /* PCB 14.5 extra stuff */
  946.   char
  947.    ansi, lastevent[8];
  948.   short int
  949.    lasteventmin;
  950.   char
  951.    exittodos, eventupcoming;
  952.   short int
  953.    lastconfarea;
  954.   char
  955.    hconfbitmap;
  956.   /* end PCB 14.5 additions */
  957. } pcboard_sys_rec;
  958.  
  959. /****************************************************************************/
  960. /* conferencing stuff */
  961.  
  962. #define conf_status_ansi       0x0001       /* ANSI required */
  963. #define conf_status_wwivreg    0x0002       /* WWIV regnum required */
  964. #define conf_status_offline    0x0004       /* conference is "offline" */
  965.  
  966. #define CONF_UPDATE_INSERT     1
  967. #define CONF_UPDATE_DELETE     2
  968. #define CONF_UPDATE_SWAP       3
  969.  
  970. #define SUBCONF_TYPE unsigned short
  971. #define MAX_CONFERENCES 26
  972.  
  973. typedef struct {
  974.   unsigned char designator,                 /* A to Z? */
  975.    name[61],                                /* Name of conference */
  976.    minsl,                                   /* Minimum SL needed for access */
  977.    maxsl,                                   /* Maximum SL allowed for access */
  978.    mindsl,                                  /* Minimum DSL needed for access */
  979.    maxdsl,                                  /* Maximum DSL allowed for access */
  980.    minage,                                  /* Minimum age needed for access */
  981.    maxage,                                  /* Maximum age allowed for access */
  982.    sex;                                     /* Gender: 0=male, 1=female,
  983.                                              * 2=all */
  984.   SUBCONF_TYPE status,                      /* Bit-mapped stuff */
  985.    minbps,                                  /* Minimum bps rate for access */
  986.    ar,                                      /* ARs necessary for access */
  987.    dar,                                     /* DARs necessary for access */
  988.    num,                                     /* Num "subs" in this conference */
  989.    maxnum,                                  /* max num subs allocated in
  990.                                              * 'subs' */
  991.   *subs;                                    /* "Sub" numbers in this
  992.                                              * conference */
  993. } confrec;
  994.  
  995. typedef struct {
  996.   short int user;
  997.   char filename[13];
  998.   long id;
  999.   unsigned long numbytes;
  1000. } filestatusrec;
  1001.  
  1002. /****************************************************************************/
  1003.  
  1004. #define CHAINFILE_CHAIN       0
  1005. #define CHAINFILE_DORINFO     1
  1006. #define CHAINFILE_PCBOARD     2
  1007. #define CHAINFILE_CALLINFO    3
  1008. #define CHAINFILE_DOOR        4
  1009.  
  1010. /****************************************************************************/
  1011.  
  1012. #define EFLAG_ABORT           0x0001        /* check for a ^C to abort
  1013.                                              * program */
  1014. #define EFLAG_INTERNAL        0x0002        /* make it look internal to BBS */
  1015. #define EFLAG_NOHUP           0x0004        /* don't check for hangup (UL
  1016.                                              * event) */
  1017. #define EFLAG_COMIO           0x0008        /* redirect IO to com port */
  1018. #define EFLAG_SHRINK          0x0010        /* shrink for more free mem
  1019.                                              * (slower) */
  1020. #define EFLAG_FILES           0x0020        /* create shrink files for extrn
  1021.                                              * progs */
  1022. #define EFLAG_NOPAUSE         0x0040        /* disable pause in remote */
  1023. #define EFLAG_NETPROG         0x0080        /* try running out of net dir
  1024.                                              * first */
  1025. #define EFLAG_TOPSCREEN       0x0100        /* leave topscreen as-is */
  1026.  
  1027. /****************************************************************************/
  1028. #define INI_TAG "WWIV"
  1029. #define WWIV_INI "WWIV.INI"
  1030.  
  1031.  
  1032. #define OP_FLAGS_FORCE_NEWUSER_FEEDBACK   0x00000001
  1033. #define OP_FLAGS_CHECK_DUPE_PHONENUM      0x00000002
  1034. #define OP_FLAGS_HANGUP_DUPE_PHONENUM     0x00000004
  1035. #define OP_FLAGS_SIMPLE_ASV               0x00000008
  1036. #define OP_FLAGS_POSTTIME_COMPENSATE      0x00000010
  1037. #define OP_FLAGS_SHOW_HIER                0x00000020
  1038. #define OP_FLAGS_IDZ_DESC                 0x00000040
  1039. #define OP_FLAGS_SETLDATE                 0x00000080
  1040. #define OP_FLAGS_NEW_CHATSOUND            0x00000100
  1041. #define OP_FLAGS_SLASH_SZ                 0x00000200
  1042. #define OP_FLAGS_READ_CD_IDZ              0x00000400
  1043. #define OP_FLAGS_FSED_EXT_DESC            0x00000800
  1044. #define OP_FLAGS_FAST_TAG_RELIST          0x00001000
  1045. #define OP_FLAGS_MAIL_PROMPT              0x00002000
  1046. #define OP_FLAGS_SHOW_CITY_ST             0x00004000
  1047. #define OP_FLAGS_NO_EASY_DL               0x00008000
  1048. #define OP_FLAGS_NEW_EXTRACT              0x00010000
  1049. #define OP_FLAGS_FAST_SEARCH              0x00020000
  1050. #define OP_FLAGS_NET_CALLOUT              0x00040000
  1051. #define OP_FLAGS_WFC_SCREEN               0x00080000
  1052. #define OP_FLAGS_FIDO_PROCESS             0x00100000
  1053. #define OP_FLAGS_USER_REGISTRATION        0x00200000
  1054. #define OP_FLAGS_MSG_TAG                  0x00400000
  1055. #define OP_FLAGS_CHAIN_REG                0x00800000
  1056. #define OP_FLAGS_CAN_SAVE_SSM             0x01000000
  1057. #define OP_FLAGS_EXTRA_COLOR              0x04000000
  1058. #define OP_FLAGS_USE_FORCESCAN            0x08000000
  1059. #define OP_FLAGS_NEWUSER_MIN              0x10000000
  1060. #define OP_FLAGS_THREAD_SUBS              0x20000000
  1061.  
  1062. /* begin callback additions */
  1063.  
  1064. #define OP_FLAGS_CALLBACK                 0x40000000
  1065. #define OP_FLAGS_VOICE_VAL                0x80000000
  1066. #define OP_FLAGS_ADV_ASV                  0xa000000
  1067.  
  1068. /* end callback additions */
  1069.  
  1070. #define E_C (sysinfo.flags & OP_FLAGS_EXTRA_COLOR)
  1071.  
  1072. /****************************************************************************/
  1073.  
  1074. typedef struct {
  1075.   unsigned char
  1076.    sl, dsl, exempt;
  1077.   unsigned short
  1078.    ar, dar, restrict;
  1079. } asv_rec;
  1080.  
  1081. typedef struct {
  1082.   unsigned char reg_wwiv, nonreg_wwiv, non_wwiv, cosysop;
  1083. } adv_asv_rec;
  1084.  
  1085.  
  1086. /* begin callback additions */
  1087.  
  1088. typedef struct {
  1089.   unsigned char
  1090.    sl, dsl, exempt, longdistance, forced, repeat;
  1091.   unsigned short
  1092.    ar, dar, restrict;
  1093. } cbv_rec;
  1094.  
  1095. /* end callback additions */
  1096.  
  1097. typedef struct {
  1098.   unsigned long
  1099.    flags, flags1;
  1100.   unsigned short
  1101.    spawn_opts[20];
  1102.   unsigned char
  1103.    newuser_colors[10], newuser_bwcolors[10], topscreen_color, f1_color, editline_color, chat_select_color, msg_color, ripdir[80], ripbbsid[30], ripmenudate[14];
  1104.    asv_rec asv;
  1105.    adv_asv_rec advasv;
  1106.  
  1107. // begin callback addition
  1108.  
  1109.    cbv_rec
  1110.    cbv;
  1111.  
  1112. // end callback addition
  1113.  
  1114.   unsigned short
  1115.    mail_who_field_len, max_batch, max_extend_lines, max_chains, max_gfilesec, screen_saver_time;
  1116.   char
  1117.    rip_rm_adjust, use_forcescan;
  1118.   short int
  1119.    forcesubnum;
  1120. } system_operation_rec;
  1121.  
  1122. typedef struct {
  1123.   short int pos, curlen, maxlen;
  1124.  
  1125.   short int first;
  1126.  
  1127.   short int xpos, ypos, amount_to_show;
  1128.   short int curxpos, curypos;
  1129.  
  1130.   short int insert, curmode, bs, char_case;
  1131.   char *text;
  1132.   char *show;
  1133.  
  1134. } inputeditrec;
  1135.  
  1136.  
  1137. typedef struct {
  1138.   short int xpos, ypos, amount_to_show;
  1139.   short int curxpos, curypos;
  1140.  
  1141.   short int justify;
  1142.   short int bg, cur_color;
  1143.  
  1144.   char *text;
  1145.   char *show;
  1146. } showtextrec;
  1147.  
  1148. struct individuals {
  1149.  unsigned one: 
  1150.    1;
  1151.  unsigned two: 
  1152.    1;
  1153.  unsigned three: 
  1154.    1;
  1155.  unsigned four: 
  1156.    1;
  1157.  unsigned five: 
  1158.    1;
  1159.  unsigned six: 
  1160.    1;
  1161.  unsigned seven: 
  1162.    1;
  1163.  unsigned eight: 
  1164.    1;
  1165.  unsigned nine: 
  1166.    1;
  1167.  unsigned ten: 
  1168.    1;
  1169.  unsigned eleven: 
  1170.    1;
  1171.  unsigned twelve: 
  1172.    1;
  1173.  unsigned thirteen: 
  1174.    1;
  1175.  unsigned fourteen: 
  1176.    1;
  1177.  unsigned fifteen: 
  1178.    1;
  1179.  unsigned sixteen: 
  1180.    1;
  1181. };
  1182.  
  1183. struct nonindividual {
  1184.   unsigned short int ni;
  1185. };
  1186.  
  1187.  
  1188.  
  1189. union bitinfo {
  1190.   struct individuals i;
  1191.   struct nonindividual n;
  1192. };
  1193.  
  1194. typedef struct {
  1195.   union bitinfo bi;
  1196.   short int xpos, ypos;
  1197.   short int amount;                               // Amount of active items
  1198.   short int pos;
  1199.  
  1200.   short int check_char, fill_char;
  1201. } checkboxrec;
  1202.  
  1203.  
  1204.  
  1205. typedef struct {
  1206.   int xpos, ypos;
  1207.   int amount;                               // Amount of active items
  1208.   int pos, last;
  1209.  
  1210.   int radio_char, fill_char;
  1211. } radiobuttonrec;
  1212.  
  1213.  
  1214.  
  1215. typedef union {
  1216.   showtextrec st;
  1217.   inputeditrec ie;
  1218.   radiobuttonrec rb;
  1219.   checkboxrec cb;
  1220. } VARI_TYPES;
  1221.  
  1222.  
  1223. struct VariMenuRec {
  1224.   int amount;                               // Only used in the first record
  1225.  
  1226.   int type;
  1227.  
  1228.   VARI_TYPES *types;
  1229.  
  1230.   int xpos, ypos;                           // copied from each type for easy
  1231.   // access
  1232.  
  1233.   unsigned hotkey;
  1234.   int active;
  1235.   int returnvalue;
  1236.  
  1237.   struct VariMenuRec *next;
  1238. };
  1239.  
  1240. typedef struct VariMenuRec varimenurec;
  1241.  
  1242. typedef struct {
  1243.   // mi=menu item, ci=current item
  1244.   unsigned mi_normal, mi_hi, ci_normal, ci_hi;
  1245.   unsigned inactive_color;
  1246.   int redraw;                               // COMMON_NONE, COMMON_PARTIAL
  1247.   // (pos and last), COMMON_FULL
  1248.   int pos, last;
  1249.  
  1250.   int xpos, ypos;                           // Where the cursor is right now
  1251.  
  1252.   unsigned event;
  1253.   int status;
  1254.   int returnvalue;
  1255. } varimenuinfo;
  1256.  
  1257.  
  1258. typedef struct {
  1259.   int width;
  1260.   int amount_per_square;
  1261.  
  1262.   char square_list[10];
  1263.  
  1264.   int empty_space, side_char1, side_char2;
  1265.   int surround_color, box_color;
  1266.  
  1267.   long total_items, current_item;
  1268.   long last_maj_pos, last_min_pos;
  1269. } statusbarrec;
  1270.  
  1271.  
  1272. typedef struct {
  1273.   int pos, curlen, maxlen;
  1274.  
  1275.   int first;
  1276.  
  1277.   int xpos, ypos, amount_to_show;
  1278.   int curxpos, curypos;
  1279.  
  1280.   int insert, curmode, bs, char_case;
  1281.   char *text;
  1282.   char *show;
  1283.  
  1284.   char *picture[256];
  1285. } inputpicrec;
  1286.  
  1287.  
  1288. /* begin dupphone additions */
  1289.  
  1290. /* QUICK REFERNCE TO FIND USER PHONE NUMBER */
  1291.  
  1292. typedef struct {
  1293.   short int usernum;                        /* user's number */
  1294.   unsigned char phone[13];                  /* user's phone number */
  1295. } phonerec;
  1296.  
  1297. /* end dupphone additions */
  1298.  
  1299. /* begin events additions */
  1300.  
  1301. #define MAX_EVENT 30                        /* max number of timed events */
  1302.  
  1303. #define EVENT_FORCED       0x0001           /* force user off to run event? */
  1304. #define EVENT_SHRINK       0x0002           /* shrink for event? */
  1305. #define EVENT_HOLD         0x0004           /* holdphone for event? */
  1306. #define EVENT_RUNTODAY     0x8000           /* has it run today? */
  1307.  
  1308. typedef struct {
  1309.   char cmd[81];                             /* commandline to execute */
  1310.   short int days,                           /* days to run this event */
  1311.     time,                                   /* time to run event in minutes */
  1312.     instance,                               /* instance to run event on */
  1313.     status;                                 /* bit mapped event status */
  1314.   char resv[29];                            /* reserved */
  1315. } eventsrec;
  1316.  
  1317. /* end events additions */
  1318. /****************************************************************************/
  1319. typedef struct {
  1320.    unsigned int structure_size;
  1321.    unsigned char majver;
  1322.    unsigned char minver;
  1323.    unsigned char far *ident;
  1324.    unsigned int input_buffer_size;
  1325.    unsigned int input_bytes_available;
  1326.    unsigned int output_buffer_size;
  1327.    unsigned int output_bytes_available;
  1328.    unsigned char width;
  1329.    unsigned char height;
  1330.    unsigned char baudmask;
  1331. } fossil_structR;
  1332.  
  1333. enum {
  1334.   mdmrxr = 0x0100,                          // data in receive buffer
  1335.   mdmovn = 0x0200,                          // recive buffer overrun
  1336.   mdmtxr = 0x2000,                          // transmit buffer has room
  1337.   mdmtxe = 0x4000,                          // transmit buffer is empty
  1338.   mdmdcd = 0x0080                           // data carrier detect
  1339. };
  1340.  
  1341. /****************************************************************************/
  1342. typedef struct {
  1343.   short int used;                           // Record used?
  1344.   unsigned short int msg_num,               // Message Number
  1345.    parent_num;                              // Parent Message #
  1346.   char message_code[20],                    // Message's ID Code
  1347.    parent_code[20];                         // Message's Reply Code
  1348. } threadrec;
  1349.  
  1350. /****************************************************************************/
  1351.  
  1352. typedef struct {
  1353.   char name[13];
  1354.   long offset;
  1355. } ext_desc_rec;
  1356.  
  1357. #include "instmsg.h"
  1358.  
  1359. /* Instance status flags */
  1360. #define INST_FLAGS_NONE      0x0000         /* No flags at all */
  1361. #define INST_FLAGS_ONLINE    0x0001         /* User online */
  1362. #define INST_FLAGS_MSG_AVAIL 0x0002         /* Available for inst msgs */
  1363. #define INST_FLAGS_INVIS      0x0004  /* For invisibility */
  1364.  
  1365. /* Instance primary location points */
  1366. #define INST_LOC_DOWN          0
  1367. #define INST_LOC_INIT          1
  1368. #define INST_LOC_EMAIL         2
  1369. #define INST_LOC_MAIN          3
  1370. #define INST_LOC_XFER          4
  1371. #define INST_LOC_CHAINS        5
  1372. #define INST_LOC_NET           6
  1373. #define INST_LOC_GFILES        7
  1374. #define INST_LOC_BEGINDAY      8
  1375. #define INST_LOC_EVENT         9
  1376. #define INST_LOC_CHAT         10
  1377. #define INST_LOC_CHAT2        11
  1378. #define INST_LOC_CHATROOM     12
  1379. #define INST_LOC_LOGON        13
  1380. #define INST_LOC_LOGOFF       14
  1381. #define INST_LOC_FSED         15
  1382. #define INST_LOC_UEDIT        16
  1383. #define INST_LOC_CHAINEDIT    17
  1384. #define INST_LOC_BOARDEDIT    18
  1385. #define INST_LOC_DIREDIT      19
  1386. #define INST_LOC_GFILEEDIT    20
  1387. #define INST_LOC_CONFEDIT     21
  1388. #define INST_LOC_DOS          22
  1389. #define INST_LOC_DEFAULTS     23
  1390. #define INST_LOC_REBOOT       24
  1391. #define INST_LOC_RELOAD       25
  1392. #define INST_LOC_VOTE         26
  1393. #define INST_LOC_BANK         27
  1394. #define INST_LOC_AMSG         28
  1395. #define INST_LOC_SUBS         29
  1396. #define INST_LOC_CHUSER       30
  1397. #define INST_LOC_TEDIT        31
  1398. #define INST_LOC_MAILR        32
  1399. #define INST_LOC_RESETQSCAN   33
  1400. #define INST_LOC_VOTEEDIT     34
  1401. #define INST_LOC_VOTEPRINT    35
  1402. #define INST_LOC_RESETF       36
  1403. #define INST_LOC_FEEDBACK     37
  1404. #define INST_LOC_KILLEMAIL    38
  1405. #define INST_LOC_POST         39
  1406. #define INST_LOC_NEWUSER      40
  1407. #define INST_LOC_RMAIL        41
  1408. #define INST_LOC_DOWNLOAD     42
  1409. #define INST_LOC_UPLOAD       43
  1410. #define INST_LOC_BIXFER       44
  1411. #define INST_LOC_NETLIST      45
  1412. #define INST_LOC_TERM         46
  1413. #define INST_LOC_EVENTEDIT    47
  1414. #define INST_LOC_GETUSER      48
  1415. #define INST_LOC_CH1        5000
  1416. #define INST_LOC_CH2        5001
  1417. #define INST_LOC_CH3        5002
  1418. #define INST_LOC_CH4        5003
  1419. #define INST_LOC_CH5        5004
  1420. #define INST_LOC_CH6        5005
  1421. #define INST_LOC_CH7        5006
  1422. #define INST_LOC_CH8        5007
  1423. #define INST_LOC_CH9        5008
  1424. #define INST_LOC_CH10       5009
  1425. #define INST_LOC_WFC       65535
  1426.  
  1427. typedef struct {
  1428.   short
  1429.    number, user;
  1430.   unsigned short
  1431.    flags, loc, subloc;
  1432.   unsigned long last_update;
  1433.   unsigned short modem_speed;
  1434.   unsigned long inst_started;
  1435.   unsigned char
  1436.    extra[80];
  1437. } instancerec;
  1438.  
  1439. typedef struct {
  1440.   int r;
  1441.   char aword[12];
  1442.   char toprint[80];
  1443.   char toperson[80];
  1444.   char toall[80];
  1445.   char singular[80];
  1446. } ch_action;
  1447.  
  1448. typedef struct {
  1449.   char name[60];
  1450.   int sl;
  1451.   char ar;
  1452.   char sex;
  1453.   char min_age;
  1454.   char max_age;
  1455. } ch_type;
  1456.  
  1457. /****************************************************************************/
  1458. #ifndef bbsmalloc
  1459.  #ifdef __OS2__
  1460.   #define bbsmalloc(x) malloc(x)
  1461.   #define bbsfree(x) free(x)
  1462.   #define bbscoreleft() coreleft()
  1463.  #else // __OS2__
  1464.   #ifdef _WIN32
  1465.    #define bbsmalloc(x) malloc(x)
  1466.    #define bbsfree(x) free(x)
  1467.    #define bbscoreleft() 20240
  1468.   #else // _WIN32
  1469.    #define bbsmalloc(x) farmalloc(x)
  1470.    #define bbsfree(x) farfree(x)
  1471.    #define bbscoreleft() farcoreleft()
  1472.   #endif // _WIN32
  1473.  #endif // __OS2__
  1474. #endif // bbsmaloc
  1475.  
  1476. #define ISR_VECT(n) ((n>7)?(0x68+n):(0x08+n))
  1477. #define ISR_CTRLR(n) ((n>7)?(0xa1):(0x21))
  1478. #define ISR_RESET(n) {outportb(0x20, 0x20); if (n>7) outportb(0xa0,0x20);}
  1479.  
  1480. #ifndef _WIN32
  1481.  // Fix for _chmod in BC 4.5x
  1482.  #if __TURBOC__ >= 0x0450
  1483.   #define _chmod _rtl_chmod
  1484.  #endif // __TURBOC__
  1485.  
  1486.  // Fix for timezone and daylight in BC 5.x
  1487.  #if __TURBOC__ >= 0x0450
  1488.   #define timezone _timezone
  1489.   #define daylight _daylight
  1490.   #define environ _environ
  1491.  #endif // __TURBOC__
  1492.  
  1493.  // Check userrec for size
  1494.  #if sizeof(userrec) != 1024
  1495.   #error Userrec is not 1024
  1496.  #endif // if sizeof(userrec) ...
  1497. #endif // _WIN32
  1498.  
  1499. #ifdef _WIN32
  1500. #pragma warning(pop)
  1501. #pragma pack(pop)
  1502. #endif // _WIN32
  1503.  
  1504. #endif // _VARDEC_H_
  1505.