home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / detk45he.zip / libc / sys / stat.h next >
Text File  |  1999-03-15  |  3KB  |  123 lines

  1. #if __IBMC__ || __IBMCPP__
  2. #pragma info( none )
  3. #ifndef __CHKHDR__
  4.    #pragma info( none )
  5. #endif
  6. #pragma info( restore )
  7. #endif
  8.  
  9. #ifndef __stat_h
  10.    #define __stat_h
  11.  
  12.    #ifdef __cplusplus
  13.       extern "C" {
  14.    #endif
  15.  
  16.    #ifndef  _LNK_CONV
  17.       #if __IBMC__ || __IBMCPP__ || defined(_OPTLINK_SUPPORTED)
  18.          #define _LNK_CONV   _Optlink
  19.       #else
  20.          #define _LNK_CONV
  21.       #endif
  22.    #endif
  23.  
  24.    #ifndef _IMPORT
  25.       #ifdef __IMPORTLIB__
  26.          #define _IMPORT _Import
  27.       #else
  28.          #define _IMPORT
  29.       #endif
  30.    #endif
  31.  
  32.    /********************************************************************/
  33.    /*  <sys\stat.h> header file                                        */
  34.    /*                                                                  */
  35.    /*  (C) Copyright IBM Corp. 1991, 1995.                             */
  36.    /*  - Licensed Material - Program-Property of IBM                   */
  37.    /*  - All rights reserved                                           */
  38.    /*                                                                  */
  39.    /********************************************************************/
  40.  
  41.    #if ( defined(__SPC__) || defined(__EXTENDED__))
  42.  
  43.       #ifndef __ino_t
  44.          typedef unsigned short ino_t;
  45.          #define __ino_t
  46.       #endif
  47.  
  48.       #ifndef __time_t
  49.          #define __time_t
  50.          typedef long time_t;
  51.       #endif
  52.  
  53.       #ifndef __dev_t
  54.          typedef short dev_t;
  55.          #define __dev_t
  56.       #endif
  57.  
  58.       #ifndef __off_t
  59.          typedef long off_t;
  60.          #define __off_t
  61.       #endif
  62.  
  63.       #pragma pack( 2 )
  64.       struct stat
  65.          {
  66.          dev_t st_dev;
  67.          ino_t st_ino;
  68.          unsigned short st_mode;
  69.          short st_nlink;
  70.          short st_uid;
  71.          short st_gid;
  72.          dev_t st_rdev;
  73.          unsigned short __filler;
  74.          off_t st_size;
  75.          time_t st_atime;
  76.          time_t st_mtime;
  77.          time_t st_ctime;
  78.          };
  79.       #pragma pack( )
  80.  
  81.       #define S_IFDIR         0x4000         /* directory                     */
  82.       #define S_IFCHR         0x2000         /* character device              */
  83.       #define S_IFREG         0x8000         /* regular file                  */
  84.       #define S_IREAD         0x0100         /* read permission               */
  85.       #define S_IWRITE        0x0080         /* write permission              */
  86.       #define S_IEXEC         0x0040         /* execute/search permission     */
  87.  
  88.       int _IMPORT _LNK_CONV _fstat( int, struct stat * );
  89.       int _IMPORT _LNK_CONV _stat( const char *, struct stat * );
  90.  
  91.       int _IMPORT _LNK_CONV  fstat( int, struct stat * );
  92.       int _IMPORT _LNK_CONV  stat( const char *, struct stat * );
  93.  
  94.       #if __IBMC__ || __IBMCPP__
  95.          #if __WINDOWS__ && __THW_INTEL__
  96.             #pragma map( stat , "?_stat"  )
  97.             #pragma map( fstat, "?_fstat" )
  98.          #else
  99.             #pragma map( stat , "_stat"  )
  100.             #pragma map( fstat, "_fstat" )
  101.          #endif
  102.       #else
  103.          #define stat(pathname, buffer) _stat(pathname, buffer)
  104.          #define fstat(handle, buffer) _fstat(handle, buffer)
  105.       #endif
  106.  
  107.    #endif
  108.  
  109.    #ifdef __cplusplus
  110.       }
  111.    #endif
  112.  
  113. #endif
  114.  
  115. #if __IBMC__ || __IBMCPP__
  116. #pragma info( none )
  117. #ifndef __CHKHDR__
  118.    #pragma info( restore )
  119. #endif
  120. #pragma info( restore )
  121. #endif
  122.  
  123.