home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / PC_V11_A.LZH / INCLUDE / EXT.H < prev    next >
Text File  |  1992-11-24  |  4KB  |  142 lines

  1. /*      EXT.H
  2.  
  3.         Extended library definitions
  4.  
  5.         Copyright (C) Borland International 1990
  6.         All Rights Reserved.
  7. */
  8.  
  9.  
  10. #if !defined( __EXT )
  11. #define __EXT
  12.  
  13. #include <time.h>
  14.  
  15. extern int __text, __data, __bss;
  16. #define _text &__text
  17. #define _data &__data
  18. #define _bss  &__bss
  19.  
  20. #define FA_UPDATE       0x00
  21. #define FA_RDONLY       0x01
  22. #define FA_HIDDEN       0x02
  23. #define FA_SYSTEM       0x04
  24. #define FA_LABEL        0x08
  25. #define FA_DIREC        0x10
  26. #define FA_ARCH         0x20
  27.  
  28. #define MAXPATH   119
  29. #define MAXDRIVE  3
  30. #define MAXDIR    102
  31. #define MAXFILE   9
  32. #define MAXEXT    5
  33.  
  34. #define S_IFCHR   0020000
  35. #define S_IFDIR   0040000
  36. #define S_IFREG   0100000
  37. #define S_IEXEC   0000100
  38. #define S_IREAD   0000400
  39. #define S_IWRITE  0000200
  40.  
  41. typedef unsigned long size_t;
  42.  
  43.  
  44. struct ffblk
  45. {
  46.     char ff_reserved[21];               /* Reserved by TOS */
  47.     char ff_attrib;                     /* Attribute found */
  48.     int  ff_ftime;                      /* File time */
  49.     int  ff_fdate;                      /* File date */
  50.     long ff_fsize;                      /* File size */
  51.     char ff_name[13];                   /* File name found */
  52. };
  53.  
  54. struct date
  55. {
  56.     int    da_year;                     /* Current year */
  57.     char   da_day;                      /* Day of the month */
  58.     char   da_mon;                      /* Month ( 1 = Jan ) */
  59. };
  60.  
  61. struct time
  62. {
  63.     unsigned char   ti_min;             /* Minutes */
  64.     unsigned char   ti_hour;            /* Hours */
  65.     unsigned char   ti_hund;            /* Hundredths of seconds */
  66.     unsigned char   ti_sec;             /* Seconds */
  67. };
  68.  
  69. struct ftime
  70. {
  71.     unsigned ft_hour:   5;
  72.     unsigned ft_min:    6;
  73.     unsigned ft_tsec:   5;
  74.     unsigned ft_year:   7;
  75.     unsigned ft_month:  4;
  76.     unsigned ft_day:    5;
  77. };
  78.  
  79. struct stat
  80. {
  81.     int    st_dev;
  82.     int    st_ino;
  83.     int    st_mode;
  84.     int    st_nlink;
  85.     int    st_uid;
  86.     int    st_gid;
  87.     int    st_rdev;
  88.     size_t st_size;
  89.     long   st_atime;
  90.     long   st_mtime;
  91.     long   st_ctime;
  92. };
  93.  
  94. struct dfree
  95. {
  96.         unsigned df_avail;
  97.         unsigned df_total;
  98.         unsigned df_bsec;
  99.         unsigned df_sclus;
  100. };
  101.  
  102.  
  103. int         getcurdir( int drive, char *path );
  104. char        *getcwd( char *buffer, int bufflen );
  105. int         getdisk( void );
  106. void        getdfree( unsigned char drive, struct dfree *dtable );
  107. int         setdisk( int drive );
  108.  
  109. int         findfirst( const char *filename, struct ffblk *ffblk, int attrib );
  110. int         findnext( struct ffblk *ffblk );
  111.  
  112. void        getdate( struct date *dateRec );
  113. void        gettime( struct time *timeRec );
  114. void        setdate( struct date *dateRec );
  115. void        settime( struct time *timeRec );
  116. int         getftime( int handle, struct ftime *ftimep );
  117. int         setftime( int handle, struct ftime *ftimep );
  118.  
  119. struct tm   *ftimtotm( struct ftime *f );
  120.  
  121. void        delay( unsigned milliseconds );
  122. void        sleep( unsigned seconds );
  123.  
  124. int         kbhit( void );
  125. int         getch( void );
  126. int         getche( void );
  127. int         putch( int c);
  128. int         chdir( char *filename );
  129.  
  130. int         fstat( int handle, struct stat *statbuf );
  131. int         stat( char *path, struct stat *buff );
  132.  
  133. int         isatty( int handle );
  134. long        filelength( int handle );
  135.  
  136. size_t      coreleft( void );
  137.  
  138. #endif
  139.  
  140.  
  141. /***********************************************************************/
  142.