2005-08-31 20:11:45 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* dirent.h */
|
|
|
|
/* */
|
|
|
|
/* Directory entries for cc65 */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* (C) 2005 Oliver Schmidt, <ol.sc@web.de> */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* This software is provided 'as-is', without any expressed or implied */
|
|
|
|
/* warranty. In no event will the authors be held liable for any damages */
|
|
|
|
/* arising from the use of this software. */
|
|
|
|
/* */
|
|
|
|
/* Permission is granted to anyone to use this software for any purpose, */
|
|
|
|
/* including commercial applications, and to alter it and redistribute it */
|
|
|
|
/* freely, subject to the following restrictions: */
|
|
|
|
/* */
|
|
|
|
/* 1. The origin of this software must not be misrepresented; you must not */
|
|
|
|
/* claim that you wrote the original software. If you use this software */
|
|
|
|
/* in a product, an acknowledgment in the product documentation would be */
|
|
|
|
/* appreciated but is not required. */
|
|
|
|
/* 2. Altered source versions must be plainly marked as such, and must not */
|
|
|
|
/* be misrepresented as being the original software. */
|
|
|
|
/* 3. This notice may not be removed or altered from any source */
|
|
|
|
/* distribution. */
|
|
|
|
/* */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _DIRENT_H
|
|
|
|
#define _DIRENT_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Data */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct DIR DIR;
|
|
|
|
|
2007-01-05 16:16:34 +00:00
|
|
|
#if defined(__APPLE2__) || defined(__APPLE2ENH__)
|
|
|
|
|
|
|
|
struct dirent {
|
|
|
|
char d_name[16];
|
|
|
|
unsigned d_ino;
|
|
|
|
unsigned d_blocks;
|
|
|
|
unsigned long d_size;
|
|
|
|
unsigned char d_type;
|
|
|
|
struct {
|
2009-10-11 11:14:35 +00:00
|
|
|
unsigned day :5;
|
|
|
|
unsigned mon :4;
|
|
|
|
unsigned year :7;
|
|
|
|
} d_cdate;
|
|
|
|
struct {
|
|
|
|
unsigned char min;
|
|
|
|
unsigned char hour;
|
2007-01-05 16:16:34 +00:00
|
|
|
} d_ctime;
|
|
|
|
unsigned char d_access;
|
|
|
|
unsigned d_auxtype;
|
|
|
|
struct {
|
2009-10-11 11:14:35 +00:00
|
|
|
unsigned day :5;
|
|
|
|
unsigned mon :4;
|
|
|
|
unsigned year :7;
|
|
|
|
} d_mdate;
|
|
|
|
struct {
|
|
|
|
unsigned char min;
|
|
|
|
unsigned char hour;
|
2007-01-05 16:16:34 +00:00
|
|
|
} d_mtime;
|
|
|
|
};
|
|
|
|
|
2010-10-28 21:13:52 +00:00
|
|
|
#elif defined(__ATARI__)
|
|
|
|
|
|
|
|
struct dirent {
|
|
|
|
char d_name[13]; /* 8.3 + trailing 0 */
|
|
|
|
};
|
|
|
|
|
2012-05-29 21:19:50 +00:00
|
|
|
#elif defined(__CBM__)
|
|
|
|
|
|
|
|
struct dirent {
|
|
|
|
char d_name[16+1];
|
|
|
|
unsigned int d_off;
|
2012-06-02 22:56:14 +00:00
|
|
|
unsigned int d_blocks;
|
2012-06-03 13:58:29 +00:00
|
|
|
unsigned char d_type; /* See CBM_T_xxx defines in cbm.h */
|
2012-06-02 22:56:14 +00:00
|
|
|
|
2012-05-29 21:19:50 +00:00
|
|
|
/* bsd extensions */
|
|
|
|
unsigned char d_namlen;
|
|
|
|
};
|
|
|
|
|
2011-01-04 19:39:07 +00:00
|
|
|
#elif defined(__LYNX__)
|
|
|
|
|
|
|
|
struct dirent {
|
|
|
|
unsigned char d_blocks;
|
|
|
|
unsigned int d_offset;
|
|
|
|
char d_type;
|
|
|
|
void *d_address;
|
|
|
|
unsigned int d_size;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct dirent FileEntry;
|
|
|
|
#pragma zpsym ("FileEntry");
|
|
|
|
|
2010-10-28 21:13:52 +00:00
|
|
|
#else
|
2007-01-05 16:16:34 +00:00
|
|
|
|
2005-08-31 20:11:45 +00:00
|
|
|
struct dirent {
|
|
|
|
char d_name[1];
|
|
|
|
};
|
|
|
|
|
2012-02-17 21:08:13 +00:00
|
|
|
#endif
|
2007-01-05 16:16:34 +00:00
|
|
|
|
2005-08-31 20:11:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Code */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DIR* __fastcall__ opendir (const char* name);
|
|
|
|
|
|
|
|
struct dirent* __fastcall__ readdir (DIR* dir);
|
|
|
|
|
|
|
|
int __fastcall__ closedir (DIR* dir);
|
|
|
|
|
2012-06-03 15:11:32 +00:00
|
|
|
long __fastcall__ telldir (DIR* dir);
|
|
|
|
|
|
|
|
void __fastcall__ seekdir (DIR* dir, long offs);
|
|
|
|
|
2005-08-31 20:11:45 +00:00
|
|
|
void __fastcall__ rewinddir (DIR* dir);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* End of dirent.h */
|
|
|
|
#endif
|