summaryrefslogtreecommitdiff
path: root/metaentry.h
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2008-03-20 14:25:47 +0100
committerDavid Härdeman <david@hardeman.nu>2008-03-20 14:25:47 +0100
commit2d6671c648942d46522fc53c5cff2142d4572eeb (patch)
treeb329bb025ab3501a83bc8ff3030fcf07e5ab2a05 /metaentry.h
parent84e8f95743199deec9db0a87da517252af3cd6d8 (diff)
First stab at supporting the option of automatically creating empty
directories which are missing. This should help with Debian BR #460998
Diffstat (limited to 'metaentry.h')
-rw-r--r--metaentry.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/metaentry.h b/metaentry.h
index 22f061e..fe3351a 100644
--- a/metaentry.h
+++ b/metaentry.h
@@ -18,15 +18,22 @@
*
*/
+#include <stdbool.h>
+
/* 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);