summaryrefslogtreecommitdiff
path: root/index.h
blob: 4b37534c7b54e1c51101549b9f407c6a095ae52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef INDEX_H
#define INDEX_H

#include <stdint.h>

typedef struct index index;

struct index {
	uint8_t type;		/* Index type. (0 = Named index, 1 = Numbered index) */
	union {
		char *name;	/* Named index. */
		uint64_t num;	/* Numbered index. */
	};
	index *next;		/* Next index. */
};

extern int is_valid_index(index *idx);
extern char *make_index_path(const char *root, index *idx, int path_type);
extern char *index_to_str(index *idx);
extern int index_path_exists(index *idx, const char *root, char **path);

#endif