breaking changes in type system

This commit is contained in:
2023-02-13 00:34:32 +06:00
parent 305854e721
commit 95fec8d166
48 changed files with 704 additions and 608 deletions

View File

@@ -1,8 +1,6 @@
#include "StringBuilder.h"
Autoarr_define(string)
ktid_define(StringBuilder);
kt_define(StringBuilder, __StringBuilder_free, NULL);
#define BL_C 32
#define BL_L 1024

View File

@@ -7,13 +7,10 @@ extern "C" {
#include "../Autoarr/Autoarr.h"
#include "string.h"
Autoarr_declare(string)
typedef struct StringBuilder{
STRUCT(StringBuilder,
Autoarr(string)* compl_bufs;
Autoarr(i8)* curr_buf;
} StringBuilder;
ktid_declare(StringBuilder);
)
StringBuilder* StringBuilder_create(void);
void StringBuilder_free(StringBuilder* b);

View File

@@ -1,7 +1,8 @@
#include "string.h"
ktid_define(string);
Array_define(string);
kt_define(string, NULL, NULL);
Array_define(string)
Autoarr_define(string)
// copies str content to new char pointer value (adding '\0' at the end)
char* string_extract(string str){

View File

@@ -6,15 +6,17 @@ extern "C" {
#include "../base/base.h"
#include "../Array/Array.h"
#include "../Autoarr/Autoarr.h"
// my fixed length string struct
// doesn't store '\0' at the end
typedef struct string{
STRUCT(string,
char* ptr; // char pointer
u64 length; // amount of chars in ptr value
} string;
ktid_declare(string);
Array_declare(string);
)
Array_declare(string)
Autoarr_declare(string)
static const string stringNull={NULL,0};