mirror of
https://github.com/fscotto/fsnap.git
synced 2026-11-26 03:09:51 +00:00
Extract snapshot parser into a reusable types module
Splits RecordObject, unpack, release, field and field_name out of list.c into types.c/types.h; declares field extern in the header with a single definition in types.c; adds src/types.c to SOURCES.
This commit is contained in:
23
include/types.h
Normal file
23
include/types.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef TYPE_H
|
||||
#define TYPE_H
|
||||
|
||||
enum Fields {
|
||||
FILE_TYPE,
|
||||
PERMISSIONS,
|
||||
UID,
|
||||
GID,
|
||||
SIZE,
|
||||
TIME,
|
||||
PATH,
|
||||
NONE,
|
||||
};
|
||||
|
||||
extern enum Fields field;
|
||||
|
||||
const char *field_name(enum Fields f);
|
||||
|
||||
struct RecordObject;
|
||||
struct RecordObject *unpack(char *s);
|
||||
int release(struct RecordObject *obj);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user