home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / com / bbs / downsrt / source / area_102.h < prev    next >
C/C++ Source or Header  |  1990-08-01  |  9KB  |  183 lines

  1. /***************************************************************************
  2.                              AREA.IDX Structures
  3.  ***************************************************************************/
  4.  
  5.  
  6. struct _aidx
  7. {
  8.   word  area;       /* Same format as area.areano */
  9.   dword offset;
  10.   dword name_crc;   /* Currently undefined, but reserved by Maximus.       *
  11.                      * This will probably become a CRC-32 of the           *
  12.                      * area.name string, below... but is currently not     *
  13.                      * implemented.                                        */
  14. };
  15.  
  16.  
  17. /***************************************************************************
  18.                              AREA.DAT Structures
  19.  ***************************************************************************/
  20.  
  21. #ifdef NEVER
  22.  
  23. /*  NOTE:  The _area structure has a dynamic length!  To access this file, *
  24.  *         you should read the first _area structure from the file, and    *
  25.  *         check the struct_len byte.  Then, to access the file, you seek  *
  26.  *         to each new location, instead of reading straight through.      *
  27.  *                                                                         *
  28.  *         For example, to read all of the _area file into an array, you   *
  29.  *         MUST do it like this, for upward compatiblity:                  */
  30.  
  31.   {
  32.     struct _area area[NUM_AREAS];
  33.  
  34.     int x,
  35.         slen;
  36.  
  37.     if ((areafile=open(area_name,O_RDONLY | O_BINARY))==-1)
  38.       Error();
  39.  
  40.     /* Read the first record of the file, to grab the structure-length     *
  41.      * byte.                                                               */
  42.  
  43.     read(areafile,&area[0],sizeof(struct _area));
  44.     slen=area[0].struct_len;
  45.  
  46.     for (x=0;! eof(area_data);x++)
  47.     {
  48.       /* Note this lseek() call, which positions the pointer to the        *
  49.        * start of the next record, no matter how long the previous         *
  50.        * record was.                                                       */
  51.  
  52.       lseek(areafile,x*(long)struct_len,SEEK_SET);
  53.       read(areafile,&area[x],sizeof(struct _area));
  54.     }
  55.  
  56.     close(areafile);
  57.   }
  58.  
  59. #endif
  60.  
  61.  
  62. struct _override
  63. {
  64.   int priv;   /* Override priv level */
  65.   byte lock;  /* Override lock setting */
  66.  
  67.   byte ch;    /* First letter of menu option to apply override to */
  68. };
  69.  
  70.  
  71.  
  72. #define AREA_id   0x54414441L /* "ADAT" */
  73.  
  74. struct _area
  75. {
  76.   long id;              /* Unique identifier for AREA.DAT structure.       *
  77.                          * Should be AREA_id, above.                       */
  78.  
  79.   word struct_len;      /* Length of _area structure -- this needs only    *
  80.                          * to be read from the first record in an area     *
  81.                          * data file, since it can be assumed to remain    *
  82.                          * the same throughout the entire file.  This is   *
  83.                          * GUARANTEED to be at offset two for all future   *
  84.                          * versions of this structure.                     */
  85.  
  86.   word areano;          /* This is the integer representation of this      *
  87.                          * area's name, and will be obsoleted very         *
  88.                          * shortly, even though the current version of     *
  89.                          * Maximus uses this internally.  Use the 'name'   *
  90.                          * element instead:  It is a standard string, and  *
  91.                          * is what will be supported in future versions.   *
  92.                          * One of the items on our "To Do" list is to      *
  93.                          * completely go with area names.  This means that *
  94.                          * we'll be using a string for an area "number",   *
  95.                          * and it could theoretically be as long as could  *
  96.                          * fit in the 'name' variable, as long as it is a  *
  97.                          * single word.  ie. "BinkleyTerm" could be a      *
  98.                          * valid area name!  By using the 'name' element   *
  99.                          * as a straight ASCII string, you'll have         *
  100.                          * automatic support for future versions of Max.   */
  101.  
  102.   byte name[40];        /* String format of area's name.  USE THIS!        */
  103.  
  104.   /*************************************************************************/
  105.   /**                        Message Area Information                     **/
  106.   /*************************************************************************/
  107.  
  108.   word area_type;       /* Message base type.  0x00 = *.MSG.  Others are   *
  109.                          * currently undefined, and rsvd by Maximus.       */
  110.  
  111.   byte msgpath[80],     /* Path to messages                                */
  112.        msgname[40],     /* The 'tag' of the area, for use in ECHOTOSS.LOG  */
  113.        msginfo[80],     /* The DIR.BBS-like description for msg section    */
  114.        msgbar[80],      /* Barricade file for message area                 */
  115.        origin[62];      /* The ORIGIN line for this area                   */
  116.  
  117.  
  118.   sword msgpriv;        /* This is the priv required to access the msg     *
  119.                          * section of this area.                           */
  120.   byte msglock;         /* The lock for the message area                   */
  121.  
  122.   byte fill1;
  123.  
  124.   sword origin_aka;     /* This is the AKA number to use on the origin     *
  125.                          * line.  See the normal SysOp documentation on    *
  126.                          * the "Origin" statement, for info on how this    *
  127.                          * number is used.                                 */
  128.  
  129.   /*************************************************************************/
  130.   /**                        File Area Information                        **/
  131.   /*************************************************************************/
  132.  
  133.  
  134.   byte filepath[80],    /* Path for downloads                              */
  135.        uppath[80],      /* Path for uploads                                */
  136.        filebar[80],     /* Barricade file for file areas                   */
  137.        filesbbs[80],    /* Path to FILES.BBS-like catalog for this area    */
  138.        fileinfo[80];    /* The DIR.BBS-like description for file section   */
  139.  
  140.   sword filepriv;       /* This is the priv required to access the file    *
  141.                          * section of this area.                           */
  142.   byte filelock;        /* The locks for the file area                     */
  143.   byte fill2;
  144.  
  145.   /*************************************************************************/
  146.   /**                      Miscellaneous Information                      **/
  147.   /*************************************************************************/
  148.  
  149.  
  150.   byte msgmenuname[13], /* Alternate *.MNU name to use for this msg.area   */
  151.        filemenuname[13];/* Alternate *.MNU name to use for this file area  */
  152.  
  153.   word attrib[MAXCLASS];/* This is an array of attributes for the          *
  154.                          * msg/file areas.  These are dependant on PRIV    *
  155.                          * level.  Once you have the CLASS number for a    *
  156.                          * particular user (via Find_Class_Number()), you  *
  157.                          * can find the attributes for that particular     *
  158.                          * priv level like this: "area.attrib[class]"      *
  159.                          * ...which will get you the attribute for that    *
  160.                          * priv level.                                     */
  161.  
  162.   /*************************************************************************/
  163.   /**                      Stuff hacked on later                          **/
  164.   /*************************************************************************/
  165.  
  166.   struct _override movr[MAX_OVR]; /* Override privs for msg/file areas */
  167.   struct _override fovr[MAX_OVR];
  168.  
  169. };
  170.  
  171.  
  172. /* Area attributes, for area.attrib[] (above) */
  173.  
  174. #define  SYSMAIL   0x0001 /* is a mail area                                */
  175. #define  NOPUBLIC  0x0004 /* OPUS: Disallow public messages                */
  176. #define  NOPRIVATE 0x0008 /* OPUS: Disallow private messages               */
  177. #define  ANON_OK   0x0010 /* OPUS: Enable anonymous messages               */
  178. #define  ECHOMAIL  0x0020 /* OPUS: Set=Echomail Clear=Not Echomail         */
  179. #define  HIGHBIT   0x0040 /* MAX:  Allow high-bit chars in this area       */
  180. #define  NREALNAME 0x0200 /* MAX:  Don't use ^aREALNAME for this area      */
  181. #define  UREALNAME 0x0400 /* MAX:  Use usr.realname instead of usr.name    */
  182.  
  183.