Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/gen/telldir.h
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
* One of these structures is malloced to describe the current directory | * One of these structures is malloced to describe the current directory | ||||
* position each time telldir is called. It records the current magic | * position each time telldir is called. It records the current magic | ||||
* cookie returned by getdirentries and the offset within the buffer | * cookie returned by getdirentries and the offset within the buffer | ||||
* associated with that return value. | * associated with that return value. | ||||
*/ | */ | ||||
struct ddloc { | struct ddloc { | ||||
LIST_ENTRY(ddloc) loc_lqe; /* entry in list */ | LIST_ENTRY(ddloc) loc_lqe; /* entry in list */ | ||||
long loc_index; /* key associated with structure */ | long loc_index; /* key associated with structure */ | ||||
long loc_seek; /* magic cookie returned by getdirentries */ | off_t loc_seek; /* magic cookie returned by getdirentries */ | ||||
long loc_loc; /* offset of entry in buffer */ | long loc_loc; /* offset of entry in buffer */ | ||||
}; | }; | ||||
/* | /* | ||||
* One of these structures is malloced for each DIR to record telldir | * One of these structures is malloced for each DIR to record telldir | ||||
* positions. | * positions. | ||||
*/ | */ | ||||
struct _telldir { | struct _telldir { | ||||
LIST_HEAD(, ddloc) td_locq; /* list of locations */ | LIST_HEAD(, ddloc) td_locq; /* list of locations */ | ||||
long td_loccnt; /* index of entry for sequential readdir's */ | long td_loccnt; /* index of entry for sequential readdir's */ | ||||
}; | }; | ||||
bool _filldir(DIR *, bool); | bool _filldir(DIR *, bool); | ||||
struct dirent *_readdir_unlocked(DIR *, int); | struct dirent *_readdir_unlocked(DIR *, int); | ||||
void _reclaim_telldir(DIR *); | void _reclaim_telldir(DIR *); | ||||
void _seekdir(DIR *, long); | void _seekdir(DIR *, long); | ||||
void _fixtelldir(DIR *dirp, long oldseek, long oldloc); | void _fixtelldir(DIR *dirp, long oldseek, long oldloc); | ||||
#define RDU_SKIP 0x0001 | |||||
#define RDU_SHORT 0x0002 | |||||
#endif | #endif |