home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1998 February / PCOnline_02_1998.iso / filesbbs / os2 / pgp263.arj / PGP263I.SRC / PGP263II.ZIP / src / c370.h < prev    next >
C/C++ Source or Header  |  1995-06-19  |  3KB  |  117 lines

  1. #ifndef C370_H
  2. #define C370_H
  3.  
  4. #include <stdio.h>
  5. #include <stddef.h>
  6.  
  7. void printhex( void *buf, int len );
  8.  
  9. extern unsigned char ebcdic_ascii[];
  10. extern unsigned char ascii_ebcdic[];
  11.  
  12. void ebcdic2ascii( unsigned char *buf, unsigned size );
  13. void ascii2ebcdic( unsigned char *buf, unsigned size );
  14.  
  15. /* dirent.h definitions */
  16.  
  17. #define NAMELEN     8
  18.  
  19. struct dirent {
  20.    struct dirent *d_next;
  21.    char   d_name[NAMELEN+1];
  22. };
  23.  
  24. typedef struct _DIR {
  25.    struct  dirent *D_list;
  26.    struct  dirent *D_curpos;
  27.    char            D_path[FILENAME_MAX];
  28. } DIR;
  29.  
  30. DIR *          opendir(const char *dirname);
  31. struct dirent *readdir(DIR *dirp);
  32. void           rewinddir(DIR *dirp);
  33. int            closedir(DIR *dirp);
  34.  
  35. /* sys/types.h definitions   */
  36.  
  37. #define  off_t      long
  38. #define  mode_t     int
  39.  
  40. /* fcntl.h     definitions   */
  41.  
  42. #define  O_RDONLY   0x0001
  43. #define  O_WRONLY   0x0002
  44. #define  O_RDWR     0x0004
  45.  
  46. #define  O_CREAT    0x0100
  47. #define  O_TRUNC    0x0200
  48. #define  O_EXCL     0x0400
  49. #define  O_APPEND   0x0800
  50.  
  51. #define  O_BINARY   0x1000
  52. #define  O_MEMORY   0x2000
  53. #define  O_RECORD   0x4000
  54. #define  O_DCB      0x8000
  55. extern unsigned char dcb_flags[];       /* used by fopen and O_DCB */
  56.    /* with a leading comma, eg:  ",recfm=fb,lrecl=80,blksize=6160" */
  57.  
  58. int  open(const char *path, int access);
  59.  
  60. /* stdio.h         definitions   */
  61.  
  62. #define fseek myfseek
  63. /* #define fread myfread */
  64. int  fileno( FILE *fp );
  65.  
  66. /* unistd.h        definitions   */
  67.  
  68. int      access( const char *filename, int how );
  69. int      close( int fd );
  70. int      isatty( int fd );
  71. off_t    lseek( int fd, off_t offset, int whence );
  72. size_t   read( int fd, void *buf, size_t size );
  73. int      unlink( char *filename );
  74. int      write( int fd, void *buf, size_t len );
  75.  
  76. /* io.h        definitions   */
  77.  
  78. int  eof( int fd );
  79. int  setmode(int fd, int access);
  80. int  tell( int fd );
  81.  
  82. /* stat.h      definitions   */
  83.  
  84. struct stat {
  85.   short  st_dev;
  86.   short  st_ino;
  87.   short  st_mode;
  88.   short  st_nlink;
  89.   int    st_uid;
  90.   int    st_gid;
  91.   long   st_size;
  92.   long   st_atime;
  93.   long   st_mtime;
  94.   long   st_ctime;
  95.   FILE   *fp;
  96.   char   fname[FILENAME_MAX];
  97. };
  98.  
  99. int    chmod( const char* filename, mode_t mode );
  100. int    stat(const char *filename, struct stat *buf );
  101. int    fstat(int fd, struct stat *buf );
  102.  
  103. #define S_IFMT       0xFFFF
  104. #define _FLDATA(m)   (*(fldata_t *) &m)
  105. #define S_ISDIR(m)   (_FLDATA(m).__dsorgPDSdir)
  106. #define S_ISREG(m)   (_FLDATA(m).__dsorgPO | \
  107.                       _FLDATA(m).__dsorgPDSmem | \
  108.                       _FLDATA(m).__dsorgPS)
  109. #define S_ISBLK(m)   (_FLDATA(m).__recfmBlk)
  110. #define S_ISMEM(m)   (_FLDATA(m).__dsorgMem)
  111.  
  112. /* errno.h     definitions   */
  113.  
  114. #define ENOENT   -1
  115.  
  116. #endif /* C370_H */
  117.