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

  1. Author....... : Gary Price
  2. Copyrighted by: Freejack's Software 1997-98
  3.  
  4. USERS_SPF API for TriBBS v10.x/11.x written in PowerBasic v3.5
  5. ---------------------------------------------------------------------------
  6.  
  7. The USERS_SPF unit is used to manipulate data in the USERS.SPF data file
  8. found in node 1's MWORK directory. The USERS.SPF unit is declared in
  9. PBAPI10.INC as follows:
  10.  
  11. ===========================================================================
  12. Users.SPF BitField Breakdown
  13.  
  14.  BIT Assignment
  15.     0 = AccessPrivateAreaFlag                    0 = No, 1 = Yes
  16.     1 to 7 = 0 (Reserved)
  17.  
  18. File Name: "USERS.SPF"
  19.  TYPE USERSSPF
  20.    AccessPrivateAreaFlag AS BYTE
  21.  END TYPE
  22.  
  23.  DIM USERSSPF AS SHARED USERSSPF
  24.  DIM uspf     AS SHARED USERSSPF PTR
  25.  
  26.  uspf = VARPTR32(USERSSPF)
  27.  LSET USERSSPF = USERSSPF
  28.  
  29. ---------------------------------------------------------------------------
  30.  
  31. FUNCTION's below are from the USERSSPF.PBU Unit and DECLAREd in PBAPI10.INC.
  32.  
  33. FUNCTION USERS_SPF_OPEN()
  34. FUNCTION USERS_SPF_CLOSE()
  35. FUNCTION USERS_SPF_READ(u AS WORD, n AS INTEGER)
  36. FUNCTION USERS_SPF_WRITE(u AS WORD, n AS INTEGER)
  37. FUNCTION USERS_SPF_OpenRead(u AS WORD, n AS INTEGER)
  38. FUNCTION USERS_SPF_WriteClose(u AS WORD, n AS INTEGER)
  39. FUNCTION USERS_SPF_OpenReadClose(u AS WORD, n AS INTEGER)
  40. FUNCTION USERS_SPF_OpenWriteClose(u AS WORD, n AS INTEGER)
  41. FUNCTION USERS_SPF_Clearit(n AS WORD)
  42. FUNCTION USERS_SPF_TotalRecords() AS WORD
  43.  
  44. FUNCTION USERS_SPF_GetAPAF() AS INTEGER
  45. FUNCTION USERS_SPF_PutAPAF(n AS INTEGER)
  46.  
  47. -----------------------------------------------------------------------------
  48. The total file size for the Users.spf file is determined by the following
  49. formula:
  50.  
  51. Users.spf record length = 1 Byte
  52.  
  53. SizeOf(Users.spf) = (1 * TotalRecordsOf(Farea.dat) * TotalRecordsOf(Users.dat))
  54.  
  55. -----------------------------------------------------------------------------
  56. IMPORTANT NOTES:
  57.  
  58.   Before these functions will allow you to write to the users.spf file, the
  59.   Farea.dat must not be at '0' bytes. Otherwise, these functions will abort
  60.   if a call is made and the Farea.dat is at '0' bytes.
  61.  
  62.   Also, before you can use USERS_SPF_Clearit(n AS WORD) to add a new set of
  63.   records to the Users.spf, record 'n' must first be added to the Users.dat
  64.   file as these function will check to see if 'n' exist first prior to doing
  65.   any operations.
  66.  
  67. -----------------------------------------------------------------------------
  68.  MPORTANT: TBNode1sMainDirectory must be set to node 1's main directory
  69.  before calling any function with the "Open" word.
  70. -----------------------------------------------------------------------------
  71.  
  72. USERS_SPF_Open()
  73.  The USERS_SPF_Open function opens the USERS.SPF data file in node 1's MWORK
  74.  directory. 
  75.  
  76. USERS_SPF_Close()
  77.  The USERS_SPF_Close function closes the USERS.SPF data file in node 1's MWORK
  78.  directory.
  79.  
  80. USERS_SPF_Read(u AS WORD, n AS INTEGER)
  81.  The USERS_SPF_Read function reads the data record for user "u" and message
  82.  conference "n" into memory.
  83.  
  84. USERS_SPF_Write(u AS WORD, n AS INTEGER)
  85.  The USERS_SPF_Write function updates the data record for user "u" and message
  86.  conference "n" from memory.
  87.  
  88. USERS_SPF_OpenRead(u AS WORD, n AS INTEGER)
  89.  The USERS_SPF_OpenRead function provides the functionality of the
  90.  USERS_SPF_Open and USERS_SPF_Read functions in a single function call.
  91.  
  92. USERS_SPF_WriteClose(u AS WORD, n AS INTEGER)
  93.  The USERS_SPF_WriteClose function provides the functionality of the
  94.  USERS_SPF_Write and USERS_SPF_Close functions in a single function call.
  95.  
  96. USERS_SPF_OpenReadClose(u AS WORD, n AS INTEGER)
  97.  The USERS_SPF_OpenReadClose function provides the functionality of the
  98.  USERS_SPF_Open, USERS_SPF_Read, and USERS_SPF_Close functions in a single
  99.  function call.
  100.  
  101. USERS_SPF_OpenWriteClose(u AS WORD, n AS INTEGER)
  102.  The USERS_SPF_OpenWriteClose function provides the functionality of the
  103.  USERS_SPF_Open, USERS_SPF_Write, and USERS_SPF_Close functions in a single
  104.  function call.
  105.  
  106. USERS_SPF_ClearIt(n AS WORD)
  107.  The USERS_SPF_ClearIt function sets the entire USERS_SPF data record for 'n'
  108.  to all zeros. Also can be used to add new records for 'n' to the Users.spf
  109.  file, however, this function will check to see if this record has been added
  110.  to the Users.dat file first, if not, then this function will abort.
  111.  
  112. USERS_SPF_TotalRecords() AS WORD
  113.  The USERS_SPF_TotalRecords function will return Total Records for a single
  114.  user. If Farea.dat is 0 byte, then this function will abort.
  115.  
  116. -----------------------------------------------------------------------------
  117. POINTERS Uses a hidden variable I use called "@uspf". Any reference to this
  118. is only for your information for discussion in this doc file. You will not
  119. need to concern yourself trying to use this.. All calls are handled in the
  120. main USERSSPM.PBU Unit by my routines automatically. In other words, I am
  121. trying to keep Pointers as easy as possible for your use. :)
  122. -----------------------------------------------------------------------------
  123. All BIT Field Flags below have been converted to Integers to allow easier
  124. access and handling.
  125. -----------------------------------------------------------------------------
  126. USERS_SPF_GetAPAF() AS INTEGER
  127.  This form of the USERS_SPF_GetAPAF function returns the user's access
  128.  private area flag.
  129.  
  130. USERS_SPF_PutAPAF(n AS INTEGER)
  131.   This form of the USERS_SPF_PutAPAF function sets the user's access private
  132.   area flag to "n". "n" must be in the range of 0 to 1 as follows:
  133.  
  134.     0 = The user doesn't have access to the private file area.
  135.     1 = The user has access to the private file area.
  136.  
  137.