From 8d1d7b7b4a48187f5849548bbc6bb543d6de33ba Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Mon, 27 Jun 2022 01:13:26 +0200 Subject: WIP native implementation --- src_c/common.h | 99 ---------------------------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 src_c/common.h (limited to 'src_c/common.h') diff --git a/src_c/common.h b/src_c/common.h deleted file mode 100644 index 5f0b976..0000000 --- a/src_c/common.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef OPCUT_COMMON_H -#define OPCUT_COMMON_H - -#include -#include -#include -#include "pool.h" - -#define OPCUT_SUCCESS 0 -#define OPCUT_ERROR 1 -#define OPCUT_UNSOLVABLE 42 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - char *data; - size_t len; -} opcut_str_t; - -typedef struct opcut_panel_t { - opcut_str_t id; - double width; - double height; - - // internal - struct opcut_panel_t *next; - double area; -} opcut_panel_t; - -typedef struct opcut_item_t { - opcut_str_t id; - double width; - double height; - bool can_rotate; - - // internal - struct opcut_item_t *next; - double area; -} opcut_item_t; - -typedef struct { - double cut_width; - bool min_initial_usage; - opcut_panel_t *panels; - opcut_item_t *items; - - // internal - opcut_pool_t *panel_pool; - opcut_pool_t *item_pool; - double panels_area; -} opcut_params_t; - -typedef struct opcut_used_t { - opcut_panel_t *panel; - opcut_item_t *item; - double x; - double y; - bool rotate; - - // internal - struct opcut_used_t *next; -} opcut_used_t; - -typedef struct opcut_unused_t { - opcut_panel_t *panel; - double width; - double height; - double x; - double y; - - // internal - struct opcut_unused_t *next; - double area; - bool initial; -} opcut_unused_t; - -typedef struct { - opcut_params_t *params; - opcut_used_t *used; - opcut_unused_t *unused; - - // internal - opcut_pool_t *used_pool; - opcut_pool_t *unused_pool; -} opcut_result_t; - - -int opcut_params_init(hat_allocator_t *a, opcut_params_t *params, - opcut_pool_t *panel_pool, opcut_pool_t *item_pool, - opcut_str_t *json); -int opcut_result_write(opcut_result_t *result, FILE *stream); - -#ifdef __cplusplus -} -#endif - -#endif -- cgit v1.2.3-70-g09d2