home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / bbbsr2.zip / misc / bbbsdef.h next >
C/C++ Source or Header  |  1997-06-26  |  41KB  |  801 lines

  1. /* $Id: bbbsdef.h,v 1.38 1997/06/24 06:11:30 b Exp $ */
  2.  
  3. /*****************************************************************************
  4.  *                                                                           *
  5.  *    BBBS is Copyright 1990,1992-1997, Kim Heino and Tapani T. Salmi.       *
  6.  *                                                                           *
  7.  *    Definitions and variables for BBBS, version number is below.           *
  8.  *    You may use this file as long as this is totally unmodified.           *
  9.  *    We take no responsibility over any program using this file.            *
  10.  *                                                                           *
  11.  *****************************************************************************/
  12.  
  13. #if defined(__OS2__) || defined(__EMX__)
  14. #pragma pack(1)
  15. #endif
  16.  
  17. typedef unsigned char         boolean;    /*  8 bit, true or false */
  18. typedef unsigned char         byte;       /*  8 bit, unsigned */
  19. typedef signed short int      integer;    /* 16 bit, signed */
  20. typedef unsigned short int    word;       /* 16 bit, unsigned */
  21. typedef signed long int       longint;    /* 32 bit, signed */
  22. #if (!defined(__LINUX__) && !defined(__SOLARIS__) && !defined(__UNIXWARE__)) || defined(__ULTRIX__) || defined(__FREEBSD__)
  23. typedef unsigned long int     ulong;      /* 32 bit, unsigned */
  24. #endif
  25.  
  26. #define true                  1
  27. #define false                 0
  28.  
  29. #if defined(__MSDOS__)
  30. #define lines_in_editor       1000        /* max lines in editor */
  31. #define max_msg               2048        /* max unread messages per area */
  32. #define desclen               768
  33. #define chat_last_saved       10          /* /last */
  34. #else
  35. #define lines_in_editor       4096        /* max lines in editor */
  36. #define max_msg               8192        /* max unread messages per area */
  37. #define desclen               4096
  38. #define chat_last_saved       20          /* /last */
  39. #endif
  40. #define disk_lastread         128         /* word-pairs in tmp lastread file */
  41. #if defined(__MSDOS__)
  42. #define buffer_len            4096        /* com buffer length, must be 2^something */
  43. #define buffer_open           3000
  44. #define buffer_close          3900
  45. #else
  46. #define buffer_len            8192        /* com buffer length, must be 2^something */
  47. #define buffer_open           6144
  48. #define buffer_close          8000
  49. #endif
  50. #define txtsize               713         /* bbbstxt lines */
  51. #define commands_saved        20          /* inputs saved */
  52. #define fileaccess_NONE       0
  53. #define fileaccess_W          2
  54. #define fileaccess_R          4
  55. #define linkoverflow          128
  56. #define num_of_akas           44
  57. #define num_of_events         90
  58. #define num_of_limits         128
  59. #define usernumcolors         80
  60.  
  61. #define stat_must       1       /* status bits */
  62. #define stat_member     2
  63. #define stat_invite     4
  64. #define stat_fidoarea   8
  65. #define stat_postarea   16
  66. #define stat_allowpriv  32
  67. #define stat_nomarks    64
  68. #define stat_noreply    128
  69. #define stat_nostrip    256
  70. #define stat_allfix     512
  71. #define stat_namefix    1024
  72. #define stat_alias      2048
  73. #define stat_allowtag   4096
  74. #define stat_agnet      8192
  75. #define stat_moderated  16384   /* used internally, DO NOT SET */
  76. #define stat_nntp       32768   /* used internally, DO NOT SET */
  77.  
  78. #define mstat_killed    1       /* mstatust bits */
  79. #define mstat_mempty12  2
  80. #define mstat_private   4
  81. #define mstat_sent      8
  82. #define mstat_readed    16
  83. #define mstat_extraline 32
  84. #define mstat_nntpsent  64
  85. #define mstat_mempty3   128
  86. #define mstat_mempty4   256
  87. #define mstat_mempty5   512
  88. #define mstat_mempty6   1024
  89. #define mstat_mempty7   2048
  90. #define mstat_mempty8   4096
  91. #define mstat_mempty9   8192
  92. #define mstat_mempty10  16384
  93. #define mstat_mempty11  32768
  94.  
  95. #define char_IBM        0       /* charsets */
  96. #define char_SF7        1
  97. #define char_ISO        2
  98. #define char_IBN        3
  99. #define char_US7        4
  100. #define char_GE7        5
  101. #define char_NO7        6
  102. #define char_FR7        7
  103. #define char_IT7        8
  104. #define char_SP7        9
  105. #define char_MAC        10
  106.  
  107. #define CTABLE_IN       0
  108. #define CTABLE_OUT      256
  109.  
  110. #define acc_readmsg     1       /* accesst bits */
  111. #define acc_writemsg    2
  112. #define acc_aempty12    4
  113. #define acc_aempty13    8
  114. #define acc_sigop       16
  115. #define acc_aempty1     32
  116. #define acc_aempty2     64
  117. #define acc_aempty3     128
  118. #define acc_aempty4     256
  119. #define acc_aempty5     512
  120. #define acc_aempty6     1024
  121. #define acc_aempty7     2048
  122. #define acc_aempty8     4096
  123. #define acc_aempty9     8192
  124. #define acc_aempty10    16384
  125. #define acc_aempty11    32768
  126.  
  127. #define bzs_alias_len   1024
  128. #define bzs_set_len     2048
  129. #define bzs_end         0
  130. #define bzs_foo2        1
  131. #define bzs_alias       2
  132. #define bzs_set         3
  133. #define bzs_script      4
  134.  
  135. #define bun_year(l)     (int)(((l>>25) & 127)+80)
  136. #define bun_month(l)    (int)((l>>21) & 15)
  137. #define bun_day(l)      (int)((l>>16) & 31)
  138. #define bun_hour(l)     (int)((l>>11) & 31)
  139. #define bun_minute(l)   (int)((l>>5) & 63)
  140. #define bun_second(l)   (int)((l & 31)<<1)
  141.  
  142. #define outputstopped_no_break  16
  143. #define outputstopped_show_log  32
  144. #define outputstopped_no_local  64
  145. #define outputstopped_no_remote 128
  146. #define outputstopped_reset     0xf8
  147. #define outputstopped_set       1
  148. #define outputstopped_check     7
  149.  
  150. struct userrec {                /* maindir/bbbsusr.dat */
  151.   char            name[30];     /*   0 */
  152.   byte            password[16]; /*  30 */ /* MD5 of upper case password */
  153.   char            address[30];  /*  46 */
  154.   char            city[30];     /*  76 */
  155.   char            phone[18];    /* 106 */
  156.   char            birth[18];    /* 124 */
  157.   byte            ok2login;     /* 142 */ /* 0=yes,1=getlost,2=killed,3=kill+boot */
  158.   byte            termcap;      /* 143 */ /* Bit 0-3: 0=TTY,1=ANSI,2=dummy,3=VT320,4=RIP, Bit 4-7: 0=Line,1=FSE,2=MG,3=local/script */
  159.   byte            pagelength;   /* 144 */
  160.   byte            charset;      /* 145 */
  161.   byte            language;     /* 146 */ /* 0..9 (0=English,1=Suomi,2=Svenska,3=Norsk) */
  162.   byte            readmode;     /* 147 */ /* Bit 0-3: 0=Marked,1=Reference,2=Forward, Bit 4-7: 0=Text,1=Hippo1,2=Hippo2,3=OMEN,4=QWK,5=BW,6=QWKREP */
  163.   byte            packtype;     /* 148 */ /* 0=text,1=arc,2=zip,3=lzh,4=arj,5=zoo,6=hpk,7=rar */
  164.   byte            protocol;     /* 149 */ /* 0=Z,1=Y,2=X,3=SHYDRA,4=XCRC,5=YB,6=SZmodem,7=HYDRA,8=ZedZap */
  165.   byte            nodemsgfilt;  /* 150 */ /* 0=feelings, 1=login/logout, 2=entered message, 3=public chat, 4=priv msgs */
  166.   integer         timelimit;    /* 151 */
  167.   integer         timeleft;     /* 153 */
  168.   word            fchecked;     /* 155 */
  169.   word            timebank;     /* 157 */
  170.   word            limits;       /* 159 */
  171.   ulong           timeson;      /* 161 */
  172.   ulong           ptimeson;     /* 165 */
  173.   ulong           msgleft;      /* 169 */
  174.   ulong           pmsgleft;     /* 173 */
  175.   ulong           msgread;      /* 177 */
  176.   ulong           pmsgread;     /* 181 */
  177.   ulong           msgdumped;    /* 185 */
  178.   ulong           pmsgdumped;   /* 189 */
  179.   ulong           uploaded;     /* 193 */
  180.   ulong           puploaded;    /* 197 */
  181.   ulong           downloaded;   /* 201 */
  182.   ulong           pdownloaded;  /* 205 */
  183.   ulong           kbup;         /* 209 */
  184.   ulong           pkbup;        /* 213 */
  185.   ulong           kbdown;       /* 217 */
  186.   ulong           pkbdown;      /* 221 */
  187.   ulong           resume;       /* 225 */
  188.   ulong           access;       /* 229 */ /* Bit 0=DOS,1=Confs,2=Files,3=Priv,4=Pass,30=Download,31=Upload */
  189.   ulong           utoggles;     /* 233 */ /* Bit 0=!Insert,1=Indent,2=XYdisp,3=!Flash,4=ConfS,5=Expert,7=Colors,8=Review,9=RealVT100keyboard,10=Quote,11=Silent */
  190.   ulong           envpos;       /* 237 */
  191.   ulong           lasttime;     /* 241 */
  192.   ulong           firsttime;    /* 245 */
  193.   ulong           account;      /* 249 */
  194.   ulong           todaydown;    /* 253 */
  195.   ulong           userbits;     /* 257 */ /* Feel free to use this variable as you want - just note that somebody else might also use it */
  196.   byte            uempty[8];    /* 261 */
  197.   ulong           bzlong;       /* 269 */ /* tampered check */
  198. };                              /* 273 */
  199.  
  200. #define uacc_sysop_mask         0x000000FF
  201. #define uacc_dos                0x00000001
  202. #define uacc_confs              0x00000002
  203. #define uacc_files              0x00000004
  204. #define uacc_priv               0x00000008
  205. #define uacc_pass               0x00000010
  206. #define uacc_useredit           0x00000020
  207. #define uacc_fido               0x00000040
  208. #define uacc_chat               0x00000080
  209. #define uacc_download           0x40000000
  210. #define uacc_upload             0x80000000
  211.  
  212. #define utog_not_insert         0x00000001
  213. #define utog_indent             0x00000002
  214. #define utog_xydisp             0x00000004
  215. #define utog_not_flash          0x00000008
  216. #define utog_confs              0x00000010
  217. #define utog_expert             0x00000020
  218. #define utog_colors             0x00000080
  219. #define utog_review             0x00000100
  220. #define utog_vt100key           0x00000200
  221. #define utog_quote_include      0x00000400
  222. #define utog_silent             0x00000800
  223. #define utog_return             0x00001000
  224.  
  225. struct account {
  226.   char    name[30];             /*   0 */
  227.   longint money;                /*  30 */
  228.   word    flags;                /*  34 */ /* bit 0:allow nega */
  229.   word    users;                /*  36 */ /* # of users in this account */
  230. };                              /*  38 */
  231.  
  232. #define account_negative        0x0001
  233.  
  234. struct msgrec {                 /* maindir/ *.hdr */
  235.   word            number;       /*   0 */
  236.   word            timegot;      /*   2 */
  237.   char            msgfrom[72];  /*   4 */
  238.   char            msgto[72];    /*  76 */
  239.   char            subject[72];  /* 148 */
  240.   word            msgfromn;     /* 220 */
  241.   word            msgton;       /* 222 */
  242.   word            status;       /* 224 */
  243.   word            lines;        /* 226 */
  244.   ulong           offset;       /* 228 */
  245.   ulong           dated;        /* 232 */
  246.   word            replyto;      /* 236 */
  247.   word            nextreply;    /* 238 */
  248.   word            firstreply;   /* 240 */
  249.   word            zonefrom;     /* 242 */
  250.   word            netfrom;      /* 244 */
  251.   word            nodefrom;     /* 246 */
  252.   longint         msgid;        /* 248 */
  253. };                              /* 252 */
  254.  
  255. struct hihhi {                  /* maindir/bbbshi.dat */
  256.   word            times;        /*   0 */
  257.   word            daynro;       /*   2 */
  258.   char            name[30];     /*   4 */
  259.   char            msg[80];      /*  34 */
  260. };                              /* 114 */
  261.  
  262. struct noderec {                /* tempdir/bbbsnode */
  263.   word            split;        /*   0 */ /* reserved */
  264.   byte            bstatus;      /*   2 */ /* Bit 1=mailsession, 2=groupchat_in_hydra, 3=keepalive, 4=keepidle, 5=bterm */
  265.   byte            zstatus;      /*   3 */ /* 0=off,1=active,2=not,3=writing,4=grab,5=down,6=up,7=chat,8=door,9=groupchat,10=telnet,11=shelled */
  266.   ulong           speed;        /*   4 */ /* 0=local */
  267.   word            time;         /*   8 */ /* hour*0x100+min */
  268.   word            endtime;      /*  10 */ /* when downloading, hour*0x100+min */
  269.   char            nick[11];     /*  12 */
  270.   char            sex;          /*  23 */ /* 1=male, 0=female */
  271.   char            realname[30]; /*  24 */
  272.   ulong           idle;         /*  54 */ /* timestamp (time()), ignore diffs less than 120 seconds! */
  273. };                              /*  58 */
  274.  
  275. struct chatrec {                /* tempdir/bbbsmsg.* */
  276.   word            node;         /*   0 */
  277.   word            filter;       /*   2 */
  278.   char            msg[256];     /*   4 */
  279.   char            prefix[80];   /* 260 */ /* "#[* ] :nick{ color}" for feelings, "#channel:nick" for chat, "nick" for private, "*channel:nick" for info messages */
  280. };                              /* 340 */
  281.  
  282. struct bstatrec {               /* maindir/bbbsstat.dat */
  283.   ulong           data [7]      /*   0 */ /* day */
  284.                        [3]                /* user/sysop/fido */
  285.                        [6];               /* date/min/call/msg/up/down    date=day+31*month+372*year */
  286. };                              /* 504 */
  287.  
  288. struct cfgrec2 {
  289.   ulong           count_of_confs;   /*   0 */
  290.   ulong           post_conf;        /*   4 */
  291.   ulong           resume_conf;      /*   8 */
  292.   ulong           fileinfo_conf;    /*  12 */
  293. };                                  /*  16 */
  294.  
  295. struct confrec1 {
  296.   word            lastread;         /*   0 */
  297.   byte            charsets;         /*   2 */ /* hi: bbbs->msg, lo: bbbs<-msg */
  298.   byte            foo;              /*   3 */
  299.   word            status;           /*   4 */
  300.   char            confname[60];     /*   6 */
  301.   char            description[60];  /*  66 */
  302. };                                  /* 126 */
  303.  
  304. struct confrec2 {
  305.   char            fidopath[70];     /*   0 */
  306.   char            nntpname[64];     /*  70 */
  307.   word            nntphost;         /* 134 */
  308.   ulong           nntpnumber;       /* 136 */
  309.   word            nodenumber;       /* 140 */
  310.   word            originnumber;     /* 142 */
  311.   word            moderator_zone;   /* 144 */
  312.   word            moderator_net;    /* 146 */
  313.   word            moderator_node;   /* 148 */
  314.   word            moderator_point;  /* 150 */
  315.   word            bpc_min;          /* 152 */
  316.   word            bpc_max;          /* 154 */
  317. };                                  /* 156 */
  318.  
  319. /* next: 3039/4300 */
  320.  
  321. struct global_config {
  322.   char    bbbs_name[30],                                /*   0     */
  323.           sysop_name[30],                               /*   1     */
  324.           newu_account[30],                             /* 591     */
  325.           closed_password[8],                           /*   2     */
  326.           grabfile[14],                                 /*   3     */
  327.           maindir[70],                                  /*  10     */
  328.           updir[70],                                    /*  12     */
  329.           tempdir[70],                                  /*  14     */
  330.           menudir[70],                                  /* 278     */
  331.           origins[10][60],                              /*  26- 35 */
  332.           tickdir[70],                                  /* 280     */
  333.           netmail[70],                                  /* 281     */
  334.           extlog[70],                                   /* 526     */
  335.           inetlog[70],                                  /*3032     */
  336.           tmp_in_pkt[70],                               /* 502     */
  337.           tmp_out_pkt[70],                              /* 503     */
  338.           bundle_dir[70],                               /* 504     */
  339.           badechodir[70],                               /* 505     */
  340.           badsecuredir[70],                             /* 506     */
  341.           sitename[60],                                 /* 306     */
  342.           location[60],                                 /* 307     */
  343.           phone[60],                                    /* 308     */
  344.           speed[60],                                    /* 309     */
  345.           flags[60],                                    /* 310     */
  346.           organization[60],                             /* 617     */
  347.           hostname[60],                                 /* 618     */
  348.           remotedomain[60],                             /* 952     */
  349.           ircserver[60],                                /*3037     */
  350.           cdtempdrives[40],                             /* 612     */
  351.           akam[num_of_akas][60],                        /* 900-943, old 311-320 */
  352.           freq_magic[70],                               /* 357     */
  353.           freq_normal[70],                              /* 358     */
  354.           dialconvfrom[10][27],                         /* 337-346 */
  355.           dialconvto[10][27],                           /* 347-356 */
  356.           faxdir[70],                                   /* 414     */
  357.           feelingsdir[70],                              /* 3008    */
  358.           scriptdir[70],                                /* 3009    */
  359.           btermdown[70],                                /* 417     */
  360.           inbound[70];                                  /* 282     */
  361.   word    max_nodes,                                    /*  36     */
  362.           bankmax,                                      /*  40     */
  363.           whodown_size,                                 /* 291     */
  364.           maxbundlesize,                                /* 615     */
  365.           boguspktsize,                                 /* 530     */
  366.           smtpmaxsize,                                  /*3019     */
  367.           tranxzone,                                    /* 302     */
  368.           tranxnet,                                     /* 303     */
  369.           tranxnode,                                    /* 304     */
  370.           tranxpoint,                                   /* 305     */
  371.           freqlimit[3][4],                              /* 321-332 */
  372.           limits_kbday[num_of_limits],                  /*3100-3217, old 542-557 */
  373.           cost_start[num_of_limits],                    /*3300-3417, old 558-573 */
  374.           cost_min[num_of_limits],                      /*3500-3617, old 574-589 */
  375.           cost_hour[num_of_limits],                     /*3700-3817, old 596-611 */
  376.           zone[num_of_akas],                            /* 700-743, old 41- 50 */
  377.           net[num_of_akas],                             /* 750-793, old 51- 60 */
  378.           node[num_of_akas],                            /* 800-843, old 61- 70 */
  379.           point[num_of_akas];                           /* 850-893, old 71- 80 */
  380.   integer newu_time;                                    /*  81     */
  381.   byte    bankrate,                                     /*  84     */
  382.           msgrate,                                      /*  85     */
  383.           desc_max_lines,                               /* 289     */
  384.           present_akas,                                 /* 425     */
  385.           limits_byte[num_of_limits],                   /*3900-4017, old 118-133 */
  386.           limits_file[num_of_limits],                   /*4100-4217, old 102-117 */
  387.           rescantime,                                   /* 300     */
  388.           busydelay,                                    /* 333     */
  389.           tries_busy,                                   /* 334     */
  390.           tries_bad,                                    /* 522     */
  391.           faxerror,                                     /* 416     */
  392.           mailerror,                                    /* 301     */
  393.           flood_max_count,                              /*3038     */
  394.           max_open_files,                               /* 507     */
  395.           bogus_dupes,                                  /* 529     */
  396.           hydra_tx,                                     /* 520     */
  397.           hydra_rx,                                     /* 521     */
  398.           usermailerror;                                /* 411     */
  399.   ulong   newu_access,                                  /*  86     */
  400.           gtoggles,                                     /*  below  */
  401.           htoggles;                                     /*  below  */
  402. };
  403.  
  404. #define cfgg_up_down_check           0x00000001         /*  91     */
  405. #define cfgg_show_privates           0x00000002         /*  92     */
  406. #define cfgg_brobocop                0x00000004         /*  93     */
  407. #define cfgg_hippo                   0x00000008         /*  94     */
  408. #define cfgg_show_empty              0x00000010         /*  97     */
  409. #define cfgg_pack_messages           0x00000040         /* 290     */
  410. #define cfgg_fido_hydra              0x00000080         /* 292     */
  411. #define cfgg_fido_zedzap             0x00000100         /* 293     */
  412. #define cfgg_fido_tranx              0x00000200         /* 294     */
  413. #define cfgg_fido_unlistnode         0x00000400         /* 295     */
  414. #define cfgg_fido_unlistpoint        0x00000800         /* 296     */
  415. #define cfgg_fido_unprotnode         0x00001000         /* 297     */
  416. #define cfgg_fido_freq_answering     0x00002000         /* 298     */
  417. #define cfgg_fido_freq_calling       0x00004000         /* 299     */
  418. #define cfgg_show_sysop_in_stats     0x00008000         /* 410     */
  419. #define cfgg_bmt_check_destination   0x00010000         /* 413     */
  420. #define cfgg_disable_newu_address    0x00020000         /* 419     */
  421. #define cfgg_disable_newu_birthday   0x00040000         /* 420     */
  422. #define cfgg_users_are_hidden        0x00080000         /* 421     */
  423. #define cfgg_upload_scan             0x00100000         /* 422     */
  424. #define cfgg_poll_all_crashes        0x00200000         /* 423     */
  425. #define cfgg_delete_dup_uploads      0x00400000         /* 424     */
  426. #define cfgg_savebad                 0x00800000         /* 508     */
  427. #define cfgg_savesecure              0x01000000         /* 509     */
  428. #define cfgg_bmt_log_headers         0x02000000         /* 531     */
  429. #define cfgg_no_remote_sysop         0x04000000         /* 532     */
  430. #define cfgg_bogus_save_netmail      0x08000000         /* 541     */
  431. #define cfgg_kb_day_relative         0x10000000         /* 590     */
  432. #define cfgg_global_download         0x20000000         /* 613     */
  433. #define cfgg_nntp_gateway            0x40000000         /* 950     */
  434. #define cfgg_smtp_gateway            0x80000000         /* 951     */
  435.  
  436. #define cfgh_nntp_save_headers       0x00000001         /* 3001    */
  437. #define cfgh_smtp_save_headers       0x00000002         /* 3002    */
  438. #define cfgh_chat_uses_time          0x00000004         /* 3003    */
  439. #define cfgh_sysnote_msg             0x00000008         /* 3004    */
  440. #define cfgh_eom_to_uucp             0x00000010         /* 3006    */
  441. #define cfgh_use_nodenum_not_nick    0x00000020         /* 3007    */
  442. #define cfgh_allow_all_names         0x00000040         /* 3010    */
  443. #define cfgh_grab_is_free            0x00000100         /* 3031    */
  444. #define cfgh_uploader_owns_file      0x00000200         /* 3034    */
  445.  
  446. struct local_config {
  447.   char    modem_init_string1[60],                       /*   4     */
  448.           modem_init_string2[60],                       /* 283     */
  449.           modem_init_string3[60],                       /* 284     */
  450.           modem_hangup_string[60],                      /*   5     */
  451.           modem_busy_string[60],                        /*   6     */
  452.           modem_answer_string[60],                      /* 279     */
  453.           modem_aftercall[60],                          /* 527     */
  454.           voice_init[80],                               /*3020     */
  455.           voice_beep[60],                               /*3021     */
  456.           voice_play[60],                               /*3022     */
  457.           voice_save[60],                               /*3023     */
  458.           voice_go_voice[60],                           /*3027     */
  459.           voice_go_data[60],                            /*3028     */
  460.           data_after_voice[60],                         /* 533     */
  461.           voicedir[70],                                 /* 536     */
  462.           voicegreetings[70],                           /* 537     */
  463.           bterm_init[60],                               /* 427     */
  464.           dont_crash_flags[60],                         /* 426     */
  465.           only_crash_flags[60],                         /* 593     */
  466.           fd_dobbs[70],                                 /*   7     */
  467.           logfile[70],                                  /*   8     */
  468.           spyfile[70],                                  /* 3000    */
  469.           loginlog[70],                                 /*   9     */
  470.           grabdir[70],                                  /*  11     */
  471.           menudir[70],                                  /*  13     */
  472.           newdir[70],                                   /*  15     */
  473.           voicepass[5],                                 /* 540     */
  474.           lockpass[8],                                  /*3035     */
  475.           dial1[5][20],                                 /* 447-451 */
  476.           dial2[5][10],                                 /* 452-456 */
  477.           dial3[5][50],                                 /* 457-461 */
  478.           macros[10][50],                               /*  16- 25 */
  479.           hotlogin[10][40];                             /* 429-438 */
  480.   word    event_dial_zone[num_of_events],               /* 1000-1099, old 370-379 */
  481.           event_dial_net[num_of_events],                /* 1100-1199, old 380-389 */
  482.           event_dial_node[num_of_events],               /* 1200-1299, old 390-399 */
  483.           event_dial_point[num_of_events],              /* 1300-1399, old 400-409 */
  484.           voice_min_size,                               /*3030     */
  485.           locktimeout,                                  /*3036     */
  486.           base_address;                                 /*  39     */
  487.   byte    irq,                                          /*  82     */
  488.           pollrate,                                     /*  83     */
  489.           checksleep,                                   /* 287     */
  490.           ringingcount,                                 /* 539     */
  491.           answer_ring_count,                            /*  98     */
  492.           screensaver_timeout,                          /* 285     */
  493.           aftercall_lines,                              /* 528     */
  494.           voicecompression,                             /* 538     */
  495.           voice_modem,                                  /*3024     */
  496.           voice_speaker,                                /*3025     */
  497.           voice_mic,                                    /*3026     */
  498.           rush_hour[24],                                /* 134-157 */
  499.           event_day[num_of_events],                     /* 1400-1499, old 158-167 */
  500.           event_start_hour[num_of_events],              /* 1500-1599, old 168-177 */
  501.           event_start_min[num_of_events],               /* 1600-1699, old 178-187 */
  502.           event_end_hour[num_of_events],                /* 1700-1799, old 188-197 */
  503.           event_end_min[num_of_events],                 /* 1800-1899, old 198-207 */
  504.           event_errorlevel[num_of_events],              /* 1900-1999, old 208-217 */
  505.           event_toggles[num_of_events],                 /*  below  */
  506.           event_last_dial[num_of_events],               /* 2000-2099, old 360-369 */
  507.           event_last_day[num_of_events],                /* 2100-2199, old 248-257 */
  508.           nt_priorities[8],                             /*3011-3018*/
  509.           priorities[8];                                /* 439-446 */
  510.   ulong   start_speed,                                  /*  37     */
  511.           faxbaud,                                      /* 415     */
  512.           min_speed,                                    /*  38     */
  513.           ltoggles;                                     /*  below  */
  514. };
  515.  
  516. #define cfgl_event_dont_allow_users  0x01               /* 2200-2299, old 218-227 */
  517. #define cfgl_event_flexible          0x02               /* 2300-2399, old 228-237 */
  518. #define cfgl_event_must              0x04               /* 2400-2499, old 238-247 */
  519. #define cfgl_event_dont_allow_mail   0x08               /* 2500-2599, old 462-471 */
  520. #define cfgl_event_dont_allow_pickup 0x10               /* 2600-2699, old 472-481 */
  521. #define cfgl_event_dont_send_cm      0x20               /* 2700-2799, old 482-491 */
  522. #define cfgl_event_send_all          0x40               /* 2800-2899, old 492-501 */
  523. #define cfgl_event_dont_allow_freq   0x80               /* 2900-2999, old 510-519 */
  524.  
  525. #define cfgl_local_bell              0x00000001         /*  87     */
  526. #define cfgl_rts_cts                 0x00000002         /*  88     */
  527. #define cfgl_reset_speed             0x00000004         /*  89     */
  528. #define cfgl_hangup_at_exit          0x00000008         /*  90     */
  529. #define cfgl_set_16550               0x00000010         /*  95     */
  530. #define cfgl_local_sysop_keys        0x00000020         /*  96     */
  531. #define cfgl_local_echo              0x00000040         /* 100     */
  532. #define cfgl_save_screen             0x00000080         /* 101     */
  533. #define cfgl_null_modem_login        0x00000100         /* 288     */
  534. #define cfgl_send_crashmail          0x00000200         /* 359     */
  535. #define cfgl_backdoor                0x00000400         /* 412     */
  536. #define cfgl_fast_fax                0x00000800         /* 418     */
  537. #define cfgl_dont_check_carrier      0x00001000         /* 428     */
  538. #define cfgl_nocarrier_is_busy       0x00002000         /* 523     */
  539. #define cfgl_show_shell_output       0x00004000         /* 524     */
  540. #define cfgl_allow_shell_break       0x00008000         /* 525     */
  541. #define cfgl_slow_protocols          0x00010000         /* 592     */
  542. #define cfgl_fax_receive_revbit      0x00020000         /* 594     */
  543. #define cfgl_fax_send_revbit         0x00040000         /* 595     */
  544. #define cfgl_buffered_output         0x00080000         /* 614     */
  545. #define cfgl_rockwell_kludge         0x00100000         /* 616     */
  546. #define cfgl_fix_rar_bug             0x00200000         /*3033     */
  547.  
  548. struct comstruct {            /* for internal / named memory communication */
  549.   ulong modemhead, modemtail, s, c;
  550.   byte  modembuf[buffer_len];
  551. };
  552.  
  553. #if !defined(__BBBS_NO_EXTERNS__)
  554.  
  555. extern  char                  *ver;           /* "3.33 Foo"; Version number */
  556. extern  char                  hexs[17];       /* "0123456789ABCDEF";      */
  557. extern  char                  *vername;       /* "BBBS/D", "BBBS/2", etc. */
  558.  
  559. extern  struct userrec        u;
  560. extern  struct global_config  cfgg;
  561. extern  struct local_config   cfgl;
  562. extern  struct cfgrec2        cfg2;
  563. extern  struct noderec        node;
  564. extern  struct fos_struct     fos_info;
  565. extern  struct confrec1       **confs;
  566. extern  FILE                  *grabfile;
  567. extern  char                  *buffer, *outbuffer, *txt[txtsize+1], *txtstart, commands[commands_saved][80], local_buffer[128], comstring[256], temp_string[256], *bzsalias, *bzsset, binterface, *areamod, *groups, crrdir[128], realdir[128], holdreal[128], hddesc[128], serna[21], *chat_last_lines[chat_last_saved];
  568. extern  ulong                 tempsys, startdump, startread, startleft, realbaud, baud, lastcall;
  569. extern  word                  unum, confnro, loginhour, loginmin, lastmsg, curmsg, firstmsg, lastreaded, foryou, newavail, reserved1, reserved2, reserved3, reserved4, reserved5, msgreaded[max_msg+1], gnubuf, serno, *lastr, nodenumber, reduced, nextevent, bzltc;
  570. extern  integer               lastwarn, temptime;
  571. extern  byte                  chartable[512], jobtype, com, errl, commands_in_memory, pagecounter, lastinchar, spymode, brobot, dinged, bzlts[2], tomenu, getdown, remotey, fossil, forcefossil, script_count, pktcount, currentevent, outputstopped, usercolors[usernumcolors+1];
  572. extern  boolean               carrier, files_checked, desqview, quicklogin, paged, script_running, rupted, bzchanged, askpass, userlocked, debugmode, reducedevent, safeprint, allow_locking;
  573. #if defined(__OS2__) && !defined(BAG) && !defined(BCFG4)
  574. extern  int                   socket1;
  575. extern  boolean               freemodem, thread_active, broken_pipe;
  576. extern  HFILE                 modem;
  577. extern  char                  comdevice[80];
  578. extern  byte                  pipecommunication;
  579. #endif
  580. #if defined(__WINDOWS__) && !defined(BAG) && !defined(BCFG4)
  581. extern  HANDLE                modem;
  582. extern  char                  comdevice[80];
  583. extern  byte                  pipecommunication;
  584. extern  boolean               freemodem;
  585. #endif
  586. #if (defined(__LINUX__) || defined(__SOLARIS__) || defined(__UNIXWARE__) || defined(__SUNOS__)) && !defined(BAG) && !defined(BCFG4)
  587. extern  int                   modem;
  588. extern  char                  comdevice[80];
  589. extern  byte                  pipecommunication;
  590. extern  boolean               freemodem;
  591. #endif
  592. #if defined(__MSDOS__)
  593. extern  char                  filna[13];
  594. #else
  595. extern  char                  filna[80];
  596. #endif
  597.  
  598. #endif
  599.  
  600. /******************************************************************************
  601.  
  602. confh2o4.dat  word highwater[count_of_confs+1];
  603.  
  604. confusr4.dat  struct {                                    unum*4L*(count_of_confs+1)+confnro*4L
  605.                 word lastread;                                  0
  606.                 word status;                                    2
  607.               } userconfstat[count_of_confs+1];
  608.  
  609. confcfg4.dat  ulong count_of_confs;                        0
  610.               ulong post_conf;                             4
  611.               ulong resume_conf;                           8
  612.               ulong fileinfo_conf;                        12
  613.               struct {                                    16+confnum*282
  614.                 word lastread;                                  0
  615.                 byte charsets;                                  2
  616.                 byte foo;                                       3
  617.                 word status;                                    4
  618.                 char confnames[60];                             6
  619.                 char description[60];                          66
  620.                 char fidopath[70];                            126
  621.                 char nntpname[64];                            196
  622.                 word nntphost;                                260
  623.                 ulong nntpnumber;                             262
  624.                 word nodenumber;                              266
  625.                 word originnumber;                            268
  626.                 word moderator_zone;                          270
  627.                 word moderator_net;                           272
  628.                 word moderator_node;                          274
  629.                 word moderator_point;                         276
  630.                 word bpc_min;                                 278
  631.                 word bpc_max;                                 280
  632.               } confstats[count_of_confs+1];                  282
  633.  
  634. *******************************************************************************
  635.  
  636.               A Quick Guide to Convert C struct to Pascal Record
  637.  
  638. struct foobar {                   type foobar = record
  639.   char b1;                          b1 : shortint;
  640.   char b2[128];                     b2 : string[127];           { 128-1=127 }
  641.   byte b3;                          b3 : byte;
  642.   word b4;                          b4 : word;
  643.   word b5[128];                     b5 : array[0..127] of word; { 128-1=127 }
  644.   integer b6;                       b6 : integer;
  645.   longint b7;                       b7 : longint;
  646.   ulong b8;                         b8 : longint;               { unsigned }
  647. };                                end;
  648.  
  649.  
  650. You still have to convert C-alike null-terminated strings (b2) to
  651. Pascal-alike strings.
  652.  
  653. *******************************************************************************
  654.  
  655. global_config and local_config strutures are saved in following format:
  656.  
  657.  word     id;                       -- see comments
  658.  byte     len;                      -- in bytes
  659.  byte     data[];                   -- actual data for item id
  660.  
  661. So, after reading id and len you just fread(&config.id,1,len,file) or
  662. fseek(len,SEEK_CUR,file).
  663.  
  664. ******************************************************************************/
  665.  
  666. struct fos_struct {
  667.   word            strsize;        /* size of the structure in bytes     */
  668.   byte            majver;         /* FOSSIL spec driver conforms to     */
  669.   byte            minver;         /* rev level of this specific driver  */
  670.   char            *ident;         /* FAR pointer to ASCII ID string     */
  671.   word            ibufr;          /* size of the input buffer (bytes)   */
  672.   word            ifree;          /* number of bytes left in buffer     */
  673.   word            obufr;          /* size of the output buffer (bytes)  */
  674.   word            ofree;          /* number of bytes left in the buffer */
  675.   byte            swidth;         /* width of screen on this adapter    */
  676.   byte            sheight;        /* height of screen    "      "       */
  677.   byte            speed;          /* ACTUAL speed, computer to modem    */
  678. };
  679.  
  680. struct ftsc001 {
  681.   char  fromuser[36];     /*   0 */
  682.   char  touser[36];       /*  36 */
  683.   char  subject[72];      /*  72 */
  684.   char  datetime[20];     /* 144 */
  685.   word  timesread;        /* 164 */ /* not used */
  686.   word  destnode;         /* 166 */
  687.   word  orignode;         /* 168 */
  688.   word  cost;             /* 170 */ /* not used */
  689.   word  orignet;          /* 172 */
  690.   word  destnet;          /* 174 */
  691.   word  destzone;         /* 176 */
  692.   word  origzone;         /* 178 */
  693.   word  destpoint;        /* 180 */
  694.   word  origpoint;        /* 182 */
  695.   word  replyto;          /* 184 */ /* not used */
  696.   word  attribute;        /* 186 */
  697.   word  nextreply;        /* 188 */ /* not used */
  698. };                        /* 190 */
  699.  
  700. struct pktmessage {
  701.   word version,           /*   0 */
  702.        orignode,          /*   2 */
  703.        destnode,          /*   4 */
  704.        orignet,           /*   6 */
  705.        destnet,           /*   8 */
  706.        attribute,         /*  10 */
  707.        cost;              /*  12 */
  708.                           /*  14 */
  709.   /* byte datetime[20]; */ /* OPUS does it wrong! */
  710.   /* char to[], from[], subject[], text[]; */
  711. };
  712.  
  713. #define fido_attr_private       0x00000001L
  714. #define fido_attr_crash         0x00000002L
  715. #define fido_attr_sent          0x00000008L
  716. #define fido_attr_file          0x00000010L
  717. #define fido_attr_kill          0x00000080L
  718. #define fido_attr_local         0x00000100L
  719. #define fido_attr_hold          0x00000200L
  720. #define fido_attr_freq          0x00000800L
  721. #define fido_attr_rrr           0x00001000L
  722. #define fido_attr_isrr          0x00002000L
  723. #define fido_attr_delete        0x00010000L
  724. #define fido_attr_trunc         0x00020000L
  725. #define fido_attr_direct        0x00040000L
  726. #define fido_attr_lock          0x00080000L
  727. #define fido_attr_immediate     0x00100000L
  728.  
  729. struct packetheader2 {
  730.   word orignode,          /*   0 */
  731.        destnode,          /*   2 */
  732.        year,              /*   4 */
  733.        month,             /*   6 */
  734.        day,               /*   8 */
  735.        hour,              /*  10 */
  736.        minute,            /*  12 */
  737.        second,            /*  14 */
  738.        baud,              /*  16 */
  739.        version,           /*  18 */
  740.        orignet,           /*  20 */
  741.        destnet;           /*  22 */
  742.   byte prodcode,          /*  24 */
  743.        serial,            /*  25 */
  744.        password[8];       /*  26 */
  745.   word origzone,          /*  34 */
  746.        destzone;          /*  36 */
  747.   byte empty[20];         /*  38 */
  748. };                        /*  58 */
  749.  
  750. struct packetheader2p {
  751.   word orignode,          /*   0 */
  752.        destnode,          /*   2 */
  753.        year,              /*   4 */
  754.        month,             /*   6 */
  755.        day,               /*   8 */
  756.        hour,              /*  10 */
  757.        minute,            /*  12 */
  758.        second,            /*  14 */
  759.        baud,              /*  16 */
  760.        version,           /*  18 */
  761.        orignet,           /*  20 */
  762.        destnet;           /*  22 */
  763.   byte prodcodel,         /*  24 */
  764.        revisionh,         /*  25 */
  765.        password[8];       /*  26 */
  766.   word origzoneq,         /*  34 */
  767.        destzoneq,         /*  36 */
  768.        auxnet,            /*  38 */
  769.        cwcopy;            /*  40 */
  770.   byte prodcodeh,         /*  42 */
  771.        revisionl;         /*  43 */
  772.   word cw,                /*  44 */
  773.        origzone,          /*  46 */
  774.        destzone,          /*  48 */
  775.        origpoint,         /*  50 */
  776.        destpoint;         /*  52 */
  777.   long psd;               /*  54 */
  778. };                        /*  58 */
  779.  
  780. struct packetheader22 {
  781.   word orignode,          /*   0 */
  782.        destnode,          /*   2 */
  783.        origpoint,         /*   4 */
  784.        destpoint;         /*   6 */
  785.   long res1,              /*   8 */
  786.        res2;              /*  12 */
  787.   word subversio,         /*  16 */
  788.        version,           /*  18 */
  789.        orignet,           /*  20 */
  790.        destnet;           /*  22 */
  791.   byte prodcode,          /*  24 */
  792.        revision,          /*  25 */
  793.        password[8];       /*  26 */
  794.   word origzone,          /*  34 */
  795.        destzone;          /*  36 */
  796.   byte origdomain[8],     /*  38 */
  797.        destdomain[8];     /*  46 */
  798.   long psd;               /*  54 */
  799. };                        /*  58 */
  800.  
  801.