Implement stringifying functions and headers

This commit is contained in:
2025-09-07 19:22:49 +01:00
parent ed9381342e
commit ea09838b46
2 changed files with 199 additions and 18 deletions

View File

@@ -7,6 +7,30 @@
#include "dbl_list.h"
#include "type_enums.h"
#ifndef CCGEN_BUF_MIN
#define CCGEN_BUF_MIN 16
#endif // !CCGEN_BUF_MIN
#ifndef CCGEN_BUF_TINY
#define CCGEN_BUF_TINY 32
#endif // !CCGEN_BUF_TINY
#ifndef CCGEN_BUF_SMALL
#define CCGEN_BUF_SMALL 512
#endif // !CCGEN_BUF_SMALL
#ifndef CCGEN_BUF_MEDIUM
#define CCGEN_BUF_MEDIUM 1024
#endif // !CCGEN_BUF_MEDIUM
#ifndef CCGEN_BUF_LARGE
#define CCGEN_BUF_LARGE 4096
#endif // !CCGEN_BUF_LARGE
#ifndef CCGEN_BUF_MAX
#define CCGEN_BUF_MAX 8192
#endif // !CCGEN_BUF_MAX
#define CENUM(NAME, VALUES, TYPEDEF) ((CEnum){ .name = (NAME), .values = (VALUES), .add_typedef = (TYPEDEF) })
#define CSTRUCT(NAME, ARGS, TYPEDEF_NAME_PTR) ((CStruct){ .name = (NAME), .args = (ARGS), .typedef_name = (TYPEDEF_NAME_PTR) })
@@ -245,7 +269,12 @@ void define_cstruct(Str8 *dst, const CStruct *cstruct);
void cusertype_to_string(Str8 *dst, const CUserType *cusertype);
void cdatatype_to_string(Str8 *dst, const CDataType *cdatatype);
void carg_to_string(Str8 *dst, const CArg *carg);
void cfunc_to_string(Str8 *dst, const CFunc *cfunc);
void declare_cfunc(Str8 *dst, const CFunc *cfunc);
void define_cfunc(Str8 *dst, const CFunc *cfunc);
void cinclude_to_string(Str8 *dst, const CInclude *cinclude);
void cheader_to_string(Str8 *dst, const CHeader *cheader);
void csource_to_string(Str8 *dst, const CSource *csource);
b32 cheaderinclude_to_string(Str8 *dst, const CHeaderInclude *cheaderinclude);
#endif // !DATATYPES_H