home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / os232.exe / INCLUDE / NWMISC.H < prev    next >
C/C++ Source or Header  |  1995-06-21  |  8KB  |  423 lines

  1. /******************************************************************************
  2.  
  3.   $Workfile:   nwmisc.h  $
  4.   $Revision:   1.21  $
  5.   $Modtime::   21 Jun 1995 16:38:34                        $
  6.   $Copyright:
  7.  
  8.   Copyright (c) 1989-1995 Novell, Inc.  All Rights Reserved.                      
  9.  
  10.   THIS WORK IS  SUBJECT  TO  U.S.  AND  INTERNATIONAL  COPYRIGHT  LAWS  AND
  11.   TREATIES.   NO  PART  OF  THIS  WORK MAY BE  USED,  PRACTICED,  PERFORMED
  12.   COPIED, DISTRIBUTED, REVISED, MODIFIED, TRANSLATED,  ABRIDGED, CONDENSED,
  13.   EXPANDED,  COLLECTED,  COMPILED,  LINKED,  RECAST, TRANSFORMED OR ADAPTED
  14.   WITHOUT THE PRIOR WRITTEN CONSENT OF NOVELL, INC. ANY USE OR EXPLOITATION
  15.   OF THIS WORK WITHOUT AUTHORIZATION COULD SUBJECT THE PERPETRATOR TO
  16.   CRIMINAL AND CIVIL LIABILITY.$
  17.  
  18.  *****************************************************************************/
  19.  
  20. #if ! defined ( NWMISC_H )
  21. #define NWMISC_H
  22.  
  23. #if ! defined ( NWCALDEF_H )
  24. # include "nwcaldef.h"
  25. #endif
  26.  
  27. #include "npackon.h"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. #ifndef NW_SHORT_NAME_SERVER
  34. # define NW_SHORT_NAME_SERVER 0
  35. #endif
  36.  
  37. #ifndef NW_LONG_NAME_SERVER
  38. # define NW_LONG_NAME_SERVER 1
  39. #endif
  40.  
  41. #ifndef NW_ENCP_SERVER
  42. #define NW_ENCP_SERVER 1
  43. #endif
  44.  
  45. #ifndef NW_EXTENDED_NCP_SERVER
  46. #define NW_EXTENDED_NCP_SERVER 1
  47. #endif
  48.  
  49. #ifndef _NETX_COM
  50. #define _NETX_COM     0x0001
  51. #define _NETX_VLM     0x0002
  52. #define _REDIR_LOADED 0x4000
  53. #define _VLM_LOADED   0x8000
  54. #endif
  55.  
  56. #ifdef   N_PLAT_UNIX
  57. #define  NWWordSwap(x) ((nuint16) ( \
  58.                        (((nuint16)((x) & 0x00FF)) << 8) | \
  59.                        (((nuint16)((x) & 0xFF00)) >> 8) ))
  60. #define  NWLongSwap(x) ((nuint32) ( \
  61.                        (((nuint32)((x) & 0x000000FFL)) << 24) | \
  62.                        (((nuint32)((x) & 0x0000FF00L)) <<  8) | \
  63.                        (((nuint32)((x) & 0x00FF0000L)) >>  8) | \
  64.                        (((nuint32)((x) & 0xFF000000L)) >> 24) ))
  65. #endif
  66.  
  67. typedef struct
  68. {
  69.   nuint8    day;
  70.   nuint8    month;
  71.   nuint16   year;
  72. } NW_DATE;
  73.  
  74. /* hours is a nuint16  so that this structure will be the same length as a dword */
  75. typedef struct
  76. {
  77.   nuint8    seconds;
  78.   nuint8    minutes;
  79.   nuint16   hours;
  80. } NW_TIME;
  81.  
  82. typedef enum
  83. {
  84.   NW_LONG_NAME_REQUESTER,
  85.   NW_SHORT_NAME_REQUESTER,
  86.   NW_ERROR_ON_REQUESTER_TYPE
  87. } NW_REQUESTER_TYPE;
  88.  
  89. #ifndef NW_FRAGMENT_DEFINED
  90. #define NW_FRAGMENT_DEFINED
  91. typedef struct
  92. {
  93.   nptr fragAddress;
  94. #if defined(N_PLAT_NLM) || defined(WIN32)
  95.   nuint32 fragSize;
  96. #else
  97.   nuint16  fragSize;
  98. #endif
  99. } NW_FRAGMENT;
  100. #endif
  101.  
  102. typedef struct
  103. {
  104.   nuint16   taskNumber;
  105.   nuint8    taskState;
  106. } CONN_TASK;
  107.  
  108. typedef struct
  109. {
  110.   nuint16   serverVersion;    /* use NW_ constants from nwserver.h */
  111.   nuint8    lockState;
  112.   nuint16   waitingTaskNumber;
  113.   nuint32   recordStart;
  114.   nuint32   recordEnd;
  115.   nuint8    volNumber;
  116.   nuint32   dirEntry;         /* this field is only valid in 3.11 */
  117.   nuint8    nameSpace;        /* this field is only valid in 3.11 */
  118.   nuint16   dirID;            /* this field is only valid in 2.x  */
  119.   nstr8     lockedName[256];
  120.   nuint8    taskCount;
  121.   CONN_TASK tasks[256];
  122. } CONN_TASK_INFO;
  123.  
  124. typedef struct
  125. {
  126.   nuint8  volNumber;
  127.   nuint32 dirEntry;
  128. } DIR_ENTRY;
  129.  
  130. void N_API NWUnpackDateTime
  131. (
  132.   nuint32         dateTime,
  133.   NW_DATE N_FAR *   sDate,
  134.   NW_TIME N_FAR *   sTime
  135. );
  136.  
  137. void N_API NWUnpackDate
  138. (
  139.   nuint16         date,
  140.   NW_DATE N_FAR *   sDate
  141. );
  142.  
  143. void N_API NWUnpackTime
  144. (
  145.   nuint16         time,
  146.   NW_TIME N_FAR *   sTime
  147. );
  148.  
  149. nuint32 N_API NWPackDateTime
  150. (
  151.    NW_DATE N_FAR *  sDate,
  152.    NW_TIME N_FAR *  sTime
  153. );
  154.  
  155. nuint16 N_API NWPackDate
  156. (
  157.    NW_DATE N_FAR *  sDate
  158. );
  159.  
  160. nuint16 N_API NWPackTime
  161. (
  162.    NW_TIME N_FAR *  sTime
  163. );
  164.  
  165. /* Avoid using the following three NWConvert{Date/Time} functions,
  166.    they just call the NWUnpack{Date/Time} functions. They are here for
  167.    compatibility reasons only. */
  168. void N_API NWConvertDateTime
  169. (
  170.    nuint32        dateTime,
  171.    NW_DATE N_FAR *  sDate,
  172.    NW_TIME N_FAR *  sTime
  173. );
  174.  
  175. void N_API NWConvertDate
  176. (
  177.    nuint16        date,
  178.    NW_DATE N_FAR *  sDate
  179. );
  180.  
  181. void N_API NWConvertTime
  182. (
  183.    nuint16        time,
  184.    NW_TIME N_FAR *  sTime
  185. );
  186.  
  187. NWCCODE N_API NWRequest
  188. (
  189.   NWCONN_HANDLE      conn,
  190.   nuint16            function,
  191.   nuint16            numReqFrags,
  192.   NW_FRAGMENT N_FAR *  reqFrags,
  193.   nuint16            numReplyFrags,
  194.   NW_FRAGMENT N_FAR *  replyFrags
  195. );
  196.  
  197. NWCCODE N_API _NWGetRequesterType
  198. (
  199.   NW_REQUESTER_TYPE N_FAR * type
  200. );
  201.  
  202. #ifndef  N_PLAT_UNIX
  203.  
  204. nuint16 N_API NWWordSwap
  205. (
  206.    nuint16  swapWord
  207. );
  208.  
  209. nuint32 N_API NWLongSwap
  210. (
  211.    nuint32  swapLong
  212. );
  213.  
  214. #endif
  215.  
  216. nint16 N_API NWInitDBCS
  217. (
  218.    void
  219. );
  220.  
  221. NWCCODE N_API NWConvertPathToDirEntry
  222. (
  223.   NWCONN_HANDLE   conn,
  224.   NWDIR_HANDLE    dirHandle,
  225.   pnstr8          path,
  226.   DIR_ENTRY N_FAR * dirEntry
  227. );
  228.  
  229. NWCCODE N_API NWGetTaskInformationByConn
  230. (
  231.   NWCONN_HANDLE   conn,
  232.   NWCONN_NUM      connNum,
  233.   CONN_TASK_INFO N_FAR * taskInfo
  234. );
  235.  
  236. NWCCODE N_API NWGetRequesterVersion
  237. (
  238.   pnuint8         majorVer,
  239.   pnuint8         minorVer,
  240.   pnuint8         revision
  241. );
  242.  
  243. NWCCODE N_API NWIsLNSSupportedOnVolume
  244. (
  245.   NWCONN_HANDLE   conn,
  246.   NWDIR_HANDLE    dirHandle,
  247.   pnstr8          path
  248. );
  249.  
  250. NWCCODE N_API _NWConvertHandle
  251. (
  252.   NWCONN_HANDLE   conn,
  253.   nuint8          accessMode,
  254.   pnuint8         NWHandle,
  255.   nuint32         fileSize,
  256.   NWFILE_HANDLE N_FAR * fileHandle
  257. );
  258.  
  259. NWCCODE N_API NWConvertFileHandle
  260. (
  261.   NWFILE_HANDLE    fileHandle,
  262.   nuint16          handleType,
  263.   pnuint8          NWHandle,
  264.   NWCONN_HANDLE N_FAR * conn
  265. );
  266.  
  267. NWCCODE N_API NWConvertFileHandleConnRef
  268. (
  269.   NWFILE_HANDLE    fileHandle,
  270.   nuint16          handleType,
  271.   pnuint8          NWHandle,
  272.   pnuint32         connRef
  273. );
  274.  
  275. void N_API _NWConvert4ByteTo6ByteHandle
  276. (
  277.   pnuint8         NW4ByteHandle,
  278.   pnuint8         NW6ByteHandle
  279. );
  280.  
  281. NWCCODE N_API NWEndOfJob
  282. (
  283.   void
  284. );
  285.  
  286. NWCCODE N_API NWCallsInit
  287. (
  288.   nptr in,
  289.   nptr out
  290. );
  291.  
  292. NWCCODE N_API NWCallsTerm
  293. (
  294.   void
  295. );
  296.  
  297. nuint16 N_API NWGetClientType
  298. (
  299.    void
  300. );
  301.  
  302. #ifndef WIN32
  303. nuint16 N_API __NWGetNWCallsState
  304. (
  305.   void
  306. );
  307.  
  308. NWCCODE N_API NWSetNetWareErrorMode
  309. (
  310.   nuint8    errorMode,
  311.   pnuint8   prevMode
  312. );
  313.  
  314. NWCCODE N_API NWSetEndOfJobStatus
  315. (
  316.   nuint8    endOfJobStatus,
  317.   pnuint8   prevStatus
  318. );
  319. #else
  320. NWCCODE N_API NWFSRequest
  321. (
  322.   nuint32   request,
  323.   nptr      inBuf,
  324.   nuint16   inLen,
  325.   nptr      outBuf,
  326.   nuint16   outLen
  327. );
  328. #endif
  329.  
  330. void N_API NWGetNWCallsVersion
  331. (
  332.   pnuint8   majorVer,
  333.   pnuint8   minorVer,
  334.   pnuint8   revLevel,
  335.   pnuint8   betaLevel
  336. );
  337.  
  338. NWCCODE N_API NWConvertHandle
  339. (
  340.   NWCONN_HANDLE   conn,
  341.   nuint8          accessMode,
  342.   nptr            NWHandle,
  343.   nuint16         handleSize,
  344.   nuint32         fileSize,
  345.   NWFILE_HANDLE N_FAR * fileHandle
  346. );
  347.  
  348. /* The stuff below this line may NOT be documented. Use with care. */
  349. #if !defined(NWOS2) && !defined(WIN32)
  350. #ifndef _REGISTERS_DEF
  351. #define _REGISTERS_DEF
  352.  
  353. typedef struct
  354. {
  355.   nuint16  si;
  356.   nuint16  ds;
  357.   nuint16  di;
  358.   nuint16  es;
  359.   nuint8 al, ah;
  360.   nuint8 bl, bh;
  361.   nuint8 cl, ch;
  362.   nuint8 dl, dh;
  363. } BYTE_REGISTERS;
  364.  
  365. typedef struct
  366. {
  367.   nuint16  si;
  368.   nuint16  ds;
  369.   nuint16  di;
  370.   nuint16  es;
  371.   nuint16  ax;
  372.   nuint16  bx;
  373.   nuint16  cx;
  374.   nuint16  dx;
  375.   nuint16  bp;
  376.   nuint16  flags;
  377. } WORD_REGISTERS;
  378.  
  379. typedef struct
  380. {
  381.   nptr requestBuffer;
  382.   nptr replyBuffer;
  383. } PTR_REGISTERS;
  384.  
  385. typedef struct
  386. {
  387.   nptr ds_si;
  388.   nptr es_di;
  389. } SEG_OFF_REGISTERS;
  390.  
  391. typedef union
  392. {
  393.   WORD_REGISTERS w;
  394.   BYTE_REGISTERS b;
  395.   PTR_REGISTERS  p;
  396.   SEG_OFF_REGISTERS s;
  397. } REGISTERS;
  398. #endif
  399.  
  400. #ifndef USE_DS
  401. #define USE_DS  1
  402. #define USE_ES  2
  403. #define USE_DOS 0x80
  404. #endif
  405.  
  406. nint N_API NWShellRequest(REGISTERS N_FAR * , nuint16);
  407. nuint16 N_API NWVLMRequest
  408. (
  409.   nuint16   callerID,
  410.   nuint16   destID,
  411.   nuint16   destFunc,
  412.   REGISTERS N_FAR * regs,
  413.   nuint16   mask
  414. );
  415. #endif
  416.  
  417. #ifdef __cplusplus
  418. }
  419. #endif
  420.  
  421. #include "npackoff.h"
  422. #endif
  423.