diff options
| author | rajdakin <rajdakin@gmail.com> | 2024-09-06 15:07:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-06 15:07:38 +0200 |
| commit | 6044feb7fd58ff69f63f5418f516b1f3ded346e9 (patch) | |
| tree | 9935288f145df5b80f6d118c8a487b0a10afb1e8 /wrapperhelper/src/generator.h | |
| parent | 7dc59ac342d315dbb352becbeabc4e7057992de0 (diff) | |
| download | box64-6044feb7fd58ff69f63f5418f516b1f3ded346e9.tar.gz box64-6044feb7fd58ff69f63f5418f516b1f3ded346e9.zip | |
Wrapper helper (#1799)
* [WRAPPERHELPER] Added wrapperhelper v0.1, tested on libc * [WRAPPED] Removed updates to libc from this branch * [WRAPPERHELPER] Removed GPL header and added modified LGPL header, added notes about licensing issues
Diffstat (limited to 'wrapperhelper/src/generator.h')
| -rw-r--r-- | wrapperhelper/src/generator.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/wrapperhelper/src/generator.h b/wrapperhelper/src/generator.h new file mode 100644 index 00000000..ef27ad0a --- /dev/null +++ b/wrapperhelper/src/generator.h @@ -0,0 +1,50 @@ +#pragma once + +#ifndef GENERATOR_H +#define GENERATOR_H + +#include <stdio.h> + +#include "cstring.h" +#include "lang.h" + +typedef struct request_s { + string_t *obj_name; + _Bool has_default, default_comment; + _Bool has_val; + _Bool weak; + struct { + enum request_type_e { + RQT_FUN, + RQT_FUN_2, + RQT_FUN_MY, + RQT_FUN_D, + + RQT_DATA, + RQT_DATAV, + RQT_DATAB, + RQT_DATAM, + } rty; + union { + struct { + string_t *typ; + string_t *fun2; + } fun; + struct { + int has_size; + size_t sz; + } dat; + }; + } def, val; +} request_t; +VECTOR_DECLARE(requests, request_t) +void request_print(request_t *req); +void request_print_check(request_t *req); +void output_from_requests(FILE *f, VECTOR(requests) *reqs); + +VECTOR(requests) *requests_from_file(const char *filename, FILE *f); // Takes ownership of f +int solve_request(request_t *req, type_t *typ); +int solve_request_map(request_t *req, khash_t(type_map) *decl_map); +int solve_requests(VECTOR(requests) *reqs, khash_t(type_map) *decl_map); + +#endif // GENERATOR_H |