Update code generation to create one file for dbl_list

This commit is contained in:
2025-04-19 13:33:09 +01:00
parent 3c32b247c0
commit 63ed2633ea
11 changed files with 105 additions and 70 deletions

View File

@@ -2,15 +2,13 @@
* THIS FILE IS AUTOMATICALLY GENERATED. ANY MODIFICATIONS TO IT WILL BE OVERWRITTEN
*/
#include "./str8_list.h"
#include "../../../common/aliases/aliases.h"
#include "./dbl_list.h"
#include "../../common/aliases/aliases.h"
#include <stddef.h>
internal Str8List str8_node_to_list(Str8Node *node);
typedef struct str8 Str8;
Str8Node wapp_str8_list_node(Str8 *item) {
return (Str8Node){.item = item};
}
internal Str8List str8_node_to_list(Str8Node *node);
Str8Node *wapp_str8_list_get(const Str8List *list, u64 index) {
if (index >= list->node_count) {

View File

@@ -2,15 +2,17 @@
* THIS FILE IS AUTOMATICALLY GENERATED. ANY MODIFICATIONS TO IT WILL BE OVERWRITTEN
*/
#ifndef STR8_LIST_H
#define STR8_LIST_H
#ifndef DBL_LIST_H
#define DBL_LIST_H
#include "../../../common/aliases/aliases.h"
#include "../../common/aliases/aliases.h"
#ifdef __cplusplus
BEGIN_C_LINKAGE
#endif // !__cplusplus
#define wapp_str8_list_node(ITEM_PTR) ((Str8Node){.item = ITEM_PTR})
typedef struct str8 Str8;
typedef struct Str8Node Str8Node;
@@ -27,7 +29,6 @@ struct Str8List {
u64 node_count;
};
Str8Node wapp_str8_list_node(Str8 *item);
Str8Node *wapp_str8_list_get(const Str8List *list, u64 index);
void wapp_str8_list_push_front(Str8List *list, Str8Node *node);
void wapp_str8_list_push_back(Str8List *list, Str8Node *node);
@@ -41,4 +42,4 @@ void wapp_str8_list_empty(Str8List *list);
END_C_LINKAGE
#endif // !__cplusplus
#endif // !STR8_LIST_H
#endif // !DBL_LIST_H

View File

@@ -0,0 +1,6 @@
#ifndef WAPP_CONTAINERS_C
#define WAPP_CONTAINERS_C
#include "dbl_list/dbl_list.c"
#endif // !WAPP_CONTAINERS_C

View File

@@ -0,0 +1,7 @@
#ifndef WAPP_CONTAINERS_H
#define WAPP_CONTAINERS_H
#include "dbl_list/dbl_list.h"
#include "../common/wapp_common.h"
#endif // !WAPP_CONTAINERS_H

View File

@@ -1,8 +1,8 @@
#ifndef STR8_H
#define STR8_H
#include "./str8_list.h"
#include "../../../common/aliases/aliases.h"
#include "../../../containers/dbl_list/dbl_list.h"
#include "../../mem/allocator/mem_allocator.h"
#include <string.h>
#include <stdbool.h>
@@ -91,8 +91,8 @@ Str8 *wapp_str8_join(const Allocator *allocator, const Str8List *list, Str8R
/**
* Str8 list utilities
*/
#define wapp_str8_node_from_cstr(STRING) ((Str8Node){.item = &wapp_str8_lit(STRING)})
#define wapp_str8_node_from_str8(STRING) ((Str8Node){.item = &(STRING)})
#define wapp_str8_node_from_cstr(STRING) wapp_str8_list_node(&wapp_str8_lit(STRING))
#define wapp_str8_node_from_str8(STRING) wapp_str8_list_node(&(STRING))
u64 wapp_str8_list_total_size(const Str8List *list);
#ifdef __cplusplus

View File

@@ -3,7 +3,6 @@
#include "wapp_core.h"
#include "strings/str8/str8.c"
#include "strings/str8/str8_list.c"
#include "os/shell/termcolour/posix/termcolour_posix.c"
#include "os/shell/termcolour/win/termcolour_win.c"
#include "os/shell/termcolour/termcolour.c"
@@ -18,5 +17,6 @@
#include "mem/allocator/mem_allocator.c"
#include "mem/arena/mem_arena.c"
#include "mem/arena/mem_arena_allocator.c"
#include "../containers/wapp_containers.c"
#endif // !WAPP_CORE_C

View File

@@ -2,7 +2,6 @@
#define WAPP_CORE_H
#include "strings/str8/str8.h"
#include "strings/str8/str8_list.h"
#include "os/shell/termcolour/termcolour.h"
#include "os/shell/termcolour/terminal_colours.h"
#include "os/shell/commander/commander.h"
@@ -18,5 +17,6 @@
#include "mem/arena/mem_arena_allocator.h"
#include "mem/arena/mem_arena.h"
#include "../common/wapp_common.h"
#include "../containers/wapp_containers.h"
#endif // !WAPP_CORE_H