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

  1. /******************************************************************************
  2.  
  3.   $Workfile:   nwfile.h  $
  4.   $Revision:   1.24  $
  5.   $Modtime::   08 May 1995 17:02:58                        $
  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 ( NWFILE_H )
  21. #define NWFILE_H
  22.  
  23. #if ! defined ( NTYPES_H )
  24. # include "ntypes.h"
  25. #endif
  26.  
  27. #if ! defined ( NWCALDEF_H )
  28. # include "nwcaldef.h"
  29. #endif
  30.  
  31. #include "npackon.h"
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #ifndef FILE_LOCKS_ONLY
  38.  
  39. typedef struct NW_FILE_INFO
  40. {
  41.    nstr8   fileName[14];
  42.    nuint8  fileAttributes;
  43.    nuint8  extendedFileAttributes;
  44.    nuint32 fileSize;
  45.    nuint16 creationDate;
  46.    nuint16 lastAccessDate;
  47.    nuint32 lastUpdateDateAndTime;
  48.    nuint32 fileOwnerID;
  49.    nuint32 lastArchiveDateAndTime;
  50. } NW_FILE_INFO;
  51.  
  52. typedef struct NW_FILE_INFO2
  53. {
  54.    nuint8  fileAttributes;
  55.    nuint8  extendedFileAttributes;
  56.    nuint32 fileSize;
  57.    nuint16 creationDate;
  58.    nuint16 lastAccessDate;
  59.    nuint32 lastUpdateDateAndTime;
  60.    nuint32 fileOwnerID;
  61.    nuint32 lastArchiveDateAndTime;
  62.    nstr8   fileName[260];
  63. } NW_FILE_INFO2;
  64.  
  65. typedef struct SEARCH_FILE_INFO
  66. {
  67.    nuint16 sequenceNumber;
  68.    nuint16 reserved;
  69.    nstr8   fileName[15];
  70.    nuint8  fileAttributes;
  71.    nuint8  fileMode;
  72.    nuint32 fileLength;
  73.    nuint16 createDate;
  74.    nuint16 accessDate;
  75.    nuint16 updateDate;
  76.    nuint16 updateTime;
  77. } SEARCH_FILE_INFO;
  78.  
  79. typedef struct SEARCH_DIR_INFO
  80. {
  81.    nuint16 sequenceNumber;
  82.    nuint16 reserved1;
  83.    nstr8   directoryName[15];
  84.    nuint8  directoryAttributes;
  85.    nuint8  directoryAccessRights;
  86.    nuint16 createDate;
  87.    nuint16 createTime;
  88.    nuint32 owningObjectID;
  89.    nuint16 reserved2;
  90.    nuint16 directoryStamp;
  91. } SEARCH_DIR_INFO;
  92.  
  93. typedef struct
  94. {
  95.    nuint8  taskNumber;
  96.    nuint8  lockType;
  97.    nuint8  accessControl;
  98.    nuint8  lockFlag;
  99.    nuint8  volNumber;
  100.    nuint16 dirEntry;
  101.    nstr8   fileName[14];
  102. } CONN_OPEN_FILE;
  103.  
  104. typedef struct
  105. {
  106.    nuint16 nextRequest;
  107.    nuint8  connCount;
  108.    CONN_OPEN_FILE connInfo[22];
  109. } CONN_OPEN_FILES;
  110.  
  111. typedef struct
  112. {
  113.    nuint16 taskNumber;
  114.    nuint8  lockType;
  115.    nuint8  accessControl;
  116.    nuint8  lockFlag;
  117.    nuint8  volNumber;
  118.    nuint32 parent;
  119.    nuint32 dirEntry;
  120.    nuint8  forkCount;
  121.    nuint8  nameSpace;
  122.    nuint8  nameLen;
  123.    nstr8   fileName[255];
  124. } OPEN_FILE_CONN;
  125.  
  126. typedef struct
  127. {
  128.    nuint16 nextRequest;
  129.    nuint16 openCount;
  130.    nuint8  buffer[512];
  131.    nuint16 curRecord;
  132. } OPEN_FILE_CONN_CTRL;
  133.  
  134. typedef struct
  135. {
  136.    NWCONN_NUM connNumber;
  137.    nuint16 taskNumber;
  138.    nuint8  lockType;
  139.    nuint8  accessControl;
  140.    nuint8  lockFlag;
  141. } CONN_USING_FILE;
  142.  
  143. typedef struct
  144. {
  145.    nuint16 nextRequest;
  146.    nuint16 useCount;
  147.    nuint16 openCount;
  148.    nuint16 openForReadCount;
  149.    nuint16 openForWriteCount;
  150.    nuint16 denyReadCount;
  151.    nuint16 denyWriteCount;
  152.    nuint8  locked;
  153.    nuint8  forkCount;
  154.    nuint16 connCount;
  155.    CONN_USING_FILE connInfo[70];
  156. } CONNS_USING_FILE;
  157.  
  158. #define  SEEK_FROM_BEGINNING        1
  159. #define  SEEK_FROM_CURRENT_OFFSET   2
  160. #define  SEEK_FROM_END              3
  161.  
  162. /* The following flags are to be used in the createFlag parameter of
  163.    the NWCreateFile call. */
  164.  
  165. #define NWCREATE_NEW_FILE    1
  166. #define NWOVERWRITE_FILE    2
  167.  
  168. NWCCODE N_API NWSetCompressedFileSize
  169. (
  170.    NWCONN_HANDLE  conn,
  171.    nuint32        fileHandle,
  172.    nuint32        reqFileSize,
  173.    pnuint32       resFileSize
  174. );
  175.  
  176. NWCCODE N_API NWFileServerFileCopy
  177. (
  178.    NWFILE_HANDLE  srcFileHandle,
  179.    NWFILE_HANDLE  dstFileHandle,
  180.    nuint32        srcOffset,
  181.    nuint32        dstOffset,
  182.    nuint32        bytesToCopy,
  183.    pnuint32       bytesCopied
  184. );
  185.  
  186. NWCCODE N_API NWGetFileConnectionID
  187. (
  188.    NWFILE_HANDLE  fileHandle,
  189.    NWCONN_HANDLE N_FAR *  conn
  190. );
  191.  
  192. NWCCODE N_API NWGetFileConnRef
  193. (
  194.    NWFILE_HANDLE  fileHandle,
  195.    pnuint32       connRef
  196. );
  197.  
  198. NWCCODE N_API NWIntFileSearchInitialize
  199. (
  200.    NWCONN_HANDLE  conn,
  201.    NWDIR_HANDLE   dirHandle,
  202.    pnstr8         path,
  203.    pnuint8        volNum,
  204.    pnuint16       dirID,
  205.    pnuint16       iterhandle,
  206.    pnuint8        accessRights,
  207.    nuint16        augmentFlag
  208. );
  209.  
  210. NWCCODE N_API NWFileSearchInitialize
  211. (
  212.    NWCONN_HANDLE  conn,
  213.    NWDIR_HANDLE   dirHandle,
  214.    pnstr8         path,
  215.    pnuint8        volNum,
  216.    pnuint16       dirID,
  217.    pnuint16       iterhandle,
  218.    pnuint8        accessRights
  219. );
  220.  
  221. #define NWFileSearchContinue(a, b, c, d, e, f, g) \
  222.         NWIntFileSearchContinue(a, b, c, d, e, f, g, 0)
  223.  
  224. NWCCODE N_API NWIntFileSearchContinue
  225. (
  226.    NWCONN_HANDLE  conn,
  227.    nuint8         volNum,
  228.    nuint16        dirID,
  229.    nuint16        searchContext,
  230.    nuint8         searchAttr,
  231.    pnstr8         searchPath,
  232.    pnuint8        retBuf,
  233.    nuint16        augmentFlag
  234. );
  235.  
  236. #define NWScanFileInformation(a, b, c, d, e, f) \
  237.         NWIntScanFileInformation(a, b, c, d, e, f, 0)
  238.  
  239. NWCCODE N_API NWIntScanFileInformation
  240. (
  241.    NWCONN_HANDLE  conn,
  242.    NWDIR_HANDLE   dirHandle,
  243.    pnstr8         filePattern,
  244.    nuint8         searchAttr,
  245.    pnint16        iterhandle,
  246.    NW_FILE_INFO N_FAR * info,
  247.    nuint16        augmentFlag
  248. );
  249.  
  250. NWCCODE N_API NWSetFileInformation
  251. (
  252.    NWCONN_HANDLE  conn,
  253.    NWDIR_HANDLE   dirHandle,
  254.    pnstr8         fileName,
  255.    nuint8         searchAttrs,
  256.    NW_FILE_INFO N_FAR * info
  257. );
  258.  
  259. NWCCODE N_API NWSetFileInformation2
  260. (
  261.    NWCONN_HANDLE  conn,
  262.    NWDIR_HANDLE   dirHandle,
  263.    pnstr8         fileName,
  264.    nuint8         searchAttrs,
  265.    NW_FILE_INFO2 N_FAR * info
  266. );
  267.  
  268. #define NWScanFileInformation2(a, b, c, d, e, f) \
  269.         NWIntScanFileInformation2(a, b, c, d, e, f, 0)
  270.  
  271. NWCCODE N_API NWIntScanFileInformation2
  272. (
  273.    NWCONN_HANDLE  conn,
  274.    NWDIR_HANDLE   dirHandle,
  275.    pnstr8         filePattern,
  276.    nuint8         searchAttrs,
  277.    pnuint8        iterHandle,
  278.    NW_FILE_INFO2 N_FAR * info,
  279.    nuint16        augmentFlag
  280. );
  281.  
  282. NWCCODE N_API NWSetFileAttributes
  283. (
  284.    NWCONN_HANDLE  conn,
  285.    NWDIR_HANDLE   dirHandle,
  286.    pnstr8         fileName,
  287.    nuint8         searchAttrs,
  288.    nuint8         newAttrs
  289. );
  290.  
  291. NWCCODE N_API NWGetExtendedFileAttributes2
  292. (
  293.    NWCONN_HANDLE  conn,
  294.    NWDIR_HANDLE   dirHandle,
  295.    pnstr8         path,
  296.    pnuint8        extAttrs
  297. );
  298.  
  299. NWCCODE N_API NWScanConnectionsUsingFile
  300. (
  301.    NWCONN_HANDLE  conn,
  302.    NWDIR_HANDLE   dirHandle,
  303.    pnstr8         filePath,
  304.    pnint16        iterhandle,
  305.    CONN_USING_FILE N_FAR * fileUse,
  306.    CONNS_USING_FILE N_FAR * fileUsed
  307. );
  308.  
  309. NWCCODE N_API NWScanOpenFilesByConn2
  310. (
  311.    NWCONN_HANDLE  conn,
  312.    NWCONN_NUM     connNum,
  313.    pnint16        iterHandle,
  314.    OPEN_FILE_CONN_CTRL N_FAR * openCtrl,
  315.    OPEN_FILE_CONN N_FAR * openFile
  316. );
  317.  
  318. NWCCODE N_API NWScanOpenFilesByConn
  319. (
  320.    NWCONN_HANDLE  conn,
  321.    NWCONN_NUM     connNum,
  322.    pnint16        iterHandle,
  323.    CONN_OPEN_FILE N_FAR * openFile,
  324.    CONN_OPEN_FILES N_FAR * openFiles
  325. );
  326.  
  327. NWCCODE N_API NWSetExtendedFileAttributes2
  328. (
  329.    NWCONN_HANDLE  conn,
  330.    NWDIR_HANDLE   dirHandle,
  331.    pnstr8         path,
  332.    nuint8         extAttrs
  333. );
  334.  
  335. NWCCODE N_API NWRenameFile
  336. (
  337.    NWCONN_HANDLE  conn,
  338.    NWDIR_HANDLE   oldDirHandle,
  339.    pnstr8         oldFileName,
  340.    nuint8         searchAttrs,
  341.    NWDIR_HANDLE   newDirHandle,
  342.    pnstr8         newFileName
  343. );
  344.  
  345. #define NWEraseFiles(a, b, c, d) \
  346.         NWIntEraseFiles(a, b, c, d, 0)
  347.  
  348. NWCCODE N_API NWIntEraseFiles
  349. (
  350.    NWCONN_HANDLE  conn,
  351.    NWDIR_HANDLE   dirHandle,
  352.    pnstr8         path,
  353.    nuint8         searchAttrs,
  354.    nuint16        augmentFlag
  355. );
  356.  
  357. NWCCODE N_API NWGetSparseFileBitMap
  358. (
  359.    NWCONN_HANDLE  conn,
  360.    NWFILE_HANDLE  fileHandle,
  361.    nint16         flag,
  362.    nuint32        offset,
  363.    pnuint32       blockSize,
  364.    pnuint8        bitMap
  365. );
  366.  
  367. #endif
  368.  
  369. #define NWLOCKS_INCLUDED
  370.  
  371. NWCCODE N_API NWLogPhysicalRecord
  372. (
  373.    NWFILE_HANDLE  fileHandle,
  374.    nuint32        recStartOffset,
  375.    nuint32        recLength,
  376.    nuint8         lockFlags,
  377.    nuint16        timeOut
  378. );
  379.  
  380. NWCCODE N_API NWLockPhysicalRecordSet
  381. (
  382.    nuint8      lockFlags,
  383.    nuint16     timeOut
  384. );
  385.  
  386. NWCCODE N_API NWReleasePhysicalRecordSet
  387. (
  388.    void
  389. );
  390.  
  391. NWCCODE N_API NWClearPhysicalRecordSet
  392. (
  393.    void
  394. );
  395.  
  396. NWCCODE N_API NWReleasePhysicalRecord
  397. (
  398.    NWFILE_HANDLE  fileHandle,
  399.    nuint32        recStartOffset,
  400.    nuint32        recSize
  401. );
  402.  
  403. NWCCODE N_API NWClearPhysicalRecord
  404. (
  405.    NWFILE_HANDLE  fileHandle,
  406.    nuint32        recStartOffset,
  407.    nuint32        recSize
  408. );
  409.  
  410. NWCCODE N_API NWLockFileLockSet
  411. (
  412.    nuint16        timeOut
  413. );
  414.  
  415. NWCCODE N_API NWReleaseFileLockSet
  416. (
  417.    void
  418. );
  419.  
  420. NWCCODE N_API NWClearFileLockSet
  421. (
  422.    void
  423. );
  424.  
  425. NWCCODE N_API NWClearFileLock2
  426. (
  427.    NWCONN_HANDLE  conn,
  428.    NWDIR_HANDLE   dirHandle,
  429.    pnstr8         path
  430. );
  431.  
  432. NWCCODE N_API NWReleaseFileLock2
  433. (
  434.    NWCONN_HANDLE  conn,
  435.    NWDIR_HANDLE   dirHandle,
  436.    pnstr8         path
  437. );
  438.  
  439. NWCCODE N_API NWLogFileLock2
  440. (
  441.    NWCONN_HANDLE  conn,
  442.    NWDIR_HANDLE   dirHandle,
  443.    pnstr8         path,
  444.    nuint8         lockFlags,
  445.    nuint16        timeOut
  446. );
  447.  
  448. NWCCODE N_API NWLogLogicalRecord
  449. (
  450.    NWCONN_HANDLE  conn,
  451.    pnstr8         logRecName,
  452.    nuint8         lockFlags,
  453.    nuint16        timeOut
  454. );
  455.  
  456. NWCCODE N_API NWLockLogicalRecordSet
  457. (
  458.    nuint8         lockFlags,
  459.    nuint16        timeOut
  460. );
  461.  
  462. NWCCODE N_API NWReleaseLogicalRecordSet
  463. (
  464.    void
  465. );
  466.  
  467. NWCCODE N_API NWClearLogicalRecordSet
  468. (
  469.    void
  470. );
  471.  
  472. NWCCODE N_API NWReleaseLogicalRecord
  473. (
  474.    NWCONN_HANDLE  conn,
  475.    pnstr8         logRecName
  476. );
  477.  
  478. NWCCODE N_API NWClearLogicalRecord
  479. (
  480.    NWCONN_HANDLE  conn,
  481.    pnstr8         logRecName
  482. );
  483.  
  484.  
  485. NWCCODE N_API NWCloseFile
  486. (
  487.    NWFILE_HANDLE  fileHandle
  488. );
  489.  
  490. NWCCODE N_API NWCreateFile
  491. (
  492.    NWCONN_HANDLE  conn,
  493.    NWDIR_HANDLE   dirHandle,
  494.    pnstr8         fileName,
  495.    nuint8         fileAttrs,
  496.    NWFILE_HANDLE  N_FAR * fileHandle,
  497.    nflag32        createFlag
  498. );
  499.  
  500. NWCCODE N_API NWOpenFile
  501. (
  502.    NWCONN_HANDLE  conn,
  503.    NWDIR_HANDLE   dirHandle,
  504.    pnstr8         fileName,
  505.    nuint16        searchAttr,
  506.    nuint8         accessRights,
  507.    NWFILE_HANDLE  N_FAR * fileHandle
  508. );
  509.  
  510. NWCCODE N_API NWReadFile
  511. (
  512.    NWFILE_HANDLE  fileHandle,
  513.    nuint32        bytesToRead,
  514.    pnuint32       bytesActuallyRead,
  515.    pnuint8        data
  516. );
  517.  
  518. NWCCODE N_API NWWriteFile
  519. (
  520.    NWFILE_HANDLE  fileHandle,
  521.    nuint32        bytesToWrite,
  522.    pnuint8        data
  523. );
  524.  
  525. NWCCODE N_API NWCommitFile
  526. (
  527.    NWFILE_HANDLE  fileHandle
  528. );
  529.  
  530. NWCCODE N_API NWGetEOF
  531. (
  532.    NWFILE_HANDLE  fileHandle,
  533.    pnuint32       getEOF
  534. );
  535.  
  536. NWCCODE N_API NWSetEOF
  537. (
  538.    NWFILE_HANDLE  fileHandle,
  539.    nuint32        setEOF
  540. );
  541.  
  542. NWCCODE N_API NWGetFilePos
  543. (
  544.    NWFILE_HANDLE  fileHandle,
  545.    pnuint32       filePos
  546. );
  547.  
  548. NWCCODE N_API NWSetFilePos
  549. (
  550.    NWFILE_HANDLE  fileHandle,
  551.    nuint          mode,
  552.    nuint32        filePos
  553. );
  554.  
  555. #ifdef __cplusplus
  556. }
  557. #endif
  558.  
  559. #include "npackoff.h"
  560. #endif
  561.