home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / RP-110.ZIP / RPSTRUCT.INC < prev    next >
Encoding:
Text File  |  1994-10-01  |  9.7 KB  |  279 lines

  1. (*
  2. ** Prime request processor for Frontdoor structure file
  3. **
  4. ** Copyright (c) 1993,94 Tisas Development; All rights reserved.
  5. **
  6. ** Structures designed by Hans Siemons, Prime Productions and
  7. **                        Marco Miltenburg.
  8. **
  9. **
  10. ** Last revision (dd/mm/yy) : 01-10-94
  11. **
  12. ** [...]
  13. ** This information is not necessarily final and is subject to change at any
  14. ** given time without further notice
  15. ** [...]
  16. *)
  17.  
  18. (*
  19. ** General notes:
  20. ** date format used everywhere is the UNIXdate format.
  21. ** CRC's over strings are on the text only (not the size). 'A'..'Z' are
  22. ** casted to 'a'..'z'. (international characters are not taken in
  23. ** considiration!
  24. **
  25. ** CRC's over AKA's, are simply CRC's over the '8' bytes.
  26. **
  27. ** The CRC's are the standard CRC32's, used by PKZip and ZModem.
  28. **
  29. ** If you do not have any library to calculate them, use the CRC32 routines
  30. ** from RADUMISC.TPU (included with RADU)
  31. *)
  32.  
  33. (*
  34. ** FILEBASE.RP contains the database to the filebase. The request processor
  35. ** only takes this file, and the magic filename database in consideration
  36. ** when a node requests something.
  37. **
  38. ** Duplicate files in different groups in no problem. RP will never send the
  39. ** same file twice.
  40. *)
  41.  
  42. Type FIdx = record                                            { FILEBASE.RP }
  43.              FileName : array[1..11] of char; { filename }
  44.              size     : Longint;    { filesize }
  45.              date     : Longint;    { filedate }
  46.              dir      : Longint;    { pointer to directory }
  47.              pwdcrc   : Longint;    { crc-32 over password,-1=no password }
  48.              group    : byte;       { group of file }
  49.            end;
  50.  
  51. (*
  52. ** Descriptions are placed in DESCRIPT.RP, and is a file of character. It just
  53. ** contains the pure text.
  54. *)
  55.  
  56.      DescInfoRecord=record                                 { descinfo.rp }
  57.               FileName  : Longint;                { crc-32 over filename }
  58.               desc      : Longint;              { pointer to description }
  59.               Descs     : Integer;               { length of description }
  60.               Downloads : Word;                    { number of downloads }
  61.             end;
  62.  
  63. (*
  64. ** Magic names database
  65. ** This database is searched in first. If a file has a "magic hit", it can
  66. ** never have a "file hit" anymore.
  67. **
  68. ** For magic names that represent more then one file, a record is added
  69. ** per file. The request processor itselve handles it correctly.
  70. *)
  71.      Midx = record                                               { MAGIC.RP }
  72.               Magicname,            { crc-32 over magic name }
  73.               Pwdcrc,               { crc-32 over password,-1=no password }
  74.               FileName : Longint;   { pointer to filelist }
  75.               size,                 { filesize }
  76.               date     : Longint;   { filedate }
  77.               Group    : Byte;      { group of file }
  78.               MType    : Byte;      { 0=magic filename
  79.                                       1=function request
  80.                                       2=template request }
  81.             end;
  82.  
  83. (*
  84. ** FileName (Midx) and dir (Fidx) point a in straight ascii text file called
  85. ** "textbase.rp". If RP hits on a magic name, it extracts from "textbase.rp"
  86. ** the actual filename. If RP hits on a filename, it extracts the directory
  87. ** from it.
  88. *)
  89.  
  90. (*
  91. ** the group field in the magic and filebase also contain 3 flags for
  92. ** marking files as free.
  93. **
  94. ** bit 0-4=group itselve
  95. ** bit   5=free kilobytes
  96. ** bit   6=free time
  97. ** bit   7=free match
  98. *)
  99.  
  100. (*
  101. ** REQUESTD.RP contains information about what a node already requested,
  102. ** and is used to setup "requestlimits" per day.
  103. **
  104. ** There can be more then one record from the same node, since FDRPR
  105. ** stores a record per "request session".
  106. *)
  107.  
  108.      Requested=
  109.        record                                                 { REQUESTD.RP }
  110.          NodeCrc : Longint;                               {crc-32 over node#}
  111.          FileID : Longint;
  112.          StatKB,
  113.          KBrequested,
  114.          NRrequested,
  115.          TIMErequested : Longint;
  116.          RequestDate : Longint;                 { date of request, unixdate }
  117.          Recovertime : Integer;                       { recovertime of node }
  118.        end;
  119.  
  120. Type
  121.      GroupAccessType=set of 1..26;
  122.      AvailableType=array[0..6] of set of 0..143;       { timeslot variabele }
  123.      TaskAvailableType=set of byte;
  124.  
  125. (*
  126. ** Node definition file.
  127. *)
  128.      Noderecord=
  129.        record                                        { nodefile.rp }
  130.          Zone,
  131.          Net,
  132.          Node,
  133.          Point : word;
  134.          wildcard : byte;  { 0=zone:net/node.point
  135.                              1=zone:net/node.*
  136.                              2=zone:net/*
  137.                              3=zone:*
  138.                            }
  139.          Name : String[40];
  140.          Level : word;
  141.          groups : GroupAccessType;
  142.          Deleted : boolean;
  143.          DenyRequest : boolean;
  144.          TimeToRecover : Integer;
  145.          LimitedTime : Boolean;
  146.          TaskAvailable : TaskAvailabletype;
  147.          LimitTask : Boolean;
  148.          Available : AvailableType;
  149.        end;
  150.  
  151. Const MyRev=2;
  152.  
  153. type PathStr=String[78];
  154.  
  155. (*
  156. ** Available type is an array (arrays states the days, sunday=0), that contains
  157. ** the timeslot information.
  158. ** in 0 in set, then available from 00:00 till 00:10
  159. ** if 1 in set, then available from 00:10 till 00:20
  160. **
  161. ** [...]
  162. **
  163. ** if 143 in set, then available from 23:50 till 00:00
  164. *)
  165.  
  166.      timeslottype=
  167.        record
  168.          start,        { minutes since 00:00 }
  169.          stop : longint;
  170.        end;
  171.  
  172.      groupsetup=
  173.        record
  174.          Name : string[20];                                    { group name }
  175.          Paths : PathStr;
  176.          Magics : PathStr;
  177.          Passwords : PathStr;                           { file of passwords }
  178.          minbaud : Longint;
  179.          StopMatch : Boolean;
  180.          FreeKB,
  181.          FreeTime,
  182.          FreeMatch,
  183.          ShowPWDfailures,
  184.          ShowNoAccess,
  185. {}       CompileOnce,
  186.          CDrom : Boolean;
  187.          LimitedTime : boolean;                          { limit hours ;-)) }
  188.          TaskAvailable : TaskAvailableType;            { available on tasks }
  189.          LimitTask : Boolean;
  190.          Available : AvailableType;
  191.        end;
  192.      groupsetupar=array[1..26] of groupsetup;
  193.  
  194. { RP reads like this:
  195.  
  196.   read record,
  197.   level lower or requel to then "userlevel" : read it
  198.   baudrate lower or equel to to then "userbaudrate" : read it
  199.  
  200.   These records are sorted on level and baudrate, where level is the primary key
  201. }
  202.  
  203.      LimitRecord=
  204.        record
  205.          level : word;
  206.          Baudrate : longint;
  207.          MaxMatchPT,   { pt=per time slot }
  208.          MaxTimePT,
  209.          MaxKBPT,
  210.          MaxMatchPS,   { ps=per session }
  211.          MaxTimePS,
  212.          MaxKBPS : word;
  213.          LimitedTime : boolean;
  214.          Available : AvailableType;
  215.          LimitTask : Boolean;
  216.          TaskAvailable : TaskAvailableType;            { available on tasks }
  217.        end;
  218.  
  219.      ULnodelimittype=record      { unlistednode limit type }
  220.         Groups : GroupAccessType;
  221.         Level : word;
  222.         Recovertime : Integer;
  223.       end;
  224.  
  225.      MailerUsedType=(FD212,FD220b,FD230,Im227);   { fd 2.30 is not used yet }
  226.  
  227.      CtlMainHdr=
  228.        record                                                   { setup.rpr }
  229.          Signature : Longint;                  { must contain <R><P><R><#0> }
  230.          Revision : word;                                 { must be <myrev> }
  231.          LimitRecSize,
  232.          NodeRecSize : word;
  233.        end;
  234.      CtlHdr=
  235.        record
  236.          Signature : Longint;                  { must contain <R><P><R><#0> }
  237.          ID : Word;                                     { ID# for next part }
  238.          Records,                                       { number of records }
  239.          RecordSize : word;          { total size in bytes of these records }
  240.        end;
  241.  
  242. (*
  243. ** The CTLfile consist of the CtlMainHdr, followed by CtlHdr+specific fields
  244. ** belong with that header.
  245. *)
  246.  
  247. Const
  248.   CtlID_Settings=1;                               { Followed by CtlSettings }
  249.   CtlID_DefaultNode=2;                             { Followed by NODErecord }
  250.   CtlID_StandardLimits=3;                      { Followed by StandardLimits }
  251.   CtlID_Groups=4;                                { followed by GroupSetupAr }
  252.  
  253. Type
  254.      StandardLimitsRecord=
  255.        record
  256.          nlsecure,                 { not listed in database, secure session }
  257.          nlunsecure,              { not listed in databse, unsecure session }
  258.          nlnodelist : ULnodelimittype;
  259.                            { not listed in database, not listed in nodelist }
  260.        end;
  261.      NiceScreenSet = Set of (showfound,showhandling,scroll);
  262.  
  263.      CtlSettings=
  264.        record
  265.          Editor : PathStr;                                { external editor }
  266.          LogFile : PathStr;                { logfile. Empty=use frodo's log }
  267.          CompLogFile : PathStr;       { RPcomp logfile, empty use "logfile" }
  268.          SystemPath : PathStr;                { Empty=use RP.EXE's home dir }
  269.          WorkDir : PathStr;                                    { for cd-rom }
  270.          ListPath,                            { default path for list files }
  271.          CCpath,                   { *.msg dir for copies of response mess. }
  272.          TemplatePath : PathStr;               { default path for templates }
  273.          MailerUsed : MailerUsedType;                         { Mailer used }
  274.          MaxWildCards : byte;                           { Maximum wildcards }
  275.          NiceScreen : NiceScreenSet;
  276.          SwapOut : Boolean;                  { swap out on service requests }
  277.        end;
  278.  
  279.