#ifndef INDEX_H #define INDEX_H #include typedef struct index index_t; struct index { uint8_t type; /* Index type. (0 = Named index, 1 = Numbered index) */ union { char *name; /* Named index. */ uint64_t num; /* Numbered index. */ }; index_t *next; /* Next index. */ }; extern int is_valid_index(index_t *idx); extern char *make_index_path(const char *root, index_t *idx, int path_type); extern char *index_to_str(index_t *idx); extern int index_path_exists(index_t *idx, const char *root, char **path); #endif