| 1 | /* $Id: OS2KIO.h,v 1.4 2000-02-19 08:40:30 bird Exp $ | 
|---|
| 2 | * | 
|---|
| 3 | * OS/2 kernel IO: prototypes, typedefs and macros. | 
|---|
| 4 | * | 
|---|
| 5 | * Project Odin Software License can be found in LICENSE.TXT | 
|---|
| 6 | * | 
|---|
| 7 | */ | 
|---|
| 8 |  | 
|---|
| 9 | #ifndef _OS2KIO_h_ | 
|---|
| 10 | #define _OS2KIO_h_ | 
|---|
| 11 |  | 
|---|
| 12 |  | 
|---|
| 13 | /** | 
|---|
| 14 | * Opens a given file. | 
|---|
| 15 | * @returns  NO_ERROR on success. OS/2 error code on error. | 
|---|
| 16 | * @param    pszFilename   Pointer to filename. | 
|---|
| 17 | * @param    flOpenFlags   Open flags. (similar to DosOpen) | 
|---|
| 18 | * @param    fsOpenMode    Open mode flags. (similar to DosOpen) | 
|---|
| 19 | * @param    phFile        Pointer to filehandle. | 
|---|
| 20 | * @param    pulsomething  16-bit near (?) pointer to a variable - unknown. NULL is allowed. EA? | 
|---|
| 21 | */ | 
|---|
| 22 | APIRET KRNLCALL IOSftOpen( | 
|---|
| 23 | PSZ pszFilename, | 
|---|
| 24 | ULONG flOpenFlags, | 
|---|
| 25 | ULONG fsOpenMode, | 
|---|
| 26 | PSFN phFile, | 
|---|
| 27 | PULONG pulsomething | 
|---|
| 28 | ); | 
|---|
| 29 |  | 
|---|
| 30 |  | 
|---|
| 31 | /** | 
|---|
| 32 | * Closes the specified file. | 
|---|
| 33 | * @returns  NO_ERROR on success. OS/2 error code on error. | 
|---|
| 34 | * @param    hFile      File handle - System File Number. | 
|---|
| 35 | */ | 
|---|
| 36 | APIRET KRNLCALL IOSftClose( | 
|---|
| 37 | SFN hFile | 
|---|
| 38 | ); | 
|---|
| 39 |  | 
|---|
| 40 |  | 
|---|
| 41 | /** | 
|---|
| 42 | * Probably this function will expand a relative path to a full path. | 
|---|
| 43 | * @returns  NO_ERROR on success. OS/2 error code on error. | 
|---|
| 44 | * @param    pszPath  Pointer to path to expand. Contains the full path upon return. (?) | 
|---|
| 45 | *                    This buffer should probably be of CCHMAXPATH length. | 
|---|
| 46 | */ | 
|---|
| 47 | APIRET KRNLCALL IOSftTransPath( | 
|---|
| 48 | PSZ pszPath | 
|---|
| 49 | ); | 
|---|
| 50 |  | 
|---|
| 51 |  | 
|---|
| 52 | /** | 
|---|
| 53 | * Read at a given offset in the a file. | 
|---|
| 54 | * @returns  NO_ERROR on success. OS/2 error code on error. | 
|---|
| 55 | * @param    hFile      File handle - System File Number. | 
|---|
| 56 | * @param    pcbActual  Pointer to variable which upon input holds the number | 
|---|
| 57 | *                      of bytes to read, on output the actual number of bytes read. | 
|---|
| 58 | * @param    pvBuffer   Pointer to the read buffer. | 
|---|
| 59 | * @param    flFlags    Read flags? | 
|---|
| 60 | * @param    ulOffset   File offset to read from. (0=start of file) | 
|---|
| 61 | */ | 
|---|
| 62 | APIRET KRNLCALL IOSftReadAt( | 
|---|
| 63 | SFN hFile, | 
|---|
| 64 | PULONG pcbActual, | 
|---|
| 65 | PVOID pvBuffer, | 
|---|
| 66 | ULONG flFlags, | 
|---|
| 67 | ULONG ulOffset | 
|---|
| 68 | ); | 
|---|
| 69 |  | 
|---|
| 70 |  | 
|---|
| 71 | /** | 
|---|
| 72 | * Write at a given offset in the a file. | 
|---|
| 73 | * @returns  NO_ERROR on success. OS/2 error code on error. | 
|---|
| 74 | * @param    hFile      File handle - System File Number. | 
|---|
| 75 | * @param    pcbActual  Pointer to variable which upon input holds the number | 
|---|
| 76 | *                      of bytes to write, on output the actual number of bytes write. | 
|---|
| 77 | * @param    pvBuffer   Pointer to the write buffer. | 
|---|
| 78 | * @param    flFlags    Read flags? | 
|---|
| 79 | * @param    ulOffset   File offset to write from. (0=start of file) | 
|---|
| 80 | */ | 
|---|
| 81 | APIRET KRNLCALL IOSftWriteAt( | 
|---|
| 82 | SFN hFile, | 
|---|
| 83 | PULONG pcbActual, | 
|---|
| 84 | PVOID pvBuffer, | 
|---|
| 85 | ULONG flFlags, | 
|---|
| 86 | ULONG ulOffset | 
|---|
| 87 | ); | 
|---|
| 88 |  | 
|---|
| 89 |  | 
|---|
| 90 | /** | 
|---|
| 91 | * Gets the filesize. | 
|---|
| 92 | * @returns   NO_ERROR on success; OS/2 error code on error. | 
|---|
| 93 | * @param     hFile    File handle - System File Number. | 
|---|
| 94 | * @param     pcbFile  Pointer to ULONG which will hold the file size upon return. | 
|---|
| 95 | */ | 
|---|
| 96 | APIRET KRNLCALL SftFileSize( | 
|---|
| 97 | SFN hFile, | 
|---|
| 98 | PULONG pcbFile | 
|---|
| 99 | ); | 
|---|
| 100 |  | 
|---|
| 101 | #endif | 
|---|