Prefix core functions

This commit is contained in:
nub31
2026-03-05 23:10:38 +01:00
parent 24d41d3dcb
commit dd44e3edc4

View File

@@ -176,7 +176,7 @@ public class Generator
} }
#endif #endif
static inline void string_rc_inc(struct nub_core_string *string) static inline void nub_core_string_rc_inc(struct nub_core_string *string)
{ {
if (string == NULL) if (string == NULL)
{ {
@@ -192,7 +192,7 @@ public class Generator
STR_DBG("INC: str=%p ref=%u \"%s\"", (void*)string, string->ref, string->data); STR_DBG("INC: str=%p ref=%u \"%s\"", (void*)string, string->ref, string->data);
} }
static inline void string_rc_dec(struct nub_core_string *string) static inline void nub_core_string_rc_dec(struct nub_core_string *string)
{ {
if (string == NULL) if (string == NULL)
{ {
@@ -232,7 +232,7 @@ public class Generator
} }
} }
static inline struct nub_core_string *string_concat(struct nub_core_string *left, struct nub_core_string *right) static inline struct nub_core_string *nub_core_string_concat(struct nub_core_string *left, struct nub_core_string *right)
{ {
size_t new_length = left->length + right->length; size_t new_length = left->length + right->length;
@@ -255,7 +255,7 @@ public class Generator
return result; return result;
} }
static inline struct nub_core_string *string_from_cstr(char* cstr) static inline struct nub_core_string *nub_core_string_from_cstr(char* cstr)
{ {
size_t len = strlen(cstr); size_t len = strlen(cstr);
@@ -580,7 +580,7 @@ public class Generator
if (expression.Operation == TypedNodeExpressionBinary.Op.Add && expression.Left.Type is NubTypeString && expression.Right.Type is NubTypeString) if (expression.Operation == TypedNodeExpressionBinary.Op.Add && expression.Left.Type is NubTypeString && expression.Right.Type is NubTypeString)
{ {
scopes.Peek().DeconstructableNames.Add((name, expression.Type)); scopes.Peek().DeconstructableNames.Add((name, expression.Type));
writer.WriteLine($"{CType(NubTypeString.Instance, name)} = string_concat({left}, {right});"); writer.WriteLine($"{CType(NubTypeString.Instance, name)} = nub_core_string_concat({left}, {right});");
return name; return name;
} }
@@ -690,7 +690,7 @@ public class Generator
var name = Tmp(); var name = Tmp();
scopes.Peek().DeconstructableNames.Add((name, expression.Type)); scopes.Peek().DeconstructableNames.Add((name, expression.Type));
var value = EmitExpression(expression.Value); var value = EmitExpression(expression.Value);
writer.WriteLine($"{CType(expression.Type, name)} = string_from_cstr({value});"); writer.WriteLine($"{CType(expression.Type, name)} = nub_core_string_from_cstr({value});");
return name; return name;
} }
@@ -788,7 +788,7 @@ public class Generator
{ {
case NubTypeString: case NubTypeString:
{ {
writer.WriteLine($"string_rc_inc({value});"); writer.WriteLine($"nub_core_string_rc_inc({value});");
break; break;
} }
case NubTypeStruct structType: case NubTypeStruct structType:
@@ -859,7 +859,7 @@ public class Generator
{ {
case NubTypeString: case NubTypeString:
{ {
writer.WriteLine($"string_rc_dec({value});"); writer.WriteLine($"nub_core_string_rc_dec({value});");
break; break;
} }
case NubTypeStruct structType: case NubTypeStruct structType: