|
|
1.1 ! root 1: /* sbbs.h */ ! 2: ! 3: /* Synchronet class (sbbs_t) definition and exported function prototypes */ ! 4: ! 5: /* $Id: sbbs.h,v 1.26 2000/12/11 23:21:12 rswindell Exp $ */ ! 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: * * ! 11: * Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html * ! 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: ! 57: #elif defined(__unix__) /* Unix-variant */ ! 58: ! 59: #include <unistd.h> /* close */ ! 60: ! 61: #endif ! 62: ! 63: /******************/ ! 64: /* ANSI C Library */ ! 65: /******************/ ! 66: #include <time.h> ! 67: #include <errno.h> ! 68: #include <stdio.h> ! 69: #include <ctype.h> ! 70: #include <fcntl.h> /* open */ ! 71: #include <stdarg.h> ! 72: #include <stdlib.h> ! 73: #include <string.h> ! 74: #include <malloc.h> ! 75: #include <sys/stat.h> ! 76: ! 77: /***********************/ ! 78: /* Synchronet-specific */ ! 79: /***********************/ ! 80: #include "sbbsinet.h" ! 81: #include "sbbswrap.h" ! 82: #include "smblib.h" ! 83: #include "smbwrap.h" ! 84: #include "ars_defs.h" ! 85: #include "scfgdefs.h" ! 86: #include "scfglib.h" ! 87: #include "userdat.h" ! 88: #include "riodefs.h" ! 89: #include "text.h" ! 90: #include "cmdshell.h" ! 91: #include "post.h" /* post_t defintion */ ! 92: #include "ringbuf.h" /* RingBuf definition */ ! 93: #include "client.h" /* client_t definition */ ! 94: ! 95: /* Synchronet Node Instance class definition */ ! 96: #ifdef __cplusplus ! 97: class sbbs_t ! 98: { ! 99: ! 100: public: ! 101: ! 102: sbbs_t(ushort node_num, DWORD addr, char* host_name, SOCKET, scfg_t*, char* text[]); ! 103: ~sbbs_t(); ! 104: ! 105: bool init(void); ! 106: bool terminated; ! 107: ! 108: client_t client; ! 109: SOCKET client_socket; ! 110: SOCKET client_socket_dup; ! 111: DWORD client_addr; ! 112: char client_name[61]; ! 113: DWORD local_addr; ! 114: ! 115: scfg_t cfg; ! 116: ! 117: int outchar_esc; // track ANSI escape seq output ! 118: ! 119: int rioctl(ushort action); // remote i/o control ! 120: bool rio_abortable; ! 121: ! 122: RingBuf inbuf; ! 123: RingBuf outbuf; ! 124: sem_t output_sem; ! 125: HANDLE input_thread; ! 126: pthread_mutex_t input_thread_mutex; ! 127: ! 128: int outcom(uchar ch); // send character ! 129: int incom(void); // receive character ! 130: ! 131: void spymsg(char *msg); // send message to active spies ! 132: ! 133: void putcom(char *str, int len=0); // Send string ! 134: void hangup(void); // Hangup modem ! 135: ! 136: ! 137: uchar telnet_cmd[10]; ! 138: int telnet_cmdlen; ! 139: ulong telnet_mode; ! 140: uchar telnet_last_rxch; ! 141: ! 142: bool event_thread_running; ! 143: bool output_thread_running; ! 144: bool input_thread_running; ! 145: ! 146: char menu_dir[128]; /* Over-ride default menu dir */ ! 147: char menu_file[128]; /* Over-ride menu file */ ! 148: ! 149: user_t useron; /* User currently online */ ! 150: node_t thisnode; /* Node information */ ! 151: smb_t smb; /* Currently open message base */ ! 152: char rlogin_name[LEN_ALIAS]; ! 153: ! 154: uint temp_dirnum; ! 155: ! 156: FILE *nodefile_fp, ! 157: *node_ext_fp, ! 158: *logfile_fp; ! 159: ! 160: int nodefile; /* File handle for node.dab */ ! 161: int node_ext; /* File handle for node.exb */ ! 162: char cap_fname[41]; /* Capture filename - default is CAPTURE.TXT */ ! 163: FILE *capfile; /* File string to use for capture file */ ! 164: int inputfile; /* File handle to use for input */ ! 165: ! 166: /* Batch download queue */ ! 167: char **batdn_name; /* Filenames */ ! 168: ushort *batdn_alt; /* Alternate path */ ! 169: uint *batdn_dir, /* Directory for each file */ ! 170: batdn_total; /* Total files */ ! 171: long *batdn_offset; /* Offset for data */ ! 172: ulong *batdn_size; /* Size of file in bytes */ ! 173: ulong *batdn_cdt; /* Credit value of file */ ! 174: ! 175: /* Batch upload queue */ ! 176: char **batup_desc, /* Description for each file */ ! 177: **batup_name; /* Filenames */ ! 178: long *batup_misc; /* Miscellaneous bits */ ! 179: ushort *batup_alt; /* Alternate path */ ! 180: uint *batup_dir, /* Directory for each file */ ! 181: batup_total; /* Total files */ ! 182: ! 183: /*********************************/ ! 184: /* Color Configuration Variables */ ! 185: /*********************************/ ! 186: char *text[TOTAL_TEXT]; /* Text from ctrl\text.dat */ ! 187: char *text_sav[TOTAL_TEXT]; /* Text from ctrl\text.dat */ ! 188: char orgcmd[129]; /* Original command to execute bbs */ ! 189: char dszlog[127]; /* DSZLOG enviornment variable */ ! 190: char debug; /* Flag to allow debug writes */ ! 191: int keybuftop,keybufbot; /* Keyboard input buffer pointers */ ! 192: char keybuf[KEY_BUFSIZE]; /* Keyboard input buffer */ ! 193: char * connection; /* Connection Description */ ! 194: ulong cur_rate; /* Current Connection (DCE) Rate */ ! 195: ulong cur_cps; /* Current Average Transfer CPS */ ! 196: ulong dte_rate; /* Current COM Port (DTE) Rate */ ! 197: time_t timeout; /* User inactivity timeout reference */ ! 198: ulong timeleft_warn; /* low timeleft warning flag */ ! 199: uchar curatr; /* Current Text Attributes Always */ ! 200: long lncntr; /* Line Counter - for PAUSE */ ! 201: long tos; /* Top of Screen */ ! 202: long rows; /* Current Rows for User */ ! 203: long autoterm; /* Autodetected terminal type */ ! 204: char slbuf[SAVE_LINES][LINE_BUFSIZE+1]; /* Saved for redisplay */ ! 205: char slatr[SAVE_LINES]; /* Starting attribute of each line */ ! 206: char slcnt; /* Number of lines currently saved */ ! 207: char lbuf[LINE_BUFSIZE+1];/* Temp storage for each line output */ ! 208: int lbuflen; /* Number of characters in line buffer */ ! 209: char latr; /* Starting attribute of line buffer */ ! 210: ulong console; /* Defines current Console settings */ ! 211: char wordwrap[81]; /* Word wrap buffer */ ! 212: time_t now, /* Used to store current time in Unix format */ ! 213: answertime, /* Time call was answered */ ! 214: logontime, /* Time user logged on */ ! 215: starttime, /* Time stamp to use for time left calcs */ ! 216: ns_time, /* File new-scan time */ ! 217: last_ns_time; /* Most recent new-file-scan this call */ ! 218: uchar action; /* Current action of user */ ! 219: long online; /* Remote/Local or not online */ ! 220: long sys_status; /* System Status */ ! 221: ushort *sub_cfg; /* User configuration for this sub-board */ ! 222: ulong *sub_ptr; /* Highest read message */ ! 223: ulong *sub_last; /* last read message pointer */ ! 224: ushort *sav_sub_cfg; /* Save cfg and ptrs for subs */ ! 225: ulong *sav_sub_ptr; /* for fast pointer update */ ! 226: ulong *sav_sub_last; /* last read message pointer */ ! 227: ! 228: ulong logon_ulb, /* Upload Bytes This Call */ ! 229: logon_dlb, /* Download Bytes This Call */ ! 230: logon_uls, /* Uploads This Call */ ! 231: logon_dls, /* Downloads This Call */ ! 232: logon_posts, /* Posts This Call */ ! 233: logon_emails, /* Emails This Call */ ! 234: logon_fbacks; /* Feedbacks This Call */ ! 235: uchar logon_ml; /* ML of the user apon logon */ ! 236: ! 237: int node_disk; /* Number of Node's disk */ ! 238: uint main_cmds; /* Number of Main Commands this call */ ! 239: uint xfer_cmds; /* Number of Xfer Commands this call */ ! 240: ulong posts_read; /* Number of Posts read this call */ ! 241: char temp_uler[31]; /* User who uploaded the files to temp dir */ ! 242: char temp_file[41]; /* Origin of extracted temp files */ ! 243: long temp_cdt; /* Credit value of file that was extracted */ ! 244: char autohang; /* Used for auto-hangup after transfer */ ! 245: size_t logcol; /* Current column of log file */ ! 246: uint criterrs; /* Critical error counter */ ! 247: ! 248: uint curgrp, /* Current group */ ! 249: *cursub, /* Current sub-board for each group */ ! 250: curlib, /* Current library */ ! 251: *curdir; /* Current directory for each library */ ! 252: uint *usrgrp, /* Real group numbers */ ! 253: usrgrps; /* Number groups this user has access to */ ! 254: uint *usrlib, /* Real library numbers */ ! 255: usrlibs; /* Number of libs this user can access */ ! 256: uint **usrsub, /* Real sub numbers */ ! 257: *usrsubs; /* Num of subs with access for each grp */ ! 258: uint **usrdir, /* Real dir numbers */ ! 259: *usrdirs; /* Num of dirs with access for each lib */ ! 260: uint cursubnum; /* For ARS */ ! 261: uint curdirnum; /* For ARS */ ! 262: ulong timeleft; /* Number of seconds user has left online */ ! 263: char sbbsnode[81]; /* Environment var to contain node dir path */ ! 264: char sbbsnnum[81]; /* Environment var to contain node num */ ! 265: char *comspec; /* Pointer to environment variable COMSPEC */ ! 266: ushort altul; /* Upload to alternate path flag */ ! 267: time_t next_event; /* Next event time - from front-end */ ! 268: char lastuseron[LEN_ALIAS+1]; /* Name of user last online */ ! 269: char cid[LEN_CID+1]; /* Caller ID (IP Address) of current caller */ ! 270: char *noaccess_str; /* Why access was denied via ARS */ ! 271: long noaccess_val; /* Value of parameter not met in ARS */ ! 272: int errorlevel; /* Error level of external program */ ! 273: ! 274: csi_t main_csi; /* Main Command Shell Image */ ! 275: ! 276: /* Global command shell variables */ ! 277: uint global_str_vars; ! 278: char ** global_str_var; ! 279: long * global_str_var_name; ! 280: uint global_int_vars; ! 281: long * global_int_var; ! 282: long * global_int_var_name; ! 283: char * sysvar_p[MAX_SYSVARS]; ! 284: uint sysvar_pi; ! 285: long sysvar_l[MAX_SYSVARS]; ! 286: uint sysvar_li; ! 287: ! 288: /* ansi_term.cpp */ ! 289: char * ansi(int atr); /* Returns ansi escape sequence for atr */ ! 290: void ansi_getxy(int* x, int* y); ! 291: void ansi_getlines(void); ! 292: ! 293: /* Command Shell Methods */ ! 294: int exec(csi_t *csi); ! 295: int exec_function(csi_t *csi); ! 296: int exec_misc(csi_t *csi, char *path); ! 297: int execmsg(csi_t *csi); ! 298: int execfile(csi_t *csi); ! 299: long exec_bin(char *mod, csi_t *csi); ! 300: void clearvars(csi_t *bin); ! 301: void freevars(csi_t *bin); ! 302: char** getstrvar(csi_t *bin, long name); ! 303: long* getintvar(csi_t *bin, long name); ! 304: char* copystrvar(csi_t *csi, char *p, char *str); ! 305: void skipto(csi_t *csi, uchar inst); ! 306: ! 307: void reset_logon_vars(void); ! 308: ! 309: uint finduser(char *str); ! 310: ! 311: int sub_op(uint subnum); ! 312: ulong getlastmsg(uint subnum, ulong *ptr, time_t *t); ! 313: time_t getmsgtime(uint subnum, ulong ptr); ! 314: ulong getmsgnum(uint subnum, time_t t); ! 315: ulong getposts(uint subnum); ! 316: ! 317: int getfiles(uint dirnum); ! 318: int dir_op(uint dirnum); ! 319: int getuserxfers(int fromuser, int destuser, char *fname); ! 320: uint gettotalfiles(uint dirnum); ! 321: void getnodeext(uint number, char * str); ! 322: void putnodeext(uint number, char * str); ! 323: void getnodedat(uint number, node_t * node, bool lock); ! 324: void putnodedat(uint number, node_t * node); ! 325: void putusername(int number, char * name); ! 326: void nodesync(void); ! 327: user_t nodesync_user; ! 328: bool nodesync_inside; ! 329: ! 330: void getmsgptrs(void); ! 331: void putmsgptrs(void); ! 332: void getusrsubs(void); ! 333: void getusrdirs(void); ! 334: uint userdatdupe(uint usernumber, uint offset, uint datlen, char *dat ! 335: ,bool del); ! 336: void gettimeleft(void); ! 337: bool gettimeleft_inside; ! 338: ! 339: /* str.cpp */ ! 340: char * timestr(time_t* intime); /* ASCII representation of time_t */ ! 341: char timestr_output[60]; ! 342: void userlist(char subonly); ! 343: size_t gettmplt(char *outstr, char *tmplt, long mode); ! 344: void sif(char *fname, char *answers, long len); /* Synchronet Inteface File */ ! 345: void sof(char *fname, char *answers, long len); ! 346: void create_sif_dat(char *siffile, char *datfile); ! 347: void read_sif_dat(char *siffile, char *datfile); ! 348: void printnodedat(uint number, node_t* node); ! 349: void reports(void); ! 350: bool inputnstime(time_t *dt); ! 351: bool chkpass(char *pass, user_t* user, bool unique); ! 352: char * cmdstr(char *instr, char *fpath, char *fspec, char *outstr); ! 353: char cmdstr_output[512]; ! 354: ! 355: void subinfo(uint subnum); ! 356: void dirinfo(uint dirnum); ! 357: bool trashcan(char *insearch, char *name); ! 358: ! 359: /* writemsg.cpp */ ! 360: void automsg(void); ! 361: bool writemsg(char *str, char *top, char *title, long mode, int subnum ! 362: ,char *dest); ! 363: char putmsg(char HUGE16 *str, long mode); ! 364: bool msgabort(void); ! 365: bool email(int usernumber, char *top, char *title, long mode); ! 366: void forwardmail(smbmsg_t* msg, int usernum); ! 367: bool postmsg(uint subnum, smbmsg_t* msg, long wm_mode); ! 368: void removeline(char *str, char *str2, char num, char skip); ! 369: ulong msgeditor(char *buf, char *top, char *title); ! 370: void editfile(char *path); ! 371: void getsmsg(int usernumber); ! 372: void getnmsg(void); ! 373: void putnmsg(int num, char *strin); ! 374: int loadmsg(smbmsg_t *msg, ulong number); ! 375: ushort chmsgattr(ushort attr); ! 376: void show_msgattr(ushort attr); ! 377: void show_msghdr(smbmsg_t* msg); ! 378: void show_msg(smbmsg_t* msg, long mode); ! 379: void msgtotxt(smbmsg_t* msg, char *str, int header, int tails); ! 380: void quotemsg(smbmsg_t* msg, int tails); ! 381: void putmsg_fp(FILE *fp, long length, long mode); ! 382: void editmsg(smbmsg_t* msg, uint subnum); ! 383: void editor_inf(int xeditnum,char *dest, char *title, long mode ! 384: ,uint subnum); ! 385: void copyfattach(uint to, uint from, char *title); ! 386: bool movemsg(smbmsg_t* msg, uint subnum); ! 387: ! 388: /* mail.cpp */ ! 389: int delmail(uint usernumber,int which); ! 390: void delfattach(uint to, char *title); ! 391: void telluser(smbmsg_t* msg); ! 392: void delallmail(uint usernumber); ! 393: ! 394: /* getmsg.cpp */ ! 395: post_t* loadposts(long *posts, uint subnum, ulong ptr, long mode); ! 396: ! 397: /* readmail.cpp */ ! 398: void readmail(uint usernumber, int sent); ! 399: ! 400: /* bulkmail.cpp */ ! 401: void bulkmail(uchar *ar); ! 402: int bulkmailhdr(uint usernum, smbmsg_t* msg, ushort msgattr, ulong offset ! 403: ,ulong length, char *title); ! 404: ! 405: /* con_out.cpp */ ! 406: int bputs(char *str); /* BBS puts function */ ! 407: int rputs(char *str); /* BBS raw puts function */ ! 408: int bprintf(char *fmt, ...); /* BBS printf function */ ! 409: int rprintf(char *fmt, ...); /* BBS raw printf function */ ! 410: void outchar(char ch); /* Output a char - check echo and emu. */ ! 411: void center(char *str); ! 412: ! 413: /* getstr.cpp */ ! 414: size_t getstr(char *str, size_t length, long mode); ! 415: long getnum(ulong max); ! 416: ! 417: /* getkey.cpp */ ! 418: char getkey(long mode); /* Waits for a key hit local or remote */ ! 419: long getkeys(char *str, ulong max); ! 420: void ungetkey(char ch); /* Places 'ch' into the input buffer */ ! 421: char inkey(long mode); /* Returns key if one has been hit */ ! 422: char question[128]; ! 423: bool yesno(char *str); ! 424: bool noyes(char *str); ! 425: void pause(void); ! 426: char * mnestr; ! 427: void mnemonics(char *str); ! 428: ! 429: /* prntfile.cpp */ ! 430: void printfile(char *str, long mode); ! 431: void printtail(char *str, int lines, long mode); ! 432: void menu(char *code); ! 433: ! 434: int uselect(int add, uint n, char *title, char *item, uchar *ar); ! 435: uint uselect_total, uselect_num[500]; ! 436: ! 437: void riosync(char abortable); ! 438: bool validattr(char a); ! 439: int stripattr(char *str); ! 440: void redrwstr(char *strin, int i, int l, long mode); ! 441: void attr(int atr); /* Change local and remote text attributes */ ! 442: void ctrl_a(char x); /* Peforms the Ctrl-Ax attribute changes */ ! 443: ! 444: /* atcodes.cpp */ ! 445: int atcodes(char *code); ! 446: int syncatcodes(char *sp, int len); ! 447: ! 448: /* getnode.cpp */ ! 449: int whos_online(bool listself);/* Lists active nodes, returns active nodes */ ! 450: ! 451: void clearline(void); ! 452: ! 453: /* logonoff.cpp */ ! 454: bool answer(); ! 455: int login(char *str, char *pw); ! 456: bool logon(void); ! 457: void logout(void); ! 458: void logoff(void); ! 459: void newuser(void); /* Get new user */ ! 460: void backout(void); ! 461: ! 462: /* readmsgs.cpp */ ! 463: int scanposts(uint subnum, long mode, char *find); /* Scan sub-board */ ! 464: int searchsub(uint subnum, char *search); /* Search for string on sub */ ! 465: int searchsub_toyou(uint subnum); ! 466: int text_sec(void); /* Text sections */ ! 467: void listmsgs(int subnum, post_t * post, long i, long posts); ! 468: void msghdr(smbmsg_t* msg); ! 469: int searchposts(uint subnum, post_t * post, long start, long msgs ! 470: ,char *search); ! 471: void showposts_toyou(post_t * post, ulong start, long posts); ! 472: ! 473: /* chat.cpp */ ! 474: void chatsection(void); ! 475: void nodepage(void); ! 476: void nodemsg(void); ! 477: int nodemsg_inside; ! 478: uchar lastnodemsg; /* Number of node last message was sent to */ ! 479: char lastnodemsguser[LEN_ALIAS+1]; ! 480: void guruchat(char *line, char *guru, int gurunum); ! 481: bool guruexp(char **ptrptr, char *line); ! 482: void localguru(char *guru, int gurunum); ! 483: void sysop_page(void); ! 484: void privchat(bool local=false); ! 485: bool chan_access(uint cnum); ! 486: int getnodetopage(int all, int telegram); ! 487: ! 488: /* main.cpp */ ! 489: void printstatslog(uint node); ! 490: ulong logonstats(void); ! 491: void logoffstats(void); ! 492: ! 493: /* misc.cpp */ ! 494: int nopen(char *str, int access); ! 495: void errormsg(int line, char *file, char action, char *object ! 496: ,ulong access, char *extinfo=NULL); ! 497: int mv(char *src, char *dest, char copy); /* fast file move/copy function */ ! 498: bool chksyspass(int local); ! 499: bool chk_ar(uchar * str, user_t * user); /* checks access requirements */ ! 500: bool ar_exp(uchar ** ptrptr, user_t * user); ! 501: ! 502: /* upload.cpp */ ! 503: bool uploadfile(file_t* f); ! 504: char sbbsfilename[128],sbbsfiledesc[128]; /* env vars */ ! 505: void upload(uint dirnum); ! 506: char upload_lastdesc[LEN_FDESC+1]; ! 507: void update_uldate(file_t* f); ! 508: bool bulkupload(uint dirnum); ! 509: ! 510: /* download.cpp */ ! 511: void downloadfile(file_t* f); ! 512: void notdownloaded(ulong size, time_t start, time_t end); ! 513: int protocol(char *cmdline, int cd); ! 514: void seqwait(uint devnum); ! 515: void autohangup(void); ! 516: bool checkprotlog(file_t* f); ! 517: ! 518: /* file.cpp */ ! 519: void fileinfo(file_t* f); ! 520: void openfile(file_t* f); ! 521: void closefile(file_t* f); ! 522: void putextdesc(uint dirnum, ulong datoffset, char *ext); ! 523: void getextdesc(uint dirnum, ulong datoffset, char *ext); ! 524: bool removefcdt(file_t* f); ! 525: bool movefile(file_t* f, int newdir); ! 526: char * getfilespec(char *str); ! 527: uint delfiles(char *path, char *spec); ! 528: bool checkfname(char *fname); ! 529: bool addtobatdl(file_t* f); ! 530: ! 531: /* listfile.cpp */ ! 532: bool listfile(char *fname, char HUGE16 *buf, uint dirnum ! 533: ,char *search, char letter, ulong datoffset); ! 534: int listfiles(uint dirnum, char *filespec, int tofile, long mode); ! 535: int listfileinfo(uint dirnum, char *filespec, long mode); ! 536: void listfiletofile(char *fname, char HUGE16 *buf, uint dirnum, int file); ! 537: int batchflagprompt(uint dirnum, file_t bf[], uint total, long totalfiles); ! 538: ! 539: /* bat_xfer.cpp */ ! 540: void batchmenu(void); ! 541: void batch_add_list(char *list); ! 542: bool create_batchup_lst(void); ! 543: bool create_batchdn_lst(void); ! 544: bool create_bimodem_pth(void); ! 545: void batch_upload(void); ! 546: void batch_download(int xfrprot); ! 547: void start_batch_download(void); ! 548: ! 549: /* tmp_xfer.cpp */ ! 550: void temp_xfer(void); ! 551: void extract(uint dirnum); ! 552: char * temp_cmd(void); /* Returns temp file command line */ ! 553: ulong create_filelist(char *name, long mode); ! 554: ! 555: /* viewfile.cpp */ ! 556: int viewfile(file_t* f, int ext); ! 557: void viewfiles(uint dirnum, char *fspec); ! 558: void viewfilecontents(file_t* f); ! 559: ! 560: /* sortdir.cpp */ ! 561: void resort(uint dirnum); ! 562: ! 563: /* xtrn.cpp */ ! 564: int external(char* cmdline, long mode, char* startup_dir=NULL); ! 565: ! 566: /* xtrn_sec.cpp */ ! 567: int xtrn_sec(void); /* The external program section */ ! 568: void xtrndat(char* name, char* dropdir, uchar type, ulong tleft ! 569: ,ulong misc); ! 570: void exec_xtrn(uint xtrnnum); /* Executes online external program */ ! 571: void user_event(char event); /* Executes user event(s) */ ! 572: char xtrn_access(uint xnum); /* Does useron have access to xtrn? */ ! 573: void moduserdat(uint xtrnnum); ! 574: ! 575: /* logio.cpp */ ! 576: void logentry(char *code,char *entry); ! 577: void log(char *str); /* Writes 'str' to node log */ ! 578: void logch(char ch, char comma); /* Writes 'ch' to node log */ ! 579: void logline(char *code,char *str); /* Writes 'str' on it's own line in log */ ! 580: void logofflist(void); /* List of users logon activity */ ! 581: void errorlog(char *text); /* Logs errors to ERROR.LOG and NODE.LOG */ ! 582: bool errorlog_inside; ! 583: bool errormsg_inside; ! 584: ! 585: #if DEBUG ! 586: void dlog(int line, char *file, char *text); /* Debug log file */ ! 587: #endif ! 588: ! 589: /* qwk.cpp */ ! 590: bool qwklogon; ! 591: time_t qwkmail_time; ! 592: void qwk_sec(void); ! 593: int qwk_route(char *inaddr, char *fulladdr); ! 594: void update_qwkroute(char *via); ! 595: void qwk_success(ulong msgcnt, char bi, char prepack); ! 596: void qwksetptr(uint subnum, char *buf, int reset); ! 597: void qwkcfgline(char *buf,uint subnum); ! 598: ! 599: /* pack_qwk.cpp */ ! 600: bool pack_qwk(char *packet, ulong *msgcnt, bool prepack); ! 601: ! 602: /* un_qwk.cpp */ ! 603: bool unpack_qwk(char *packet,uint hubnum); ! 604: ! 605: /* pack_rep.cpp */ ! 606: bool pack_rep(uint hubnum); ! 607: ! 608: /* un_rep.cpp */ ! 609: bool unpack_rep(char* repfile=NULL); ! 610: ! 611: /* msgtoqwk.cpp */ ! 612: ulong msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum, int conf); ! 613: ! 614: /* qwktomsg.cpp */ ! 615: bool qwktomsg(FILE *qwk_fp, char *hdrblk, char fromhub, uint subnum ! 616: ,uint touser); ! 617: ! 618: /* fido.cpp */ ! 619: bool netmail(char *into, char *subj, long mode); ! 620: void qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub); ! 621: bool lookup_netuser(char *into); ! 622: ! 623: bool inetmail(char *into, char *subj, long mode); ! 624: bool qnetmail(char *into, char *subj, long mode); ! 625: ! 626: /* useredit.cpp */ ! 627: void useredit(int usernumber, int local); ! 628: int searchup(char *search,int usernum); ! 629: int searchdn(char *search,int usernum); ! 630: void maindflts(user_t* user); ! 631: void purgeuser(int usernumber); ! 632: ! 633: /* ver.cpp */ ! 634: void ver(void); ! 635: ! 636: /* scansubs.cpp */ ! 637: void scansubs(long mode); ! 638: void scanallsubs(long mode); ! 639: void new_scan_cfg(ulong misc); ! 640: void new_scan_ptr_cfg(void); ! 641: ! 642: /* scandirs.cpp */ ! 643: void scanalldirs(long mode); ! 644: void scandirs(long mode); ! 645: ! 646: #define nosound() ! 647: #define checkline() ! 648: ! 649: void catsyslog(int crash); ! 650: ! 651: /* telgate.cpp */ ! 652: void telnet_gate(char* addr, ulong mode); // See TG_* for mode bits ! 653: ! 654: }; ! 655: #endif ! 656: ! 657: #ifdef DLLEXPORT ! 658: #undef DLLEXPORT ! 659: #endif ! 660: #ifdef DLLCALL ! 661: #undef DLLCALL ! 662: #endif ! 663: #ifdef _WIN32 ! 664: #ifdef SBBS_EXPORTS ! 665: #define DLLEXPORT __declspec(dllexport) ! 666: #else ! 667: #define DLLEXPORT __declspec(dllimport) ! 668: #endif ! 669: #ifdef __BORLANDC__ ! 670: #define DLLCALL __stdcall ! 671: #else ! 672: #define DLLCALL ! 673: #endif ! 674: #else /* !_WIN32 */ ! 675: #define DLLEXPORT ! 676: #define DLLCALL ! 677: #endif ! 678: ! 679: #ifdef __cplusplus ! 680: extern "C" { ! 681: #endif ! 682: ! 683: /* main.cpp */ ! 684: DLLEXPORT BOOL DLLCALL getstats(scfg_t* cfg, char node, stats_t* stats); ! 685: ! 686: /* mail.cpp */ ! 687: DLLEXPORT int DLLCALL getmail(scfg_t* cfg, int usernumber, BOOL sent); ! 688: DLLEXPORT mail_t* DLLCALL loadmail(smb_t* smb, ulong* msgs, uint usernumber ! 689: ,int which, long mode); ! 690: DLLEXPORT void DLLCALL freemail(mail_t* mail); ! 691: ! 692: /* filedat.c */ ! 693: DLLEXPORT BOOL DLLCALL getfileixb(scfg_t* cfg, file_t* f); ! 694: DLLEXPORT BOOL DLLCALL getfiledat(scfg_t* cfg, file_t* f); ! 695: DLLEXPORT BOOL DLLCALL putfiledat(scfg_t* cfg, file_t* f); ! 696: DLLEXPORT BOOL DLLCALL removefiledat(scfg_t* cfg, file_t* f); ! 697: DLLEXPORT BOOL DLLCALL addfiledat(scfg_t* cfg, file_t* f); ! 698: DLLEXPORT BOOL DLLCALL findfile(scfg_t* cfg, uint dirnum, char *filename); ! 699: DLLEXPORT char * DLLCALL getfname(char *path); ! 700: DLLEXPORT char * DLLCALL padfname(char *filename, char *str); ! 701: DLLEXPORT char * DLLCALL unpadfname(char *filename, char *str); ! 702: DLLEXPORT BOOL DLLCALL rmuserxfers(scfg_t* cfg, int fromuser, int destuser, char *fname); ! 703: ! 704: /* str.cpp */ ! 705: DLLEXPORT BOOL DLLCALL trashcan(scfg_t* cfg, char *insearch, char *name); ! 706: ! 707: DLLEXPORT ushort DLLCALL crc16(char *str); ! 708: DLLEXPORT char * DLLCALL zonestr(short zone); ! 709: DLLEXPORT int DLLCALL putsmsg(scfg_t* cfg, int usernumber, char *strin); ! 710: ! 711: /* load_cfg.C */ ! 712: ! 713: DLLEXPORT BOOL DLLCALL load_cfg(scfg_t* cfg, char* text[]); ! 714: DLLEXPORT void DLLCALL free_cfg(scfg_t* cfg); ! 715: DLLEXPORT void DLLCALL free_text(char* text[]); ! 716: ! 717: /* date_str.c */ ! 718: ! 719: /* ASCII date (MM/DD/YY) to unix conversion */ ! 720: DLLEXPORT time_t DLLCALL dstrtounix(scfg_t*, char *str); ! 721: /* Unix time to ASCII date */ ! 722: DLLEXPORT char * DLLCALL unixtodstr(scfg_t*, time_t, char *str); ! 723: /* seconds to HH:MM:SS */ ! 724: DLLEXPORT char * DLLCALL sectostr(uint sec, char *str); ! 725: ! 726: #ifdef SBBS /* These aren't exported */ ! 727: ! 728: /* misc.c */ ! 729: int nopen(char *str, int access); ! 730: FILE * fnopen(int *file, char *str, int access); ! 731: int bstrlen(char *str); ! 732: void strip_ctrl(char *str); ! 733: void strip_exascii(char *str); ! 734: char * ultoac(ulong l,char *str); ! 735: void truncsp(char *str); /* Truncates white spaces off end of str */ ! 736: void backslash(char *str); ! 737: void backslashcolon(char *str); ! 738: ulong _crc32(char *str); ! 739: ulong crc32(char *buf, ulong len); ! 740: void ucrc16(uchar ch, ushort *rcrc); ! 741: int pstrcmp(char **str1, char **str2); /* Compares pointers to pointers */ ! 742: int strsame(char *str1, char *str2); /* Compares number of same chars */ ! 743: ulong ahtoul(char *str); /* Converts ASCII hex to ulong */ ! 744: char * hexplus(uint num, char *str); /* Hex plus for 3 digits up to 9000 */ ! 745: uint hptoi(char *str); ! 746: ! 747: char * readtext(long *line, FILE *stream); ! 748: BOOL md(char *path); ! 749: ! 750: int lprintf(char *fmt, ...); ! 751: int lputs(char *); ! 752: ! 753: /* qwk.cpp */ ! 754: void remove_re(char *str); ! 755: #ifdef __cplusplus ! 756: char* remove_ctrl_a(char* instr, char* outstr=NULL); ! 757: #endif ! 758: ! 759: /* sortdir.cpp */ ! 760: int fnamecmp_a(char **str1, char **str2); /* for use with resort() */ ! 761: int fnamecmp_d(char **str1, char **str2); ! 762: int fdatecmp_a(uchar **buf1, uchar **buf2); ! 763: int fdatecmp_d(uchar **buf1, uchar **buf2); ! 764: ! 765: BOOL filematch(char *filename, char *filespec); ! 766: ! 767: /* chat.cpp */ ! 768: void packchatpass(char *pass, node_t* node); ! 769: char * unpackchatpass(char *pass, node_t* node); ! 770: ! 771: #endif /* SBBS */ ! 772: ! 773: #ifdef __cplusplus ! 774: } ! 775: #endif ! 776: ! 777: /* Global data */ ! 778: ! 779: extern const char* wday[]; /* abbreviated weekday names */ ! 780: extern const char* mon[]; /* abbreviated month names */ ! 781: ! 782: #if defined(__FLAT__) || defined(_WIN32) ! 783: ! 784: #define lread(f,b,l) read(f,b,l) ! 785: #define lfread(b,l,f) fread(b,l,f) ! 786: #define lwrite(f,b,l) write(f,b,l) ! 787: #define lfwrite(b,l,f) fwrite(b,l,f) ! 788: ! 789: #define lkbrd(x) 0 ! 790: ! 791: #endif ! 792: ! 793: #endif /* Don't add anything after this line */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.