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

1.1       root        1: /* sbbs.h */
                      2: 
                      3: /* Synchronet class (sbbs_t) definition and exported function prototypes */
                      4: 
1.1.1.2 ! root        5: /* $Id: sbbs.h,v 1.244 2004/12/30 09:24:05 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 2004 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 _SBBS_H
                     39: #define _SBBS_H
                     40: 
                     41: /****************************/
                     42: /* Standard library headers */
                     43: /****************************/
                     44: 
                     45: /***************/
                     46: /* OS-specific */
                     47: /***************/
                     48: #if defined(_WIN32)                    /* Windows */
                     49: 
                     50:        #include <io.h>
                     51:        #include <share.h>
                     52:        #include <windows.h>
                     53:        #include <process.h>    /* _beginthread() prototype */
                     54:        #include <direct.h>             /* _mkdir() prototype */
                     55:        #include <mmsystem.h>   /* SND_ASYNC */
                     56: 
1.1.1.2 ! root       57:        #if defined(_DEBUG) && defined(_MSC_VER)
        !            58:                #include <crtdbg.h> /* Windows debug macros and stuff */
        !            59:        #endif
        !            60: 
        !            61: #if defined(__cplusplus)
        !            62:        extern "C"
        !            63: #endif
        !            64:        extern HINSTANCE hK32;
        !            65: 
1.1       root       66: #elif defined(__unix__)                /* Unix-variant */
                     67: 
                     68:        #include <unistd.h>             /* close */
                     69: 
                     70: #endif
                     71: 
                     72: /******************/
                     73: /* ANSI C Library */
                     74: /******************/
                     75: #include <time.h>
                     76: #include <errno.h>
                     77: #include <stdio.h>
                     78: #include <ctype.h>
                     79: #include <fcntl.h>                     /* open */
                     80: #include <stdarg.h>
                     81: #include <stdlib.h>
                     82: #include <string.h>
1.1.1.2 ! root       83: 
        !            84: #ifndef __unix__
        !            85: 
        !            86:        #include <malloc.h>
        !            87: 
        !            88: #endif
        !            89: 
1.1       root       90: #include <sys/stat.h>
                     91: 
1.1.1.2 ! root       92: #ifdef JAVASCRIPT
        !            93:        #ifdef __unix__
        !            94:                #define XP_UNIX
        !            95:        #else
        !            96:                #define XP_PC
        !            97:                #define XP_WIN
        !            98:        #endif
        !            99:        #define JS_THREADSAFE   /* Required! */
        !           100:        #include <jsapi.h>
        !           101:        #include <jsprf.h>              /* JS-safe sprintf functions */
        !           102: #endif
        !           103: 
1.1       root      104: /***********************/
                    105: /* Synchronet-specific */
                    106: /***********************/
1.1.1.2 ! root      107: #ifdef __cplusplus
        !           108:        #include "startup.h"
        !           109:        #include "threadwrap.h" /* pthread_mutex_t */
        !           110: #endif
        !           111: #ifdef SBBS    
        !           112:        #include "text.h"
        !           113: #endif
        !           114: 
        !           115: /* xpdev */
        !           116: #define LINK_LIST_THREADSAFE
        !           117: #include "genwrap.h"
        !           118: #include "dirwrap.h"
        !           119: #include "filewrap.h"
        !           120: #include "sockwrap.h"
        !           121: #include "link_list.h"
        !           122: #include "msg_queue.h"
        !           123: 
1.1       root      124: #include "smblib.h"
                    125: #include "ars_defs.h"
                    126: #include "scfgdefs.h"
                    127: #include "scfglib.h"
                    128: #include "userdat.h"
                    129: #include "riodefs.h"
                    130: #include "cmdshell.h"
                    131: #include "ringbuf.h"    /* RingBuf definition */
                    132: #include "client.h"            /* client_t definition */
1.1.1.2 ! root      133: #include "crc16.h"
        !           134: #include "crc32.h"
        !           135: #include "telnet.h"
1.1       root      136: 
                    137: /* Synchronet Node Instance class definition */
                    138: #ifdef __cplusplus
                    139: class sbbs_t
                    140: {
                    141: 
                    142: public:
                    143: 
1.1.1.2 ! root      144:        sbbs_t(ushort node_num, DWORD addr, char* host_name, SOCKET
        !           145:                ,scfg_t*, char* text[], client_t* client_info);
1.1       root      146:        ~sbbs_t();
                    147: 
1.1.1.2 ! root      148:        bbs_startup_t*  startup;
        !           149: 
1.1       root      150:        bool    init(void);
1.1.1.2 ! root      151:        BOOL    terminated;
1.1       root      152: 
                    153:        client_t client;
                    154:        SOCKET  client_socket;
                    155:        SOCKET  client_socket_dup;
                    156:        DWORD   client_addr;
1.1.1.2 ! root      157:        char    client_name[128];
        !           158:        char    client_ident[128];
1.1       root      159:        DWORD   local_addr;
                    160: 
                    161:        scfg_t  cfg;
                    162: 
                    163:        int             outchar_esc;               // track ANSI escape seq output
                    164: 
                    165:        int     rioctl(ushort action); // remote i/o control
                    166:        bool    rio_abortable;
                    167: 
                    168:     RingBuf    inbuf;
                    169:     RingBuf    outbuf;
                    170:        HANDLE  input_thread;
                    171:        pthread_mutex_t input_thread_mutex;
1.1.1.2 ! root      172:        bool    input_thread_mutex_locked;      // by someone other than the input_thread
1.1       root      173: 
                    174:        int     outcom(uchar ch);          // send character
1.1.1.2 ! root      175:        int     incom(unsigned long timeout=0);            // receive character
1.1       root      176: 
                    177:        void    spymsg(char *msg);              // send message to active spies
                    178: 
                    179:        void    putcom(char *str, int len=0);  // Send string
                    180:        void    hangup(void);              // Hangup modem
                    181: 
1.1.1.2 ! root      182:        uchar   telnet_local_option[0x100];
        !           183:        uchar   telnet_remote_option[0x100];
        !           184:        void    send_telnet_cmd(uchar cmd, uchar opt);
        !           185:        void    request_telnet_opt(uchar cmd, uchar opt);
1.1       root      186: 
1.1.1.2 ! root      187:     uchar      telnet_cmd[64];
        !           188:     uint       telnet_cmdlen;
1.1       root      189:        ulong   telnet_mode;
                    190:        uchar   telnet_last_rxch;
1.1.1.2 ! root      191:        char    terminal[TELNET_TERM_MAXLEN+1];
1.1       root      192: 
1.1.1.2 ! root      193:        time_t  event_time;                             // Time of next exclusive event
        !           194:        char*   event_code;                             // Internal code of next exclusive event
1.1       root      195:        bool    event_thread_running;
                    196:     bool       output_thread_running;
                    197:     bool       input_thread_running;
                    198: 
1.1.1.2 ! root      199: #ifdef JAVASCRIPT
        !           200: 
        !           201:        JSRuntime*      js_runtime;
        !           202:        JSContext*      js_cx;
        !           203:        JSObject*       js_glob;
        !           204:        js_branch_t     js_branch;
        !           205:        long            js_execfile(const char *fname);
        !           206:        bool            js_init(void);
        !           207:        void            js_create_user_objects(void);
        !           208: 
        !           209: #endif
        !           210: 
1.1       root      211:        char    menu_dir[128];  /* Over-ride default menu dir */
                    212:        char    menu_file[128]; /* Over-ride menu file */
                    213: 
                    214:        user_t  useron;                 /* User currently online */
                    215:        node_t  thisnode;               /* Node information */
                    216:        smb_t   smb;                    /* Currently open message base */
1.1.1.2 ! root      217:        char    rlogin_name[LEN_ALIAS+1];
1.1       root      218: 
                    219:        uint    temp_dirnum;
                    220: 
                    221:        FILE    *nodefile_fp,
                    222:                        *node_ext_fp,
                    223:                        *logfile_fp;
                    224: 
                    225:        int     nodefile;               /* File handle for node.dab */
                    226:        int             node_ext;               /* File handle for node.exb */
                    227:        int     inputfile;              /* File handle to use for input */
                    228: 
                    229:                                                        /* Batch download queue */
                    230:        char    **batdn_name;   /* Filenames */
                    231:        ushort  *batdn_alt;     /* Alternate path */
                    232:        uint    *batdn_dir,     /* Directory for each file */
                    233:                         batdn_total;   /* Total files */
                    234:        long    *batdn_offset;  /* Offset for data */
                    235:        ulong   *batdn_size;    /* Size of file in bytes */
                    236:        ulong   *batdn_cdt;     /* Credit value of file */
                    237: 
                    238:                                                        /* Batch upload queue */
                    239:        char    **batup_desc,   /* Description for each file */
                    240:                        **batup_name;   /* Filenames */
                    241:        long    *batup_misc;    /* Miscellaneous bits */
                    242:        ushort  *batup_alt;     /* Alternate path */
                    243:        uint    *batup_dir,     /* Directory for each file */
                    244:                        batup_total;    /* Total files */
                    245: 
                    246:        /*********************************/
                    247:        /* Color Configuration Variables */
                    248:        /*********************************/
                    249:        char    *text[TOTAL_TEXT];                      /* Text from ctrl\text.dat */
                    250:        char    *text_sav[TOTAL_TEXT];          /* Text from ctrl\text.dat */
                    251:        char    dszlog[127];    /* DSZLOG enviornment variable */
                    252:        int             keybuftop,keybufbot;    /* Keyboard input buffer pointers */
                    253:        char    keybuf[KEY_BUFSIZE];    /* Keyboard input buffer */
                    254:        char *  connection;             /* Connection Description */
                    255:        ulong   cur_rate;               /* Current Connection (DCE) Rate */
                    256:        ulong   cur_cps;                /* Current Average Transfer CPS */
                    257:        ulong   dte_rate;               /* Current COM Port (DTE) Rate */
                    258:        time_t  timeout;                /* User inactivity timeout reference */
                    259:        ulong   timeleft_warn;  /* low timeleft warning flag */
                    260:        uchar   curatr;                 /* Current Text Attributes Always */
1.1.1.2 ! root      261:        uchar   attr_stack[64]; /* Saved attributes (stack) */
        !           262:        int     attr_sp;                /* Attribute stack pointer */
1.1       root      263:        long    lncntr;                 /* Line Counter - for PAUSE */
                    264:        long    tos;                    /* Top of Screen */
1.1.1.2 ! root      265:        long    rows;                   /* Current number of Rows for User */
        !           266:        long    cols;                   /* Current number of Columns for User */
1.1       root      267:        long    autoterm;               /* Autodetected terminal type */
                    268:        char    slbuf[SAVE_LINES][LINE_BUFSIZE+1]; /* Saved for redisplay */
                    269:        char    slatr[SAVE_LINES];      /* Starting attribute of each line */
1.1.1.2 ! root      270:        char    slcuratr[SAVE_LINES];   /* Ending attribute of each line */
        !           271:        int     slcnt;                  /* Number of lines currently saved */
1.1       root      272:        char    lbuf[LINE_BUFSIZE+1];/* Temp storage for each line output */
                    273:        int             lbuflen;                /* Number of characters in line buffer */
                    274:        char    latr;                   /* Starting attribute of line buffer */
                    275:        ulong   console;                /* Defines current Console settings */
                    276:        char    wordwrap[81];   /* Word wrap buffer */
                    277:        time_t  now,                    /* Used to store current time in Unix format */
                    278:                        answertime,     /* Time call was answered */
                    279:                        logontime,              /* Time user logged on */
                    280:                        starttime,              /* Time stamp to use for time left calcs */
                    281:                        ns_time,                /* File new-scan time */
                    282:                        last_ns_time;   /* Most recent new-file-scan this call */
                    283:        uchar   action;                 /* Current action of user */
                    284:        long    online;                 /* Remote/Local or not online */
                    285:        long    sys_status;     /* System Status */
1.1.1.2 ! root      286:        subscan_t       *subscan;       /* User sub configuration/scan info */
1.1       root      287: 
                    288:        ulong   logon_ulb,              /* Upload Bytes This Call */
                    289:                        logon_dlb,              /* Download Bytes This Call */
                    290:                        logon_uls,              /* Uploads This Call */
                    291:                        logon_dls,              /* Downloads This Call */
                    292:                        logon_posts,    /* Posts This Call */
                    293:                        logon_emails,   /* Emails This Call */
                    294:                        logon_fbacks;   /* Feedbacks This Call */
1.1.1.2 ! root      295:        uchar   logon_ml;               /* ML of the user upon logon */
1.1       root      296: 
                    297:        uint    main_cmds;              /* Number of Main Commands this call */
                    298:        uint    xfer_cmds;              /* Number of Xfer Commands this call */
                    299:        ulong   posts_read;     /* Number of Posts read this call */
                    300:        char    temp_uler[31];  /* User who uploaded the files to temp dir */
                    301:        char    temp_file[41];  /* Origin of extracted temp files */
                    302:        long    temp_cdt;               /* Credit value of file that was extracted */
                    303:        char    autohang;               /* Used for auto-hangup after transfer */
                    304:        size_t  logcol;                 /* Current column of log file */
                    305:        uint    criterrs;               /* Critical error counter */
                    306: 
1.1.1.2 ! root      307:        uint    curgrp;                 /* Current group */
        !           308:        uint    *cursub;                /* Current sub-board for each group */
        !           309:        uint    curlib;                 /* Current library */
        !           310:        uint    *curdir;                /* Current directory for each library */
        !           311:        uint    *usrgrp;                /* Real group numbers */
        !           312:        uint    usrgrps;                /* Number groups this user has access to */
        !           313:        uint    usrgrp_total;   /* Total number of groups */
        !           314:        uint    *usrlib;                /* Real library numbers */
        !           315:        uint    usrlibs;                /* Number of libs this user can access */
        !           316:        uint    usrlib_total;   /* Total number of libraries */
        !           317:        uint    **usrsub;               /* Real sub numbers */
        !           318:        uint    *usrsubs;               /* Num of subs with access for each grp */
        !           319:        uint    **usrdir;               /* Real dir numbers */
        !           320:        uint    *usrdirs;               /* Num of dirs with access for each lib */
1.1       root      321:        uint    cursubnum;              /* For ARS */
                    322:        uint    curdirnum;              /* For ARS */
                    323:        ulong   timeleft;               /* Number of seconds user has left online */
1.1.1.2 ! root      324:        char    sbbsnnum[MAX_PATH+1];   /* Environment var to contain node num */
        !           325:        char    sbbsnode[MAX_PATH+1];   /* Environment var to contain node dir path */
        !           326:        char    sbbsctrl[MAX_PATH+1];   /* Environment var to contain ctrl dir path */
        !           327:        char    sbbsdata[MAX_PATH+1];   /* Environment var to contain data dir path */
        !           328:        char    sbbsexec[MAX_PATH+1];   /* Environment var to contain exec dir path */
        !           329:        char    env_day[32];                    /* Environment var for day of month */
        !           330:        char    env_weekday[32];                /* Environment var for name of weekday */
        !           331:        char    env_month[32];                  /* Environment var for month number (1-based) */
        !           332:        char    env_monthname[32];              /* Environment var for day of month abbreviation */
        !           333:        char    env_year[32];                   /* Environment var for the year */
        !           334: 
1.1       root      335:        char    *comspec;               /* Pointer to environment variable COMSPEC */
                    336:        ushort  altul;                  /* Upload to alternate path flag */
                    337:        char    cid[LEN_CID+1]; /* Caller ID (IP Address) of current caller */
                    338:        char    *noaccess_str;  /* Why access was denied via ARS */
                    339:        long    noaccess_val;   /* Value of parameter not met in ARS */
                    340:        int             errorlevel;     /* Error level of external program */
                    341: 
                    342:        csi_t   main_csi;               /* Main Command Shell Image */
                    343: 
1.1.1.2 ! root      344:        smbmsg_t*       current_msg;    /* For message header @-codes */
        !           345: 
1.1       root      346:                        /* Global command shell variables */
                    347:        uint    global_str_vars;
                    348:        char ** global_str_var;
                    349:        long *  global_str_var_name;
                    350:        uint    global_int_vars;
                    351:        long *  global_int_var;
                    352:        long *  global_int_var_name;
                    353:        char *  sysvar_p[MAX_SYSVARS];
                    354:        uint    sysvar_pi;
                    355:        long    sysvar_l[MAX_SYSVARS];
                    356:        uint    sysvar_li;
                    357: 
                    358:     /* ansi_term.cpp */
                    359:        char *  ansi(int atr);                  /* Returns ansi escape sequence for atr */
1.1.1.2 ! root      360:     bool       ansi_getxy(int* x, int* y);
1.1       root      361:        void    ansi_getlines(void);
                    362: 
                    363:                        /* Command Shell Methods */
                    364:        int             exec(csi_t *csi);
                    365:        int             exec_function(csi_t *csi);
                    366:        int             exec_misc(csi_t *csi, char *path);
1.1.1.2 ! root      367:        int             exec_net(csi_t *csi);
        !           368:        int             exec_msg(csi_t *csi);
        !           369:        int             exec_file(csi_t *csi);
1.1       root      370:        long    exec_bin(char *mod, csi_t *csi);
                    371:        void    clearvars(csi_t *bin);
                    372:        void    freevars(csi_t *bin);
                    373:        char**  getstrvar(csi_t *bin, long name);
                    374:        long*   getintvar(csi_t *bin, long name);
                    375:        char*   copystrvar(csi_t *csi, char *p, char *str);
                    376:        void    skipto(csi_t *csi, uchar inst);
1.1.1.2 ! root      377:        bool    ftp_cmd(csi_t* csi, SOCKET ctrl_sock, char* cmdsrc, char* rsp);
        !           378:        bool    ftp_put(csi_t* csi, SOCKET ctrl_sock, char* src, char* dest);
        !           379:        bool    ftp_get(csi_t* csi, SOCKET ctrl_sock, char* src, char* dest, bool dir=false);
        !           380:        SOCKET  ftp_data_sock(csi_t* csi, SOCKET ctrl_sock, SOCKADDR_IN*);
        !           381: 
        !           382:        bool    select_shell(void);
        !           383:        bool    select_editor(void);
        !           384: 
        !           385:        void    sys_info(void);
        !           386:        void    user_info(void);
        !           387:        void    xfer_policy(void);
        !           388: 
        !           389:        void    xfer_prot_menu(enum XFER_TYPE);
        !           390:        void    node_stats(uint node_num);
        !           391:        void    sys_stats(void);
        !           392:        void    logonlist(void);
        !           393:        bool    spy(uint node_num);
1.1       root      394: 
                    395:        void    reset_logon_vars(void);
                    396: 
                    397:        uint    finduser(char *str);
                    398: 
                    399:        int     sub_op(uint subnum);
                    400:        ulong   getlastmsg(uint subnum, ulong *ptr, time_t *t);
                    401:        time_t  getmsgtime(uint subnum, ulong ptr);
                    402:        ulong   getmsgnum(uint subnum, time_t t);
                    403: 
                    404:        int             dir_op(uint dirnum);
                    405:        int             getuserxfers(int fromuser, int destuser, char *fname);
                    406: 
                    407:        void    getmsgptrs(void);
                    408:        void    putmsgptrs(void);
                    409:        void    getusrsubs(void);
                    410:        void    getusrdirs(void);
1.1.1.2 ! root      411:        uint    getusrsub(uint subnum);
        !           412:        uint    getusrgrp(uint subnum);
        !           413: 
1.1       root      414:        uint    userdatdupe(uint usernumber, uint offset, uint datlen, char *dat
                    415:                                ,bool del);
                    416:        void    gettimeleft(void);
                    417:        bool    gettimeleft_inside;
                    418: 
                    419:        /* str.cpp */
1.1.1.2 ! root      420:        char*   timestr(time_t *intime);
1.1       root      421:     char       timestr_output[60];
1.1.1.2 ! root      422:        void    userlist(long mode);
1.1       root      423:        size_t  gettmplt(char *outstr, char *tmplt, long mode);
1.1.1.2 ! root      424:        void    sif(char *fname, char *answers, long len);      /* Synchronet Interface File */
1.1       root      425:        void    sof(char *fname, char *answers, long len);
                    426:        void    create_sif_dat(char *siffile, char *datfile);
                    427:        void    read_sif_dat(char *siffile, char *datfile);
                    428:        void    printnodedat(uint number, node_t* node);
                    429:        bool    inputnstime(time_t *dt);
                    430:        bool    chkpass(char *pass, user_t* user, bool unique);
                    431:        char *  cmdstr(char *instr, char *fpath, char *fspec, char *outstr);
                    432:        char    cmdstr_output[512];
                    433: 
                    434:        void    subinfo(uint subnum);
                    435:        void    dirinfo(uint dirnum);
                    436:        bool    trashcan(char *insearch, char *name);
1.1.1.2 ! root      437:        void    time_bank(void);
        !           438:        void    change_user(void);
1.1       root      439: 
                    440:        /* writemsg.cpp */
                    441:        void    automsg(void);
                    442:        bool    writemsg(char *str, char *top, char *title, long mode, int subnum
                    443:                                ,char *dest);
                    444:        char    putmsg(char HUGE16 *str, long mode);
                    445:        bool    msgabort(void);
                    446:        bool    email(int usernumber, char *top, char *title, long mode);
                    447:        void    forwardmail(smbmsg_t* msg, int usernum);
                    448:        void    removeline(char *str, char *str2, char num, char skip);
                    449:        ulong   msgeditor(char *buf, char *top, char *title);
                    450:        void    editfile(char *path);
                    451:        int             loadmsg(smbmsg_t *msg, ulong number);
                    452:        ushort  chmsgattr(ushort attr);
                    453:        void    show_msgattr(ushort attr);
                    454:        void    show_msghdr(smbmsg_t* msg);
                    455:        void    show_msg(smbmsg_t* msg, long mode);
                    456:        void    msgtotxt(smbmsg_t* msg, char *str, int header, int tails);
                    457:        void    quotemsg(smbmsg_t* msg, int tails);
                    458:        void    editmsg(smbmsg_t* msg, uint subnum);
                    459:        void    editor_inf(int xeditnum,char *dest, char *title, long mode
                    460:                                ,uint subnum);
                    461:        void    copyfattach(uint to, uint from, char *title);
                    462:        bool    movemsg(smbmsg_t* msg, uint subnum);
                    463: 
1.1.1.2 ! root      464:        /* postmsg.cpp */
        !           465:        bool    postmsg(uint subnum, smbmsg_t* msg, long wm_mode);
        !           466: 
1.1       root      467:        /* mail.cpp */
                    468:        int             delmail(uint usernumber,int which);
                    469:        void    telluser(smbmsg_t* msg);
                    470:        void    delallmail(uint usernumber);
                    471: 
                    472:        /* getmsg.cpp */
                    473:        post_t* loadposts(long *posts, uint subnum, ulong ptr, long mode);
                    474: 
                    475:        /* readmail.cpp */
                    476:        void    readmail(uint usernumber, int sent);
                    477: 
                    478:        /* bulkmail.cpp */
1.1.1.2 ! root      479:        bool    bulkmail(uchar *ar);
        !           480:        int             bulkmailhdr(smb_t*, smbmsg_t*, uint usernum);
1.1       root      481: 
                    482:        /* con_out.cpp */
                    483:        int             bputs(char *str);                               /* BBS puts function */
                    484:        int             rputs(char *str);                               /* BBS raw puts function */
                    485:        int             bprintf(char *fmt, ...);                /* BBS printf function */
                    486:        int             rprintf(char *fmt, ...);                /* BBS raw printf function */
1.1.1.2 ! root      487:        void    outchar(char ch);                               /* Output a char - check echo and emu.  */
1.1       root      488:        void    center(char *str);
1.1.1.2 ! root      489:        void    clearline(void);
        !           490:        void    cleartoeol(void);
        !           491:        void    cursor_home(void);
        !           492:        void    cursor_up(int count=1);
        !           493:        void    cursor_down(int count=1);
        !           494:        void    cursor_left(int count=1);
        !           495:        void    cursor_right(int count=1);
1.1       root      496: 
                    497:        /* getstr.cpp */
1.1.1.2 ! root      498:        size_t  getstr_offset;
1.1       root      499:        size_t  getstr(char *str, size_t length, long mode);
                    500:        long    getnum(ulong max);
1.1.1.2 ! root      501:        void    insert_indicator(void);
1.1       root      502: 
                    503:        /* getkey.cpp */
1.1.1.2 ! root      504:        char    getkey(long mode);              /* Waits for a key hit local or remote  */
1.1       root      505:        long    getkeys(char *str, ulong max);
1.1.1.2 ! root      506:        void    ungetkey(char ch);              /* Places 'ch' into the input buffer    */
1.1       root      507:        char    question[128];
                    508:        bool    yesno(char *str);
                    509:        bool    noyes(char *str);
                    510:        void    pause(void);
                    511:        char *  mnestr;
                    512:        void    mnemonics(char *str);
                    513: 
1.1.1.2 ! root      514:        /* inkey.cpp */
        !           515:        char    inkey(long mode, unsigned long timeout=0);
        !           516:        char    handle_ctrlkey(char ch, long mode=0);
        !           517: 
1.1       root      518:        /* prntfile.cpp */
                    519:        void    printfile(char *str, long mode);
                    520:        void    printtail(char *str, int lines, long mode);
1.1.1.2 ! root      521:        void    menu(const char *code);
1.1       root      522: 
                    523:        int             uselect(int add, uint n, char *title, char *item, uchar *ar);
                    524:        uint    uselect_total, uselect_num[500];
                    525: 
                    526:        void    riosync(char abortable);
                    527:        void    redrwstr(char *strin, int i, int l, long mode);
                    528:        void    attr(int atr);                          /* Change local and remote text attributes */
                    529:        void    ctrl_a(char x);                 /* Peforms the Ctrl-Ax attribute changes */
                    530: 
                    531:        /* atcodes.cpp */
1.1.1.2 ! root      532:        int             show_atcode(char *code);
        !           533:        char*   atcode(char* sp, char* str);
1.1       root      534: 
                    535:        /* getnode.cpp */
1.1.1.2 ! root      536:        int             getsmsg(int usernumber);
        !           537:        int             getnmsg(void);
1.1       root      538:        int             whos_online(bool listself);/* Lists active nodes, returns active nodes */
1.1.1.2 ! root      539:        void    nodelist(void);
        !           540:        int             getnodeext(uint number, char * str);
        !           541:        int             getnodedat(uint number, node_t * node, bool lock);
        !           542:        void    nodesync(void);
        !           543:        user_t  nodesync_user;
        !           544:        bool    nodesync_inside;
1.1       root      545: 
1.1.1.2 ! root      546:        /* putnode.cpp */
        !           547:        int             putnodedat(uint number, node_t * node);
        !           548:        int             putnodeext(uint number, char * str);
1.1       root      549: 
                    550:        /* logonoff.cpp */
                    551:        bool    answer();
                    552:        int             login(char *str, char *pw);
                    553:        bool    logon(void);
                    554:        void    logout(void);
                    555:        void    logoff(void);
1.1.1.2 ! root      556:        BOOL    newuser(void);                                  /* Get new user                                                 */
1.1       root      557:        void    backout(void);
                    558: 
                    559:        /* readmsgs.cpp */
                    560:        int             scanposts(uint subnum, long mode, char *find);  /* Scan sub-board */
                    561:        int             searchsub(uint subnum, char *search);   /* Search for string on sub */
                    562:        int             searchsub_toyou(uint subnum);
                    563:        int             text_sec(void);                                         /* Text sections */
                    564:        void    listmsgs(int subnum, post_t * post, long i, long posts);
                    565:        void    msghdr(smbmsg_t* msg);
                    566:        int             searchposts(uint subnum, post_t * post, long start, long msgs
                    567:                                ,char *search);
                    568:        void    showposts_toyou(post_t * post, ulong start, long posts);
                    569: 
                    570:        /* chat.cpp */
                    571:        void    chatsection(void);
1.1.1.2 ! root      572:        void    multinodechat(int channel=1);
1.1       root      573:        void    nodepage(void);
                    574:        void    nodemsg(void);
1.1.1.2 ! root      575:        uint    nodemsg_inside;
        !           576:        uint    hotkey_inside;
1.1       root      577:        uchar   lastnodemsg;    /* Number of node last message was sent to */
                    578:        char    lastnodemsguser[LEN_ALIAS+1];
1.1.1.2 ! root      579:        void    guruchat(char* line, char* guru, int gurunum, char* last_answer);
1.1       root      580:        bool    guruexp(char **ptrptr, char *line);
                    581:        void    localguru(char *guru, int gurunum);
1.1.1.2 ! root      582:        bool    sysop_page(void);
        !           583:        bool    guru_page(void);
1.1       root      584:        void    privchat(bool local=false);
                    585:        bool    chan_access(uint cnum);
                    586:        int             getnodetopage(int all, int telegram);
                    587: 
                    588:        /* main.cpp */
                    589:        void    printstatslog(uint node);
                    590:        ulong   logonstats(void);
                    591:        void    logoffstats(void);
                    592:        int             nopen(char *str, int access);
                    593:        int             mv(char *src, char *dest, char copy); /* fast file move/copy function */
1.1.1.2 ! root      594:        bool    chksyspass(void);
1.1       root      595:        bool    chk_ar(uchar * str, user_t * user); /* checks access requirements */
                    596:        bool    ar_exp(uchar ** ptrptr, user_t * user);
                    597: 
                    598:        /* upload.cpp */
                    599:        bool    uploadfile(file_t* f);
                    600:        char    sbbsfilename[128],sbbsfiledesc[128]; /* env vars */
1.1.1.2 ! root      601:        bool    upload(uint dirnum);
1.1       root      602:     char       upload_lastdesc[LEN_FDESC+1];
                    603:        bool    bulkupload(uint dirnum);
                    604: 
                    605:        /* download.cpp */
                    606:        void    downloadfile(file_t* f);
                    607:        void    notdownloaded(ulong size, time_t start, time_t end);
1.1.1.2 ! root      608:        int             protocol(prot_t* prot, enum XFER_TYPE, char *fpath, char *fspec, bool cd);
        !           609:        char*   protcmdline(prot_t* prot, enum XFER_TYPE type);
1.1       root      610:        void    seqwait(uint devnum);
                    611:        void    autohangup(void);
1.1.1.2 ! root      612:        bool    checkdszlog(file_t*);
        !           613:        bool    checkprotresult(prot_t*, int error, file_t*);
1.1       root      614: 
                    615:        /* file.cpp */
                    616:        void    fileinfo(file_t* f);
                    617:        void    openfile(file_t* f);
                    618:        void    closefile(file_t* f);
                    619:        bool    removefcdt(file_t* f);
                    620:        bool    movefile(file_t* f, int newdir);
                    621:        char *  getfilespec(char *str);
                    622:        bool    checkfname(char *fname);
                    623:        bool    addtobatdl(file_t* f);
                    624: 
                    625:        /* listfile.cpp */
                    626:        bool    listfile(char *fname, char HUGE16 *buf, uint dirnum
                    627:                                ,char *search, char letter, ulong datoffset);
                    628:        int             listfiles(uint dirnum, char *filespec, int tofile, long mode);
                    629:        int             listfileinfo(uint dirnum, char *filespec, long mode);
                    630:        void    listfiletofile(char *fname, char HUGE16 *buf, uint dirnum, int file);
                    631:        int             batchflagprompt(uint dirnum, file_t bf[], uint total, long totalfiles);
                    632: 
                    633:        /* bat_xfer.cpp */
                    634:        void    batchmenu(void);
1.1.1.2 ! root      635:        void    batch_create_list(void);
1.1       root      636:        void    batch_add_list(char *list);
                    637:        bool    create_batchup_lst(void);
1.1.1.2 ! root      638:        bool    create_batchdn_lst(bool native);
1.1       root      639:        bool    create_bimodem_pth(void);
                    640:        void    batch_upload(void);
                    641:        void    batch_download(int xfrprot);
1.1.1.2 ! root      642:        BOOL    start_batch_download(void);
1.1       root      643: 
                    644:        /* tmp_xfer.cpp */
                    645:        void    temp_xfer(void);
                    646:        void    extract(uint dirnum);
                    647:        char *  temp_cmd(void);                                 /* Returns temp file command line */
                    648:        ulong   create_filelist(char *name, long mode);
                    649: 
                    650:        /* viewfile.cpp */
                    651:        int             viewfile(file_t* f, int ext);
                    652:        void    viewfiles(uint dirnum, char *fspec);
                    653:        void    viewfilecontents(file_t* f);
                    654: 
                    655:        /* sortdir.cpp */
                    656:        void    resort(uint dirnum);
                    657: 
                    658:        /* xtrn.cpp */
1.1.1.2 ! root      659:        int             external(const char* cmdline, long mode, const char* startup_dir=NULL);
1.1       root      660: 
                    661:        /* xtrn_sec.cpp */
                    662:        int             xtrn_sec(void);                                 /* The external program section  */
                    663:        void    xtrndat(char* name, char* dropdir, uchar type, ulong tleft
                    664:                                ,ulong misc);
1.1.1.2 ! root      665:        bool    exec_xtrn(uint xtrnnum);                        /* Executes online external program */
        !           666:        bool    user_event(user_event_t);                       /* Executes user event(s) */
1.1       root      667:        char    xtrn_access(uint xnum);                 /* Does useron have access to xtrn? */
                    668:        void    moduserdat(uint xtrnnum);
                    669: 
1.1.1.2 ! root      670:        /* logfile.cpp */
1.1       root      671:        void    logentry(char *code,char *entry);
                    672:        void    log(char *str);                         /* Writes 'str' to node log */
1.1.1.2 ! root      673:        void    logch(char ch, bool comma);     /* Writes 'ch' to node log */
1.1       root      674:        void    logline(char *code,char *str); /* Writes 'str' on it's own line in log */
                    675:        void    logofflist(void);              /* List of users logon activity */
1.1.1.2 ! root      676:        bool    syslog(char* code, char *entry);
1.1       root      677:        void    errorlog(char *text);                   /* Logs errors to ERROR.LOG and NODE.LOG */
                    678:        bool    errorlog_inside;
                    679:        bool    errormsg_inside;
1.1.1.2 ! root      680:        void    errormsg(int line, const char *file, char action, const char *object
        !           681:                                ,ulong access, const char *extinfo=NULL);
        !           682:        
1.1       root      683:        /* qwk.cpp */
                    684:        bool    qwklogon;
1.1.1.2 ! root      685:        ulong   qwkmail_last;
1.1       root      686:        void    qwk_sec(void);
                    687:        int             qwk_route(char *inaddr, char *fulladdr);
                    688:        void    update_qwkroute(char *via);
                    689:        void    qwk_success(ulong msgcnt, char bi, char prepack);
                    690:        void    qwksetptr(uint subnum, char *buf, int reset);
                    691:        void    qwkcfgline(char *buf,uint subnum);
1.1.1.2 ! root      692:        int             set_qwk_flag(ulong flag);
1.1       root      693: 
                    694:        /* pack_qwk.cpp */
                    695:        bool    pack_qwk(char *packet, ulong *msgcnt, bool prepack);
                    696: 
                    697:        /* un_qwk.cpp */
                    698:        bool    unpack_qwk(char *packet,uint hubnum);
                    699: 
                    700:        /* pack_rep.cpp */
                    701:        bool    pack_rep(uint hubnum);
                    702: 
                    703:        /* un_rep.cpp */
                    704:        bool    unpack_rep(char* repfile=NULL);
                    705: 
                    706:        /* msgtoqwk.cpp */
                    707:        ulong   msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum, int conf);
                    708: 
                    709:        /* qwktomsg.cpp */
                    710:        bool    qwktomsg(FILE *qwk_fp, char *hdrblk, char fromhub, uint subnum
                    711:                                ,uint touser);
                    712: 
                    713:        /* fido.cpp */
                    714:        bool    netmail(char *into, char *subj, long mode);
                    715:        void    qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub);
                    716:        bool    lookup_netuser(char *into);
                    717: 
                    718:        bool    inetmail(char *into, char *subj, long mode);
                    719:        bool    qnetmail(char *into, char *subj, long mode);
                    720: 
                    721:        /* useredit.cpp */
1.1.1.2 ! root      722:        void    useredit(int usernumber);
1.1       root      723:        int             searchup(char *search,int usernum);
                    724:        int             searchdn(char *search,int usernum);
                    725:        void    maindflts(user_t* user);
                    726:        void    purgeuser(int usernumber);
                    727: 
                    728:        /* ver.cpp */
                    729:        void    ver(void);
                    730: 
                    731:        /* scansubs.cpp */
                    732:        void    scansubs(long mode);
                    733:        void    scanallsubs(long mode);
                    734:        void    new_scan_cfg(ulong misc);
                    735:        void    new_scan_ptr_cfg(void);
                    736: 
                    737:        /* scandirs.cpp */
                    738:        void    scanalldirs(long mode);
                    739:        void    scandirs(long mode);
                    740: 
                    741:        #define nosound()
                    742:        #define checkline()
                    743: 
                    744:        void    catsyslog(int crash);
                    745: 
                    746:        /* telgate.cpp */
                    747:        void    telnet_gate(char* addr, ulong mode);    // See TG_* for mode bits
                    748: 
                    749: };
1.1.1.2 ! root      750: 
        !           751: #endif /* __cplusplus */
1.1       root      752: 
                    753: #ifdef DLLEXPORT
                    754: #undef DLLEXPORT
                    755: #endif
                    756: #ifdef DLLCALL
                    757: #undef DLLCALL
                    758: #endif
                    759: #ifdef _WIN32
                    760:        #ifdef SBBS_EXPORTS
                    761:                #define DLLEXPORT       __declspec(dllexport)
                    762:        #else
                    763:                #define DLLEXPORT       __declspec(dllimport)
                    764:        #endif
                    765:        #ifdef __BORLANDC__
                    766:                #define DLLCALL __stdcall
                    767:        #else
                    768:                #define DLLCALL
                    769:        #endif
                    770: #else  /* !_WIN32 */
                    771:        #define DLLEXPORT
                    772:        #define DLLCALL
                    773: #endif
                    774: 
                    775: #ifdef __cplusplus
                    776: extern "C" {
                    777: #endif
                    778: 
1.1.1.2 ! root      779:        /* getstats.c */
        !           780:        DLLEXPORT BOOL          DLLCALL getstats(scfg_t* cfg, char node, stats_t* stats);
        !           781:        DLLEXPORT ulong         DLLCALL getposts(scfg_t* cfg, uint subnum);
        !           782:        DLLEXPORT long          DLLCALL getfiles(scfg_t* cfg, uint dirnum);
        !           783: 
        !           784:        /* getmail.c */
        !           785:        DLLEXPORT int           DLLCALL getmail(scfg_t* cfg, int usernumber, BOOL sent);
        !           786:        DLLEXPORT mail_t *      DLLCALL loadmail(smb_t* smb, ulong* msgs, uint usernumber
1.1       root      787:                                                                                ,int which, long mode);
1.1.1.2 ! root      788:        DLLEXPORT void          DLLCALL freemail(mail_t* mail);
        !           789:        DLLEXPORT void          DLLCALL delfattach(scfg_t*, smbmsg_t*);
        !           790: 
        !           791:        /* postmsg.cpp */
        !           792:        DLLEXPORT int           DLLCALL savemsg(scfg_t*, smb_t*, smbmsg_t*, client_t*, char* msgbuf);
        !           793:        DLLEXPORT void          DLLCALL signal_sub_sem(scfg_t*, uint subnum);
        !           794:        DLLEXPORT int           DLLCALL msg_client_hfields(smbmsg_t*, client_t*);
1.1       root      795: 
                    796:        /* filedat.c */
1.1.1.2 ! root      797:        DLLEXPORT BOOL          DLLCALL getfileixb(scfg_t* cfg, file_t* f);
        !           798:        DLLEXPORT BOOL          DLLCALL getfiledat(scfg_t* cfg, file_t* f);
        !           799:        DLLEXPORT BOOL          DLLCALL putfiledat(scfg_t* cfg, file_t* f);
        !           800:        DLLEXPORT void          DLLCALL putextdesc(scfg_t* cfg, uint dirnum, ulong datoffset, char *ext);
        !           801:        DLLEXPORT void          DLLCALL getextdesc(scfg_t* cfg, uint dirnum, ulong datoffset, char *ext);
        !           802:        DLLEXPORT char*         DLLCALL getfilepath(scfg_t* cfg, file_t* f, char* path);
        !           803: 
        !           804:        DLLEXPORT BOOL          DLLCALL removefiledat(scfg_t* cfg, file_t* f);
        !           805:        DLLEXPORT BOOL          DLLCALL addfiledat(scfg_t* cfg, file_t* f);
        !           806:        DLLEXPORT BOOL          DLLCALL findfile(scfg_t* cfg, uint dirnum, char *filename);
        !           807:        DLLEXPORT char *        DLLCALL padfname(char *filename, char *str);
        !           808:        DLLEXPORT char *        DLLCALL unpadfname(char *filename, char *str);
        !           809:        DLLEXPORT BOOL          DLLCALL rmuserxfers(scfg_t* cfg, int fromuser, int destuser, char *fname);
        !           810: 
        !           811:        DLLEXPORT int           DLLCALL update_uldate(scfg_t* cfg, file_t* f);
        !           812: 
        !           813:        /* str_util.c */
        !           814:        DLLEXPORT char *        DLLCALL truncstr(char* str, const char* set);
        !           815:        DLLEXPORT char *        DLLCALL ascii_str(uchar* str);
        !           816:        DLLEXPORT BOOL          DLLCALL findstr(char *insearch, char *fname);
        !           817:        DLLEXPORT BOOL          DLLCALL trashcan(scfg_t* cfg, char *insearch, char *name);
        !           818:        DLLEXPORT char *        DLLCALL strip_exascii(char *str);
        !           819:        DLLEXPORT char *        DLLCALL prep_file_desc(char *str);
        !           820:        DLLEXPORT char *        DLLCALL strip_ctrl(char *str);
        !           821:        DLLEXPORT char *        DLLCALL net_addr(net_t* net);
        !           822:        DLLEXPORT BOOL          DLLCALL validattr(char a);
        !           823:        DLLEXPORT size_t        DLLCALL strip_invalid_attr(char *str);
        !           824:        DLLEXPORT char *        DLLCALL ultoac(ulong l,char *str);
        !           825:        DLLEXPORT char *        DLLCALL rot13(char* str);
        !           826: 
        !           827:        /* msg_id.c */
        !           828:        DLLEXPORT char *        DLLCALL ftn_msgid(sub_t* sub, smbmsg_t* msg);
        !           829:        DLLEXPORT char *        DLLCALL get_msgid(scfg_t* cfg, uint subnum, smbmsg_t* msg);
1.1       root      830: 
                    831: 
1.1.1.2 ! root      832:        /* date_str.c */
1.1       root      833:        DLLEXPORT char *        DLLCALL zonestr(short zone);
1.1.1.2 ! root      834:        DLLEXPORT time_t        DLLCALL dstrtounix(scfg_t*, char *str); 
        !           835:        DLLEXPORT char *        DLLCALL unixtodstr(scfg_t*, time_t, char *str);
        !           836:        DLLEXPORT char *        DLLCALL sectostr(uint sec, char *str);          
        !           837:        DLLEXPORT char *        DLLCALL hhmmtostr(scfg_t* cfg, struct tm* tm, char* str);
        !           838:        DLLEXPORT char *        DLLCALL timestr(scfg_t* cfg, time_t *intime, char* str);
        !           839:        DLLEXPORT when_t        DLLCALL rfc822date(char* p);
        !           840:        DLLEXPORT char *        DLLCALL msgdate(when_t when, char* buf);
1.1       root      841: 
1.1.1.2 ! root      842:        /* load_cfg.c */
        !           843:        DLLEXPORT BOOL          DLLCALL load_cfg(scfg_t* cfg, char* text[], BOOL prep, char* error);
1.1       root      844:        DLLEXPORT void          DLLCALL free_cfg(scfg_t* cfg);
                    845:        DLLEXPORT void          DLLCALL free_text(char* text[]);
1.1.1.2 ! root      846:        DLLEXPORT ushort        DLLCALL sys_timezone(scfg_t* cfg);
1.1       root      847: 
1.1.1.2 ! root      848:        /* scfgsave.c */
        !           849:        DLLEXPORT BOOL          DLLCALL save_cfg(scfg_t* cfg, int backup_level);
        !           850:        DLLEXPORT BOOL          DLLCALL write_node_cfg(scfg_t* cfg, int backup_level);
        !           851:        DLLEXPORT BOOL          DLLCALL write_main_cfg(scfg_t* cfg, int backup_level);
        !           852:        DLLEXPORT BOOL          DLLCALL write_msgs_cfg(scfg_t* cfg, int backup_level);
        !           853:        DLLEXPORT BOOL          DLLCALL write_file_cfg(scfg_t* cfg, int backup_level);
        !           854:        DLLEXPORT BOOL          DLLCALL write_chat_cfg(scfg_t* cfg, int backup_level);
        !           855:        DLLEXPORT BOOL          DLLCALL write_xtrn_cfg(scfg_t* cfg, int backup_level);
        !           856:        DLLEXPORT BOOL          DLLCALL fcopy(char* src, char* dest);
        !           857:        DLLEXPORT BOOL          DLLCALL backup(char *org, int backup_level, BOOL ren);
        !           858:        DLLEXPORT void          DLLCALL refresh_cfg(scfg_t* cfg);
        !           859:        
        !           860: 
        !           861:        /* scfglib1.c */
        !           862:        DLLEXPORT char *        DLLCALL prep_dir(char* base, char* dir, size_t buflen);
        !           863: 
        !           864:        /* logfile.cpp */
        !           865:        DLLEXPORT BOOL          DLLCALL hacklog(scfg_t* cfg, char* prot, char* user, char* text 
        !           866:                                                                                ,char* host, SOCKADDR_IN* addr);
        !           867:        DLLEXPORT BOOL          DLLCALL spamlog(scfg_t* cfg, char* prot, char* action, char* reason
        !           868:                                                                                ,char* host, char* ip_addr, char* to, char* from);
        !           869: 
        !           870:        DLLEXPORT char *        DLLCALL remove_ctrl_a(char* instr, char* outstr);
        !           871: 
        !           872:        /* data_ovl.cpp */
        !           873:        DLLEXPORT BOOL          DLLCALL getmsgptrs(scfg_t* cfg, uint usernumber, subscan_t* subscan);
        !           874:        DLLEXPORT BOOL          DLLCALL putmsgptrs(scfg_t* cfg, uint usernumber, subscan_t* subscan);
        !           875: 
        !           876:        /* sockopt.c */
        !           877:        DLLEXPORT int           DLLCALL sockopt(char* str, int* level);
        !           878:        DLLEXPORT int           DLLCALL set_socket_options(scfg_t* cfg, SOCKET sock, char* error);
1.1       root      879: 
1.1.1.2 ! root      880:        /* xtrn.cpp */
        !           881:        DLLEXPORT char*         DLLCALL cmdstr(scfg_t* cfg, user_t* user, const char* instr
        !           882:                                                                        ,const char* fpath, const char* fspec, char* cmd);
1.1       root      883: 
1.1.1.2 ! root      884:        /* semfile.c */
        !           885:        DLLEXPORT BOOL          DLLCALL semfile_signal(const char* fname, const char* text);
        !           886:        DLLEXPORT BOOL          DLLCALL semfile_check(time_t* t, const char* fname);
        !           887:        DLLEXPORT char*         DLLCALL semfile_list_check(time_t* t, link_list_t* filelist);
        !           888:        DLLEXPORT void          DLLCALL semfile_list_init(link_list_t* filelist, const char* parent, 
        !           889:                                                                                                   const char* action, const char* service);
        !           890:        DLLEXPORT void          DLLCALL semfile_list_add(link_list_t* filelist, const char* fname);
        !           891:        DLLEXPORT void          DLLCALL semfile_list_free(link_list_t* filelist);
        !           892: 
        !           893: 
        !           894: #ifdef JAVASCRIPT
        !           895: 
        !           896:        typedef struct {
        !           897:                const char*             name;
        !           898:                JSNative        call;
        !           899:                uint8           nargs;
        !           900:                int                             type;           /* return type */
        !           901:                const char*             args;           /* arguments */
        !           902:                const char*             desc;           /* description */
        !           903:                int                             ver;            /* version added/modified */
        !           904:        } jsSyncMethodSpec;
        !           905: 
        !           906:        typedef struct {
        !           907:                const char      *name;
        !           908:                int8            tinyid;
        !           909:                uint8           flags;
        !           910:                int                             ver;            /* version added/modified */
        !           911:        } jsSyncPropertySpec;
        !           912: 
        !           913:        typedef struct {
        !           914:                const char*             name;
        !           915:                int                             val;
        !           916:        } jsConstIntSpec;
        !           917: 
        !           918:        typedef struct {
        !           919:                char            version[128];
        !           920:                const char*     version_detail;
        !           921:                DWORD*          interface_addr;
        !           922:                DWORD*          options;
        !           923:                DWORD*          clients;
        !           924:        } js_server_props_t;
        !           925: 
        !           926:        enum {
        !           927:                 JSTYPE_ARRAY=JSTYPE_LIMIT
        !           928:                ,JSTYPE_ALIAS
        !           929:                ,JSTYPE_UNDEF
        !           930:        };
1.1       root      931: 
1.1.1.2 ! root      932:        #ifdef _DEBUG   /* String compiled into debug build only, for JS documentation generation */
        !           933:                #define JSDOCSTR(s)     s
        !           934:        #else
        !           935:                #define JSDOCSTR(s)     ""
        !           936:        #endif
1.1       root      937: 
1.1.1.2 ! root      938:        /* main.cpp */
        !           939:        DLLEXPORT JSBool        DLLCALL js_DescribeSyncObject(JSContext* cx, JSObject* obj, const char*, int ver);
        !           940:        DLLEXPORT JSBool        DLLCALL js_DescribeSyncConstructor(JSContext* cx, JSObject* obj, const char*);
        !           941:        DLLEXPORT JSBool        DLLCALL js_DefineSyncMethods(JSContext* cx, JSObject* obj, jsSyncMethodSpec*, BOOL append);
        !           942:        DLLEXPORT JSBool        DLLCALL js_DefineSyncProperties(JSContext* cx, JSObject* obj, jsSyncPropertySpec*);
        !           943:        DLLEXPORT JSBool        DLLCALL js_DefineConstIntegers(JSContext* cx, JSObject* obj, jsConstIntSpec*, int flags);
        !           944:        DLLEXPORT JSBool        DLLCALL js_CreateArrayOfStrings(JSContext* cx, JSObject* parent
        !           945:                                                                                                                ,const char* name, char* str[], uintN flags);
        !           946: 
        !           947:        /* js_server.c */
        !           948:        DLLEXPORT JSObject* DLLCALL js_CreateServerObject(JSContext* cx, JSObject* parent
        !           949:                                                                                ,js_server_props_t* props);
        !           950: 
        !           951:        /* js_global.c */
        !           952:        DLLEXPORT JSObject* DLLCALL js_CreateGlobalObject(JSContext* cx, scfg_t* cfg, jsSyncMethodSpec* methods);
        !           953:        DLLEXPORT JSObject*     DLLCALL js_CreateCommonObjects(JSContext* cx
        !           954:                                                                                                        ,scfg_t* cfg                            /* common */
        !           955:                                                                                                        ,scfg_t* node_cfg                       /* node-specific */
        !           956:                                                                                                        ,jsSyncMethodSpec* methods      /* global */
        !           957:                                                                                                        ,time_t uptime                          /* system */
        !           958:                                                                                                        ,char* host_name                        /* system */
        !           959:                                                                                                        ,char* socklib_desc                     /* system */
        !           960:                                                                                                        ,js_branch_t* js_branch         /* js */
        !           961:                                                                                                        ,client_t* client                       /* client */
        !           962:                                                                                                        ,SOCKET client_socket           /* client */
        !           963:                                                                                                        ,js_server_props_t* props       /* server */
        !           964:                                                                                                        );
        !           965: 
        !           966:        /* js_internal.c */
        !           967:        DLLEXPORT JSObject* DLLCALL js_CreateInternalJsObject(JSContext* cx, JSObject* parent, js_branch_t* branch);
        !           968:        DLLEXPORT JSBool        DLLCALL js_CommonBranchCallback(JSContext *cx, js_branch_t*);
        !           969: 
        !           970:        /* js_system.c */
        !           971:        DLLEXPORT JSObject* DLLCALL js_CreateSystemObject(JSContext* cx, JSObject* parent
        !           972:                                                                                                        ,scfg_t* cfg, time_t uptime
        !           973:                                                                                                        ,char* host_name
        !           974:                                                                                                        ,char* socklib_desc);
        !           975: 
        !           976:        /* js_client.c */
        !           977:        DLLEXPORT JSObject* DLLCALL js_CreateClientObject(JSContext* cx, JSObject* parent
        !           978:                                                                                                        ,char* name, client_t* client, SOCKET sock);
        !           979:        /* js_user.c */
        !           980:        DLLEXPORT JSObject*     DLLCALL js_CreateUserClass(JSContext* cx, JSObject* parent, scfg_t* cfg);
        !           981:        DLLEXPORT JSObject* DLLCALL js_CreateUserObject(JSContext* cx, JSObject* parent, scfg_t* cfg
        !           982:                                                                                                        ,char* name, uint usernumber);
        !           983:        DLLEXPORT JSBool        DLLCALL js_CreateUserObjects(JSContext* cx, JSObject* parent, scfg_t* cfg
        !           984:                                                                                                        ,user_t* user, char* html_index_file
        !           985:                                                                                                        ,subscan_t* subscan);
        !           986:        /* js_file_area.c */
        !           987:        DLLEXPORT JSObject* DLLCALL js_CreateFileAreaObject(JSContext* cx, JSObject* parent, scfg_t* cfg 
        !           988:                                                                                                        ,user_t* user, char* html_index_file);
        !           989: 
        !           990:        /* js_msg_area.c */
        !           991:        DLLEXPORT JSObject* DLLCALL js_CreateMsgAreaObject(JSContext* cx, JSObject* parent, scfg_t* cfg
        !           992:                                                                                                        ,user_t* user, subscan_t* subscan);
        !           993:        DLLEXPORT BOOL          DLLCALL js_CreateMsgAreaProperties(JSContext* cx, scfg_t* cfg
        !           994:                                                                                                        ,JSObject* subobj, uint subnum);
        !           995: 
        !           996:        /* js_xtrn_area.c */
        !           997:        DLLEXPORT JSObject* DLLCALL js_CreateXtrnAreaObject(JSContext* cx, JSObject* parent, scfg_t* cfg
        !           998:                                                                                                        ,user_t* user);
        !           999: 
        !          1000:        /* js_msgbase.c */
        !          1001:        DLLEXPORT JSObject* DLLCALL js_CreateMsgBaseClass(JSContext* cx, JSObject* parent, scfg_t* cfg);
        !          1002: 
        !          1003:        /* js_socket.c */
        !          1004:        DLLEXPORT JSObject* DLLCALL js_CreateSocketClass(JSContext* cx, JSObject* parent);
        !          1005:        DLLEXPORT JSObject* DLLCALL js_CreateSocketObject(JSContext* cx, JSObject* parent
        !          1006:                                                                                                        ,char *name, SOCKET sock);
        !          1007:        DLLEXPORT void          DLLCALL js_timeval(JSContext* cx, jsval val, struct timeval* tv);
        !          1008:        DLLEXPORT SOCKET        DLLCALL js_socket(JSContext *cx, jsval val);
        !          1009: 
        !          1010:        /* js_queue.c */
        !          1011:        DLLEXPORT JSObject* DLLCALL js_CreateQueueClass(JSContext* cx, JSObject* parent);
        !          1012:        DLLEXPORT JSObject* DLLCALL js_CreateQueueObject(JSContext* cx, JSObject* parent
        !          1013:                                                                                                        ,char *name, msg_queue_t* q);
        !          1014:        BOOL js_enqueue_value(JSContext *cx, msg_queue_t* q, jsval val, char* name);
1.1       root     1015: 
1.1.1.2 ! root     1016:        /* js_file.c */
        !          1017:        DLLEXPORT JSObject* DLLCALL js_CreateFileClass(JSContext* cx, JSObject* parent);
        !          1018: 
        !          1019:        /* js_console.cpp */
        !          1020:        JSObject* js_CreateConsoleObject(JSContext* cx, JSObject* parent);
        !          1021: 
        !          1022:        /* js_bbs.cpp */
        !          1023:        JSObject* js_CreateBbsObject(JSContext* cx, JSObject* parent);
1.1       root     1024: 
                   1025: #endif
                   1026: 
1.1.1.2 ! root     1027: /* str_util.c */
        !          1028: int            bstrlen(char *str);
        !          1029: void   backslashcolon(char *str);
        !          1030: ulong  ahtoul(char *str);      /* Converts ASCII hex to ulong */
        !          1031: char * hexplus(uint num, char *str);   /* Hex plus for 3 digits up to 9000 */
        !          1032: uint   hptoi(char *str);
        !          1033: int            pstrcmp(char **str1, char **str2);  /* Compares pointers to pointers */
        !          1034: int            strsame(char *str1, char *str2);        /* Compares number of same chars */
        !          1035: 
        !          1036: /* nopen.c */
        !          1037: int            nopen(const char* str, int access);
        !          1038: FILE * fnopen(int* file, const char* str, int access);
        !          1039: BOOL   ftouch(const char* fname);
        !          1040: BOOL   fmutex(const char* fname, const char* text);
        !          1041: 
        !          1042: /* load_cfg.c */
        !          1043: BOOL   md(char *path);
        !          1044: 
        !          1045: #ifdef SBBS /* These aren't exported */
        !          1046: 
        !          1047:        /* main.c */
        !          1048:        int     lputs(int level, char *);                       /* log output */
        !          1049:        int     lprintf(int level, char *fmt, ...);     /* log output */
        !          1050:        int     eprintf(int level, char *fmt, ...);     /* event log */
        !          1051:        SOCKET  open_socket(int type);
        !          1052:        SOCKET  accept_socket(SOCKET s, SOCKADDR* addr, socklen_t* addrlen);
        !          1053:        int             close_socket(SOCKET);
        !          1054:        u_long  resolve_ip(char *addr);
        !          1055: 
        !          1056:        char *  readtext(long *line, FILE *stream);
        !          1057: 
        !          1058:        /* ver.cpp */
        !          1059:        char*   socklib_version(char* str, char* winsock_ver);
        !          1060:        
1.1       root     1061:        /* sortdir.cpp */
                   1062:        int             fnamecmp_a(char **str1, char **str2);    /* for use with resort() */
                   1063:        int             fnamecmp_d(char **str1, char **str2);
                   1064:        int             fdatecmp_a(uchar **buf1, uchar **buf2);
                   1065:        int             fdatecmp_d(uchar **buf1, uchar **buf2);
                   1066: 
1.1.1.2 ! root     1067:        /* file.cpp */
1.1       root     1068:        BOOL    filematch(char *filename, char *filespec);
                   1069: 
1.1.1.2 ! root     1070:        /* sbbscon.c */
        !          1071:        #if defined(__unix__) && defined(NEEDS_DAEMON)
        !          1072:        int daemon(int nochdir, int noclose);
        !          1073:        #endif
1.1       root     1074: 
                   1075: #endif /* SBBS */
                   1076: 
1.1.1.2 ! root     1077: extern const char* wday[];     /* abbreviated weekday names */
        !          1078: extern const char* mon[];      /* abbreviated month names */
        !          1079: extern char lastuseron[LEN_ALIAS+1];  /* Name of user last online */
        !          1080: 
1.1       root     1081: #ifdef __cplusplus
                   1082: }
                   1083: #endif
                   1084: 
1.1.1.2 ! root     1085: extern
        !          1086: #ifdef __cplusplus
        !          1087:  "C"
        !          1088: #endif
        !          1089:        const char* beta_version;
1.1       root     1090: 
1.1.1.2 ! root     1091: /* Global data */
1.1       root     1092: 
                   1093: #if defined(__FLAT__) || defined(_WIN32)
                   1094: 
                   1095: #define lread(f,b,l) read(f,b,l)
                   1096: #define lfread(b,l,f) fread(b,l,f)
                   1097: #define lwrite(f,b,l) write(f,b,l)
                   1098: #define lfwrite(b,l,f) fwrite(b,l,f)
                   1099: 
                   1100: #define lkbrd(x)       0
                   1101: 
                   1102: #endif
                   1103: 
                   1104: #endif /* Don't add anything after this line */

unix.superglobalmegacorp.com

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