home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
MISC
/
PBAPI10.ZIP
/
APIDOCS.ZIP
/
MNNNNHDR.DOC
< prev
next >
Wrap
Text File
|
1998-02-21
|
20KB
|
518 lines
Author....... : Gary Price
Copyrighted by: Freejack's Software 1997-98
MNNNN_HDR API for TriBBS v10.x/11.x written in PowerBasic v3.5
---------------------------------------------------------------------------
The MNNNN_HDR unit is used to manipulate data in the MNNNN.HDR data file
found in node 1's MWORK directory. The MNNNN_HDR unit is declared in
PBAPI10.INC as follows:
Mnnnn.hdr BitFields Breakdown
MnnnnBit.bit1 BIT Assignment
0 = EchoMessageFlag
1 = ThreadedMessageFlag
2 = PrivateMessageFlag
3 = DeletedMessageFlag
4 = ReceivedMessageFlag
5 = PermanentMessageFlag
6 = TriTossEchoMessageFlag
7 = CrashMailFlag
MnnnnBit.bit2 to MnnnnBit.bit10 - All bits are set to 0 (Reserved)
Sub Type Structure for 10 byte BitFields
TYPE MnnnnBit
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: "Mnnnn.HDR" where "nnnn" is the Conf Number
Example: M0001.HDR to M9999.HDR
"c" = 1 to 9999
"mn" = 1 to 999999
TYPE MNNNN
FromUser AS STRING * 61
ToUser AS STRING * 61
Subject AS STRING * 61
NameOfAttachedFile AS STRING * 81
DateAndTime AS STRING * 15
NetMailFromZone AS INTEGER
NetMailFromNet AS INTEGER
NetMailFromNode AS INTEGER
NetMailFromPoint AS INTEGER
NetMailToZone AS INTEGER
NetMailToNet AS INTEGER
NetMailToNode AS INTEGER
NetMailToPoint AS INTEGER
OffsetIntoTextFile AS LONG
MessageLength AS LONG
Number AS LONG
NumberOfMessageThisRepliesTo AS LONG
FromHash AS LONG
ToHash AS LONG
MnnnnBitFields AS MnnnnBit
ReservedDataArea AS STRING * 695
END TYPE
DIM MnnnnBit AS MnnnnBit
DIM MNNNN AS SHARED MNNNN
DIM mch AS SHARED MNNNN PTR
mch = VARPTR32(MNNNN)
LSET MNNNN = MNNNN
---------------------------------------------------------------------------
FUNCTION's below are from the MNNNNH.PBU Unit and DECLAREd in PBAPI10.INC.
FUNCTION MNNNN_HDR_OPEN(c AS INTEGER) AS INTEGER
FUNCTION MNNNN_HDR_CLOSE()
FUNCTION MNNNN_HDR_READ(mn AS LONG)
FUNCTION MNNNN_HDR_WRITE(mn AS LONG)
FUNCTION MNNNN_HDR_Length() AS LONG
FUNCTION MNNNN_HDR_OpenRead(c AS INTEGER, mn AS LONG) AS INTEGER
FUNCTION MNNNN_HDR_WriteClose(mn AS LONG)
FUNCTION MNNNN_HDR_OpenReadClose(c AS INTEGER, mn AS LONG) AS INTEGER
FUNCTION MNNNN_HDR_OpenWriteClose(c AS INTEGER, mn AS LONG) AS INTEGER
FUNCTION MNNNN_HDR_Clearit(c AS INTEGER)
FUNCTION MNNNN_HDR_Search(mn AS LONG) AS INTEGER
FUNCTION MNNNN_HDR_GetNext(mn AS LONG) AS INTEGER
FUNCTION MNNNN_HDR_GetYourNext(h AS LONG, mn AS LONG) AS INTEGER
FUNCTION MNNNN_HDR_GetFU() AS STRING
FUNCTION MNNNN_HDR_PutFU(s AS STRING)
FUNCTION MNNNN_HDR_GetTU() AS STRING
FUNCTION MNNNN_HDR_PutTU(s AS STRING)
FUNCTION MNNNN_HDR_GetMS() AS STRING
FUNCTION MNNNN_HDR_PutMS(s AS STRING)
FUNCTION MNNNN_HDR_GetNOAF() AS STRING
FUNCTION MNNNN_HDR_PutNOAF(s AS STRING)
FUNCTION MNNNN_HDR_GetDAT() AS STRING
FUNCTION MNNNN_HDR_PutDAT(s AS STRING)
FUNCTION MNNNN_HDR_GetNMFZ() AS INTEGER
FUNCTION MNNNN_HDR_PutNMFZ(n AS INTEGER)
FUNCTION MNNNN_HDR_GetNMFNet() AS INTEGER
FUNCTION MNNNN_HDR_PutNMFNet(n AS INTEGER)
FUNCTION MNNNN_HDR_GetNMFNode() AS INTEGER
FUNCTION MNNNN_HDR_PutNMFNode(n AS INTEGER)
FUNCTION MNNNN_HDR_GetNMFP() AS INTEGER
FUNCTION MNNNN_HDR_PutNMFP(n AS INTEGER)
FUNCTION MNNNN_HDR_GetNMTZ() AS INTEGER
FUNCTION MNNNN_HDR_PutNMTZ(n AS INTEGER)
FUNCTION MNNNN_HDR_GetNMTNet() AS INTEGER
FUNCTION MNNNN_HDR_PutNMTNet(n AS INTEGER)
FUNCTION MNNNN_HDR_GetNMTNode() AS INTEGER
FUNCTION MNNNN_HDR_PutNMTNode(n AS INTEGER)
FUNCTION MNNNN_HDR_GetNMTP() AS INTEGER
FUNCTION MNNNN_HDR_PutNMTP(n AS INTEGER)
FUNCTION MNNNN_HDR_GetOITF() AS LONG
FUNCTION MNNNN_HDR_PutOITF(n AS LONG)
FUNCTION MNNNN_HDR_GetML() AS LONG
FUNCTION MNNNN_HDR_PutML(n AS LONG)
FUNCTION MNNNN_HDR_GetMN() AS LONG
FUNCTION MNNNN_HDR_PutMN(n AS LONG)
FUNCTION MNNNN_HDR_GetNOMTRT() AS LONG
FUNCTION MNNNN_HDR_PutNOMTRT(n AS LONG)
FUNCTION MNNNN_HDR_GetFH() AS LONG
FUNCTION MNNNN_HDR_PutFH(n AS LONG)
FUNCTION MNNNN_HDR_GetTH() AS LONG
FUNCTION MNNNN_HDR_PutTH(n AS LONG)
FUNCTION MNNNN_HDR_GetEMF() AS INTEGER
FUNCTION MNNNN_HDR_PutEMF(n AS INTEGER)
FUNCTION MNNNN_HDR_GetTMF() AS INTEGER
FUNCTION MNNNN_HDR_PutTMF(n AS INTEGER)
FUNCTION MNNNN_HDR_GetPriMF() AS INTEGER
FUNCTION MNNNN_HDR_PutPriMF(n AS INTEGER)
FUNCTION MNNNN_HDR_GetDMF() AS INTEGER
FUNCTION MNNNN_HDR_PutDMF(n AS INTEGER)
FUNCTION MNNNN_HDR_GetRMF() AS INTEGER
FUNCTION MNNNN_HDR_PutRMF(n AS INTEGER)
FUNCTION MNNNN_HDR_GetPerMF() AS INTEGER
FUNCTION MNNNN_HDR_PutPerMF(n AS INTEGER)
FUNCTION MNNNN_HDR_GetTTEMF() AS INTEGER
FUNCTION MNNNN_HDR_PutTTEMF(n AS INTEGER)
FUNCTION MNNNN_HDR_GetCMF() AS INTEGER
FUNCTION MNNNN_HDR_PutCMF(n AS INTEGER)
---------------------------------------------------------------------------
** EXTERNAL FUNCTION USED BY MNNNN.HDR UNIT BELOW **
FUNCTION Exist(BYVAL Filename AS STRING) AS INTEGER
---------------------------------------------------------------------------
MPORTANT: TBNode1sMainDirectory must be set to node 1's main directory
before calling this function.
SPECIAL NOTE! In this Documentation and in all Unit's and .BAS files
relating to reading in Message Conferences and their
Messages. Please note the following below.
"c" will stand for Conference Number
"mn" will stand for Message Number of "c" Conference Number
Previously, "n" was set for Message Number and was defined
as a SHORT INTEGER. Since TriBBS allows "999,999" messages,
the newer "mn" will now be defined as a LONG INTEGER for all
references to the Message's Number.
All other references to "n" can either be a SHORT INTEGER or
LONG INTEGER depending on the MNNNN Data Record's element.
---------------------------------------------------------------------------
MNNNN_HDR_Open(c AS INTEGER) AS INTEGER
The MNNNN_HDR_Open function opens the Mnnnn.HDR data file, where nnnn is
specified by "c", in node 1's MWORK directory. Also, this function will
return either 0 or 1 depending if the file exists or not.
0 = MNNNN.HDR does not exist and file was not open.
1 = MNNNN.HDR did exist and the file was opened.
MNNNN_HDR_Close()
The MNNNN_HDR_Close function closes the Mnnnn.HDR data file in node 1's
MWORK directory.
MNNNN_HDR_Read(mn AS LONG)
The MNNNN_HDR_Read function reads the record for message header "mn" into
memory.
MNNNN_HDR_Write(mn AS LONG)
The MNNNN_HDR_Write function updates the record for message header "mn" from
memory.
MNNNN_HDR_Length() AS LONG
The MNNNN_HDR_Length function returns the number of records in the Mnnnn.HDR
data file.
MNNNN_HDR_OpenRead(c AS INTEGER, mn AS LONG) AS INTEGER
The MNNNN_HDR_OpenRead function provides the functionality of the
MNNNN_HDR_Open and MNNNN_HDR_Read functions in a single function call.
Also, this function will return either 0 or 1 depending if the file exists
or not.
0 = MNNNN.HDR does not exist and file was not open.
1 = MNNNN.HDR did exist and the file was opened.
MNNNN_HDR_WriteClose(mn AS LONG)
The MNNNN_HDR_WriteClose function provides the functionality of the
MNNNN_HDR_Write and MNNNN_HDR_Close functions in a single function call.
MNNNN_HDR_OpenReadClose(c AS INTEGER, mn AS LONG) AS INTEGER
The MNNNN_HDR_OpenReadClose function provides the functionality of the
MNNNN_HDR_Open, MNNNN_HDR_Read, and MNNNN_HDR_Close functions in a single
function call. Also, this function will return either 0 or 1 depending if
the file exists or not.
0 = MNNNN.HDR does not exist and file was not open.
1 = MNNNN.HDR did exist and the file was opened.
MNNNN_HDR_OpenWriteClose(c AS INTEGER, mn AS LONG)
The MNNNN_HDR_OpenWriteClose function provides the functionality of the
MNNNN_HDR_Open, MNNNN_HDR_Write, and MNNNN_HDR_Close functions in a single
function call.
MNNNN_HDR_ClearIt(c AS INTEGER)
The MNNNN_HDR_ClearIt Function sets the entire MNNNN_HDR data record for 'c'
to all zeros, leaving the data record in place, but empty.
-----------------------------------------------------------------------------
ATTENTION: Pointer Varible "@mn" has changed to "@mc".
POINTERS Uses a hidden variable I use called "@mc". 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
MNNNNH.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 farea.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 MNNNN.HDR
in order for the changes to become permanent.
-----------------------------------------------------------------------------
MNNNN_HDR_Search(mn AS LONG) AS INTEGER
The MNNNN_HDR_Search function searches the header file for message number
"mn". If message number "mn" is found in the header file,
the MNNNN_HDR_Search function will return the message header's record number.
Otherwise, the MNNNN_HDR_Search function will return -1 to indicate that
message number "mn" was not found in the header file.
MNNNN_HDR_GetNext(mn AS LONG) AS INTEGER
The MNNNN_HDR_GetNext function searches the header file for the next message
after message number "mn". If a next message is found, the MNNNN_HDR_GetNext
function will return the message header's record number. Otherwise, the
MNNNN_HDR_GetNext function will return -1 to indicate that a next message
was not found in the header file.
MNNNN_HDR_GetYourNext(h AS LONG, mn AS LONG) AS INTEGER
The MNNNN_HDR_GetYourNext function searches the header file for the next
message addressed to the user with a hash value of "h" and comes after
message number "mn". If a your next message is found, the
MNNNN_HDR_GetYourNext function will return the message header's record
number. Otherwise, the MNNNN_HDR_GetYourNext function will return -1 to
indicate that a your next message was not found in the header file.
MNNNN_HDR_GetFU() AS STRING
This form of the MNNNN_HDR_GetFU function returns a pointer to the message's
from string.
MNNNN_HDR_PutFU(s AS STRING)
This form of the MNNNN_HDR_PutFU function sets the message's from 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.
MNNNN_HDR_GetTU() AS STRING
This form of the MNNNN_HDR_GetTU function returns a pointer to the message's
to string.
MNNNN_HDR_PutTU(s AS STRING)
This form of the MNNNN_HDR_PutTU function sets the message's to 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.
MNNNN_HDR_GetMS() AS STRING
This form of the MNNNN_HDR_GetMS function returns a pointer to the message's
subject string.
MNNNN_HDR_PutMS(s AS STRING)
This form of the MNNNN_HDR_PutMS function sets the message's subject 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.
MNNNN_HDR_GetNOAF() AS STRING
This form of the MNNNN_HDR_GetNOAF function returns a pointer to the
message's name of attached file string.
MNNNN_HDR_PutNOAF(s AS STRING)
This form of the MNNNN_HDR_PutNOAF function sets the message's name of
attached file string to the string pointed to by "s". Note that the string
pointed to by "s" can be no more than 80 characters in length.
MNNNN_HDR_GetDAT() AS STRING
This form of the MNNNN_HDR_GetDAT function returns a pointer to the message's
date and time string.
MNNNN_HDR_PutDAT(s AS STRING)
This form of the MNNNN_HDR_PutDAT function sets the message's date and time
string to the string pointed to by "s". Note that the string pointed to by
"s" can be no more than 14 characters in length and must use the format
"MM/DD/YY HH:MM".
MNNNN_HDR_GetNMFZ() AS INTEGER
This form of the MNNNN_HDR_GetNMFZ function returns the message's netmail
from zone.
MNNNN_HDR_PutNMFZ(n AS INTEGER)
This form of the MNNNN_HDR_PutNMFZ function sets the message's netmail from
zone to "n".
MNNNN_HDR_GetNMFNet() AS INTEGER
This form of the MNNNN_HDR_GetNMFNet function returns the message's netmail
from net.
MNNNN_HDR_PutNMFNet(n AS INTEGER)
This form of the MNNNN_HDR_PutNMFNet function sets the message's netmail
from net to "n".
MNNNN_HDR_GetNMFNode() AS INTEGER
This form of the MNNNN_HDR_GetNMFNode function returns the message's netmail
from node.
MNNNN_HDR_PutNMFNode(n AS INTEGER)
This form of the MNNNN_HDR_PutNMFNode function sets the message's netmail
from node to "n".
MNNNN_HDR_GetNMFP() AS INTEGER
This form of the MNNNN_HDR_GetNMFP function returns the message's netmail
from point.
MNNNN_HDR_PutNMFP(n AS INTEGER)
This form of the MNNNN_HDR_PutNMFP function sets the message's netmail from
point to "n".
MNNNN_HDR_GetNMTZ() AS INTEGER
This form of the MNNNN_HDR_GetNMTZ function returns the message's netmail to
zone.
MNNNN_HDR_PutNMTZ(n AS INTEGER)
This form of the MNNNN_HDR_PutNMTZ function sets the message's netmail to
zone to "n".
MNNNN_HDR_GetNMTNet() AS INTEGER
This form of the MNNNN_HDR_GetNMTNet function returns the message's netmail
to net.
MNNNN_HDR_PutNMTNet(n AS INTEGER)
This form of the MNNNN_HDR_PutNMTNet function sets the message's netmail to
net to "n".
MNNNN_HDR_GetNMTNode() AS INTEGER
This form of the MNNNN_HDR_GetNMTNode function returns the message's netmail
to node.
MNNNN_HDR_PutNMTNode(n AS INTEGER)
This form of the MNNNN_HDR_PutNMTNode function sets the message's netmail to
node to "n".
MNNNN_HDR_GetNMTP() AS INTEGER
This form of the MNNNN_HDR_GetNMTP function returns the message's netmail to
point.
MNNNN_HDR_PutNMTP(n AS INTEGER)
This form of the MNNNN_HDR_PutNMTP function sets the message's netmail to
point.
MNNNN_HDR_GetOITF() AS LONG
This form of the MNNNN_HDR_GetOITF function returns the message's offset
into the accompanying Mnnnn.TXT file.
MNNNN_HDR_PutOITF(n AS LONG)
This form of the MNNNN_HDR_PutOITF function sets the message's offset into
the accompanying Mnnnn.TXT file to "n".
MNNNN_HDR_GetML() AS LONG
This form of the MNNNN_HDR_GetML function returns the message's length.
MNNNN_HDR_PutML(n AS LONG)
This form of the MNNNN_HDR_PutML function sets the message's length.
MNNNN_HDR_GetMN() AS LONG
This form of the MNNNN_HDR_GetMN function returns the message's number.
MNNNN_HDR_PutMN(mn AS LONG)
This form of the MNNNN_HDR_PutMN function sets the message's number to "mn".
MNNNN_HDR_GetNOMTRT() AS LONG
This form of the MNNNN_HDR_GetNOMTRT function returns the number of the
message this message replies to.
MNNNN_HDR_PutNOMTRT(n AS LONG)
This form of the MNNNN_HDR_PutNOMTRT function sets the number of the message
this message replies to to "n".
MNNNN_HDR_GetFH() AS LONG
This form of the MNNNN_HDR_GetFH function returns the message's from hash
value.
MNNNN_HDR_PutFH(n AS LONG)
This form of the MNNNN_HDR_PutFH functions sets the message's from hash
value to "n".
MNNNN_HDR_GetTH() AS LONG
This form of the MNNNN_HDR_GetTH function returns the message's to hash
value.
MNNNN_HDR_PutTH(n AS LONG)
This form of the MNNNN_HDR_PutTH function sets the message's to hash value.
-----------------------------------------------------------------------------
All BIT Fields below have been converted to Integers to allow easier access
and handling.
-----------------------------------------------------------------------------
MNNNN_HDR_GetEMF() AS INTEGER
This form of the MNNNN_HDR_GetEMF function returns the message's echo message
flag.
MNNNN_HDR_PutEMF(n AS INTEGER)
This form of the MNNNN_HDR_PutEMF function sets the message's echo message
flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = Do not echo the message.
1 = Echo the message.
MNNNN_HDR_GetTMF() AS INTEGER
This form of the MNNNN_HDR_GetTMF function returns the message's threaded
message flag.
MNNNN_HDR_PutTMF(n AS INTEGER)
This form of the MNNNN_HDR_PutTMF function sets the message's threaded
message flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = The message is not the start of a message thread.
1 = The message is the start of a message thread.
MNNNN_HDR_GetPriMF() AS INTEGER
This form of the MNNNN_HDR_GetPriMF function returns the message's private
message flag.
MNNNN_HDR_PutPriMF(n AS INTEGER)
This form of the MNNNN_HDR_PutPriMF function sets the message's private
message flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = The message is a public message.
1 = The message is a private message.
MNNNN_HDR_GetDMF() AS INTEGER
This form of the MNNNN_HDR_GetDMF function returns the message's deleted
message flag.
MNNNN_HDR_PutDMF(n AS INTEGER)
This form of the MNNNN_HDR_PutDMF function sets the message's deleted message
flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = The message is not marked for deletion.
1 = The message is marked for deletion.
MNNNN_HDR_GetRMF() AS INTEGER
This form of the MNNNN_HDR_GetRMF function returns the message's received
message flag.
MNNNN_HDR_PutRMF(n AS INTEGER)
This form of the MNNNN_HDR_PutRMF function sets the message's received
message flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = The message hasn't been received.
1 = The message has been received.
MNNNN_HDR_GetPerMF() AS INTEGER
This form of the MNNNN_HDR_GetPerMF function returns the message's permanent
message flag.
MNNNN_HDR_PutPMF(n AS INTEGER)
This form of the MNNNN_HDR_PutPerMF function sets the message's permanent
message flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = The message is not a permanent message.
1 = The message is a permanent message.
MNNNN_HDR_GetTTEMF() AS INTEGER
This form of the MNNNN_HDR_GetTTEMF function returns the message's TriToss
echo message flag.
MNNNN_HDR_PutTTEMF(n AS INTEGER)
This form of the MNNNN_HDR_PutTTEMF function sets the message's TriToss echo
message flag to "n". "n" must be in the range of 0 to 1 as follows:
0 = The message has not been echoed by TriToss.
1 = The message has been echoed by TriToss.
MNNNN_HDR_GetCMF() AS INTEGER
This form of the MNNNN_HDR_GetCMF function returns the message's crashmail
flag.
MNNNN_HDRPutCMF(n AS INTEGER)
This form of the MNNNN_HDR_PutCMF function sets the messageÆs crashmail flag
to "n". "n" must be in the range of 0 to 1 as follows:
0 = The message is not a crashmail message.
1 = The message is a crashmail message.