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

  1. Author....... : Gary Price
  2. Copyrighted by: Freejack's Software 1997-98
  3.  
  4. WHOSON_DAT API for TriBBS v10.x/11.x written in PowerBasic v3.5
  5. ---------------------------------------------------------------------------
  6.  
  7. The WHOSON_DAT unit is used to manipulate data in the WHOSON.DAT data file
  8. found in Node 1's \MWORK directory. The WHOSON_DAT unit is declared in
  9. PBAPI10.INC as follows:
  10.  
  11. File Name: "WHOSON.DAT"
  12.  TYPE WHOSONDAT
  13.     WhoName          AS STRING * 61
  14.     ChatBuffer       AS STRING * 1024
  15.     ChatStatus       AS INTEGER
  16.     NodeChattingWith AS INTEGER
  17.     Head             AS INTEGER
  18.     Tail             AS INTEGER
  19.     ReservedDataArea AS STRING * 3003
  20.  END TYPE
  21.  
  22.  DIM WHOSONDAT AS SHARED WHOSONDAT
  23.  DIM wd        AS SHARED WHOSONDAT PTR
  24.  
  25.  wd = VARPTR32(WHOSONDAT)
  26.  LSET WHOSONDAT = WHOSONDAT
  27.  
  28. -----------------------------------------------------------------------------
  29.  
  30. FUNCTION's below are from the WHOSON.PBU Unit and DECLAREd IN THE PBAPI10.INC.
  31.  
  32. FUNCTION WHOSON_DAT_Open()
  33. FUNCTION WHOSON_DAT_Close()
  34. FUNCTION WHOSON_DAT_Read(n AS INTEGER)
  35. FUNCTION WHOSON_DAT_Write(n AS INTEGER)
  36. FUNCTION WHOSON_DAT_OpenRead(n AS INTEGER)
  37. FUNCTION WHOSON_DAT_WriteClose(n AS INTEGER)
  38. FUNCTION WHOSON_DAT_OpenReadClose(n AS INTEGER)
  39. FUNCTION WHOSON_DAT_OpenWriteClose(n AS INTEGER)
  40. FUNCTION WHOSON_DAT_Length() AS LONG
  41. FUNCTION WHOSON_DAT_ClearIt(n AS INTEGER)
  42.  
  43. FUNCTION WHOSON_DAT_GetWN() AS STRING
  44. FUNCTION WHOSON_DAT_PutWN(s AS STRING)
  45. FUNCTION WHOSON_DAT_GetCS() AS INTEGER
  46. FUNCTION WHOSON_DAT_PutCS(n AS INTEGER)
  47. FUNCTION WHOSON_DAT_GetNCW() AS INTEGER
  48. FUNCTION WHOSON_DAT_PutNCW(n AS INTEGER)
  49.  
  50. -----------------------------------------------------------------------------
  51.  
  52.   IMPORTANT: TBNode1sMainDirectory must be set to node 1's main directory
  53.   before calling this function.
  54.  
  55. WHOSON_DAT_Open()
  56.  The WHOSON_DAT_Open function opens the WHOSON.DAT file in node 1's MWORK
  57.  directory.
  58.  
  59. WHOSON_DAT_Close()
  60.  The WHOSON_DAT_Close function closes the WHOSON.DAT file in node 1's MWORK
  61.  directory.
  62.  
  63. WHOSON_DAT_Read(n AS INTEGER)
  64.  The WHOSON_DAT_Read function reads the record for node "n" into memory.
  65.  
  66. WHOSON_DAT_Write(n AS INTEGER)
  67.  The WHOSON_DAT_Write function updates the record for node "n" from memory.
  68.  
  69. WHOSON_DAT_Length() AS LONG
  70.  The WHOSON_DAT_Length function returns the number of records in the
  71.  WHOSON.DAT file.
  72.  
  73. WHOSON_DAT_OpenRead(n AS INTEGER)
  74.  The WHOSON_DAT_OpenRead function provides the functionality of the
  75.  WHOSON_DAT_Open and WHOSON_DAT_Read functions in a single function call.
  76.  
  77. WHOSON_DAT_WriteClose(n AS INTEGER)
  78.  The WHOSON_DAT_WriteClose function provides the functionality of the
  79.  WHOSON_DAT_Write and WHOSON_DAT_Close functions in a single function call.
  80.  
  81. WHOSON_DAT_OpenReadClose(n AS INTEGER)
  82.  The WHOSON_DAT_OpenReadClose function provides the functionality of the
  83.  WHOSON_DAT_Open, WHOSON_DAT_Read, and WHOSON_DAT_Close functions in a single
  84.  function call.
  85.  
  86. WHOSON_DAT_OpenWriteClose(n AS INTEGER)
  87.  The WHOSON_DAT_OpenWriteClose function provides the functionality of the
  88.  WHOSON_DAT_Open, WHOSON_DAT_Write, and WHOSON_DAT_Close functions in a single
  89.  function call.
  90.  
  91. WHOSON_DAT_ClearIt()
  92.  The WHOSON_DAT_ClearIt function sets the entire WHOSON_DAT data record to
  93.  zeros.
  94.  
  95. -----------------------------------------------------------------------------
  96. POINTERS Uses a hidden variable I use called "@wd". Any reference to this is
  97. only for your information for discussion in this doc file. You will not need
  98. to concern yourself trying to use this.. All calls are handled in the main
  99. WHOSON.PBU Unit by my routines automatically. In other words, I am trying to
  100. keep Pointers as easy as possible for your use. :)
  101.  
  102. Also, all calls to any Functions which gets data with the string routines
  103. will auto-trim each string's extra spaces and the null terminator, CHR$(0),
  104. off so printing will be easier for you to manipulate. When calling the string
  105. routines to put data back into the string space, all string data will be
  106. resized to fit the WHOSON.DAT type structure and will add the null terminator
  107. back to the end of the string. Just remember, when working the data in memory
  108. with the pointer calls, you still have to write the data back to the
  109. WHOSON.DAT in order for the changes to become permanent.
  110.  
  111. -----------------------------------------------------------------------------
  112. WHOSON_DAT_GetWN() AS STRING
  113.  This form of the WHOSON_DAT_GetWN function returns a pointer to the node's
  114.  name string.
  115.  
  116. WHOSON_DAT_PutWN(s AS STRING)
  117.  This form of the WHOSON_DAT_PutWN function sets the node's name string to
  118.  the string pointed to by "s". Note that the string pointed to by "s" can be
  119.  no more than 60 characters in length.
  120.  
  121. WHOSON_DAT_GetCS() AS INTEGER
  122.  This form of the WHOSON_DAT_GetCS function returns the node's chat status.
  123.  
  124. WHOSON_DAT_PutCS(n AS INTEGER)
  125.  This form of the WHOSON_DAT_PutCS function sets the node's chat status to
  126.  "n". "n" must be in the range of 0 to 7 as follows:
  127.  
  128.     0 = User is available to chat.
  129.     1 = User isn't available to chat.
  130.     2 = User is transferring a file.
  131.     3 = User is entering a message.
  132.     4 = User is in a door.
  133.     5 = User is in group chat.
  134.     6 = User is waiting for a node to join node chat.
  135.     7 = User is in node chat.
  136.  
  137. WHOSON_DAT_GetNCW() AS INTEGER
  138.  This form of the WHOSON_DAT_GetNCW function returns the node that this node
  139.  is chatting with.
  140.  
  141. WHOSON_DAT_PutNCW(n AS INTEGER)
  142.  This form of the WHOSON_DAT_PutNCW function sets the node that this node is
  143.  chatting with.
  144.  
  145.