From 2d6671c648942d46522fc53c5cff2142d4572eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=C3=A4rdeman?= Date: Thu, 20 Mar 2008 14:25:47 +0100 Subject: First stab at supporting the option of automatically creating empty directories which are missing. This should help with Debian BR #460998 --- metaentry.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'metaentry.h') diff --git a/metaentry.h b/metaentry.h index 22f061e..fe3351a 100644 --- a/metaentry.h +++ b/metaentry.h @@ -18,15 +18,22 @@ * */ +#include + /* Data structure to hold all metadata for a file/dir */ struct metaentry { - struct metaentry *next; + struct metaentry *next; /* For the metahash chains */ + struct metaentry *list; /* For creating additional lists of entries */ + char *path; + unsigned int pathlen; + char *owner; char *group; mode_t mode; time_t mtime; long mtimensec; + unsigned int xattrs; char **xattr_names; ssize_t *xattr_lvalues; @@ -41,6 +48,9 @@ struct metahash { unsigned int count; }; +/* Create a metaentry for the file/dir/etc at path */ +struct metaentry *mentry_create(const char *path); + /* Recurses opath and adds metadata entries to the metaentry list */ void mentries_recurse_path(const char *opath, struct metahash **mhash); @@ -65,11 +75,16 @@ int mentry_find_xattr(struct metaentry *haystack, #define DIFF_ADDED 0x40 #define DIFF_DELE 0x80 +/* Compares two metaentries and returns an int with a bitmask of differences */ +int mentry_compare(struct metaentry *left, + struct metaentry *right, + bool do_mtime); + /* Compares lists of real and stored metadata and calls pfunc for each */ void mentries_compare(struct metahash *mhashreal, struct metahash *mhashstored, void (*pfunc)(struct metaentry *real, struct metaentry *stored, int cmp), - int do_mtime); + bool do_mtime); -- cgit v1.2.1