am 3de1121e: Merge "Refresh header byteswap.h and dirent.h"

* commit '3de1121e22d78b2ab22f57a392e7204ed073907f':
  Refresh header byteswap.h and dirent.h
This commit is contained in:
Andrew Hsieh
2012-11-21 08:28:29 -08:00
committed by Android Git Automerger
2 changed files with 21 additions and 19 deletions

View File

@@ -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)

View File

@@ -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