home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / DEVELOP.ZIP / CNAMES.DOC < prev    next >
Text File  |  1995-04-05  |  9KB  |  177 lines

  1.   WARNING:  This document is subject to change at any time.  Any changes made
  2.   will be indicated by a vertical bar (|) in column 1 of the file.
  3.  
  4. | Last update: 04/05/94
  5.  
  6. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7.  
  8.   PCBoard v15.0 now uses two separate files for conference information.  They
  9.   are CNAMES.@@@ and CNAMES.ADD.  Both of which are random access (fixed length
  10.   records).  A discussion of each follows:
  11.  
  12.  
  13.                             CNAMES.@@@ FILE LAYOUT
  14.                             ----------------------
  15.  
  16.   The CNAMES.@@@ files is a random access file with 2 byte (INTEGER) at the
  17.   start of the file that indicates the LENGTH of the conference record
  18.   structure.
  19.  
  20.   The actual file layout is as follows:
  21.  
  22.   typedef struct {
  23.     char Name[14];             conference name
  24.     bool PublicConf;           new user default registration
  25.     bool AutoRejoin;           auto-rejoin for this conference
  26.     bool ViewMembers;          allow viewing conference members
  27.     bool PrivUplds;            make uploads private
  28.     bool PrivMsgs;             make all messages private
  29.     bool EchoMail;             is this an Echo-Mail conference
  30.     int  ReqSecLevel;          security required to join non-public conf.
  31.     int  AddSec;               additional security level added after join
  32.     int  AddTime;              additional time added after join
  33.     char MsgBlocks;            number of message base index blocks
  34.     char MsgFile[32];          name and location of messages file
  35.     char UserMenu[32];         name and location of Users Menu
  36.     char SysopMenu[32];        name and location of Sysops Menu
  37.     char NewsFile[32];         name and location of Conference News
  38.     char PubUpldSort;          sort type for public upload DIR file
  39.     char UpldDir[29];          name and location of public upload DIR file
  40.     char PubUpldLoc[26];       public upload location
  41.     char PrvUpldSort;          sort type for public upload DIR file
  42.     char PrivDir[29];          name and location of private upload DIR file
  43.     char PrvUpldLoc[26];       private upload location
  44.     char DrsMenu[29];          name and location of conference doors menu
  45.     char DrsFile[33];          name and location of DOORS.LST file
  46.     char BltMenu[29];          name and location of conference blt menu
  47.     char BltNameLoc[33];       name and location of BLT.LST file
  48.     char ScrMenu[29];          name and location of conference scripts menu
  49.     char ScrNameLoc[33];       name and location of SCRIPT.LST
  50.     char DirMenu[29];          name and location of directories menu
  51.     char DirNameLoc[33];       name and location of DIR.LST file
  52.     char PthNameLoc[33];       name and location of DLPATH.LST file
  53.   } pcbconftype;
  54.  
  55.   Accessing the file then is a simple matter of determine which record number
  56.   you want and multiplying it by the size of the conference record and then
  57.   adding the two byte offset for the header.
  58.  
  59.   In other words, you might do the following:
  60.  
  61.       read(cnames,&RecSize,sizeof(int));
  62.       lseek(cnames,(ConfNum-1)*RecSize+sizeof(int),SEEK_SET);
  63.       read(cnames,&ConfRec,sizeof(pcbconftype));
  64.  
  65.   Note that you first read in the two byte header to determine the actual
  66.   record size on disk.  You can do this ONCE at the startup of your code
  67.   and record the value so that you never have to read it again.
  68.  
  69.   The record size MAY may be larger than the size of the structure that you
  70.   want to read in since you may not want to use the entire structure or it
  71.   may be updated in a later release of PCBoard code.  So by using the two
  72.   byte header as your record size you will remain compatible with updates
  73.   to PCBoard.
  74.  
  75.   Also, notice that in the lseek() function call the size of the header was
  76.   added to the equation so that you are positioned right where the record
  77.   starts in the file.
  78.  
  79.   NOTE:  The file layout for the CNAMES file does not contain any kind of
  80.   limit as to the number of conferences which may be stored in the file.
  81.   However, since PCBoard uses an unsigned integer for the conference number
  82.   it limits the number to 65535.
  83.  
  84.   HOWEVER, because the "Main Board Area" counts as one AREA - the highest
  85.   "numbered" conference on a system will be 65534 because one more than that
  86.   would create 65536 conference AREAS which would not fit inside of an
  87.   unsigned integer.
  88.  
  89.                             CNAMES.ADD FILE LAYOUT
  90.                             ----------------------
  91.  
  92.   The CNAMES.@@@ files is a random access file of 256 bytes per record with
  93.   the first record starting at offset 0 (no header information).
  94.  
  95.   The actual file layout is as follows:
  96.  
  97.   #define ADDCONFRESERVE     64
  98.  
  99.   typedef struct {
  100.     bool ForceEcho;             turn off echo question, force all msgs to echo
  101.     bool ReadOnly;              do not allow ANY msgs to be entered in conf
  102.     bool NoPrivateMsgs;         do not allow PRIVATE msgs to be entered
  103.     char RetReceiptLevel;       level required to request return receipts
  104.     bool RecordOrigin;          Record ORIGIN in messages
  105.     bool PromptForRouting;      Prompt user for ROUTING information
  106.     bool AllowAliases;          Allow aliases to be used
  107.     bool ShowIntroOnRA;         Show the Conf INTRO in the middle of R A scan
  108.     char ReqLevelToEnter;       Security Level required to enter messages
  109.     char Password[13];          password reqd to join if private
  110.     char Intro[32];             name/location of conference INTRO file
  111.     char AttachLoc[32];         location for file attachment storage
  112.     char RegFlags[4];           RXS flags for automatic conf registration
  113.     char AttachLevel;           Level required to attach a message
  114.     char CarbonLimit;           max number of names in carbon list
  115.     char CmdLst[32];            name/location of CMD.LST use instead of default
  116.     bool OldIndex;              maintain old MSGS indexes?
  117.     bool LongToNames;           allow long TO: names to be entered
  118.     char CarbonLevel;           level required to enter @LIST@ messages
  119.     char ConfType;              one byte code for conference type (*see below)
  120.     long ExportPtr;             a pointer to the last message number exported
  121.     float ChargeTime;           amount to charge for time spent in conference
  122.     float ChargeMsgRead;        amount to charge for each message read
  123.     float ChargeMsgWrite;       amount to charge for each message written
  124.     char Reserved[ADDCONFRESERVE];  reserved for future growth
  125.     char Name2[48];             conf name #2 (**see below)
  126.   } addconftype;
  127.  
  128.   Accessing the file then is a simple matter of determine which record number
  129.   you want and multiplying it by the size of the conference record.
  130.  
  131.   In other words, you might do the following:
  132.  
  133.       lseek(file,(ConfNum-1)*sizeof(addconftype),SEEK_SET);
  134.       read(file,&AddRec,sizeof(addconftype));
  135.  
  136.   *NOTE:  Conference types are defined as follows:
  137.  
  138.           ConfType = 0 = Normal PCBoard Conference
  139.           ConfType = 1 = Internet Email (Import & Export)
  140.           ConfType = 2 = Internet/Usenet Junk (Import Only)
  141.           ConfType = 3 = Usenet Moderated Newsgroup
  142.                          (Import Normally /
  143.                           Export Public Messages as Email to Moderator /
  144.                           Export Private Messages as Email to TO:)
  145.           ConfType = 4 = Usenet Public Newsgroup
  146.                          (Import Normally /
  147.                           Export Public Messages as Articles /
  148.                           Export Private Messages as Email to TO:)
  149.           ConfType = 5 = Fido Conference
  150.  
  151.    **NOTE: The actual conference name is now composed of two parts.  The
  152.            first 13 bytes of the name are found in CNAMES.@@@, the last 47
  153.            bytes of the name are found in CNAMES.ADD at the end of the
  154.            structure (skipping over the reserved bytes).  Don't forget that
  155.            the first part had a NULL terminator which needs to be removed as
  156.            you concatenate the two strings together.
  157.  
  158.  
  159.                             CNAMES.IDX FILE LAYOUT
  160.                             ----------------------
  161.  
  162. | The CNAMES.IDX file is used by 1) PCBoard to speed up the (J)oin Command
  163. | when used with a conference name, and 2) by the UUCP import utility (UUIN)
  164. | to speed up the importing process.
  165. |
  166. | The file is composed of one record per conference, with the record format
  167. | looking like this:
  168. |
  169. | typedef struct {
  170. |     char     Name [ 60 + 1 ];
  171. |     unsigned Num;
  172. | } cnamesidxtype;
  173. |
  174. | The Name field is NUL terminated, and the Num field is the conference
  175. | number.  The entire file is sorted by conference name (case insensitive).
  176.  
  177.