ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ InterBBS v1.2 File Structures ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ This file is provided for door and utility authors with a goal of clearly explaining the methodology used for reading and updating a user's record. It is current for version 1.2 of the InterBBS software which will be released in early July, 1995. ÚÄÄÄÄÄÄÄÄÄÄ¿ ³Background³ ÀÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ InterBBS version 1.2 utilizes 2 files for the storage of user account information. They are USERS and FNUSERS.INF. Each SIG (forum) has a file named SIG####.USR which contains last message read pointers and message related "flags". The "####" is the number of the SIG filled from the left with 0's. The first SIG is 0000. Each SIG has 3 additional SYSTEM files which control the bbs' operation: SIG####.@@@ - The CONFERENCE configuration file for each SIG. Contains pertinent information about each CONFERENCE within the SIG including required security levels, name of conference, location/name of conference message file and other information which is defined in the structure of the conference record located below. SIG####.LST - This file is a cr/lf delimited list of conference NAMES. The names are extracted from SIG####.@@@ by IBBSCFG.EXE (InterBBS configuration program). SIG####.SEC - This file contains a bit-map of each conference's public/private status. If the conference is PUBLIC the bit is set while a PRIVATE conference will have the bit cleared. InterBBS *does not* maintain or use the PCBoard USERS file bytes which hold the message flags and pointers for conferences 0-39. These are 15 bytes at offset 193 and 160 bytes at offset 225 (based on the first byte of the file being offset 0). ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³Accessing the User Record³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ InterBBS utilizes 26 user index files for quickly locating a user's name during the logon process or when a caller addresses mail to other than "ALL". They are named FNPNDX.x ("x" is the first letter of the caller's first name). The SysOp record is ALWAYS record #1. The name in this record should be the same as the sysop's name entered in IBBSCFG. When a user logs on (locally or remotely), the user record # is derived from the signed integer in the user index file (FNPNDX.x). If the SysOp performs a quick login to the main menu, record #1 is used without accessing the user index file(s). The USERS file is a text/binary file with a 400 byte record for each user. The record obtained when the users index file is read is the one assigned for a given user. Users with the same name are permitted if the SysOp chooses (in IBBSCFG - General Information #1) to verify each user's City and State. Otherwise the search will terminate when the the first match occurs. When the user record is read, the 2 bytes at offset 390 contain a SIGNED integer with a record number in the SIG's SIG####.USR file which contains this user's Last Message Read Pointers and Bitmaps. All users are in SIG 0 when they login. The filename for LMR pointers and Bitmaps for SIG 0 is "SIG0000.USR". The SIG####.USR file is a variable length record file. Each user's record is the same length, but length of each user's record is solely dependent upon the number of conferences configured for the SIG. The size of each record in the SIG####.USR file is calculated in the following manner: 1) Number of conferences times 4. [LMR Pointers in SIGNED Long Ints] 2) Number of conferences divided by 8 rounded up. 3) Value in #2 times 4 (4 bit fields for each conference). ---------------------------------------------------------------------- Example BASIC Code to calculate the record length: ExtLmrLen& = Areas& * 4 ' Bytes needed Last Message Read Ptrs. BitLen% = Areas& \ 8 ' "\" is integer division operator IF Areas& MOD 8 > 0 THEN ' MOD is Modulus Division ("%" in C). Bitlen% = Bitlen% + 1 ' Length of BASIC string which END IF ' contains a conference bitmap ' Bitlen% is the length (in Bytes) of EACH bitmap (there are 4) ExtRecLen& = ExtLmrLen& + (Bitlen% * 4) ' Length of a user's record ' in the SIG####.USR file. ---------------------------------------------------------------------- Example C Code to calculate the record length: ExtLmrLen = Areas& * 4 ' Bytes needed Last Message Read Ptrs. Bitlen = (Areas / 8) + ((Areas % 8) != 0 ? 1 : 0); // Bitlen% is the length (in Bytes) of EACH bitmap (there are 4) ExtRecLen = ExtLmrLen + (Bitlen% * 4) ' Length of a user's record ' in the SIG####.USR file. The BITMAP flags are stored in the following sequence: 1) All the Conference scan flags (user wants to scan these conferences in global msg reading, QWK D/L) 2) All mail Waiting flags (user has mail waiting in these conferences) 3) All Joined Conference Flags (user has joined/allowed to join these conferences) 4) All Conference Co-SysOp Flags (user may read/delete any messages in a conference if he/she has a Co-SysOp bit set). Bit Flags: If a bit is non zero it is considered ON. A zero bit is OFF. If a user connects to the bbs, enters the name "IMA MODEMEN" the following demonstrates accessing the user's record in the USERS file followed by reading his/her message information from SIG0000.USR. 1) FNPNDX.I is scanned for "IMA MODEMEN". Let's say it was located and the SIGNED integer at offset 0 of the user index record was 450. 2) The USERS file is opened and the record number obtained above is read (400 bytes). Currently, InterBBS does not use a typed structure for the user record. The USERS file record layout is found in another section of this file (below). 3) The 2 bytes at offset 390 of the user record contain the "extended" user record number. This record number in the SIG####.USR file is then read to obtain the user's LMR pointers and conference bitmaps. (The bitmaps are explained below). Use the formula explained above to obtain the extended user record size for this SIG. Then seek to the part of the user's record you wish to read. Updating (and flushing to disk) a user's record before changing SIG's is required to keep a user's information up-to-date. Though this is pretty elementary, the SIG approach InterBBS uses does create room for a programming over-sight. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÚÄÄÄÄÄ¿ ³Recap³ ÃÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ þ File names and naming conventions for the user-related system files ³ ³ have been specified and explained. ³ ³ ³ ³ þ The method for determining the users record size in the SIG####.USR³ ³ file has been explained. ³ ³ ³ ³ þ Reading a user's record in the USERS file and in the current SIG's ³ ³ extended user file (SIG####.USR) has been explained. ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ When the message base is locked for message insertion, only the 6 bytes starting at offset 16 (positions 17 through 22) are "LOCKED". This permits normal message reading even if the above bytes are locked. Previous versions of InterBBS placed the word "LOCKED" in the locked field to indicate the message file was being written. This means of indicating the message file header is LOCKED is still supported since some older message manipulation utilities may still use the old method. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³USERS File Locking ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ InterBBS locks the entire user record (400 bytes) when the USERS file is being updated. Other programs encountering a locked USERS file record should loop until the lock is removed. This should rarely be more than about 1/2 second (that is a conservative estimate). On a network with several nodes in operation this could be longer when a SERVER has a heavy workload. I have seen 10mbps networks drop below 150kbps. be prepared for the worst case network situation. Recommendation: Allow at least 15 seconds before "timing out". ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Message Handling Information³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ InterBBS version 1.2 closely follows the PCBoard version 15.0 message handling. There are a few exceptions and those exceptions are now discussed. InterBBS uses the PCBoard message structure because it has proven to be an excellent medium for storage and retrieval of messages. Its structure facilitates extremely quick searches for text within messages and lends itself (again) to very quick exporting of messages into the QWK format created by Mark (Sparky) Herring. It is possible InterBBS will optionally support another popular message base API in the future. None is planned at this time, however. þ InterBBS's method of file attachments differs: We use a database method of maintaining file attachments. Each conference may have a path specified for file attachments. If a path is specified, this enables file attachments for the conference. Each conference with file attachments *should* have a UNIQUE ATTCHMENT SUB-DIRECTORY specified. The database is located in the attachment sub-directory for a conference and is named "#####.ATT" where #### is the conference number. The attachment database record BASIC structure is: Type AttachMentType StoredName AS STRING * 12 ' FileName stored in attach sub-dir RealName AS STRING * 12 ' FileName when Uploaded Size AS LONG ' File Size Stored in SIGNED Long Int End Type The attachment database record C structure is: struct attachmenttype { char StoredName[12]; char RealName[12]; long Size; } attach; Note: The character arrays ARE NOT null terminated. Strings shorter than 12 bytes are SPACE-FILLED. Note that the conference number is one higher than the conference joined. Example: MAIN BOARD (CONF 0) would have an attachment database named "1.ATT". This file is located in the attachment sub-directory specified in the conference 0 configuration (see structure below). When a file is attached to a message, InterBBS checks for the existence of a file with the SAME name (ignoring the extension (if any)). The name of the file is changed to FILENAME plus an extension of ".###" where ### begins at "000" and any subsequent files uploaded with the SAME name (ignoring the extension) will be given the next higher number up to 999. The database is scanned for the first BLANK (spaces) record (indicative of a deleted attachment) and if one is found that record # is assigned the new attachment otherwise a new record is created in the database. A SIGNED integer at offset 122 (bytes 123,2) of the message header holds this record number. When a message is read, the value of the SIGNED integer at offset 122 is checked. If it is < 1000 and greater than 1 then an attachment is assumed and The database record is read (SIGNED integer). If the attached file is downloaded or viewed after the message is read, the stored name is first copied to the WORK sub-directory as the REAL name. þ InterBBS' method of Return Receipts (RR) Differs: InterBBS utilizes byte 125 (offset 124) of the message header to indicate a return receipt is requested/present. When a RR is requested as a message is saved, offset 124 (byte 125) of the message header will contain an ASCII 1 (""). When the user that message is addressed to has read the message, InterBBS will generate a RR which places an ASCII 4 ("") at offset 124 (byte 125) of the message header. InterBBS generate a new message to create the RR. When a RR notice is read by the person to whom it is addressed, the message is automatically deleted. þ InterBBS supports only private ("*") and public (" ") mail status codes (offset 0 in the message header). This may be expanded in the future. Mail Status codes other than "*" (PRIVATE) are considered PUBLIC. þ InterBBS supports only the following extended message header fields: "TO " - TO Name (or address for internet) "FROM " - FROM Name (or address for internet) "SUBJECT" - Subject of the message Note: If more extended message header fields *must* be supported, please notify us by calling 813-885-5869 (voice) or 813-885-5718 (bbs). ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º CONTROL FILES - SIG.LST º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ The SIG.LST file (SIG List File) is comprised of fixed length records using the following BASIC structure. Type SigDataType Sec AS INTEGER ' This is a SIGNED Integer Desc AS STRING * 30 ' NOT null terminated Intro AS STRING * 32 ' NOT null terminated End Type struct sigdatatype { int Sec; char Desc[30]; char Intro[32]; { sigdata; Note: The character arrays ARE NOT null terminated. Strings shorter than 30 and 32 bytes (respectively) are SPACE-FILLED. InterBBS will *always* have at least 1 (one) record in the SIG List file (for SIG 0). The ONLY part of the record which really *controls* anything is the "Sec" element. The "Sec" element may contain a numeric range from 0-255 which are the security levels allowed in InterBBS. The "Desc" element is a short description of the SIG. This is displayed to a caller when the SIG is joined ("SIG ####"). The "Intro" element is the path and name of a text file to be displayed to a caller when the SIG is joined. If none is specified, InterBBS does not display the "missing file" notice to the caller. The total size of the structure is 64 bytes. It is important to check the size of the SIG List file to determine the number of sigs. There is no configuration item which accepts the number of SIGS to configure. Using a suitable method, read LINE 216 of the SRCONFIG file (located in the NODE sub-directory). This is the PATH & NAME of the SIG List file. Divide the Size of the SIG List file by 64 to determine the number of SIG's. Seek to the offset of the record you are accessing and read in the structure or merely read the SIGNED integer at the offset of the record if that is all the information you need from the record. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º CONTROL FILES - SIG####.@@@º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ The SIG####.@@@ is the conference "control" or definition file. It contains all pertinent information about each conference in the SIG. The first 2 bytes of the file are a SIGNED integer which contains the size of the structure (900 bytes for InterBBS v1.0). ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ To read conference #2's RECORD, the following BASIC code is used: ³ ³ 'RecNum% is 2 ³ ³ 'ConfSize& is 900 as determined when we read the SIGNED int³ ³ 'One is a CONST (1) ³ ³ 'SigRec is Our Type Structure ³ ³ '"3" is used to seek to the file position. (OPTION BASE 1) ³ ³ 'C or Assembler would use a "2" (OPTION BASE 0) ³ ³ GET FileNum%, (ConfSize& * (RecNum% - One)) + 3, SigRec ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ The BASIC structure of the "record" follows. TYPE ConfNames ' SIG####.@@@ file RECORD Structure Maildir AS STRING * 40 ' Path/name of Conf message File Bname AS STRING * 25 ' Name of Conference Xfer AS STRING * 35 ' DIR Listing File name ("DIR.LST") DpathNm AS STRING * 30 ' DLPATH.LST File name ("DLPATH.LST") UpathNm AS STRING * 30 ' Public Upload FIle Directory Path PrivPathNm AS STRING * 30 ' Private Upload Directory path UlDirFile AS STRING * 30 ' Public Upload DIR Listing File Name PrivDirFile AS STRING * 30 ' Private Upload DIR Listing File Name DirMenFile AS STRING * 30 ' DIR Listing Menu File Name IsEcho AS STRING * 1 ' Is this conf. to be echoed (Char 0=no; 1=yes) AccLvl AS STRING * 1 ' Security Lvl Req'd to enter conf. (0-255) RepLvl AS STRING * 1 ' Security Lvl Req'd to REPLY to msg (0-255) WritLvl AS STRING * 1 ' Security Lvl Req'd to ENTER a msg (0-255) IsPub AS STRING * 1 ' Is this a public conf (Char 0= no; 1=yes) NumMblks AS STRING * 1 ' Number of message Blocks - 1 block=1024 msgs UpDirlvl AS STRING * 1 ' Public Upload Directory Security level PrivDirlvl AS STRING * 1 ' Private Upload Directory Security level IndexFile AS STRING * 30 ' Path And name of DIR Index file (if any) DoorMen AS STRING * 30 ' Path And name of Door menu File DoorData AS STRING * 30 ' Path And name of Door Data File BltnMen AS STRING * 30 ' Path And name of bulletin menu File BltnLst AS STRING * 30 ' Path And name of Bulletin List File PrivateOnly AS STRING * 1 ' Private mail ONLY conference ' \\\\\\\\\ ConfNewsFile AS STRING * 30 ' Private mail ONLY conference ' \\\\\\\\\ PubLicOnly AS STRING * 1 ' Public mail ONLY conference ' \\\\\\\\\ AttachToDir AS STRING * 30 ' Private mail ONLY conference ' \\\\\\\\\ CoSysOpName AS STRING * 25 ' Co-SysOp's name (if any) for SYSOP mail GraphicsQ AS STRING * 1 ' GrapHics Quoting Cussing AS STRING * 30 ' CussWord File Path/name AliasOK AS STRING * 1 ' Alias Name ok in This conf ReceiptSec AS STRING * 1 ' Return Receipt Security Level ConfPw AS STRING * 15 ' Password to Join Conf (if <> " ") ConfConfNews AS STRING * 35 ' Conference NEWS File ConfMainMenu AS STRING * 35 ' Conference MainMenu File (MM) ConfSysOpMainMenu AS STRING * 35 ' Conference Sysop main Menu ConfConfmenu AS STRING * 35 ' Conference ConF Menu ConfSysOpConfmenu AS STRING * 35 ' Conference Sysop Conf Menu ConfConflst AS STRING * 35 ' Conference Conference List File Name ConfFilemenu AS STRING * 35 ' Conference File menu ConfSysOpFilemenu AS STRING * 35 ' Conference Sysop File Menu ViewDirsok AS STRING * 1 ' ViewDirsok Yes / No LongHeader AS STRING * 1 ' Allow Long TO, From Addresses ForceEcho AS STRING * 1 ' Force All mail in conf as ECHO UseOldNdx AS STRING * 1 ' Use the Old Style MSGS.NDX File FidoNetMail AS STRING * 1 ' Create Fido-Style .MSG Netmail? ' v1.2 ' Char 1 = Yes; Char 0 = NO. Future AS STRING * 42 ' Reserved and UnUsed END TYPE Note that the STRINGS are NOT null terminated. The "IsPub" element may be ignored *if* you utilize the bitmap in the SIG####.SEC file. The message INDEX files have .NDX (for OLD Index) and .IDX (NEW Index) extensions appended to the path & name of the message file. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º CONTROL FILES - NODEINFO.DAT º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ InterBBS uses NODEINFO.DAT as a node "status" and control file. The file format has changed from the previous use of the PCBoard 14.2 USERNET.DAT file format to better support numerous nodes and to provide a means for quickly detecting changes in any nodes status. With version 1.0 of the software, the NODEINFO.DAT file was modified by using the first 128 byte record of the file as a BITMAP. Currently, InterBBS uses the first 32 bytes of this record for node login/logoff flags. The bits used for this are 0-254 which support nodes 1-255 respectively. For example, when a caller is logging in or logging off the system AND the SysOp has enebled login/logoff broadcasts to other nodes in IBBSCFG (General Information #2), the BIT for that NODE will be set for three seconds. After the three second "wait" for other nodes to detect the login/logoff, the BIT is then cleared. IF login/logoff broadcasts are enabled on a node (each node is controlled individually) the NODEINFO.DAT file is checked every 3 seconds when a user is in the system and NOT entering a message or file description. The entire 128 byte record is currently read and those login/logoff BITS for the active nodes are checked. If one is found to be SET that nodes records is then read and the login/logoff is broadcast to the caller on the node performing the check. The process loops until all nodes have been checked (practically no delay). Once all nodes have been checked AND there has been a login or logoff, there will be a delay of 1 and 1/18th seconds to allow the affected node to clear its login/logoff bit. A node setting its BIT (logging in / logging off) will pause 3 seconds for other nodes to check the BITMAP. InterBBS DOES NOT presize the NODEINFO.DAT file to support the maximum number of nodes the software is designed for. The file is extended as new nodes are added up to the maximum supported. The BASIC structure of the NODEINFO.DAT follows: Type NodeRecord Status AS STRING * 1 ' Node's Current Status Flag PageOK AS STRING * 1 ' Is this node accepting a Chat Page PagedBy AS Integer ' Either a "0" for not paged or a node# ' Note that this allows a user to be ' paged while in chat unless the PageOK ' flag is turned off. ChatWith AS Integer ' # = Node# or Group#. 0 = N/A. ' Indicates the node number or group # ' the user is IN chat with (or 0=N/A) UserNm AS STRING * 25 ' Name of User on this Node UserFm AS STRING * 24 ' Where the user is from (City/State) Waiting AS Integer ' The Node has paged the node # here ' and is "WAITING" in the chat module ' for the "paged" node to enter chat. Reserved AS STRING * 7 ' Filler & Extra up to 128 Bytes/Record NodeMsg AS STRING * 64 ' Node-Node msg (From Chat Module) End Type Current Node STATUS codes are (ASCII): 1 = Available for Chat 2 = Waiting for a Call 3 = Transferring a File 4 = Entering a Message 5 = Group Chat (Group ###) 6 = Chatting with Node ### 7 = Opened a Door 8 = Front End in Control 9 = Unavailable for Chat 10 = Logging into Node ### 11 = Logging off Node ### 12 = Stealth Mode "Stealth Mode" is given for a node which has used the "HIDE" command from the main menu. This command toggles STEALTH mode. If a node is STEALTH, the exact status of that node is unavailable to users on other nodes. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º CONTROL FILES - SRCONFIG º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ This is the main BBS configuration file. It is a cr/lf delimited text file and it is created by IBBSCFG in each NODE directory. A sample SRCONFIG file with a short description of the contents follows: ENTRY LINE DESCRIPTION ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The BBS 1 Name of your BBS IMA MODEMEN 2 Sysop's name C:\IBBS 3 BBS program main directory 1 4 Number of this node C:\IBBS\NODE1 5 This node home directory 140 6 Max messages per archive run 115 7 Userfile edit access (remote sysop access 1 8 Lock com port at opening baud rate 1=yes, 0=no COM1 9 Comport for this node (com1-4) ATZ 10 Modem reset string 57600 11 Baud rate which to open com port 30 12 New user's access level 1 13 Questionnaires used? 1=yes, 0=no 25 14 Secs for modem to wait to connect C:\IBBS\NODE1\WORK\ 15 Node work directory (all deleted) 3 16 Number of questionnaires available 1200 17 Lowest baud rate to allow onto BBS 1 18 Use the Today function? 1=yes,0=no 000 19 Registration Number (000 if Unreg) 20 Unused by InterBBS v1.0 1000 21 Min K-bytes on U/L drive for U/Ls 8 22 Number of bulletins available 23 - unused - 24 - unused - 30 25 Days before subscription expired warning file displayed 10 26 Expired sec level when subscrip- tion expires) 1 27 Subscription mode desired? 1=yes, 0=no 0 28 Ringback option desired? 1=yes, 0=no 45 29 Seconds to wait for ringback? 0 30 Frontdoor program is used? 1=yes, 0=no 0 31 Running under DESQview?1=yes, 0=no 1 32 "Uploaded By:"in file description? 1=yes, 0=no 0 33 Want high ASCII filter? 1=yes,0=no C:\IBBS\SECMSGS\ 34 Location of security files 0 34 Minutes before modem is reinitial- ized C:\IBBS\FILES\CF0000\HOLD 36 Duplicate U/L hold directory path 30 37 Sec lev required to D/L files 30 38 Sec lev required to U/L files 30 39 Sec lev to enter Files area 1 40 Graphics at local logon? 1=yes, 0=no 0 41 Force users into door at logon? 1=yes, 0=no 1.5 42 Upload time credit factor. 43 - unused - 1 44 Warn if files flagged at logoff? 1=yes, 0=no 1 45 Ask to set msg pointers at logoff? 1=yes, 0=No 46 - unused - 47 - unused - 48 - unused - 49 - unused - Y 50 Permit swapping to EMS/XMS/Disk? 1=yes, 0=no 50 51 Sec lev to list users? 52 - Unused - 1 53 Allow private personal transfers? 1=yes, 0=no C:\IBBS\FILES\CF0000\UPL 54 Private personal file xfer file directory path 0 55 3 second pause after connect=<2400 0=yes, 1=n0 50 56 Sec lev to archive and D/L msgs 1 57 Enable split screen chat? 1=yes, 0=no 1 58 Always ask users to select xfer protocol? 1=yes, 0=no 2 59 Number of nodes configured for 1 60 Enable auto-ANSI detect at logon? 1=yes, 0=no 0 61 Default subscription in days (0-999) for new users 00:00 62 Sysop available start time (page) 23:59 63 Sysop available stop time (page) 0 64 Allow one name users (handles)? 1=yes, 0=no 0 65 Allow login as sysop from remote? 1=yes, 0=no F F 1^m 66 1/10 shifted F-keys - defined 67 2/10 shifted F-keys - defined 68 3/10 shifted F-keys - defined 69 4/10 shifted F-keys - defined 70 5/10 shifted F-keys - defined 71 6/10 shifted F-keys - defined 72 7/10 shifted F-keys - defined 73 8/10 shifted F-keys - defined 74 9/10 shifted F-keys - defined J 0 R-^M 75 10/10 shifted F-keys - defined 1 76 Enforce the above sysop availiab- ility for chat? 1=yes, 0=no 77 Path/name of program to run before & after transfers &H3F8 78 Serial port base address &H4 79 IRQ number to use C:\IBBS\IBSYS\IBBSTEXT 80 Path/name of the "IBBSTEXT" file 0 81 - unused - 1010 82 Number of lines users allowed to read from archive 255 83 Sec lev req'd to kill own message 255 84 Sec lev req'd to list [T]odays callers 100 85 Sec lev req'd to carbon copy msgs C:\IBBS\MENU\MM 86 Path/name of Main menu file C:\IBBS\MENU\CM 87 Path/name of Conference menu file C:\IBBS\MENU\FM 88 Path/name of File menu file C:\IBBS\QUES\QUEM 89 Path/name of Script questionaire menu C:\IBBS\DISP\PRELOG 90 Path/name of Prelogin welcome file C:\IBBS\DISP\NEWS 91 Path/name of News file C:\IBBS\HELLO1 92 Path/name of After login Welcome file C:\IBBS\DISP\NEWUSER 93 Path/name of New User welcome file C:\IBBS\DISP\CLOSED 94 Path/name of text file shown to new users if system is private C:\IBBS\LOGS\CALLER1 95 Path/name of Caller log file C:\IBBS\DISP\EXPWARN 96 Path/name of Expired subscription Warning file C:\IBBS\DISP\EXPIRED 97 Path/name of Expired Subscription lapse notice file C:\IBBS\QUES\SCRIPT.0 98 Path/name of New user script questionaire file C:\IBBS\\DISP\LOGOFF 99 Path/name of Logoff file (shown after the [G]oodbye) C:\IBBS\DISP\TODAY 100 Path/name of "TODAY" text file (if used) C:\IBBS\DISP\PREDL 101 Path/name of PreDownload Warning file C:\IBBS\DISP\PREUL 102 Path/name of PreUpload Warning file C:\IBBS\DISP\USRSTAT 103 Path/name of the User Statistics Information file 255 104 Sec lev req'd to Kill any message 255 105 Sec lev req'd to Edit any message 110 106 Sec lev req'd to enter @ macro messages 255 107 Sec lev req'd to [R]ead any msg 110 108 Sec lev req'd to view callers log 50 109 Sec lev req'd to user [VER] command 100 110 Sec lev req'd to edit own messages 110 111 Sec lev req'd to edit user info 50 112 Sec lev req'd to view [B]ulletins 50 113 Sec lev req'd to leave a [C]omment 50 114 Sec lev req'd to use [D]oors 50 115 Sec lev req'd to view [H]elp files 50 116 Sec lev req'd to [J]oin a conf 50 117 Sec lev req'd to [L]ist files 50 118 Sec lev req'd for [N]ew file dir scan 50 119 Sec lev req'd to page [O]perator 50 120 Sec lev req'd to change [P]age length 110 121 Sec lev req'd for unlimited time 50 122 Sec lev req'd to answer [Q]ues- tionnaries 50 123 Sec lev req'd for [S/SS]can/super scans 50 124 Sec lev req'd to [S]elect msg scan 50 125 Sec lev req'd to toggle [S]creen color mode 50 126 Sec lev req'd for [TP], transfer protocol 50 127 Sec lev req'd to [V]iew user's statistics 50 128 Sec lev req'd to [V]iew archive 50 129 Sec lev req'd to view [W]elcome file 50 130 Sec lev req'd to toggle e[X]pert mode 50 131 Sec lev req'd for [Z]ippy scan 70 132 Sec lev req'd for [*] global new messages read 1 133 Show bulletin menu if new Bltns? 1=yes, 0=No 10 134 Suspend callers before event (in minutes) C:\IBBS\USRNDX\ 135 Path to the "FNPNDX.x" user index files C:\IBBS\DISP\CL 136 Path/name of conf listing file C:\IBBS\HELP\ 137 Path to "Custom" help files 138 No Longer Used 1 139 Ask "Do you want color at logon?"? 1=yes, 0=no 1 140 Number of "rings" before sending modem answer command C:\IBBS\IBSYS\PWRD 141 Path/name of the "PWRD" file 142 Unused -1 143 Load IBBSTEXT into memory?(faster) -1=yes, 0=no 1 144 Confirm the [G] (logoff) command? 1=yes, 0=no 70 145 Sec lev required to U/L attached file HIJ 146 Slow drive letters Y 147 Take modem off-hook during event C:\IBBS\QUES\ 148 Location of script questionnaires 0 149 0=Open system, -1= Closed system 0 150 Use sysops real name? -1=yes, 0=no 151 - unused - 152 - unused - 1 153 Parallel printer port assigned C:\IBBS\IBSYS\FNUSERS.INF 154 Path/name of "FNUSERS.INF" file C:\IBBS\IBSYS\CUSSWRN 155 Path/name of the Profanity Warning file C:\IBBS\DISP\QUOTES.BBS 156 Path/name of BBS quotes file 1 157 Display USRSTAT at logon: 1=y,0=n C:\IBBS\DISP\POSTUL 158 Path/name of Post Upload file C:\IBBS\DISP\POSTDL 159 Path/name of Post Download file C:\IBBS\DISP\FAILUL 160 Path/name of Failed Upload file C:\IBBS\DISP\FAILDL 161 Path/name of Failed Download file C:\IBBS\CHAT\ 162 Location of Chat files C:\IBBS\DISP\CHTM 163 Path/name of Group Chat menu 6 164 Maximum number of rooms available in group chat 1 165 Verify callers city/state at logon 0=yes, 1=no C:\IBBS\MENU\CLS 166 Path/name of sysop message menu C:\IBBS\MENU\MM 167 Path/name of sysop main menu C:\IBBS\MENU\FMS 168 Path/name of sysop file menu 1 169 Force mail to be read at logon? 1=yes, 0=no C:\IBBS\IBSYS\ 170 Path to SIG####.@@@ file(s). C:\IBBS\IBSYS\ 171 Path to SIG####.LST file(s). C:\IBBS\IBSYS\USERS 172 Path/Name of "USERS" file C:\IBBS\IBSYS\ 173 Path to SIG####.USR file(s). 150 174 Maximum number of lines allowed in message editor C:\IBBS\IBBSPROT.DAT 175 Path/name of "IBBSPROT.DAT" file F 176 "A"=Async serial driver,"F"=Fossil C:\IBBS\IBSYS\FREE.LST 177 Path/name of FREE.LST file 0 178 Charge users time for D/L Free files? 1=yes, 0=no 50 179 Sec lev for "*" Quick logon C:\IBBS\IBSYS\TRASH 180 Path/name of "TRASH" file C:\IBBS\IBSYS\FNPML.DAT 181 Path/name of Multi-Language File C:\IBBS\IBSYS\MAIN.CMD 182 Path/name of MAIN Command Trans- lation file. C:\IBBS\IBSYS\MSG.CMD 183 Path/name of MSG Command Trans- lation file. C:\IBBS\IBSYS\FT.CMD 184 Path/name of FILE TRANSFER Command Translation file. C:\IBBS\IBSYS\PAY.LST 185 Path/name of PAID D/L Files .LST file. Note: The next 6 items expect HEX numbers. 1E 186 Color for Message Header CONF Line 4F 187 Color for Message Header DATE Line 78 188 Color for Message Header TO Line 5F 189 Color for Message Header FROM Line 30 190 Color for Message Header SUBJ Line 9 191 Color for TEXT Entry 1 192 Tell other nodes when a caller logs on? 0=no; 1=yes 1 193 Allow nodes to send other nodes 1-liner messages with the /w command when in node/group chat. 0=no; 1=yes 200 194 Max messages <= 2400 baud callers may download per day. 32767 max. 400 195 Max messages <= 4800 baud callers may download per day. 32767 max. 1000 196 Max messages <= 9600 baud callers may download per day. 32767 max. 2000 197 Max messages <= 14400 baud callers may download per day. 32767 max. 10000 198 Max messages > 14400 baud callers may download per day. 32767 max. 200 199 Max messages <= 2400 baud callers may D/L in a QWK packet. 32767 Max 400 200 Max messages <= 4800 baud callers may D/L in a QWK packet. 32767 Max 1000 201 Max messages <= 9600 baud callers may D/L in a QWK packet. 32767 Max 2000 202 Max messages <= 14400 baud callers may D/L in a QWK packet. 32767 Max 10000 203 Max messages > 14400 baud callers may D/L in a QWK packet. 32767 Max C:\IBBS\MENU\QWKM 204 Path/name of QWK menu file. C:\IBBS\IBSYS\QWKCRC.DAT 205 Path/name of crc-32 dupe database Note: Any of the next 9 items with an "*" (asteric) following the item number are MANDATORY! PROGINN 206* BBS ID - Contact HUB if Applicable (813) 555-1212 207* BBS Phone Number þ The Programmer's Inn þ 208 Origin Line (tagline). D:\SLMR 209* Sub-Dir to IMPORT .REP packet from D:\SLMR 210* Sub-Dir to EXPORT .QWK packet to D:\IBBS\RIPS\HELLO1 211 Path/name of WELCOME file to add to .QWK packets. D:\IBBS\RIPS\NEWS 212 Path/name of NEWS file to add to .QWK packets. D:\IBBS\RIPS\LOGOFF 213 Path/name of GOODBYE file to add to .QWK packets. TAMPA, FL. 214* Location of your BBS. D:\IBBS\RIPS\SIGMEN 215 Path/Name of SIG MENU file. D:\IBBS\IBSYS\SIGDATA 216 Path/Name of SIG LIST file. 4E 217 Color for Message Header READ Line. 400 218 Lines in Scroll-Back Buffer. D:\IBBS\DISP\HMR 219 HMR Settings Menu. 0 220 Recycle the BBS to DOS after each call. 1=Yes 0=No. ATM0H1 221 Command String to take your Modem Off-Hook (BUSY). D:\IBBS\IBSYS\ 222 InterBBS' SYSTEM directory. D:\IBBS\IBSYS\MAIN.FUN 223 Main Menu Command Configuration File. D:\IBBS\IBSYS\CONF.FUN 224 Message Menu Command Configuration File. D:\IBBS\IBSYS\XFER.FUN 225 File Transfer Menu Command Configuration File. D:\IBBS\IBSYS\IBNODE.CTL 226 InterBBS Node Control File Loc/Name 1:143/317 227 Your FIDO(tm) Node Number (Origin) 1 228 Your Origin Point (0 = Not a Point) E:\IM\NETMAIL 229 Loc for Outgoing NetMail D:\IBBS\DISP\NETM 230 Loc/Name of Netmail Intro File D:\IBBS\DISP\CBK 231 Loc/Name of Call-Back Intro File D:\IBBS\IBSYS\CBV.LST 232 Loc/Name of Call-Back .LST File 70 233 Security Level to Use Call-Back 80 234 Security Level when CBV Verifies 0 235 Subscription Expires in nnn Days ------------------------------------------------------------------------------ CONTROL FILES - USERS The 26 USERS file "quick" index files are automatically generated by the BBS when the file is packed in the filename format of FNPNDX.x - where "x" is a letter from A-Z. These index files contain the names of all registered system callers, sorted alphabetically by last name. Each file contains a caller's record number and their complete username. Each record in the file is 27 bytes long. The first two bytes as the caller's record number in the main USERS file, and the last 25 bytes contain the caller's first and last names. NOTE: All strings (ASCII) are not null-terminated. Position,# Bytes Type Description ------------------------------------------------------------------------------- 1,25 ASCII First & Last Name 26,24 ASCII City & State 50,12 ASCII Password 62,13 ASCII Business/Data Phone Number 75,13 ASCII Voice/Home Phone Number 88,6 ASCII Last Date on in (yymmdd) format 94,5 ASCII Last Logon Time in (hh:mm) format 99,1 ASCII Expert Mode (y or n) 100,1 ASCII Protocol Type ("Z", "G", "H", etc) 101,1 (Space) UnUsed by InterBBS v1.2 102,6 ASCII Last DIR new files search date (yymmdd) 108,1 CHR$ Security Level (0-255) 109,2 MKI$ Number of times on System 111,1 CHR$ Page Length (24 normally) 112,2 MKI$ Total Number of Uploads 114,2 MKI$ Total Number of Downloads 116,8 MKD$ Daily Download Bytes so Far 124,25 ASCII Alias Name 149,4 MKL$ Number of Messages left 154,25 ASCII Sysop Maintained Comment 179,2 UnUsed by InterBBS v1.2 181,2 MKI$ Number of Files Downloaded Today. 183,1 BITMAP Bit 0 = Personal Private File Transfer Auth. Bit 1 = Personal Private File(s) Present Bit 2 = Stealth Mode Allowed(Mask Presence) Bit 3 = QWK - Receive Mail TO YOU Only. Bit 4 = QWK - Receive mail addressed to ALL. Non Zero = Yes or Authorized as Applicable. 184,2 MKI$ Elapsed Time on System TODAY 186,6 ASCII Subscription Expiration Date (yymmdd) 192,1 CHR$ Subscription Expired Security Level 193,1 CHR$ Conference number the user last joined 194,15 UnUsed by InterBBS v1.2 209,8 MKD$ Total Bytes Downloaded - all calls 217,8 MKD$ Total Bytes Uploaded - all calls 225,1 ASCII Deleted Flag ("Y" or "N") 226,162 UnUsed by InterBBS v1.2 388,2 MKI$ Birthdate crunched into a signed integer. 390,2 MKI$ User's Record Number in External User Files (SIG####.USR, FNUSERS.INF) 392,9 (Space) UnUsed by InterBBS v1.2 ------------------------------------------------------------------------------- CONTROL FILES - MESSAGE BASE FILES MESSAGE BASE FILE FORMATS (128 BYTES PER BLOCK) ------------------------------------------------------------------------------ Header Block of Message Base for each Area 1,4 MKS$ High Message Number (0 to 9,999,999) 5,4 MKS$ Low Message Number (0 to 9,999,999) 9,4 MKS$ Number of Active Messages (0 to 32767) 13,4 MKS$ Number of System Callers (0 to 9,999,999) 17,6 ASCII "LOCKED" when message is being written to disk 23,105 Space (Reserved for future use) First Block of Each Actual Message 1,1 ASCII Status Flag 2,4 MKS$ Message Number (1 to 9,999,999) 6,4 MKS$ Reference Message Number (1 to 9,999,999) 10,1 chr$ Number of 128 byte blocks in the message 11,8 ASCII Date of message as (mm-dd-yy) 19,5 ASCII Time of Message as (hh:mm) 24,25 ASCII Who the Message is For 49,4 MKS$ Date of reply message as (yymmdd) 53,5 ASCII Time of last reply message 58,1 ASCII The letter "R" if an "ALL" msg. has reply(s) 59,25 ASCII Who the Message is From 84,25 ASCII The Subject of the Message 109,12 ASCII Password of the Message (Not Used) 121,1 ASCII chr$(225) for active or chr$(226) for inactive 122,1 ASCII The letter "E" if message is to be echoed 123,2 MKI$ (Record in the Conf attachment database for file) 125,1 ASCII Ascii 1 = Return Receipt Requested 126,1 UnUsed by InterBBS v1.2 127,1 BITMAP If No Extended header information in the message just use an ascii 1 or 32 here. Otherwise, the character is bitmapped using the following information: bit 0 = extended header has TO information bit 1 = extended header has FROM information bit 2 = extended header has SUBJECT information 128,1 UnUsed by InterBBS v1.2 ------------------------------------------------------------------------------ Extended Header Format ---------------------- A message may contain one or more EXTENDED HEADERS within the body of the message. The following is the physical layout of the Extended Header within the message body. You may assume that as soon as the Extended Header ID is not found that there are no more extended headers in the message body. Position, Bytes Data Description ------ ---- ----------- 1,2 MKI$ Extended Header ID = must be equal to 40FFh (Decimal 16639) 3,7 ASCII Extended Header Function (TO,TO2,FROM,FROM2,SUBJECT) 10,1 ASCII A colon (:) is always placed in this location 11,60 ASCII Extended Header text (to, from, subject) 71,1 ASCII Status ("N" or "R"). Should be "N" for InterBBS. 72,1 ASCII Line Separator (Ascii 227) The following information applies to both InterBBS v1.2 and PCBoard v15.xx. It is edited to reflect InterBBS specifics. Index File Format ----------------- There are two separate Index File Formats used by InterBBS. There is an older format which was used from Ron Pierce's FeatherNet version 2.38, and a new PCBoard v15.0 specific format. All authors are encouraged to utilize the PCBoard v15.0 format. However, in the meantime, InterBBS is capable of working with BOTH formats. InterBBS no longer uses the old style format, but it will keep it updated if the SysOp has utilities which mandate its presence. SysOps can use the environment variable FNP=/OLDNDX to force the old index files to be maintained for all conferences. The two index filenames are the same root name as used for the message base plus the addition of an extension as follows: .NDX for old-style index files .IDX for v15.0 style index files Example: MSGS.NDX and MSGS.IDX would be the two index files for MSGS. Version 15.0 Style Index ------------------------ This new format has several changes and at the same time some operational simularities that make it easy to implement. These changes are: - The index record now has the offset stored as a long integer instead of as a single precision real number. - The offset is no longer the number of the message block but instead is the actual offset within the file. (the old style offset had to be multiplied by 128 to arrive at a physical offset) - The index record now has the most commonly accessed information that is used by PCBoard to determine the accessability of a message - that is, to decide whether or not the message can be read by the caller. By putting all of this information into the index PCBoard no longer has to read BOTH the index AND the message header to find out of the message is readable. This also greatly speeds up the Y-scan because for most scans it no longer has to read the message base but just the information in the index file can be used. - A date is now included in the index making it possible to quickly locate messages that are newer than a given date. - The index file is not PRE-formatted. This means that sysops no longer have to worry about filling up the message base index or setting an appropriate "block size" for the index. PCBoard and PCBPack simply maintain an index that covers only the range of messages from low to high in the message base and nothinger more. The format for the index is as follows: Offset Type Length Description ------ ------ ------ ----------- 0 long 4 Offset (0 if none, >0 if active, <0 if killed) 4 long 4 Message Number 8 str 25 TO Name 33 str 25 FROM Name 58 char 1 Status Character (from Message Header) 59 int 2 Date of Message (in julian date format) 61 str 3 Reserved for future use Accessing the file is quite similar to the old style index. Here is the same example used for the Old Style Index access: Message Number to Find: 1500 Low Message Number : 1024 Offset into INDEX File: 1500-1024 = 476, 476 * 64 = 30464 read 64 bytes at offset 30464 in INDEX file Offset into MSGS File : Index.Offset The differences in the above as compared to Old Style Indexes are that the size of the index record is now 64 bytes instead of 4 bytes. And the Offset in the record is used "as is" without having to perform any calculations on it. Example C code implementing the above: typedef struct { long Offset; long Num; char To[25]; char From[25]; char Status; unsigned Date; char Reserved[3]; } indextype; indextype Index; LowNum = 1024; MsgNum = 1500; lseek( IndexFile,( MsgNum - LowNum ) * sizeof( indextype ),SEEK_SET ); read( IndexFile,&Index,sizeof( indextype )); if (Index.Offset > 0) { lseek( MsgsFile, Offset, SEEK_SET ); read( MsgsFile, Header, sizeof( Header )); /////////////////////////////////////////////////// // read the rest of the message here if you want // /////////////////////////////////////////////////// } The offsets contained in the index file will be 0 (indicating that no message exists for that entry), a negative of the offset (example -476 in the above) if the message has been killed or a positive offset value if the message is active. Old Style Index --------------- The file is preformatted to a size of 4096 times the number of message index blocks. Each message index block consists of 1024 entries each being of type "bsreal" resulting in 4096 bytes per block. Each entry in the index is the block offset into the message base for a given message number minus the low message number in the message base. Take the following example for instance: Message Number to Find: 1500 Low Message Number : 1024 Offset into INDEX File: 1500 - 1024 = 476, 476 * 4 = 1904 read 4 bytes at offset 1904 in INDEX file (realizing that those 4 bytes are "bsreal") Offset into MSGS File : (Value from Index - 1) * 128 The Offset into the MSGS file is then calculated according to the above example by first determining where to read in the index file, grabbing the block offset value from the index and then subtracting one from it and multiplying by 128 (which is the size of all blocks in the message base). Example C code implementing the above: LowNum = 1024; MsgNum = 1500; lseek( IndexFile,( MsgNum - LowNum ) * 4, SEEK_SET ); read( IndexFile,Offset,sizeof( bsreal )); MsgOffset = Offset; // <-- using your own routines you need // to convert the bsreal type to a // long integer for use below if ( MsgOffset > 0 ) { lseek( MsgsFile,( MsgOffset-1 ) * 128, SEEK_SET ); read( MsgsFile,Header,sizeof( Header )); /////////////////////////////////////////////////// // read the rest of the message here if you want // /////////////////////////////////////////////////// } The offsets contained in the index file will be 0 (indicating that no message exists for that entry), a negative of the offset (example -476 in the above) if the message has been killed or a positive offset value if the message is active. ------------------------------------------------------------------------------ CONTROL FILES - FNPUSER.SYS FNPUSER.SYS utilizes: 1) A fixed header which describes the contents of the file. 2) A fixed size user record which contains a user's account information. 3) High Message read pointers 4) Bit mapped fields for conferences (registered, scan, mail waiting, and co-sysop). The following BASIC structures are used: ÚÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³Notes³ ³ ÃÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³"Integer" is a signed integer (-32768 to 32767) ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ FNPUSER.SYS Fixed Header ------------------------ Note: The below type "Updated" should be considered a type "bool" where non-zero means TRUE and zero means FALSE. Type UsysHdr Version AS Integer InterBBS version number (11, 12, etc) UrecNum AS Long User's record number in USERS file UrecSize AS Integer Size of "fixed" user record ConfAreas AS Integer Number of conference areas (1 to 4096) BitFields AS Integer Number of Bit Map fields for EACH conference SizeOfBits AS Integer Size of the Bit Map Field (String) Updated AS String * 1 TRUE if the FNUSERS.SYS file has been updated Reserved AS STRING * 17 Reserved for "possible" future use. End Type ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ FNPUSER.SYS Fixed User Record ----------------------------- Note: The "LastDateOn", "LastDirRead" and "ExpireDate" types are the number of days before/after 12/31/1979. 01-01-1994 would be stored as a signed integer of 5115. 12-31-1979 would be stored as a signed integer of 0. Note: The below "DelUser" and "ExpertMode" types should be considered a type "bool" where non-zero means TRUE and zero means FALSE. (267 Bytes for InterBBS version 1.2) Type FixedUrec Name AS String * 26 Name (NULL terminated) AliasName AS String * 26 User's Alias Name (NULL terminated) CityState AS String * 25 City/State (NULL terminated) Password AS String * 13 Password (NULL terminated) DataPhone AS String * 14 Data/Business Phone (NULL terminated) HomePhone AS String * 14 Home/Voice Phone (NULL terminated) LastDateOn AS String * 7 Last Date Called (YYMMDD) (NULL Terminated) LastTimeOn AS String * 6 Last Time On (HH:MM) (NULL terminated) ExpertMode AS String * 1 TRUE if Expert mode on Protocol AS String * 1 Protocol (A-Z) LastDirRead AS String * 7 Last DIR Scan Date (YYMMDD) (NULL Terminated) SecurityLevel AS Integer Security Level TimesConnected AS Integer Number of Times Caller has Been on System PageLength AS Integer Page Length for data displayed on the screen FilesUld AS Long Total Number of Files Uploaded FilesDld AS Long Total Number of Files Downloaded FilesDlToday AS Integer Number of Files Downloaded TODAY BytesDlToday AS Long Number of Bytes Downloaded TODAY TotalDLBytes AS Long Total Number of Bytes Downloaded TotalULBytes AS Long Total Number of Bytes Uploaded DelUser AS String * 1 1 = Delete this user; 0 = Keep this user MsgsLeft AS Long Number of messages this user has Left SysopCmt AS String * 71 Sysop Comment (NULL terminated) ElapsedTime AS Integer Number of minutes user has been online TODAY ExpireDate AS String * 7 Registration Exp Date(YYMMDD) (NULL Terminated) LastConf AS Integer Conference # the caller was in ExtUserRec AS Long User's record number in FNUSERS.INF/SIG####.USR MoneyTotal AS Single Total Money Paid for Hourly Subscription ActiveSig AS Integer Active Sig When Exiting to DOS/DOOR Area AS Integer Last Conf Area User was in When Exiting End Type ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Following the FIXED user information in the FNPUSER.SYS file are the HMR pointers for all conferences. Each is stored as a Long Integer in (IEEE) format. If there are 20 conferences configured (including the MAIN BOARD) the HMR pointers would occupy the 80 bytes immediately following the FIXED user record. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Following the HMR pointers are the BIT MAPPED fields. These are a string of bytes used to efficiently store flags assigned to a user specific to each conference. Version 1.2 of InterBBS utilize 4 bits per conference: 1) Registered in Conference - This bit is set if as user is "registered" in a conference. If registered, a user may read, write, reply to messages and may download/upload files (if any are available in the conference). 2) Scan this Conference - This bit is set if the user has a conference "flagged" as a part of his/her "global SCAN". Within InterBBS, the global scan can be used to archive new messages in all "flagged" conferences. It can also be used to read all new PUBLIC (and his/her personal) mail in the flagged conferences. 3) Mail Waiting Flags - This bit is set if a user has new PERSONAL mail waiting to be read. Within InterBBS, this bit is used to notify users of new personal mail waiting in any conference he/she is registered in without the need for a "scan" or "check for new mail" delay. 4) Co-SysOp Flag - This bit is set is a user has CO-SYSOP status within a given conference. If set, a user may read or delete ANY (and ALL) messages within this conference. He/She is the "Conference Cop". The method used to calculate the number of BYTES necessary to contain the bits for ALL the conferences follows. (BASIC code is shown) Tmp% = ConfAreas% * BitFields% SizeofBits% = Tmp% \ 8 IF Tmp% MOD 8 > 0 THEN SizeofBits% = SizeofBits% + 1 END IF The BYTES are filled with BITS in the following order: 1) Registered for each Conference 2) Scan for each Conference 3) Mail Waiting for each Conference 4) Co-Sysop for each Conference InterBBS version 1.2 uses 4 bit fields. Given this: A system with 1000 conferences configured would require a total of 500 BYTES (4000 bits) to map the bits for all the conferences. The first 1,000 bits contain conference registration flags; the second 1,000 bits contain the global scan flag for each conference; the third 1,000 bits contain the personal mail waiting flag for each conference; the fourth 1,000 bits contain the co-sysop flag for each conference. A system with 4,096 conferences would require 2048 BYTES to contain ALL the bits. ------------------------------------------------------------------------------ CONTROL FILES - FNUSERS.INF FNUSERS.INF contains user account information which has overflowed from the USERS file. It, too, has a fixed length of 400 bytes. FNUSERS.INF file DES NOT use null-terminated strings. Developers should keep this in mind when manipulating the FNUSERS.INF file. The BASIC structure of the FNUSERS.INF file follows. TYPE UserInfo DateLastPaid AS INTEGER Date of Last Subscription Payment. CostPerHr AS SINGLE The user's cost per hour of BBS usage. HoursUsed AS SINGLE Total Hours the user has been charged. MoneyUsed AS SINGLE Total amount the user has been charged. MoneyTotal AS SINGLE Total amount received from user. Street1 AS STRING * 40 User's Address - Part 1. Street2 AS STRING * 40 User's Address - Part 2. City AS STRING * 25 User's City. State AS STRING * 15 User's State/Province. ZipCode AS STRING * 10 User's Zip/Postal Code. Country AS STRING * 15 User's Country. UnUsed1 AS String * 8 UnUsed by InterBBS v1.2 (RESERVED) Sex AS String * 1 "M", "F", "U" to denote user's sex. Personal1 AS STRING * 70 User Comment. Public. Personal2 AS STRING * 70 SysOp Comment. Private. AliasName AS STRING * 25 User's Alias Name. MessagesLeft AS LONG Number of messages left by the user. ClrMsgs AS STRING * 1 Clear Screen between msgs? 1=Yes; 0=No KeepHdr AS STRING * 1 Keep msg display header intact when reading multiple screen messages? 1=Yes; 0=No. NewFlag AS STRING * 1 Use "graphical" file viewing/flagging 1=Yes; 0=No. TodayCALLS AS STRING * 1 Number of times user logged on today. DlqwkToday AS INTEGER # of QWK Messages user has D/L today. DlqwkTotal AS LONG TOTAL # of QWK Messages user has D/L. Reserved AS STRING * 49 UnUsed by InterBBS v1.2 (Reserved) END TYPE