aboutsummaryrefslogtreecommitdiff
path: root/src_c/common.h
diff options
context:
space:
mode:
authorbozo.kopic <bozo@kopic.xyz>2021-12-22 19:35:48 +0100
committerbozo.kopic <bozo@kopic.xyz>2021-12-22 19:35:48 +0100
commit1a19c238e3741931db9e61b6a0b79259b5ed0753 (patch)
tree7e5d705e423583188b346bbb7e7486f808b66bc8 /src_c/common.h
parent923e73a50320792bbedb945b45c54dab12d44708 (diff)
WIP c implementation
Diffstat (limited to 'src_c/common.h')
-rw-r--r--src_c/common.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src_c/common.h b/src_c/common.h
index 16aeb9b..42fed63 100644
--- a/src_c/common.h
+++ b/src_c/common.h
@@ -8,6 +8,21 @@
#define OPCUT_ERROR 1
#define OPCUT_UNSOLVABLE 2
+#define OPCUT_STR_EMPTY ((opcut_str_t){.data = NULL, .len = 0})
+#define OPCUT_PARAMS_EMPTY \
+ ((opcut_params_t){.cut_width = 0, \
+ .min_initial_usage = false, \
+ .panels = NULL, \
+ .panels_len = 0, \
+ .items = NULL, \
+ .items_len = 0})
+#define OPCUT_RESULT_EMPTY \
+ ((opcut_result_t){.params = NULL, \
+ .used = NULL, \
+ .used_len = 0, \
+ .unused = NULL, \
+ .unused_len = 0})
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -64,10 +79,14 @@ typedef struct {
} opcut_result_t;
+int opcut_str_resize(opcut_str_t *str, size_t size);
int opcut_params_init(opcut_params_t *params, opcut_str_t *json);
-void opcut_params_destroy(opcut_params_t *params);
int opcut_result_write(opcut_result_t *result, FILE *stream);
+void opcut_str_destroy(opcut_str_t *str);
+void opcut_params_destroy(opcut_params_t *params);
+void opcut_result_destroy(opcut_result_t *result);
+
#ifdef __cplusplus
}
#endif