2020-06-17 14:51:08 +00:00
|
|
|
#ifndef WFP_IMPL_DIRBUFFER_H
|
|
|
|
#define WFP_IMPL_DIRBUFFER_H
|
2019-03-26 22:04:53 +00:00
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2020-07-10 22:17:03 +00:00
|
|
|
struct wfp_dirbuffer_entry
|
|
|
|
{
|
|
|
|
char * name;
|
|
|
|
ino_t inode;
|
|
|
|
};
|
|
|
|
|
2019-03-26 22:04:53 +00:00
|
|
|
struct wfp_dirbuffer
|
|
|
|
{
|
2020-07-10 22:17:03 +00:00
|
|
|
struct wfp_dirbuffer_entry * entries;
|
|
|
|
size_t size;
|
|
|
|
size_t capacity;
|
2019-03-26 22:04:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct wfp_dirbuffer * wfp_impl_dirbuffer_create(void);
|
|
|
|
|
|
|
|
extern void wfp_impl_dirbuffer_dispose(
|
|
|
|
struct wfp_dirbuffer * buffer);
|
|
|
|
|
|
|
|
extern void wfp_impl_dirbuffer_add(
|
|
|
|
struct wfp_dirbuffer * buffer,
|
|
|
|
char const * name,
|
|
|
|
ino_t inode);
|
|
|
|
|
2020-07-10 22:17:03 +00:00
|
|
|
extern size_t
|
|
|
|
wfp_impl_dirbuffer_size(
|
2019-03-26 22:04:53 +00:00
|
|
|
struct wfp_dirbuffer * buffer);
|
|
|
|
|
2020-07-10 22:17:03 +00:00
|
|
|
extern struct wfp_dirbuffer_entry const *
|
|
|
|
wfp_impl_dirbuffer_entry_at(
|
|
|
|
struct wfp_dirbuffer * buffer,
|
|
|
|
size_t pos);
|
2019-03-26 22:04:53 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|