got_index_priv.h -> got_file_index_priv.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
diff --git a/lib/got_file_index_priv.h b/lib/got_file_index_priv.h
new file mode 100644
index 0000000..d1bd962
--- /dev/null
+++ b/lib/got_file_index_priv.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * State information for a tracked file in a work tree.
+ * When written to disk, multi-byte fields are written in big-endian.
+ * Some fields are based on results from stat(2). These are only used in
+ * order to detect modifications made to on-disk files, they are never
+ * applied back to the filesystem.
+ */
+struct got_file_index_entry {
+ uint64_t ctime_sec;
+ uint64_t ctime_nsec;
+ uint64_t mtime_sec;
+ uint64_t mtime_nsec;
+ uint32_t uid;
+ uint32_t gid;
+ /*
+ * On-disk size is truncated to the lower 32 bits.
+ * The value is only used to check for modifications anyway.
+ */
+ uint32_t size;
+ uint16_t mode;
+#define GOT_INDEX_ENTRY_MODE_OBJ_TYPE 0x000f
+#define GOT_INDEX_ENTRY_MODE_PERMS 0xff10
+
+ /* SHA1 of corresponding blob in repository. */
+ uint8_t blob_sha1[SHA1_DIGEST_LENGTH];
+
+ uint32_t flags;
+#define GOT_INDEX_ENTRY_F_PATH_LEN 0x00000fff
+#define GOT_INDEX_ENTRY_F_STAGE 0x00003000
+#define GOT_INDEX_ENTRY_F_EXTENDED 0x00004000
+#define GOT_INDEX_ENTRY_F_ASSUME_VALID 0x00008000
+
+ /*
+ * UNIX-style path, relative to work tree root.
+ * Variable length and NUL-padded to a multiple of 8.
+ */
+ const char *path;
+};
+
+/* "Stages" of a file which is afflicted by a 3-way merge conflict. */
+#define GOT_INDEX_ENTRY_STAGE_MERGED 0
+#define GOT_INDEX_ENTRY_STAGE_ANCESTOR 1
+#define GOT_INDEX_ENTRY_STAGE_OURS 2
+#define GOT_INDEX_ENTRY_STAGE_THEIRS 3
+
+/* On-disk file index header structure. */
+struct got_file_index_hdr {
+ uint32_t signature; /* big-endian on disk */
+ uint32_t version; /* big-endian on disk */
+ uint32_t nentries; /* big-endian on disk */
+ struct got_index_entry *entries; /* big-endian on disk */
+ uint8_t sha1[SHA1_DIGEST_LENGTH]; /* checksum of above data */
+};
diff --git a/lib/got_index_priv.h b/lib/got_index_priv.h
deleted file mode 100644
index d1bd962..0000000
--- a/lib/got_index_priv.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * State information for a tracked file in a work tree.
- * When written to disk, multi-byte fields are written in big-endian.
- * Some fields are based on results from stat(2). These are only used in
- * order to detect modifications made to on-disk files, they are never
- * applied back to the filesystem.
- */
-struct got_file_index_entry {
- uint64_t ctime_sec;
- uint64_t ctime_nsec;
- uint64_t mtime_sec;
- uint64_t mtime_nsec;
- uint32_t uid;
- uint32_t gid;
- /*
- * On-disk size is truncated to the lower 32 bits.
- * The value is only used to check for modifications anyway.
- */
- uint32_t size;
- uint16_t mode;
-#define GOT_INDEX_ENTRY_MODE_OBJ_TYPE 0x000f
-#define GOT_INDEX_ENTRY_MODE_PERMS 0xff10
-
- /* SHA1 of corresponding blob in repository. */
- uint8_t blob_sha1[SHA1_DIGEST_LENGTH];
-
- uint32_t flags;
-#define GOT_INDEX_ENTRY_F_PATH_LEN 0x00000fff
-#define GOT_INDEX_ENTRY_F_STAGE 0x00003000
-#define GOT_INDEX_ENTRY_F_EXTENDED 0x00004000
-#define GOT_INDEX_ENTRY_F_ASSUME_VALID 0x00008000
-
- /*
- * UNIX-style path, relative to work tree root.
- * Variable length and NUL-padded to a multiple of 8.
- */
- const char *path;
-};
-
-/* "Stages" of a file which is afflicted by a 3-way merge conflict. */
-#define GOT_INDEX_ENTRY_STAGE_MERGED 0
-#define GOT_INDEX_ENTRY_STAGE_ANCESTOR 1
-#define GOT_INDEX_ENTRY_STAGE_OURS 2
-#define GOT_INDEX_ENTRY_STAGE_THEIRS 3
-
-/* On-disk file index header structure. */
-struct got_file_index_hdr {
- uint32_t signature; /* big-endian on disk */
- uint32_t version; /* big-endian on disk */
- uint32_t nentries; /* big-endian on disk */
- struct got_index_entry *entries; /* big-endian on disk */
- uint8_t sha1[SHA1_DIGEST_LENGTH]; /* checksum of above data */
-};