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
Wrap
Text File
|
1998-02-21
|
6KB
|
145 lines
Author....... : Gary Price
Copyrighted by: Freejack's Software 1997-98
WHOSON_DAT API for TriBBS v10.x/11.x written in PowerBasic v3.5
---------------------------------------------------------------------------
The WHOSON_DAT unit is used to manipulate data in the WHOSON.DAT data file
found in Node 1's \MWORK directory. The WHOSON_DAT unit is declared in
PBAPI10.INC as follows:
File Name: "WHOSON.DAT"
TYPE WHOSONDAT
WhoName AS STRING * 61
ChatBuffer AS STRING * 1024
ChatStatus AS INTEGER
NodeChattingWith AS INTEGER
Head AS INTEGER
Tail AS INTEGER
ReservedDataArea AS STRING * 3003
END TYPE
DIM WHOSONDAT AS SHARED WHOSONDAT
DIM wd AS SHARED WHOSONDAT PTR
wd = VARPTR32(WHOSONDAT)
LSET WHOSONDAT = WHOSONDAT
-----------------------------------------------------------------------------
FUNCTION's below are from the WHOSON.PBU Unit and DECLAREd IN THE PBAPI10.INC.
FUNCTION WHOSON_DAT_Open()
FUNCTION WHOSON_DAT_Close()
FUNCTION WHOSON_DAT_Read(n AS INTEGER)
FUNCTION WHOSON_DAT_Write(n AS INTEGER)
FUNCTION WHOSON_DAT_OpenRead(n AS INTEGER)
FUNCTION WHOSON_DAT_WriteClose(n AS INTEGER)
FUNCTION WHOSON_DAT_OpenReadClose(n AS INTEGER)
FUNCTION WHOSON_DAT_OpenWriteClose(n AS INTEGER)
FUNCTION WHOSON_DAT_Length() AS LONG
FUNCTION WHOSON_DAT_ClearIt(n AS INTEGER)
FUNCTION WHOSON_DAT_GetWN() AS STRING
FUNCTION WHOSON_DAT_PutWN(s AS STRING)
FUNCTION WHOSON_DAT_GetCS() AS INTEGER
FUNCTION WHOSON_DAT_PutCS(n AS INTEGER)
FUNCTION WHOSON_DAT_GetNCW() AS INTEGER
FUNCTION WHOSON_DAT_PutNCW(n AS INTEGER)
-----------------------------------------------------------------------------
IMPORTANT: TBNode1sMainDirectory must be set to node 1's main directory
before calling this function.
WHOSON_DAT_Open()
The WHOSON_DAT_Open function opens the WHOSON.DAT file in node 1's MWORK
directory.
WHOSON_DAT_Close()
The WHOSON_DAT_Close function closes the WHOSON.DAT file in node 1's MWORK
directory.
WHOSON_DAT_Read(n AS INTEGER)
The WHOSON_DAT_Read function reads the record for node "n" into memory.
WHOSON_DAT_Write(n AS INTEGER)
The WHOSON_DAT_Write function updates the record for node "n" from memory.
WHOSON_DAT_Length() AS LONG
The WHOSON_DAT_Length function returns the number of records in the
WHOSON.DAT file.
WHOSON_DAT_OpenRead(n AS INTEGER)
The WHOSON_DAT_OpenRead function provides the functionality of the
WHOSON_DAT_Open and WHOSON_DAT_Read functions in a single function call.
WHOSON_DAT_WriteClose(n AS INTEGER)
The WHOSON_DAT_WriteClose function provides the functionality of the
WHOSON_DAT_Write and WHOSON_DAT_Close functions in a single function call.
WHOSON_DAT_OpenReadClose(n AS INTEGER)
The WHOSON_DAT_OpenReadClose function provides the functionality of the
WHOSON_DAT_Open, WHOSON_DAT_Read, and WHOSON_DAT_Close functions in a single
function call.
WHOSON_DAT_OpenWriteClose(n AS INTEGER)
The WHOSON_DAT_OpenWriteClose function provides the functionality of the
WHOSON_DAT_Open, WHOSON_DAT_Write, and WHOSON_DAT_Close functions in a single
function call.
WHOSON_DAT_ClearIt()
The WHOSON_DAT_ClearIt function sets the entire WHOSON_DAT data record to
zeros.
-----------------------------------------------------------------------------
POINTERS Uses a hidden variable I use called "@wd". Any reference to this is
only for your information for discussion in this doc file. You will not need
to concern yourself trying to use this.. All calls are handled in the main
WHOSON.PBU Unit by my routines automatically. In other words, I am trying to
keep Pointers as easy as possible for your use. :)
Also, all calls to any Functions which gets data with the string routines
will auto-trim each string's extra spaces and the null terminator, CHR$(0),
off so printing will be easier for you to manipulate. When calling the string
routines to put data back into the string space, all string data will be
resized to fit the WHOSON.DAT type structure and will add the null terminator
back to the end of the string. Just remember, when working the data in memory
with the pointer calls, you still have to write the data back to the
WHOSON.DAT in order for the changes to become permanent.
-----------------------------------------------------------------------------
WHOSON_DAT_GetWN() AS STRING
This form of the WHOSON_DAT_GetWN function returns a pointer to the node's
name string.
WHOSON_DAT_PutWN(s AS STRING)
This form of the WHOSON_DAT_PutWN function sets the node's name string to
the string pointed to by "s". Note that the string pointed to by "s" can be
no more than 60 characters in length.
WHOSON_DAT_GetCS() AS INTEGER
This form of the WHOSON_DAT_GetCS function returns the node's chat status.
WHOSON_DAT_PutCS(n AS INTEGER)
This form of the WHOSON_DAT_PutCS function sets the node's chat status to
"n". "n" must be in the range of 0 to 7 as follows:
0 = User is available to chat.
1 = User isn't available to chat.
2 = User is transferring a file.
3 = User is entering a message.
4 = User is in a door.
5 = User is in group chat.
6 = User is waiting for a node to join node chat.
7 = User is in node chat.
WHOSON_DAT_GetNCW() AS INTEGER
This form of the WHOSON_DAT_GetNCW function returns the node that this node
is chatting with.
WHOSON_DAT_PutNCW(n AS INTEGER)
This form of the WHOSON_DAT_PutNCW function sets the node that this node is
chatting with.