aboutgitcodelistschat:MatrixIRC
path: root/cooker/cooker.h
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-03-28 16:48:58 +0200
committerAlice Frosi <afrosi@redhat.com>2023-03-28 17:05:54 +0200
commitb6c964fb5a00c8b8ab26a4678cdde24c3e9b1d9c (patch)
tree55449680aa735b529600b2b7927e160944685697 /cooker/cooker.h
parent21c4730f0cb020db3bdff22e347a52d012cc79fe (diff)
downloadseitan-b6c964fb5a00c8b8ab26a4678cdde24c3e9b1d9c.tar
seitan-b6c964fb5a00c8b8ab26a4678cdde24c3e9b1d9c.tar.gz
seitan-b6c964fb5a00c8b8ab26a4678cdde24c3e9b1d9c.tar.bz2
seitan-b6c964fb5a00c8b8ab26a4678cdde24c3e9b1d9c.tar.lz
seitan-b6c964fb5a00c8b8ab26a4678cdde24c3e9b1d9c.tar.xz
seitan-b6c964fb5a00c8b8ab26a4678cdde24c3e9b1d9c.tar.zst
seitan-b6c964fb5a00c8b8ab26a4678cdde24c3e9b1d9c.zip
Rename cooker and eater with seitan prefix
Diffstat (limited to 'cooker/cooker.h')
-rw-r--r--cooker/cooker.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/cooker/cooker.h b/cooker/cooker.h
new file mode 100644
index 0000000..53aa0db
--- /dev/null
+++ b/cooker/cooker.h
@@ -0,0 +1,99 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * Copyright 2023 Red Hat GmbH
+ * Author: Stefano Brivio <sbrivio@redhat.com>
+ */
+
+#ifndef COOKER_H
+#define COOKER_H
+
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define REFS_MAX 256
+#define CALL_ARGS 6
+
+struct arg_num;
+struct arg_struct;
+struct arg_select;
+
+union arg_value {
+ struct arg_num *d_num;
+ struct arg_struct *d_struct;
+ struct arg_select *d_select;
+};
+
+enum arg_type {
+ ARG_INT,
+ ARG_INTMASK,
+ ARG_INTFLAGS,
+
+ ARG_U32,
+ ARG_U32MASK,
+ ARG_U32FLAGS,
+
+ ARG_LONG,
+ ARG_LONGMASK,
+ ARG_LONGFLAGS,
+
+ ARG_STRING,
+
+ ARG_STRUCT,
+ ARG_SELECT,
+
+ ARG_PID,
+
+ ARG_PORT,
+ ARG_IPV4,
+ ARG_IPV6,
+
+ ARG_FDPATH,
+
+ ARG_TYPE_END,
+};
+
+#define ARG_TYPE_COUNT (ARG_TYPE_END - 1)
+
+struct arg_num {
+ char *name;
+ long long value;
+};
+
+struct arg_struct {
+ char *name;
+ enum arg_type type;
+ size_t offset;
+
+ size_t strlen;
+
+ union arg_value desc;
+};
+
+struct arg_select_num {
+ long long value;
+
+ enum arg_type type;
+ union arg_value desc;
+};
+
+struct arg_select {
+ struct arg_struct *field;
+
+ union {
+ struct arg_select_num *d_num;
+ } desc;
+};
+
+struct arg {
+ int pos;
+ char *name;
+
+ enum arg_type type;
+ size_t size;
+
+ union arg_value desc;
+};
+
+#endif /* COOKER_H */