shorten imsg type names, and introduce a separate object structure
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
diff --git a/lib/got_lib_privsep.h b/lib/got_lib_privsep.h
index dc24c06..3ce39ee 100644
--- a/lib/got_lib_privsep.h
+++ b/lib/got_lib_privsep.h
@@ -46,20 +46,20 @@ enum got_imsg_type {
* separate process which runs under pledge("stdio").
* This sandboxes our own repository parsing code, as well as zlib.
*/
- GOT_IMSG_READ_LOOSE_OBJECT_HEADER_REQUEST,
- GOT_IMSG_READ_LOOSE_OBJECT_HEADER_REPLY,
- GOT_IMSG_READ_LOOSE_BLOB_OBJECT_REQUEST,
- GOT_IMSG_READ_LOOSE_BLOB_OBJECT_REPLY,
- GOT_IMSG_READ_LOOSE_TREE_OBJECT_REQUEST,
- GOT_IMSG_READ_LOOSE_TREE_OBJECT_REPLY,
- GOT_IMSG_READ_LOOSE_COMMIT_OBJECT_REQUEST,
- GOT_IMSG_READ_LOOSE_COMMIT_OBJECT_REPLY,
- GOT_IMSG_READ_PACKED_BLOB_OBJECT_REQUEST,
- GOT_IMSG_READ_PACKED_BLOB_OBJECT_REPLY,
- GOT_IMSG_READ_PACKED_TREE_OBJECT_REQUEST,
- GOT_IMSG_READ_PACKED_TREE_OBJECT_REPLY,
- GOT_IMSG_READ_PACKED_COMMIT_OBJECT_REQUEST,
- GOT_IMSG_READ_PACKED_COMMIT_OBJECT_REPLY
+ GOT_IMSG_LOOSE_OBJECT_HEADER_REQUEST,
+ GOT_IMSG_LOOSE_OBJECT_HEADER_REPLY,
+ GOT_IMSG_LOOSE_BLOB_OBJECT_REQUEST,
+ GOT_IMSG_LOOSE_BLOB_OBJECT_REPLY,
+ GOT_IMSG_LOOSE_TREE_OBJECT_REQUEST,
+ GOT_IMSG_LOOSE_TREE_OBJECT_REPLY,
+ GOT_IMSG_LOOSE_COMMIT_OBJECT_REQUEST,
+ GOT_IMSG_LOOSE_COMMIT_OBJECT_REPLY,
+ GOT_IMSG_PACKED_BLOB_OBJECT_REQUEST,
+ GOT_IMSG_PACKED_BLOB_OBJECT_REPLY,
+ GOT_IMSG_PACKED_TREE_OBJECT_REQUEST,
+ GOT_IMSG_PACKED_TREE_OBJECT_REPLY,
+ GOT_IMSG_PACKED_COMMIT_OBJECT_REQUEST,
+ GOT_IMSG_PACKED_COMMIT_OBJECT_REPLY
};
/* Structure for GOT_IMSG_ERROR. */
@@ -91,16 +91,16 @@ struct got_imsg_delta_stream {
*/
};
-/* Structure for GOT_IMSG_READ_LOOSE_OBJECT_HEADER_REQUEST data. */
-struct got_imsg_read_loose_object_header_request {
+/* Structure for GOT_IMSG_LOOSE_OBJECT_HEADER_REQUEST data. */
+struct got_imsg_loose_object_header_request {
/*
* Empty since the following is implied: If imsg fd == -1 then
* read raw object data from imsg buffer, else read from fd.
*/
};
-/* Structure for GOT_IMSG_READ_LOOSE_OBJECT_HEADER_REPLY data. */
-struct got_imsg_read_loose_object_header_reply {
+/* Structure for transmitting struct got_object data in an imsg. */
+struct got_imsg_object {
/* These fields are the same as in struct got_object. */
int type;
int flags;
@@ -111,4 +111,9 @@ struct got_imsg_read_loose_object_header_reply {
int ndeltas; /* this many GOT_IMSG_DELTA messages follow */
};
+/* Structure for GOT_IMSG_LOOSE_OBJECT_HEADER_REPLY data. */
+struct got_imsg_loose_object_header_reply {
+ struct got_imsg_object iobj;
+};
+
/* TODO: Implement the above, and then add more message data types here. */