home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / v7nl.zip / V7NL.INF (.txt) < prev    next >
OS/2 Help File  |  1993-12-31  |  48KB  |  1,765 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. V7NL Licensing Terms and Restrictions ΓòÉΓòÉΓòÉ
  3.  
  4. (C) Copyright 1993, Jim Dailey, FidoNet 1:106/202, ALL RIGHTS RESERVED. 
  5.  
  6. THE V7NL.DLL,  IS AND WILL REMAIN THE INTELLECTUAL PROPERTY OF JAMES DAILEY. 
  7. BECAUSE V7NL IS LICENSED FREE OF CHARGE, I PROVIDE ABSOLUTELY NO WARRANTY AND 
  8. WILL ONLY GUARANTEE THAT V7NL WILL TAKE UP SPACE ON YOUR DISK.  V7NL IS OFFERED 
  9. "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, 
  10. BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
  11. PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF V7NL, 
  12. AND THE ACCURACY OF ITS ASSOCIATED DOCUMENTATION, IS WITH YOU. SHOULD V7NL OR 
  13. ITS ASSOCIATED DOCUMENTATION PROVE  DEFECTIVE, YOU ASSUME THE COST OF ALL 
  14. NECESSARY SERVICING, REPAIR OR CORRECTION. 
  15.  
  16. A LICENSE TO FREELY USE V7NL IS GRANTED TO ALL NON-COMMERCIAL USERS. IF YOU RUN 
  17. A SUBSCRIPTION BBS, OR RUN A BBS IN SUPPORT OF YOUR BUSINESS, YOU ARE REQUIRED 
  18. TO MAKE A ONE TIME $100 DONATION TO A CHARITY THAT SUPPORTS ABUSED CHILDREN. 
  19. YOU MAY DISTRIBUTE V7NL.DLL WITH YOU APPLICATION.  IF YOUR APPLICATION IS A 
  20. COMMERCIAL APPLICATION OR A SHAREWARE APPLICATION YOU ARE REQUIRED TO MAKE THE 
  21. ONE TIME DONATION. DONATIONS ARE TO BE MADE ON BEHALF OF FIDONET. 
  22.  
  23. YOU MAY POST V7NL FOR DOWNLOADING FROM YOUR BBS, OR DISTRIBUTE V7NL THROUGH 
  24. FIDONET FILE DISTRIBUTION SYSTEMS UNDER THE FOLLOWING CONDITIONS: 
  25.  
  26.  1. YOU ARE NOT TO MODIFY THE ORIGINAL DISTRIBUTION FILE INCLUDING RE-ARCHIVING 
  27.     THE DISTRIBUTION FILE. 
  28.  
  29.  2. YOU ARE NOT TO REVERSE ENGINEER, MODIFY IN ANYWAY ANY FILE IN THE 
  30.     DISTRIBUTION ARCHIVE. 
  31.  
  32.  3. YOU ARE NOT TO SELL OR CHARGE A FEE FOR V7NL.  IF YOU RUN A SUBSCRIPTION 
  33.     BBS, V7NL IS TO BE FREELY AVAILABLE FOR DOWNLOAD OR NOT AVAILABLE AT ALL. 
  34.  
  35.  4. YOU ARE PROHIBITED FROM CHARGING FOR THE DISTRIBUTION OF V7NL. 
  36.  
  37. Special Thanks to: 
  38.  
  39. Vince Perriello - for giving us BINKLEY Term 
  40.  
  41. The Opus development team of Wynn Wagner III and Doug Boone. 
  42.  
  43. FidoNet - a major contributor to global communciations. 
  44.  
  45. IBM for OS/2 (all versions). 
  46.  
  47. Last but not least - all those who took the time to file request and test V7nl 
  48. for me, and to send me your comments, suggestions, and bug reports. 
  49.  
  50.  
  51. ΓòÉΓòÉΓòÉ 2. Introduction ΓòÉΓòÉΓòÉ
  52.  
  53. The V7NL.DLL, is a 32 bit dynamic link library that provides an API to access a 
  54. FidoNet<tm> version 7 nodelist.  The DLL give the application programmer the 
  55. ability to: 
  56.  
  57.     1. Findfirst/Findnext processing to search the node list.  This can be done 
  58.        using a complete or partial nodenumber, or a complete or partial SysOp 
  59.        name. 
  60.  
  61.     2. Random processing of nodes.  An example would be a mail editor 
  62.        application that had a distribution list.  The application can open the 
  63.        nodelist once, individually read each node extracting or saving the 
  64.        required information, then closing the nodelist. 
  65.  
  66.     3. Nodelist maintenance.  Your application can add new nodes, update 
  67.        existing nodes, or delete existing nodes. 
  68.  
  69.  
  70. ΓòÉΓòÉΓòÉ 3. Version 7 Nodelist Format ΓòÉΓòÉΓòÉ
  71.  
  72. The Version 7 nodelist is divided into 3 seperate components: 
  73.  
  74. Node Index          An index containing an entry for every node in the 
  75.                     nodelist. 
  76.  
  77. SysOp Name Index    An index containing at least one entry for each SysOp in 
  78.                     the node list.  Typically, most node list compilers by 
  79.                     default will place a SysOp's name in the index once.  Most, 
  80.                     also allow duplicate entries if explicitly requested in 
  81.                     their configuration files. There can never be duplicate 
  82.                     entries all pointing to the same DAT file record A node 
  83.                     index entry and a SysOp index entry can and do point to the 
  84.                     same record. 
  85.  
  86. DAT file            A file containing the detailed information for each node. 
  87.                     Each index entry contains a pointer in the form of an 
  88.                     offset into the DAT file, for it's detailed information. 
  89.  
  90. The data structure of the index components are organized into a hierarchial 
  91. called a B_tree. Each node or "entry" in the tree is composed of 2 parts: a 
  92. "key" part and a "data" part. The data part is where the information is stored. 
  93.  
  94. The "key" part in the node index is made up of a node number. The length of the 
  95. key for a normal node is 6 bytes and for a point node is 8 bytes.  Duplicate 
  96. entries in the node index are not allowed. 
  97.  
  98. In the SysOp index, the key is a SysOp name of the format, Last name, followed 
  99. by a comma (,), followed by a space, followed the first name.  The SysOp index 
  100. can and does contain duplicate keys, however each entry's "data"  part contains 
  101. a different value. 
  102.  
  103. The "data" part in the index is an offset into the node list DAT file.  Once a 
  104. node's entry is located in the index, the offset is used to find and read the 
  105. nodes information from the DAT file. 
  106.  
  107.  
  108. ΓòÉΓòÉΓòÉ 4. Programming considerations ΓòÉΓòÉΓòÉ
  109.  
  110.  
  111. ΓòÉΓòÉΓòÉ 4.1. General Information ΓòÉΓòÉΓòÉ
  112.  
  113. V7NL.DLL is a 32 bit Dynamic Link Library, compiled with IBM's C Set++. When 
  114. compiling your programs, you MUST compile with structure packing on single a 
  115. byte boundary. 
  116.  
  117. Note:  OS/2 v2.0+ is required for V7NL.DLL. 
  118.  
  119.  
  120. ΓòÉΓòÉΓòÉ 4.2. V7NL Callable Function Groups. ΓòÉΓòÉΓòÉ
  121.  
  122.  
  123. ΓòÉΓòÉΓòÉ 4.2.1. Initialization and termination. ΓòÉΓòÉΓòÉ
  124.  
  125. The 2 initialization and termination functions are: 
  126.  
  127. V7Initialize   This function initializes and prepares the V7NL.DLL for 
  128.                processing. It must be called once and only once, prior to 
  129.                makeing any subsequent function calls. 
  130.  
  131. V7Finish       The function is called when your nodelist processing is 
  132.                complete. Memory allocated during the initialization call is 
  133.                free. 
  134.  
  135.  
  136. ΓòÉΓòÉΓòÉ 4.2.2. FindFirst/Findnext Processing. ΓòÉΓòÉΓòÉ
  137.  
  138. The FindFirst/Findnext is similiar to findfirst/findnext processing when 
  139. searching for a list of files that match a specified file mask. Two findfirst 
  140. functions are available; one for searching the node index, and the other for 
  141. searching the SysOp name index. 
  142.  
  143. When one of the findfirst functions is called, the matching index and the DAT 
  144. file is opened and remains opened until the close function is called. 
  145.  
  146. V7FindFirstNode     This function opens the node index and the DAT file, and 
  147.                     retrieves the first record matching the search key. 
  148.  
  149. V7FindFirstSysOp    This function opens the SysOp name index and the DAT file, 
  150.                     and retrieves the first record matching the search key. 
  151.  
  152. V7FindNext          This function retrieves the next record matching your 
  153.                     search key. This function is called repeatdly until, there 
  154.                     are no more records matching the initial search key. 
  155.  
  156. V7FindClose         This function terminates the findfirst/findnext process. 
  157.                     The node list files that are open are closed and IO buffers 
  158.                     are freed. 
  159.  
  160.  
  161. ΓòÉΓòÉΓòÉ 4.2.3. Node List Maintenance. ΓòÉΓòÉΓòÉ
  162.  
  163. The maintenance functions allow you to update an existing node, add a new node, 
  164. or delete a node. These function will open the required index and DAT files, 
  165. perform their function, then close the files. 
  166.  
  167. V7AddNode      This function allows a program to add a new node to the node 
  168.                list. Optionally, an entry is added to the SysOp name index. 
  169.  
  170. V7UpdateNode   This function allows you to update the information for an 
  171.                existing node. 
  172.  
  173. V7DeleteNode   This function deletes a nodes information from the node index. 
  174.                If a matching entry is in the SysOp name index, it too is 
  175.                deleted.  The information in the DAT file is not deleted. 
  176.  
  177.  
  178. ΓòÉΓòÉΓòÉ 4.2.4. Random Processing. ΓòÉΓòÉΓòÉ
  179.  
  180. Random processing is ideal for retireving information on nodes that can't be 
  181. read using findfirst/findnext processing.  It is ideal for a distribution list 
  182. where the nodes are in many different nets. In random processing, the node 
  183. index and DAT files are opened until processing is complete. 
  184.  
  185. V7OpenIndex    Opens the node index for randome processing. 
  186.  
  187. V7ReadIndex    Reads the information for a specific node using the node index 
  188.                opened by V7OpenIndex. 
  189.  
  190. V7CloseIndex   Closes the node index and DAT file. 
  191.  
  192.  
  193. ΓòÉΓòÉΓòÉ 4.2.5. Misc. Processing ΓòÉΓòÉΓòÉ
  194.  
  195. The following function is when you need to find one node number. It will open 
  196. the node index and DAT file, read the nodes record, then close the opened file. 
  197.  
  198. V7FindNode Obtain the information for a specific node. 
  199.  
  200.  
  201. ΓòÉΓòÉΓòÉ 4.3. Return Codes. ΓòÉΓòÉΓòÉ
  202.  
  203. Below are the return codes returned by the function in V7NL.DLL 
  204.  
  205. V7NL_SUCCESS                  Request was a success 
  206.  
  207. V7NL_NODEINDEX_OPENFAILED     Open of the node index failed. 
  208.  
  209. V7NL_SYSOPINDEX_OPENFAILED    Open of the SysOp index failed. 
  210.  
  211. V7NL_NODEDAT_OPENFAILED       Open of the DAT file failed. 
  212.  
  213. V7NL_NODENUMBER_NOTFOUND      Requested node number was not found. 
  214.  
  215. V7NL_SYSOPNAME_NOTFOUND       Requested SysOp name was not found. 
  216.  
  217. V7Nl_NODEDAT_READERROR        IO error reading the DAT file. 
  218.  
  219. V7NL_NODEDAT_SEEKERROR        Seek failed on DAT file. 
  220.  
  221. V7NL_FINDNEXT_END             No more entries found matching the argument 
  222.                               passed in either V7FindFirstNode or 
  223.                               V7FindFirstSysOp 
  224.  
  225. V7NL_NODEDELETE_FAILED        Deletion of an entry in the node index failed. 
  226.  
  227. V7NL_SYSOPDELETE_FAILED       Deletion of an entry in the SysOp index failed. 
  228.  
  229. V7NL_ZONENUMBER_REQUIRED      Zone number is required in the V7NODE record. 
  230.  
  231. V7NL_NETNUMBER_REQUIRED       Net number is required in the V7NODE record. 
  232.  
  233. V7NL_NODENUMBER_REQUIRED      Node number is required in the V7NODE record. 
  234.  
  235. V7NL_PHONENUMBER_REQUIRED     Phone number is required in the V7NODE record. 
  236.  
  237. V7NL_SYSOPNAME_REQUIRED       SysOp name is required in the V7NODE record. 
  238.  
  239. V7NL_MODMEMBAUD_LESSTHAN300   Modem Baud is less than 300. 
  240.  
  241. V7NL_MODEMBAUD_NOTMULTIPLE300 Modem Baud is not a multiple of 300. 
  242.  
  243. V7NL_NODEDAT_WRITEERROR       IO Error writing to the DAT file. 
  244.  
  245. V7NL_NODEINDEX_UPDATEERR      Error writing to the node index. 
  246.  
  247. V7NL_SYSOPINDEX_UPDATEERR     Error writing to the SysOp index. 
  248.  
  249.  
  250. ΓòÉΓòÉΓòÉ 4.4. V7RCB - V7NL.DLL Request Control Block ΓòÉΓòÉΓòÉ
  251.  
  252. All functions that perform IO to either of the node list indexes and the DAT 
  253. file require the application pass a V7NL Request Control Block  It is the 
  254. applications responsibility to ensure the V7RCB is correctly initialized. 
  255.  
  256. /***********************************************************************
  257.  * V7NL request control block
  258.  ***********************************************************************
  259.  */
  260. typedef struct {
  261.   PSZ   pszIndexName ;    /* path and name of node index */
  262.   PSZ   pszSysOpIndex ;   /* path and name of Sysop index */
  263.   PSZ   pszDataName ;    /* path and name of .DAT file */
  264.   PV7NODE pV7Node ;      /* address of where to copy nodlist
  265.                   record */
  266.   WORD   wLen ;        /* length for find first node function
  267.                   2 = search on Zone
  268.                   4 = search on Zone + Net
  269.                   6 = search on Zone + Net + Node
  270.                   8 = search on Zone + Net + Node + Point
  271.                 */
  272.   UWORD  V7Flags ;      /* Flags */
  273.   PVOID  pnlFh ;       /* used by find first/next */
  274. } V7RCB, *PV7RCB ;
  275.  
  276. /*
  277.  ***********************************************************************
  278.  * Values for the "V7Flags" field
  279.  ***********************************************************************
  280.  */
  281. #define V7_SYSOPDUP     0x0001  /* when adding entry to SysOp index
  282.                     duplicate entry is ok */
  283. #define V7_SYSOPADD     0x0002  /* when adding an entry to the node
  284.                     index, add an entry to the sysop
  285.                     index also */
  286.  
  287.  
  288. ΓòÉΓòÉΓòÉ 4.5. V7NODE - Version 7 Nodelist Structure. ΓòÉΓòÉΓòÉ
  289.  
  290. The following is the format of the Version 7 nodelist record. 
  291.  
  292. /***********************************************************************
  293.  * structure of a fido net node.  this structure is based primarily
  294.  * on the NEWNODE structure of Opus CBCS
  295.  ***********************************************************************
  296.  */
  297.  
  298. typedef struct {
  299.   WORD   ZoneNumber ;     /* *jbd* */
  300.   WORD   NetNumber;
  301.   WORD   NodeNumber;
  302.   UWORD  Cost;        /* cost to user for * message */
  303.   char   SysopName[26] ;   /* sysop *jbd* */
  304.   char   SystemName[34];   /* node name */
  305.   char   PhoneNumber[40];   /* phone number */
  306.   char   MiscInfo[30];    /* city and state */
  307.   char   Password[9];     /* necessarily null-terminated */
  308.   UWORD  RealCost;      /* phone company's charge */
  309.   short  HubNode;       /* node # of this node's hub
  310.                  * or point number if node is a point */
  311.   UWORD  BaudRate;      /* baud rate divided by 300 */
  312.   BYTE   ModemType;      /* RESERVED for modem type */
  313.   UWORD  NodeFlags;      /* set of flags (see below) */
  314.   ULONG  ulOffset ;      /* offset into DAT file */
  315. } V7NODE, *PV7NODE ;
  316.  
  317.  
  318. /*
  319.  ***********************************************************************
  320.  * Values for the `NodeFlags' field
  321.  ***********************************************************************
  322.  */
  323. #define B_hub   0x0001  /* node is a net hub   0000 0000 0000 0001 */
  324. #define B_host  0x0002  /* node is a net host   0000 0000 0000 0010 */
  325. #define B_region 0x0004  /* node is region coord  0000 0000 0000 0100 */
  326. #define B_zone  0x0008  /* is a zone gateway   0000 0000 0000 1000 */
  327. #define B_CM   0x0010  /* runs continuous mail  0000 0000 0001 0000 */
  328. #define B_res1  0x0020  /* reserved by Opus    0000 0000 0010 0000 */
  329. #define B_res2  0x0040  /* reserved by Opus    0000 0000 0100 0000 */
  330. #define B_res3  0x0080  /* reserved by Opus    0000 0000 1000 0000 */
  331. #define B_res4  0x0100  /* reserved by Opus    0000 0001 0000 0000 */
  332. #define B_res5  0x0200  /* reserved for non-Opus 0000 0010 0000 0000 */
  333. #define B_res6  0x0400  /* reserved for non-Opus 0000 0100 0000 0000 */
  334. #define B_res7  0x0800  /* reserved for non-Opus 0000 1000 0000 0000 */
  335. #define B_point  0x1000  /* node is a point    0001 0000 0000 0000 */
  336. #define B_res9  0x2000  /* reserved for non-Opus 0010 0000 0000 0000 */
  337. #define B_resa  0x4000  /* reserved for non-Opus 0100 0000 0000 0000 */
  338. #define B_resb  0x8000  /* reserved for non-Opus 1000 0000 0000 0000 */
  339.  
  340. Note:  The V7NL.DLL Version 7 nodelist structure is based closely on the Opus 
  341. v1.20 Version 7 node list structure. The Opus v1.20 Version 7 node list 
  342. structure is Copyright 1991 by Wynn Wagner III and Doug Boone. 
  343.  
  344.  
  345. ΓòÉΓòÉΓòÉ 5. V7NL Functions Calls. ΓòÉΓòÉΓòÉ
  346.  
  347.  
  348. ΓòÉΓòÉΓòÉ 5.1. V7AddNode ΓòÉΓòÉΓòÉ
  349.  
  350. Function Syntax 
  351. Parameters 
  352. Return Values 
  353. Notes 
  354. Examples 
  355. Related 
  356.  
  357.  
  358. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  359.  
  360. /************************************************************
  361.  * This function adds a node to the node index and it related
  362.  * information to the nodelist .DAT file.  Optionally, an
  363.  * index entry is added to the SysOp index.
  364.  ************************************************************
  365.  */
  366.  
  367. #include <os2.h>
  368. #include "v7nl.h"
  369.  
  370. V7RC   V7rc ;            /* return code from the DLL */
  371. PV7RCB  pV7rcb ;           /* DLL IO request block */
  372.  
  373. V7rc = V7AddNode(pV7rcb) ;
  374.  
  375.  
  376. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  377.  
  378. V7RCB: with the following fields initialized: 
  379.  
  380. pszIndexName - Pointer to the name of the nodelist node index. 
  381.  
  382. pszSysOpIndex - Pointer to the name of the nodelist sysop index. 
  383.  
  384. pszDataName - Pointer to the name of the nodelist .DAT file. 
  385.  
  386. pszV7Node - Pointer to an initialized nodelist record. 
  387.  
  388. If you wish to add the SysOp name for the new node to the SysOp index you must 
  389. turn on the V7_SYSOPADD flag in the V7Flags field.  If you, allow duplicate 
  390. SysOp names, the V7_SYSOPDUP flag must also be turned on. 
  391.  
  392. V7NODE with, at a minimum, the following fields initialized.: 
  393.  
  394. ZoneNumberZone number of the new node. 
  395.  
  396. NetNumberNet number of the new node. 
  397.  
  398. NodeNumberNode number of the new node. 
  399.  
  400. SysopNameName of the SysOp for the new node. 
  401.  
  402. PhoneNumberPhone number for the new node. 
  403.  
  404. ModemBaudModem baud rate for the new node. This value must be a multiple of 
  405. 300. 
  406.  
  407. If the new node is a point, the HubNode must contain the point number and 
  408. B_point flag in the NodeFlags field must be turned on. 
  409.  
  410.  
  411. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  412.  
  413. Return Values 
  414.  
  415. V7NL_SUCCESS - Request was a success 
  416. V7NL_NODEINDEX_OPENFAILED - Open of the node index failed. 
  417. V7NL_SYSOPINDEX_OPENFAILED - Open of the SysOp index failed. 
  418. V7NL_NODEDAT_OPENFAILED - Open of the DAT file failed. 
  419. V7Nl_NODEDAT_READERROR - IO error reading the DAT file. 
  420. V7NL_NODEDAT_SEEKERROR - Seek failed on DAT file. 
  421. V7NL_ZONENUMBER_REQUIRED - Zone number is required in the V7NODE record. 
  422. V7NL_NETNUMBER_REQUIRED - Net number is required in the V7NODE record. 
  423. V7NL_NODENUMBER_REQUIRED - Node number is required in the V7NODE record. 
  424. V7NL_PHONENUMBER_REQUIRED - Phone number is required in the V7NODE record. 
  425. V7NL_SYSOPNAME_REQUIRED - SysOp name is required in the V7NODE record. 
  426. V7NL_MODMEMBAUD_LESSTHAN300 - Modem Baud is less than 300. 
  427. V7NL_MODEMBAUD_NOTMULTIPLE300 - Modem Baud is not a multiple of 300. 
  428. V7NL_NODEDAT_WRITEERROR - IO Error writing to the DAT file. 
  429. V7NL_NODEINDEX_UPDATEERR- Error writing to the node index. 
  430. V7NL_SYSOPINDEX_UPDATEERR - Error writing to the SysOp index. 
  431.  
  432.  
  433. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  434.  
  435. I can't think of anything at this time. 
  436.  
  437.  
  438. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  439.  
  440. #include <os2.h>
  441. #include "v7nl.h"
  442.  
  443. main()
  444. {
  445. PSZ pszNodeIndex  = "C:\\Nodelist\\Nodex.ndx" ;
  446. PSZ pszSysOpIndex = "C:\\Nodelist\\Sysop.ndx" ;
  447. PSZ pszNodeDat   = "C:\\Nodelist\\Nodex.dat" ;
  448.  
  449. V7RCB  Vrcb ;         /* request block */
  450. V7NODE V7node ;        /* V7 format node record */
  451. V7RC  V7rc ;         /* return code */
  452.  
  453.   V7Initialize() ;
  454.  
  455.   memset(&V7rcb, '\0', sizeof(V7RCB)) ;
  456.   memset(&V7node, '\0', sizeof(V7NODE)) ;
  457.  
  458.   V7rcb.pszIndexName  = pszNodeIndex ;
  459.   V7rcb.pszSysOpIndex = pszSysOpIndex ;
  460.   V7rcb.pszDatName   = pszNodeDat ;
  461.   V7rcb.pV7Node    = &V7node ;
  462.  
  463.         .
  464.         .
  465.    < initialize V7NODE >
  466.         .
  467.         .
  468.   V7rc = V7AddNode(&V7rcb) ;
  469.  
  470.   if ( V7rc != V7NL_SUCCESS ) {
  471.     <error processing>
  472.   }
  473.  
  474. }
  475.  
  476.  
  477. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  478.  
  479. V7FindNode 
  480. V7DeleteNode 
  481. V7UpdateNode 
  482. V7DeleteSysOp 
  483.  
  484.  
  485. ΓòÉΓòÉΓòÉ 5.2. V7CloseIndex ΓòÉΓòÉΓòÉ
  486.  
  487. Function Syntax 
  488. Parameters 
  489. Return Values 
  490. Notes 
  491. Examples 
  492. Related 
  493.  
  494.  
  495. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  496.  
  497. /************************************************************
  498.  * This function closes the node index that was opened by
  499.  * a previous call to V7OpenIndex
  500.  ************************************************************
  501.  */
  502.  
  503. #include <os2.h>
  504. #include "v7nl.h"
  505.  
  506. V7RC   V7rc ;            /* return code from the DLL */
  507. PV7RCB  pV7rcb ;           /* DLL IO request block */
  508.  
  509. VOID V7CloseIndex(PV7RCB pV7rcb)
  510.  
  511.  
  512. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  513.  
  514. V7RCB that was initialized prior to calling V7OpenIndex 
  515.  
  516.  
  517. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  518.  
  519. This functions does not return any values. 
  520.  
  521.  
  522. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  523.  
  524. The V7RCB must have been initialized, and a call to V7OpenIndex prior to 
  525. calling this function. 
  526.  
  527.  
  528. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  529.  
  530. #include <os2.h>
  531. #include "v7nl.h"
  532.  
  533. main()
  534. {
  535. PSZ pszNodeIndex  = "C:\\Nodelist\\Nodex.ndx" ;
  536. PSZ pszSysOpIndex = "C:\\Nodelist\\Sysop.ndx" ;
  537. PSZ pszNodeDat   = "C:\\Nodelist\\Nodex.dat" ;
  538.  
  539. V7RCB  Vrcb ;         /* request block */
  540. V7NODE V7node ;        /* V7 format node record */
  541. V7RC  V7rc ;         /* return code */
  542.  
  543.   V7Initialize() ;
  544.  
  545.   memset(&V7rcb, '\0', sizeof(V7RCB)) ;
  546.   memset(&V7node, '\0', sizeof(V7NODE)) ;
  547.  
  548.   V7rcb.pszIndexName  = pszNodeIndex ;
  549.   V7rcb.pszDatName   = pszNodeDat ;
  550.   V7rcb.pV7Node    = &V7node ;
  551.  
  552.   V7rc = V7OpenIndex(&V7rcb) ;
  553.  
  554.   if ( V7rc != V7NL_SUCCESS ) {
  555.     <error processing>
  556.   }
  557.  
  558.         .
  559.         .
  560.    < initialize V7NODE >
  561.   < read a node list record >
  562.         .
  563.         .
  564.  
  565.   V7CloseIndex(&V7rcb) ;
  566. }
  567.  
  568.  
  569. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  570.  
  571. V7OpenIndex 
  572. V7ReadIndex 
  573.  
  574.  
  575. ΓòÉΓòÉΓòÉ 5.3. V7DeleteNode ΓòÉΓòÉΓòÉ
  576.  
  577. Function Syntax 
  578. Parameters 
  579. Return Values 
  580. Notes 
  581. Examples 
  582. Related 
  583.  
  584.  
  585. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  586.  
  587. /************************************************************
  588.  * This function deletes a nodes entry from the node
  589.  * index.
  590.  ************************************************************
  591.  */
  592.  
  593. #include <os2.h>
  594. #include "v7nl.h"
  595.  
  596. V7RC   V7rc ;            /* return code from the DLL */
  597. PV7RCB  pV7rcb ;           /* DLL IO request block */
  598. V7NODE  V7node ;           /* V7 nodelist record */
  599.  
  600. V7rc = V7DeleteNode(pV7rcb) ;
  601.  
  602.  
  603. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  604.  
  605. V7RCB: with the following fields initialized: 
  606.  
  607. pszIndexName - Pointer to the name of the nodelist node index. 
  608.  
  609. pszDataName - Pointer to the name of the nodelist .DAT file. 
  610.  
  611. pszV7Node - Pointer to an initialized nodelist record. 
  612.  
  613. V7NODE with, at a minimum, the following fields initialized.: 
  614.  
  615. ZoneNumber- Zone number of the node to be deleted. 
  616.  
  617. NetNumber- Net number of the node to be deleted. 
  618.  
  619. NodeNumber- Node number of the node to be deleted. 
  620.  
  621. ulOffset - Offset to the nodes entry in the DAT file. 
  622.  
  623. If the node to be deleted is a point, then the HubNode field of the V7NODE 
  624. record must contain the point number and the B_point in NodeFlags must be 
  625. turned on. 
  626.  
  627.  
  628. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  629.  
  630. V7NL_SUCCESS - Request was a success 
  631. V7NL_NODEINDEX_OPENFAILED - Open of the node index failed. 
  632. V7NL_NODEDELETE_FAILED - Deletion of the entry in the node index failed failed. 
  633.  
  634.  
  635. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  636.  
  637. The zone, net, and node numbers,  and the value in the ulOffset of the V7NODE 
  638. must match with the nodes index entry for a node to be deleted from the node 
  639. index.  If the node is a point, the point number is used as part of the index 
  640. key. 
  641.  
  642. The deleted nodes information in the DAT file is NOT not deleted. 
  643.  
  644.  
  645. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  646.  
  647. In this example, a nodes entry is first read in order to get it's offset into 
  648. the DAT file.  If the read is successful, the nodes entry in the node index is 
  649. deleted. 
  650.  
  651. #include <os2.h>
  652. #include "v7nl.h"
  653.  
  654. main()
  655. {
  656. PSZ pszNodeIndex  = "C:\\Nodelist\\Nodex.ndx" ;
  657. PSZ pszSysOpIndex = "C:\\Nodelist\\Sysop.ndx" ;
  658. PSZ pszNodeDat   = "C:\\Nodelist\\Nodex.dat" ;
  659.  
  660. V7RCB  Vrcb ;         /* request block */
  661. V7NODE V7node ;        /* V7 format node record */
  662. V7RC  V7rc ;         /* return code */
  663.  
  664.   V7Initialize() ;
  665.  
  666.   memset(&V7rcb, '\0', sizeof(V7RCB)) ;
  667.   memset(&V7node, '\0', sizeof(V7NODE)) ;
  668.  
  669.   V7rcb.pszIndexName  = pszNodeIndex ;
  670.   V7rcb.pszDatName   = pszNodeDat ;
  671.   V7rcb.pV7Node    = &V7node ;
  672.   V7rcb.wLen      = 6 ;
  673.  
  674.   V7node.ZoneNumber  = 1 ;
  675.   V7node.NetNumber   = 106 ;
  676.   V7node.NodeNumber  = 202 ;
  677.  
  678.  
  679.  
  680.   /* read the nodes record to gets the offset
  681.     of it's entry in the DAT file */
  682.  
  683.   V7rc = V7FindNode(&V7rcb) ;
  684.  
  685.   /* if the record was found, then
  686.     delete it */
  687.  
  688.   if ( V7rc == V7NL_SUCCESS ) {
  689.     V7rc = V7DeleteNode(&V7rcb) ;
  690.     if ( V7rc != V7NL_SUCCESS ) {
  691.        <error processing>
  692.     }
  693.   } else {
  694.     <error processing>
  695.   }
  696.  
  697. }
  698.  
  699.  
  700. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  701.  
  702. V7FindNode 
  703. V7AddNode 
  704. V7UpdateNode 
  705. V7DeleteSysOp 
  706.  
  707.  
  708. ΓòÉΓòÉΓòÉ 5.4. V7DeleteSysOp ΓòÉΓòÉΓòÉ
  709.  
  710. Function Syntax 
  711. Parameters 
  712. Return Values 
  713. Notes 
  714. Examples 
  715. Related 
  716.  
  717.  
  718. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  719.  
  720. /************************************************************
  721.  * This function deletes a sysop entry from the sysop
  722.  * index.
  723.  ************************************************************
  724.  */
  725.  
  726. #include <os2.h>
  727. #include "v7nl.h"
  728.  
  729. V7RC   V7rc ;            /* return code from the DLL */
  730. PV7RCB  pV7rcb ;           /* DLL IO request block */
  731. V7NODE  V7node ;           /* V7 nodelist record */
  732.  
  733. V7rc = V7DeleteSysOp(pV7rcb) ;
  734.  
  735.  
  736. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  737.  
  738. V7RCB: with the following fields initialized: 
  739.  
  740. pszIndexName - Pointer to the name of the nodelist node index. 
  741.  
  742. pszDataName - Pointer to the name of the nodelist .DAT file. 
  743.  
  744. pszV7Node - Pointer to an initialized nodelist record. 
  745.  
  746. V7NODE with, at a minimum, the following fields initialized.: 
  747.  
  748. Sysopname- SysOp name for the entry to be deleted. 
  749.  
  750. ulOffset - Offset to the nodes entry in the DAT file. 
  751.  
  752.  
  753. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  754.  
  755. V7NL_SUCCESS - Request was a success 
  756. V7NL_SYSOPINDEX_OPENFAILED - Open of the node index failed. 
  757. V7NL_SYSOPDELETE_FAILED - Deletion of the entry in the node index failed 
  758. failed. 
  759.  
  760.  
  761. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  762.  
  763. The SysopName and the ulOffset of the V7NODE must match with the SysOp index 
  764. entry for an index to be deleted from the SysOp index. 
  765.  
  766. The deleted SysOp's information in the DAT file is NOT not deleted. 
  767.  
  768.  
  769. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  770.  
  771. In this example, a nodes entry is first read in order to get it's offset into 
  772. the DAT file.  If the read is successful, the SysOp entry in the SysOp index is 
  773. deleted. 
  774.  
  775. #include <os2.h>
  776. #include <string.h>
  777. #include "v7nl.h"
  778.  
  779. main()
  780. {
  781. PSZ pszNodeIndex  = "C:\\Nodelist\\Nodex.ndx" ;
  782. PSZ pszSysOpIndex = "C:\\Nodelist\\Sysop.ndx" ;
  783. PSZ pszNodeDat   = "C:\\Nodelist\\Nodex.dat" ;
  784.  
  785. V7RCB  Vrcb ;         /* request block */
  786. V7NODE V7node ;        /* V7 format node record */
  787. V7RC  V7rc ;         /* return code */
  788.  
  789.   V7Initialize() ;
  790.  
  791.   memset(&V7rcb, '\0', sizeof(V7RCB)) ;
  792.   memset(&V7node, '\0', sizeof(V7NODE)) ;
  793.  
  794.   V7rcb.pszIndexName  = pszNodeIndex ;
  795.   V7rcb.pszDatName   = pszNodeDat ;
  796.   V7rcb.pV7Node    = &V7node ;
  797.   V7rcb.wLen      = 6 ;
  798.  
  799.   V7node.ZoneNumber  = 1 ;
  800.   V7node.NetNumber   = 106 ;
  801.   V7node.NodeNumber  = 202 ;
  802.  
  803.  
  804.   /* read the nodes record to gets the offset
  805.     of it's entry in the DAT file */
  806.  
  807.   V7rc = V7FindNode(&V7rcb) ;
  808.  
  809.   /* if the record was found, then
  810.     delete it's SysOp index entry */
  811.  
  812.   if ( V7rc == V7NL_SUCCESS ) {
  813.     V7rc = V7DeleteSysop(&V7rcb) ;
  814.     if ( V7rc != V7NL_SUCCESS ) {
  815.        <error processing>
  816.     }
  817.   } else {
  818.     <error processing>
  819.   }
  820.  
  821. }
  822.  
  823.  
  824. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  825.  
  826. V7FindNode 
  827. V7AddNode 
  828. V7UpdateNode 
  829. V7DeleteNode 
  830.  
  831.  
  832. ΓòÉΓòÉΓòÉ 5.5. V7FindClose ΓòÉΓòÉΓòÉ
  833.  
  834. Function Syntax 
  835. Parameters 
  836. Return Values 
  837. Notes 
  838. Examples 
  839. Related 
  840.  
  841.  
  842. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  843.  
  844. /************************************************************
  845.  * This function performs the close processing at the
  846.  * end of findfirst/findnext processing
  847.  *
  848.  ************************************************************
  849.  */
  850.  
  851. #include <os2.h>
  852. #include "v7nl.h"
  853.  
  854. V7RC   V7rc ;            /* return code from the DLL */
  855. PV7RCB  pV7rcb ;           /* DLL IO request block */
  856.  
  857. VOID V7FindClose(pV7rcb) ;
  858.  
  859.  
  860. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  861.  
  862. V7RCB that was initialized prior to calling V7FindFirstNode or V7FindFirstSysOp 
  863.  
  864.  
  865. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  866.  
  867. This function has no return values. 
  868.  
  869.  
  870. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  871.  
  872. The V7RCB must have been initialized, and a call to V7FindFirstNode or 
  873. V7FindFirstSysOp prior to calling this function. 
  874.  
  875.  
  876. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  877.  
  878. #include <os2.h>
  879. #include "v7nl.h"
  880.  
  881. main()
  882. {
  883. V7RCB  Vrcb ;         /* request block */
  884. V7NODE V7node ;        /* V7 format node record */
  885. V7RC  V7rc ;         /* return code */
  886.  
  887.     V7Initialize() ;
  888.  
  889.     < initialize V7RCB >
  890.     < findfirst/findnext processing>
  891.  
  892.     V7FindClose(&V7rcb) ;
  893.  
  894. }
  895.  
  896.  
  897. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  898.  
  899. V7FindFirstNode 
  900. V7FindFirstSysOp 
  901. V7FindNext 
  902.  
  903.  
  904. ΓòÉΓòÉΓòÉ 5.6. V7FindFirstNode ΓòÉΓòÉΓòÉ
  905.  
  906. Function Syntax 
  907. Parameters 
  908. Return Values 
  909. Notes 
  910. Examples 
  911. Related 
  912.  
  913.  
  914. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  915.  
  916. /************************************************************
  917.  * This function reads the first matching node.  It sets up
  918.  * for subsequent find next calls to retrieve all nodes matching
  919.  * the specified key.
  920.  ************************************************************
  921.  */
  922.  
  923. #include <os2.h>
  924. #include "v7nl.h"
  925.  
  926. V7RC   V7rc ;            /* return code from the DLL */
  927. PV7RCB  pV7rcb ;           /* DLL IO request block */
  928. V7NODE  V7node ;           /* V7 nodelist record */
  929.  
  930. V7rc = V7FindFirstNode(pV7rcb) ;
  931.  
  932.  
  933. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  934.  
  935. V7RCB: with the following fields initialized: 
  936.  
  937. pszIndexName - Pointer to the name of the nodelist node index. 
  938.  
  939. pszDataName - Pointer to the name of the nodelist .DAT file. 
  940.  
  941. pszV7Node - Pointer to an initialized nodelist record. 
  942.  
  943. wLen - Length of the search key: 
  944.  
  945.    o 2 - To search for all nodes matching ZoneNumber 
  946.    o 4 - To search for all nodes matching ZoneNumber + NetNumber 
  947.    o 6 - To search for all nodes matching ZoneNumber + NetNumber + NodeNumber 
  948.  
  949. V7NODE with the Zone, Net, and/or Node fields filled in as appropriate for the 
  950. type of search desired. 
  951.  
  952.  
  953. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  954.  
  955. V7NL_SUCCESS - Request was a success 
  956. V7NL_NODEINDEX_OPENFAILED - Open of the node index failed. 
  957. V7NL_NODEDAT_OPENFAILED - Open of the DAT file failed. 
  958. V7NL_NODENUMBER_NOTFOUND - Requested node number was not found. 
  959. V7Nl_NODEDAT_READERROR - IO error reading the DAT file. 
  960. V7NL_NODEDAT_SEEKERROR - Seek failed on DAT file. 
  961.  
  962.  
  963. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  964.  
  965. This function is the first function to be called when performing 
  966. findfirst/findnext processing for a key of a partial node number. By creating a 
  967. partial key of a Zone + Net, you can read all of the nodes in a particular net. 
  968.  
  969.  
  970. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  971.  
  972. This example shows the first step in findfirst/findnext processing using a 
  973. partial node number as a key. 
  974.  
  975. #include <os2.h>
  976. #include "v7nl.h"
  977.  
  978. main()
  979. {
  980. PSZ pszNodeIndex  = "C:\\Nodelist\\Nodex.ndx" ;
  981. PSZ pszNodeDat   = "C:\\Nodelist\\Nodex.dat" ;
  982.  
  983. V7RCB  Vrcb ;         /* request block */
  984. V7NODE V7node ;        /* V7 format node record */
  985. V7RC  V7rc ;         /* return code */
  986.  
  987.   V7Initialize() ;
  988.  
  989.   memset(&V7rcb, '\0', sizeof(V7RCB)) ;
  990.   memset(&V7node, '\0', sizeof(V7NODE)) ;
  991.  
  992.   V7rcb.pszIndexName  = pszNodeIndex ;
  993.   V7rcb.pszDatName   = pszNodeDat ;
  994.   V7rcb.pV7Node    = &V7node ;
  995.   V7rcb.wLen      = 4 ;
  996.  
  997.   V7node.ZoneNumber  = 1 ;
  998.   V7node.NetNumber   = 106 ;
  999.  
  1000.   /***********************************************
  1001.    * read the first node in zone 1 net 106
  1002.    ***********************************************
  1003.    */
  1004.   V7rc = V7FindFirstNode(&V7rcb) ;
  1005.  
  1006. }
  1007.  
  1008.  
  1009. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  1010.  
  1011. V7FindFirstSysOp 
  1012. V7FindNext 
  1013. V7FindClose 
  1014.  
  1015.  
  1016. ΓòÉΓòÉΓòÉ 5.7. V7FindFirstSysOp ΓòÉΓòÉΓòÉ
  1017.  
  1018. Function Syntax 
  1019. Parameters 
  1020. Return Values 
  1021. Notes 
  1022. Examples 
  1023. Related 
  1024.  
  1025.  
  1026. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  1027.  
  1028. /************************************************************
  1029.  * This function finds the first SysOp entry in the SysOP
  1030.  * index that matches the full or partial name in
  1031.  * SysopName field of the V7NODE record.
  1032.  ************************************************************
  1033.  */
  1034.  
  1035. #include <os2.h>
  1036. #include "v7nl.h"
  1037.  
  1038. V7RC   V7rc ;            /* return code from the DLL */
  1039. PV7RCB  pV7rcb ;           /* DLL IO request block */
  1040. V7NODE  V7node ;           /* V7 nodelist record */
  1041.  
  1042. V7rc = V7FindFirstSysOp(pV7rcb) ;
  1043.  
  1044.  
  1045. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  1046.  
  1047. V7RCB with the following fields initialized: 
  1048.  
  1049. pszSysOpIndex - Pointer to the name of the nodelist SysOp name index. 
  1050.  
  1051. pszDataName - Pointer to the name of the nodelist .DAT file. 
  1052.  
  1053. pszV7Node - Pointer to an initialized nodelist record. 
  1054.  
  1055. V7NODE with the SysopName primed with a full or partial SysOp name. 
  1056.  
  1057.  
  1058. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  1059.  
  1060. V7NL_SUCCESS - Request was a success 
  1061. V7NL_SYSOPINDEX_OPENFAILED - Open of the SysOp index failed. 
  1062. V7NL_NODEDAT_OPENFAILED - Open of the DAT file failed. 
  1063. V7NL_SYSOPNAME_NOTFOUND - Requested SysOp name was not found. 
  1064. V7Nl_NODEDAT_READERROR - IO error reading the DAT file. 
  1065. V7NL_NODEDAT_SEEKERROR - Seek failed on DAT file. 
  1066.  
  1067.  
  1068. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  1069.  
  1070. This function is the first function to be called when performing 
  1071. findfirst/findnext processing for a key of a full or partial SysOp name. 
  1072.  
  1073.  
  1074. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  1075.  
  1076. This example finds the first entry in the SysOp index whose last name is Smith 
  1077. and whose first name begins with the letter J. 
  1078.  
  1079. #include <os2.h>
  1080. #include "v7nl.h"
  1081.  
  1082. main()
  1083. {
  1084. PSZ pszSysOpIndex = "C:\\Nodelist\\Sysop.ndx" ;
  1085. PSZ pszNodeDat   = "C:\\Nodelist\\Nodex.dat" ;
  1086.  
  1087. V7RCB  Vrcb ;         /* request block */
  1088. V7NODE V7node ;        /* V7 format node record */
  1089. V7RC  V7rc ;         /* return code */
  1090.  
  1091.   V7Initialize() ;
  1092.  
  1093.   memset(&V7rcb, '\0', sizeof(V7RCB)) ;
  1094.   memset(&V7node, '\0', sizeof(V7NODE)) ;
  1095.  
  1096.   V7rcb.pszSysOpIndex = pszSysOpIndex ;
  1097.   V7rcb.pszDatName   = pszNodeDat ;
  1098.   V7rcb.pV7Node    = &V7node ;
  1099.  
  1100.  
  1101.   strcpy(V7node.SysopName, "J Smith") ;
  1102.  
  1103.   /***********************************************
  1104.    * read the first matching SysOp
  1105.    ***********************************************
  1106.    */
  1107.   V7rc = V7FindFirstSysOp(&V7rcb) ;
  1108.  
  1109. }
  1110.  
  1111.  
  1112. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  1113.  
  1114. V7FindFirstNode 
  1115. V7FindNext 
  1116. V7FindClose 
  1117.  
  1118.  
  1119. ΓòÉΓòÉΓòÉ 5.8. V7FindNext ΓòÉΓòÉΓòÉ
  1120.  
  1121. Function Syntax 
  1122. Parameters 
  1123. Return Values 
  1124. Notes 
  1125. Examples 
  1126. Related 
  1127.  
  1128.  
  1129. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  1130.  
  1131. /************************************************************
  1132.  * This functions finds the next node that matches the
  1133.  * search argument that was passed in the initial findfirst
  1134.  * function call.
  1135.  ************************************************************
  1136.  */
  1137.  
  1138. #include <os2.h>
  1139. #include "v7nl.h"
  1140.  
  1141. V7RC   V7rc ;            /* return code from the DLL */
  1142. PV7RCB  pV7rcb ;           /* DLL IO request block */
  1143. V7NODE  V7node ;           /* V7 nodelist record */
  1144.  
  1145. V7rc = V7FindNext(pV7rcb) ;
  1146.  
  1147.  
  1148. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  1149.  
  1150. A V7RCB that was initialized prior to calling either V7FindFirstNode or 
  1151. V7FindFirstSysOp 
  1152.  
  1153.  
  1154. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  1155.  
  1156. V7NL_SUCCESS - Request was a success 
  1157. V7Nl_NODEDAT_READERROR - IO error reading the DAT file. 
  1158. V7NL_NODEDAT_SEEKERROR - Seek failed on DAT file. 
  1159. V7NL_FINDNEXT_END - No more entries found matching the argument passed in 
  1160. either V7FindFirstNode or V7FindFirstSysOp. 
  1161.  
  1162.  
  1163. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  1164.  
  1165. This function is a continuation of one of the findfirst functions. It continues 
  1166. reading records that match the original key until there are no more matches. 
  1167.  
  1168.  
  1169. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  1170.  
  1171. This example shows the loop required to read all of the nodes in a net. 
  1172.  
  1173. #include <os2.h>
  1174. #include "v7nl.h"
  1175.  
  1176. main()
  1177. {
  1178. PSZ pszNodeIndex  = "C:\\Nodelist\\Nodex.ndx" ;
  1179. PSZ pszNodeDat   = "C:\\Nodelist\\Nodex.dat" ;
  1180.  
  1181. V7RCB  Vrcb ;         /* request block */
  1182. V7NODE V7node ;        /* V7 format node record */
  1183. V7RC  V7rc ;         /* return code */
  1184.  
  1185.   V7Initialize() ;
  1186.  
  1187.   memset(&V7rcb, '\0', sizeof(V7RCB)) ;
  1188.   memset(&V7node, '\0', sizeof(V7NODE)) ;
  1189.  
  1190.   V7rcb.pszIndexName  = pszNodeIndex ;
  1191.   V7rcb.pszDatName   = pszNodeDat ;
  1192.   V7rcb.pV7Node    = &V7node ;
  1193.   V7rcb.wLen      = 4 ;
  1194.  
  1195.   V7node.ZoneNumber  = 1 ;
  1196.   V7node.NetNumber   = 106 ;
  1197.  
  1198.   /***********************************************
  1199.    * read the first node in zone 1 net 106
  1200.    ***********************************************
  1201.    */
  1202.   V7rc = V7FindFirstNode(&V7rcb) ;
  1203.  
  1204.   /***********************************************
  1205.    * process and read the remaining nodes
  1206.    ***********************************************
  1207.    */
  1208.   while ( V7rc == V7NL_SUCCESS ) {
  1209.      < node record processing >
  1210.     V7rc = V7FindNext(&V7rcb) ;
  1211.   }
  1212.  
  1213. }
  1214.  
  1215.  
  1216. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  1217.  
  1218. V7FindFirstNode 
  1219. V7FindFirstSysOp 
  1220. V7FindClose 
  1221.  
  1222.  
  1223. ΓòÉΓòÉΓòÉ 5.9. V7FindNode ΓòÉΓòÉΓòÉ
  1224.  
  1225. Function Syntax 
  1226. Parameters 
  1227. Return Values 
  1228. Notes 
  1229. Examples 
  1230. Related 
  1231.  
  1232.  
  1233. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  1234.  
  1235. /************************************************************
  1236.  * This function reads the record for a specific.  The
  1237.  * node index is used by this function.
  1238.  ************************************************************
  1239.  */
  1240.  
  1241. #include <os2.h>
  1242. #include "v7nl.h"
  1243.  
  1244. V7RC   V7rc ;            /* return code from the DLL */
  1245. PV7RCB  pV7rcb ;           /* DLL IO request block */
  1246. V7NODE  V7node ;           /* V7 nodelist record */
  1247.  
  1248. V7rc = V7FindNode(pV7rcb) ;
  1249.  
  1250.  
  1251. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  1252.  
  1253. V7RCB: with the following fields initialized: 
  1254.  
  1255. pszIndexName - Pointer to the name of the nodelist node index. 
  1256.  
  1257. pszDataName - Pointer to the name of the nodelist .DAT file. 
  1258.  
  1259. pszV7Node - Pointer to an initialized nodelist record. 
  1260.  
  1261. V7NODE with, at a minimum, the following fields initialized.: 
  1262.  
  1263. ZoneNumberZone number of the node. 
  1264.  
  1265. NetNumberNet number of the node. 
  1266.  
  1267. NodeNumberNode number of the node. 
  1268.  
  1269. If the node is a point, the HubNode must contain the point number and B_point 
  1270. flag in the NodeFlags field must be turned on. 
  1271.  
  1272.  
  1273. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  1274.  
  1275. V7NL_SUCCESS - Request was a success 
  1276. V7NL_NODEINDEX_OPENFAILED - Open of the node index failed. 
  1277. V7NL_SYSOPINDEX_OPENFAILED - Open of the SysOp index failed. 
  1278. V7NL_NODEDAT_OPENFAILED - Open of the DAT file failed. 
  1279. V7NL_NODENUMBER_NOTFOUND - Requested node number was not found. 
  1280. V7Nl_NODEDAT_READERROR - IO error reading the DAT file. 
  1281. V7NL_NODEDAT_SEEKERROR - Seek failed on DAT file. 
  1282.  
  1283.  
  1284. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  1285.  
  1286. Nothing special to say about this function.  It just reads a node's nodelist 
  1287. entry. 
  1288.  
  1289.  
  1290. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  1291.  
  1292. This shows how to read a nodes nodelist entry. 
  1293.  
  1294. #include <os2.h>
  1295. #include "v7nl.h"
  1296.  
  1297. main()
  1298. {
  1299. PSZ pszNodeIndex  = "C:\\Nodelist\\Nodex.ndx" ;
  1300. PSZ pszNodeDat   = "C:\\Nodelist\\Nodex.dat" ;
  1301.  
  1302. V7RCB  Vrcb ;         /* request block */
  1303. V7NODE V7node ;        /* V7 format node record */
  1304. V7RC  V7rc ;         /* return code */
  1305.  
  1306.   V7Initialize() ;
  1307.  
  1308.   memset(&V7rcb, '\0', sizeof(V7RCB)) ;
  1309.   memset(&V7node, '\0', sizeof(V7NODE)) ;
  1310.  
  1311.   V7rcb.pszIndexName  = pszNodeIndex ;
  1312.   V7rcb.pszSysOpIndex = pszSysOpIndex ;
  1313.   V7rcb.pszDatName   = pszNodeDat ;
  1314.   V7rcb.pV7Node    = &V7node ;
  1315.  
  1316.   V7node.ZoneNumber  = 1 ;
  1317.   V7node.NetNumber   = 106 ;
  1318.   V7node.NodeNumber  = 202 ;
  1319.   V7node.HubNode    = 1 ;
  1320.   V7node.NodeFlags   != B_point ;
  1321.         .
  1322.   /***********************************************
  1323.    * read the node list entry for 1:106/202.1
  1324.    ***********************************************
  1325.    */
  1326.   V7rc = V7FindNode(&V7rcb) ;
  1327.  
  1328.   if ( V7rc != V7NL_SUCCESS ) {
  1329.     <error processing>
  1330.   }
  1331.  
  1332. }
  1333.  
  1334.  
  1335. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  1336.  
  1337. Ain't none. 
  1338.  
  1339.  
  1340. ΓòÉΓòÉΓòÉ 5.10. V7Finish ΓòÉΓòÉΓòÉ
  1341.  
  1342. Function Syntax 
  1343. Parameters 
  1344. Return Values 
  1345. Notes 
  1346. Examples 
  1347. Related 
  1348.  
  1349.  
  1350. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  1351.  
  1352. /************************************************************
  1353.  * This cleans up and free memory obtain by V7Initialize
  1354.  ************************************************************
  1355.  */
  1356.  
  1357. #include <os2.h>
  1358. #include "v7nl.h"
  1359.  
  1360.  
  1361. VOID V7Finish(VOID) ;
  1362.  
  1363.  
  1364. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  1365.  
  1366. This one's easy.  There are no parameters. 
  1367.  
  1368.  
  1369. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  1370.  
  1371. There are no return values. 
  1372.  
  1373.  
  1374. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  1375.  
  1376. This function is called prior to terminating your program. 
  1377.  
  1378.  
  1379. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  1380.  
  1381. #include <os2.h>
  1382. #include "v7nl.h"
  1383.  
  1384. main()
  1385. {
  1386.     V7Initialize() ;
  1387.        .
  1388.        .
  1389.        .
  1390.        .
  1391.     V7Finish() ;
  1392. }
  1393.  
  1394.  
  1395. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  1396.  
  1397. V7Initialize 
  1398.  
  1399.  
  1400. ΓòÉΓòÉΓòÉ 5.11. V7Initialize ΓòÉΓòÉΓòÉ
  1401.  
  1402. Function Syntax 
  1403. Parameters 
  1404. Return Values 
  1405. Notes 
  1406. Examples 
  1407. Related 
  1408.  
  1409.  
  1410. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  1411.  
  1412. /************************************************************
  1413.  * This function initializes the DLL for node list processing
  1414.  ************************************************************
  1415.  */
  1416.  
  1417. #include <os2.h>
  1418. #include "v7nl.h"
  1419.  
  1420.  
  1421. BOOL V7Initialize(VOID) ;
  1422.  
  1423.  
  1424. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  1425.  
  1426. This function has no parameters. 
  1427.  
  1428.  
  1429. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  1430.  
  1431. TRUE - Initialization was successful 
  1432.  
  1433. FALSE - Initialization failed. 
  1434.  
  1435.  
  1436. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  1437.  
  1438. This function MUST must be called prior to calling any of the functions that 
  1439. access the nodelist. 
  1440.  
  1441.  
  1442. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  1443.  
  1444. #include <os2.h>
  1445. #include "v7nl.h"
  1446.  
  1447. main()
  1448. {
  1449.  
  1450.     V7Initialize() ;
  1451.  
  1452. }
  1453.  
  1454.  
  1455. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  1456.  
  1457. V7Finish 
  1458.  
  1459.  
  1460. ΓòÉΓòÉΓòÉ 5.12. V7OpenIndex ΓòÉΓòÉΓòÉ
  1461.  
  1462. Function Syntax 
  1463. Parameters 
  1464. Return Values 
  1465. Notes 
  1466. Examples 
  1467. Related 
  1468.  
  1469.  
  1470. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  1471.  
  1472. /************************************************************
  1473.  * This function opens the nodelist node index form
  1474.  * multiple random accesses
  1475.  ************************************************************
  1476.  */
  1477.  
  1478. #include <os2.h>
  1479. #include "v7nl.h"
  1480.  
  1481. V7RC   V7rc ;            /* return code from the DLL */
  1482. PV7RCB  pV7rcb ;           /* DLL IO request block */
  1483. V7NODE  V7node ;           /* V7 nodelist record */
  1484.  
  1485. V7rc = V7OpenIndex(pV7rcb) ;
  1486.  
  1487.  
  1488. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  1489.  
  1490. V7RCB: with the following fields initialized: 
  1491.  
  1492. pszIndexName - Pointer to the name of the nodelist node index. 
  1493.  
  1494. pszDataName - Pointer to the name of the nodelist .DAT file. 
  1495.  
  1496.  
  1497. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  1498.  
  1499. V7NL_SUCCESS - Request was a success 
  1500. V7NL_NODEINDEX_OPENFAILED - Open of the node index failed. 
  1501. V7NL_NODEDAT_OPENFAILED - Open of the DAT file failed. 
  1502.  
  1503.  
  1504. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  1505.  
  1506. This function must be called prior to callingV7ReadIndex. 
  1507.  
  1508.  
  1509. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  1510.  
  1511. Open the nodelist node index. 
  1512.  
  1513. #include <os2.h>
  1514. #include "v7nl.h"
  1515.  
  1516. main()
  1517. {
  1518. PSZ pszNodeIndex  = "C:\\Nodelist\\Nodex.ndx" ;
  1519. PSZ pszNodeDat   = "C:\\Nodelist\\Nodex.dat" ;
  1520.  
  1521. V7RCB  Vrcb ;         /* request block */
  1522. V7NODE V7node ;        /* V7 format node record */
  1523. V7RC  V7rc ;         /* return code */
  1524.  
  1525.   V7Initialize() ;
  1526.  
  1527.   memset(&V7rcb, '\0', sizeof(V7RCB)) ;
  1528.   memset(&V7node, '\0', sizeof(V7NODE)) ;
  1529.  
  1530.   V7rcb.pszIndexName  = pszNodeIndex ;
  1531.   V7rcb.pszDatName   = pszNodeDat ;
  1532.  
  1533.   V7rc = V7OpenIndex(&V7rcb) ;
  1534.  
  1535. }
  1536.  
  1537.  
  1538. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  1539.  
  1540. V7ReadIndex 
  1541. V7CloseIndex 
  1542.  
  1543.  
  1544. ΓòÉΓòÉΓòÉ 5.13. V7ReadIndex ΓòÉΓòÉΓòÉ
  1545.  
  1546. Function Syntax 
  1547. Parameters 
  1548. Return Values 
  1549. Notes 
  1550. Examples 
  1551. Related 
  1552.  
  1553.  
  1554. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  1555.  
  1556. /************************************************************
  1557.  * This function performs random reads on a nodelist that
  1558.  * was opened by V7OpenIndex
  1559.  ************************************************************
  1560.  */
  1561.  
  1562. #include <os2.h>
  1563. #include "v7nl.h"
  1564.  
  1565. V7RC   V7rc ;            /* return code from the DLL */
  1566. PV7RCB  pV7rcb ;           /* DLL IO request block */
  1567. V7NODE  V7node ;           /* V7 nodelist record */
  1568.  
  1569. V7rc = V7ReadIndex(pV7rcb) ;
  1570.  
  1571.  
  1572. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  1573.  
  1574. V7RCB that was initialized with a call to V7OpenIndex  In addition field wLen 
  1575. must be initialized to the length of the search argument and pV7Node must 
  1576. contain a pointer to a V7NODE 
  1577.  
  1578. V7NODE with the zone, net, node fields initialized for the node whose record 
  1579. you want to read. 
  1580.  
  1581. If the node is a point, the HubNode must contain the point number and B_point 
  1582. flag in the NodeFlags field must be turned on. 
  1583.  
  1584.  
  1585. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  1586.  
  1587. V7NL_SUCCESS - Request was a success 
  1588. V7NL_NODENUMBER_NOTFOUND - Requested node number was not found. 
  1589. V7Nl_NODEDAT_READERROR - IO error reading the DAT file. 
  1590. V7NL_NODEDAT_SEEKERROR - Seek failed on DAT file. 
  1591.  
  1592.  
  1593. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  1594.  
  1595. This function is for random reading through the nodelist.  The main difference 
  1596. between this function and V7FindNode, is V7FindNode opens the node list, reads 
  1597. the record, then closes the nodelist.  Using V7ReadIndex the index is opened by 
  1598. V7OpenIndex and remains open until V7CloseIndex is called. 
  1599.  
  1600.  
  1601. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  1602.  
  1603. #include <os2.h>
  1604. #include "v7nl.h"
  1605.  
  1606. main()
  1607. {
  1608. PSZ pszNodeIndex  = "C:\\Nodelist\\Nodex.ndx" ;
  1609. PSZ pszSysOpIndex = "C:\\Nodelist\\Sysop.ndx" ;
  1610. PSZ pszNodeDat   = "C:\\Nodelist\\Nodex.dat" ;
  1611.  
  1612. V7RCB  Vrcb ;         /* request block */
  1613. V7NODE V7node ;        /* V7 format node record */
  1614. V7RC  V7rc ;         /* return code */
  1615.  
  1616.   V7Initialize() ;
  1617.  
  1618.   memset(&V7rcb, '\0', sizeof(V7RCB)) ;
  1619.   memset(&V7node, '\0', sizeof(V7NODE)) ;
  1620.  
  1621.   V7rcb.pszIndexName  = pszNodeIndex ;
  1622.   V7rcb.pszSysOpIndex = pszSysOpIndex ;
  1623.   V7rcb.pszDatName   = pszNodeDat ;
  1624.   V7rcb.pV7Node    = &V7node ;
  1625.   V7rcb.wLen      = 6 ;
  1626.  
  1627.   V7node.ZoneNumber  = 1 ;
  1628.   V7node.NetNumber   = 106 ;
  1629.   V7node.NodeNumber  = 202 ;
  1630.  
  1631.   V7rc = V7OpenIndex(&V7rcb) ;
  1632.  
  1633.   if ( V7rc == V7NL_SUCCESS ) {
  1634.     V7rc = V7ReadIndex&V7rcb) ;
  1635.   }
  1636.  
  1637.   V7CloseIndex(&V7rcb) ;
  1638. }
  1639.  
  1640.  
  1641. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  1642.  
  1643. V7FindNode 
  1644.  
  1645.  
  1646. ΓòÉΓòÉΓòÉ 5.14. V7UpdateNode ΓòÉΓòÉΓòÉ
  1647.  
  1648. Function Syntax 
  1649. Parameters 
  1650. Return Values 
  1651. Notes 
  1652. Examples 
  1653. Related 
  1654.  
  1655.  
  1656. ΓòÉΓòÉΓòÉ <hidden> Function Syntax ΓòÉΓòÉΓòÉ
  1657.  
  1658. /************************************************************
  1659.  * This updates a nodes entry in the node list.
  1660.  ************************************************************
  1661.  */
  1662.  
  1663. #include <os2.h>
  1664. #include "v7nl.h"
  1665.  
  1666. V7RC   V7rc ;            /* return code from the DLL */
  1667. PV7RCB  pV7rcb ;           /* DLL IO request block */
  1668. V7NODE  V7node ;           /* V7 nodelist record */
  1669.  
  1670. V7rc = V7UpdateNode(pV7rcb) ;
  1671.  
  1672.  
  1673. ΓòÉΓòÉΓòÉ <hidden> Parameters ΓòÉΓòÉΓòÉ
  1674.  
  1675. V7RCB: with the following fields initialized: 
  1676.  
  1677. pszIndexName - Pointer to the name of the nodelist node index. 
  1678.  
  1679. pszSysOpIndex - Pointer to the name of the nodelist sysop index. 
  1680.  
  1681. pszDataName - Pointer to the name of the nodelist .DAT file. 
  1682.  
  1683. pszV7Node - Pointer to a previously read node list record. 
  1684.  
  1685.  
  1686. ΓòÉΓòÉΓòÉ <hidden> Return Values ΓòÉΓòÉΓòÉ
  1687.  
  1688. V7NL_SUCCESS - Request was a success 
  1689. V7NL_NODEINDEX_OPENFAILED - Open of the node index failed. 
  1690. V7NL_SYSOPINDEX_OPENFAILED - Open of the SysOp index failed. 
  1691. V7NL_NODEDAT_OPENFAILED - Open of the DAT file failed. 
  1692. V7NL_NODEDAT_WRITEERROR - IO Error writing to the DAT file. 
  1693. V7NL_NODEINDEX_UPDATEERR- Error writing to the node index. 
  1694. V7NL_SYSOPINDEX_UPDATEERR - Error writing to the SysOp index. 
  1695.  
  1696.  
  1697. ΓòÉΓòÉΓòÉ <hidden> Notes ΓòÉΓòÉΓòÉ
  1698.  
  1699. The record to be deleted, must have been previously read, or a V7NODE record 
  1700. initialized with the complete key information, including the ulOffset field 
  1701. containing the offset to the nodes current entry in the DAT file.  If there is 
  1702. a matching entry in the SysOp name index, it too is updated. 
  1703.  
  1704. The old information is not deleted or overlayed in the DAT file with the new 
  1705. information.  Instead, the nodes new information is appended to the end of the 
  1706. DAT file, and the respective index entries updated with the new offset. 
  1707.  
  1708.  
  1709. ΓòÉΓòÉΓòÉ <hidden> Example ΓòÉΓòÉΓòÉ
  1710.  
  1711. This example reads a nodes entry, changes the phone number, then write the 
  1712. nodes data to the end of the DAT file. Both the node index and the SysOp index 
  1713. entries with the new offset into the DAT file. 
  1714.  
  1715. #include <os2.h>
  1716. #include <string.h>
  1717. #include "v7nl.h"
  1718.  
  1719. main()
  1720. {
  1721. PSZ pszNodeIndex  = "C:\\Nodelist\\Nodex.ndx" ;
  1722. PSZ pszNodeDat   = "C:\\Nodelist\\Nodex.dat" ;
  1723.  
  1724. V7RCB  Vrcb ;         /* request block */
  1725. V7NODE V7node ;        /* V7 format node record */
  1726. V7RC  V7rc ;         /* return code */
  1727.  
  1728.   V7Initialize() ;
  1729.  
  1730.   memset(&V7rcb, '\0', sizeof(V7RCB)) ;
  1731.   memset(&V7node, '\0', sizeof(V7NODE)) ;
  1732.  
  1733.   V7rcb.pszIndexName  = pszNodeIndex ;
  1734.   V7rcb.pszSysOpIndex = pszSysOpIndex ;
  1735.   V7rcb.pszDatName   = pszNodeDat ;
  1736.   V7rcb.pV7Node    = &V7node ;
  1737.  
  1738.   V7node.ZoneNumber  = 1 ;
  1739.   V7node.NetNumber   = 106 ;
  1740.   V7node.NodeNumber  = 202 ;
  1741.   V7node.HubNode    = 1 ;
  1742.   V7node.NodeFlags   != B_point ;
  1743.         .
  1744.   /***********************************************
  1745.    * read the node list entry for 1:106/202.1
  1746.    ***********************************************
  1747.    */
  1748.   V7rc = V7FindNode(&V7rcb) ;
  1749.  
  1750.   if ( V7rc != V7NL_SUCCESS ) {
  1751.     <error processing>
  1752.   } else {
  1753.     strcpy(V7node.PhoneNumber, "555-1234") ;
  1754.     V7UpdateNode(&V7rcb) ;
  1755.   }
  1756.  
  1757. }
  1758.  
  1759.  
  1760. ΓòÉΓòÉΓòÉ <hidden> Related Functions ΓòÉΓòÉΓòÉ
  1761.  
  1762. V7FindNode 
  1763. V7AddNode 
  1764. V7DeleteNode 
  1765.