diff options
author | Ben Brewer <ben.brewer@codethink.co.uk> | 2014-06-04 16:57:00 +0100 |
---|---|---|
committer | Ben Brewer <ben.brewer@codethink.co.uk> | 2014-06-04 16:57:00 +0100 |
commit | 0b9a35045c6fb7baa7a2b29408c2df9017111432 (patch) | |
tree | 899dc8dee7ef09aa38b9341a1a2a5421102f31ac /tbdiff/tbdiff-stat.h | |
parent | 20d5fb340c6ad1e7b16c6dc17e3f6c364a5a5515 (diff) | |
parent | 1de58f93e1b19442d40badde4b68fc34bb08f386 (diff) | |
download | tbdiff-0b9a35045c6fb7baa7a2b29408c2df9017111432.tar.gz |
Merge branch 'baserock/benbrewer/post-overhaul-v2'
Reviewed-by: Michael Drake
Reviewed-by: Richard Maw
Diffstat (limited to 'tbdiff/tbdiff-stat.h')
-rw-r--r-- | tbdiff/tbdiff-stat.h | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/tbdiff/tbdiff-stat.h b/tbdiff/tbdiff-stat.h index 22da466..5f9af83 100644 --- a/tbdiff/tbdiff-stat.h +++ b/tbdiff/tbdiff-stat.h @@ -27,7 +27,7 @@ #include <stdbool.h> #include <sys/types.h> -typedef enum { +enum tbd_stat_type { TBD_STAT_TYPE_FILE = 'f', TBD_STAT_TYPE_DIR = 'd', TBD_STAT_TYPE_SYMLINK = 'l', @@ -35,30 +35,26 @@ typedef enum { TBD_STAT_TYPE_BLKDEV = 'b', TBD_STAT_TYPE_FIFO = 'p', TBD_STAT_TYPE_SOCKET = 's' -} tbd_stat_type_e; - -typedef struct tbd_stat_s tbd_stat_t; +}; -struct tbd_stat_s { - tbd_stat_t* parent; - char* name; - tbd_stat_type_e type; - time_t mtime; - uint32_t size; /* Count for directory. */ - uid_t uid; - gid_t gid; - mode_t mode; - uint32_t rdev; +struct tbd_stat { + struct tbd_stat* parent; + char* name; + enum tbd_stat_type type; + time_t mtime; + uint32_t size; /* Count for directory. */ + uid_t uid; + gid_t gid; + mode_t mode; + uint32_t rdev; }; -extern tbd_stat_t* tbd_stat(const char *path); -extern void tbd_stat_free(tbd_stat_t *file); -extern void tbd_stat_print(tbd_stat_t *file); -extern tbd_stat_t* tbd_stat_entry(tbd_stat_t *file, uint32_t entry); -extern tbd_stat_t* tbd_stat_entry_find(tbd_stat_t *file, const char *name); -extern char* tbd_stat_subpath(tbd_stat_t *file, const char *entry); -extern char* tbd_stat_path(tbd_stat_t *file); -extern int tbd_stat_open(tbd_stat_t *file, int flags); -extern FILE* tbd_stat_fopen(tbd_stat_t *file, const char *mode); +struct tbd_stat* tbd_stat(const char *path); +void tbd_stat_free(struct tbd_stat *file); +struct tbd_stat* tbd_stat_entry(struct tbd_stat *file, uint32_t entry); +struct tbd_stat* tbd_stat_entry_find(struct tbd_stat *file, const char *name); +char* tbd_statubpath(struct tbd_stat *file, const char *entry); +char* tbd_stat_path(struct tbd_stat *file); +int tbd_stat_open(struct tbd_stat *file, int flags); #endif /* !__TBDIFF_STAT_H__ */ |