Merge "Refresh header byteswap.h and dirent.h"
This commit is contained in:
@@ -28,7 +28,8 @@
|
|||||||
#ifndef _BYTESWAP_H_
|
#ifndef _BYTESWAP_H_
|
||||||
#define _BYTESWAP_H_
|
#define _BYTESWAP_H_
|
||||||
|
|
||||||
#include <sys/endian.h>
|
/* endian.h rather than sys/endian.h so we get the machine-specific file. */
|
||||||
|
#include <endian.h>
|
||||||
|
|
||||||
#define bswap_16(x) swap16(x)
|
#define bswap_16(x) swap16(x)
|
||||||
#define bswap_32(x) swap32(x)
|
#define bswap_32(x) swap32(x)
|
||||||
|
|||||||
@@ -51,28 +51,29 @@ __BEGIN_DECLS
|
|||||||
* who assume to be able to access it directly. sad...
|
* who assume to be able to access it directly. sad...
|
||||||
*/
|
*/
|
||||||
struct dirent {
|
struct dirent {
|
||||||
uint64_t d_ino;
|
uint64_t d_ino;
|
||||||
int64_t d_off;
|
int64_t d_off;
|
||||||
unsigned short d_reclen;
|
unsigned short d_reclen;
|
||||||
unsigned char d_type;
|
unsigned char d_type;
|
||||||
char d_name[256];
|
char d_name[256];
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct DIR DIR;
|
typedef struct DIR DIR;
|
||||||
|
|
||||||
|
extern DIR* opendir(const char* dirpath);
|
||||||
|
extern DIR* fdopendir(int fd);
|
||||||
|
extern struct dirent* readdir(DIR* dirp);
|
||||||
|
extern int readdir_r(DIR* dirp, struct dirent* entry, struct dirent** result);
|
||||||
|
extern int closedir(DIR* dirp);
|
||||||
|
extern void rewinddir(DIR* dirp);
|
||||||
|
extern int dirfd(DIR* dirp);
|
||||||
|
extern int alphasort(const struct dirent** a, const struct dirent** b);
|
||||||
|
extern int scandir(const char* dir, struct dirent*** namelist,
|
||||||
|
int(*filter)(const struct dirent*),
|
||||||
|
int(*compar)(const struct dirent**,
|
||||||
|
const struct dirent**));
|
||||||
|
|
||||||
extern int getdents(unsigned int, struct dirent*, unsigned int);
|
extern int getdents(unsigned int, struct dirent*, unsigned int);
|
||||||
extern DIR* opendir(const char* dirpath);
|
|
||||||
extern DIR* fdopendir(int fd);
|
|
||||||
extern struct dirent* readdir(DIR* dirp);
|
|
||||||
extern int readdir_r(DIR* dirp, struct dirent *entry, struct dirent **result);
|
|
||||||
extern int closedir(DIR* dirp);
|
|
||||||
extern void rewinddir(DIR *dirp);
|
|
||||||
extern int dirfd(DIR* dirp);
|
|
||||||
extern int alphasort(const void *a, const void *b);
|
|
||||||
extern int scandir(const char *dir, struct dirent ***namelist,
|
|
||||||
int(*filter)(const struct dirent *),
|
|
||||||
int(*compar)(const struct dirent **,
|
|
||||||
const struct dirent **));
|
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user