summaryrefslogtreecommitdiff
path: root/lib/decoder_ipc_layout.h
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-10-09 14:12:49 +0200
committerChristoph Berg <myon@debian.org>2026-10-09 14:12:49 +0200
commit76956486fa7ef52a51d4e56df1e13a9f19a6c93c (patch)
treefe0c394439fdc167d1970372e8998874090854dd /lib/decoder_ipc_layout.h
parent0685fcada9f95fe90f70b387cd7d757da8209624 (diff)
parentffc62c792c9a5196cb4ce7a353287dfe20db6524 (diff)
Update upstream source from tag 'upstream/3.3.0_beta1+dfsg'
Update to upstream version '3.3.0~beta1+dfsg' with Debian dir 85037bbb9376721108594b59b54ead82ac6924a3
Diffstat (limited to 'lib/decoder_ipc_layout.h')
-rw-r--r--lib/decoder_ipc_layout.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/lib/decoder_ipc_layout.h b/lib/decoder_ipc_layout.h
new file mode 100644
index 00000000..d1a144fc
--- /dev/null
+++ b/lib/decoder_ipc_layout.h
@@ -0,0 +1,69 @@
+#ifndef DECODER_IPC_LAYOUT_H
+#define DECODER_IPC_LAYOUT_H
+
+#include <stddef.h>
+
+#define DECODER_IPC_LAYOUT_MAGIC 0x57534a54
+#define DECODER_IPC_ENDIAN_MARKER 0x01020304
+#define DECODER_IPC_CAP_GENERATIONS 1
+#define DECODER_IPC_CAP_PROGRESS 2
+#define DECODER_IPC_CAP_HANDSHAKE 4
+#define DECODER_IPC_CAPABILITIES 7
+#define DECODER_IPC_LAYOUT_FIELDS 96
+
+typedef struct decoder_ipc_field_layout {
+ int offset;
+ int bytes;
+} decoder_ipc_field_layout_t;
+
+typedef struct decoder_ipc_layout {
+ int magic;
+ int protocol_version;
+ int header_bytes;
+ int payload_bytes;
+ int logical_bytes;
+ int payload_offset;
+ int capabilities;
+ int int_bytes;
+ int short_bytes;
+ int float_bytes;
+ int bool_bytes;
+ int char_bytes;
+ int endian_marker;
+ int field_count;
+ decoder_ipc_field_layout_t fields[DECODER_IPC_LAYOUT_FIELDS];
+} decoder_ipc_layout_t;
+
+enum decoder_ipc_layout_status {
+ DECODER_IPC_LAYOUT_OK = 0,
+ DECODER_IPC_LAYOUT_NULL = 1,
+ DECODER_IPC_LAYOUT_TRUNCATED = 2,
+ DECODER_IPC_LAYOUT_ALIGNMENT = 3,
+ DECODER_IPC_LAYOUT_VERSION = 4,
+ DECODER_IPC_LAYOUT_HEADER_SIZE = 5,
+ DECODER_IPC_LAYOUT_PAYLOAD_SIZE = 6,
+ DECODER_IPC_LAYOUT_MISMATCH = 7,
+ DECODER_IPC_LAYOUT_CAPABILITIES = 8,
+ DECODER_IPC_LAYOUT_STATE = 9,
+ DECODER_IPC_LAYOUT_LOGICAL_SIZE = 10,
+ DECODER_IPC_LAYOUT_ATTACH = 11
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void decoder_ipc_expected_layout (decoder_ipc_layout_t * layout);
+int decoder_ipc_validate_layout (void const * storage, size_t available_bytes,
+ decoder_ipc_layout_t const * peer_layout);
+char const * decoder_ipc_layout_status_name (int status);
+void decoder_ipc_report_layout_error (int status, void const * storage,
+ size_t available_bytes);
+void decoder_ipc_fortran_layout (decoder_ipc_layout_t * layout);
+int decoder_ipc_fortran_validate (void const * storage, size_t available_bytes);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif