diff --git a/include/types.h b/include/types.h index 74a3f3f..e6549a7 100644 --- a/include/types.h +++ b/include/types.h @@ -1,5 +1,5 @@ -#ifndef TYPE_H -#define TYPE_H +#ifndef TYPES_H +#define TYPES_H #include #include @@ -19,7 +19,7 @@ enum Fields { extern enum Fields field; -const char *FieldName(enum Fields f); +const char *RecordObjectFieldName(enum Fields f); struct RecordObject; diff --git a/include/walk.h b/include/walk.h index 13ac5cf..bfd08c8 100644 --- a/include/walk.h +++ b/include/walk.h @@ -1,8 +1,8 @@ #ifndef WALK_H #define WALK_H -typedef int(*operation)(const char *, void *); +typedef int(*WalkOp)(const char *, void *); -int walk(const char *directory, operation op, void *context); +int walk(const char *directory, WalkOp op, void *context); #endif diff --git a/src/list.c b/src/list.c index 22de0d2..907704a 100644 --- a/src/list.c +++ b/src/list.c @@ -40,7 +40,7 @@ int list(const char *snapshot) { } int ret = RecordObjectUnpack(objp, buf); if (field != NONE) { - fprintf(stderr, "%s:%d: invalid %s\n", snapshot, i + 1, FieldName(field)); + fprintf(stderr, "%s:%d: invalid %s\n", snapshot, i + 1, RecordObjectFieldName(field)); rc = 128; RecordObjectRelease(objp); break; diff --git a/src/types.c b/src/types.c index 8dca42c..e706060 100644 --- a/src/types.c +++ b/src/types.c @@ -20,7 +20,7 @@ static const char *field_names[] = { "file type", "permissions", "uid", "gid", "size", "time", "target", "fingerprint", "path", "none"}; -const char *FieldName(enum Fields f) { +const char *RecordObjectFieldName(enum Fields f) { return (f <= NONE) ? field_names[f] : "unknown"; } diff --git a/src/walk.c b/src/walk.c index 14a13b4..b275979 100644 --- a/src/walk.c +++ b/src/walk.c @@ -18,7 +18,7 @@ static int ignore_file(const char *name) { return 0; } -static int handle_unknown(const char *path, operation op, void *context) { +static int handle_unknown(const char *path, WalkOp op, void *context) { struct stat st; if (lstat(path, &st) == -1) { @@ -36,7 +36,7 @@ static int handle_unknown(const char *path, operation op, void *context) { return 0; } -int walk(const char *directory, operation op, void *context) { +int walk(const char *directory, WalkOp op, void *context) { errno = 0; DIR *dirp = opendir(directory); if (dirp == NULL) {