home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / UTIL / WWIVSOR / VARDEC.H < prev    next >
C/C++ Source or Header  |  1995-05-20  |  39KB  |  1,281 lines

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