home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / PBAPI10.ZIP / APIDOCS.ZIP / FAREA.DOC < prev    next >
Text File  |  1998-02-21  |  14KB  |  366 lines

  1. Author....... : Gary Price
  2. Copyrighted by: Freejack's Software 1997-98
  3.  
  4. FAREA_DAT API for TriBBS v10.x/11.x written in PowerBasic v3.5
  5. ---------------------------------------------------------------------------
  6.  
  7. The FAREA_DAT unit is used to manipulate data in the FAREA.DAT data file
  8. found in node 1's MWORK directory. The FAREA_DAT unit is declared in
  9. PBAPI10.INC as follows:
  10.  
  11.  Farea.dat BitFields Breakdown
  12.  
  13.  FareaBit.bit1 BIT Assignment
  14.     0 = PrivateAreaFlag
  15.     1 = CDROMFileAreaFlag
  16.     2 = AliasAreaFlag
  17.     3 = OfflineFileAreaFlag
  18.     4 = MasterIndexFlag
  19.     5 to 7 Reserved, set to all 0's
  20.  
  21.  FareaBit.bit2 to FareaBit.bit10, Reserved and all bit's set to 0
  22.  
  23.  Sub Type Structure for 10 byte BitFields
  24. TYPE FareaBit
  25.   bit1  AS BYTE
  26.   bit2  AS BYTE
  27.   bit3  AS BYTE
  28.   bit4  AS BYTE
  29.   bit5  AS BYTE
  30.   bit6  AS BYTE
  31.   bit7  AS BYTE
  32.   bit8  AS BYTE
  33.   bit9  AS BYTE
  34.   bit10 AS BYTE
  35. END TYPE
  36.  
  37. ---------------------------------------------------------------------------
  38.  
  39.  Sub Type Structure for 10 Additional File Area Paths BitFields
  40.  
  41. TYPE AFAP
  42.   FP1  AS STRING * 81
  43.   FP2  AS STRING * 81
  44.   FP3  AS STRING * 81
  45.   FP4  AS STRING * 81
  46.   FP5  AS STRING * 81
  47.   FP6  AS STRING * 81
  48.   FP7  AS STRING * 81
  49.   FP8  AS STRING * 81
  50.   FP9  AS STRING * 81
  51.   FP10 AS STRING * 81
  52. END TYPE
  53.  
  54. ---------------------------------------------------------------------------
  55.  
  56.  File Name: Main Type Structure for "FAERA.DAT" file
  57.  
  58. TYPE FAREA
  59.   FareaName               AS STRING * 41
  60.   FileAreaPath            AS STRING * 81
  61.   FileAreaUploadPath      AS STRING * 81
  62.   FileAreaFileList        AS STRING * 81
  63.   FileAreaUploadList      AS STRING * 81
  64.   FileAreaIndexFile       AS STRING * 81
  65.   AdditionalFileAreaPaths AS AFAP
  66.   SecurityLevel           AS INTEGER
  67.   ViewSecurityLevel       AS INTEGER
  68.   FileSortType            AS INTEGER
  69.   FileBitFields           AS FareaBit
  70.   OfflineDiscNumber       AS INTEGER
  71.   ReservedDataArea        AS STRING * 2822
  72. END TYPE
  73.  
  74. DIM FareaBit AS FareaBit
  75. DIM AFAP     AS AFAP    
  76. DIM FAREA    AS SHARED FAREA
  77. DIM fa       AS SHARED FAREA PTR
  78.  
  79. fa = VARPTR32(FAREA)
  80. LSET FAREA = FAREA
  81. ---------------------------------------------------------------------------
  82.  
  83. FUNCTION's below are from the FAREA.PBU Unit and DECLAREd in PBAPI10.INC.
  84.  
  85. FUNCTION FAREA_DAT_OPEN()
  86. FUNCTION FAREA_DAT_CLOSE()
  87. FUNCTION FAREA_DAT_READ(n AS INTEGER)
  88. FUNCTION FAREA_DAT_WRITE(n AS INTEGER)
  89. FUNCTION FAREA_DAT_Length() AS LONG
  90. FUNCTION FAREA_DAT_OpenRead(n AS INTEGER)
  91. FUNCTION FAREA_DAT_WriteClose(n AS INTEGER)
  92. FUNCTION FAREA_DAT_OpenReadClose(n AS INTEGER)
  93. FUNCTION FAREA_DAT_OpenWriteClose(n AS INTEGER)
  94. FUNCTION FAREA_DAT_Clearit(n AS INTEGER)
  95.  
  96. FUNCTION FAREA_DAT_GetFAN() AS STRING
  97. FUNCTION FAREA_DAT_PutFAN(s AS STRING)
  98. FUNCTION FAREA_DAT_GetFAP() AS STRING
  99. FUNCTION FAREA_DAT_PutFAP(s AS STRING)
  100. FUNCTION FAREA_DAT_GetFAUP() AS STRING
  101. FUNCTION FAREA_DAT_PutFAUP(s AS STRING)
  102. FUNCTION FAREA_DAT_GetFAFL() AS STRING
  103. FUNCTION FAREA_DAT_PutFAFL(s AS STRING)
  104. FUNCTION FAREA_DAT_GetFAUL() AS STRING
  105. FUNCTION FAREA_DAT_PutFAUL(s AS STRING)
  106. FUNCTION FAREA_DAT_GetFAIF() AS STRING
  107. FUNCTION FAREA_DAT_PutFAIF(s AS STRING)
  108. FUNCTION FAREA_DAT_GetAFAP(n AS INTEGER) AS STRING
  109. FUNCTION FAREA_DAT_PutAFAP(n AS INTEGER, s AS STRING)
  110.  
  111. FUNCTION FAREA_DAT_GetSL() AS INTEGER
  112. FUNCTION FAREA_DAT_PutSL(n AS INTEGER)
  113. FUNCTION FAREA_DAT_GetVSL() AS INTEGER
  114. FUNCTION FAREA_DAT_PutVSL(n AS INTEGER)
  115. FUNCTION FAREA_DAT_GetODN() AS INTEGER
  116. FUNCTION FAREA_DAT_PutODN(n AS INTEGER)
  117. FUNCTION FAREA_DAT_GetFST() AS INTEGER
  118. FUNCTION FAREA_DAT_PutFST(n AS INTEGER)
  119.  
  120. FUNCTION FAREA_DAT_GetPFAF() AS INTEGER
  121. FUNCTION FAREA_DAT_PutPFAF(n AS INTEGER)
  122. FUNCTION FAREA_DAT_GetCDFAF() AS INTEGER
  123. FUNCTION FAREA_DAT_PutCDFAF(n AS INTEGER)
  124. FUNCTION FAREA_DAT_GetAFAF() AS INTEGER
  125. FUNCTION FAREA_DAT_PutAFAF(n AS INTEGER)
  126. FUNCTION FAREA_DAT_GetOFAF() AS INTEGER
  127. FUNCTION FAREA_DAT_PutOFAF(n AS INTEGER)
  128. FUNCTION FAREA_DAT_GetMIFAF() AS INTEGER
  129. FUNCTION FAREA_DAT_PutMIFAF(n AS INTEGER)
  130.  
  131. -----------------------------------------------------------------------------
  132. IMPORTANT: TBNode1sMainDirectory must be set to node 1's main directory
  133.            before calling to any Function with the "OPEN" command in it. 
  134.  
  135. FAREA_DAT_Open
  136.  The FAREA_DAT_Open Function opens the FAREA.DAT data file in node 1's MWORK
  137.   directory.
  138.  
  139. FAREA_DAT_Close
  140.  The FAREA_DAT_Close Function closes the FAREA.DAT data file in node 1's MWORK
  141.  directory.
  142.  
  143. FAREA_DAT_Read(n AS INTEGER)
  144.  The FAREA_DAT_Read Function reads the record for file area "n" into memory.
  145.  
  146. FAREA_DAT_Write(n AS INTEGER)
  147.  The FAREA_DAT_Write Function updates the record for file area "n" from
  148.  memory.
  149.  
  150. FAREA_DAT_Length() AS LONG
  151.  The FAREA_DAT_Length Function returns the number of records in the FAREA.DAT
  152.  file.
  153.  
  154. FAREA_DAT_OpenRead(n AS INTEGER)
  155.  The FAREA_DAT_OpenRead Function provides the Functionality of the
  156.  FAREA_DAT_Open and FAREA_DAT_Read Functions in a single Function call.
  157.  
  158. FAREA_DAT_WriteClose(n AS INTEGER)
  159.  The FAREA_DAT_WriteClose Function provides the Functionality of the
  160.  FAREA_DAT_Write and FAREA_DAT_Close Functions in a single Function call.
  161.  
  162. FAREA_DAT_OpenReadClose(n AS INTEGER)
  163.  The FAREA_DAT_OpenReadClose Function provides the Functionality of the
  164.  FAREA_DAT_Open, FAREA_DAT_Read, and FAREA_DAT_Close Functions in a single
  165.  Function call.
  166.  
  167. FAREA_DAT_OpenWriteClose(n AS INTEGER)
  168.  The FAREA_DAT_OpenWriteClose Function provides the Functionality of the
  169.  FAREA_DAT_Open, FAREA_DAT_Write, and FAREA_DAT_Close Functions in a single
  170.  Function call.
  171.  
  172. FAREA_DAT_ClearIt(n AS INTEGER)
  173.  The FAREA_DAT_ClearIt Function sets the entire FAREA_DAT data record for 'n'
  174.  to all zeros, leaving the data record in place, but empty.
  175.  
  176. -----------------------------------------------------------------------------
  177. POINTERS Uses a hidden variable I use called "@fa". Any reference to this is
  178. only for your information for discussion in this doc file. You will not need
  179. to concern yourself trying to use this.. All calls are handled in the main
  180. FAREA.PBU Unit by my routines automatically. In other words, I am trying to
  181. keep Pointers as easy as possible for your use. :)
  182.  
  183. Also, all calls to any Functions which gets data with the string routines
  184. will auto-trim each string's extra spaces and the null terminator, CHR$(0),
  185. off so printing will be easier for you to manipulate. When calling the string
  186. routines to put data back into the string space, all string data will be
  187. resized to fit the farea.dat type structure and will add the null terminator
  188. back to the end of the string. Just remember, when working the data in memory
  189. with the pointer calls, you still have to write the data back to the farea.dat
  190. in order for the changes to become permanent.
  191.  
  192. -----------------------------------------------------------------------------
  193. FAREA_DAT_GetFAN() AS STRING
  194.  This form of the FAREA_DAT_GetFAN Function returns a pointer to the file
  195.  area's name string. Also, trims the extra spaces off of the end of the
  196.  string.
  197.  
  198. FAREA_DAT_PutFAN(s AS STRING)
  199.  This form of the FAREA_DAT_PutFAN Function sets the file area's name string
  200.  to the string pointed to by "@fa". Note that the string pointed to by "@fa"
  201.  can be no more than 40 characters in length. Also, will add the NULL
  202.  Terminator back to the end of the string.
  203.  
  204. FAREA_DAT_GetFAP() AS STRING
  205.  This form of the FAREA_GetDAT_GetFAP Function returns a pointer to the file
  206.  area's file area path string. Also, trims the extra spaces off of the end of
  207.  the string.
  208.  
  209. FAREA_DAT_PutFAP(s AS STRING)
  210.  This form of the FAREA_DAT_PutFAP Function sets the file area's file area
  211.  path string to the string pointed to by "@fa". Note that the string pointed
  212.  to by "@fa" can be no more than 80 characters in length. Also, will add the
  213.  NULL Terminator back to the end of the string.
  214.  
  215. FAREA_DAT_GetFAUP() AS STRING
  216.  This form of the FAREA_DAT_GetFAUP Function returns a pointer to the file
  217.  area's file area upload path string. Also, trims the extra spaces off of
  218.  the end of the string.
  219.  
  220. FAREA_DAT_PutFAUP(s AS STRING)
  221.  This form of the FAREA_DAT_PutFAUP Function sets the file area's file area
  222.  upload path string to the string pointed to by "@fa".  Note that the string
  223.  pointed to by "@fa" can be no more than 80 characters in length. Also, will
  224.  add the NULL Terminator back to the end of the string.
  225.  
  226. FAREA_DAT_GetFAFL() AS STRING
  227.  This form of the FAREA_DAT_GetFAFL Function returns a pointer to the file
  228.  area's file area file list string. Also, trims the extra spaces off of the
  229.  end of the string.
  230.  
  231. FAREA_DAT_PutFAFL(s AS STRING)
  232.  This form of the FAREA_DAT_PutFAFL Function sets the file area's file area
  233.  file list string to the string pointed to by "@fa". Note that the string
  234.  pointed to by "@fa" can be no more than 80 characters in length. Also, will
  235.  add the NULL Terminator back to the end of the string.
  236.  
  237. FAREA_DAT_GetFAUL() AS STRING
  238.  This form of the FAREA_GetDAT_FAUL Function returns a pointer to the file
  239.  area's file area upload list string. Also, trims the extra spaces off of
  240.  the end of the string.
  241.  
  242. FAREA_DAT_PutFAUL(s AS STRING)
  243.  This form of the FAREA_DAT_PutFAUL Function sets the file area's file area
  244.  upload list string to the string pointed to by "@fa".  Note that the string
  245.  pointed to by "@fa" can be no more than 80 characters in length. Also, will
  246.  add the NULL Terminator back to the end of the string.
  247.  
  248. FAREA_DAT_GetFAIF() AS STRING
  249.  This form of the FAREA_DAT_GetFAIF Function returns a pointer to the file
  250.  area's file area index file string. Also, trims the extra spaces off of the
  251.  end of the string.
  252.  
  253. FAREA_DAT_PutFAIF(s AS STING)
  254.  This form of the FAREA_DAT_PutFAIF Function sets the file area's file area
  255.  index file string to the string pointed to by "@fa". Note that the string
  256.  pointed to by "@fa" can be no more than 80 characters in length. Also, will
  257.  add the NULL Terminator back to the end of the string.
  258.  
  259. FAREA_DAT_GetAFAP(n AS INTEGER) AS STRING
  260.  This form of the FAREA_DAT_GetAFAP Function returns a pointer to the file
  261.  area's additional file area path string number "(n)". "(n)" can be 1 to 10
  262.  for the 10 additional file area paths. Also, trims the extra spaces off of
  263.  the end of the string.
  264.  
  265. FAREA_DAT_PutAFAP(n AS INTEGER, s AS STRING)
  266.  This form of the FAREA_DAT_PutAFAP Function sets a file area's additional
  267.  file area paths string number "n" to the string pointed to by "@fa".  Note
  268.  that the string pointed to by "@fa" can be no more than 80 characters in
  269.  length. "n" can be 1 to 10 for the 10 additional file area paths. Also,
  270.  will add the NULL Terminator back to the end of the string.
  271.  
  272. FAREA_DAT_GetSL() AS INTEGER
  273.  This form of the FAREA_DAT_GetSL Function returns the file area's security
  274.  level.
  275.  
  276. FAREA_DAT_PutSL(n AS INTEGER)
  277.  This form of the FAREA_DAT_SecurityLevel Function sets the file area's
  278.  security level to "n". "n" must be in the range of "0 to 9999."
  279.  
  280. FAREA_DAT_GetVSL() AS INTEGER
  281.  This form of the FAREA_DAT_GetVSL Function returns the file area's view
  282.  security level.
  283.  
  284. FAREA_DAT_PutVSL(n AS INTEGER)
  285.  This form of the FAREA_DAT_PutVSL Function sets the file area's security
  286.  level to "n". "n" must be in the range of "0 to 9999."
  287.  
  288. FAREA_DAT_GetODN() AS INTEGER
  289.  This form of the FAREA_DAT_GetODN Function returns the file area's offline
  290.  disc number.
  291.  
  292. FAREA_DAT_PutODN(n AS INTEGER)
  293.  This form of the FAREA_DAT_PutODN Function sets the file area's offline disc
  294.  number to "n". "n" must be in the range of "0 to 9999."
  295.  
  296. FAREA_DAT_GetFST() AS INTEGER
  297.  This form of the FAREA_DAT_GetFST Function returns the file area's sort type.
  298.  
  299. FAREA_DAT_PutFST(n AS INTEGER)
  300.  This form of the FAREA_DAT_PutFST Function sets the file area's sort type to
  301.  "n". "n" must be in the range of 0 to 1 as follows:
  302.  
  303.     0 = Sorts the file list by date.
  304.     1 = Sorts the file list alphabetically by file name.
  305.  
  306. -----------------------------------------------------------------------------
  307. The BIT Fields, Private File Area Flag, CDROM File Area Flag, Alias Area Flag,
  308. Offline File Area Flag, & Master Index Flag, have been converted to INTEGER's
  309. to allow easier access and handling.
  310. -----------------------------------------------------------------------------
  311.  
  312. FAREA_DAT_GetPFAF() AS INTEGER
  313.  This form of the FAREA_DAT_GetPFAF Function returns the file area's private
  314.  file area flag.
  315.  
  316. FAREA_DAT_PutPFAF(n AS INTEGER)
  317.  This form of the FAREA_DAT_PutPFAF Function sets the file area's private
  318.  file area flag to "n". "n" must be in the range of 0 to 1 as follows:
  319.  
  320.     0 = The file area is not a private file area.
  321.     1 = The file area is a private file area.
  322.  
  323. FAREA_DAT_GetCDFAF() AS INTEGER
  324.  This form of the FAREA_DAT_GetCDFAF Function returns the file area's CDROM
  325.  file area flag.
  326.  
  327. FAREA_DAT_PutCDFAF(n AS INTEGER)
  328.  This form of the FAREA_DAT_PutCDFAF functoin sets the file area's CDROM file
  329.  area flag to "n". "n" must be in the range of 0 to 1 as follows:
  330.  
  331.     0 = The file area isn't a CD-ROM file area.
  332.     1 = The file area is a CD-ROM file area.
  333.  
  334. FAREA_DAT_GetAFAF() AS INTEGER
  335.  This form of the FAREA_DAT_GetAFAF Function returns the file area's alias
  336.  file area flag.
  337.  
  338. FAREA_DAT_PutAFAF(n AS INTEGER)
  339.  This form of the FAREA_DAT_PutAFAF Function sets the file area's alias file
  340.  area flag to "n". "n" must be in the range of 0 to 1 as follows:
  341.  
  342.     0 = The file area isn't an alias file area.
  343.     1 = The file area is an alias file area.
  344.  
  345. FAREA_DAT_GetOFAF() AS INTEGER
  346.  This form of the FAREA_DAT_GetOFAF Function returns the file area's offline
  347.  file area flag.
  348.  
  349. FAREA_DAT_PutOFAF(n AS INTEGER)
  350.  This form of the FAREA_DAT_PutOFAF Function sets the file area's offline
  351.  file area flag to "n".  "n" must be in the range of 0 to 1 as follows:
  352.  
  353.     0 = The file area isn't an offline file area.
  354.     1 = The file area is an offline file area.
  355.  
  356. FAREA_DAT_GetMIFAF() AS INTEGER
  357.  This form of the FAREA_DAT_GetMIFAF Function returns the file area's master
  358.  index file area flag.
  359.  
  360. FAREA_DAT_PutMIFAF(n AS INTEGER)
  361.  This form of the FAREA_DAT_PutMIFAF Function sets the file area's master
  362.  index file area flag to "n".  "n" must be in the range of 0 to 1 as follows:
  363.  
  364.     0 = Do not include this file area in the master index.
  365.     1 = Include this file area in the master index.
  366.