Annotation of sbbs/src/sbbs3/sbbsdefs.h, revision 1.1.1.2

1.1       root        1: /* sbbsdefs.h */
                      2: 
                      3: /* Synchronet constants, macros, and structure definitions */
                      4: 
1.1.1.2 ! root        5: /* $Id: sbbsdefs.h,v 1.169 2011/07/14 02:32:11 rswindell Exp $ */
1.1       root        6: 
                      7: /****************************************************************************
                      8:  * @format.tab-size 4          (Plain Text/Source Code File Header)                    *
                      9:  * @format.use-tabs true       (see http://www.synchro.net/ptsc_hdr.html)              *
                     10:  *                                                                                                                                                     *
1.1.1.2 ! root       11:  * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html         *
1.1       root       12:  *                                                                                                                                                     *
                     13:  * This program is free software; you can redistribute it and/or                       *
                     14:  * modify it under the terms of the GNU General Public License                         *
                     15:  * as published by the Free Software Foundation; either version 2                      *
                     16:  * of the License, or (at your option) any later version.                                      *
                     17:  * See the GNU General Public License for more details: gpl.txt or                     *
                     18:  * http://www.fsf.org/copyleft/gpl.html                                                                                *
                     19:  *                                                                                                                                                     *
                     20:  * Anonymous FTP access to the most recent released source is available at     *
                     21:  * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net     *
                     22:  *                                                                                                                                                     *
                     23:  * Anonymous CVS access to the development source and modification history     *
                     24:  * is available at cvs.synchro.net:/cvsroot/sbbs, example:                                     *
                     25:  * cvs -d :pserver:[email protected]:/cvsroot/sbbs login                       *
                     26:  *     (just hit return, no password is necessary)                                                     *
                     27:  * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src                *
                     28:  *                                                                                                                                                     *
                     29:  * For Synchronet coding style and modification guidelines, see                                *
                     30:  * http://www.synchro.net/source.html                                                                          *
                     31:  *                                                                                                                                                     *
                     32:  * You are encouraged to submit any modifications (preferably in Unix diff     *
                     33:  * format) via e-mail to [email protected]                                                                      *
                     34:  *                                                                                                                                                     *
                     35:  * Note: If this box doesn't appear square, then you need to fix your tabs.    *
                     36:  ****************************************************************************/
                     37: 
                     38: #ifndef _SBBSDEFS_H
                     39: #define _SBBSDEFS_H
                     40: 
                     41: #include <time.h>
                     42: 
                     43: #include "gen_defs.h"  /* uchar, ushort, uint, ulong, etc. */
                     44: #include "nodedefs.h"  /* node_t */
                     45: #include "fidodefs.h"  /* fmsghdr_t, fpkthdr_t, FIDO_*, etc. */
                     46: #include "xpbeep.h"            /* BEEP() */
                     47: #include "str_list.h"  /* str_list_t */
                     48: 
                     49: /*************/
                     50: /* Constants */
                     51: /*************/
                     52: 
1.1.1.2 ! root       53: #define VERSION        "3.15"  /* Version: Major.minor  */
        !            54: #define REVISION       'b'     /* Revision: lowercase letter */
        !            55: #define VERSION_NUM    (31500   + (tolower(REVISION)-'a'))
        !            56: #define VERSION_HEX    (0x31500 + (tolower(REVISION)-'a'))
1.1       root       57: 
                     58: #define VERSION_NOTICE         "Synchronet BBS for "PLATFORM_DESC\
                     59:                                                                "  Version " VERSION
                     60: #define SYNCHRONET_CRC         0x9BCDD162
1.1.1.2 ! root       61: #define COPYRIGHT_NOTICE       "Copyright 2011 Rob Swindell"
        !            62: #define COPYRIGHT_CRC          0x3D5C1DE9
1.1       root       63: 
                     64: #define Y2K_2DIGIT_WINDOW      70
                     65: 
                     66: #define FNOPEN_BUF_SIZE                (2*1024)
                     67: 
1.1.1.2 ! root       68: #define ILLEGAL_FILENAME_CHARS "\\/|<>:\";,%"
1.1       root       69: 
                     70: #define BIND_FAILURE_HELP      "!Another application or service may be using this port"
                     71: #define UNKNOWN_LOAD_ERROR     "Unknown load error - Library mismatch?"
                     72: 
                     73: #define        JAVASCRIPT_MAX_BYTES            (8*1024*1024)
                     74: #define JAVASCRIPT_CONTEXT_STACK       (16*1024)
                     75: #define JAVASCRIPT_THREAD_STACK                (256*1024)
                     76: #define JAVASCRIPT_BRANCH_LIMIT                99999999
                     77: #define JAVASCRIPT_YIELD_INTERVAL      10000
                     78: #define JAVASCRIPT_GC_INTERVAL         100 
1.1.1.2 ! root       79: #define JAVASCRIPT_LOAD_PATH           "load"
        !            80: #define JAVASCRIPT_LOAD_PATH_LIST      "load_path_list"
1.1       root       81: 
                     82: typedef struct {
                     83:        ulong   counter;
                     84:        ulong   limit;
                     85:        ulong   yield_interval;
                     86:        ulong   gc_interval;
                     87:        ulong   gc_attempts;
                     88:        BOOL    auto_terminate;
1.1.1.2 ! root       89:        volatile BOOL*  terminated;
1.1       root       90:        str_list_t      exit_func;
                     91: } js_branch_t;
                     92: 
                     93: #define JSVAL_NULL_OR_VOID(val)                (JSVAL_IS_NULL(val) || JSVAL_IS_VOID(val))
                     94: 
                     95: /************/
                     96: /* Maximums */
                     97: /************/
                     98: 
                     99: #define MAX_NODES              250
                    100: 
                    101: #define MAX_FILES        10000 /* Maximum number of files per dir                      */
                    102: #define MAX_USERXFER   500 /* Maximum number of dest. users of usrxfer */
                    103: 
1.1.1.2 ! root      104: #define MAX_TEXTDAT_ITEM_LEN   2000
        !           105: 
1.1       root      106: 
                    107: #define LEN_DIR                63              /* Maximum length of directory paths            */
                    108: #define LEN_CMD                63              /* Maximum length of command lines                      */
                    109: 
                    110:                                                        /* MS-DOS limited values                                        */
                    111: #define LEN_CODE       8               /* Maximum length of internal codes                     */
                    112: #define LEN_QWKID      8               /* Maximum length of QWK-ID                                     */
                    113: #define LEN_MODNAME 8          /* Maximum length of loadable module name       */
                    114: #define LEN_SIFNAME 8          /* Maximum length of SIF filename                       */
                    115: #define LEN_EXTCODE (LEN_CODE*2)       /* Code prefix + suffix */
                    116: 
                    117:                                                        /* Lengths of various strings                           */
                    118: #define LEN_GSNAME     15              /* Group/Lib short name                                         */
                    119: #define LEN_GLNAME     40              /* Group/Lib long name                                          */
                    120: #define LEN_SSNAME     25              /* Sub/Dir short name                                           */
                    121: #define LEN_SLNAME     40              /* Sub/Dir long name                                            */
                    122:                                                
                    123:                                                                        /* User Questions                                               */
                    124: #define UQ_ALIASES             (1L<<0)         /* Ask for alias                                                */
                    125: #define UQ_LOCATION            (1L<<1)         /* Ask for location                                     */
                    126: #define UQ_ADDRESS             (1L<<2)         /* Ask for address                                              */
                    127: #define UQ_PHONE               (1L<<3)         /* Ask for phone number                                 */
                    128: #define UQ_HANDLE              (1L<<4)         /* Ask for chat handle                                  */
                    129: #define UQ_DUPHAND             (1L<<5)         /* Search for duplicate handles                 */
                    130: #define UQ_SEX                 (1L<<6)         /* Ask for sex :)                                               */
                    131: #define UQ_BIRTH               (1L<<7)         /* Ask for birth date                                   */
                    132: #define UQ_COMP                (1L<<8)         /* Ask for computer type                                */
                    133: #define UQ_MC_COMP             (1L<<9)         /* Multiple choice computer type                */
                    134: #define UQ_REALNAME            (1L<<10)        /* Ask for real name                                    */
                    135: #define UQ_DUPREAL             (1L<<11)        /* Search for duplicate real names              */
                    136: #define UQ_COMPANY             (1L<<12)        /* Ask for company name                                 */
                    137: #define UQ_NOEXASC             (1L<<13)        /* Don't allow ex-ASCII in user text    */
                    138: #define UQ_CMDSHELL            (1L<<14)        /* Ask for command shell                                */
                    139: #define UQ_XEDIT               (1L<<15)        /* Ask for external editor                              */
                    140: #define UQ_NODEF               (1L<<16)        /* Don't ask for default settings       */
                    141: #define UQ_NOCOMMAS            (1L<<17)        /* Do not require commas in location    */
                    142: #define UQ_NONETMAIL   (1L<<18)        /* Don't ask for e-mail/netmail address */
                    143: #define UQ_NOUPRLWR            (1L<<19)        /* Don't force upper/lower case strings */
                    144:                                                
                    145:                                                
                    146:                                                                        /* Different bits in sys_misc                           */
                    147: #define SM_CLOSED              (1L<<0)         /* System is clsoed to New Users                        */
                    148: #define SM_SYSSTAT             (1L<<1)         /* Sysops activity included in statistics       */
                    149: #define SM_NOSYSINFO   (1L<<2)         /* Suppress system info display at logon        */
                    150: #define SM_PWEDIT              (1L<<3)         /* Allow users to change their passwords        */
                    151: #define SM_RA_EMU              (1L<<4)         /* Reverse R/A commands at msg read prompt      */
                    152: #define SM_ANON_EM             (1L<<5)         /* Allow anonymous e-mail                                       */
                    153: #define SM_LISTLOC             (1L<<6)         /* Use location of caller in user lists         */
                    154: #define SM_WILDCAT             (1L<<7)         /* Expand Wildcat color codes in messages       */
                    155: #define SM_PCBOARD             (1L<<8)         /* Expand PCBoard color codes in messages       */
                    156: #define SM_WWIV                (1L<<9)         /* Expand WWIV color codes in messages          */
                    157: #define SM_CELERITY            (1L<<10)        /* Expand Celerity color codes in messages      */
                    158: #define SM_RENEGADE            (1L<<11)        /* Expand Renegade color codes in messages      */
                    159: #define SM_ECHO_PW             (1L<<12)        /* Echo passwords locally                                       */
1.1.1.2 ! root      160: #define SM_UNUSED              (1L<<13)        /* Defaults to *on*     (used to SM_LOCAL_TZ)   */
1.1       root      161: #define SM_AUTO_DST            (1L<<14)        /* Automatic Daylight Savings Toggle (US)   */
                    162: #define SM_R_SYSOP             (1L<<15)        /* Allow remote sysop logon/commands            */
                    163: #define SM_QUOTE_EM            (1L<<16)        /* Allow quoting of e-mail                                      */
                    164: #define SM_EURODATE            (1L<<17)        /* Europian date format (DD/MM/YY)                      */
                    165: #define SM_MILITARY            (1L<<18)        /* Military time format                                         */
                    166: #define SM_TIMEBANK            (1L<<19)        /* Allow time bank functions                            */
                    167: #define SM_FILE_EM             (1L<<20)        /* Allow file attachments in E-mail             */
                    168: #define SM_SHRTPAGE            (1L<<21)        /* Short sysop page                                             */
                    169: #define SM_TIME_EXP            (1L<<22)        /* Set to expired values if out-of-time         */
                    170: #define SM_FASTMAIL            (1L<<23)        /* Fast e-mail storage mode                             */
                    171: #define SM_NONODELIST  (1L<<24)        /* Suppress active node list during logon       */
                    172: #define SM_ERRALARM            (1L<<25)        /* Error beeps on                                                       */
                    173: #define SM_FWDTONET            (1L<<26)        /* Allow forwarding of e-mail to netmail        */
                    174: #define SM_DELREADM            (1L<<27)        /* Delete read mail automatically                       */
                    175: #define SM_NOCDTCVT            (1L<<28)        /* No credit to minute conversions allowed      */
                    176: #define SM_DELEMAIL            (1L<<29)        /* Physically remove deleted e-mail immed.      */
                    177: #define SM_USRVDELM            (1L<<30)        /* Users can see deleted msgs                           */
                    178: #define SM_SYSVDELM            (1L<<31)        /* Sysops can see deleted msgs                          */
                    179:                                                
                    180:                                                                        /* Different bits in node_misc                          */
                    181: #define NM_NO_NUM              (1<<8)          /* Don't allow logons by user number        */
                    182: #define NM_LOGON_R             (1<<9)          /* Allow logons by user real name                       */
                    183: #define NM_LOGON_P             (1<<10)         /* Secure logons (always ask for password)      */
                    184: #define NM_LOWPRIO             (1<<15)         /* Always use low priority input                        */
                    185: #define NM_7BITONLY            (1L<<16)        /* Except 7-bit input only (E71 terminals)      */
                    186: #define NM_NOPAUSESPIN (1L<<18)        /* No spinning cursor at pause prompt           */
                    187: #define NM_CLOSENODEDAB        (1L<<19)        /* Keep node.dab file closed (for Samba)        */
                    188: 
                    189:                                                                        /* Miscellaneous Modem Settings (mdm_misc)  */
                    190: #define MDM_CTS                (1<<0)          /* Use hardware send flow control                       */
                    191: #define MDM_RTS                (1<<1)          /* Use hardware recv flow control                       */
                    192: #define MDM_STAYHIGH   (1<<2)          /* Stay at highest DTE rate                             */
                    193: #define MDM_CALLERID   (1<<3)          /* Supports Caller ID                                           */
                    194: #define MDM_DUMB               (1<<4)          /* Just watch DCD for answer - dumb modem       */
                    195: #define MDM_NODTR              (1<<5)          /* Don't drop DTR for hang-up               */
                    196: #define MDM_KNOWNRES   (1<<6)          /* Allow known result codes only                        */
                    197: #define MDM_VERBAL             (1<<7)          /* Use verbal result codes                                      */
                    198: 
                    199:                                                
                    200:                                                                        /* Bit values for level_misc[x]         */
                    201: #define LEVEL_EXPTOLVL (1<<0)          /* Expire to level_expireto[x]          */
                    202: #define LEVEL_EXPTOVAL (1<<1)          /* Expire to val[level_expireto[x]] */
                    203: 
                    204:                                                                        /* Bit values for prot[x].misc */
                    205: #define PROT_DSZLOG            (1<<0)      /* Supports DSZ Log */
                    206: #define PROT_NATIVE            (1<<1)          /* Native (32-bit) executable */
                    207: #define PROT_SOCKET            (1<<2)          /* Use socket I/O, not stdio on *nix */
                    208: 
                    209:                                                                        /* Bit values in netmail_misc */
                    210: 
                    211: #define NMAIL_ALLOW    (1<<0)          /* Allow NetMail */
                    212: #define NMAIL_CRASH    (1<<1)          /* Default netmail to crash */
                    213: #define NMAIL_HOLD             (1<<2)          /* Default netmail to hold */
                    214: #define NMAIL_KILL             (1<<3)          /* Default netmail to kill after sent */
                    215: #define NMAIL_ALIAS    (1<<4)          /* Use Aliases in NetMail */
                    216: #define NMAIL_FILE             (1<<5)          /* Allow file attachments */
                    217: #define NMAIL_DIRECT   (1<<6)          /* Default netmail to direct */
                    218: 
                    219:                                                                        /* Bit values for subscan_t.cfg and sav_cfg     */
                    220: #define SUB_CFG_NSCAN  0x0005          /* Auto-scan for new messages                           */
                    221: #define SUB_CFG_SSCAN  0x0002          /* Auto-scan for unread messages to you         */
                    222: #define SUB_CFG_YSCAN  0x0100          /* Auto-scan for new messages to you only       */
                    223:                                                                        /* (bits 8-15 default to off)                           */
                    224: 
                    225:                                                                        /* Bit values for sub[x].misc */
                    226: #define SUB_QNET               (1L<<3)         /* Sub-board is netted via QWK network */
                    227: #define SUB_PNET               (1L<<4)         /* Sub-board is netted via PostLink */
                    228: #define SUB_FIDO               (1L<<5)         /* Sub-board is netted via FidoNet */
                    229: #define SUB_PRIV               (1L<<6)         /* Allow private posts on sub */
                    230: #define SUB_PONLY              (1L<<7)         /* Private posts only */
                    231: #define SUB_ANON               (1L<<8)         /* Allow anonymous posts on sub */
                    232: #define SUB_AONLY              (1L<<9)         /* Anonymous only */
                    233: #define SUB_NAME               (1L<<10)        /* Must use real names */
                    234: #define SUB_DEL                (1L<<11)        /* Allow users to delete messages */
                    235: #define SUB_DELLAST            (1L<<12)        /* Allow users to delete last msg only */
                    236: #define SUB_FORCED             (1L<<13)        /* Sub-board is forced scanning */
                    237: #define SUB_NOTAG              (1L<<14)        /* Don't add tag or origin lines */
                    238: #define SUB_TOUSER             (1L<<15)        /* Prompt for to user on posts */
                    239: #define SUB_ASCII              (1L<<16)        /* ASCII characters only */
                    240: #define SUB_QUOTE              (1L<<17)        /* Allow online quoting */
                    241: #define SUB_NSDEF              (1L<<18)        /* New-Scan on by default */
                    242: #define SUB_INET               (1L<<19)        /* Sub-board is netted via Internet */
                    243: #define SUB_FAST               (1L<<20)        /* Fast storage mode */
                    244: #define SUB_KILL               (1L<<21)        /* Kill read messages automatically */
                    245: #define SUB_KILLP              (1L<<22)        /* Kill read pvt messages automatically */
                    246: #define SUB_SYSPERM            (1L<<23)        /* Sysop messages are permament */
                    247: #define SUB_GATE               (1L<<24)        /* Gateway between Network types */
                    248: #define SUB_LZH                (1L<<25)        /* Use LZH compression for msgs */
                    249: #define SUB_SSDEF              (1L<<26)        /* Default ON for Scan for Your msgs */
                    250: #define SUB_HYPER              (1L<<27)        /* Hyper allocation */
                    251: #define SUB_EDIT               (1L<<28)        /* Users can edit message text after posting */
                    252: #define SUB_EDITLAST   (1L<<29)        /* Users can edit last message only */
                    253: #define SUB_NOUSERSIG  (1L<<30)        /* Suppress user signatures */
                    254: #define SUB_HDRMOD             (1L<<31)        /* Modified sub-board header info (SCFG) */
                    255: 
                    256:                                     /* Bit values for dir[x].misc */
                    257: #define DIR_FCHK       (1<<0)                  /* Check for file existance */
                    258: #define DIR_RATE       (1<<1)                  /* Force uploads to be rated G,R, or X */
                    259: #define DIR_MULT       (1<<2)                  /* Ask for multi-disk numbering */
                    260: #define DIR_DUPES      (1<<3)                  /* Search this dir for upload dupes */
                    261: #define DIR_FREE       (1<<4)                  /* Free downloads */
                    262: #define DIR_TFREE      (1<<5)                  /* Time to download is free */
                    263: #define DIR_CDTUL      (1<<6)                  /* Credit Uploads */
                    264: #define DIR_CDTDL      (1<<7)                  /* Credit Downloads */
                    265: #define DIR_ANON       (1<<8)                  /* Anonymous uploads */
                    266: #define DIR_AONLY      (1<<9)                  /* Anonymous only */
                    267: #define DIR_ULDATE     (1<<10)                 /* Include upload date in listing */
                    268: #define DIR_DIZ        (1<<11)                 /* FILE_ID.DIZ and DESC.SDI support */
                    269: #define DIR_NOSCAN     (1<<12)                 /* Don't new-scan this directory */
                    270: #define DIR_NOAUTO     (1<<13)                 /* Don't auto-add this directory */
                    271: #define DIR_ULTIME     (1<<14)                 /* Deduct time during uploads */
                    272: #define DIR_CDTMIN     (1<<15)                 /* Give uploader minutes instead of cdt */
                    273: #define DIR_SINCEDL (1<<16)                    /* Purge based on days since last dl */
                    274: #define DIR_MOVENEW (1<<17)                    /* Files marked as new when moved */
                    275: #define DIR_QUIET      (1<<18)                 /* Do not notify uploader of downloads */
                    276: #define DIR_NOSTAT     (1<<19)                 /* Do not include transfers in system stats */
                    277: 
                    278:                                     /* Bit values for file_t.misc */
                    279: #define FM_EXTDESC  (1<<0)          /* Extended description exists */
                    280: #define FM_ANON        (1<<1)                  /* Anonymous upload */
                    281: 
                    282:                                                                        /* Bit values for cfg.file_misc                         */
                    283: #define FM_NO_LFN      (1<<0)                  /* No long filenames in listings                        */
                    284: 
1.1.1.2 ! root      285:                                                                        /* Bit values for cfg.msg_misc (upper 16-bits default to on) */
1.1       root      286: #define MM_REALNAME    (1<<16)                 /* Allow receipt of e-mail using real names     */
1.1.1.2 ! root      287: #define MM_EMAILSIG    (1<<17)                 /* Include user signatures in e-mail msgs */
1.1       root      288: 
                    289:                                                                        /* errormsg() codes */
                    290: #define ERR_OPEN       "opening"               /* opening a file */
                    291: #define ERR_CLOSE      "closing"               /* close a file */
                    292: #define ERR_FDOPEN     "fdopen"                /* associating a stream with fd */
                    293: #define ERR_READ       "reading"               /* reading from file */
                    294: #define ERR_WRITE      "writing"               /* writing to file */
                    295: #define ERR_REMOVE     "removing"              /* removing a file */
                    296: #define ERR_ALLOC      "allocating"    /* allocating memory */
                    297: #define ERR_CHK                "checking"              /* checking */
                    298: #define ERR_LEN                "checking length"
                    299: #define ERR_EXEC       "executing"             /* executing */
1.1.1.2 ! root      300: #define ERR_CHDIR      "changing directory"
1.1       root      301: #define ERR_CREATE     "creating"              /* creating */
                    302: #define ERR_LOCK       "locking"               /* locking */
                    303: #define ERR_UNLOCK     "unlocking"             /* unlocking */
                    304: #define ERR_TIMEOUT    "timeout"               /* timeout waiting for resource */      
                    305: #define ERR_IOCTL      "sending IOCTL" /* IOCTL error */
                    306: #define ERR_SEEK       "seeking"               /* SEEKing error */
                    307: 
                    308: enum {                              /* Values for dir[x].sort */
                    309:      SORT_NAME_A                    /* Sort by filename, ascending */
                    310:     ,SORT_NAME_D                    /* Sort by filename, descending */
                    311:     ,SORT_DATE_A                    /* Sort by upload date, ascending */
                    312:     ,SORT_DATE_D                    /* Sort by upload date, descending */
                    313:     };
                    314: 
                    315: enum {
                    316:         clr_mnehigh
                    317:        ,clr_mnelow
                    318:        ,clr_mnecmd
                    319:        ,clr_inputline
                    320:        ,clr_err
                    321:        ,clr_nodenum
                    322:        ,clr_nodeuser
                    323:        ,clr_nodestatus
                    324:        ,clr_filename
                    325:        ,clr_filecdt
                    326:        ,clr_filedesc
                    327:        ,clr_filelsthdrbox
                    328:        ,clr_filelstline
                    329:        ,clr_chatlocal
                    330:        ,clr_chatremote
                    331:        ,clr_multichat
                    332:        ,clr_external
                    333:        ,MIN_COLORS 
                    334: };
                    335: 
                    336: enum {                                                         /* Values for xtrn_t.type                               */
                    337:         XTRN_NONE                                              /* No data file needed                                  */
                    338:        ,XTRN_SBBS                                              /* Synchronet external                                  */
                    339:        ,XTRN_WWIV                                              /* WWIV external                                                */
                    340:        ,XTRN_GAP                                               /* Gap door                                                     */
                    341:        ,XTRN_RBBS                                              /* RBBS, QBBS, or Remote Access                 */
                    342:        ,XTRN_WILDCAT                                   /* Wildcat                                                              */
                    343:        ,XTRN_PCBOARD                                   /* PCBoard                                                              */
                    344:        ,XTRN_SPITFIRE                                  /* SpitFire                                                     */
                    345:        ,XTRN_UTI                                               /* UTI Doors - MegaMail                                 */
                    346:        ,XTRN_SR                                                /* Solar Realms                                                 */
                    347:        ,XTRN_RBBS1                                     /* DORINFO1.DEF always                                  */
                    348:        ,XTRN_TRIBBS                                    /* TRIBBS.SYS                                                   */
                    349:        ,XTRN_DOOR32                                    /* DOOR32.SYS                                                   */
                    350:        };                                                                                                                                              
                    351:                                                                                                                                                        
                    352: typedef enum {                                         /* Values for xtrn_t.event                              */
                    353:         EVENT_NONE                                     /* Only accessible by menu                              */
                    354:        ,EVENT_LOGON                                    /* Execute during logon sequence                */
                    355:        ,EVENT_LOGOFF                                   /* Execute during logoff sequence               */
                    356:        ,EVENT_NEWUSER                                  /* Execute during newuser app.                  */
                    357:        ,EVENT_BIRTHDAY                                 /* Execute on birthday                                  */
                    358:        ,EVENT_POST                                             /* Execute after posting a message              */
                    359:        ,EVENT_UPLOAD                                   /* Execute after uploading a file               */
                    360:        ,EVENT_DOWNLOAD                                 /* Execute after downloading a file             */
                    361: } user_event_t;                                                                                                                                
                    362:                                                                                                                                                        
                    363:                                                                        /* Misc bits for event_t.misc                   */
                    364: #define EVENT_EXCL             (1<<0)          /* Exclusive                                                    */
                    365: #define EVENT_FORCE            (1<<1)          /* Force users off-line for event               */
                    366: #define EVENT_INIT             (1<<2)          /* Always run event after init                  */
                    367: #define EVENT_DISABLED (1<<3)          /* Disabled                                                             */
                    368:                                                                                                                                                        
                    369:                                                                        /* Mode bits for QWK stuff */                   
                    370: #define A_EXPAND               (1<<0)          /* Expand to ANSI sequences */                  
                    371: #define A_LEAVE                (1<<1)          /* Leave in */                                                  
                    372: #define A_STRIP                (1<<2)          /* Strip out */                                                 
                    373:                                                                                                                                                        
                    374:                                                                        /* Bits in xtrn_t.misc                                  */
                    375: #define MULTIUSER              (1<<0)          /* allow multi simultaneous users               */
1.1.1.2 ! root      376: #define XTRN_ANSI              (1<<1)          /* LEGACY (not used)                    */
        !           377: #define XTRN_STDIO             (1<<2)          /* Intercept Standard I/O (aka IO_INTS) */
1.1       root      378: #define MODUSERDAT             (1<<3)          /* Program can modify user data                 */
                    379: #define WWIVCOLOR              (1<<4)          /* Program uses WWIV color codes                */
                    380: #define EVENTONLY              (1<<5)          /* Program executes as event only               */
                    381: #define STARTUPDIR             (1<<6)          /* Create drop file in start-up dir             */
                    382: #define REALNAME               (1<<7)          /* Use real name in drop file                   */
                    383: #define SWAP                   (1<<8)          /* Swap for this door                                   */
                    384: #define FREETIME               (1<<9)          /* Free time while in this door                 */
                    385: #define QUICKBBS               (1<<10)         /* QuickBBS style editor                                */
                    386: #define EXPANDLF               (1<<11)         /* Expand LF to CRLF editor                     */
                    387: #define QUOTEALL               (1<<12)         /* Automatically quote all of msg               */
                    388: #define QUOTENONE              (1<<13)         /* Automatically quote none of msg              */
                    389: #define XTRN_NATIVE            (1<<14)         /* Native application (EX_NATIVE)               */
                    390: #define STRIPKLUDGE            (1<<15)         /* Strip FTN Kludge lines from msg              */
                    391: #define XTRN_CHKTIME   (1<<16)         /* Check time online (EX_CHKTIME)               */
                    392: #define XTRN_LWRCASE   (1<<17)         /* Use lowercase drop-file names                */
                    393: #define XTRN_SH                        (1<<18)         /* Use command shell to execute                 */
                    394: #define XTRN_PAUSE             (1<<19)         /* Force a screen pause on exit                 */
                    395: #define XTRN_NOECHO            (1<<20)         /* Don't echo stdin to stdout                   */
1.1.1.2 ! root      396: #define QUOTEWRAP              (1<<21)         /* Word-wrap the quoted text                    */
        !           397: #define XTRN_CONIO             (1<<31)         /* Intercept Windows Console I/O (Drwy) */
        !           398: 
1.1       root      399: 
                    400:                                                                        /* Bits in cfg.xtrn_misc                                */
                    401: #define XTRN_NO_MUTEX  (1<<0)          /* Do not use exec_mutex for FOSSIL VXD */
                    402: 
                    403:                                                                        /* Bits in user.qwk                                     */
                    404: #define QWK_FILES      (1L<<0)                 /* Include new files list                               */
                    405: #define QWK_EMAIL      (1L<<1)                 /* Include unread e-mail                                */
                    406: #define QWK_ALLMAIL (1L<<2)            /* Include ALL e-mail                                   */
                    407: #define QWK_DELMAIL (1L<<3)            /* Delete e-mail after download                 */
                    408: #define QWK_BYSELF     (1L<<4)                 /* Include messages from self                   */
                    409: #define QWK_UNUSED     (1L<<5)                 /* Currently unused                                     */
                    410: #define QWK_EXPCTLA (1L<<6)            /* Expand ctrl-a codes to ascii                 */
                    411: #define QWK_RETCTLA (1L<<7)            /* Retain ctrl-a codes                                  */
                    412: #define QWK_ATTACH     (1L<<8)                 /* Include file attachments                     */
                    413: #define QWK_NOINDEX (1L<<9)            /* Do not create index files in QWK             */
                    414: #define QWK_TZ         (1L<<10)                /* Include "@TZ" time zone in msgs              */
                    415: #define QWK_VIA        (1L<<11)                /* Include "@VIA" seen-bys in msgs              */
                    416: #define QWK_NOCTRL     (1L<<12)                /* No extraneous control files                  */
                    417: #define QWK_EXT                (1L<<13)                /* QWK Extended (QWKE) format                   */
                    418: #define QWK_MSGID      (1L<<14)                /* Include "@MSGID" in msgs                             */
1.1.1.2 ! root      419: #define QWK_HEADERS    (1L<<16)                /* Include HEADERS.DAT file                             */
1.1       root      420: 
                    421: #define QWK_DEFAULT    (QWK_FILES|QWK_ATTACH|QWK_EMAIL|QWK_DELMAIL)
                    422:                                                                                                                                                        
                    423:                                                        /* Bits in user.chat                                                    */
                    424: #define CHAT_ECHO      (1<<0)  /* Multinode chat echo                                                  */
                    425: #define CHAT_ACTION (1<<1)     /* Chat actions                                                                 */
                    426: #define CHAT_NOPAGE (1<<2)     /* Can't be paged                                                               */
                    427: #define CHAT_NOACT     (1<<3)  /* No activity alerts                                                   */
                    428: #define CHAT_SPLITP (1<<4)     /* Split screen private chat                                    */
                    429:                                                                                                                                                        
                    430:                                                                                                                                                        
1.1.1.2 ! root      431: #define INVALID_DIR ((uint)-1) /* Invalid directory value                                      */
        !           432: #define INVALID_SUB ((uint)-1) /* Invalid sub-board value                                      */
1.1       root      433:                                                                                                                                                        
                    434: #define KEY_BUFSIZE 1024       /* Size of keyboard input buffer                                */
                    435: #define SAVE_LINES      4              /* Maximum number of lines to save                              */
                    436: #define LINE_BUFSIZE 512       /* Size of line output buffer                                   */
                    437:                                                                                                                                                        
                    438:                                                                                                                                                        
                    439: #define EDIT_TABSIZE 4         /* Tab size for internal message/line editor    */
                    440:                                                                                                                                                        
                    441: #define SWAP_NONE      0x80    /* Allow no swapping for executables                    */
                    442:                                                                                                                                                        
                    443: #define DSTSDABLEN     50              /* Length of dsts.dab file                                              */
                    444:                                                                                                                                                        
                    445:                                                                /* Console I/O Bits     (console)                               */
                    446: #define CON_R_ECHO             (1<<0)  /* Echo remotely                                                        */
                    447: #define CON_R_ECHOX            (1<<1)  /* Echo X's to remote user                                      */
                    448: #define CON_R_INPUT            (1<<2)  /* Accept input remotely                                        */
                    449: #define CON_L_ECHO             (1<<3)  /* Echo locally                                         */
                    450: #define CON_L_ECHOX            (1<<4)  /* Echo X's locally                                                     */
                    451: #define CON_L_INPUT            (1<<5)  /* Accept input locally                                         */
                    452: #define CON_RAW_IN             (1<<8)  /* Raw input mode - no editing capabilities     */
                    453: #define CON_ECHO_OFF   (1<<10) /* Remote & Local echo disabled for ML/MF       */
                    454: #define CON_UPARROW            (1<<11) /* Up arrow hit - move up one line                      */
                    455: #define CON_DOWNARROW  (1<<12) /* Down arrow hit, exiting from getstr()        */
                    456: #define CON_NO_INACT   (1<<13) /* Console inactivity detection disabled        */
                    457: #define CON_BACKSPACE  (1<<14) /* Backspace hit, exiting from getstr()         */
                    458: #define CON_LEFTARROW  (1<<15) /* Left arrow hit, exiting from getstr()        */
                    459: #define CON_INSERT             (1<<16) /* Insert mode, for getstr()                            */
                    460: #define CON_DELETELINE (1<<17) /* Deleted line, exiting from getstr()          */
                    461:                                                                                                                                                        
                    462:                                                        /* Number of milliseconds                                               */
                    463: #define DELAY_AUTOHG 1500      /* Delay for auto-hangup (xfer)                                 */
                    464:                                                                                                                                                        
                    465: #define SEC_LOGON      1800    /* 30 minutes allowed to logon                                  */
                    466: #define SEC_BILLING   90       /* under 2 minutes per billing call                     */
                    467: #define SEC_OK            5    /* Attempt to get an OK response from modem             */
                    468: #define SEC_ANSI          5    /* Attempt to get a valid ANSI response                 */
                    469: #define SEC_ANSWER       30    /* Retries to get an answer code from modem             */
                    470: #define SEC_CID          10    /* Ten second pause for caller ID                               */
                    471: #define SEC_RING          6    /* Maximum seconds between rings                                */
                    472:                                                                                                                                                        
                    473: #define LOOP_NOPEN       50    /* Retries before file access denied                    */
                    474: #define LOOP_NODEDAB  50       /* Retries on node.dab locking/unlocking                */
                    475:                                                                                                                                                        
                    476:                                                        /* String lengths                                                               */
                    477: #define LEN_ALIAS              25      /* User alias                                                                   */
                    478: #define LEN_NAME               25      /* User name                                                                    */
                    479: #define LEN_HANDLE             8       /* User chat handle                                                     */
                    480: #define LEN_NOTE               30      /* User note                                                                    */
                    481: #define LEN_COMP               30      /* User computer description                                    */
                    482: #define LEN_COMMENT    60      /* User comment                                                                 */
                    483: #define LEN_NETMAIL    60      /* NetMail forwarding address                                   */
                    484: #define LEN_PASS                8      /* User password                                                                */
                    485: #define LEN_PHONE              12      /* User phone number                                                    */
                    486: #define LEN_BIRTH               8      /* Birthday in MM/DD/YY format                                  */
                    487: #define LEN_ADDRESS    30      /* User address                                                                 */
                    488: #define LEN_LOCATION   30      /* Location (City, State)                                               */
                    489: #define LEN_ZIPCODE    10      /* Zip/Postal code                                                              */
                    490: #define LEN_MODEM               8      /* User modem type description                                  */
                    491: #define LEN_FDESC              58      /* File description                                                     */
                    492: #define LEN_FCDT                9      /* 9 digits for file credit values                              */
                    493: #define LEN_TITLE              70      /* Message title                                                                */
                    494: #define LEN_MAIN_CMD   34      /* Storage in user.dat for custom commands              */
                    495: #define LEN_XFER_CMD   40                                                                                                      
                    496: #define LEN_SCAN_CMD   40                                                                                                      
                    497: #define LEN_MAIL_CMD   40                                                                                                      
                    498: #define LEN_CID                25      /* Caller ID (phone number)                                     */
                    499: #define LEN_ARSTR              40      /* Max length of Access Requirement string              */
                    500: #define LEN_CHATACTCMD  9      /* Chat action command                                                  */
                    501: #define LEN_CHATACTOUT 65      /* Chat action output string                                    */
                    502: 
                    503: /****************************************************************************/
                    504: /* This is a list of offsets into the USER.DAT file for different variables */
                    505: /* that are stored (for each user)                                                                                     */
                    506: /****************************************************************************/
                    507: #define U_ALIAS        0                                       /* Offset to alias */
                    508: #define U_NAME         U_ALIAS+LEN_ALIAS  /* Offset to name */
                    509: #define U_HANDLE       U_NAME+LEN_NAME 
                    510: #define U_NOTE         U_HANDLE+LEN_HANDLE+2 
                    511: #define U_COMP         U_NOTE+LEN_NOTE 
                    512: #define U_COMMENT      U_COMP+LEN_COMP+2 
                    513: 
                    514: #define U_NETMAIL      U_COMMENT+LEN_COMMENT+2 
                    515: 
                    516: #define U_ADDRESS      U_NETMAIL+LEN_NETMAIL+2 
                    517: #define U_LOCATION     U_ADDRESS+LEN_ADDRESS 
                    518: #define U_ZIPCODE      U_LOCATION+LEN_LOCATION 
                    519: 
                    520: #define U_PASS         U_ZIPCODE+LEN_ZIPCODE+2 
                    521: #define U_PHONE        U_PASS+8                        /* Offset to phone-number */
                    522: #define U_BIRTH        U_PHONE+12              /* Offset to users birthday     */
                    523: #define U_MODEM     U_BIRTH+8 
                    524: #define U_LASTON       U_MODEM+8 
                    525: #define U_FIRSTON      U_LASTON+8 
                    526: #define U_EXPIRE    U_FIRSTON+8 
                    527: #define U_PWMOD     U_EXPIRE+8 
                    528: 
                    529: #define U_LOGONS    U_PWMOD+8+2 
                    530: #define U_LTODAY    U_LOGONS+5 
                    531: #define U_TIMEON    U_LTODAY+5 
                    532: #define U_TEXTRA       U_TIMEON+5 
                    533: #define U_TTODAY    U_TEXTRA+5 
                    534: #define U_TLAST     U_TTODAY+5 
                    535: #define U_POSTS     U_TLAST+5 
                    536: #define U_EMAILS    U_POSTS+5 
                    537: #define U_FBACKS    U_EMAILS+5 
                    538: #define U_ETODAY       U_FBACKS+5 
                    539: #define U_PTODAY       U_ETODAY+5 
                    540: 
                    541: #define U_ULB       U_PTODAY+5+2 
                    542: #define U_ULS       U_ULB+10 
                    543: #define U_DLB       U_ULS+5 
                    544: #define U_DLS       U_DLB+10 
                    545: #define U_CDT          U_DLS+5 
                    546: #define U_MIN          U_CDT+10 
                    547: 
                    548: #define U_LEVEL        U_MIN+10+2      /* Offset to Security Level    */
                    549: #define U_FLAGS1       U_LEVEL+2       /* Offset to Flags */
                    550: #define U_TL           U_FLAGS1+8      /* Offset to unused field */
                    551: #define U_FLAGS2       U_TL+2 
                    552: #define U_EXEMPT       U_FLAGS2+8 
                    553: #define U_REST         U_EXEMPT+8 
                    554: #define U_ROWS         U_REST+8+2      /* Number of Rows on user's monitor */
                    555: #define U_SEX          U_ROWS+2                /* Sex, Del, ANSI, color etc.           */
                    556: #define U_MISC         U_SEX+1                 /* Miscellaneous flags in 8byte hex */
                    557: #define U_OLDXEDIT     U_MISC+8                /* External editor (Version 1 method  */
                    558: #define U_LEECH        U_OLDXEDIT+2    /* two hex digits - leech attempt count */
                    559: #define U_CURSUB       U_LEECH+2       /* Current sub (internal code)  */
                    560: #define U_CURXTRN      U_CURSUB+16 /* Current xtrn (internal code) */
                    561: #define U_MAIN_CMD     U_CURXTRN+8+2   /* unused */
                    562: #define U_XFER_CMD     U_MAIN_CMD+LEN_MAIN_CMD                 /* unused */
                    563: #define U_SCAN_CMD     U_XFER_CMD+LEN_XFER_CMD+2       /* unused */
                    564: #define U_MAIL_CMD     U_SCAN_CMD+LEN_SCAN_CMD                 /* unused */
                    565: #define U_FREECDT      U_MAIL_CMD+LEN_MAIL_CMD+2 
                    566: #define U_FLAGS3       U_FREECDT+10    /* Flag set #3 */
                    567: #define U_FLAGS4       U_FLAGS3+8      /* Flag set #4 */
                    568: #define U_XEDIT        U_FLAGS4+8      /* External editor (code  */
                    569: #define U_SHELL        U_XEDIT+8       /* Command shell (code  */
                    570: #define U_QWK          U_SHELL+8       /* QWK settings */
                    571: #define U_TMPEXT       U_QWK+8                 /* QWK extension */
                    572: #define U_CHAT         U_TMPEXT+3      /* Chat settings */
                    573: #define U_NS_TIME      U_CHAT+8                /* New-file scan date/time */
                    574: #define U_PROT         U_NS_TIME+8     /* Default transfer protocol */
                    575: #define U_LOGONTIME    U_PROT+1
                    576: #define U_CURDIR       U_LOGONTIME+8   /* Current dir (internal code  */
                    577: #define U_UNUSED       U_CURDIR+16
                    578: #define U_LEN          (U_UNUSED+4+2)
                    579: 
                    580: /****************************************************************************/
                    581: /* Offsets into DIR .DAT file for different fields for each file                       */
                    582: /****************************************************************************/
                    583: #define F_CDT          0                               /* Offset in DIR#.DAT file for cdts             */
                    584: #define F_DESC         (F_CDT+LEN_FCDT)/* Description                                                  */
                    585: #define F_ULER         (F_DESC+LEN_FDESC+2)   /* Uploader                                              */
                    586: #define F_TIMESDLED (F_ULER+30+2)      /* Number of times downloaded                   */
                    587: #define F_OPENCOUNT    (F_TIMESDLED+5+2)                                                                               
                    588: #define F_MISC         (F_OPENCOUNT+3+2)                                                                               
                    589: #define F_ALTPATH      (F_MISC+1)              /* Two hex digit alternate path */              
                    590: #define F_LEN          (F_ALTPATH+2+2) /* Total length of all fdat in file             */
                    591:                                                                                                                                                        
                    592: #define F_IXBSIZE      22                              /* Length of each index entry                   */
                    593:                                                                                                                                                        
                    594: #define F_EXBSIZE      512                             /* Length of each ext-desc entry                */
                    595:                                                                                                                                                        
                    596:                                                                                                                                                        
                    597: #define SIF_MAXBUF  0x7000                     /* Maximum buffer size of SIF data              */
                    598:                                                                                                                                                        
                    599: /* NOTE: Do not change the values of the following block of defines!           */
                    600:                                                                                                                                                        
                    601: #define DELETED        (1L<<0)                 /* Bit values for user.misc                     */
                    602: #define ANSI           (1L<<1)                 /* Supports ANSI terminal emulation             */
                    603: #define COLOR          (1L<<2)                 /* Send color codes                                     */
                    604: #define RIP            (1L<<3)                 /* Supports RIP terminal emulation              */
                    605: #define UPAUSE         (1L<<4)                 /* Pause on every screen full                   */
                    606: #define SPIN           (1L<<5)                 /* Spinning cursor - Same as K_SPIN             */
                    607: #define INACTIVE       (1L<<6)                 /* Inactive user slot                                   */
                    608: #define EXPERT         (1L<<7)                 /* Expert menu mode                                     */
                    609: #define ANFSCAN        (1L<<8)                 /* Auto New file scan                                   */
                    610: #define CLRSCRN        (1L<<9)                 /* Clear screen before each message             */
                    611: #define QUIET          (1L<<10)                /* Quiet mode upon logon                                */
                    612: #define BATCHFLAG      (1L<<11)                /* File list allow batch dl flags               */
                    613: #define NETMAIL        (1L<<12)                /* Forward e-mail to fidonet addr               */
                    614: #define CURSUB         (1L<<13)                /* Remember current sub-board/dir               */
                    615: #define ASK_NSCAN      (1L<<14)                /* Ask for newscanning upon logon               */
                    616: #define NO_EXASCII     (1L<<15)                /* Don't send extended ASCII                    */
                    617: #define ASK_SSCAN      (1L<<16)                /* Ask for messages to you at logon             */
                    618: #define AUTOTERM       (1L<<17)                /* Autodetect terminal type                     */
                    619: #define COLDKEYS       (1L<<18)                /* No hot-keys                                                  */
                    620: #define EXTDESC        (1L<<19)                /* Extended file descriptions                   */
                    621: #define AUTOHANG       (1L<<20)                /* Auto-hang-up after transfer                  */
                    622: #define WIP            (1L<<21)                /* Supports WIP terminal emulation              */
                    623: #define AUTOLOGON      (1L<<22)                /* AutoLogon via IP                                             */
                    624: #define HTML           (1L<<23)                /* Using Deuce's HTML terminal                  */
                    625: #define NOPAUSESPIN    (1L<<24)                /* No spinning cursor at pause prompt   */
                    626: 
                    627: #define TERM_FLAGS     (ANSI|COLOR|NO_EXASCII|RIP|WIP|HTML)
                    628:                                                                                                                                                        
                    629: #define CLREOL      256     /* Character to erase to end of line                       */
                    630:                                                                                                                                                        
                    631:                                                        /* Online status (online)                                               */
                    632: #define ON_LOCAL       1               /* Online locally                                                               */
                    633: #define ON_REMOTE   2                  /* Online remotely                                                              */
                    634:                                                                                                                                                        
                    635:                                                        /* Various SYSTEM parameters for sys_status             */
                    636: #define SS_UNUSED      (1L<<0) /* Unused                                                                       */
                    637: #define SS_INITIAL  (1L<<1)    /* The bbs data has been initialized.                   */
                    638: #define SS_TMPSYSOP (1L<<2)    /* Temporary Sysop Status                                               */
                    639: #define SS_USERON   (1L<<3)    /* A User is logged on to the BBS                               */
                    640: #define SS_LCHAT    (1L<<4) /* Local chat in progress                                          */
                    641: #define SS_CAP         (1L<<5) /* Capture is on                                                                */
                    642: #define SS_ANSCAP      (1L<<6) /* Capture ANSI codes too                                               */
                    643: #define SS_FINPUT      (1L<<7) /* Using file for input                                                 */
                    644: #define SS_COMISR      (1L<<8) /* Com port ISR is installed                                    */
                    645: #define SS_DAILY       (1L<<9) /* Execute System Daily Event on logoff                 */
                    646: #define SS_INUEDIT     (1L<<10) /* Inside Alt-Useredit section                                 */
                    647: #define SS_ABORT       (1L<<11) /* Global abort input or output flag                   */
                    648: #define SS_SYSPAGE     (1L<<12) /* Paging sysop                                                                */
                    649: #define SS_SYSALERT (1L<<13) /* Notify sysop when users hangs up                       */
                    650: #define SS_GURUCHAT (1L<<14) /* Guru chat in progress                                          */
                    651: #define SS_UNUSED2     (1L<<15) /* not used in v3 (used to be SS_NODEDAB)              */
                    652: #define SS_EVENT       (1L<<16) /* Time shortened due to upcoming event                */
                    653: #define SS_PAUSEON     (1L<<17) /* Pause on, overriding user default                   */
                    654: #define SS_PAUSEOFF (1L<<18) /* Pause off, overriding user default                     */
                    655: #define SS_IN_CTRLP (1L<<19) /* Inside ctrl-p send node message func           */
                    656: #define SS_NEWUSER     (1L<<20) /* New User online                                                     */
                    657: #define SS_MDMDEBUG (1L<<21) /* Modem debug output                                                     */
                    658: #define SS_NEST_PF     (1L<<22) /* Nested in printfile function                                */
                    659: #define SS_DCDHIGH     (1L<<23) /* Assume DCD is high always                                   */
                    660: #define SS_SPLITP      (1L<<24) /* Split-screen private chat                                   */
                    661: #define SS_NEWDAY      (1L<<25) /* Date changed while online                                   */
                    662: #define SS_RLOGIN      (1L<<26) /* Current login via BSD RLogin                                */
                    663: #define SS_FILEXFER    (1L<<27) /* File transfer in progress, halt spy                 */
                    664: #define SS_SSH         (1L<<28) /* Current login via SSH                                               */
1.1.1.2 ! root      665: #define SS_MOFF                (1L<<29) /* Disable automatic messages                                  */
1.1       root      666: 
                    667:                                                                /* Bits in 'mode' for getkey and getstr     */
                    668: #define K_NONE         0                       /* Use as a place holder for no mode flags      */
                    669: #define K_UPPER        (1L<<0)         /* Converts all letters to upper case           */
                    670: #define K_UPRLWR       (1L<<1)         /* Upper/Lower case automatically                       */
                    671: #define K_NUMBER       (1L<<2)         /* Allow numbers only                                           */
                    672: #define K_WRAP         (1L<<3)         /* Allows word wrap                                             */
                    673: #define K_MSG          (1L<<4)         /* Allows ANSI, ^N ^A ^G                                        */
                    674: #define K_SPIN         (1L<<5)         /* Spinning cursor (same as SPIN)                       */
                    675: #define K_LINE         (1L<<6)         /* Input line (inverse color)                           */
                    676: #define K_EDIT         (1L<<7)         /* Edit string passed                                           */
                    677: #define K_CHAT         (1L<<8)         /* In chat multi-chat                                           */
                    678: #define K_NOCRLF       (1L<<9)         /* Don't print CRLF after string input      */
                    679: #define K_ALPHA        (1L<<10)        /* Only allow alphabetic characters             */
                    680: #define K_GETSTR       (1L<<11)        /* getkey called from getstr()                          */
                    681: #define K_LOWPRIO      (1L<<12)        /* low priority input                                           */
                    682: #define K_NOEXASC      (1L<<13)        /* No extended ASCII allowed                            */
                    683: #define K_E71DETECT (1L<<14)   /* Detect E-7-1 terminal type                           */
                    684: #define K_AUTODEL      (1L<<15)        /* Auto-delete text (used with K_EDIT)          */
                    685: #define K_COLD         (1L<<16)        /* Possible cold key mode                                       */
                    686: #define K_NOECHO       (1L<<17)        /* Don't echo input                         */
                    687: #define K_TAB          (1L<<18)        /* Treat TAB key as CR                                          */
                    688: #define K_LEFTEXIT     (1L<<19)        /* Allow exit by backspacing/arrowing left      */
                    689: #define K_USEOFFSET    (1L<<20)        /* Use getstr_offset for cursor position        */
                    690: #define K_NOSPIN       (1L<<21)        /* Do not honor the user's spinning cursor      */
1.1.1.2 ! root      691: #define K_ANSI_CPR     (1L<<22)        /* Expect ANSI Cursor Position Report           */
1.1       root      692: 
                    693:                                                                /* Bits in 'mode' for putmsg and printfile  */
                    694: #define P_NOABORT      (1<<0)          /* Disallows abortion of a message          */
                    695: #define P_SAVEATR   (1<<1)             /* Save the new current attributres after       */
                    696:                                                                /* msg has printed. */
                    697: #define P_NOATCODES (1<<2)             /* Don't allow @ codes                      */
                    698: #define P_OPENCLOSE (1<<3)             /* Open and close the file                                      */
                    699: #define P_NOPAUSE      (1<<4)          /* Disable screen pause                                         */
                    700: #define P_HTML         (1<<5)          /* Message is HTML                                                      */
                    701: #define P_NOCRLF       (1<<6)          /* Don't prepend a CRLF in printfile()          */
                    702:                                                                
                    703:                                                                /* Bits in 'mode' for listfiles             */
                    704: #define FL_ULTIME   (1<<0)             /* List files by upload time                */
                    705: #define FL_DLTIME   (1<<1)             /* List files by download time              */
                    706: #define FL_NO_HDR   (1<<2)             /* Don't list directory header              */
                    707: #define FL_FINDDESC (1<<3)             /* Find text in description                 */
                    708: #define FL_EXFIND   (1<<4)             /* Find text in description - extended info */
                    709: #define FL_VIEW     (1<<5)             /* View ZIP/ARC/GIF etc. info               */
                    710:                                                                
                    711:                                                                /* Bits in the mode of writemsg and email() */
                    712: #define WM_EXTDESC     (1<<0)          /* Writing extended file description            */
                    713: #define WM_EMAIL       (1<<1)          /* Writing e-mail                                                       */
                    714: #define WM_NETMAIL     (1<<2)          /* Writing NetMail                                                      */
                    715: #define WM_ANON        (1<<3)          /* Writing anonymous message                            */
                    716: #define WM_FILE        (1<<4)          /* Attaching a file to the message                      */
                    717: #define WM_NOTOP       (1<<5)          /* Don't add top because we need top line   */
                    718: #define WM_QUOTE       (1<<6)          /* Quote file available                                         */
                    719: #define WM_QWKNET      (1<<7)          /* Writing QWK NetMail (25 char title)          */
                    720: #define WM_PRIVATE     (1<<8)          /* Private (for creating MSGINF file)           */
                    721: #define WM_SUBJ_RO     (1<<9)          /* Subject/title is read-only                           */
                    722:                                                                
                    723:                                                                /* Bits in the mode of loadposts()                      */
                    724: #define LP_BYSELF      (1<<0)          /* Include messages sent by self                        */
                    725: #define LP_OTHERS      (1<<1)          /* Include messages sent to others                      */
                    726: #define LP_UNREAD      (1<<2)          /* Un-read messages only                                        */
                    727: #define LP_PRIVATE     (1<<3)          /* Include all private messages                         */
                    728: #define LP_REP         (1<<4)          /* Packing REP packet                                           */
                    729:                                                                
                    730:                                                                /* Bits in the mode of loadmail()                       */
                    731: #define LM_UNREAD      (1<<0)          /* Include un-read mail only                            */
                    732: #define LM_INCDEL      (1<<1)          /* Include deleted mail                                         */
                    733:                                                                
                    734: enum {                                                 /* readmail and delmailidx which types          */
                    735:         MAIL_YOUR                                      /* mail sent to you                                                     */
                    736:        ,MAIL_SENT                                      /* mail you have sent                                           */
                    737:        ,MAIL_ANY                                       /* mail sent to or from you                                     */
                    738:        ,MAIL_ALL                                       /* all mail (ignores usernumber arg)            */
                    739:        };                                                      
                    740:                                                                
                    741:                                                                /* Bits in the mode of external()           */
                    742: #define EX_SH       (1<<0)             /* Use command shell to load other process  */
1.1.1.2 ! root      743: #define EX_STDOUT   (1<<1)             /* Copy DOS output to remote                */
        !           744: #define EX_OUTL        (1<<2)          /* Use _lputc() for local output (*legacy*)     */
        !           745: #define EX_STDIN       (1<<3)          /* Trap int 16h keyboard input requests     */
1.1       root      746: #define EX_WWIV        WWIVCOLOR       /* Expand WWIV color codes to ANSI sequence */
                    747: #define EX_SWAP        (1<<5)          /* Swap out for this external (*legacy*)        */
                    748: #define EX_POPEN       (1<<7)          /* Leave COM port open  (*legacy*)                      */
                    749: #define EX_OFFLINE     (1<<8)          /* Run this program offline                                     */
                    750: #define EX_BG          (1<<10)         /* Back-ground/detached process                         */
                    751: #define EX_BIN         (1<<11)         /* Binary mode (no Unix LF to CRLF)                     */
                    752: #define EX_NATIVE      XTRN_NATIVE             /* Native 32-bit application                    */
                    753: #define EX_CHKTIME     XTRN_CHKTIME    /* Check time left                                              */
                    754: #define EX_NOECHO      XTRN_NOECHO             /* Don't echo stdin to stdout                   */
1.1.1.2 ! root      755: #define EX_STDIO       (EX_STDIN|EX_STDOUT)
        !           756: #define EX_CONIO       (1<<31)         /* Intercept Windows console I/O (doorway)      */
1.1       root      757: 
                    758: #if defined(__unix)
                    759: #define EX_WILDCARD    EX_SH           /* Expand wildcards using 'sh' on Unix          */
                    760: #else
                    761: #define EX_WILDCARD    0
                    762: #endif
                    763:                                                                
                    764:                                                                /* telnet_gate() mode bits                                      */                                                      
                    765: #define TG_ECHO                        (1<<0)  /* Turn on telnet echo                                          */
                    766: #define TG_CRLF                        (1<<1)  /* Expand sole CR to CRLF                                       */
                    767: #define TG_LINEMODE            (1<<2)  /* Send entire lines only                                       */
                    768: #define TG_NODESYNC            (1<<3)  /* Call Nodesync, get msgs, etc.                        */
                    769: #define TG_CTRLKEYS            (1<<4)  /* Interpret ^P ^U ^T, etc locally                      */
                    770: #define TG_PASSTHRU            (1<<5)  /* Pass-through telnet commands/responses       */
                    771: #define TG_RLOGIN              (1<<6)  /* Use BSD RLogin protocol                                      */
                    772: #define TG_NOCHKTIME   (1<<7)  /* Don't check time left while gated            */
                    773: #define TG_NOTERMTYPE  (1<<8)  /* Request client "DONT TERM_TYPE"                      */
                    774:                                                                
                    775: enum {                                                 /* Values for 'mode' in listfileinfo        */
                    776:         FI_INFO                        /* Just list file information               */
                    777:        ,FI_REMOVE                      /* Remove/Move/Edit file information        */
                    778:        ,FI_DOWNLOAD                    /* Download files                           */
                    779:        ,FI_OLD                         /* Search/Remove files not downloaded since */
                    780:        ,FI_OLDUL                                       /* Search/Remove files uploaded before      */
                    781:        ,FI_OFFLINE                             /* Search/Remove files not online                       */
                    782:        ,FI_USERXFER                            /* User Xfer Download                       */
                    783:        ,FI_CLOSE                                       /* Close any open records                                       */
                    784:        };                                                      
                    785: 
                    786: enum XFER_TYPE {                               /* Values for type in xfer_prot_select()        */
                    787:         XFER_UPLOAD
                    788:        ,XFER_DOWNLOAD
                    789:        ,XFER_BATCH_UPLOAD
                    790:        ,XFER_BATCH_DOWNLOAD
                    791:        ,XFER_BIDIR
                    792: };
                    793:        
                    794: #define L_LOGON     1                  /* Logon List maintenance                   */
                    795: #define LOL_SIZE    81                 /* Length of each logon list entry          */
                    796:                                                                
                    797:                                                                /* Bits in mode of scanposts() function         */
                    798: #define SCAN_CONST     (1<<0)          /* Continuous message scanning                          */
                    799: #define SCAN_NEW       (1<<1)          /* New scanning                                                         */
                    800: #define SCAN_BACK      (1<<2)          /* Scan the last message if no new                      */
                    801: #define SCAN_TOYOU     (1<<3)          /* Scan for messages to you                             */
                    802: #define SCAN_FIND      (1<<4)          /* Scan for text in messages                            */
                    803: #define SCAN_UNREAD (1<<5)             /* Find un-read messages to you                         */
                    804:                                                                
                    805:                                                                /* Bits in misc of chan_t                                       */
                    806: #define CHAN_PW        (1<<0)          /* Can be password protected                            */
                    807: #define CHAN_GURU      (1<<1)          /* Guru joins empty channel                             */
                    808:                                                                
                    809: enum {                                                 /* Values of mode for userlist function     */
                    810:         UL_ALL                                         /* List all users in userlist                           */
                    811:        ,UL_SUB                                 /* List all users with access to cursub     */
                    812:        ,UL_DIR                                         /* List all users with access to curdir         */
                    813:        };                                                      
                    814:                                                                
                    815:                                                                
                    816: #define BO_LEN         16                      /* backout.dab record length                            */
                    817:                                                                
                    818: #define BO_OPENFILE 0                  /* Backout types */
                    819: 
                    820: /**********/
                    821: /* Macros */
                    822: /**********/
                    823: 
                    824: #define CRLF                   { outchar(CR); outchar(LF); }
                    825: #define SYSOP_LEVEL            90
                    826: #define SYSOP                  (useron.level>=SYSOP_LEVEL || sys_status & SS_TMPSYSOP)
                    827: #define REALSYSOP              (useron.level>=SYSOP_LEVEL)
                    828: #define FLAG(x)                (ulong)(1UL<<(x-'A'))
                    829: #define CLS            outchar(FF)
1.1.1.2 ! root      830: #define WHERE          __LINE__,getfname(__FILE__)
        !           831: #define SAVELINE               { if(slcnt<SAVE_LINES) { \
        !           832:                                                        slatr[slcnt]=latr; \
1.1       root      833:                                                        slcuratr[slcnt]=curatr; \
                    834:                                                        sprintf(slbuf[slcnt],"%.*s",lbuflen,lbuf); \
1.1.1.2 ! root      835:                                                        slcnt++; \
        !           836:                                                        lbuflen=0; } }
1.1       root      837: #define RESTORELINE    { lbuflen=0; if(slcnt) --slcnt; \
                    838:                                                        attr(slatr[slcnt]); \
                    839:                                                        rputs(slbuf[slcnt]); \
                    840:                                                        curatr=slcuratr[slcnt]; }
                    841: #define SYNC                   { getnodedat(cfg.node_num,&thisnode,0); \
                    842:                                                  nodesync(); }
                    843: #define ASYNC                  { getnodedat(cfg.node_num,&thisnode,0); \
                    844:                                                  nodesync(); }
                    845: #define TM_YEAR(yy)            ((yy)%100)
                    846: #define sbbs_beep(f,d) BEEP(f,d)
                    847: #define mswait(x)              SLEEP(x)
                    848: 
                    849: /**************************************/
                    850: /* Text Attribute (color) Definitions */
                    851: /**************************************/
                    852: #define HIGH  0x08      /* High intensity foreground text */
                    853: #ifndef BLINK
                    854: #define BLINK 0x80             /* Blinking text */
                    855: #endif
                    856: 
                    857: #ifndef __COLORS
                    858: #define __COLORS
                    859: 
                    860: enum COLORS {
                    861:        BLACK,                  /* dark colors (HIGH bit unset) */
                    862:        BLUE,
                    863:        GREEN,
                    864:        CYAN,
                    865:        RED,
                    866:        MAGENTA,
                    867:        BROWN,
                    868:        LIGHTGRAY,
                    869:        DARKGRAY,               /* light colors (HIGH bit set) */
                    870:        LIGHTBLUE,
                    871:        LIGHTGREEN,
                    872:        LIGHTCYAN,
                    873:        LIGHTRED,
                    874:        LIGHTMAGENTA,
                    875:        YELLOW,
                    876:        WHITE
                    877: };
                    878: 
                    879: #endif /* __COLORS */
                    880: 
                    881: #define ANSI_NORMAL            0x100
                    882: #define BG_BLACK               0x200
                    883: #define BG_BLUE                        (BLUE<<4)
                    884: #define BG_GREEN               (GREEN<<4)
                    885: #define BG_CYAN                        (CYAN<<4)
                    886: #define BG_RED                 (RED<<4)
                    887: #define BG_MAGENTA             (MAGENTA<<4)
                    888: #define BG_BROWN               (BROWN<<4)
                    889: #define BG_LIGHTGRAY   (LIGHTGRAY<<4)
                    890: 
                    891: /********************/
                    892: /* Type Definitions */
                    893: /********************/
                    894: 
                    895: typedef struct {                                               /* Users information */
                    896:        ushort  number,                                         /* Number */
                    897:                        uls,                                            /* Number of uploads */
                    898:                        dls,                                            /* Number of downloads */
                    899:                        posts,                                          /* Number of posts */
                    900:                        emails,                                         /* Number of emails */
                    901:                        fbacks,                                         /* Number of emails sent to sysop */
                    902:                        etoday,                                         /* Emails today */
                    903:                        ptoday,                                         /* Posts today */
                    904:                        timeon,                                         /* Total time on */
                    905:                        textra,                                         /* Extra time for today */
                    906:                        logons,                                         /* Total logons */
                    907:                        ttoday,                                         /* Time on today */
                    908:                        tlast,                                          /* Time on last call */
                    909:                        ltoday,                                         /* Logons today */
                    910:                        xedit,                                          /* External editor (1 based) */
                    911:                        shell;                                          /* Command shell */
                    912: 
                    913:        char    alias[LEN_ALIAS+1],             /* Alias */
                    914:                        name[LEN_NAME+1],                       /* Name - Real */
                    915:                        handle[LEN_HANDLE+1],           /* Chat handle */
                    916:                        comp[LEN_COMP+1],                       /* Computer type */
                    917:                        note[LEN_NOTE+1],                       /* Public notice about this user */
                    918:                        address[LEN_ADDRESS+1],         /* Street Address */
                    919:                        location[LEN_LOCATION+1],       /* Location of user */
                    920:                        zipcode[LEN_ZIPCODE+1],         /* Zip/Postal code */
                    921:                        pass[LEN_PASS+1],                       /* Password - not case sensitive */
                    922:                        birth[LEN_BIRTH+1],             /* Birthday in MM/DD/YY format */
                    923:                        phone[LEN_PHONE+1],                     /* Phone number xxx-xxx-xxxx format */
                    924:                        modem[LEN_MODEM+1],                     /* Modem type - 8 chars max */
                    925:                        netmail[LEN_NETMAIL+1],         /* NetMail forwarding address */
                    926:                        tmpext[4],                                      /* QWK Packet extension */
                    927:                        comment[LEN_COMMENT+1],         /* Private comment about user */
                    928:                        cursub[LEN_EXTCODE+1],          /* Current sub-board internal code */
                    929:                        curdir[LEN_EXTCODE+1],          /* Current directory internal code */
                    930:                        curxtrn[9];                                     /* Current external program internal code */
                    931: 
                    932:        uchar   level,                                          /* Security level */
                    933:                        sex,                                            /* Sex - M or F */
                    934:                        rows,                           /* Rows of text */
                    935:                        prot,                                           /* Default transfer protocol */
                    936:                        leech;                                          /* Leech attempt counter */
                    937: 
                    938:        ulong   misc,                                           /* Misc. bits - ANSI, Deleted etc. */
                    939:                        qwk,                                            /* QWK settings */
                    940:                        chat,                                           /* Chat defaults */
                    941:                        flags1,                                         /* Flag set #1 */
                    942:                        flags2,                                         /* Flag set #2 */
                    943:                        flags3,                                         /* Flag set #3 */
                    944:                        flags4,                                         /* Flag set #4 */
                    945:                        exempt,                                         /* Exemption Flags */
                    946:                        rest,                                           /* Restriction Flags */
                    947:                        ulb,                                            /* Total bytes uploaded */
                    948:                        dlb,                                            /* Total bytes downloaded */
                    949:                        cdt,                                            /* Credits */
                    950:                        min,                                            /* Minutes */
                    951:                        freecdt;                                        /* Free credits (renewed daily) */
                    952:        time_t  firston,                                        /* Date/Time first called */
                    953:                        laston,                                         /* Last logoff date/time */
                    954:                        expire,                                         /* Expiration date */
                    955:                        pwmod,                                          /* Password last modified */
                    956:                        ns_time,                                        /* Date/Time of last new file scan */
                    957:                        logontime;                                      /* Time of current logon */
                    958: 
                    959: } user_t;
                    960: 
                    961: typedef struct {                                               /* File (transfers) Data */
                    962:        char    name[13],                                       /* Name of file FILENAME.EXT */
                    963:                        desc[LEN_FDESC+1],                      /* Uploader's Description */
                    964:                        uler[LEN_ALIAS+1];                      /* User who uploaded */
                    965:        uchar   opencount;                                      /* Times record is currently open */
1.1.1.2 ! root      966:        time32_t  date,                                         /* File date/time */
1.1       root      967:                        dateuled,                                       /* Date/Time (Unix) Uploaded */
                    968:                        datedled;                                       /* Date/Time (Unix) Last downloaded */
1.1.1.2 ! root      969:        uint16_t        dir,                                            /* Directory file is in */
1.1       root      970:                        altpath,
                    971:                        timesdled,                                      /* Total times downloaded */
                    972:                        timetodl;                                       /* How long transfer time */
1.1.1.2 ! root      973:        int32_t datoffset,                                      /* Offset into .DAT file */
1.1       root      974:                        size,                                           /* Size of file */
                    975:                        misc;                                           /* Miscellaneous bits */
1.1.1.2 ! root      976:        uint32_t        cdt;                                            /* Credit value for this file */
1.1       root      977: 
                    978: } file_t;
                    979: 
                    980: typedef idxrec_t post_t;                               /* defined in smbdefs.h */
                    981: typedef idxrec_t mail_t;                               /* defined in smbdefs.h */
                    982: typedef fidoaddr_t faddr_t;                            /* defined in smbdefs.h */
                    983: 
                    984: typedef struct {                                               /* System/Node Statistics */
1.1.1.2 ! root      985:        uint32_t        logons,                                         /* Total Logons on System */
        !           986:                                ltoday,                                         /* Total Logons Today */
        !           987:                                timeon,                                         /* Total Time on System */
        !           988:                                ttoday,                                         /* Total Time Today */
        !           989:                                uls,                                            /* Total Uploads Today */
        !           990:                                ulb,                                            /* Total Upload Bytes Today */
        !           991:                                dls,                                            /* Total Downloads Today */
        !           992:                                dlb,                                            /* Total Download Bytes Today */
        !           993:                                ptoday,                                         /* Total Posts Today */
        !           994:                                etoday,                                         /* Total Emails Today */
        !           995:                                ftoday;                                         /* Total Feedbacks Today */
        !           996:        uint16_t        nusers;                                         /* Total New Users Today */
1.1       root      997: 
                    998: } stats_t;
                    999: 
                   1000: typedef struct {                                               /* Sub-board scan information */
1.1.1.2 ! root     1001:        uint16_t        cfg;                                            /* User's configuration */
        !          1002:        uint32_t        ptr;                                            /* New-message pointer */
        !          1003:        uint32_t        last;                                           /* Last read message number */
        !          1004:        uint16_t        sav_cfg;                                        /* Saved configuration */
        !          1005:        uint32_t        sav_ptr;                                        /* Saved New-message pointer */
        !          1006:        uint32_t        sav_last;                                       /* Saved Last read message number */
1.1       root     1007: } subscan_t;
                   1008: 
                   1009: #endif /* Don't add anything after this #endif statement */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.