change GOT_INDEX_ENTRY prefix to GOT_FILEIDX
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
diff --git a/lib/fileindex.c b/lib/fileindex.c
index 3d56217..257b5a5 100644
--- a/lib/fileindex.c
+++ b/lib/fileindex.c
@@ -54,11 +54,11 @@ got_fileindex_entry_update(struct got_fileindex_entry *entry,
entry->gid = sb.st_gid;
entry->size = (sb.st_size & 0xffffffff);
if (sb.st_mode & S_IFLNK)
- entry->mode = GOT_INDEX_ENTRY_MODE_SYMLINK;
+ entry->mode = GOT_FILEIDX_MODE_SYMLINK;
else
- entry->mode = GOT_INDEX_ENTRY_MODE_REGULAR_FILE;
+ entry->mode = GOT_FILEIDX_MODE_REGULAR_FILE;
entry->mode |= ((sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) <<
- GOT_INDEX_ENTRY_MODE_PERMS_SHIFT);
+ GOT_FILEIDX_MODE_PERMS_SHIFT);
memcpy(entry->blob_sha1, blob_sha1, SHA1_DIGEST_LENGTH);
memcpy(entry->commit_sha1, commit_sha1, SHA1_DIGEST_LENGTH);
@@ -85,8 +85,8 @@ got_fileindex_entry_alloc(struct got_fileindex_entry **entry,
}
len = strlen(relpath);
- if (len > GOT_INDEX_ENTRY_F_PATH_LEN)
- len = GOT_INDEX_ENTRY_F_PATH_LEN;
+ if (len > GOT_FILEIDX_F_PATH_LEN)
+ len = GOT_FILEIDX_F_PATH_LEN;
(*entry)->flags |= len;
return got_fileindex_entry_update(*entry, ondisk_path, blob_sha1,
@@ -116,7 +116,7 @@ got_fileindex_entry_add(struct got_fileindex *fileindex,
struct got_fileindex_entry *entry)
{
/* Flag this entry until it gets written out to disk. */
- entry->flags |= GOT_INDEX_ENTRY_F_INTENT_TO_ADD;
+ entry->flags |= GOT_FILEIDX_F_INTENT_TO_ADD;
return add_entry(fileindex, entry);
}
@@ -322,7 +322,7 @@ got_fileindex_write(struct got_fileindex *fileindex, FILE *outfile)
return got_ferror(outfile, GOT_ERR_IO);
RB_FOREACH(entry, got_fileindex_tree, &fileindex->entries) {
- entry->flags &= ~GOT_INDEX_ENTRY_F_INTENT_TO_ADD;
+ entry->flags &= ~GOT_FILEIDX_F_INTENT_TO_ADD;
err = write_fileindex_entry(&ctx, entry, outfile);
if (err)
return err;
@@ -597,7 +597,7 @@ walk_fileindex(struct got_fileindex *fileindex, struct got_fileindex_entry *ie)
next = RB_NEXT(got_fileindex_tree, &fileindex->entries, ie);
/* Skip entries which were newly added by diff callbacks. */
- while (next && (next->flags & GOT_INDEX_ENTRY_F_INTENT_TO_ADD))
+ while (next && (next->flags & GOT_FILEIDX_F_INTENT_TO_ADD))
next = RB_NEXT(got_fileindex_tree, &fileindex->entries, next);
return next;
diff --git a/lib/got_lib_fileindex.h b/lib/got_lib_fileindex.h
index 3aee1d3..4a01cb9 100644
--- a/lib/got_lib_fileindex.h
+++ b/lib/got_lib_fileindex.h
@@ -36,11 +36,11 @@ struct got_fileindex_entry {
uint32_t size;
uint16_t mode;
-#define GOT_INDEX_ENTRY_MODE_FILE_TYPE 0x000f
-#define GOT_INDEX_ENTRY_MODE_REGULAR_FILE 1
-#define GOT_INDEX_ENTRY_MODE_SYMLINK 2
-#define GOT_INDEX_ENTRY_MODE_PERMS 0xff10
-#define GOT_INDEX_ENTRY_MODE_PERMS_SHIFT 4
+#define GOT_FILEIDX_MODE_FILE_TYPE 0x000f
+#define GOT_FILEIDX_MODE_REGULAR_FILE 1
+#define GOT_FILEIDX_MODE_SYMLINK 2
+#define GOT_FILEIDX_MODE_PERMS 0xff10
+#define GOT_FILEIDX_MODE_PERMS_SHIFT 4
/* SHA1 of corresponding blob in repository. */
uint8_t blob_sha1[SHA1_DIGEST_LENGTH];
@@ -49,11 +49,11 @@ struct got_fileindex_entry {
uint8_t commit_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
-#define GOT_INDEX_ENTRY_F_INTENT_TO_ADD 0x20000000
+#define GOT_FILEIDX_F_PATH_LEN 0x00000fff
+#define GOT_FILEIDX_F_STAGE 0x00003000
+#define GOT_FILEIDX_F_EXTENDED 0x00004000
+#define GOT_FILEIDX_F_ASSUME_VALID 0x00008000
+#define GOT_FILEIDX_F_INTENT_TO_ADD 0x20000000
/*
* UNIX-style path, relative to work tree root.
@@ -65,10 +65,10 @@ struct got_fileindex_entry {
};
/* "Stages" of a file 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
+#define GOT_FILEIDX_STAGE_MERGED 0
+#define GOT_FILEIDX_STAGE_ANCESTOR 1
+#define GOT_FILEIDX_STAGE_OURS 2
+#define GOT_FILEIDX_STAGE_THEIRS 3
struct got_fileindex;