home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
MISC
/
PBAPI10.ZIP
/
APIDOCS.ZIP
/
DOORTMP.DOC
< prev
next >
Wrap
Text File
|
1998-02-21
|
16KB
|
436 lines
Author....... : Gary Price
Copyrighted by: Freejack's Software 1997-98
DOORS_TMP API for TriBBS v10.x/11.x written in PowerBasic v3.5
---------------------------------------------------------------------------
The DOORS_TMP unit is used to manipulate data in the DOORS.TMP data file.
Doors.tmp is created in any node's \NWORK directory when a caller shells to
a door from the BBS, TriBBS will create this temporary file, and then re-read
it back in and then delete it when the caller returns from the door back to
TriBBS. The interaction with this file must be during this time when the
caller is shelled from TriBBS.
For testing purposes, you will need to create or grab a copy of Doors.tmp
when a caller is logged on and shelled to a door so you can test this unit.
The DOORS_TMP unit is declared in PBAPI10.INC as follows:
Doors.tmp BitFields Breakdown
DoorTmpBit.bit1 BIT Assignment
0 = ANSIFlag
1 = FrontEndFlag
2 = FrontEndHangUpFlag
3 = UserWindowFlag
4 = ChatRequestedFlag
5 = EventPendingFlag
6 = GoodbyeFromDoorFlag
7 = ForceBoardDownAfterCallFlag
DoorTmpBit.bit2 Assignment
0 = RIPscripFlag
1 = DOORSYSFlag
2 = ErrorCorrectingConnectionFlag
3 to 7 Reserved, set to all 0's
DoorTmpBit.bit3 to DoorTmpBit.bit10, Reserved and all bit's set to 0
Sub Type Structure for 10 byte BitFields
TYPE DoorTmpBit
bit1 AS BYTE
bit2 AS BYTE
bit3 AS BYTE
bit4 AS BYTE
bit5 AS BYTE
bit6 AS BYTE
bit7 AS BYTE
bit8 AS BYTE
bit9 AS BYTE
bit10 AS BYTE
END TYPE
File Name: "DOORS.TMP"
TYPE DOORTMP
TimeLeftAtLogon AS INTEGER
CurrentFileArea AS INTEGER
CurrentMessageConference AS INTEGER
FrontEndTime AS INTEGER
WhereTheDoorWasCalledFrom AS INTEGER
LanguageNumber AS INTEGER
NumberOfFilesFlagged AS INTEGER
TimeInDOORSYS AS INTEGER
UserRecordNumber AS LONG
BaudRate AS LONG
FrontEndBaudRate AS LONG
TimeWhenUserLoggedOn AS LONG
DoorTmpBitFields AS DoorTmpBit
END TYPE
DIM DoorTmpBit AS DoorTmpBit
DIM DOORTMP AS SHARED DOORTMP
DIM dt AS SHARED DOORTMP PTR
dt = VARPTR32(DOORTMP)
LSET DOORTMP = DOORTMP
---------------------------------------------------------------------------
FUNCTION's below are from the DOORTMP.PBU Unit and DECLAREd in PBAPI10.INC.
FUNCTION DOORS_TMP_OPEN() AS INTEGER
FUNCTION DOORS_TMP_CLOSE()
FUNCTION DOORS_TMP_READ()
FUNCTION DOORS_TMP_WRITE()
FUNCTION DOORS_TMP_OpenRead() AS INTEGER
FUNCTION DOORS_TMP_WriteClose()
FUNCTION DOORS_TMP_OpenReadClose() AS INTEGER
FUNCTION DOORS_TMP_OpenWriteClose() AS INTEGER
FUNCTION DOORS_TMP_Clearit() AS INTEGER
FUNCTION DOORS_TMP_GetTLAL() AS INTEGER
FUNCTION DOORS_TMP_PutTLAL(n AS INTEGER)
FUNCTION DOORS_TMP_GetCFA() AS INTEGER
FUNCTION DOORS_TMP_PutCFA(n AS INTEGER)
FUNCTION DOORS_TMP_GetCMC() AS INTEGER
FUNCTION DOORS_TMP_PutCMC(n AS INTEGER)
FUNCTION DOORS_TMP_GetFET() AS INTEGER
FUNCTION DOORS_TMP_PutFET(n AS INTEGER)
FUNCTION DOORS_TMP_GetWTDWCF() AS INTEGER
FUNCTION DOORS_TMP_PutWTDWCF(n AS INTEGER)
FUNCTION DOORS_TMP_GetLN() AS INTEGER
FUNCTION DOORS_TMP_PutLN(n AS INTEGER)
FUNCTION DOORS_TMP_GetNOFF() AS INTEGER
FUNCTION DOORS_TMP_PutNOFF(n AS INTEGER)
FUNCTION DOORS_TMP_GetTIDSys() AS INTEGER
FUNCTION DOORS_TMP_PutTIDSys(n AS INTEGER)
FUNCTION DOORS_TMP_GetURN() AS LONG
FUNCTION DOORS_TMP_PutURN(n AS LONG)
FUNCTION DOORS_TMP_GetBR() AS LONG
FUNCTION DOORS_TMP_PutBR(n AS LONG)
FUNCTION DOORS_TMP_GetFEBR() AS LONG
FUNCTION DOORS_TMP_PutFEBR(n AS LONG)
FUNCTION DOORS_TMP_GetTWULO() AS LONG
FUNCTION DOORS_TMP_PutTWULO(n AS LONG)
FUNCTION DOORS_TMP_GetAF() AS INTEGER
FUNCTION DOORS_TMP_PutAF(n AS INTEGER)
FUNCTION DOORS_TMP_GetFEF() AS INTEGER
FUNCTION DOORS_TMP_PutFEF(n AS INTEGER)
FUNCTION DOORS_TMP_GetFEHU() AS INTEGER
FUNCTION DOORS_TMP_PutFEHU(n AS INTEGER)
FUNCTION DOORS_TMP_GetUWF() AS INTEGER
FUNCTION DOORS_TMP_PutUWF(n AS INTEGER)
FUNCTION DOORS_TMP_GetCRF() AS INTEGER
FUNCTION DOORS_TMP_PutCRF(n AS INTEGER)
FUNCTION DOORS_TMP_GetEPF() AS INTEGER
FUNCTION DOORS_TMP_PutEPF(n AS INTEGER)
FUNCTION DOORS_TMP_GetGFD() AS INTEGER
FUNCTION DOORS_TMP_PutGFD(n AS INTEGER)
FUNCTION DOORS_TMP_GetFBDAC() AS INTEGER
FUNCTION DOORS_TMP_PutFBDAC(n AS INTEGER)
FUNCTION DOORS_TMP_GetRIP() AS INTEGER
FUNCTION DOORS_TMP_PutRIP(n AS INTEGER)
FUNCTION DOORS_TMP_GetDSF() AS INTEGER
FUNCTION DOORS_TMP_PutDSF(n AS INTEGER)
FUNCTION DOORS_TMP_GetECC() AS INTEGER
FUNCTION DOORS_TMP_PutECC(n AS INTEGER)
---------------------------------------------------------------------------
** EXTERNAL FUNCTION USED BY DOORS.TMP UNIT BELOW **
FUNCTION Exist(BYVAL Filename AS STRING) AS INTEGER
-----------------------------------------------------------------------------
IMPORTANT: TBNodesMainDirectory must be set to the node's main directory
before calling to any of these functions.
Since the Doors.tmp file is only created when a caller shells out from TriBBS
into a door, I have set the functions that contains any of the "OPEN"
statements to first verify that the Doors.tmp does exist in the current node's
\NWORK directory. This will help solve two problems. First of all, we don't
want to create a 0 byte Doors.tmp file in the \NWORK directory, this causes
TriBBS to do weird things.. :) Second, if the Doors.tmp file is not currently
in the node's \NWORK directory, you don't want your program to hang or lock
up tring to read in data.
DOORS_TMP_Open() AS INTEGER
The DOORS_TMP_Open function opens the DOORS.TMP data file in the current
node's NWORK directory. Also, this function will return either 0 or 1
depending if the file exists or not.
0 = Doors.tmp does not exist and file was not open.
1 = Doors.tmp did exist and the file was opened.
DOORS_TMP_Close()
The DOORS_TMP_Close function closes the DOORS.TMP data file in the current
node's NWORK directory.
DOORS_TMP_Read()
The DOORS_TMP_Read function reads the DOORS.TMP data file into memory.
DOORS_TMP_Write()
The DOORS_TMP_Write function updates the DOORS.TMP data file from memory.
DOORS_TMP_OpenRead() AS INTEGER
The DOORS_TMP_OpenRead function provides the functionality of the
DOORS_TMP_Open and DOORS_TMP_Read functions in a single function call. Also,
this function will return either 0 or 1 depending if the file exists or not.
0 = Doors.tmp does not exist and file was not open.
1 = Doors.tmp did exist and the file was opened.
DOORS_TMP_WriteClose()
The DOORS_TMP_WriteClose function provides the functionality of the
DOORS_TMP_Write and DOORS_TMP_Close functions in a single function call.
DOORS_TMP_OpenReadClose() AS INTEGER
The DOORS_TMP_OpenReadClose function provides the functionality of the
DOORS_TMP_Open, DOORS_TMP_Read, and DOORS_TMP_Close functions in a single
function call. Also, this function will return either 0 or 1 depending if
the file exists or not.
0 = Doors.tmp does not exist and file was not open.
1 = Doors.tmp did exist and the file was opened.
DOORS_TMP_OpenWriteClose() AS INTEGER
The DOORS_TMP_OpenWriteClose function provides the functionality of the
DOORS_TMP_Open, DOORS_TMP_Write, and DOORS_TMP_Close functions in a single
function call. this function will return either 0 or 1 depending if the file
exists or not.
0 = Doors.tmp does not exist and file was not open.
1 = Doors.tmp did exist and the file was opened.
DOORS_TMP_ClearIt() AS INTEGER
The DOORS_TMP_ClearIt function sets the entire DOORS_TMP data record to all
zeros. Also, this function will return either 0 or 1 depending if the file
exists or not.
0 = Doors.tmp does not exist and file was not open.
1 = Doors.tmp did exist and the file was opened.
-----------------------------------------------------------------------------
POINTERS Uses a hidden variable I use called "@dt". 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
DOORTMP.PBU Unit by my routines automatically. In other words, I am trying to
keep Pointers as easy as possible for your use. :)
-----------------------------------------------------------------------------
DOORS_TMP_GetTLAL() AS INTEGER
This form of the DOORS_TMP_GetTLAL function returns the user's time left
at logon.
DOORS_TMP_PutTLAL(n AS INTEGER)
This form of the DOORS_TMP_PutTLAL function sets the user's time left at
logon to "n"
DOORS_TMP_GetCFA() AS INTEGER
This form of the DOORS_TMP_GetCFA function returns the user's current file
area.
DOORS_TMP_PutCFA(n AS INTEGER)
This form of the DOORS_TMP_PutCFA function sets the user's current file area
to "n".
DOORS_TMP_GetCMC() AS INTEGER
This form of the DOORS_TMP_GetCMC function returns the user's current message
conference.
DOORS_TMP_PutCMC(n AS INTEGER)
This form of the DOORS_TMP_PutCMC function sets the user's current message
conference to "n".
DOORS_TMP_GetFET() AS INTEGER
This form of the DOORS_TMP_GetFET function returns the time passed to TriBBS
by a front end.
DOORS_TMP_PutFET(n AS INTEGER)
This form of the DOORS_TMP_PutFET function sets the time passed to TriBBS by
a front end to "n".
DOORS_TMP_GetWTDWCF() AS INTEGER
This form of the DOORS_TMP_GetWTDWCF function returns where the door was
called from.
DOORS_TMP_PutWTDWCF(n AS INTEGER)
This form of the DOORS_TMP_PutWTDWCF function sets where the door was called
from to "n". "n" must be in the range of 0 to 7 as follows:
0 = Called from doors menu.
1 = NEWUSER.BAT
2 = SECnnnn.BAT
3 = LOGON.BAT
4 = Called from main menu.
5 = Called from files menu.
6 = Called from message menu.
7 = Called from sysop menu.
DOORS_TMP_GetLN() AS INTEGER
This form of the DOORS_TMP_GetLN function returns the language number.
DOORS_TMP_PutLN(n AS INTEGER)
This form of the DOORS_TMP_PutLN function sets the language number to "n".
DOORS_TMP_GetNOFF() AS INTEGER
This form of the DOORS_TMP_GetNOFF function returns the number of files
flagged.
DOORS_TMP_PutNOFF(n AS INTEGER)
This form of the DOORS_TMP_PutNOFF function sets the number of files flagged
to "n".
DOORS_TMP_GetTIDSys() AS INTEGER
This form of the DOORS_TMP_GetTIDSys function returns the caller's time
remaining when DOOR.SYS was created.
DOORS_TMP_PutTIDSys(n AS INTEGER)
This form of the DOORS_TMP_PutTIDSys function sets the caller's time
remaining when DOORS.SYS was created to "n".
DOORS_TMP_GetURN() AS LONG
This form of the DOORS_TMP_GetURN function returns the user's record number.
DOORS_TMP_PutURN(n AS LONG)
This form of the DOORS_TMP_PutURN function sets the user's record number
to "n".
DOORS_TMP_GetBR() AS LONG
This form of the DOORS_TMP_GetBR function returns the baud rate.
DOORS_TMP_PutBR(n AS LONG)
This form of the DOORS_TMP_PutBR function sets the baud rate to "n".
"n" must be in the range of 0 to 115400.
DOORS_TMP_GetFEBR() AS LONG
This form of the DOORS_TMP_GetFEBR returns the front end's baud rate.
DOORS_TMP_PutFEBR(n AS LONG)
This form of the DOORS_TMP_PutFEBR sets the front end's baud rate to "n".
"n" must be in the range of 0 to 115400.
DOORS_TMP_GetTWULO() AS LONG
This form of the DOORS_TMP_GetTWULO function returns the time when the user
logged on.
DOORS_TMP_PutTWULO(n AS LONG)
This form of the DOORS_TMP_PutTWULO function sets the time when user logged
on to "n".
DOORS_TMP_GetAF() AS INTEGER
This form of the DOORS_TMP_GetAF function returns the ANSI flag.
DOORS_TMP_PutAF(n AS INTEGER)
This form of the DOORS_TMP_PutAF function sets the ANSI flag to "n".
"n" must be in the range of 0 to 1 as follows:
0 = Caller is not using ANSI emulation.
1 = Caller is using ANSI emulation.
DOORS_TMP_GetFEF() AS INTEGER
This form of the DOORS_TMP_GetFEF function returns the front end flag.
DOORS_TMP_PutFEF(n AS INTEGER)
This form of the DOORS_TMP_PutFEF function sets the front end flag to "n".
"n" must be in the range of 0 to 1 as follows:
0 = TriBBS was not called from a front end.
1 = TriBBS was called from a front end.
DOORS_TMP_GetFEHU() AS INTEGER
This form of the DOORS_TMP_GetFEHU function returns the front end hang up
flag.
DOORS_TMP_PutFEHU(n AS INTEGER)
This form of the DOORS_TMP_PutFEHU function sets the front end hang up flag
to "n". "n" must be in the range of 0 to 1 as follows:
0 = TriBBS will not hang up on the caller before returning to a front end.
1 = TriBBS will hang up on the caller before returning to a front end.
DOORS_TMP_GetUWF() AS INTEGER
This form of the DOORS_TMP_GetUWF function returns the user window flag.
DOORS_TMP_PutUWF(n AS INTEGER)
This form of the DOORS_TMP_PutUWF function sets the user window flag to "n".
"n" must be in the range of 0 to 1 as follows:
0 = The user status window is not being displayed.
1 = The user status window is being displayed.
DOORS_TMP_GetCRF() AS INTEGER
This form of the DOORS_TMP_GetCRF function returns the chat requested flag.
DOORS_TMP_PutCRF(n AS INTEGER)
This form of the DOORS_TMP_PutCRF function sets the chat requested flag to
"n". "n" must be in the range of 0 to 1 as follows:
0 = The caller hasn't requested a chat.
1 = The caller has requested a chat.
DOORS_TMP_GetEPF() AS INTEGER
This form of the DOORS_TMP_GetEPF function returns the event pending flag.
DOORS_TMP_PutEPF(n AS INTEGER)
This form of the DOORS_TMP_PutEPF function sets the event pending flag to
"n". "n" must be in the range of 0 to 1 as follows:
0 = An event is not pending.
1 = An event is pending.
DOORS_TMP_GetGFD() AS INTEGER
This form of the DOORS_TMP_GetGFD function returns the goodbye from door
flag.
DOORS_TMP_PutGFD(n AS INTEGER)
This form of the DOORS_TMP_PutGFD function sets the goodbye from door flag
to "n". "n" must be in the range of 0 to 1 as follows:
0 = The caller hasn't selected "goodbye" from a door.
1 = The caller has selected "goodbye" from a door.
DOORS_TMP_GetFBDAC() AS INTEGER
This form of the DOORS_TMP_GetFBDAC function returns the force board down
after call flag.
DOORS_TMP_PutFBDAC(n AS INTEGER)
This form of the DOORS_TMP_PutFBDAC function sets the force board down after
call flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = Do not exit TriBBS when the caller is done.
1 = Exit TriBBS when the caller is done.
DOORS_TMP_GetRIP() AS INTEGER
This form of the DOORS_TMP_GetRIP function returns the RIPscrip flag.
DOORS_TMP_PutRIP(n AS INTEGER)
This form of the DOORS_TMP_PutRIP function sets the RIPscrip flag to "n".
"n" must be in the range of 0 to 1 as follows:
0 = The caller isn't using RIPscrip emulation.
1 = The caller is using RIPscrip emulation.
DOORS_TMP_GetDSF() AS INTEGER
This form of the DOORS_TMP_GetDSF function returns the DOOR.SYS flag.
DOORS_TMP_PutDSF(n AS INTEGER)
This form of the DOORS_TMP_PutDSF function sets the DOOR.SYS flag to "n".
"n" must be in the range of 0 to 1 as follows:
0 = Do not read DOOR.SYS back in after the door.
1 = Read DOOR.SYS back in after the door.
DOORS_TMP_GetECC() AS INTEGER
This form of the DOORS_TMP_GetECC function returns the error correcting
connection flag.
DOORS_TMP_PutECC(n AS INTEGER)
This form of the DOORS_TMP_PutECC function sets the error correcting
connection flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = There is a non-errorcorrecting connection.
1 = There is an errorcorrecting connection.