home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / UDEL.ZIP / SFDOS.H < prev    next >
Text File  |  1988-10-16  |  10KB  |  200 lines

  1. /****************************************************************************
  2. *   sfdos.h - standart dos routines.                                        *
  3. *                                               T.  Sandberg                *
  4. *                                               02/23/88                    *
  5. *                                                                           *
  6. ****************************************************************************/
  7.  
  8.  
  9. #define FA_NORMAL       0x0000            /* Normal   */
  10. #define FA_RDONLY       0x0001            /* Read only attribute */
  11. #define FA_HIDDEN       0x0002            /* Hidden file */
  12. #define FA_SYSTEM       0x0004            /* System file */
  13. #define FA_LABEL        0x0008            /* Volume label */
  14. #define FA_DIREC        0x0010            /* Directory */
  15. #define FA_ARCH         0x0020            /* Archive */
  16. #define FA_ALL          0x0002            /* all files except sub directory */
  17.  
  18. #define F_DELETED       0
  19. #define F_FOUND         0
  20. #define F_NOT_FOUND    -1
  21. #define F_PROTECTED    -2
  22. #define F_IN_USE       -3
  23. #define F_ATTR_ON       1
  24. #define F_ATTR_OFF     -1
  25.  
  26.  
  27. typedef struct sfdir {
  28.               char  fnameext[12];      /* file name with extension */
  29.               char  fname[9];          /* file name only */
  30.               char  fext[4];           /* extension only */
  31.               char  fdate[9];          /* file date m/d/y */
  32.               long  fldate;            /* file date in long inter format y/m/d */
  33.               char  ftime[6];          /* time */
  34.               long  fltime;            /* long integer time hhmmss */
  35.      unsigned long  fsize;    /* file size bytes */
  36.              } SFDIR;
  37.  
  38.  
  39.  
  40. typedef struct _FSINFOBUF {
  41.                    FDATE fdateCreation;
  42.                    FTIME ftimeCreation;
  43.                    CHAR cchName;
  44.                    CHAR achVolumeName[14];
  45.                  } FSINFOBUF;
  46.  
  47.  
  48. typedef struct _SFVOLINFO  {
  49.                             char name[14];
  50.                             char fdate[9];
  51.                             char ftime[6];
  52.                           }
  53. SFVOLINFO;
  54.  
  55.  
  56.  
  57. int sfdos_dir_first_entry(HDIR *,char *,struct sfdir *,int);
  58. /****************************************************************************
  59. * sfdos_dir_first_entry   retuns dir_ent of path, with file attrib          *
  60. *                         where attrib are                                  *
  61. *                         FA_RDONLY = read only attribue                    *
  62. *                         FA_HIDDEN = Hidden file                           *
  63. *                         FA_SYSTEM = System file                           *
  64. *                         FA_DIREC  = Directory                             *
  65. *                         FA_ARCH   = Archive   (normal attribute           *
  66. *                         FA_NORMAL = Normal files                          *
  67. *                         FA_ALL    = All but hidden files                  *
  68. ****************************************************************************
  69. HDIR *hdir;
  70. char *path;
  71. struct sfdir *dir_ent;
  72. int attrib;  */
  73.  
  74.  
  75.  
  76. int sfdos_dir_next_entry(HDIR,struct sfdir *,int);
  77. /****************************************************************************
  78. * sfdos_dir_next_entry   retuns next dir_ent of path, with file attrib      *
  79. *                        started in sfdos_dir_first_entry                   *
  80. *                                                                           *
  81. ****************************************************************************
  82. HDIR hdir;
  83. struct sfdir *dir_ent;
  84. int attrib; */
  85.  
  86.  
  87.  
  88.  
  89. void sfdos_getenv(char *,char *);
  90. /*****************************************************************************
  91. *  sfdos_getenv  get enviroment variable env_var and returns value env_value *
  92. *                note enviroment variable are set with the DOS SET command   *
  93. *                they are in form    env_var=inv_value                       *
  94. *                an exmple is   LINK=c:\masm                                 *
  95. *                where "LINK" is the env_var and "c:\masm" is the env_value  *
  96. *                                                                            *
  97. *                note : a null string will be returned if enviroment variable*
  98. *                       is not found.                                        *
  99. *****************************************************************************/
  100.  
  101.  
  102.  
  103. void sfdos_getdfree(char,FSALLOCATE *,ULONG *,
  104.                     ULONG *,int *);
  105. /****************************************************************************
  106. *  sfdos_getdfree  - get free space information on disk d:                  *
  107. *                                                                           *
  108. *   parms are                                                               *
  109. *               d        =  disk drive letter "a" - "z" or "A" - "Z"        *
  110. *                                                                           *
  111. *               dspace   =  Detail on disk drive.                           *
  112. *                                                                           *
  113. *               total    =  Total disk space used and availble.             *
  114. *                                                                           *
  115. *               available =  Total disk space free (not in use)             *
  116. *                                                                           *
  117. *               percent_free = Percentage of free space                     *
  118. ****************************************************************************/
  119.  
  120.  
  121. void sfdos_get_volid(char,char *);
  122. /******************************************************************************
  123. * sfdos_get_volid   retrive volid id for drive return result in volname       *
  124. *******************************************************************************
  125. char drive;
  126. char *volname; */
  127.  
  128.  
  129. void sfdos_get_volid_st(char,SFVOLINFO *);
  130. /******************************************************************************
  131. * sfdos_get_volid_st   retrive volid id for drive return result in struct     *
  132. *                      volinfo.                                               *
  133. *******************************************************************************
  134. char drive;
  135. SFVOLINFO *volinfo; */
  136.  
  137.  
  138. char sfdos_get_disk();
  139. /******************************************************************************
  140. *  sfdos_getdrive  :  returns the current drive letter.                       *
  141. ******************************************************************************/
  142.  
  143.  
  144. int sfdos_set_disk(char d);
  145. /******************************************************************************
  146. *  sfdos_getdrive  :                                                          *
  147. ******************************************************************************/
  148.  
  149.  
  150. int sfdos_getcwd(char drive,char *cwd);
  151. /******************************************************************************
  152. *  sfdos_getcwd  retrive current working directory.                           *
  153. *                if drive is 0 use current drive if in error return           *
  154. *                os/2 error number.                                           *
  155. ******************************************************************************/
  156.  
  157.  
  158. int sfdos_setcwd(char drive,char *cwd);
  159. /******************************************************************************
  160. *  sfdos_setcwd  set current working directory.                               *
  161. *                if drive is 0 use current drive if in error return           *
  162. *                os/2 error number.                                           *
  163. ******************************************************************************/
  164.  
  165.  
  166.  
  167.  
  168. int sfdos_delete_file(char *path);
  169. /*****************************************************************************
  170. * sfdos_delete_file   - delete file specified in path                        *
  171. *                       returns F_DELETED = file deleted                     *
  172. *                               F_NOT_FOUND                                  *
  173. *                               F_PROCTECED    file procted can not delete   *
  174. *****************************************************************************/
  175.  
  176.  
  177.  
  178. int sfdos_get_file_attr(char *path,int *attr_r,int *attr_h,int *attr_s,
  179.                         int *attr_a);
  180. /****************************************************************************
  181. *  sfdos_get_file_attr - check file *path, and check to see if read only,   *
  182. *                        if hidden, if system and if archive.               *
  183. *                        return TRUE or FALSE for                           *
  184. *                        each attribute.                                    *
  185. *                        returns                                            *
  186. *                        F_FOUND or F_NOT_FOUND                             *
  187. ****************************************************************************/
  188.  
  189.  
  190. int sfdos_set_file_attr(char *path,int attr_r,int attr_h,int attr_s,
  191.                                    int attr_a);
  192. /****************************************************************************
  193. *  sfdos_set_file_attr - set file *path, and change  the three catagory,    *
  194. *                        read only, hidden, sytem.                          *
  195. *                        set F_ATTR_ON OR F_ATTR_OFF for                    *
  196. *                        each attribute.                                    *
  197. *                        returns                                            *
  198. *                        F_FOUND or F_NOT_FOUND                             *
  199. ****************************************************************************/
  200.