summaryrefslogtreecommitdiff
path: root/index.h
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-07-26 17:46:54 -0300
committermrb0nk500 <b0nk@b0nk.xyz>2022-07-26 17:46:54 -0300
commit45b91d6057fc67db1491d301cf44f4f93764c783 (patch)
tree4649e17b0d569136e48ec20cc9c91a8026218e31 /index.h
parent6fec7170544009fe3ce95b0d2b7e6ab65c97922d (diff)
git, index: Move index related functions to `index.{c,h}`
Diffstat (limited to 'index.h')
-rw-r--r--index.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/index.h b/index.h
new file mode 100644
index 0000000..af0ba68
--- /dev/null
+++ b/index.h
@@ -0,0 +1,20 @@
+#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);
+
+#endif