home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / incl / sysa / stat.h__ / STAT.H
Encoding:
C/C++ Source or Header  |  1992-09-28  |  3.0 KB  |  99 lines

  1. #ifndef __stat_h
  2.    #define __stat_h
  3.  
  4.    #pragma info( none )
  5.    #ifndef __CHKHDR__
  6.       #pragma info( none )
  7.    #endif
  8.    #pragma info( restore )
  9.  
  10.    #ifdef __cplusplus
  11.       extern "C" {
  12.    #endif
  13.  
  14.    /********************************************************************/
  15.    /*  <sys\stat.h> header file                                        */
  16.    /*                                                                  */
  17.    /*  Licensed Materials - Property of IBM                            */
  18.    /*                                                                  */
  19.    /*  IBM C Set/2 Beta Version                                        */
  20.    /*  Copyright (C) International Business Machines Corp., 1991,1992  */
  21.    /*  All rights reserved                                             */
  22.    /*                                                                  */
  23.    /*  US Government Users Restricted Rights -                         */
  24.    /*  Use, duplication, or disclosure restricted                      */
  25.    /*  by GSA ADP Schedule Contract with IBM Corp.                     */
  26.    /*                                                                  */
  27.    /********************************************************************/
  28.  
  29.    #if ( defined(__SPC__) || defined(__EXTENDED__))
  30.  
  31.       #ifndef __ino_t
  32.          typedef unsigned short ino_t;
  33.          #define __ino_t
  34.       #endif
  35.  
  36.       #ifndef __time_t
  37.          #define __time_t
  38.          typedef long time_t;
  39.       #endif
  40.  
  41.       #ifndef __dev_t
  42.          typedef short dev_t;
  43.          #define __dev_t
  44.       #endif
  45.  
  46.       #ifndef __off_t
  47.          typedef long off_t;
  48.          #define __off_t
  49.       #endif
  50.  
  51.       #pragma pack( 2 )
  52.       struct stat
  53.          {
  54.          dev_t st_dev;
  55.          ino_t st_ino;
  56.          unsigned short st_mode;
  57.          short st_nlink;
  58.          short st_uid;
  59.          short st_gid;
  60.          dev_t st_rdev;
  61.          unsigned short __filler;
  62.          off_t st_size;
  63.          time_t st_atime;
  64.          time_t st_mtime;
  65.          time_t st_ctime;
  66.          };
  67.       #pragma pack( )
  68.  
  69.       #define S_IFDIR         0x4000         /* directory                     */
  70.       #define S_IFCHR         0x2000         /* character device              */
  71.       #define S_IFREG         0x8000         /* regular file                  */
  72.       #define S_IREAD         0x0100         /* read permission               */
  73.       #define S_IWRITE        0x0080         /* write permission              */
  74.       #define S_IEXEC         0x0040         /* execute/search permission     */
  75.  
  76.       int _Optlink _fstat( int, struct stat * );
  77.       #ifdef __cplusplus
  78.          int _Optlink _stat( const char *, struct stat * );
  79.       #else
  80.          int _Optlink _stat( char *, struct stat * );
  81.       #endif
  82.  
  83.       #define stat(a,b)  _stat((a),(b))
  84.       #define fstat(a,b)  _fstat((a),(b))
  85.  
  86.    #endif
  87.  
  88.    #ifdef __cplusplus
  89.       }
  90.    #endif
  91.  
  92.    #pragma info( none )
  93.    #ifndef __CHKHDR__
  94.       #pragma info( restore )
  95.    #endif
  96.    #pragma info( restore )
  97.  
  98. #endif
  99.