From d107c58da75674946e70008c09fc60f89d99aba1 Mon Sep 17 00:00:00 2001 From: ThoNohT Date: Mon, 4 May 2026 15:01:57 +0200 Subject: [PATCH] noh.h: noh_string_append_sv --- src/noh.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/noh.h b/src/noh.h index 67268c1..226b956 100644 --- a/src/noh.h +++ b/src/noh.h @@ -357,6 +357,9 @@ typedef struct { const char *elems; } Noh_String_View; +// Appends a Noh_String_View view into a Noh_String. +void noh_string_append_sv(Noh_String *string, Noh_String_View sv); + // Increases the position of a string view by the specified amount, reducing its count by the same // amount. If the end is reached, the string view will remain empty without moving further. void noh_sv_increase_position(Noh_String_View *sv, size_t distance); @@ -880,6 +883,10 @@ defer: ///////////////////////// String view ///////////////////////// +void noh_string_append_sv(Noh_String *string, Noh_String_View sv) { + noh_da_append_multiple(string, sv.elems, sv.count); +} + void noh_sv_increase_position(Noh_String_View *sv, size_t distance) { if (distance < sv->count) { sv->count -= distance;