home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
UDEL.ZIP
/
SFDOS.H
< prev
next >
Wrap
Text File
|
1988-10-16
|
10KB
|
200 lines
/****************************************************************************
* sfdos.h - standart dos routines. *
* T. Sandberg *
* 02/23/88 *
* *
****************************************************************************/
#define FA_NORMAL 0x0000 /* Normal */
#define FA_RDONLY 0x0001 /* Read only attribute */
#define FA_HIDDEN 0x0002 /* Hidden file */
#define FA_SYSTEM 0x0004 /* System file */
#define FA_LABEL 0x0008 /* Volume label */
#define FA_DIREC 0x0010 /* Directory */
#define FA_ARCH 0x0020 /* Archive */
#define FA_ALL 0x0002 /* all files except sub directory */
#define F_DELETED 0
#define F_FOUND 0
#define F_NOT_FOUND -1
#define F_PROTECTED -2
#define F_IN_USE -3
#define F_ATTR_ON 1
#define F_ATTR_OFF -1
typedef struct sfdir {
char fnameext[12]; /* file name with extension */
char fname[9]; /* file name only */
char fext[4]; /* extension only */
char fdate[9]; /* file date m/d/y */
long fldate; /* file date in long inter format y/m/d */
char ftime[6]; /* time */
long fltime; /* long integer time hhmmss */
unsigned long fsize; /* file size bytes */
} SFDIR;
typedef struct _FSINFOBUF {
FDATE fdateCreation;
FTIME ftimeCreation;
CHAR cchName;
CHAR achVolumeName[14];
} FSINFOBUF;
typedef struct _SFVOLINFO {
char name[14];
char fdate[9];
char ftime[6];
}
SFVOLINFO;
int sfdos_dir_first_entry(HDIR *,char *,struct sfdir *,int);
/****************************************************************************
* sfdos_dir_first_entry retuns dir_ent of path, with file attrib *
* where attrib are *
* FA_RDONLY = read only attribue *
* FA_HIDDEN = Hidden file *
* FA_SYSTEM = System file *
* FA_DIREC = Directory *
* FA_ARCH = Archive (normal attribute *
* FA_NORMAL = Normal files *
* FA_ALL = All but hidden files *
****************************************************************************
HDIR *hdir;
char *path;
struct sfdir *dir_ent;
int attrib; */
int sfdos_dir_next_entry(HDIR,struct sfdir *,int);
/****************************************************************************
* sfdos_dir_next_entry retuns next dir_ent of path, with file attrib *
* started in sfdos_dir_first_entry *
* *
****************************************************************************
HDIR hdir;
struct sfdir *dir_ent;
int attrib; */
void sfdos_getenv(char *,char *);
/*****************************************************************************
* sfdos_getenv get enviroment variable env_var and returns value env_value *
* note enviroment variable are set with the DOS SET command *
* they are in form env_var=inv_value *
* an exmple is LINK=c:\masm *
* where "LINK" is the env_var and "c:\masm" is the env_value *
* *
* note : a null string will be returned if enviroment variable*
* is not found. *
*****************************************************************************/
void sfdos_getdfree(char,FSALLOCATE *,ULONG *,
ULONG *,int *);
/****************************************************************************
* sfdos_getdfree - get free space information on disk d: *
* *
* parms are *
* d = disk drive letter "a" - "z" or "A" - "Z" *
* *
* dspace = Detail on disk drive. *
* *
* total = Total disk space used and availble. *
* *
* available = Total disk space free (not in use) *
* *
* percent_free = Percentage of free space *
****************************************************************************/
void sfdos_get_volid(char,char *);
/******************************************************************************
* sfdos_get_volid retrive volid id for drive return result in volname *
*******************************************************************************
char drive;
char *volname; */
void sfdos_get_volid_st(char,SFVOLINFO *);
/******************************************************************************
* sfdos_get_volid_st retrive volid id for drive return result in struct *
* volinfo. *
*******************************************************************************
char drive;
SFVOLINFO *volinfo; */
char sfdos_get_disk();
/******************************************************************************
* sfdos_getdrive : returns the current drive letter. *
******************************************************************************/
int sfdos_set_disk(char d);
/******************************************************************************
* sfdos_getdrive : *
******************************************************************************/
int sfdos_getcwd(char drive,char *cwd);
/******************************************************************************
* sfdos_getcwd retrive current working directory. *
* if drive is 0 use current drive if in error return *
* os/2 error number. *
******************************************************************************/
int sfdos_setcwd(char drive,char *cwd);
/******************************************************************************
* sfdos_setcwd set current working directory. *
* if drive is 0 use current drive if in error return *
* os/2 error number. *
******************************************************************************/
int sfdos_delete_file(char *path);
/*****************************************************************************
* sfdos_delete_file - delete file specified in path *
* returns F_DELETED = file deleted *
* F_NOT_FOUND *
* F_PROCTECED file procted can not delete *
*****************************************************************************/
int sfdos_get_file_attr(char *path,int *attr_r,int *attr_h,int *attr_s,
int *attr_a);
/****************************************************************************
* sfdos_get_file_attr - check file *path, and check to see if read only, *
* if hidden, if system and if archive. *
* return TRUE or FALSE for *
* each attribute. *
* returns *
* F_FOUND or F_NOT_FOUND *
****************************************************************************/
int sfdos_set_file_attr(char *path,int attr_r,int attr_h,int attr_s,
int attr_a);
/****************************************************************************
* sfdos_set_file_attr - set file *path, and change the three catagory, *
* read only, hidden, sytem. *
* set F_ATTR_ON OR F_ATTR_OFF for *
* each attribute. *
* returns *
* F_FOUND or F_NOT_FOUND *
****************************************************************************/