2023-05-06 12:49:43 -07:00
|
|
|
#pragma once
|
|
|
|
|
2023-07-29 13:00:06 -07:00
|
|
|
|
|
|
|
|
2023-07-18 21:13:12 -07:00
|
|
|
#if GEN_TIME
|
2023-05-06 12:49:43 -07:00
|
|
|
#include "gen.hpp"
|
|
|
|
|
|
|
|
using namespace gen;
|
|
|
|
|
|
|
|
Code gen__array_base()
|
|
|
|
{
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeType t_allocator_info = def_type( name(AllocatorInfo) );
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeStruct header = def_struct( name(ArrayHeader),
|
2023-07-12 00:41:16 -07:00
|
|
|
def_struct_body( args(
|
|
|
|
def_variable( t_allocator_info, name(Allocator) )
|
2023-06-30 08:54:27 -07:00
|
|
|
, def_variable( t_uw, name(Capacity) )
|
|
|
|
, def_variable( t_uw, name(Num) )
|
2023-07-12 00:41:16 -07:00
|
|
|
)));
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-13 22:37:22 -07:00
|
|
|
CodeFn grow_formula = def_function( name(array_grow_formula), def_param( t_uw, name(value)), t_uw
|
2023-07-08 09:21:26 -07:00
|
|
|
, def_execution( code( return 2 * value * 8; ) )
|
2023-07-15 23:26:55 -07:00
|
|
|
, def_specifiers( args( ESpecifier::Static, ESpecifier::Inline ) )
|
2023-06-30 08:54:27 -07:00
|
|
|
);
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-12 00:41:16 -07:00
|
|
|
return def_global_body( args( header, grow_formula ) );
|
2023-05-06 12:49:43 -07:00
|
|
|
}
|
|
|
|
|
2023-07-11 00:10:20 -07:00
|
|
|
Code gen__array( StrC type )
|
2023-05-06 12:49:43 -07:00
|
|
|
{
|
2023-07-13 22:37:22 -07:00
|
|
|
static CodeType t_allocator_info = def_type( name(AllocatorInfo) );
|
|
|
|
static Code v_nullptr = code_str(nullptr);
|
2023-06-30 00:13:41 -07:00
|
|
|
|
2023-07-23 21:27:13 -07:00
|
|
|
static CodeSpecifiers spec_ct_member = def_specifiers( 2, ESpecifier::Constexpr, ESpecifier::Static );
|
|
|
|
static CodeSpecifiers spec_static_inline = def_specifiers( 2, ESpecifier::Static, ESpecifier::Inline );
|
|
|
|
static CodeSpecifiers spec_static = def_specifier( ESpecifier::Static );
|
2023-06-30 00:13:41 -07:00
|
|
|
|
2023-07-13 22:37:22 -07:00
|
|
|
static CodeUsing using_header = def_using( name(Header), def_type( name(ArrayHeader) ) );
|
|
|
|
static CodeVar ct_grow_formula = def_variable( t_auto, name(grow_formula), untyped_str( code( & array_grow_formula )), spec_ct_member );
|
2023-05-06 12:49:43 -07:00
|
|
|
|
|
|
|
StrC name;
|
|
|
|
{
|
2023-06-30 00:13:41 -07:00
|
|
|
char const* name_str = str_fmt_buf( "Array_%s\0", type.Ptr );
|
|
|
|
s32 name_len = str_len( name_str );
|
2023-05-06 12:49:43 -07:00
|
|
|
|
|
|
|
name = { name_len, name_str };
|
|
|
|
};
|
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeType t_array_type = def_type( name );
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeType t_type = def_type( type );
|
|
|
|
CodeType t_type_ptr = def_type( type, __, spec_ptr );
|
|
|
|
CodeType t_type_ref = def_type( type, __, spec_ref );
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeType t_alias = def_type( name(Type) );
|
|
|
|
CodeType t_alias_ptr = def_type( name(Type), __, spec_ptr );
|
|
|
|
CodeType t_alias_ref = def_type( name(Type), __, spec_ref );
|
2023-06-30 21:23:40 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeType t_header = def_type( name(Header) );
|
|
|
|
CodeType t_header_ptr = def_type( name(Header), __, spec_ptr );
|
|
|
|
CodeType t_header_ref = def_type( name(Header), __, spec_ref );
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeStruct array = {0};
|
2023-05-06 12:49:43 -07:00
|
|
|
{
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeUsing using_type = def_using( name(Type), t_type );
|
|
|
|
CodeVar data = def_variable( t_alias_ptr, name(Data) );
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn init = def_function( name(init), def_param( t_allocator_info, name(allocator) ), t_array_type
|
2023-07-08 09:21:26 -07:00
|
|
|
, def_execution( code(
|
2023-05-06 12:49:43 -07:00
|
|
|
return init_reserve( allocator, grow_formula(0) );
|
2023-07-08 09:21:26 -07:00
|
|
|
))
|
|
|
|
, spec_static
|
|
|
|
);
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn init_reserve;
|
2023-05-06 12:49:43 -07:00
|
|
|
{
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeParam params = def_params( args(
|
2023-07-12 00:41:16 -07:00
|
|
|
def_param( t_allocator_info, name(allocator) )
|
2023-06-30 08:54:27 -07:00
|
|
|
, def_param( t_sw, name(capacity) )
|
2023-07-12 00:41:16 -07:00
|
|
|
));
|
2023-06-30 00:13:41 -07:00
|
|
|
|
2023-07-08 09:21:26 -07:00
|
|
|
Code body = def_execution( code(
|
2023-05-06 12:49:43 -07:00
|
|
|
Header* header = rcast( Header*, alloc( allocator, sizeof(Header) + sizeof(Type) ));
|
|
|
|
|
|
|
|
if ( header == nullptr )
|
2023-06-30 08:54:27 -07:00
|
|
|
return { nullptr };
|
2023-05-06 12:49:43 -07:00
|
|
|
|
|
|
|
header->Allocator = allocator;
|
|
|
|
header->Capacity = capacity;
|
|
|
|
header->Num = 0;
|
|
|
|
|
2023-06-30 08:54:27 -07:00
|
|
|
return { rcast( Type*, header + 1) };
|
|
|
|
));
|
2023-05-06 12:49:43 -07:00
|
|
|
|
|
|
|
init_reserve = def_function( name(init_reserve), params, t_array_type, body, spec_static );
|
|
|
|
}
|
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn append = def_function( name(append), def_param(t_alias, name(value)), t_bool
|
2023-07-08 09:21:26 -07:00
|
|
|
, def_execution( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
Header* header = get_header();
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-11 22:33:11 -07:00
|
|
|
if ( header->Num == header->Capacity )
|
2023-07-08 09:21:26 -07:00
|
|
|
{
|
2023-07-11 22:33:11 -07:00
|
|
|
if ( ! grow( header->Capacity ))
|
2023-07-08 09:21:26 -07:00
|
|
|
return false;
|
2023-07-11 22:33:11 -07:00
|
|
|
|
|
|
|
header = get_header();
|
2023-07-08 09:21:26 -07:00
|
|
|
}
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-11 22:33:11 -07:00
|
|
|
Data[ header->Num ] = value;
|
|
|
|
header->Num++;
|
2023-06-30 10:56:31 -07:00
|
|
|
|
2023-07-08 09:21:26 -07:00
|
|
|
return true;
|
|
|
|
))
|
|
|
|
);
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn back = def_function( name(back), __, t_alias_ref
|
2023-07-08 09:21:26 -07:00
|
|
|
, def_execution( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
Header& header = * get_header();
|
2023-05-06 12:49:43 -07:00
|
|
|
return Data[ header.Num - 1 ];
|
2023-07-08 09:21:26 -07:00
|
|
|
))
|
|
|
|
);
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn clear = def_function( name(clear), __, t_void
|
2023-07-08 09:21:26 -07:00
|
|
|
, def_execution( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
Header& header = * get_header();
|
2023-06-30 08:54:27 -07:00
|
|
|
header.Num = 0;
|
|
|
|
))
|
|
|
|
);
|
2023-05-06 15:35:11 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn fill;
|
2023-05-06 15:35:11 -07:00
|
|
|
{
|
2023-07-15 19:27:38 -07:00
|
|
|
CodeParam params = def_params( args(
|
|
|
|
def_param( t_uw, name(begin) )
|
2023-06-30 21:23:40 -07:00
|
|
|
, def_param( t_uw, name(end) )
|
|
|
|
, def_param( t_alias, name(value) )
|
2023-07-15 19:27:38 -07:00
|
|
|
));
|
2023-05-06 15:35:11 -07:00
|
|
|
|
2023-07-13 22:37:22 -07:00
|
|
|
Code body = untyped_str( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
Header& header = * get_header();
|
2023-05-06 15:35:11 -07:00
|
|
|
|
|
|
|
if ( begin < 0 || end >= header.Num )
|
|
|
|
return false;
|
|
|
|
|
2024-10-27 15:58:37 -07:00
|
|
|
for ( ssize idx = begin; idx < end; idx++ )
|
2023-05-06 15:35:11 -07:00
|
|
|
{
|
2023-06-30 00:13:41 -07:00
|
|
|
Data[ idx ] = value;
|
2023-05-06 15:35:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
));
|
|
|
|
|
|
|
|
fill = def_function( name(fill), params, t_bool, body );
|
|
|
|
}
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn free = def_function( name(free), __, t_void
|
2023-07-08 09:21:26 -07:00
|
|
|
, def_execution( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
Header* header = get_header();
|
|
|
|
gen::free( header->Allocator, header );
|
2023-06-30 08:54:27 -07:00
|
|
|
))
|
|
|
|
);
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn get_header = def_function( name(get_header), __, t_header_ptr
|
2023-07-08 09:21:26 -07:00
|
|
|
, def_execution( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
return rcast( Header*, Data ) - 1;
|
2023-07-08 09:21:26 -07:00
|
|
|
))
|
|
|
|
);
|
2023-05-06 15:35:11 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn grow = def_function( name(grow), def_param( t_uw, name(min_capacity)), t_bool
|
2023-07-08 09:21:26 -07:00
|
|
|
, def_execution( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
Header& header = * get_header();
|
2023-05-06 15:35:11 -07:00
|
|
|
|
2024-10-27 15:58:37 -07:00
|
|
|
usize new_capacity = grow_formula( header.Capacity );
|
2023-05-06 15:35:11 -07:00
|
|
|
|
|
|
|
if ( new_capacity < min_capacity )
|
|
|
|
new_capacity = 8;
|
|
|
|
|
|
|
|
return set_capacity( new_capacity );
|
2023-06-30 08:54:27 -07:00
|
|
|
))
|
|
|
|
);
|
2023-05-06 15:35:11 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn num = def_function( name(num), __, t_uw
|
2023-07-08 09:21:26 -07:00
|
|
|
, def_execution( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
return get_header()->Num;
|
2023-06-30 21:23:40 -07:00
|
|
|
))
|
|
|
|
);
|
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn pop = def_function( name(pop), __, t_bool
|
2023-07-08 09:21:26 -07:00
|
|
|
, def_execution( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
Header& header = * get_header();
|
2023-05-06 15:35:11 -07:00
|
|
|
|
2023-07-15 19:27:38 -07:00
|
|
|
GEN_ASSERT( header.Num > 0 );
|
2023-05-06 15:35:11 -07:00
|
|
|
header.Num--;
|
2023-07-08 09:21:26 -07:00
|
|
|
))
|
|
|
|
);
|
2023-05-06 15:35:11 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn remove_at = def_function( name(remove_at), def_param( t_uw, name(idx)), t_void
|
2023-06-30 21:23:40 -07:00
|
|
|
, def_execution( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
Header* header = get_header();
|
2023-07-15 19:27:38 -07:00
|
|
|
GEN_ASSERT( idx < header->Num );
|
2023-06-30 21:23:40 -07:00
|
|
|
|
|
|
|
mem_move( header + idx, header + idx + 1, sizeof( Type ) * ( header->Num - idx - 1 ) );
|
|
|
|
header->Num--;
|
|
|
|
))
|
|
|
|
);
|
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn reserve = def_function( name(reserve), def_param( t_uw, name(new_capacity)), t_bool
|
2023-07-08 09:21:26 -07:00
|
|
|
, def_execution( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
Header& header = * get_header();
|
2023-05-06 15:35:11 -07:00
|
|
|
|
|
|
|
if ( header.Capacity < new_capacity )
|
2023-06-30 00:13:41 -07:00
|
|
|
return set_capacity( new_capacity );
|
2023-05-06 15:35:11 -07:00
|
|
|
|
|
|
|
return true;
|
2023-06-30 08:54:27 -07:00
|
|
|
))
|
|
|
|
);
|
2023-05-06 15:35:11 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn resize = def_function( name(resize), def_param( t_uw, name(num)), t_bool
|
2023-07-08 09:21:26 -07:00
|
|
|
, def_execution( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
Header* header = get_header();
|
2023-05-06 15:35:11 -07:00
|
|
|
|
2023-07-11 22:33:11 -07:00
|
|
|
if ( num > header->Capacity )
|
2023-05-06 15:35:11 -07:00
|
|
|
{
|
2023-07-11 22:33:11 -07:00
|
|
|
if ( ! grow( header->Capacity ))
|
2023-05-06 15:35:11 -07:00
|
|
|
return false;
|
2023-07-11 22:33:11 -07:00
|
|
|
|
|
|
|
header = get_header();
|
2023-05-06 15:35:11 -07:00
|
|
|
}
|
|
|
|
|
2023-07-11 22:33:11 -07:00
|
|
|
header->Num = num;
|
2023-05-06 15:35:11 -07:00
|
|
|
return true;
|
2023-06-30 08:54:27 -07:00
|
|
|
))
|
|
|
|
);
|
2023-05-06 15:35:11 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeFn set_capacity;
|
2023-05-06 15:35:11 -07:00
|
|
|
{
|
2023-07-08 09:21:26 -07:00
|
|
|
Code body = def_execution( code(
|
2023-07-11 22:33:11 -07:00
|
|
|
Header& header = * get_header();
|
2023-05-06 15:35:11 -07:00
|
|
|
|
|
|
|
if ( new_capacity == header.Capacity )
|
|
|
|
return true;
|
|
|
|
|
|
|
|
if ( new_capacity < header.Num )
|
|
|
|
header.Num = new_capacity;
|
|
|
|
|
2024-10-27 15:58:37 -07:00
|
|
|
ssize size = sizeof(Header) + sizeof(Type) * new_capacity;
|
2023-05-06 15:35:11 -07:00
|
|
|
Header* new_header = rcast( Header*, alloc( header.Allocator, size ));
|
|
|
|
|
|
|
|
if ( new_header == nullptr )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
mem_move( new_header, & header, sizeof( Header ) + sizeof(Type) * header.Num );
|
|
|
|
|
2023-07-11 22:33:11 -07:00
|
|
|
new_header->Capacity = new_capacity;
|
2023-05-06 15:35:11 -07:00
|
|
|
|
2023-07-11 22:33:11 -07:00
|
|
|
gen::free( header.Allocator, & header );
|
2023-05-06 15:35:11 -07:00
|
|
|
|
2023-07-11 22:33:11 -07:00
|
|
|
Data = rcast( Type*, new_header + 1);
|
2023-05-06 15:35:11 -07:00
|
|
|
|
|
|
|
return true;
|
|
|
|
));
|
|
|
|
|
2023-06-30 08:54:27 -07:00
|
|
|
set_capacity = def_function( name(set_capacity), def_param( t_uw, name(new_capacity)), t_bool, body );
|
2023-05-06 15:35:11 -07:00
|
|
|
}
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeOpCast op_ptr = def_operator_cast( t_type_ptr, def_execution( code(
|
2023-07-10 19:14:41 -07:00
|
|
|
return Data;
|
|
|
|
)));
|
2023-06-30 21:23:40 -07:00
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeBody body = def_struct_body( args(
|
2023-07-12 00:41:16 -07:00
|
|
|
using_header
|
2023-05-06 12:49:43 -07:00
|
|
|
, using_type
|
2023-06-30 08:54:27 -07:00
|
|
|
, ct_grow_formula
|
2023-05-06 12:49:43 -07:00
|
|
|
|
|
|
|
, init
|
|
|
|
, init_reserve
|
|
|
|
|
|
|
|
, append
|
|
|
|
, back
|
|
|
|
, clear
|
|
|
|
, fill
|
|
|
|
, free
|
|
|
|
, get_header
|
|
|
|
, grow
|
2023-06-30 21:23:40 -07:00
|
|
|
, num
|
2023-05-06 12:49:43 -07:00
|
|
|
, pop
|
2023-06-30 21:23:40 -07:00
|
|
|
, remove_at
|
2023-05-06 12:49:43 -07:00
|
|
|
, reserve
|
|
|
|
, resize
|
|
|
|
, set_capacity
|
|
|
|
|
2023-06-30 21:23:40 -07:00
|
|
|
, op_ptr
|
|
|
|
|
2023-05-06 12:49:43 -07:00
|
|
|
, data
|
2023-07-12 00:41:16 -07:00
|
|
|
));
|
2023-05-06 12:49:43 -07:00
|
|
|
array = def_struct( name, body );
|
|
|
|
}
|
|
|
|
|
|
|
|
return array;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct GenArrayRequest
|
|
|
|
{
|
|
|
|
StrC Dependency;
|
2023-06-30 10:56:31 -07:00
|
|
|
StrC Type;
|
2023-05-06 12:49:43 -07:00
|
|
|
};
|
2023-07-11 15:29:45 -07:00
|
|
|
Array<GenArrayRequest> GenArrayRequests;
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-07-11 00:10:20 -07:00
|
|
|
void gen__array_request( StrC type, StrC dep = {} )
|
2023-05-06 12:49:43 -07:00
|
|
|
{
|
2023-06-30 00:13:41 -07:00
|
|
|
do_once_start
|
2023-07-29 13:00:06 -07:00
|
|
|
GenArrayRequests = Array<GenArrayRequest>::init( GlobalAllocator );
|
2023-06-30 00:13:41 -07:00
|
|
|
do_once_end
|
|
|
|
|
2023-06-30 12:11:49 -07:00
|
|
|
// Make sure we don't already have a request for the type.
|
2024-10-27 15:58:37 -07:00
|
|
|
for ( ssize idx = 0; idx < GenArrayRequests.num(); ++idx )
|
2023-06-30 12:11:49 -07:00
|
|
|
{
|
|
|
|
StrC const reqest_type = GenArrayRequests[ idx ].Type;
|
|
|
|
|
|
|
|
if ( reqest_type.Len != type.Len )
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if ( str_compare( reqest_type.Ptr, type.Ptr, reqest_type.Len ) == 0 )
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-07-11 00:10:20 -07:00
|
|
|
GenArrayRequest request = { dep, type };
|
2023-07-11 15:29:45 -07:00
|
|
|
GenArrayRequests.append( request );
|
2023-05-06 12:49:43 -07:00
|
|
|
}
|
2023-07-11 22:33:11 -07:00
|
|
|
#define gen_array( type ) gen__array_request( code(type) )
|
2023-05-06 12:49:43 -07:00
|
|
|
|
|
|
|
u32 gen_array_file()
|
|
|
|
{
|
|
|
|
Builder
|
|
|
|
gen_array_file;
|
2023-07-11 22:33:11 -07:00
|
|
|
gen_array_file.open( "array.Upfront.gen.hpp" );
|
2023-05-06 12:49:43 -07:00
|
|
|
|
2023-08-09 15:47:59 -07:00
|
|
|
CodeInclude include_gen = def_include( txt("gen.hpp") );
|
2023-07-15 19:27:38 -07:00
|
|
|
gen_array_file.print( include_gen );
|
2023-06-30 00:13:41 -07:00
|
|
|
|
2023-07-11 22:33:11 -07:00
|
|
|
gen_array_file.print( def_using_namespace( name(gen)));
|
|
|
|
|
2023-06-30 08:54:27 -07:00
|
|
|
Code array_base = gen__array_base();
|
|
|
|
gen_array_file.print( array_base );
|
2023-05-06 12:49:43 -07:00
|
|
|
|
|
|
|
GenArrayRequest* current = GenArrayRequests;
|
2023-07-11 15:29:45 -07:00
|
|
|
s32 left = GenArrayRequests.num();
|
2023-05-06 12:49:43 -07:00
|
|
|
while (left--)
|
|
|
|
{
|
|
|
|
GenArrayRequest const& request = * current;
|
|
|
|
|
2023-07-11 00:10:20 -07:00
|
|
|
Code generated_array = gen__array( request.Type );
|
2023-05-06 12:49:43 -07:00
|
|
|
|
|
|
|
if ( request.Dependency )
|
|
|
|
{
|
|
|
|
char const* cmt_str = str_fmt_buf( "// Dependency for %s type", request.Type );
|
|
|
|
s32 cmt_len = str_len( cmt_str );
|
|
|
|
|
2023-07-15 12:20:55 -07:00
|
|
|
CodeComment cmt = def_comment( { cmt_len, cmt_str } );
|
|
|
|
CodeInclude include = def_include( request.Dependency );
|
2023-05-06 12:49:43 -07:00
|
|
|
|
|
|
|
gen_array_file.print( cmt );
|
|
|
|
gen_array_file.print( include );
|
|
|
|
}
|
|
|
|
|
|
|
|
gen_array_file.print( generated_array );
|
|
|
|
current++;
|
|
|
|
}
|
|
|
|
|
|
|
|
gen_array_file.write();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|