Annotation of mstools/h/io.h, revision 1.1.1.2

1.1       root        1: /***
                      2: *io.h - declarations for low-level file handling and I/O functions
                      3: *
                      4: *      Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved.
                      5: *
                      6: *Purpose:
                      7: *      This file contains the function declarations for the low-level
                      8: *      file handling and I/O functions.
                      9: *
                     10: ****/
                     11: 
                     12: #ifndef _INC_IO
                     13: 
                     14: #ifdef __cplusplus
                     15: extern "C" {
                     16: #endif
                     17: 
                     18: 
1.1.1.2 ! root       19: #ifndef MIPS
1.1       root       20: #if (_MSC_VER <= 600)
                     21: #define __cdecl _cdecl
                     22: #endif
1.1.1.2 ! root       23: #endif
1.1       root       24: 
                     25: #ifndef _TIME_T_DEFINED
                     26: typedef long time_t;           /* time value */
                     27: #define _TIME_T_DEFINED        /* avoid multiple def's of time_t */
                     28: #endif
                     29: 
                     30: #ifndef _FSIZE_T_DEFINED
                     31: typedef unsigned long _fsize_t;     // Could be 64 bits for Win32
                     32: #define _FSIZE_T_DEFINED
                     33: #endif
                     34: 
                     35: #ifndef _FINDDATA_T_DEFINED
                     36: 
                     37: struct _finddata_t {
                     38:     unsigned   attrib;
                     39:     time_t     time_create;    // -1 for FAT file systems
                     40:     time_t     time_access;    // -1 for FAT file systems
                     41:     time_t     time_write;
                     42:     _fsize_t   size;
                     43:     char       name[256];
                     44: };
                     45: 
                     46: #define _FINDDATA_T_DEFINED
                     47: 
                     48: #endif
                     49: 
                     50: /* File attribute constants for _findfirst() */
                     51: 
                     52: #define _A_NORMAL      0x00    /* Normal file - No read/write restrictions */
                     53: #define _A_RDONLY      0x01    /* Read only file */
                     54: #define _A_HIDDEN      0x02    /* Hidden file */
                     55: #define _A_SYSTEM      0x04    /* System file */
                     56: #define _A_SUBDIR      0x10    /* Subdirectory */
                     57: #define _A_ARCH        0x20    /* Archive file */
                     58: 
                     59: /* function prototypes */
1.1.1.2 ! root       60: #ifdef _POSIX_
        !            61: int access(const char *, int);
        !            62: int chmod(const char *, int);
        !            63: int chsize(int, long);
        !            64: int close(int);
        !            65: int commit(int);
        !            66: int creat(const char *, int);
        !            67: int dup(int);
        !            68: int dup2(int, int);
        !            69: int eof(int);
        !            70: long filelength(int);
        !            71: int isatty(int);
        !            72: int locking(int, int, long);
        !            73: long lseek(int, long, int);
        !            74: char * mktemp(char *);
        !            75: int open(const char *, int, ...);
        !            76: int pipe(int *);              /* POSIX pipe */
        !            77: int read(int, void *, unsigned int);
        !            78: int remove(const char *);
        !            79: int rename(const char *, const char *);
        !            80: int setmode(int, int);
        !            81: long tell(int);
        !            82: int umask(int);
        !            83: int unlink(const char *);
        !            84: int write(int, const void *, unsigned int);
        !            85: #else
1.1       root       86: int _access(const char *, int);
                     87: int _chmod(const char *, int);
                     88: int _chsize(int, long);
                     89: int _close(int);
                     90: int _commit(int);
                     91: int _creat(const char *, int);
                     92: int _dup(int);
                     93: int _dup2(int, int);
                     94: int _eof(int);
                     95: long _filelength(int);
                     96: int _isatty(int);
                     97: int _locking(int, int, long);
                     98: long _lseek(int, long, int);
                     99: char * _mktemp(char *);
                    100: int _open(const char *, int, ...);
                    101: int _pipe(int *, unsigned int, int);
                    102: int _read(int, void *, unsigned int);
                    103: int remove(const char *);
                    104: int rename(const char *, const char *);
                    105: int _setmode(int, int);
                    106: int _sopen(const char *, int, int, ...);
                    107: long _tell(int);
                    108: int _umask(int);
                    109: int _unlink(const char *);
                    110: int _write(int, const void *, unsigned int);
1.1.1.2 ! root      111: #endif /* _POSIX_ */
        !           112: 
        !           113: #ifdef _POSIX_
        !           114: #define _chsize_lk(fh,size) _chsize(fh,size)
        !           115: #define _close_lk(fh)      close(fh)
        !           116: #define _lseek_lk(fh,offset,origin) lseek(fh,offset,origin)
        !           117: #define _setmode_lk(fh,mode)       _setmode(fh,mode)
        !           118: #define _read_lk(fh,buff,count)     read(fh,buff,count)
        !           119: #define _write_lk(fh,buff,count)    write(fh,buff,count)
        !           120: #endif /* POSIX */
1.1       root      121: long _findfirst(char *, struct _finddata_t *);
                    122: int _findnext(long, struct _finddata_t *);
                    123: int _findclose(long);
                    124: 
                    125: 
                    126: long _get_osfhandle(int);
                    127: int _open_osfhandle(long, int);
                    128: 
1.1.1.2 ! root      129: #if !(__STDC__ || defined(_POSIX_))
1.1       root      130: /* Non-ANSI names for compatibility */
                    131: #define access    _access
                    132: #define chmod     _chmod
                    133: #define chsize    _chsize
                    134: #define close     _close
                    135: #define creat     _creat
                    136: #define dup       _dup
                    137: #define dup2      _dup2
                    138: #define eof       _eof
                    139: #define filelength _filelength
                    140: #define isatty    _isatty
                    141: #define locking    _locking
                    142: #define lseek     _lseek
                    143: #define mktemp    _mktemp
                    144: #define open      _open
                    145: #define read      _read
                    146: #define setmode    _setmode
                    147: #define sopen     _sopen
                    148: #define tell      _tell
                    149: #define umask     _umask
                    150: #define unlink    _unlink
                    151: #define write     _write
                    152: #endif /* __STDC__ */
                    153: 
                    154: #ifdef __cplusplus
                    155: }
                    156: #endif
                    157: 
                    158: #define _INC_IO
                    159: #endif /* _INC_IO */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.