home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
OS2
/
V7NL.ZIP
/
V7NL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-12-21
|
9KB
|
191 lines
#if !defined _V7NL_H_INCLUDED_
#define _V7NL_H_INCLUDED_
/***********************************************************************
* return codes
***********************************************************************
*/
#define V7NL_SUCCESS 0
#define V7NL_NODEINDEX_OPENFAILED 1
#define V7NL_SYSOPINDEX_OPENFAILED 2
#define V7NL_NODEDAT_OPENFAILED 3
#define V7NL_NODENUMBER_NOTFOUND 4
#define V7NL_SYSOPNAME_NOTFOUND 5
#define V7Nl_NODEDAT_READERROR 6
#define V7NL_NODEDAT_SEEKERROR 7
#define V7NL_FINDNEXT_END 8
#define V7NL_NODEDELETE_FAILED 9
#define V7NL_SYSOPDELETE_FAILED 10
#define V7NL_ZONENUMBER_REQUIRED 11
#define V7NL_NETNUMBER_REQUIRED 12
#define V7NL_NODENUMBER_REQUIRED 13
#define V7NL_PHONENUMBER_REQUIRED 14
#define V7NL_SYSOPNAME_REQUIRED 15
#define V7NL_MODMEMBAUD_LESSTHAN300 16
#define V7NL_MODEMBAUD_NOTMULTIPLE300 17
#define V7NL_NODEDAT_WRITEERROR 18
#define V7NL_NODEINDEX_UPDATEERR 19
#define V7NL_SYSOPINDEX_UPDATEERR 20
#ifndef WORD_DEFINED
#define WORD_DEFINED
typedef short WORD ;
typedef unsigned short UWORD ;
#endif
typedef int V7RC ;
/***********************************************************************
* structure of a fido net node. this structure is based primarily
* on the NEWNODE structure of Opus CBCS
***********************************************************************
*/
typedef struct {
WORD ZoneNumber ; /* *jbd* */
WORD NetNumber;
WORD NodeNumber;
UWORD Cost; /* cost to user for * message */
char SysopName[26] ; /* sysop *jbd* */
char SystemName[34]; /* node name */
char PhoneNumber[40]; /* phone number */
char MiscInfo[30]; /* city and state */
char Password[9]; /* necessarily null-terminated */
UWORD RealCost; /* phone company's charge */
short HubNode; /* node # of this node's hub
* or point number if node is a point */
UWORD BaudRate; /* baud rate divided by 300 */
BYTE ModemType; /* RESERVED for modem type */
UWORD NodeFlags; /* set of flags (see below) */
ULONG ulOffset ; /* offset into DAT file */
} V7NODE, *PV7NODE ;
/*
***********************************************************************
* Values for the `NodeFlags' field
***********************************************************************
*/
#define B_hub 0x0001 /* node is a net hub 0000 0000 0000 0001 */
#define B_host 0x0002 /* node is a net host 0000 0000 0000 0010 */
#define B_region 0x0004 /* node is region coord 0000 0000 0000 0100 */
#define B_zone 0x0008 /* is a zone gateway 0000 0000 0000 1000 */
#define B_CM 0x0010 /* runs continuous mail 0000 0000 0001 0000 */
#define B_res1 0x0020 /* reserved by Opus 0000 0000 0010 0000 */
#define B_res2 0x0040 /* reserved by Opus 0000 0000 0100 0000 */
#define B_res3 0x0080 /* reserved by Opus 0000 0000 1000 0000 */
#define B_res4 0x0100 /* reserved by Opus 0000 0001 0000 0000 */
#define B_res5 0x0200 /* reserved for non-Opus 0000 0010 0000 0000 */
#define B_res6 0x0400 /* reserved for non-Opus 0000 0100 0000 0000 */
#define B_res7 0x0800 /* reserved for non-Opus 0000 1000 0000 0000 */
#define B_point 0x1000 /* node is a point 0001 0000 0000 0000 */
#define B_res9 0x2000 /* reserved for non-Opus 0010 0000 0000 0000 */
#define B_resa 0x4000 /* reserved for non-Opus 0100 0000 0000 0000 */
#define B_resb 0x8000 /* reserved for non-Opus 1000 0000 0000 0000 */
/***********************************************************************
* V7Nl request control block
***********************************************************************
*/
typedef struct {
PSZ pszIndexName ; /* path and name of node index */
PSZ pszSysOpIndex ; /* path and name of Sysop index */
PSZ pszDataName ; /* path and name of .DAT file */
PV7NODE pV7Node ; /* address of where to copy nodlist
record */
WORD wLen ; /* length for find first node function
2 = search on Zone
4 = search on Zone + Net
6 = search on Zone + Net + Node
8 = search on Zone + Net + Node + Point
*/
UWORD V7Flags ; /* Flags */
PVOID pnlFh ; /* used by find first/next */
} V7RCB, *PV7RCB ;
/*
***********************************************************************
* Values for the "V7Flags" field
***********************************************************************
*/
#define V7_SYSOPDUP 0x0001 /* when adding entry to SysOp index
duplicate entry is ok */
#define V7_SYSOPADD 0x0002 /* when adding an entry to the node
index, add an entry to the sysop
index also */
/*
************************************************************************
*
* Function protoypes
*
************************************************************************
*/
/************************************************************************
* nodelist processing and initialization and termination. V7Initialize
* must be called prior to making any request to acces the nodelist
************************************************************************
*/
BOOL V7Initialize(VOID) ;
VOID V7Finish(VOID) ; /* done with the nodelist processor */
/************************************************************************
* functions for random reading of both indexes - these functions are
* for random reading of the nodelist. open will be done in "read"
* mode.
************************************************************************
*/
V7RC V7OpenIndex(PV7RCB) ; /* opens indexes for random reading */
V7RC V7ReadIndex(PV7RCB) ; /* reads a record from the nodex index */
VOID V7CloseIndex(PV7RCB) ; /* closes the indexes */
/************************************************************************
* functions for findfirst/findnext access of the nodelist
************************************************************************
*/
V7RC V7FindFirstNode(PV7RCB) ; /* opens the nodelist index and finds
the first matching nodenumber */
V7RC V7FindFirstSysOp(PV7RCB) ; /* opens the sysop index and finds
the first matching sysop name */
V7RC V7FindNext(PV7RCB) ; /* finds the next node/sysop entry */
VOID V7FindClose(PV7RCB) ; /* closes the index after findfirst
findnext processing */
/************************************************************************
* maintenance type functions - - these functions will open the required
* files, perform the function, then close the files.
************************************************************************
*/
V7RC V7AddNode(PV7RCB) ; /* adds an entry to the nodeindex
if the V7_SYSOPADD flag is set
an entry is also added to the
sysop index */
V7RC V7DeleteNode(PV7RCB) ; /* deletes a nodes entry from the
node index. A find node must
be done first as the offset is
required to delete the entry */
V7RC V7DeleteSysOp(PV7RCB) ; /* deletes a sysop entry from the
sysop index. A read must have
been done first to obtain the
offset */
V7RC V7UpdateNode(PV7RCB) ; /* updates a previously read
node entry. this function will
also update the sysop index
entry if it exists. */
/************************************************************************
* misc read functions - these functions will open the required files,
* perform the function, then close the files.
************************************************************************
*/
V7RC V7FindNode(PV7RCB) ; /* find a node */
#endif