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 >
Wrap
Text File
|
1998-02-21
|
6KB
|
137 lines
Author....... : Gary Price
Copyrighted by: Freejack's Software 1997-98
USERS_SPF API for TriBBS v10.x/11.x written in PowerBasic v3.5
---------------------------------------------------------------------------
The USERS_SPF unit is used to manipulate data in the USERS.SPF data file
found in node 1's MWORK directory. The USERS.SPF unit is declared in
PBAPI10.INC as follows:
===========================================================================
Users.SPF BitField Breakdown
BIT Assignment
0 = AccessPrivateAreaFlag 0 = No, 1 = Yes
1 to 7 = 0 (Reserved)
File Name: "USERS.SPF"
TYPE USERSSPF
AccessPrivateAreaFlag AS BYTE
END TYPE
DIM USERSSPF AS SHARED USERSSPF
DIM uspf AS SHARED USERSSPF PTR
uspf = VARPTR32(USERSSPF)
LSET USERSSPF = USERSSPF
---------------------------------------------------------------------------
FUNCTION's below are from the USERSSPF.PBU Unit and DECLAREd in PBAPI10.INC.
FUNCTION USERS_SPF_OPEN()
FUNCTION USERS_SPF_CLOSE()
FUNCTION USERS_SPF_READ(u AS WORD, n AS INTEGER)
FUNCTION USERS_SPF_WRITE(u AS WORD, n AS INTEGER)
FUNCTION USERS_SPF_OpenRead(u AS WORD, n AS INTEGER)
FUNCTION USERS_SPF_WriteClose(u AS WORD, n AS INTEGER)
FUNCTION USERS_SPF_OpenReadClose(u AS WORD, n AS INTEGER)
FUNCTION USERS_SPF_OpenWriteClose(u AS WORD, n AS INTEGER)
FUNCTION USERS_SPF_Clearit(n AS WORD)
FUNCTION USERS_SPF_TotalRecords() AS WORD
FUNCTION USERS_SPF_GetAPAF() AS INTEGER
FUNCTION USERS_SPF_PutAPAF(n AS INTEGER)
-----------------------------------------------------------------------------
The total file size for the Users.spf file is determined by the following
formula:
Users.spf record length = 1 Byte
SizeOf(Users.spf) = (1 * TotalRecordsOf(Farea.dat) * TotalRecordsOf(Users.dat))
-----------------------------------------------------------------------------
IMPORTANT NOTES:
Before these functions will allow you to write to the users.spf file, the
Farea.dat must not be at '0' bytes. Otherwise, these functions will abort
if a call is made and the Farea.dat is at '0' bytes.
Also, before you can use USERS_SPF_Clearit(n AS WORD) to add a new set of
records to the Users.spf, record 'n' must first be added to the Users.dat
file as these function will check to see if 'n' exist first prior to doing
any operations.
-----------------------------------------------------------------------------
MPORTANT: TBNode1sMainDirectory must be set to node 1's main directory
before calling any function with the "Open" word.
-----------------------------------------------------------------------------
USERS_SPF_Open()
The USERS_SPF_Open function opens the USERS.SPF data file in node 1's MWORK
directory.
USERS_SPF_Close()
The USERS_SPF_Close function closes the USERS.SPF data file in node 1's MWORK
directory.
USERS_SPF_Read(u AS WORD, n AS INTEGER)
The USERS_SPF_Read function reads the data record for user "u" and message
conference "n" into memory.
USERS_SPF_Write(u AS WORD, n AS INTEGER)
The USERS_SPF_Write function updates the data record for user "u" and message
conference "n" from memory.
USERS_SPF_OpenRead(u AS WORD, n AS INTEGER)
The USERS_SPF_OpenRead function provides the functionality of the
USERS_SPF_Open and USERS_SPF_Read functions in a single function call.
USERS_SPF_WriteClose(u AS WORD, n AS INTEGER)
The USERS_SPF_WriteClose function provides the functionality of the
USERS_SPF_Write and USERS_SPF_Close functions in a single function call.
USERS_SPF_OpenReadClose(u AS WORD, n AS INTEGER)
The USERS_SPF_OpenReadClose function provides the functionality of the
USERS_SPF_Open, USERS_SPF_Read, and USERS_SPF_Close functions in a single
function call.
USERS_SPF_OpenWriteClose(u AS WORD, n AS INTEGER)
The USERS_SPF_OpenWriteClose function provides the functionality of the
USERS_SPF_Open, USERS_SPF_Write, and USERS_SPF_Close functions in a single
function call.
USERS_SPF_ClearIt(n AS WORD)
The USERS_SPF_ClearIt function sets the entire USERS_SPF data record for 'n'
to all zeros. Also can be used to add new records for 'n' to the Users.spf
file, however, this function will check to see if this record has been added
to the Users.dat file first, if not, then this function will abort.
USERS_SPF_TotalRecords() AS WORD
The USERS_SPF_TotalRecords function will return Total Records for a single
user. If Farea.dat is 0 byte, then this function will abort.
-----------------------------------------------------------------------------
POINTERS Uses a hidden variable I use called "@uspf". 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 USERSSPM.PBU Unit by my routines automatically. In other words, I am
trying to keep Pointers as easy as possible for your use. :)
-----------------------------------------------------------------------------
All BIT Field Flags below have been converted to Integers to allow easier
access and handling.
-----------------------------------------------------------------------------
USERS_SPF_GetAPAF() AS INTEGER
This form of the USERS_SPF_GetAPAF function returns the user's access
private area flag.
USERS_SPF_PutAPAF(n AS INTEGER)
This form of the USERS_SPF_PutAPAF function sets the user's access private
area flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = The user doesn't have access to the private file area.
1 = The user has access to the private file area.