Category : C Source Code
Archive   : ZIPSRC19.ZIP
Filename : OS2ZIP.H

 
Output of file : OS2ZIP.H contained in archive : ZIPSRC19.ZIP
/*
* @(#) dir.h 1.4 87/11/06 Public Domain.
*
* A public domain implementation of BSD directory routines for
* MS-DOS. Written by Michael Rendell ({uunet,utai}michael@garfield),
* August 1987
*
* Enhanced and ported to OS/2 by Kai Uwe Rommel; added scandir() prototype
* December 1989, February 1990
* Change of MAXPATHLEN for HPFS, October 1990
*/


#define MAXNAMLEN 256
#define MAXPATHLEN 256

#define A_RONLY 0x01
#define A_HIDDEN 0x02
#define A_SYSTEM 0x04
#define A_LABEL 0x08
#define A_DIR 0x10
#define A_ARCHIVE 0x20


struct direct
{
ino_t d_ino; /* a bit of a farce */
int d_reclen; /* more farce */
int d_namlen; /* length of d_name */
char d_name[MAXNAMLEN + 1]; /* null terminated */
/* nonstandard fields */
long d_size; /* size in bytes */
unsigned d_mode; /* DOS or OS/2 file attributes */
unsigned d_time;
unsigned d_date;
};

/* The fields d_size and d_mode are extensions by me (Kai Uwe Rommel).
* The find_first and find_next calls deliver this data without any extra cost.
* If this data is needed, these fields save a lot of extra calls to stat()
* (each stat() again performs a find_first call !).
*/

struct _dircontents
{
char *_d_entry;
long _d_size;
unsigned _d_mode, _d_time, _d_date;
struct _dircontents *_d_next;
};

typedef struct _dirdesc
{
int dd_id; /* uniquely identify each open directory */
long dd_loc; /* where we are in directory entry is this */
struct _dircontents *dd_contents; /* pointer to contents of dir */
struct _dircontents *dd_cp; /* pointer to current position */
}
DIR;


extern DIR *opendir(char *);
extern struct direct *readdir(DIR *);
extern void seekdir(DIR *, long);
extern long telldir(DIR *);
extern void closedir(DIR *);
#define rewinddir(dirp) seekdir(dirp, 0L)

int GetFileMode(char *name);

long GetFileTime(char *name);
void SetFileTime(char *path, long stamp);

int IsFileNameValid(char *name);
int IsFileSystemFAT(char *dir);
void ChangeNameForFAT(char *name);

char *GetLongNameEA(char *name);
char *GetLongPathEA(char *name);
void GetEAs(char *name, char **bufptr, unsigned *size,
char **cbufptr, unsigned *csize);

char *StringLower(char *);


  3 Responses to “Category : C Source Code
Archive   : ZIPSRC19.ZIP
Filename : OS2ZIP.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/