home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / mag&info / msjv7_4.zip / NETBIOS2.ARJ / NETIO.H < prev    next >
C/C++ Source or Header  |  1992-07-01  |  3KB  |  124 lines

  1. /****************************************************************************
  2.     FILE: NETIO.H
  3.  
  4.     PURPOSE: contains function declarations, #defines,
  5.              and constants for netio.c and any program
  6.              using functions exported by netio.c
  7.  
  8.     History:
  9.                 January, 1992       Alok Sinha      Created
  10. ****************************************************************************/
  11.  
  12.  
  13. #include <direct.h>
  14. #include <dos.h>
  15. #include <stdlib.h>
  16. #include "alloc.h"
  17.  
  18. // This error can be returned by any netio api calls. It indicates
  19. // that wnetbios.dll NCB table is full of outstanding NCBs.
  20.  
  21. #define WNETBIOS_ERROR  (80)
  22.  
  23. BYTE AddName   ( LPSTR lpLocalName, BYTE * pbNameNum);
  24. BYTE DeleteName( LPSTR lpLocalName, BYTE bNameNum );
  25. BYTE CreateASession ( LPSTR lpRemoteName,
  26.                       LPSTR lpLocalName,
  27.                       BYTE * pbLsn);
  28.  
  29. BYTE Call (      HWND    hWnd,
  30.           LPSTR lpLocalName,
  31.           LPSTR lpRemoteName,
  32.           BYTE    bRto,
  33.           BYTE    bSto,
  34.           BYTE    *pbLsn
  35.       );
  36.  
  37. BYTE Listen ( HWND  hWnd,
  38.           LPSTR lpLocalName,
  39.           LPSTR lpRemoteName,
  40.           BYTE    bRto,
  41.           BYTE    bSto,
  42.           PNCB    *pncbListenPosted
  43.         );
  44.  
  45.  
  46. BYTE Send (      HWND        hWnd,
  47.           LPSTR     lpData,
  48.           WORD        wDataLen,
  49.           BYTE        bLsn,
  50.           unsigned    iMessage,
  51.           SendStatus *peSendState
  52.           );
  53.  
  54. BYTE Receive (      HWND        hWnd,
  55.           LPSTR     *ppLpData,
  56.           WORD        wDataLen,
  57.           BYTE        bLsn,
  58.           BOOL        fServer
  59.          );
  60.  
  61.  
  62. BYTE Hangup( BYTE bLsn);
  63. BYTE Cancel( PNCB pncbNCBToCancel);
  64.  
  65.  
  66. char * R_getcwd( HWND hWnd, BYTE bLsn, char * pszBuffer, int maxlen);
  67.  
  68. typedef struct find_t FINDT;
  69. BYTE  R_dos_findfirst( HWND hWnd,
  70.                         BYTE bLsn,
  71.                         char * filename,
  72.                         unsigned uAttrib,
  73.                         FINDT *findFileInfo);
  74.  
  75. BYTE  R_dos_findnext( HWND hWnd,
  76.                       BYTE bLsn,
  77.                       FINDT *findFileInfo);
  78.  
  79. /* struct to contain find first information */
  80. typedef struct {
  81.     char      chFileName [ MAXFILENAME ] ;
  82.     unsigned  uAttrib;
  83. } FINDFIRST;
  84.  
  85.  
  86.  
  87. /* struct to contain find next information */
  88. typedef struct {
  89.     FINDT FileInfo;
  90. } FINDNEXT;
  91.  
  92.  
  93. /* struct to contain getcwd information */
  94. typedef struct {
  95.     char    chBuffer [ _MAX_DIR ] ;
  96.     int     imaxlen;
  97. } GETCWD;
  98.  
  99.  
  100. /* A single packet going over net */
  101. typedef struct {
  102.     BYTE  bCommand;         /* Requested Command */
  103.     char  data [1];        /* variable sized data. Format depends on
  104.                  * command being sent
  105.                  */
  106. }   PACKET;
  107.  
  108. #define PACKET_SIZE (sizeof(PACKET))
  109.  
  110. /* Commands  */
  111. #define  R_GETCWD    (01)
  112. #define  R_FINDFIRST (02)
  113. #define  R_FINDNEXT  (03)
  114.  
  115.  
  116.  
  117. /* Time out values */
  118. #define CALL_TIME_OUT     (double) (60 * 2) // 2 Minutes
  119. #define SEND_TIME_OUT     (double) (60 * 2) // 2 Minutes
  120. #define RECEIVE_TIME_OUT (double) (60 * 2) // 2 Minutes
  121.  
  122. #define SEND_NCB_STO    (BYTE) ((2 * 60)* 2)   // 2 Minutes in 1/2 sec intervals
  123. #define RECEIVE_NCB_RTO (BYTE) ((2 * 60)* 2)   // 2 Minutes in 1/2 sec intervals
  124.