1992-01-13 21:48:03 +00:00
|
|
|
/*
|
2012-11-23 07:48:43 +00:00
|
|
|
<dirent.h> -- definitions for POSIX-compatible directory access
|
1992-01-13 21:48:03 +00:00
|
|
|
|
2007-02-10 22:34:45 +00:00
|
|
|
* The code here is forced by the interface, and is not subject to
|
|
|
|
* copyright, constituting the only possible expression of the
|
|
|
|
* algorithm in this format.
|
|
|
|
*/
|
1992-01-13 21:48:03 +00:00
|
|
|
|
|
|
|
#define DIRBLKSIZ 512 /* size of directory block */
|
1994-11-01 08:24:29 +00:00
|
|
|
#ifdef WINDOWSNT
|
|
|
|
#define MAXNAMLEN 255
|
|
|
|
#else /* not WINDOWSNT */
|
1992-01-13 21:48:03 +00:00
|
|
|
#define MAXNAMLEN 15 /* maximum filename length */
|
1994-11-01 08:24:29 +00:00
|
|
|
#endif /* not WINDOWSNT */
|
1992-01-13 21:48:03 +00:00
|
|
|
/* NOTE: MAXNAMLEN must be one less than a multiple of 4 */
|
|
|
|
|
2012-11-23 07:48:43 +00:00
|
|
|
struct dirent /* data from readdir() */
|
1992-01-13 21:48:03 +00:00
|
|
|
{
|
|
|
|
long d_ino; /* inode number of entry */
|
|
|
|
unsigned short d_reclen; /* length of this record */
|
|
|
|
unsigned short d_namlen; /* length of string in d_name */
|
|
|
|
char d_name[MAXNAMLEN+1]; /* name of file */
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int dd_fd; /* file descriptor */
|
|
|
|
int dd_loc; /* offset in block */
|
|
|
|
int dd_size; /* amount of valid data */
|
|
|
|
char dd_buf[DIRBLKSIZ]; /* directory block */
|
|
|
|
} DIR; /* stream data from opendir() */
|
|
|
|
|
2013-01-28 14:41:08 +00:00
|
|
|
extern DIR *opendir (const char *);
|
2012-11-23 07:48:43 +00:00
|
|
|
extern struct dirent *readdir (DIR *);
|
Make building under stricter warning flags somewhat cleaner.
Flags used: -Wold-style-declaration -Wunused-function -Wstrict-prototypes
* lib-src/emacsclient.c (getcwd, w32_getenv):
* lib-src/ntlib.h (getlogin, getuid, getegid, getgid): Fix prototypes.
* nt/runemacs.c (set_user_model_id): Fix prototype.
* src/callproc.c (relocate_fd): Set inside #ifndef WINDOWSNT.
* src/dired.c (opendir, readdir): Fix prototypes.
* src/editfns.c (w32_get_internal_run_time): Fix prototypes.
* src/keyboard.c (input_available_signal): Declare inside #ifdef SIGIO.
* src/ndir.h (opendir, readdir, seekdir, closedir): Fix prototypes.
(telldir): Remove declaration.
* src/ralloc.c (real_morecore, __morecore): Fix prototypes.
* src/sound.c (alsa_sound_perror): Declare inside #ifdef HAVE_ALSA.
* src/syssignal.h (strsignal): Fix prototype.
* src/term.c (tparam): Fix prototype.
(term_get_fkeys_address, term_get_fkeys_kboard, term_get_fkeys_1)
(term_get_fkeys): Set inside "#ifndef DOS_NT".
* src/vm-limit.c (check_memory_limits): Fix prototypes of real_morecore
and __morecore.
* src/w32gui.h (XParseGeometry): Fix prototype.
* src/w32heap.h (get_data_start, get_data_end, init_heap): Fix prototypes.
* src/w32term.c (my_set_focus): Declare inside #if 0.
* src/w32term.h (x_window_to_frame, x_display_info_for_name, w32_term_init)
(w32_fill_rect, w32_clear_window, init_crit, delete_crit, signal_quit)
(drain_message_queue, get_next_msg, post_msg, parse_button)
(ClipboardSequence_Proc): Fix prototypes.
(wait_for_sync): Remove declaration.
2010-07-25 00:20:51 +00:00
|
|
|
extern void seekdir (DIR *, long);
|
|
|
|
extern void closedir (DIR *);
|
1992-01-13 21:48:03 +00:00
|
|
|
|
|
|
|
#define rewinddir( dirp ) seekdir( dirp, 0L )
|