home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
MISC
/
PBAPI10.ZIP
/
APIDOCS.ZIP
/
USERSSPM.DOC
< prev
next >
Wrap
Text File
|
1998-02-21
|
8KB
|
207 lines
Author....... : Gary Price
Copyrighted by: Freejack's Software 1997-98
USERS_SPM API for TriBBS v10.x/11.x written in PowerBasic v3.5
---------------------------------------------------------------------------
The USERS_SPM unit is used to manipulate data in the USERS.SPM data file
found in node 1's MWORK directory. The USERS.SPM unit is declared in
PBAPI10.INC as follows:
===========================================================================
Users.spm BitField Breakdown
BIT Assignment
0 = AccessPrivateConferenceFlag 0 = No, 1 = Yes
1 = CoSysopStatusFlag 0 = No, 1 = Yes
2 to 7 = 0 (Reserved)
Sub Type Structure for 1 byte BitFields
TYPE UserSpmBit
bit1 AS BYTE
END TYPE
-----------------------------------------------------------------------------
File Name: "USERS.SPM"
TYPE USERSSPM
LastMessageRead AS LONG
LastWaitingMessageRead AS LONG
WaitingMessageCounter AS INTEGER
QueuedConference AS INTEGER
UserSpmBitFields AS UserSpmBit
END TYPE
DIM UserSpmBit AS UserSpmBit
DIM USERSSPM AS SHARED USERSSPM
DIM uspm AS SHARED USERSSPM PTR
uspm = VARPTR32(USERSSPM)
LSET USERSSPM = USERSSPM
-----------------------------------------------------------------------------
FUNCTION's below are from the USERSSPM.PBU Unit and DECLAREd in PBAPI10.INC.
FUNCTION USERS_SPM_OPEN()
FUNCTION USERS_SPM_CLOSE()
FUNCTION USERS_SPM_READ(u AS WORD, n AS INTEGER)
FUNCTION USERS_SPM_WRITE(u AS WORD, n AS INTEGER)
FUNCTION USERS_SPM_OpenRead(u AS WORD, n AS INTEGER)
FUNCTION USERS_SPM_WriteClose(u AS WORD, n AS INTEGER)
FUNCTION USERS_SPM_OpenReadClose(u AS WORD, n AS INTEGER)
FUNCTION USERS_SPM_OpenWriteClose(u AS WORD, n AS INTEGER)
FUNCTION USERS_SPM_Clearit(n AS WORD)
FUNCTION USERS_SPM_TotalRecords() AS WORD
FUNCTION USERS_SPM_GetLMR() AS LONG
FUNCTION USERS_SPM_PutLMR(n AS LONG)
FUNCTION USERS_SPM_GetLWMR() AS LONG
FUNCTION USERS_SPM_PutLWMR(n AS LONG)
FUNCTION USERS_SPM_GetWMC() AS INTEGER
FUNCTION USERS_SPM_PutWMC(n AS INTEGER)
FUNCTION USERS_SPM_GetQC() AS INTEGER
FUNCTION USERS_SPM_PutQC(n AS INTEGER)
FUNCTION USERS_SPM_GetAPCF() AS INTEGER
FUNCTION USERS_SPM_PutAPCF(n AS INTEGER)
FUNCTION USERS_SPM_GetCSSF() AS INTEGER
FUNCTION USERS_SPM_PutCSSF(n AS INTEGER)
-----------------------------------------------------------------------------
The total file size for the Users.spm file is determined by the following
formula:
Users.spm record length = 13 Bytes
SizeOf(Users.spm) = (13 * TotalRecordsOf(Mconf.dat) * TotalRecordsOf(Users.dat))
-----------------------------------------------------------------------------
IMPORTANT NOTES:
Before these functions will allow you to write to the users.spm file, the
Mconf.dat must not be at '0' bytes. Otherwise, these functions will abort
if a call is made and the Mconf.dat is at '0' bytes.
Also, before you can use USERS_SPM_Clearit(n AS WORD) to add a new set of
records to the Users.spm, 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_SPM_Open()
The USERS_SPM_Open function opens the USERS.SPM data file in node 1's MWORK
directory.
USERS_SPM_Close()
The USERS_SPM_Close function closes the USERS.SPM data file in node 1's MWORK
directory.
USERS_SPM_Read(u AS WORD, n AS INTEGER)
The USERS_SPM_Read function reads the data record for user "u" and message
conference "n" into memory.
USERS_SPM_Write(u AS WORD, n AS INTEGER)
The USERS_SPM_Write function updates the data record for user "u" and message
conference "n" from memory.
USERS_SPM_OpenRead(u AS WORD, n AS INTEGER)
The USERS_SPM_OpenRead function provides the functionality of the
USERS_SPM_Open and USERS_SPM_Read functions in a single function call.
USERS_SPM_WriteClose(u AS WORD, n AS INTEGER)
The USERS_SPM_WriteClose function provides the functionality of the
USERS_SPM_Write and USERS_SPM_Close functions in a single function call.
USERS_SPM_OpenReadClose(u AS WORD, n AS INTEGER)
The USERS_SPM_OpenReadClose function provides the functionality of the
USERS_SPM_Open, USERS_SPM_Read, and USERS_SPM_Close functions in a single
function call.
USERS_SPM_OpenWriteClose(u AS WORD, n AS INTEGER)
The USERS_SPM_OpenWriteClose function provides the functionality of the
USERS_SPM_Open, USERS_SPM_Write, and USERS_SPM_Close functions in a single
function call.
USERS_SPM_ClearIt(n AS WORD)
The USERS_SPM_ClearIt function sets the entire USERS_SPM data record for 'n'
to all zeros. Also can be used to add new records for 'n' to the Users.spm
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_SPM_TotalRecords() AS WORD
The USERS_SPM_TotalRecords function will return Total Records for a single
user. If Mconf.dat is 0 byte, then this function will abort.
-----------------------------------------------------------------------------
POINTERS Uses a hidden variable I use called "@uspm". 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. :)
-----------------------------------------------------------------------------
USERS_SPM_GetLMR() AS LONG
This form of the USERS_SPM_GetLMR function returns the user's last message
read.
USERS_SPM_PutLMR(n AS LONG)
This form of the USERS_SPM_PutLMR function sets the user's last message read
to "n".
USERS_SPM_GetLWMR() AS LONG
This form of the USERS_SPM_GetLWMR function returns the user's last waiting
message read.
USERS_SPM_PutLWMR(n AS LONG)
This form of the USERS_SPM_PutLWMR function sets the user's last waiting
message read to "n".
USERS_SPM_GetWMC() AS INTEGER
This form of the USERS_SPM_GetWMC function returns the user's waiting message
counter.
USERS_SPM_PutWMC(n AS INTEGER)
This form of the USERS_SPM_PutWMC function sets the user's waiting message
counter to "n".
USERS_SPM_GetQC() AS INTEGER
This form of the USERS_SPM_GetQC function returns the user's queued
conference flag.
USERS_SPM_PutQC(n AS INTEGER)
This form of the USERS_SPM_QueuedConference function sets the user's queued
conference flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = The conference isn't queued.
1 = The conference is queued.
-----------------------------------------------------------------------------
All BIT Field Flags below have been converted to Integers to allow easier
access and handling.
-----------------------------------------------------------------------------
USERS_SPM_GetAPCF() AS INTEGER
This form of the USERS_SPM_GetAPC function returns the user's access private
conference flag.
USERS_SPM_PutAPCF(n AS INTEGER)
This form of the USERS_SPM_AccessPrivateConference function sets the user's
access private conference flag to "n". "n" must be in the range of 0 to 1
as follows:
0 = The user doesn't have access to a private conference.
1 = The user has access to a private conference.
USERS_SPM_GetCSSF() AS INTEGER
This form of the USERS_SPM_GetCSS function returns the user's Cosysop status
flag.
USERS_SPM_PutCSSF(n AS INTEGER)
This form of the USERS_SPM_CoSysopStatus function sets the user's Cosysop
status flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = The user doesn't have cosysop status in the conference.
1 = The user has cosysop status in the conference.