home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / TRIBBS / TBAPI501.ZIP / TBAPI.DOC < prev    next >
Text File  |  1994-01-04  |  101KB  |  2,839 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.                                THE TRIBBS (R) API
  33.                                   VERSION 5.01
  34.                           COPYRIGHT (C) 1994 BY TRISOFT
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.                                 COPYRIGHT NOTICE
  74.  
  75.      The TriBBS API is distributed as freeware.  It may be used by
  76.      programmers to write doors and utilities that are compatible with the
  77.      TriBBS Bulletin Board System.  All other use is strictly forbidden.
  78.  
  79.      To keep TriBBS a relatively low cost system for the sysop to run, you
  80.      may NOT charge more than $25 a copy for any software that is developed
  81.      using the TriBBS API without the express written permission of
  82.      TriSoft.
  83.  
  84.      Additionally, you must mention in the documentation for any software
  85.      that you develop using the TriBBS API that the program uses the TriBBS
  86.      API.
  87.  
  88.  
  89.                                     WARRANTY
  90.  
  91.      The TriBBS API is distributed without warranty.  In no event will
  92.      TriSoft be liable to you for damages, including any loss of profits,
  93.      lost savings, or other incidental or consequential damages arising out
  94.      of your use of or inability to use the program, even if TriSoft or an
  95.      authorized representative has been advised of the possibility of such
  96.      damages.  TriSoft will not be liable for any such claim by any other
  97.      party.
  98.  
  99.  
  100.                                 TRADEMARK NOTICE
  101.  
  102.      TriBBS is a registered trademark of TriSoft.
  103.  
  104.      All other trademarks are the property of their respective owners.
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.                                 TABLE OF CONTENTS
  140.  
  141.      INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . . . . . . .  1
  142.  
  143.      FUNDAMENTAL DATA TYPES  . . . . . . . . . . . . . . . . . . . . . .  2
  144.           SHORT  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  145.           USHORT . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  146.           LONG . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  147.           ULONG  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  148.  
  149.      COMPLEX DATA TYPES  . . . . . . . . . . . . . . . . . . . . . . . .  3
  150.           SYSDAT1DATA  . . . . . . . . . . . . . . . . . . . . . . . . .  3
  151.           SYSDAT2DATA  . . . . . . . . . . . . . . . . . . . . . . . . .  7
  152.           NODEDATA . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  153.           USERSDATA  . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  154.           USERSINDEX . . . . . . . . . . . . . . . . . . . . . . . . . . 12
  155.           USERSSUPMESSAGES . . . . . . . . . . . . . . . . . . . . . . . 13
  156.           USERSSUPFILES  . . . . . . . . . . . . . . . . . . . . . . . . 13
  157.           MCONFDATA  . . . . . . . . . . . . . . . . . . . . . . . . . . 14
  158.           MPTRDATA . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
  159.           MIDXDATA . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
  160.           FAREADATA  . . . . . . . . . . . . . . . . . . . . . . . . . . 18
  161.           DOORSTMPDATA . . . . . . . . . . . . . . . . . . . . . . . . . 19
  162.  
  163.      GLOBAL VARIABLES  . . . . . . . . . . . . . . . . . . . . . . . . . 22
  164.           AliasIndex . . . . . . . . . . . . . . . . . . . . . . . . . . 22
  165.           DoorsTmpData . . . . . . . . . . . . . . . . . . . . . . . . . 22
  166.           FAreaData  . . . . . . . . . . . . . . . . . . . . . . . . . . 22
  167.           FAreaFile  . . . . . . . . . . . . . . . . . . . . . . . . . . 22
  168.           IsShare  . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
  169.           MConfData  . . . . . . . . . . . . . . . . . . . . . . . . . . 22
  170.           MConfFile  . . . . . . . . . . . . . . . . . . . . . . . . . . 22
  171.           MIdxData . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
  172.           MIdxFile . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
  173.           MPtrData . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
  174.           MPtrFile . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
  175.           MTxtFile . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
  176.           NodeData . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
  177.           Node1sMainDirectory  . . . . . . . . . . . . . . . . . . . . . 23
  178.           NumberOfFileAreas  . . . . . . . . . . . . . . . . . . . . . . 23
  179.           NumberOfMessageAreas . . . . . . . . . . . . . . . . . . . . . 24
  180.           NumberOfUsers  . . . . . . . . . . . . . . . . . . . . . . . . 24
  181.           SysDat1Data  . . . . . . . . . . . . . . . . . . . . . . . . . 24
  182.           SysDat2Data  . . . . . . . . . . . . . . . . . . . . . . . . . 24
  183.           TBErrorRoutine . . . . . . . . . . . . . . . . . . . . . . . . 24
  184.           UsersData  . . . . . . . . . . . . . . . . . . . . . . . . . . 25
  185.           UsersFile  . . . . . . . . . . . . . . . . . . . . . . . . . . 25
  186.           UsersIndex . . . . . . . . . . . . . . . . . . . . . . . . . . 25
  187.           UsersSupFile . . . . . . . . . . . . . . . . . . . . . . . . . 25
  188.           UsersSupFiles  . . . . . . . . . . . . . . . . . . . . . . . . 25
  189.           UsersSupMessages . . . . . . . . . . . . . . . . . . . . . . . 25
  190.  
  191.  
  192.                                         i
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.      THE TRIBBS API FUNCTIONS  . . . . . . . . . . . . . . . . . . . . . 26
  206.           fsgetc . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
  207.           fsgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
  208.           fsgetstring  . . . . . . . . . . . . . . . . . . . . . . . . . 26
  209.           fsopen . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
  210.           fsprintf . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
  211.           fsputc . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
  212.           fsputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
  213.           fsread . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
  214.           fswrite  . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
  215.           TBBasicSingleToDouble  . . . . . . . . . . . . . . . . . . . . 27
  216.           TBCheckForShareExe . . . . . . . . . . . . . . . . . . . . . . 27
  217.           TBCompress . . . . . . . . . . . . . . . . . . . . . . . . . . 27
  218.           TBGetNextMnnnnIDX  . . . . . . . . . . . . . . . . . . . . . . 28
  219.           TBInitialCaps  . . . . . . . . . . . . . . . . . . . . . . . . 28
  220.           TBInitialize . . . . . . . . . . . . . . . . . . . . . . . . . 28
  221.           TBMakePathName . . . . . . . . . . . . . . . . . . . . . . . . 29
  222.           TBNumberInFAREADAT . . . . . . . . . . . . . . . . . . . . . . 29
  223.           TBNumberInMCONFDAT . . . . . . . . . . . . . . . . . . . . . . 30
  224.           TBNumberInMnnnnIDX . . . . . . . . . . . . . . . . . . . . . . 30
  225.           TBNumberInMnnnnPTR . . . . . . . . . . . . . . . . . . . . . . 30
  226.           TBNumberInUSERSDAT . . . . . . . . . . . . . . . . . . . . . . 30
  227.           TBOpenFAREADAT . . . . . . . . . . . . . . . . . . . . . . . . 30
  228.           TBOpenMCONFDAT . . . . . . . . . . . . . . . . . . . . . . . . 30
  229.           TBOpenMnnnnIDX . . . . . . . . . . . . . . . . . . . . . . . . 30
  230.           TBOpenMnnnnPTR . . . . . . . . . . . . . . . . . . . . . . . . 30
  231.           TBOpenMnnnnTXT . . . . . . . . . . . . . . . . . . . . . . . . 31
  232.           TBOpenUSERSDAT . . . . . . . . . . . . . . . . . . . . . . . . 31
  233.           TBOpenUSERSSUP . . . . . . . . . . . . . . . . . . . . . . . . 31
  234.           TBReadDOORSTMP . . . . . . . . . . . . . . . . . . . . . . . . 31
  235.           TBReadFAREADAT . . . . . . . . . . . . . . . . . . . . . . . . 31
  236.           TBReadMCONFDAT . . . . . . . . . . . . . . . . . . . . . . . . 31
  237.           TBReadMnnnnIDX . . . . . . . . . . . . . . . . . . . . . . . . 32
  238.           TBReadMnnnnPTR . . . . . . . . . . . . . . . . . . . . . . . . 32
  239.           TBReadNODEDAT  . . . . . . . . . . . . . . . . . . . . . . . . 32
  240.           TBReadSYSDAT1DAT . . . . . . . . . . . . . . . . . . . . . . . 32
  241.           TBReadSYSDAT2DAT . . . . . . . . . . . . . . . . . . . . . . . 32
  242.           TBReadUSERSDAT . . . . . . . . . . . . . . . . . . . . . . . . 32
  243.           TBReadUSERSSUP . . . . . . . . . . . . . . . . . . . . . . . . 32
  244.           TBSearchMnnnnIDX . . . . . . . . . . . . . . . . . . . . . . . 33
  245.           TBSearchUSERSIDX . . . . . . . . . . . . . . . . . . . . . . . 33
  246.           TBStrCrc32 . . . . . . . . . . . . . . . . . . . . . . . . . . 33
  247.           TBStripNewline . . . . . . . . . . . . . . . . . . . . . . . . 33
  248.           TBStripSpaces  . . . . . . . . . . . . . . . . . . . . . . . . 33
  249.           TBStrNCrc32  . . . . . . . . . . . . . . . . . . . . . . . . . 33
  250.           TBUncompress . . . . . . . . . . . . . . . . . . . . . . . . . 34
  251.           TBUpdateFromAndTo  . . . . . . . . . . . . . . . . . . . . . . 34
  252.           TBWriteDOORSTMP  . . . . . . . . . . . . . . . . . . . . . . . 34
  253.           TBWriteFAREADAT  . . . . . . . . . . . . . . . . . . . . . . . 34
  254.           TBWriteMCONFDAT  . . . . . . . . . . . . . . . . . . . . . . . 34
  255.           TBWriteMnnnnIDX  . . . . . . . . . . . . . . . . . . . . . . . 34
  256.           TBWriteMnnnnPTR  . . . . . . . . . . . . . . . . . . . . . . . 35
  257.  
  258.                                        ii
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.           TBWriteNODEDAT . . . . . . . . . . . . . . . . . . . . . . . . 35
  272.           TBWriteSYSDAT1DAT  . . . . . . . . . . . . . . . . . . . . . . 35
  273.           TBWriteUSERSDAT  . . . . . . . . . . . . . . . . . . . . . . . 35
  274.           TBWriteUSERSSUP  . . . . . . . . . . . . . . . . . . . . . . . 35
  275.  
  276.      MISCELLANEOUS IMPLEMENTATION NOTES  . . . . . . . . . . . . . . . . 36
  277.           How Files Are Opened . . . . . . . . . . . . . . . . . . . . . 36
  278.           Record Numbers . . . . . . . . . . . . . . . . . . . . . . . . 36
  279.           Calculating CRCs . . . . . . . . . . . . . . . . . . . . . . . 36
  280.  
  281.      DEMO PROGRAMS . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
  282.  
  283.      SUPPORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.                                        iii
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.                                   INTRODUCTION
  338.  
  339.  
  340.      The TriBBS API is intended to assist third-party C/C++ programmers in
  341.      creating doors and utilities that are specific to the TriBBS Bulletin
  342.      Board System.  It contains all of the routines necessary to access the
  343.      system data files.  Additionally, it provides all of the routines
  344.      necessary to access TriBBS's compressed message base.
  345.  
  346.      The TriBBS API is provided as large memory model libraries for the
  347.      following C/C++ compilers:
  348.  
  349.      ======================================================================
  350.      COMPILER                 LIBRARY NAME
  351.      ----------------------------------------------------------------------
  352.      Borland C++              TBAPIBC.LIB
  353.      Symantec C++             TBAPISC.LIB
  354.      Turbo C++                TBAPITC.LIB
  355.      ======================================================================
  356.  
  357.      Other C/C++ compilers may be supported with future versions of the
  358.      API.
  359.  
  360.      IMPORTANT NOTE: The TriBBS data structures are all aligned on byte
  361.      boundaries.  This is the default for both Borland C++ and Turbo C++. 
  362.      However, Symantec C++'s default is to align data structures on word
  363.      boundaries.  Therefore, it is vital that you compile any programs that
  364.      use the TriBBS API with Symantec C++'s -a1 command line switch.  This
  365.      forces Symantec C++ to align data structures on byte boundaries.
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.                                         1
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.                              FUNDAMENTAL DATA TYPES
  404.  
  405.  
  406.      Because 32-bit operating systems are finally starting to become
  407.      popular, programmers should strive to write their programs so that
  408.      they will be portable across platforms without having to worry about
  409.      the word size of the platform.  Under a 16-bit operating system, such
  410.      as DOS, an int is a 16-bit value.  Under a 32-bit operating system,
  411.      such as OS/2 2.x and Windows NT, an int is a 32-bit value. 
  412.      Accordingly, the TriBBS API provides four fundamental data types that
  413.      are intended to ease the porting of TriBBS utilities and doors to 32-
  414.      bit versions of TriBBS that may become available in the future.
  415.  
  416.  
  417.      SHORT
  418.  
  419.      The SHORT data type is used to define signed, 16-bit values.  It is
  420.      defined in TBAPI.H as follows:
  421.  
  422.      typedef short int SHORT;
  423.  
  424.  
  425.      USHORT
  426.  
  427.      The USHORT data type is used to define unsigned, 16-bit values.  It is
  428.      defined in TBAPI.H as follows:
  429.  
  430.      typedef unsigned short int USHORT;
  431.  
  432.  
  433.      LONG
  434.  
  435.      The LONG data type is used to define signed, 32-bit values.  It is
  436.      defined in TBAPI.H as follows:
  437.  
  438.      typedef long LONG;
  439.  
  440.  
  441.      ULONG
  442.  
  443.      The ULONG data type is used to define unsigned, 32-bit values.  It is
  444.      defined in TBAPI.H as follows:
  445.  
  446.      typedef unsigned long ULONG;
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.                                         2
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.                                COMPLEX DATA TYPES
  470.  
  471.  
  472.      Because TriBBS stores a diverse collection of data in its data file,
  473.      the TriBBS API defines several complex data types in TBAPI.H to make
  474.      accessing the TriBBS data files easier.
  475.  
  476.  
  477.      SYSDAT1DATA
  478.  
  479.      The SYSDAT1DATA structure is defined in TBAPI.H as follows:
  480.  
  481.      typedef struct _SYSDAT1DATA {
  482.           char BoardName[41];
  483.           char SysopName[41];
  484.           char BoardStartDate[9];
  485.           char DefaultArchiveExtension[4];
  486.           SHORT TotalNodes;
  487.           SHORT CallsToday;
  488.           SHORT MessagesToday;
  489.           SHORT UploadsToday;
  490.           SHORT DownloadsToday;
  491.           SHORT DefaultDailyTimeLimit;
  492.           SHORT DefaultDailyLogons;
  493.           SHORT DefaultTimePerLogon;
  494.           SHORT MinimumSysopSecurityLevel;
  495.           SHORT NewUserSecurityLevel;
  496.           SHORT NewUserTimeTimeLimit;
  497.           SHORT UploadTimeCompensationRatio;
  498.           SHORT MaximumKeyboardIdleTime;
  499.           LONG TotalCalls;
  500.           SHORT PhoneNumberFlag;
  501.           SHORT TestUploadsFlag;
  502.           SHORT AutoANSIDetectFlag;
  503.           SHORT CheckForWaitingMessagesFlag;
  504.           char SystemPassword[16];
  505.           SHORT ULDLRatioTypeFlag;
  506.           SHORT PhoneOnHookDuringMaintenanceFlag;
  507.           SHORT NoOneWordNamesFlag;
  508.           SHORT NoBulletinMenuAtLogonFlag;
  509.           SHORT AllowAliasesFlag;
  510.           SHORT ClearScreenBeforeMenusFlag;
  511.           SHORT ExactFileNameMatchingForDupesFlag;
  512.           SHORT DisableNewUserBirthdayPrompt;
  513.           SHORT DetailedCallerLogFlag;
  514.           SHORT MajorVersionNumber;
  515.           SHORT MinorVersionNumber;
  516.           SHORT EnableRIPScripEmulationFlag;
  517.           SHORT MinimumFileAttachmentSecurityLevel;
  518.           SHORT MinimumAtVariableSecurityLevel;
  519.           SHORT FastLogonSecurityLevel;
  520.           SHORT UseAliasOrRealNamesFlag;
  521.  
  522.                                         3
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.           SHORT ClearUploadsAndDownloadsFlag;
  536.           SHORT ClearPrivateMessageAreasFlag;
  537.           SHORT ClearPrivateFileAreasFlag;
  538.           char ReservedDataArea[69];
  539.      } SYSDAT1DATA;
  540.  
  541.      The following table defines how the fields that make up SYSDAT1DATA
  542.      are used:
  543.  
  544.      ======================================================================
  545.      FIELD                         DESCRIPTION
  546.      ----------------------------------------------------------------------
  547.      BoardName                     This field holds the BBS's name.
  548.      SysopName                     This field holds the sysop's name.
  549.      BoardStartDate                This field holds the starting date of
  550.                                    the BBS using the format MM/DD/YY.
  551.      DefaultArchiveExtension       This field holds the default archive
  552.                                    extension.  It must be set to ZIP, ARJ,
  553.                                    LZH, PAK, SDN, or ARC.
  554.      TotalNodes                    This field holds the total number of
  555.                                    nodes.
  556.      CallsToday                    This field holds the number of calls for
  557.                                    the day.
  558.      MessagesToday                 This field holds the number of messages
  559.                                    posted for the day.
  560.      UploadsToday                  This field holds the number of files
  561.                                    uploaded for the day.
  562.      DownloadsToday                This field holds the number of files
  563.                                    downloaded for the day.
  564.      DefaultDailyTimeLimit         This field holds the default daily time
  565.                                    limit.
  566.      DefaultDailyLogons            This field holds the default maximum
  567.                                    number of times a caller can call the
  568.                                    BBS in a single day.
  569.      DefaultTimePerLogon           This field holds the default maximum
  570.                                    time a caller is allowed for each
  571.                                    individual call.
  572.      MinimumSysopSecurityLevel     This field holds the minimum security
  573.                                    level a caller must have to be
  574.                                    considered a sysop-level user.
  575.      NewUserSecurityLevel          This field holds the security level
  576.                                    assigned to all new callers.
  577.      NewUserTimeTimeLimit          This field holds the maximum amount of
  578.                                    time a new user is allowed for his first
  579.                                    time on the BBS.
  580.      UploadTimeCompensationRatio   This field holds the ratio that TriBBS
  581.                                    will use when compensating the caller's
  582.                                    time for uploads.
  583.      MaximumKeyboardIdleTime       This field holds the number of minutes
  584.                                    that TriBBS will wait before logging the
  585.                                    caller off for no activity.  This
  586.                                    feature can be disabled by setting this
  587.  
  588.                                         4
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.                                    field to 0.
  602.      TotalCalls                    This field holds the board's total
  603.                                    number of calls.
  604.      PhoneNumberFlag               When this field is set to 0, TriBBS will
  605.                                    use US style phone number using the
  606.                                    format ###-###-####.  When this field is
  607.                                    set to 1, TriBBS will not attempt to
  608.                                    format the phone number in anyway.
  609.      TestUploadsFlag               When this field is set to 1, TriBBS will
  610.                                    check all uploads with its internal
  611.                                    archive checker.  When this field is set
  612.                                    to 0, TriBBS will not check uploads with
  613.                                    its internal archive checker.
  614.      AutoANSIDetectFlag            When this field is set to 1, TriBBS will
  615.                                    automatically check for ANSI terminal
  616.                                    emulation at logon.  When this field is
  617.                                    set to 0, TriBBS will not try to detect
  618.                                    ANSI at logon.
  619.      CheckForWaitingMessagesFlag   When this field is set to 1, TriBBS will
  620.                                    check for waiting messages when a caller
  621.                                    logs on.  When this field is set to 0,
  622.                                    TriBBS will not check for waiting
  623.                                    messages.
  624.      SystemPassword                This field holds the board's system
  625.                                    password.
  626.      ULDLRatioTypeFlag             When this field is set to 0, TriBBS will
  627.                                    adjust the caller's security level
  628.                                    according to the board's upload/download
  629.                                    ratios.  When this field is set to 1,
  630.                                    TriBBS will not allow a caller to
  631.                                    download if he has exceeded his
  632.                                    upload/download ratio.
  633.      PhoneOnHookDuringMaintenanceFlag   When this field is set to 0, TriBBS
  634.                                         will take the phone off the hook
  635.                                         when calling maintenance routines
  636.                                         from the waiting for caller screen. 
  637.                                         When this field is set to 1, TriBBS
  638.                                         will not take the phone off the
  639.                                         hook for maintenance routines.
  640.      NoOneWordNamesFlag            When this field is set to 1, TriBBS will
  641.                                    not allow callers to log on using a one
  642.                                    word name.  When this field is set to 0,
  643.                                    TriBBS will allow callers to log on
  644.                                    using a one word name.
  645.      NoBulletinMenuAtLogonFlag     When this field is set to 1, TriBBS will
  646.                                    not display the bulletin menu to the
  647.                                    caller at logon.  When this field is set
  648.                                    to 0, TriBBS will display the bulletin
  649.                                    menu to the caller at logon.
  650.      AllowAliasesFlag              When this field is set to 1, TriBBS will
  651.                                    allow callers to optionally use an
  652.                                    alias.  When the field is set to 0,
  653.  
  654.                                         5
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.                                    TriBBS will not allow callers to use
  668.                                    aliases.
  669.      ClearScreenBeforeMenusFlag    When this field is set to 1, TriBBS will
  670.                                    clear the screen before it displays a
  671.                                    menu.  When this field is set to 0,
  672.                                    TriBBS will not clear the screen before
  673.                                    it displays a menu.
  674.      ExactFileNameMatchingForDupesFlag  When this field is set to 1, TriBBS
  675.                                         will check for exact matches when
  676.                                         checking for duplicate files.  When
  677.                                         this field is set to 0, TriBBS will
  678.                                         ignore the file extensions when
  679.                                         checking for duplicate files. 
  680.                                         Note: TriBBS will always do exact
  681.                                         file name checking for indexed file
  682.                                         areas.
  683.      DisableNewUserBirthdayPrompt  When this field is set to 1, TriBBS will
  684.                                    not ask for the caller's birthday with
  685.                                    the other new user logon information. 
  686.                                    When this field is set to 0, TriBBS will
  687.                                    ask for the caller's birthday with the
  688.                                    other new user log on information.
  689.      DetailedCallerLogFlag         When this field is set to 1, TriBBS will
  690.                                    log all menu selections in the callers
  691.                                    log.  When the field is set to 0, TriBBS
  692.                                    will not log menu selections in the
  693.                                    callers log.
  694.      MajorVersionNumber            This field holds the major version
  695.                                    number for this version of TriBBS.
  696.      MinorVersionNumber            This field holds the minor version
  697.                                    number for this version of TriBBS.
  698.      EnableRIPScripEmulationFlag   When this field is set to 1, TriBBS will
  699.                                    check for RIPScrip terminal emulation at
  700.                                    log on and allow the use of RIPScrip
  701.                                    display screens throughout the system. 
  702.                                    When this field is set to 0, TriBBS will
  703.                                    disable the use of RIPScrip.
  704.      MinimumFileAttachmentSecurityLevel This field holds the minimum
  705.                                         security level that a caller must
  706.                                         have to attach a file to a message.
  707.      MinimumAtVariableSecurityLevel     This field holds the minimum
  708.                                         security level that a caller must
  709.                                         have to use @-variables in
  710.                                         messages.
  711.      FastLogonSecurityLevel        This field holds the minimum security
  712.                                    level that a caller must have to use
  713.                                    TriBBS's quick logon feature.
  714.      UseAliasOrRealNamesFlag       When this field is set to 1, TriBBS will
  715.                                    use the caller's real name in the who's
  716.                                    on list, in the TeleChat menu, and in
  717.                                    the list of the board's users.  When
  718.                                    this field is set to 0, TriBBS will use
  719.  
  720.                                         6
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.                                    the caller's alias in the who's on list,
  734.                                    in the TeleChat menu, and in the list of
  735.                                    the board's users.
  736.      ClearUploadsAndDownloadsFlag  When this field is set to 1, TriBBS will
  737.                                    clear the caller's number of files
  738.                                    uploaded, number of files downloaded,
  739.                                    number of bytes uploaded, and number of
  740.                                    bytes downloaded when the caller's
  741.                                    subscription expires.  When this field
  742.                                    is set to 0, TriBBS retains all of the
  743.                                    caller's upload/download information
  744.                                    when the caller's subscription expires.
  745.      ClearPrivateMessageAreasFlag  When this field is set to 1, TriBBS will
  746.                                    clear the caller's access to private
  747.                                    message conferences.  When this field is
  748.                                    set to 0, TriBBS will retain all of the
  749.                                    caller's private message conference
  750.                                    access.
  751.      ClearPrivateFileAreasFlag     When this field is set to 1, TriBBS will
  752.                                    clear the caller's access to private
  753.                                    file areas.  When this field is set to
  754.                                    0, TriBBS will retain all of the
  755.                                    caller's private file area access.
  756.      ReservedDataArea              This area is reserved for future use. 
  757.                                    It must always be set to all zeros.
  758.      ======================================================================
  759.  
  760.  
  761.      SYSDAT2DATA
  762.  
  763.      The SYSDAT2DATA structure is defined in TBAPI.H as follows:
  764.  
  765.      typedef struct _SYSDAT2DATA {
  766.           char Node1sMainDirectory[81];
  767.           char ReservedDataArea[175];
  768.      } SYSDAT2DATA;
  769.  
  770.      The following table defines how the fields that make up SYSDAT2DATA
  771.      are used:
  772.  
  773.      ======================================================================
  774.      FIELD                         DESCRIPTION
  775.      ----------------------------------------------------------------------
  776.      Node1sMainDirectory           This field holds node 1's main
  777.                                    directory.
  778.      ReservedDataArea              This area is reserved for future use. 
  779.                                    It must always be set to all zeros.
  780.      ======================================================================
  781.  
  782.  
  783.      NODEDATA
  784.  
  785.  
  786.                                         7
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.      The NODEDATA structure is defined in TBAPI.H as follows:
  800.  
  801.  
  802.      typedef struct _NODEDATA {
  803.           char InitializationString[81];
  804.           char ErrorCorrectingConnectionMessage[5];
  805.           char DateOfLastCall[9];
  806.           SHORT NodeNumber;
  807.           USHORT MaximumBaudRate;
  808.           SHORT SerialPort;
  809.           SHORT No300BaudCallersFlag;
  810.           SHORT No1200BaudCallersFlag;
  811.           SHORT RTSCTSHandshakingFlag;
  812.           SHORT LockSerialPortFlag;
  813.           SHORT DirectScreenWriteFlag;
  814.           SHORT DelayBeforeATA;
  815.           SHORT NumberOfRings;
  816.           SHORT PageBellOnFlag;
  817.           SHORT UseNodeDISPLAYDirectoryFlag;
  818.           SHORT NodeSecurityLevel;
  819.           SHORT No2400BaudCallersFlag;
  820.           SHORT PhoneOffHookDuringEventsFlag;
  821.           SHORT NonStandardIRQNumber;
  822.           char ReservedDataArea[129];
  823.      } NODEDATA;
  824.  
  825.      The following table defines how the fields that make up NODEDATA are
  826.      used:
  827.  
  828.      ======================================================================
  829.      FIELD                         DESCRIPTION
  830.      ----------------------------------------------------------------------
  831.      InitializationString          This field holds the modem's
  832.                                    initialization string.
  833.      ErrorCorrectingConnectionMessage   This field holds the modem's error
  834.                                         correcting connection.
  835.      DateOfLastCall                This field holds the date of the last
  836.                                    call on this node.
  837.      NodeNumber                    This field holds the node's node number.
  838.      MaximumBaudRate               This field holds the node's maximum baud
  839.                                    rate.
  840.      SerialPort                    This field holds the node's serial port
  841.                                    number.
  842.      No300BaudCallersFlag          When this field is set to 1, TriBBS will
  843.                                    not allow 300 baud callers on this node. 
  844.                                    When this field is set to 0, TriBBS will
  845.                                    allow 300 baud callers on this node.
  846.      No1200BaudCallersFlag         When this field is set to 1, TriBBS will
  847.                                    not allow 1200 baud callers on this
  848.                                    node.  When this field is set to 0,
  849.                                    TriBBS will allow 1200 baud callers on
  850.                                    this node.
  851.  
  852.                                         8
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.      RTSCTSHandshakingFlag         When this field is set to 1, TriBBS will
  866.                                    use RTS/CTS handshaking.  When this
  867.                                    field is set to 0, TriBBS will not use
  868.                                    RTS/CTS handshaking.
  869.      LockSerialPortFlag            When this field is set to 1, TriBBS will
  870.                                    lock the serial port.  When this field
  871.                                    is set to 0, TriBBS will not lock the
  872.                                    serial port.
  873.      DirectScreenWriteFlag         When this field is set to 1, TriBBS will
  874.                                    use direct screen writes on a CGA
  875.                                    system.  When this field is set to 0,
  876.                                    TriBBS will not use direct screen writes
  877.                                    on a CGA system.
  878.      DelayBeforeATA                This field holds the tenths of a second
  879.                                    TriBBS will wait after it receives a
  880.                                    CONNECT message before sending the ATA
  881.                                    command to the modem to answer the call.
  882.      NumberOfRings                 This field holds the number of rings
  883.                                    that TriBBS will wait for before
  884.                                    answering the call.
  885.      PageBellOnFlag                When this field is set to 1, the page
  886.                                    bell will be on.  When this field is set
  887.                                    to 0, the page bell will be off.
  888.      UseNodeDISPLAYDirectoryFlag   When this field is set to 1, TriBBS will
  889.                                    use the node's DISPLAY directory to
  890.                                    locate display screens.  When this field
  891.                                    is set to 0, TriBBS will use node 1's
  892.                                    DISPLAY directory to locate display
  893.                                    screens.
  894.      NodeSecurityLevel             This field holds the minimum security
  895.                                    level a caller must have to log onto a
  896.                                    node.
  897.      No2400BaudCallersFlag         When this field is set to 1, TriBBS will
  898.                                    not allow 2400 baud callers.  When this
  899.                                    field is set to 0, TriBBS will allow
  900.                                    2400 baud callers.
  901.      PhoneOffHookDuringEventsFlag  When this field is set to 1, TriBBS will
  902.                                    take the phone off the hook when it runs
  903.                                    an event.  When this field is set to 0,
  904.                                    TriBBS will not take the phone off the
  905.                                    hook during an event.
  906.      NonStandardIRQNumber          When this field is a non-zero value,
  907.                                    TriBBS uses it for the serial port's
  908.                                    nonstandard IRQ setting.  When this
  909.                                    field is set to 0, TriBBS will use the
  910.                                    standard IRQ setting for the serial
  911.                                    port.
  912.      ReservedDataArea              This area is reserved for future use. 
  913.                                    It must always be set to all zeros.
  914.      ======================================================================
  915.  
  916.  
  917.  
  918.                                         9
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.      USERSDATA
  932.  
  933.      The USERSDATA structure is defined in TBAPI.H as follows:
  934.  
  935.      typedef struct _USERSDATA {
  936.           char Name[31];
  937.           char Password[16];
  938.           char CityAndState[31];
  939.           char PhoneNumber[13];
  940.           char Birthday[9];
  941.           char DateOfFirstCall[9];
  942.           char DateAndTimeOfLastCall[15];
  943.           char DateOfLastFileCheck[9];
  944.           SHORT SecurityLevel;
  945.           SHORT NumberOfCalls;
  946.           SHORT TimeLeftForToday;
  947.           SHORT LastMessageConference;
  948.           SHORT LastFileArea;
  949.           SHORT DefaultProtocol;
  950.           SHORT ExpertModeFlag;
  951.           SHORT LockedOutFlag;
  952.           SHORT MarkedForDeletionFlag;
  953.           SHORT NumberOfCallsToday;
  954.           SHORT IncludeLOGON1InQWKFlag;
  955.           SHORT IncludeGOODBYEInQWKFlag;
  956.           SHORT IncludeBulletinsInQWKFlag;
  957.           SHORT IncludeNewFilesInQWKFlag;
  958.           SHORT IncludeNewsletterInQWKFlag;
  959.           SHORT QWKNetworkNode;
  960.           LONG NumberOfFilesUploaded;
  961.           LONG NumberOfFilesDownloaded;
  962.           LONG NumberOfKBytesUploaded;
  963.           LONG NumberOfKBytesDownloaded;
  964.           LONG NumberOfMessagesPosted;
  965.           SHORT DefaultEditor;
  966.           SHORT InitialChatStatus;
  967.           SHORT CheckForWaitingMessagesFlag;
  968.           char SubscriptionExpirationDate[9];
  969.           char Alias[31];
  970.           SHORT NumberOfFilesDownloadedToday;
  971.           LONG NumberOfBytesDownloadedToday;
  972.           char ReservedDataArea[19];
  973.      } USERSDATA;
  974.  
  975.      The following table defines how the fields that make up USERSDATA are
  976.      used:
  977.  
  978.      ======================================================================
  979.      FIELD                         DESCRIPTION
  980.      ----------------------------------------------------------------------
  981.      Name                          This field holds the user's name.
  982.      Password                      This field holds the user's password.
  983.  
  984.                                        10
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.      CityAndState                  This field holds the user's city and
  998.                                    state.
  999.      PhoneNumber                   This field holds the user's phone
  1000.                                    number.
  1001.      Birthday                      This field holds the caller's birthday
  1002.                                    using the format MM/DD/YY.
  1003.      DateOfFirstCall               This field holds the date of the user's
  1004.                                    first call using the format MM/DD/YY.
  1005.      DateAndTimeOfLastCall         This field holds the date and time of
  1006.                                    the user's last call using the format
  1007.                                    MM/DD/YY HH:MM.
  1008.      DateOfLastFileCheck           This field holds the date of the user's
  1009.                                    last file check using the format
  1010.                                    MM/DD/YY.
  1011.      SecurityLevel                 This field holds the user's security
  1012.                                    level.
  1013.      NumberOfCalls                 This field holds the user's number of
  1014.                                    calls.
  1015.      TimeLeftForToday              This field holds the user's number of
  1016.                                    minutes remaining for the day.
  1017.      LastMessageConference         This field holds the user's last message
  1018.                                    conference.
  1019.      LastFileArea                  This field holds the user's last file
  1020.                                    area.
  1021.      DefaultProtocol               This field holds the user's default
  1022.                                    protocol.
  1023.      ExpertModeFlag                When this field is set to 0, the user is
  1024.                                    in novice mode.  When this field is set
  1025.                                    to 1, the user is in expert mode.  When
  1026.                                    this field is set to 2, the user is in
  1027.                                    super expert mode.
  1028.      LockedOutFlag                 When this field is set to 1, the user is
  1029.                                    locked out.  When this field is set to
  1030.                                    0, the user is not locked out.
  1031.      MarkedForDeletionFlag         When this field is set to 1, the user's
  1032.                                    record will be deleted during the next
  1033.                                    packing of the user file.  When this
  1034.                                    field is set to 0, the user's record
  1035.                                    will be retained during the next packing
  1036.                                    of the user file.
  1037.      NumberOfCallsToday            This field holds the user's number of
  1038.                                    calls for the day.
  1039.      IncludeLOGON1InQWKFlag        When this field is set to 1,
  1040.                                    LOGON1.BBS/ANS  will be included in the
  1041.                                    user's QWK packets.
  1042.      IncludeGOODBYEInQWKFlag       When this field is set to 1,
  1043.                                    GOODBYE.BBS/ANS will be included in the
  1044.                                    user's QWK packets.
  1045.      IncludeBulletinsInQWKFlag     When this field is set to 1, any new
  1046.                                    bulletins will be included in the user's
  1047.                                    QWK packets.
  1048.      IncludeNewFilesInQWKFlag      When this field is set to 1, a list of
  1049.  
  1050.                                        11
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.                                    new files will be included in the user's
  1064.                                    QWK packets.
  1065.      IncludeNewsletterInQWKFlag    When this field is set to 1, the
  1066.                                    newsletter will be included in the
  1067.                                    user's QWK packet if it has been updated
  1068.                                    since the user's last call.
  1069.      QWKNetworkNode                When this field is set to 1, the caller
  1070.                                    has net status.  When this field is set
  1071.                                    to 0, the caller doesn't have net
  1072.                                    status.
  1073.      NumberOfFilesUploaded         This field holds the number of files the
  1074.                                    user has uploaded.
  1075.      NumberOfFilesDownloaded       This field holds the number of files the
  1076.                                    user has downloaded.
  1077.      NumberOfKBytesUploaded        This field holds the number of Kbytes
  1078.                                    the user has uploaded.
  1079.      NumberOfKBytesDownloaded      This field holds the number of Kbytes
  1080.                                    the user has downloaded.
  1081.      NumberOfMessagesPosted        This field holds the number of messages
  1082.                                    the user has posted.
  1083.      DefaultEditor                 This field holds the user's default
  1084.                                    editor.
  1085.      InitialChatStatus             This field holds the user's initial chat
  1086.                                    status.
  1087.      CheckForWaitingMessagesFlag   This field holds the user's check for
  1088.                                    waiting messages flag.
  1089.      SubscriptionExpirationDate    This field holds the user's subscription
  1090.                                    expiration data using the format
  1091.                                    MM/DD/YY.  If the caller is not a
  1092.                                    subscriber, this field is set to a null
  1093.                                    string.
  1094.      Alias                         This field holds the user's alias.
  1095.      NumberOfFilesDownloadedToday  This field holds the user's number of
  1096.                                    files downloaded for the day.
  1097.      NumberOfBytesDownloadedToday  This field holds the user's number of
  1098.                                    bytes downloaded for the day.
  1099.      ReservedDataArea              This area is reserved for future use. 
  1100.                                    It must always be set to all zeros.
  1101.      ======================================================================
  1102.  
  1103.  
  1104.      USERSINDEX
  1105.  
  1106.      The USERSINDEX structure is defined in TBAPI.H as follows:
  1107.  
  1108.      typedef struct _USERSINDEX {
  1109.           ULONG Crc;
  1110.           SHORT RecordNumber;
  1111.      } USERSINDEX;
  1112.  
  1113.      The following table defines how the fields that make up USERSINDEX are
  1114.      used:
  1115.  
  1116.                                        12
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.      ======================================================================
  1130.      FIELD                         DESCRIPTION
  1131.      ----------------------------------------------------------------------
  1132.      Crc                           This field holds a CRC value that is
  1133.                                    based on the user's name.
  1134.      RecordNumber                  This field holds the user's record
  1135.                                    number in USERS.DAT.
  1136.      ======================================================================
  1137.  
  1138.  
  1139.      USERSSUPMESSAGES
  1140.  
  1141.      The USERSSUPMESSAGES structure if defined in TBAPI.H as follows:
  1142.  
  1143.      typedef struct _USERSSUPMESSAGES {
  1144.           SHORT QueuedConferenceFlag;
  1145.           SHORT PrivateConferenceFlag;
  1146.           LONG LastMessageRead;
  1147.           SHORT WaitingMessageCounter;
  1148.      } USERSSUPMESSAGES;
  1149.  
  1150.      The following table defines how the fields that make up
  1151.      USERSSUPMESSAGES are used:
  1152.  
  1153.      ======================================================================
  1154.      FIELD                         DESCRIPTION
  1155.      ----------------------------------------------------------------------
  1156.      QueuedConferenceFlag          When this field is set to 1, the user
  1157.                                    has the conference queued.  When this
  1158.                                    field is set to 0, the user doesn't have
  1159.                                    the conference queued.
  1160.      PrivateConferenceFlag         When this field is set to 1, the user
  1161.                                    has access to the private conference. 
  1162.                                    When this field is set to 0, the user
  1163.                                    doesn't have access to the private
  1164.                                    conference.
  1165.      LastMessageRead               This field holds the number of the last
  1166.                                    message the user read in this
  1167.                                    conference.
  1168.      WaitingMessageCounter         This field holds the number of waiting
  1169.                                    messages the user has in this
  1170.                                    conference.
  1171.      ======================================================================
  1172.  
  1173.  
  1174.      USERSSUPFILES
  1175.  
  1176.      The USERSSUPFILES structure is defined in TBAPI.H as follows:
  1177.  
  1178.      typedef struct _USERSSUPFILES {
  1179.           SHORT PrivateAreaFlag;
  1180.      } USERSSUPFILES;
  1181.  
  1182.                                        13
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.      The following table defines how the fields that make up USERSSUPFILES
  1196.      are used:
  1197.  
  1198.      ======================================================================
  1199.      FIELD                         DESCRIPTION
  1200.      ----------------------------------------------------------------------
  1201.      PrivateAreaFlag               When this field is set to 1, the user
  1202.                                    has access to the private file area. 
  1203.                                    When this field is set to 0, the user
  1204.                                    doesn't have access to the private file
  1205.                                    area.
  1206.      ======================================================================
  1207.  
  1208.  
  1209.      MCONFDATA
  1210.  
  1211.      The MCONFDATA structure is defined in TBAPI.H as follows:
  1212.  
  1213.      typedef struct _MCONFDATA{
  1214.           SHORT ReadSecurityLevel;
  1215.           SHORT NetworkedConferenceFlag;
  1216.           SHORT UserDeleteFlag;
  1217.           SHORT TriPackBackupFlag;
  1218.           SHORT TriPackNumberOfDaysToSave;
  1219.           SHORT PrivateConferenceFlag;
  1220.           SHORT FidoStyleNetMailFlag;
  1221.           SHORT AliasConferenceFlag;
  1222.           SHORT PostSecurityLevel;
  1223.           SHORT DisablePrivateMessagesFlag;
  1224.           char ConferenceName[41];
  1225.           char NetworkName[41];
  1226.           LONG HighestMessageNumber;
  1227.           SHORT DisablePublicMessagesFlag;
  1228.           char  ReservedDataArea[148];
  1229.      } MCONFDATA;
  1230.  
  1231.      The following table defines how the fields that make up MCONFDATA are
  1232.      used:
  1233.  
  1234.      ======================================================================
  1235.      FIELD                         DESCRIPTION
  1236.      ----------------------------------------------------------------------
  1237.      ReadSecurityLevel             This field holds the security level that
  1238.                                    the caller must have to read messages in
  1239.                                    this conference.
  1240.      NetworkedConferenceFlag       When this field is set to 1, TriBBS
  1241.                                    treats it as a networked conference. 
  1242.                                    When this field is set to 0, TriBBS
  1243.                                    treats it as a local conference.
  1244.      UserDeleteFlag                When this field is set to 1, TriBBS will
  1245.                                    allow callers to delete messages that
  1246.                                    are addressed either from or to them. 
  1247.  
  1248.                                        14
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.                                    When this field is set to 0, the caller
  1262.                                    must have sysop level to delete
  1263.                                    messages.
  1264.      TriPackBackupFlag             When this field is set to 1, TriPack
  1265.                                    will create backup files for the
  1266.                                    conference when it is packing the
  1267.                                    message base.  When this field is set to
  1268.                                    0, TriPack will not create backup files
  1269.                                    for the conference when it is packing
  1270.                                    the message base.
  1271.      TriPackNumberOfDaysToSave     This field holds the number of days back
  1272.                                    TriPack should save messages for in the
  1273.                                    conference.
  1274.      PrivateConferenceFlag         When this flag is set to 1, the
  1275.                                    conference is private.  When this flag
  1276.                                    is set to 0, the conference is public.
  1277.      FidoStyleNetMailFlag          When this flag is set to 1, TriBBS will
  1278.                                    ask for a Fido-style netmail address
  1279.                                    when the caller enters a message.  When
  1280.                                    this flag is set to 0, TriBBS will not
  1281.                                    ask for a Fido-style netmail address.
  1282.      AliasConferenceFlag           When this flag is set to 1, TriBBS will
  1283.                                    allow aliases to be used in this
  1284.                                    conference.  When this flag is set to 0,
  1285.                                    TriBBS will not allow aliases to be used
  1286.                                    in this conference.
  1287.      PostSecurityLevel             This field holds the minimum security
  1288.                                    level a caller must have to post a
  1289.                                    message in this conference.
  1290.      DisablePrivateMessagesFlag    When this flag is set to 1, TriBBS will
  1291.                                    not allow private messages to be entered
  1292.                                    in this conference.
  1293.      ConferenceName                This field holds the conference's name.
  1294.      NetworkName                   This field holds the conference's
  1295.                                    network name.
  1296.      HighestMessageNumber          This field holds the number of the last
  1297.                                    message posted in this conference.
  1298.      DisablePublicMessagesFlag     When this flag is set to 1, TriBBS will
  1299.                                    not allow public messages to be entered
  1300.                                    in this conference.
  1301.      ReservedDataArea              This area is reserved for future use. 
  1302.                                    It must always be set to all zeros.
  1303.      ======================================================================
  1304.  
  1305.  
  1306.      MPTRDATA
  1307.  
  1308.      The MPTRDATA structure is defined in TBAPI.H as follows:
  1309.  
  1310.      typedef struct MPTRDATA {
  1311.           char DateAndTime[15];
  1312.           char From[31];
  1313.  
  1314.                                        15
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.           char To[31];
  1328.           char Subject[41];
  1329.           SHORT EchoMessageFlag;
  1330.           SHORT ThreadedMessageFlag;
  1331.           SHORT PrivateMessageFlag;
  1332.           SHORT DeletedMessageFlag;
  1333.           SHORT ReceivedMessageFlag;
  1334.           SHORT PermanentMessageFlag;
  1335.           SHORT NetmailFromZone;
  1336.           SHORT NetMailFromNet;
  1337.           SHORT NetMailFromNode;
  1338.           SHORT NetMailFromPoint;
  1339.           SHORT NetMailToZone;
  1340.           SHORT NetMailToNet;
  1341.           SHORT NetMailToNode;
  1342.           SHORT NetMailToPoint;
  1343.           LONG OffsetIntoTextFile;
  1344.           LONG Number;
  1345.           LONG NumberOfMessageThisRepliesTo;
  1346.           char NameOfAttachedFile[81];
  1347.      } MPTRDATA;
  1348.  
  1349.      The following table defines how the fields that make up MPTRDATA are
  1350.      used:
  1351.  
  1352.      ======================================================================
  1353.      FIELD                         DESCRIPTION
  1354.      ----------------------------------------------------------------------
  1355.      DateAndTime                   This field holds the date and time of
  1356.                                    the message using the format MM/DD/YY
  1357.                                    HH:MM.
  1358.      From                          This field holds the name of the person
  1359.                                    who posted the message.
  1360.      To                            This field holds the name of the person
  1361.                                    who the message is posted to.
  1362.      Subject                       This field holds the message's subject.
  1363.      EchoMessageFlag               When this field is set to 1, the message
  1364.                                    should be echoed.  When this field is
  1365.                                    set to 0, the message should not be
  1366.                                    echoed.
  1367.      ThreadedMessageFlag           When this field is set to 1, the message
  1368.                                    has replies.  When this field is set to
  1369.                                    0, the message doesn't have any replies.
  1370.      PrivateMessageFlag            When this field is set to 1, the
  1371.                                    messages is a private message.  When
  1372.                                    this field is set to 0, the message is a
  1373.                                    public message.
  1374.      DeletedMessageFlag            When this field is set to 1, the message
  1375.                                    has been marked for deletion.  When this
  1376.                                    field is set to 0, the message has not
  1377.                                    been marked for deletion.
  1378.      ReceivedMessageFlag           When this field is set to 1, the message
  1379.  
  1380.                                        16
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.                                    has been received by the person it is
  1394.                                    addressed to.  When this field is set to
  1395.                                    0, the message has not been received by
  1396.                                    the person it is addressed to.
  1397.      PermanentMessageFlag          When this field is set to 1, TriPack
  1398.                                    will not delete it.  When this field is
  1399.                                    set to 0, TriPack can delete the
  1400.                                    message.
  1401.      NetmailFromZone               This field holds the zone number the
  1402.                                    message is from if it is in a Fido-style
  1403.                                    netmail conference.  Otherwise, this
  1404.                                    field should be set to 0.
  1405.      NetMailFromNet                This field holds the net number the
  1406.                                    message is from if it is in a Fido-style
  1407.                                    netmail conference.  Otherwise, this
  1408.                                    field should be set to 0.
  1409.      NetMailFromNode               This field holds the node number the
  1410.                                    message is from if it is in a Fido-style
  1411.                                    netmail conference.  Otherwise, this
  1412.                                    field should be set to 0.
  1413.      NetMailFromPoint              This field holds the point number the
  1414.                                    message is from if it is in a Fido-style
  1415.                                    netmail conference.  Otherwise, this
  1416.                                    field should be set to 0.
  1417.      NetMailToZone                 This field holds the zone number the
  1418.                                    message is to if it is a Fido-style
  1419.                                    netmail conference.  Otherwise, this
  1420.                                    field should be set to 0.
  1421.      NetMailToNet                  This field holds the net number the
  1422.                                    message is to if it is a Fido-style
  1423.                                    netmail conference.  Otherwise, this
  1424.                                    field should be set to 0.
  1425.      NetMailToNode                 This field holds the node number the
  1426.                                    message is to if it is a Fido-style
  1427.                                    netmail conference.  Otherwise, this
  1428.                                    field should be set to 0.
  1429.      NetMailToPoint                This field holds the point number the
  1430.                                    message is to if it is a Fido-style
  1431.                                    netmail conference.  Otherwise, this
  1432.                                    field should be set to 0.
  1433.      OffsetIntoTextFile            This field holds the location of the
  1434.                                    message's text in the Mnnnn.TXT file.
  1435.      Number                        This field holds the message's number.
  1436.      NumberOfMessageThisRepliesTo  If this message is a response to a
  1437.                                    previous message, this field will hold
  1438.                                    the number of the original message. 
  1439.                                    Otherwise, this field should be set to
  1440.                                    0.
  1441.      NameOfAttachedFile            Name of an attached file.  Otherwise,
  1442.                                    this field should be set to a null
  1443.                                    string.
  1444.      ======================================================================
  1445.  
  1446.                                        17
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.      MIDXDATA
  1461.  
  1462.      The MIDXDATA structure is defined in TBAPI.H as follows:
  1463.  
  1464.      typedef struct _MIDXDATA {
  1465.           ULONG FromCRC;
  1466.           ULONG ToCRC;
  1467.           LONG Number;
  1468.           LONG NumberOfMessageThisRepliesTo;
  1469.      } MIDXDATA;
  1470.  
  1471.      The following table defines how the fields that make up MIDXDATA are
  1472.      used:
  1473.  
  1474.      ======================================================================
  1475.      FIELD                         DESCRIPTION
  1476.      ----------------------------------------------------------------------
  1477.      FromCRC                       This field holds the CRC of the name of
  1478.                                    the caller who posted the message.
  1479.      ToCRC                         This field holds the CRC of the name of
  1480.                                    the caller the message is posted to.
  1481.      Number                        This field holds the message's number.
  1482.      NumberOfMessageThisRepliesTo  If this message is a response to a
  1483.                                    previous message, this field will hold
  1484.                                    the number of the original message. 
  1485.                                    Otherwise, this field should be set to
  1486.                                    0.
  1487.      ======================================================================
  1488.  
  1489.  
  1490.      FAREADATA
  1491.  
  1492.      The FAREADATA structure is defined in TBAPI.H as follows:
  1493.  
  1494.      typedef struct _FAREADATA{
  1495.           SHORT SecurityLevel;
  1496.           SHORT SortType;
  1497.           SHORT PrivateAreaFlag;
  1498.           char Name[41];
  1499.           char FileAreaPath[81];
  1500.           char FileAreaUploadPath[81];
  1501.           char FileAreaFileList[81];
  1502.           char FileAreaUploadList[81];
  1503.           SHORT CDROMFileAreaFlag;
  1504.           SHORT AliasAreaFlag;
  1505.           char FileAreaIndexFile[81];
  1506.           char AdditionalFileAreaPaths[10][81];
  1507.           char ReservedDataArea[14];
  1508.      } FAREADATA;
  1509.  
  1510.      The following table defines how the fields that make up FAREADATA are
  1511.  
  1512.                                        18
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.      used:
  1526.  
  1527.      ======================================================================
  1528.      FIELD                         DESCRIPTION
  1529.      ----------------------------------------------------------------------
  1530.      SecurityLevel                 This field holds the minimum security
  1531.                                    level that a caller must have to access
  1532.                                    the file area.
  1533.      SortType                      When this field is set to 1, the file
  1534.                                    area is sorted by file name.  When this
  1535.                                    field is set to 0, the file area is
  1536.                                    sorted by date.
  1537.      PrivateAreaFlag               When this field is set to 1, the file
  1538.                                    area is private.  When this field is set
  1539.                                    to 0, the file area is public.
  1540.      Name                          This is the file area's name.
  1541.      FileAreaPath                  This is the file area's directory.
  1542.      FileAreaUploadPath            This is the file area's upload
  1543.                                    directory.
  1544.      FileAreaFileList              This is the name of the file area's file
  1545.                                    list.
  1546.      FileAreaUploadList            This is the name of the file area's
  1547.                                    upload file list.
  1548.      CDROMFileAreaFlag             When this field is set to 1, the file
  1549.                                    area is considered a CD-ROM file area. 
  1550.                                    When this field is set to 0, the file
  1551.                                    area is a regular file area.
  1552.      AliasAreaFlag                 When this field is set to 1, the file
  1553.                                    area is an alias file area.  When this
  1554.                                    field is set to 0, the file area is not
  1555.                                    an alias file area.
  1556.      FileAreaIndexFile             This is the name of the file area's
  1557.                                    index file.
  1558.      AdditionalFileAreaPaths       These are the file area's additional
  1559.                                    directories.
  1560.      ReservedDataArea              This area is reserved for future use. 
  1561.                                    It must be always set to all zeros.
  1562.      ======================================================================
  1563.  
  1564.  
  1565.      DOORSTMPDATA
  1566.  
  1567.      The DOORSTMPDATA structure is defined in TBAPI.H as follows:
  1568.  
  1569.      typedef struct _DOORSTMPDATA {
  1570.           USHORT BaudRate;
  1571.           SHORT ErrorCorrectingConnection;
  1572.           SHORT UserRecordNumber;
  1573.           SHORT TimeLeftAtLogon;
  1574.           SHORT ANSIFlag;
  1575.           SHORT CurrentFileArea;
  1576.           SHORT CurrentMessageConference;
  1577.  
  1578.                                        19
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.           LONG TimeWhenUserLoggedOn;
  1592.           SHORT FrontEnd;
  1593.           USHORT FrontEndBaudRate;
  1594.           SHORT FrontEndHangUpFlag;
  1595.           SHORT UserWindowFlag;
  1596.           SHORT FrontEndTime;
  1597.           SHORT WhereTheDoorWasCalledFrom;
  1598.           SHORT ChatRequested;
  1599.           SHORT EventPendingFleg;
  1600.           SHORT GoodbyeFromDoorFlag;
  1601.           SHORT ForceBoardDownAfterCallFlag;
  1602.           SHORT LanguageNumber;
  1603.           SHORT RIPScripFlag;
  1604.           SHORT NumberOfFilesFlagged;
  1605.           SHORT DOORSYSFlag;
  1606.           SHORT TimeInDOORSYS;
  1607.           char ReservedDataArea[208];
  1608.      } DOORSTMPDATA;
  1609.  
  1610.      The following table defines how the fields that make up DOORSTMPDATA
  1611.      are used:
  1612.  
  1613.      ======================================================================
  1614.      FIELD                         DESCRIPTION
  1615.      ----------------------------------------------------------------------
  1616.      BaudRate                      This field holds the caller's baud rate.
  1617.      ErrorCorrectingConnection     When this field is set to 1, the caller
  1618.                                    achieved an error correcting connection. 
  1619.                                    When this field is set to 0, an error
  1620.                                    correcting connection couldn't be
  1621.                                    achieved.
  1622.      UserRecordNumber              This field holds the caller's record
  1623.                                    number in USERS.DAT.
  1624.      TimeLeftAtLogon               This field holds the number of minutes
  1625.                                    the caller had at log on.
  1626.      ANSIFlag                      When this field is set to 1, the caller
  1627.                                    has ANSI graphics enabled.  When this
  1628.                                    field is set to 0, the caller has ANSI
  1629.                                    graphics disabled.
  1630.      CurrentFileArea               This field holds the number of the
  1631.                                    caller's current file area.
  1632.      CurrentMessageConference      This field holds the number of the
  1633.                                    caller's current message conference.
  1634.      TimeWhenUserLoggedOn          The field holds the time the caller
  1635.                                    logged on at.  This value is in seconds
  1636.                                    elapsed since 00:00:00 GMT, January 1,
  1637.                                    1970.
  1638.      FrontEnd                      When this flag is set to 1, TriBBS was
  1639.                                    called from a frontend program.  When
  1640.                                    this flag is set to 0, TriBBS wasn't
  1641.                                    called from a frontend program.
  1642.      FrontEndBaudRate              This field holds the baud rate that the
  1643.  
  1644.                                        20
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.                                    frontend passed to TriBBS.
  1658.      FrontEndHangUpFlag            When this field is set to 1, TriBBS will
  1659.                                    hang up before returning control to the
  1660.                                    frontend.  When this field is set to 0,
  1661.                                    TriBBS will not hang up before returning
  1662.                                    control to the frontend.
  1663.      UserWindowFlag                When this field is set to 1, the user
  1664.                                    status window is being displayed at the
  1665.                                    bottom of the display screen.  When this
  1666.                                    field is set to 0, the user status
  1667.                                    window is not being displayed.
  1668.      FrontEndTime                  This field holds the time in minutes
  1669.                                    until the frontend's next event.
  1670.      WhereTheDoorWasCalledFrom     This field holds a value that tells
  1671.                                    TriBBS where the door was called from
  1672.      ChatRequested                 When this field is set to 1, the caller
  1673.                                    has requested a chat.  When this field
  1674.                                    is set to 0, the caller hasn't requested
  1675.                                    a chat.
  1676.      EventPendingFlag              When this field is set to 1, there is an
  1677.                                    event pending.  When this field is set
  1678.                                    to 0, there isn't an event pending.
  1679.      GoodbyeFromDoorFlag           TriBBS always sets this field to 0.  If
  1680.                                    the door wants to force a goodbye, then
  1681.                                    it should change this field to a 1.
  1682.      ForceBoardDownAfterCallFlag   When this field is set to 1, TriBBS will
  1683.                                    force the board down after the current
  1684.                                    caller logs off.  When this field is set
  1685.                                    to 0, TriBBS will continue operating as
  1686.                                    normal.
  1687.      LanguageNumber                This field holds the number of the
  1688.                                    language the user selected at logon.
  1689.      RIPScripFlag                  When this field is set to 1, the caller
  1690.                                    has RIPScrip terminal emulation enabled. 
  1691.                                    When this field is set to 0, the caller
  1692.                                    doesn't have RIPScrip terminal emulation
  1693.                                    enabled.
  1694.      NumberOfFilesFlagged          This field holds the number of files
  1695.                                    flagged.
  1696.      DOORSYSFlag                   When this field is set to 1, TriBBS
  1697.                                    created DOOR.SYS before calling the
  1698.                                    door.  When this field is set to 0,
  1699.                                    TriBBS didn't create DOOR.SYS before
  1700.                                    calling the door.
  1701.      TimeInDOORSYS                 This is the number of minutes the caller
  1702.                                    had remaining when he entered a door and
  1703.                                    TriBBS generated a DOOR.SYS file.
  1704.      ReservedDataArea              This area is reserved for future use. 
  1705.                                    It must always be set to all zeros.
  1706.      ======================================================================
  1707.  
  1708.  
  1709.  
  1710.                                        21
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.                                 GLOBAL VARIABLES
  1724.  
  1725.  
  1726.      The TriBBS API features a number of useful global variables.  These
  1727.      global variables are mainly intended to make accessing the TriBBS data
  1728.      files easier.
  1729.  
  1730.  
  1731.      USERSINDEX *AliasIndex
  1732.  
  1733.      The AliasIndex global variable is defined as a pointer to a structure
  1734.      of type USERSINDEX.  It is mainly used internally by the TriBBS API to
  1735.      point to an array of USERSINDEX structures that make up the ALIAS.IDX
  1736.      data file.
  1737.  
  1738.      DOORSTMPDATA DoorsTmpData
  1739.  
  1740.      The DoorsTmpData global variable is defined as a structure of type
  1741.      DOORSTMPDATA.  Its main purpose is to access data in the DOORS.TMP
  1742.      data file.
  1743.  
  1744.  
  1745.      FAREADATA FAreaData
  1746.  
  1747.      The FAreaData global variable is defined as a structure of type
  1748.      FAREADATA.  Its main purpose is to access data in the FAREA.DAT data
  1749.      file.
  1750.  
  1751.  
  1752.      FILE *FAreaFile
  1753.  
  1754.      The FAreaFile global variable is defined as a pointer to a structure
  1755.      of type FILE.  Its main purpose is to access the FAREA.DAT data file.
  1756.  
  1757.  
  1758.      SHORT IsShare
  1759.  
  1760.      The IsShare global variable is defined as a SHORT.  IsShare is used to
  1761.      indicate if SHARE.EXE is loaded.  IsShare is initially set to 0, but
  1762.      TBInitialize() calls the proper DOS function to detect if SHARE.EXE is
  1763.      loaded.  If SHARE.EXE is loaded, IsShare will be set to 1.  Otherwise,
  1764.      IsShare will be set to 0.
  1765.  
  1766.  
  1767.      MCONFDATA MConfData
  1768.  
  1769.      The MConfData global variable is defined as a structure of type
  1770.      MCONFDATA.  Its main purpose is to access data in the MCONF.DAT data
  1771.      file.
  1772.  
  1773.  
  1774.      FILE *MConfFile
  1775.  
  1776.                                        22
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.      The MConfFile global variable is defined as a pointer to a structure
  1790.      of type FILE.  Its main purpose is to access the MCONF.DAT data file.
  1791.  
  1792.  
  1793.      MIDXDATA MIdxData
  1794.  
  1795.  
  1796.      The MIdxData global variable is defined as a structure of type
  1797.      MIDXDATA.  Its main purpose is to access data in the Mnnnn.IDX data
  1798.      files.
  1799.  
  1800.  
  1801.      FILE *MIdxFile
  1802.  
  1803.      The MIdxFile global variable is defined as a pointer to a structure of
  1804.      type FILE.  Its main purpose is to access the Mnnnn.IDX data files.
  1805.  
  1806.  
  1807.      MPTRDATA  MPtrData
  1808.  
  1809.      The MPtrData global variable is defined as a structure of type
  1810.      MPTRDATA.  Its main purpose is to access data in Mnnnn.PTR data files.
  1811.  
  1812.  
  1813.      FILE *MPtrFile
  1814.  
  1815.      The MPtrFile global variable is defined as a pointer to a structure of
  1816.      type FILE.  Its main purpose is to access the Mnnnn.PTR data files.
  1817.  
  1818.  
  1819.      FILE *MTxtFile
  1820.  
  1821.      The MTxtFile global variable is defined as a pointer to a structure of
  1822.      type FILE.  Its main purpose is to access the Mnnnn.TXT data files.
  1823.  
  1824.  
  1825.      NODEDATA NodeData
  1826.  
  1827.      The NodeData global variable is defined as a structure of type
  1828.      NODEDATA.  Its main purpose is to access data in the NODE.DAT data
  1829.      file.
  1830.  
  1831.  
  1832.      char Node1sMainDirectory[81]
  1833.  
  1834.      The Node1sMainDirectory global variable is defined as an array of char
  1835.      with a length of 81.  It is used by the application program to set the
  1836.      location of node 1's main directory.  This variable must be set before
  1837.      the application program calls TBInitialize().
  1838.  
  1839.  
  1840.      SHORT NumberOfFileAreas
  1841.  
  1842.                                        23
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.      The NumberOfFileAreas global variable is set to the board's number of
  1856.      file areas by TBInitialize().  This variable's value is undefined
  1857.      before TBInitialize() is called.
  1858.  
  1859.  
  1860.      SHORT NumberOfMessageAreas
  1861.  
  1862.      The NumberOfMessageAreas global variable is set to the board's number
  1863.      of message areas by TBInitialize().  This variable's value is
  1864.      undefined before TBInitialize() is called.
  1865.  
  1866.  
  1867.      SHORT NumberOfUsers
  1868.  
  1869.      The NumberOfUses global variable is set to the board's number of users
  1870.      by TBInitialize().  This variable's value is undefined before
  1871.      TBInitialize() is called.
  1872.  
  1873.  
  1874.      SHORT SupplementalLength
  1875.  
  1876.      The SupplementalLength global variable is set to the record length for
  1877.      board's USERS.SUP file by TBInitialize().  This variable's value is
  1878.      undefined before TBInitialize() is called.
  1879.  
  1880.  
  1881.      SYSDAT1DATA SysDat1Data
  1882.  
  1883.      The SysDat1Data global variable is defined as a structure of type
  1884.      SYSDAT1DATA.  Its main purpose is to access data in the SYSDAT1.DAT
  1885.      data file.
  1886.  
  1887.  
  1888.      SYSDAT2DATA SysDat2Data
  1889.  
  1890.      The SysDat2Data global variable is defined as a structure of type
  1891.      SYSDAT2DATA.  Its main purpose is to access data in the SYSDAT2.DAT
  1892.      data file.
  1893.  
  1894.  
  1895.      void (*TBErrorRoutine)(char *f, ...)
  1896.  
  1897.      The TBErrorRoutine global variable is a pointer to a function of type
  1898.      void (*)(char *, ...).  It is a hook into the API so that the
  1899.      programmer can define a customized error routine for his application
  1900.      program.  By default, the TBErrorRoutine points to the following
  1901.      function, which simply does a printf() and then aborts the program:
  1902.  
  1903.      void TBDefaultErrorRoutine(char *f, ...)
  1904.      {
  1905.           va_list m;
  1906.           char *s, *b;
  1907.  
  1908.                                        24
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.           s = b = (char *)malloc(1024);
  1922.           va_start(m, f);
  1923.           vsprintf(s, f, m);
  1924.           printf(s);
  1925.           free(b);
  1926.           va_end(m);
  1927.           exit(1)
  1928.      }
  1929.  
  1930.  
  1931.      USERSDATA UsersData
  1932.  
  1933.      The UsersData global variable is defined as a structure of type
  1934.      USERSDATA.  Its main purpose is to access the data in the USERS.DAT
  1935.      file.
  1936.  
  1937.  
  1938.      FILE *UsersFile
  1939.  
  1940.      The UsersFile global variable is defined as a pointer to a structure
  1941.      of type FILE.  Its main purpose is to access the USERS.DAT file.
  1942.  
  1943.  
  1944.      USERSINDEX *UsersIndex
  1945.  
  1946.      The UsersIndex global variable is defined as a pointer to a structure
  1947.      of type USERSINDEX.  It is mainly used internally by the TriBBS API to
  1948.      point to an array of USERSINDEX structures that make up the USERS.IDX
  1949.      data file.
  1950.  
  1951.  
  1952.      FILE *UsersSupFile
  1953.  
  1954.      The UsersSupFile global variable is defined as a pointer to a
  1955.      structure of type FILE.  Its main purpose is to access the USERS.SUP
  1956.      data file.
  1957.  
  1958.  
  1959.      USERSSUPFILES *UsersSupFiles
  1960.  
  1961.      The UsersSupFiles global variable is defined as a pointer to a
  1962.      structure of type USERSSUPFILES.  It is mainly used internally by the
  1963.      TriBBS API to access data in the USERS.SUP data file.
  1964.  
  1965.  
  1966.      USERSSUPMESSAGES *UsersSupMessages
  1967.  
  1968.      The UsersSupMessages global variable is defined as a pointer to a
  1969.      structure of type USERSSUPMESSAGES.  It is mainly used internally by
  1970.      the TriBBS API to access data in the USERS.SUP data file.
  1971.  
  1972.  
  1973.  
  1974.                                        25
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.                             THE TRIBBS API FUNCTIONS
  1988.  
  1989.  
  1990.      This section describes each function that make up the TriBBS API.
  1991.  
  1992.  
  1993.      int fsgetc(FILE *stream)
  1994.  
  1995.      The fsgetc function is functionally equivalent to the normal fgetc C
  1996.      runtime library function.  However, fsgetc will lock and unlock the
  1997.      file if file sharing is necessary.
  1998.  
  1999.  
  2000.      char *fsgets(char *s, int n, FILE *stream)
  2001.  
  2002.      The fsgets function if functionally equivalent to the normal fgets C
  2003.      runtime library function.  However, fsgets will lock and unlock the
  2004.      file if file sharing is necessary.
  2005.  
  2006.  
  2007.      char *fsgetstring(char *s, int n, FILE *stream)
  2008.  
  2009.      The fsgetstring function is similar to the fsgets function.  Instead
  2010.      of stopping at the first newline character, the fsgetstring function
  2011.      stops at the first null character (0x00).
  2012.  
  2013.  
  2014.      FILE *fsopen(const char *filename, const char *mode, int shflg)
  2015.  
  2016.      The fsopen function is similar to the normal fsopen C runtime library
  2017.      function.  However, the "shflg" parameter is used to specify the file
  2018.      sharing that is allowed on the file.  Once the file is opened, all
  2019.      subsequent tasks much open the file in a compatible file sharing mode. 
  2020.      The shflg function can be any one of the following constants, which
  2021.      are defined in share.h:
  2022.  
  2023.      SH_COMPAT           DOS compatibility mode.  This is the way DOS
  2024.                          normally opens a file.
  2025.      SH_DENYRW           Denies read/write access.
  2026.      SH_DENYWR           Denies write access.
  2027.      SH_DENYRD           Denies read access.
  2028.      SH_DENYNO           Permits read/write access.
  2029.      SH_DENYNONE         Permits read/write access.  (Not all compilers
  2030.                          define this in their share.h file, but it is the
  2031.                          same as SH_DENYNO.)
  2032.  
  2033.  
  2034.      int fsprintf(FILE *stream, char *f, ...)
  2035.  
  2036.      The fsprintf function is functionally equivalent to the normal C
  2037.      runtime library fprintf function.  However, the fsprintf function will
  2038.      properly lock and unlock the file if file sharing is in use.
  2039.  
  2040.                                        26
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.      int fsputc(int c, FILE *stream)
  2055.  
  2056.      The fsputc function is functionally equivalent to the normal C runtime
  2057.      library fputc function.  However, the fsputc function will lock and
  2058.      unlock the file if file sharing is in use.
  2059.  
  2060.  
  2061.      int fsputs(char *s, FILE *stream)
  2062.  
  2063.      The fsputs function is functionally equivalent to the normal C runtime
  2064.      library fputs function.  However, the fsputs function will lock and
  2065.      unlock the file if file sharing is in use.
  2066.  
  2067.  
  2068.      size_t fsread(void *ptr, size_t size, size_t n, FILE *stream)
  2069.  
  2070.      The fsread function is functionally equivalent to the normal C runtime
  2071.      library fread function.  However, the fsread function will lock and
  2072.      unlock the file if file sharing is in use.
  2073.  
  2074.  
  2075.      size_t fswrite(const void *ptr, size_t size, size_t n, FILE *stream)
  2076.  
  2077.      The fswrite function is functionally equivalent to the normal C
  2078.      runtime library fwrite function.  However, the fswrite function will
  2079.      lock and unlock the file if file sharing is in use.
  2080.  
  2081.  
  2082.      double TBBasicSingleToDouble(BASICSINGLE OldNumber)
  2083.  
  2084.      The TBBasicSingleToDouble function converts the Microsoft Basic single
  2085.      precision number passed in the "Old Number" parameter to a double. 
  2086.      The converted value is returned by the TBBasicSingleToDouble function. 
  2087.      This function is primarily intended to help programmers who wish to
  2088.      write QWK mail handlers for TriBBS.
  2089.  
  2090.  
  2091.      SHORT TBCheckForShareExe(void)
  2092.  
  2093.      The TBCheckForShareExe function checks with DOS to see if SHARE.EXE is
  2094.      loaded.  TBCheckForShareExe will set the IsShare global variable to
  2095.      the appropriate value.  You should note that TBCheckForShareExe is
  2096.      called by TBInitialize so it is not usually used in an application
  2097.      program.
  2098.  
  2099.  
  2100.      LONG TBCompress(unsigned char *cib, SHORT cil,
  2101.           unsigned char *cob, unsigned char *wb)
  2102.  
  2103.      The TBCompress function compresses the message pointed to by the "cib"
  2104.      parameter whose length is passed in the "cil" parameter.  The result
  2105.  
  2106.                                        27
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.      is placed in the buffer pointed to by the "cob" parameter.  The TriBBS
  2120.      API's compression routine requires a work buffer pointed to by the
  2121.      "wb" parameter.  You should note that the "cib", "cob", and "wb" must
  2122.      all be at least 40000 bytes in length.  The length of the compressed
  2123.      message is returned by the TBCompress function.
  2124.  
  2125.  
  2126.      void TBDoubleToBasicSingle(BASICSINGLE *New, double Old)
  2127.  
  2128.      The TBDoubleToBasicSingle function converts a double passed in the
  2129.      "Old" parameter into a Microsoft Basic single precision number.  The
  2130.      converted value is returned in the variable location pointed to by
  2131.      "New".  This function is primarily intended to help programmers who
  2132.      wish to write QWK mail handlers for TriBBS.
  2133.  
  2134.  
  2135.      SHORT TBGetNextMnnnnIDX(LONG n)
  2136.  
  2137.      The TBGetNextMnnnnIDX function performs a combination binary and
  2138.      linear search of the currently opened Mnnnn.IDX file for the location
  2139.      of the next message that is greater than or equal to the message
  2140.      number passed in the "n" parameter.  If the next message is found,
  2141.      TBGetNextMnnnnIDX will return the location in the Mnnnn.IDX file of
  2142.      its location.  Otherwise, the TBGetNextMnnnnIDX function will return -
  2143.      1 to indicate that there is no message greater than or equal to the
  2144.      passed message number.  The Mnnnn.IDX file must be opened with the
  2145.      TBOpenMnnnnIDX function before the TBGetNextMnnnnIDX function is
  2146.      called.
  2147.  
  2148.  
  2149.      char *TBInitialCaps(char *s)
  2150.  
  2151.      The TBInitialCaps function forces the first character of each word to
  2152.      upper case and the remaining characters of each word to lower case in
  2153.      the string pointed to by the "s" parameter.  The TBInitialCaps
  2154.      parameter returns the location passed by the "s" parameter.
  2155.  
  2156.  
  2157.      void TBInitialize(void)
  2158.  
  2159.      The TBInitialize function initializes the TriBBS API by performing the
  2160.      following tasks:
  2161.  
  2162.           1) Check for SHARE.EXE by calling TBCheckForShareExe.
  2163.  
  2164.           2) Determine the number of message areas and set the
  2165.           NumberOfMessageAreas global variable accordingly.
  2166.  
  2167.           3) Determine the number of file areas and set the
  2168.           NumberOfFileAreas global variable accordingly.
  2169.  
  2170.           4) Figure the length of each record in USERS.SUP and set the
  2171.  
  2172.                                        28
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.           SupplementalLength global variable accordingly.
  2186.  
  2187.           5) Allocate any necessary buffer space to read and write the
  2188.           message area information of the USERS.SUP records.
  2189.  
  2190.           6) Allocate any necessary buffer space to read and write the file
  2191.           area information of the USERS.SUP records.
  2192.  
  2193.           7) Open USERS.DAT.
  2194.  
  2195.           7) Determine the number of users and set the NumberOfUsers global
  2196.           variable accordingly.
  2197.  
  2198.           8) Allocate buffer space and read USERS.IDX into memory.
  2199.  
  2200.           9) If aliases are allowed, allocate buffer space and read
  2201.           ALIAS.IDX into memory.
  2202.  
  2203.           10) Open USERS.SUP.
  2204.  
  2205.      IMPORTANT: The TBInitialize function should be just about the first
  2206.      function you call.  The behavior of the API functions is undefined if
  2207.      you try to use them before calling TBInitialize.
  2208.  
  2209.      IMPORTANT: You must set the value of the Node1sMainDirectory global
  2210.      variable before calling TBInitialize.  If the application program is
  2211.      run from a directory that contains SYSDAT2.DAT, it is safe to call the
  2212.      TBReadSYSDAT2DAT function to use SysDat2Dat.Node1sMainDirectory field
  2213.      to set the Node1sMainDirectory.
  2214.  
  2215.      IMPORTANT: The TBInitialize function leaves both USERS.DAT and
  2216.      USERS.SUP in an open state.  You should NOT reopen these files unless
  2217.      you have closed them for some reason in your application program. 
  2218.      Many of the API functions require that these two files be in an open
  2219.      state so behavior of the API is undefined if either of these files is
  2220.      closed.
  2221.  
  2222.  
  2223.      char *TBMakePathName(char *buffer, char *path, char *file)
  2224.  
  2225.      The TBMakePathName function is used combine a directory, passed in the
  2226.      the "path" parameter, and a file name, passed in the "file" parameter,
  2227.      into a single path name.  The resulting string will be placed in the
  2228.      location pointed to by the "buffer" parameter.  The TBMakePathName
  2229.      returns the starting location of the string result.
  2230.  
  2231.  
  2232.      SHORT TBNumberInFAREADAT(void)
  2233.  
  2234.      The TBNumberInFAREADAT function returns the number of records in the
  2235.      FAREA.DAT file.  The FAREA.DAT file must already be open for this
  2236.      function to return the proper value.
  2237.  
  2238.                                        29
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.      SHORT TBNumberInMCONFDAT(void)
  2253.  
  2254.      The TBNumberInMCONFDAT function returns the number of records in the
  2255.      MCONF.DAT file.  The FAREA.DAT file must already be open for this
  2256.      function to return the proper value.
  2257.  
  2258.  
  2259.      SHORT TBNumberInMnnnnIDX(void)
  2260.  
  2261.      The TBNumberInMnnnnIDX function returns the number of records in the
  2262.      currently open Mnnnn.IDX file.  As such, a Mnnnn.IDX file must already
  2263.      be open for the function to return the proper value.
  2264.  
  2265.  
  2266.      SHORT TBNumberInMnnnnPTR(void)
  2267.  
  2268.      The TBNumberInMnnnnPTR function returns the number of records in the
  2269.      currently open Mnnnn.PTR file.  As such, a Mnnnn.PTR file must already
  2270.      be open for the function to return the proper value.
  2271.  
  2272.  
  2273.      SHORT TBNumberInUSERSDAT(void)
  2274.  
  2275.      The TBNumberInUSERSDAT function returns the number of records in the
  2276.      USERS.DAT file.  The USERS.DAT function must already be open for this
  2277.      function to return the proper value.
  2278.  
  2279.  
  2280.      void TBOpenFAREADAT(void)
  2281.  
  2282.      The TBOpenFAREADAT function opens the FAREA.DAT file and assigns the
  2283.      file's FILE pointer to the FAreaFile global variable.
  2284.  
  2285.  
  2286.      void TBOpenMCONFDAT(void)
  2287.  
  2288.      The TBOpenMCONFDAT function opens the MCONF.DAT file and assigns the
  2289.      file's FILE pointer to the MConfFile global variable.
  2290.  
  2291.  
  2292.      void TBOpenMnnnnIDX(SHORT n)
  2293.  
  2294.      The TBOpenMnnnnIDX function opens the Mnnnn.IDX file specified by the
  2295.      "n" parameter and assigns the file's FILE pointer to the MIdxFile
  2296.      global variable.
  2297.  
  2298.  
  2299.  
  2300.      void TBOpenMnnnnPTR(SHORT n)
  2301.  
  2302.      The TBOpenMnnnnPTR function opens the Mnnnn.PTR file specified by the
  2303.  
  2304.                                        30
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.      "n" parameter and assigns the file's FILE pointer to the MPtrFile
  2318.      global variable.
  2319.  
  2320.  
  2321.  
  2322.      void TBOpenMnnnnTXT(SHORT n)
  2323.  
  2324.      The TBOpenMnnnnTXT function opens the Mnnnn.TXT file specified by the
  2325.      "n" parameter and assigns the file's FILE pointer to the MTxtFile
  2326.      global variable.
  2327.  
  2328.  
  2329.      void TBOpenUSERSDAT(void)
  2330.  
  2331.      The TBOpenUSERSDAT function opens the USERS.DAT file and assigns the
  2332.      file's FILE pointer to the UsersFile global variable.  You should note
  2333.      that TBInitialize leaves the USERS.DAT file in an open state when it
  2334.      returns; therefore, it is not normally necessary to reopen USERS.DAT.
  2335.  
  2336.  
  2337.      void TBOpenUSERSSUP(void)
  2338.  
  2339.      The TBOpenUSERSSUP function opens the USERS.SUP file and assigns the
  2340.      file's FILE pointer to the UsersSupFile global variable.  You should
  2341.      note that TBInitialize leaves the USERS.SUP in a state when it
  2342.      returns; therefore, it is not normally necessary to reopen USERS.SUP.
  2343.  
  2344.  
  2345.      void TBReadDOORSTMP(char *s)
  2346.  
  2347.      The TBReadDOORSTMP function opens, reads, and closes the DOORS.TMP
  2348.      file located in the directory specified by the "s" parameter.  The
  2349.      contents of the DOORS.TMP file will be placed in the DoorsTmpData
  2350.      global variable.
  2351.  
  2352.  
  2353.      void TBReadFAREADAT(SHORT n)
  2354.  
  2355.      The TBReadFAREADAT function reads the record for the file area
  2356.      specified by the "n" parameter.  The contents of the file area's
  2357.      record will be placed in the FAreaData global variable.  The FAREA.DAT
  2358.      file must be open for this function to work properly.
  2359.  
  2360.  
  2361.      void TBReadMCONFDAT(SHORT n)
  2362.  
  2363.      The TBReadMCONFDAT function reads the record for the message
  2364.      conference specified by the "n" parameter.  The contents of the
  2365.      message conference's record will be placed in the MConfData global
  2366.      variable.  The MCONF.DAT file must be open for this function to work
  2367.      properly.
  2368.  
  2369.  
  2370.                                        31
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.      void TBReadMnnnnIDX(SHORT n)
  2384.  
  2385.      The TBReadMnnnnIDX function reads the message index record specified
  2386.      by the "n" parameter.  The contents of the message index record will
  2387.      be placed in the MIdxData global variable.  The Mnnnn.IDX file must be
  2388.      open for this function to work properly.
  2389.  
  2390.  
  2391.      void TBReadMnnnnPTR(SHORT n)
  2392.  
  2393.      The TBReadMnnnnPTR function reads the message pointer record specified
  2394.      by the "n" parameter.  The contents of the message pointer record will
  2395.      be placed in the MPtrData global variable.  The Mnnnn.PTR function
  2396.      must be open for this function to work properly.
  2397.  
  2398.  
  2399.      void TBReadNODEDAT(void)
  2400.  
  2401.      The TBReadNODEDAT function opens, reads, and closes the NODE.DAT file
  2402.      in the current directory.  The contents of the NODE.DAT file will be
  2403.      placed in the NodeData global variable.
  2404.  
  2405.  
  2406.      void TBReadSYSDAT1DAT(void)
  2407.  
  2408.      The TBReadSYSDAT1DAT function opens, reads, and closes the SYSDAT1.DAT
  2409.      file located in the directory pointed to by the Node1sMainDirectory
  2410.      global variable.  The contents of the SYSDAT1.DAT file will be placed
  2411.      in the SysDat1Data global variable.
  2412.  
  2413.  
  2414.      void TBReadSYSDAT2DAT(void)
  2415.  
  2416.      The TBReadSYSDATA2.DAT function opens, reads, and closes the
  2417.      SYSDAT2.DAT file in the current directory.  The contents of the
  2418.      SYSDAT2.DAT file will be placed in the SysDat2Data global variable.
  2419.  
  2420.  
  2421.      void TBReadUSERSDAT(SHORT n)
  2422.  
  2423.      The TBReadUSERSDAT function reads the record for the user specified by
  2424.      the "n" parameter.  The contents of the user's record will be placed
  2425.      in the UsersData global variable.
  2426.  
  2427.  
  2428.      void TBReadUSERSSUP(SHORT n)
  2429.  
  2430.      The TBReadUSERSSUP function reads the supplemental record for the user
  2431.      specified by the "n" parameter.  The contents of the message
  2432.      conference portion of the user's supplemental record will be placed in
  2433.      the buffer area pointed to by UsersSupMessages.  You should note that
  2434.      the buffer area pointed to by UsersSupMessages is allocated by
  2435.  
  2436.                                        32
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.      TBInitialize.  The contents of the file area portion of the user's
  2450.      supplemental record will be placed in the buffer area pointed to by
  2451.      UsersSupFiles.  You should note that the buffer area pointed to by
  2452.      UsersSupFiles is allocated by TBInitialize.
  2453.  
  2454.  
  2455.      SHORT TBSearchMnnnnIDX(LONG n)
  2456.  
  2457.      The TBSearchMnnnnIDX function searches the currently open Mnnnn.IDX
  2458.      file for the message whose number is specified by the "n" parameter. 
  2459.      If the TBSearchMnnnnIDX function successfully locates the specified
  2460.      message, it will return the message's record number.  Otherwise, the
  2461.      TBSearchMnnnnIDX function return -1 to indicate that the specified
  2462.      message wasn't found.
  2463.  
  2464.  
  2465.      SHORT TBSearchUSERSIDX(ULONG n)
  2466.  
  2467.      The TBSearchUSERSIDX function searches USERS.IDX for the CRC specified
  2468.      by the "n" parameter.  If the board allows aliases, the
  2469.      TBSearchUSERSIDX function will search the ALIAS.IDX file for the
  2470.      specified CRC if it wasn't found in the USERS.IDX file.  If the
  2471.      TBSearchUSERSIDX function locates the specified CRC, it will return
  2472.      the user's record number.  Otherwise, the TBSearchUSERSIDX function
  2473.      returns -1 to indicate that the specified CRC wasn't found.
  2474.  
  2475.  
  2476.      ULONG TBStrCrc32(char *s)
  2477.  
  2478.      The TBStrCrc32 function calculates and returns the CRC for the string
  2479.      specified by the "s" parameter.
  2480.  
  2481.  
  2482.      void TBStripNewline(char *s)
  2483.  
  2484.      The TBStripNewLine function will strip a newline character (\n), if
  2485.      any, from the end of the string specified by "s".  This function is
  2486.      handy for stripping newline characters from text files.
  2487.  
  2488.  
  2489.      void TBStripSpaces(char *s)
  2490.  
  2491.      The TBStripSpaces function will strip any leading or trailing spaces
  2492.      from the string specified by "s".
  2493.  
  2494.  
  2495.      ULONG TBStrNCrc32(char *s, USHORT l)
  2496.  
  2497.  
  2498.      The TBStrNCrc32 function calculates and returns the CRC for the string
  2499.      of characters specified by "s" for the length specified by the "l"
  2500.      function.
  2501.  
  2502.                                        33
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.      LONG TBUncompress(unsigned char *cib, SHORT cil,
  2517.           unsigned char *cob, unsigned char *wb)
  2518.  
  2519.      The TBUncompress function uncompresses the message pointed to by the
  2520.      "cib" parameter whose length is passed in the "cil" parameter.  The
  2521.      result is placed in the buffer pointed to by the "cob" parameter.  The
  2522.      TriBBS API's uncompression routine requires a work buffer pointed to
  2523.      by the "wp" parameter.  You should note that the "cib", "cob", and
  2524.      "wb" buffers must all be at least 40000 bytes in length.  The length
  2525.      of the compressed message is returned by the TBUncompress function.
  2526.  
  2527.  
  2528.      void TBUpdateFromAndTo(ULONG f, ULONG t, SHORT c)
  2529.  
  2530.      The TBUpdateFromAndTo function will increment a caller's number of
  2531.      messages posted for the caller whose CRC is specified by the "f"
  2532.      parameter.  Additionally, this function will increment the waiting
  2533.      message counter for the caller whose CRC is specified by the "t"
  2534.      parameter in the message conference specified by the "c" parameter.
  2535.  
  2536.  
  2537.      void TBWriteDOORSTMP(char *s)
  2538.  
  2539.      The TBWriteDOORSTMP function opens, writes, and closes the DOORS.TMP
  2540.      file located in the directory specified by the "s" parameter. 
  2541.      TBWriteDOORSTMP writes the contents of the DoorsTmpData global
  2542.      variable to DOORS.TMP.
  2543.  
  2544.  
  2545.      void TBWriteFAREADAT(SHORT n)
  2546.  
  2547.      The TBWriteFAREADAT function writes the record for the file area
  2548.      specified by the "n" parameter.  TBWriteFAREADAT writes the contents
  2549.      of the FAreaData global variable to the FAREA.DAT file.  The FAREA.DAT
  2550.      file must be open for this function to work properly.
  2551.  
  2552.  
  2553.      void TBWriteMCONFDAT(SHORT n)
  2554.  
  2555.      The TBWriteMCONFDAT function writes the record for the file area
  2556.      specified by the "n" parameter.  TBWriteMCONFDAT writes the contents
  2557.      of the MConfData global variable to the MCONF.DAT file.  The MCONF.DAT
  2558.      file must be open for this function to work properly.
  2559.  
  2560.  
  2561.      void TBWriteMnnnnIDX(SHORT n)
  2562.  
  2563.  
  2564.      The TBWriteMnnnn.IDX function writes the message index record
  2565.      specified by the "n" parameter.  TBWriteMnnnnIDX writes the contents
  2566.      of the MIdxData global variable to the Mnnnn.IDX file.  The Mnnnn.IDX
  2567.  
  2568.                                        34
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.      file must be open for this function to work properly.
  2582.  
  2583.  
  2584.      void TBWriteMnnnnPTR(SHORT n)
  2585.  
  2586.      The TBWriteMnnnnPTR function writes the message pointer record
  2587.      specified by the "n" parameter.  TBWriteMnnnnPTR writes the contents
  2588.      of the MPtrData global variable to the Mnnnn.PTR file.  The Mnnnn.PTR
  2589.      file must be open for this function to work properly.
  2590.  
  2591.  
  2592.      void TBWriteNODEDAT(void)
  2593.  
  2594.      The TBWriteNODEDAT function opens, writes, and closes the NODE.DAT
  2595.      file in the current directory.  TBWriteNODEDAT writes the contents of
  2596.      the NodeData global variable to the NODE.DAT file.
  2597.  
  2598.  
  2599.      void TBWriteSYSDAT1DAT(void)
  2600.  
  2601.      The TBWriteSYSDATA1DAT function opens, writes, and closes the
  2602.      SYSDAT1.DAT file located in the directory pointed to by the
  2603.      Node1sMainDirectory global variable.  TBWriteSYSDAT1DAT writes the
  2604.      contents of the SysDat1Data global variable to the SYSDAT1.DAT file.
  2605.  
  2606.  
  2607.      void TBWriteUSERSDAT(SHORT n)
  2608.  
  2609.      The TBWriteUSERSDAT function writes the user record specified by the
  2610.      "n" parameter.  TBWriteUSERSDAT writes the contents of the UsersData
  2611.      global variable to the USERS.DAT file.
  2612.  
  2613.  
  2614.      void TBWriteUSERSSUP(SHORT n)
  2615.  
  2616.      The TBWriteUSERSSUP function writes the supplemental record for the
  2617.      user specified by the "n" parameter.  The contents of the message
  2618.      conference portion of the user's supplemental record is written from 
  2619.      the buffer area pointed to by UsersSupMessages.  You should note that
  2620.      the buffer area pointed to by UsersSupMessages is allocated by
  2621.      TBInitialize.  The contents of the file area portion of the user's
  2622.      supplemental record is written from the buffer area pointed to by
  2623.      UsersSupFiles.  You should note that the buffer area pointed to by
  2624.      UsersSupFiles is allocated by TBInitialize.
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.                                        35
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.                        MISCELLANEOUS IMPLEMENTATION NOTES
  2648.  
  2649.  
  2650.      How Files Are Opened
  2651.      --------------------
  2652.  
  2653.      The TriBBS API opens all files as binary files and for read/write
  2654.      access.  Additionally, if file sharing is detected, the TriBBS API
  2655.      uses the SH_DENYNO sharing mode when opening the files.
  2656.  
  2657.  
  2658.      Record Numbers
  2659.      --------------
  2660.  
  2661.      When passing a record number for any of the TriBBS API functions, you
  2662.      should be aware that the TriBBS API numbers records from 1 to n, where
  2663.      "n" is the total number of records in the file.
  2664.  
  2665.  
  2666.      Calculating CRCs
  2667.      ----------------
  2668.  
  2669.      TriBBS uses 32-bit CRCs for a number of user related functions.  The
  2670.      correct CRC can be calculated using the following method:
  2671.  
  2672.           .
  2673.           .
  2674.           .
  2675.      char s[81];
  2676.      ULONG ucrc;
  2677.           .
  2678.           .
  2679.           .
  2680.      TBStripSpaces(s);
  2681.      TBInitialCaps(s);
  2682.      ucrc = TBStrCrc32(s);
  2683.           .
  2684.           .
  2685.           .
  2686.  
  2687.      The above examples assume the the user's name has been assigned to the
  2688.      "s" string variable.
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.                                        36
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.                                   DEMO PROGRAMS
  2714.  
  2715.  
  2716.      There are two demo programs supplied with the TriBBS API: demo1.c and
  2717.      demo2.c.  demo1.c is a simple program that allows the user to view the
  2718.      messages in a specified message conference.  It can be compiled with
  2719.      one of the following command lines:
  2720.  
  2721.      =====================================================================
  2722.      Compiler            Command Line
  2723.      ---------------------------------------------------------------------
  2724.      Borland C++         bcc -ml demo1.c tbapibc.lib
  2725.      Symantec C++        sc -ml -a1 demo1.c tbapisc.lib
  2726.      Turbo C++           tcc -ml demo1.c tbapitc.lib
  2727.      =====================================================================
  2728.  
  2729.      demo2.c is a slightly more complex program that allows the user to
  2730.      insert the contents of a text file as a message to a specified user. 
  2731.      It can be compiled with one of the following command lines:
  2732.  
  2733.      =====================================================================
  2734.      Compiler            Command Line
  2735.      ---------------------------------------------------------------------
  2736.      Borland C++         bcc -ml demo2.c tbapibc.lib
  2737.      Symantec C++        sc -ml -a1 demo2.c tbapisc.lib
  2738.      Turbo C++           tcc -ml demo2.c tbapitc.lib
  2739.      =====================================================================
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.                                        37
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.                                      SUPPORT
  2780.  
  2781.  
  2782.      Because the TriBBS API is written for the intermediate to advanced
  2783.      C/C++ programmer, support will only be provided for questions that
  2784.      related to the TriBBS API only.  Support will not be given for general
  2785.      C/C++ programming questions.
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.                                        38
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.