home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 September / PCO_0998.ISO / filesbbs / dos / sbbs_src.exe / SBBS_SRC.DOC < prev    next >
Encoding:
Text File  |  1997-09-05  |  26.5 KB  |  661 lines

  1.        Synchronet BBS Software and Utilities C Source Code Documentation
  2.        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3.             Created April 1997, Rob Swindell
  4.               Updated September 1997, Rob Swindell
  5.               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  6.  
  7. Official Synchronet Web Site:
  8.     http://www.weedpuller.com/synchronet
  9. Latest version of the source code and this document stored at:
  10.     ftp://ftp.weedpuller.com/synchronet
  11. Post public questions are comments on the freelance Synchronet listserv:
  12.     mailto:synchronet@freelance.com
  13. Send bug fixes or comments
  14.     mailto:sbbs@weedpuller.com
  15.  
  16. I no-longer monitor any BBS-related newsgroups (too flakey and spam-ridden).
  17.  
  18. History
  19. =======
  20.  
  21. The Synchronet BBS software project began in December of 1990 when I started
  22. writing my very own BBS program from the ground up. While it is true that I ran
  23. Wayne Bell's WWIV BBS software for a number of years and an illicit copy of the
  24. WWIV source code was my first exposure to the C Programming Language, I didn't
  25. steal, borrow, or otherwise copy the WWIV source code for use in Synchronet in
  26. any way. I did refer to Wayne's code from time to time when implementing
  27. WWIV-compatible features like WWIV color codes, but I didn't need (or want) to
  28. copy his source. I do wish to take this moment, however, to extend my
  29. appreciation to Wayne Bell for his contributions to the BBS and hacker
  30. communities, and for personally inspiring me to write a better BBS! ;-)
  31.  
  32. In 1992, Synchronet became a commercial venture for me (under the company name
  33. Digital Dynamics) and was my sole source of income for over three years. The
  34. commercialization of the Internet, and in paticular, the Wolrd Wide Web, has
  35. all but eliminated the commercial BBS software market and in 1996, I officially
  36. announced the end of Digital Dynamics (in the "Digital Manifesto"). In February
  37. of 1997, my own BBS, Vertrauen, was abruptly shut-down. This time for good.
  38. From September of 1988 to February of 1997, Vertrauen (German for "Trust")
  39. answered the phone at 714-529-9525 24 hours a day, 7 days a week. It went from
  40. a 1 line "pirate" BBS running WWIV on an 8mhz 8088 to a 7 node Synchronet
  41. BBS running on two 66mhz 486s connected to a Novell NetWare 3.12 file server
  42. with many gigabytes of disk space, 7 CD-ROMS, Planet Connect Fidonet feed, the
  43. whole nine yards - pretty much everything except Internet access (never could
  44. justify the monthly costs of a full-time connection).
  45.  
  46. Today, I personally have very little interest in BBSs (using or operating them)
  47. and my programming interests have been focused elsewhere for quite some time
  48. (Internet communication products). For this reason, I am releasing the
  49. complete source code (in C) for Synchronet BBS software and all other Digital
  50. Dynamics' utilites. Since I expect no futher income from Synchronet BBS
  51. software and have no plans on enhancing or supporting the product in any way, I
  52. thought the least I could do was to package up, document, and publicly release
  53. the source code for others to continue enhancing as they wish.
  54.  
  55.  
  56. Disclaimer
  57. ==========
  58.  
  59. The accompanying source code (and this documentation) are not intended for the
  60. beginning, or possibly even intermediate, programmer. You must have a healthy
  61. knowledge of DOS, MAKEFILES, and the C Programming Language for this source
  62. code to be of any use to you. Of course, beginners are encouraged to learn
  63. (hopefully with the help of a friend or two) from the included projects - just
  64. don't get too irritated if things don't compile and link the first time.
  65.  
  66. It is my hope that a hand full of capable young hackers will take Synchronet
  67. into new directions. Hopefully, retaining the original name (Synchronet) in
  68. some form, although there is no way for me to enforce this. I assume that some
  69. will make minor modifications and re-release compiled versions under their name
  70. with no credit to my work or the history of Synchronet, but while that isn't
  71. "cool", it isn't illegal either. I am releasing the rights to every piece of
  72. code accompanying this document to the public domain. That means that anyone
  73. and everyone can do with it whatever they like as far as I'm concerned.
  74.  
  75. I, Rob Swindell, author of Synchronet, owner of Digital Dynamics, hereby
  76. relinquish the copyright of Synchronet BBS software and all Synchronet-related
  77. Digital Dynamics' utilities to the public domain. I am offering no warranties
  78. of any kind. Use at your own risk.
  79.  
  80.  
  81. Required Tools                Version         Project(s)
  82. ==============                -------         ----------
  83.  
  84. Borland C++ for DOS and Windows     3.1            SBBS.EXE
  85.                                 SBJ.EXE
  86.                                 SBL.EXE
  87.                                 SCB.EXE
  88.                                 SMM.EXE
  89.                                 UTI*.EXE
  90.                                 ADDFILES.EXE
  91.                                 DELFILES.EXE
  92.                                 DUPEFIND.EXE
  93.                                 FILELIST.EXE
  94.                                 SMBACTIV.EXE
  95.  
  96.   Note: Newer versions of Borland C++ tended to create larger, more memory
  97.     hungry executables, so I stayed with 3.1 for these 16-bit DOS versions
  98.     (where available DOS memory was a never ending issue with sysops).
  99.     Newer versions of Borland C++ will work (with slight changes to the
  100.     appropriate MAKEFILEs) for the above projects. The last five projects
  101.     listed above are built with MAKEFILE.BC (i.e. make -fmakefile.bc)
  102.     instead of MAKEFILE (used for Watcom).
  103.  
  104. Borland C++ for DOS, Windows, and Win32 4.5            SCFG.EXE
  105.                                 SCFG32.EXE
  106.                                 BAJA.EXE
  107.                                 BAJA32.EXE
  108.                                 SBBS4W32.EXE
  109.                                 INSTALL.EXE
  110.                                 QWKNODES.EXE
  111.                                 SBBSECHO.EXE
  112.                                 SMB2SBL.EXE
  113.                                 SBL2SMB.EXE
  114.                                 SMB2SMM.EXE
  115.                                 SMM2SMB.EXE
  116.                                 NODE.COM
  117.                                 SLOG.EXE
  118.                                 DSTSEDIT.EXE
  119.                                 ANS2MSG.EXE
  120.                                                                 MSG2ANS.EXE
  121.                                 EXECSBBS.COM
  122.  
  123.   Note: SBBS4W32.EXE, the 32-bit Windows version of Synchronet, is incomplete.
  124.     Again, newer versions of Borland C++ (4.51, 5.x, etc) will probably
  125.     work fine with slight changes to the appropriate MAKEFILEs. SCFG32.EXE
  126.     is a native Win32 app that also runs under DOS (using Borland's DOS
  127.     extender) - I don't know why the gettext/puttext is messed up.
  128.     You'll need EXE2BIN.EXE (included with MS-DOS) to create EXECSBBS.COM.
  129.  
  130.  
  131. Borland C++ for OS/2            2.0            SBBS4OS2.EXE
  132.                                 SCFG4OS2.EXE
  133.                                 SBBSECHO.EXE
  134.                                 ADDFILES.EXE
  135.                                 BAJA4OS2.EXE
  136.                                 DELFILES.EXE
  137.                                 DUPEFIND.EXE
  138.                                 FILELIST.EXE
  139.                                 INSTALL.EXE
  140.                                 NODE.EXE
  141.                                 SLOG.EXE
  142.                                 CHKSMB.EXE
  143.                                 FIXSMB.EXE
  144.                                 SMBUTIL.EXE
  145.                                 SMBACTIV.EXE
  146.                                 DSTSEDIT.EXE
  147.                                 ANS2MSG.EXE
  148.                                 MSG2ANS.EXE
  149.                                 EXECSBBS.EXE
  150.                                 
  151.   Note: Watcom makefiles are available for many of these projects and have
  152.     the advantage of being able to be built from any environment (DOS,
  153.     Windows, or OS/2) and create executables that run under all those
  154.     environments. Borland C++ for OS/2, on the otherhand, can only be
  155.     used in an OS/2 environment and can only create OS/2 executables.
  156.     While Borland's C++ compilers definitely compile faster, the resulting
  157.     exectubles created by Watcom C++ are usually smaller and faster.
  158.     Any of the projects that don't already have support for Borland C++
  159.     for OS/2, can probably be easily modified to do so (this excludes
  160.     XSDK apps). Most popular executables are already supported.
  161.  
  162.  
  163. Watcom C++                10.0a            ADDFILES.EXE
  164.                                 AUTONODE.EXE
  165.                                 DELFILES.EXE
  166.                                 DUPEFIND.EXE
  167.                                 FILELIST.EXE
  168.                                 SBBSECHO.EXE
  169.                                 SMBUTIL.EXE
  170.                                 SMBACTIV.EXE
  171.  
  172.   Note: All flavors (16-bit DOS, 32-bit DOS, 32-bit OS/2, and 32-bit Windows)
  173.     Love the cross-platform capabilites of Watcom C++!
  174.     The NT\*.EXE files are Win32 executables that run native under either
  175.     Windows 95 or Windows NT.
  176.     The DOSX\*.EXE and DOS4G\*.EXE files are extended DOS executables that
  177.     need DOS4G.EXE or DOS4GW.EXE (included with Watcom C++) in the search
  178.     path. (Sorry 'bout the inconsistency in the sub-directory names,
  179.     there's no difference between DOSX and DOS4G except that I used to have
  180.     some extended DOS Borland projects write to the DOSX directories).
  181.  
  182.     *** IMPORTANT ***
  183.     1) It is important that you delete all the files from the DOS and OS2
  184.        destination sub-directories (use CLEANALL.BAT) if you've previously
  185.        built a project using Borland C++ and wish to re-build it using
  186.        Watcom. The .OBJ files are NOT compatible between Watcom and Borland
  187.        (without some special effort).
  188.     2) You must copy \WATCOM\SRC\STARTUP\WILDARGV.C from the Watcom C++
  189.        installation directory (or CD-ROM) into the SBBS\SMB\SMBUTIL
  190.        directory before attempting a Watcom build on the SMBUTIL project.
  191.        It's a copyrighted file, so I couldn't include it.
  192.  
  193.     Watcom can be/could have been used for some of the Borland-only
  194.     projects, but due to its slow compile speed, I only used it for the
  195.     projects that needed the best extended DOS support (DOS4G blows away
  196.     Borland's DOS extender) and cross-platform compile (it was a pain to
  197.     boot OS/2 every time I needed to build an OS/2 executable with Borland
  198.     C++ for OS/2). Plus, Watcom's text-mode screen-libraries were sorely
  199.     lacking (hence no CFG.EXE projects are built with Watcom).
  200.  
  201. Tool Notes
  202. ==========
  203.  
  204. As noted aboved, Borland C++ v4.5 (or possibly newer versions) may be used for
  205. SBBS.EXE (and other BC v3.1 projects), but you will have less available DOS
  206. memory (the executable will consume more memory).
  207.  
  208. Borland C++ v4.5 can also be used for many of the Watcom compiled utilities.
  209. If you find MAKEFILE.BC in any of the Watcom compiled project directories, you
  210. can use this makefile to build a 16-bit DOS, 32-bit OS/2, and in some cases
  211. 32-bit DOS executable with Borland C++. Likewise, any *.WAT makefiles (and most
  212. of the MAEKALL.BAT files) are intended for use with Watcom C++.
  213.  
  214.  
  215. Project Notes
  216. =============
  217.  
  218. Most projects are built via MAKEFILE and/or .BAT/.CMD file. If you find a
  219. MAKEALL.BAT or MAKEALL.CMD (for OS/2) file in any of the project directories,
  220. this batch file is used to compile and link versions for all supported
  221. platforms (e.g. DOS-16, DOS-32, OS/2, Win32, etc).
  222.  
  223. If a MAKEFILE or *.MAK file doesn't exist in the project directory, there may
  224. be a simple MAKE.BAT/MAKE.CMD to build the executable. The simplest projects
  225. may not include any type of MAKEFILE, BAT, or CMD file, but just require a
  226. basic CC command line to compile and link into an executable (only the most
  227. independant and smallest projects fit into this category).
  228.  
  229. The MAKEALL.BAT file in the source ROOT directory is used to build ALL
  230. Borland C++ DOS and Win32 projects.
  231.  
  232. The MAKEALL.CMD file in the source ROOT directory is used to build ALL
  233. Borland C++ OS/2 projects.
  234.  
  235. The WMAKEALL.BAT file in the source ROOT directory is used to build ALL
  236. Watcom C++ DOS, DOS4G, OS/2 and Win32 projects.
  237.  
  238. Sub-directories are usually used to house the output files (.OBJ, .EXE, .MAP,
  239. etc) for each supported platform. Sub-directories with the name DOS are used
  240. for 16-bit DOS output files; sub-directories of DOSX, DOS32, or DOS4G are used
  241. for 32-bit extended DOS output files; sub-directories of OS2 contain 32-bit
  242. OS/2 output files; subdirectories of NT or W32 contain 32-bit Windows
  243. (Windows NT or Windows 95) output files. In the more simple projects (e.g.
  244. BAJA*.EXE), no sub-directories are utilized.
  245.  
  246. The makefiles (MAKEFILE.*, *.MAK, *.BC, *.WAT) are setup for my environment.
  247. You will most likely need to make changes to these makefiles for your
  248. environment. For reference purposes, these are the path locations of the
  249. various tools in my environment:
  250.  
  251. Path            Tool
  252. ----            ----
  253. N:\BC31         Borland C++ for DOS and Windows v3.1
  254. N:\BC45         Borland C++ for DOS, Windows, and Win32 v4.5
  255. C:\BCOS2        Borland C++ for OS/2 v2.0
  256. N:\WATCOM        Watcom C++ v10.0a
  257.  
  258. My system PATH environment variable contains N:\BC45\BIN, N:\WATCOM\BINB,
  259. and N:\WATCOM\BIN. So if you see references (without path) to BCC, then that
  260. would indicate Borland C++ v4.5. MAKE and MAKER are Borland's MAKE utilities
  261. (included with Borland C++ v4.5, the latter being the 16-bit real mode
  262. version). WMAKE is the Watcom MAKE utility.
  263.  
  264. My N:\BCxx\BIN\TURBOC.CFG file contains:
  265.  
  266. -IN:\BCxx\INCLUDE
  267. -LN:\BCxx\LIB
  268.  
  269. I've made an effort to eliminate the project drive letter (N:) from all
  270. MAKEFILEs and BATch files, but some references may still remain. If you only
  271. have one hard disk on your system (C:) or your projects are stored on the same
  272. drive the compiler(s) is/are installed on, then simply eliminating any drive
  273. letter specifications is suggested.
  274.  
  275. Efforts have been made to eliminate all compiler warnings, but in some cases
  276. warnings may persist. Especially when using a different compiler or version
  277. than I have used. Any warnings in the source code I'm releasing may be safely
  278. ignored. If you or anyone else has modified the code, then warnings in the
  279. modified files should be investigated at your discretion.
  280.  
  281.  
  282. Directory Hierachry
  283. ===================
  284.  
  285. If extracted correctly, the archive that contained this document should have
  286. created a directory hierarchy similar to the following:
  287.  
  288. ┌─ SBBS ─────────┬─ ADDFILES ─────┬─ DOS
  289. │         │          ├─ DOSX
  290. │         │          ├─ NT
  291. │         │          └─ OS2
  292. │         ├─ ALLUSERS
  293. │         ├─ ANS2MSG
  294. │         ├─ AUTONODE
  295. │         ├─ BAJA
  296. │         ├─ DCDWATCH
  297. │         ├─ DELFILES ─────┬─ DOS
  298. │         │          ├─ DOSX
  299. │         │          ├─ NT
  300. │         │          └─ OS2
  301. │         ├─ DOS
  302. │         ├─ DSTSEDIT
  303. │         ├─ DUPEFIND ─────┬─ DOS
  304. │         │          ├─ DOSX
  305. │         │          ├─ NT
  306. │         │          └─ OS2
  307. │         ├─ ECHO ─────────┬─ DOS
  308. │         │          ├─ DOS4G
  309. │         │          ├─ NT
  310. │         │          └─ OS2
  311. │         ├─ EXECDOS
  312. │         ├─ EXECSBBS ─────┬─ DOS
  313. │         │          └─ OS2
  314. │         ├─ FILELIST ─────┬─ DOS
  315. │         │          ├─ DOSX
  316. │         │          ├─ NT
  317. │         │          └─ OS2
  318. │         ├─ INSTALL ──────┬─ DOS
  319. │         │          └─ OS2
  320. │         ├─ MLABELS
  321. │         ├─ MSG2ANS
  322. │         ├─ MSWAIT ───────── DOS
  323. │         ├─ NODE ─────────┬─ DOS
  324. │         │          └─ OS2
  325. │         ├─ OS2
  326. │         ├─ QWKNODES
  327. │         ├─ RIO
  328. │         ├─ SBL
  329. │         ├─ SBJ
  330. │         ├─ SCB
  331. │         ├─ SCFG ─────────┬─ DOS
  332. │         │          ├─ DOS32
  333. │         │          └─ OS2
  334. │         ├─ SDK
  335. │         ├─ SLOG ─────────┬─ DOS
  336. │         │          └─ OS2
  337. │         ├─ SMB ──────────┬─ CHKSMB ───────┬─ DOS
  338. │         │          │           └─ OS2
  339. │         │          ├─ FIXSMB ───────┬─ DOS
  340. │         │          │           └─ OS2
  341. │         │          └─ SMBUTIL ──────┬─ DOS
  342. │         │                   ├─ DOS4G
  343. │         │                   ├─ NT
  344. │         │                   └─ OS2
  345. │         ├─ SMBACTIV ─────┬─ DOS
  346. │         │          ├─ DOSX
  347. │         │          ├─ NT
  348. │         │          └─ OS2
  349. │         ├─ SMM
  350. │         ├─ UTI
  351. │         └─ W32
  352. ├─ MSWAIT ───────── DOS
  353. ├─ SPAWNO
  354. ├─ STP
  355. ├─ TONE
  356. └─ UIFC
  357.  
  358. Directory Descriptions
  359. ----------------------
  360. SBBS\        Synchronet source code and shared header files
  361. SBBS\SMB\    Synchronet Message Base library and header files
  362. ...\CHKSMB\    Source for utility to check Synchronet message bases for errors
  363. ...\FIXSMB\    Source for utility to rebuild Synchronet message base indices
  364. ...\SMBUTIL\    Synchronet message base maintenance utility (SMBUTIL) source
  365. SBBS\RIO\    OS/2 and Win32 Remote I/O library source and header files
  366. SBBS\SDK\    Synchronet External program SDK (XSDK) source and header files
  367. SBBS\SMM\    Synchronet Match Maker and utility source
  368. SBBS\SCB\    Synchronet Callback source
  369. SBBS\SBJ\    Synchronet Blackjack source
  370. SBBS\SBL\    Synchronet BBS List source
  371. SBBS\UTI\    Synchronet UTI driver (for PostLink/RelayNet/RIME) source
  372. SBBS\SCFG\    Synchronet Configuration program source
  373. SBBS\BAJA\    Synchronet shell/module compiler (BAJA.EXE) source
  374. SBBS\ECHO\    SBBSecho (FidoNet echomail program) source
  375. SBBS\EXECDOS\    Synchronet for OS/2's EXECDOS.EXE source
  376. SBBS\EXECSBBS\    EXECSBBS.COM/EXE (for SBBS4DOS/OS2) source
  377. SBBS\DCDWATCH\    DCDWATCH.EXE source
  378. SBBS\ADDFILES\    ADDFILES.EXE source
  379. SBBS\DELFILES\    DELFILES.EXE source
  380. SBBS\DUPEFIND\    DUPEFIND.EXE source
  381. SBBS\FILELIST\    FILELIST.EXE source
  382. SBBS\ALLUSERS\    ALLUSERS.EXE source
  383. SBBS\MLABELS\    MLABLES.EXE source
  384. SBBS\ANS2MSG\    ANS2MSG.EXE source
  385. SBBS\MSG2ANS\    MSG2ANS.EXE source
  386. SBBS\AUTONODE\    AUTONODE.EXE source
  387. SBBS\SMBACTIV\    SMBACTIV.EXE source
  388. SBBS\QWKNODES\    QWKNODES.EXE source
  389. SBBS\SLOG\    SLOG.EXE source
  390. SBBS\NODE\    NODE.COM/EXE source
  391. SBBS\DSTSEDIT\    DSTSEDIT.EXE source
  392. SBBS\INSTALL\    INSTALL.EXE source
  393. MSWAIT\     MSWAIT\DOS\MSWAIT.OBJ (millisecond wait) source
  394. SPAWNO\     Ralf Brown's EMS/XMS/disk swapping replacement for spawn...()
  395. STP\        Synchronet Transfer Protocols (X/Y/Zmodem) [incomplete]
  396. TONE\        Tone generator (used for external sysop chat pager)
  397. UIFC\        User Interface library source and header files (for *CFG.EXE)
  398.  
  399. Note: If you don't recognize the name of a program or utility, see SYSOP.DOC.
  400. Note: Source code for SBBS\DOS\RCIOL.OBJ is not provided because I don't have
  401.       it (the consultant that developed this module never supplied me with the
  402.       latest version of the source code).
  403.  
  404.  
  405. C Header File Notes
  406. ===================
  407.  
  408. SBBS\SBBS.H
  409. -----------
  410. This is the main shared header file for Synchronet and Synchronet related
  411. utilities. This header file contains prototypes for most all functions
  412. contained in SBBS.EXE. But, more importantly, it #includes SMBLIB.H (which
  413. indirectly #includes SMBDEFS.H), ARS_DEFS.H (which indirectly #includes
  414. GEN_DEFS.H), SCFGVARS.C (which indirectly #includes SBBSDEFS.H, which
  415. indirectly #includes NODEDEFS.H), SCFGLIB.H, RIOLIB.H, RIODEFS.H, and if "SBBS"
  416. is defined (only in the MAKEFILE for SBBS) VARS.C (which indirectly #includes
  417. text.h). So, as you can see, SBBS.H pretty much covers it in the header file
  418. department for Synchronet and its related utilities. The only header files
  419. that SBBS.H doesn't directly or indirectly #include are QWK.H, POST.H, ETEXT.H,
  420. CMDSHELL.H, and SPAWNO.H. You will find this header file is the most commonly
  421. #included header file in SBBS modules and Sycnhronet related utilities. The
  422. comments are quite antiquated and may be safely ignored (e.g. /* DATIO.H */).
  423.  
  424. SBBS\SBBSDEFS.H
  425. ---------------
  426. This file contains most constants, macros, and type definitions used for
  427. Synchronet and its utilities. Since it is indirectly #included with SBBS.H,
  428. you won't find it specifically #included very often.
  429.  
  430. SBBS\SCFGLIB.H
  431. --------------
  432. Contains type defintions and function protoypes only used in the initialization
  433. of Synchronet's configuration structures. Used by the SBBS and SCFG projects
  434. and all utilities that read Synchronet's configuration (*.CNF) files.
  435.  
  436. SBBS\GEN_DEFS.H
  437. ---------------
  438. A small header file that contains general application independant constant
  439. defintions and macros. This header file is #included directly or indirectly
  440. with nearly every project.
  441.  
  442. SBBS\ARS_DEFS.H
  443. ---------------
  444. Synchronet's Access Requirement Strings function prototype and constants.
  445. This function prototype and constants were broken out for use in the SBBS\BAJA
  446. (shell/module compiler) project.
  447.  
  448. SBBS\CMDSHELL.H
  449. ---------------
  450. Contains constants, typedefs, and function prototypes specific to Synchronet's
  451. command shell/module interpreter. Also used in the SBBS\BAJA (shell/module
  452. compiler) project.
  453.  
  454. SBBS\POST.H
  455. -----------
  456. Contains type defintions for post_t and shared function prototypes for
  457. the SBBS and SBBSecho projects.
  458.  
  459. SBBS\QWK.H
  460. ----------
  461. Contains constants, type definitions, and function prototypes only used in
  462. the QWK related portions of the SBBS project.
  463.  
  464. SBBS\TEXT.H
  465. -----------
  466. Contains constant defintions (via enum) for every text item in Synchronet's
  467. TEXT.DAT file. Since this header file is indirectly #included with SBBS.H
  468. in the SBBS project, you won't find it specifically #included very often.
  469.  
  470. SBBS\ETEXT.H
  471. ------------
  472. Contains extern variable declarations for the encrypted text strings in the
  473. SBBS project. This file is automatically created (along with ETEXT.C) from
  474. ETEXT.DAT by the GENETEXT.EXE utility. The encrypted text strings are left
  475. over from the commercial version of SBBS.
  476.  
  477. SBBS\VARS.C
  478. -----------
  479. This is a dual-purpose file. If GLOBAL isn't defined, then it's a C source
  480. file for all of Synchronet's global variables. SBBS.H automatically #defines
  481. GLOBAL to extern and #includes this file to automatically declare all global
  482. variables as extern. This eliminates the double-entry work of creating
  483. separate definitions and declarations for global variables. This file is
  484. only used in the SBBS project.
  485.  
  486. SBBS\RIO\RIOLIB.H
  487. -----------------
  488. This file contains function prototypes for the Remote I/O Library API. This API
  489. is consistent between DOS, OS/2 and Win32 versions.
  490.  
  491. SBBS\RIO\RIODEFS.H
  492. ------------------
  493. Contains constants required for using the Remote I/O Library.
  494.  
  495. SBBS\SMB\SMBLIB.H
  496. -----------------
  497. Contains constants and function prototypes for the Synchronet Message Base
  498. Library.
  499.  
  500. SBBS\SMB\SMBDEFS.H
  501. ------------------
  502. Contains constants and type definitions required for using the Synchronet
  503. Message Base Library.
  504.  
  505. SBBS\SMB\CRC32.H
  506. ----------------
  507. Standard 32-bit CRC table and macro. Also included in BAJA, SBBSecho, and
  508. other projects.
  509.  
  510. SBBS\SCFG\SCFG.H
  511. ----------------
  512. Contains constant defintions, macros, global variable declarations, and
  513. function prototypes for modules in the SCFG project.
  514.  
  515. SBBS\ECHO\SBBSECHO.H
  516. --------------------
  517. Contains constants, type definitions, and function prototypes for the
  518. SBBSecho project.
  519.  
  520. SBBS\UTI\UTI.H
  521. --------------
  522. Small header file containing global variable declarations, constants, macros,
  523. and a function prototype for modules in the UTI driver project.
  524.  
  525. SBBS\SDK\XSDK.H
  526. ---------------
  527. Main header file for Synchronet external programs using the External
  528. program SDK (XSDK). This header file #includes XSDKVARS.C (global variable
  529. declarations) which indirectly #includes XSDKDEFS.H (constants and type
  530. defintions).
  531.  
  532. UIFC\UIFC.H
  533. -----------
  534. Contains constants, macros, type definitions, and function prototypes for
  535. the local console User Interface library. Used by the SCFG, SCBCFG, SMMCFG
  536. and ECHOCFG projects.
  537.  
  538. SPWANO\SPANWO.H
  539. ---------------
  540. Ralf Brown's spawno function prototypes. Used for swaping SBBS.EXE (16-bit
  541. DOS) out of memory.
  542.  
  543.  
  544. C Source File Notes
  545. ===================
  546.  
  547. Overlays
  548. --------
  549. The SBBS project (SBBS.EXE/SBBS4OS2.EXE/SBBS4W32.EXE) contains the largest
  550. number of C source files and has the longest history. For a few years, SBBS.EXE
  551. was a small 16-bit DOS executable that executed completely in memory (no
  552. overlays). With each additional group of features, the executable file
  553. (SBBS.EXE) inevitably increased in size and memory consumption. At one point I
  554. started compiling two separate versions of SBBS.EXE, one with some of the
  555. modules overlaid (dynamically swapped to/from disk), and another without
  556. overlays (faster, but consumed more memory). This was the time with I began to
  557. split off less-commonly called functions into modules that were specifically
  558. overlaid (and given a filename ending in OVL.C, e.g. MAIN.C contains
  559. non-overlaid code, and MAIN_OVL.C contains overlaid code).
  560.  
  561. As the exectuable grew larger and my knowledge and experience with optimization
  562. of overlaid modules grew, I stopped making the non-overlaid version
  563. altogether. The performance difference had become negligible and the memory
  564. consumption of the non-overlaid version was unwieldly. Anyway, the point of
  565. this little story is to help explain why so many of the filenames end in OVL.
  566. Eventually, I ended up overlaying most of the modules (not just the ones named
  567. with OVL). But still, you'll find that the code in the modules with the OVL
  568. names is of the less-frequently executed variety. Only the 16-bit versions of
  569. SBBS.EXE and SCFG.EXE use overlaid modules. All other projects (and the 32-bit
  570. versions of SBBS/SCFG) do not explicitly use overlays.
  571.  
  572. Hi/Mid/Low Level
  573. ----------------
  574. The modules with filenames containing HI (e.g. XFER_HI.C) contain high-level
  575. code (mostly user-interface type functions); modules with filenames containing
  576. MID (e.g. CON_MID.C) contain mid-level code (larger functions that don't
  577. contain direct user-interfaces;, and modules with filenames containing LO
  578. (e.g. XFER_LO.C) contain low-level code (smaller functions called frequently
  579. from mid or high level code).
  580.  
  581. Comments
  582. --------
  583. Please excuse the sparse comments; I never planned on giving the source code
  584. out. The source code that was originally distributed freely (SMB library and
  585. XSDK) is better commented.
  586.  
  587.  
  588. C Source Content Notes
  589. ======================
  590.  
  591. First off, make sure you're using an editor with tab stops set to 4 spaces
  592. for *.C and *.H files (QEdit works nicely), otherwise the source will be mostly
  593. unreadable (don't try to print the files without first exanding all tabs to
  594. 4 space tabstops). All MAKEFILES and other text files use 8 space tab stops.
  595.  
  596. If you're an experienced C programmer, the first thing you'll notice when
  597. examining any of the source code is my somewhat unique style. It's your basic
  598. K&R style C with significantly compressed whitespace. Most notably, I don't
  599. put closing curly braces (}) on their own line (except at the end of a
  600. function). Instead, I use consitent indentation to indicate nested logic and
  601. control flow. Also, I don't indent the base code of a function, but I do indent
  602. automatic variables. And I don't put white space between any operators except
  603. && and ||. This style comes from the usefulness of getting as much code as
  604. possible in an 80x25 window (and saving printer paper). You'll notice, I do use
  605. blank lines to enhance readability, but there are no strict rules I follow in
  606. the blank line department. If my style really bugs you and you just can't get
  607. used to it, then run the source through a C beautifier or other such C
  608. formatting utility (but don't cry if it doesn't compile after that).
  609.  
  610. Example (K&R style):
  611.  
  612. main()
  613. {
  614.     char line[MAXLINE];
  615.     int found = 0;
  616.  
  617.     while (getline(line, MAXLINE) > 0)
  618.     if (strindex(line, pattern) >= 0) {
  619.         printf("%s", line);
  620.         found++;
  621.     }
  622.     return found;
  623. }
  624.  
  625. Example (my style):
  626.  
  627. main()
  628. {
  629.     char line[MAXLINE];
  630.     int found=0;
  631.  
  632. while(getline(line,MAXLINE)>0)
  633.     if(strindex(line,pattern)>=0) {
  634.     printf("%s",line);
  635.     found++; }
  636. return(found);
  637. }
  638.  
  639. If you find blocks of code contained in "#if 0" and "#endif" or "/***" and
  640. "***/", you can safely ignore or even delete this code (the compiler is
  641. ignoring it). For some reason, I found it necessary or preferable to remove or
  642. replace the code in question but wished to leave the old code temporarily
  643. intact in case I changed my mind... I'm not going to be changing me mind. :-)
  644.  
  645. I've deleted all sections of code refering to registration numbers, keys, etc.
  646. If you find some code remaining that appears to require a registration number
  647. or key of some sort, it probably can be safely ignored (unless you've found it
  648. impeding the operation of the program) - but there shouldn't be any.
  649.  
  650.  
  651. Last Minute Updates
  652. ===================
  653.  
  654. The UTI, FIXSMB, QWKNODES, and SBL2SMB/SMB2SBL projects were all converted from
  655. SMBLIB 1.x to 2.x at the last minute. They all compile, but haven't been
  656. tested. The differences between SMBLIB 1.x and 2.x are mainly in the calling
  657. conventions, so these programs should run fine, but I suppose you never know
  658. what could've happened.
  659.  
  660. /* End of SBBS_SRC.DOC */
  661.