@@ -24,6 +24,7 @@ typedef struct RDProjectManifest {
2424 bool has_value ;
2525 } entry_point ;
2626
27+ RDStringTerminatorVect string_terminators ;
2728 RDAnalyzerItemVect analyzers ;
2829
2930 toml_result_t toml ;
@@ -54,6 +55,7 @@ static const RDTomlSchema MANIFEST_SCHEMA[] = {
5455 {.key = "format.file_name" , .type = TOML_STRING },
5556
5657 {.key = "analysis.min_string" , .type = TOML_INT64 },
58+ {.key = "analysis.string_terminators" , .type = TOML_ARRAY , .array_type = & (RDTomlSchema ){.type = TOML_INT64 }},
5759 {.key = "analysis.loader" , .type = TOML_STRING },
5860 {.key = "analysis.processor" , .type = TOML_STRING },
5961 {.key = "analysis.analyzers" , .type = TOML_ARRAY , .array_type = ANALYZER_SCHEMA },
@@ -65,6 +67,7 @@ static const RDTomlSchema MANIFEST_SCHEMA[] = {
6567
6668static void _rd_project_manifest_destroy (RDProjectManifest * m ) {
6769 rd_i_analyzeritemvect_destroy (& m -> analyzers );
70+ vect_destroy (& m -> string_terminators );
6871 toml_free (m -> toml );
6972 rd_free (m -> raw );
7073}
@@ -158,6 +161,17 @@ static bool _rd_project_read_manifest(mz_zip_archive* zip,
158161 out -> min_string =
159162 (int )toml_seek (out -> toml .toptab , "analysis.min_string" ).u .int64 ;
160163
164+ toml_datum_t string_terminators =
165+ toml_seek (out -> toml .toptab , "analysis.string_terminators" );
166+
167+ vect_reserve (& out -> string_terminators ,
168+ (usize )string_terminators .u .arr .size );
169+
170+ for (int i = 0 ; i < string_terminators .u .arr .size ; i ++ ) {
171+ toml_datum_t elem = string_terminators .u .arr .elem [i ];
172+ vect_push (& out -> string_terminators , (u8 )elem .u .int64 );
173+ }
174+
161175 const char * loader_id = toml_seek (out -> toml .toptab , "analysis.loader" ).u .s ;
162176 assert (loader_id );
163177
@@ -274,6 +288,9 @@ static RDContext* _rd_project_create_context(mz_zip_archive* zip,
274288
275289 ctx -> entry_point .has_value = manifest -> entry_point .has_value ;
276290 ctx -> entry_point .value = manifest -> entry_point .value ;
291+
292+ mem_swap (RDStringTerminatorVect , & ctx -> string_terminators ,
293+ & manifest -> string_terminators );
277294 mem_swap (RDAnalyzerItemVect , & ctx -> analyzerplugins , & manifest -> analyzers );
278295
279296 ctx -> engine .step = RD_WS_DONE ;
0 commit comments