aboutsummaryrefslogtreecommitdiff
path: root/src/base/string/append.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/string/append.c')
-rw-r--r--src/base/string/append.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/base/string/append.c b/src/base/string/append.c
index d4d0396..60e1b48 100644
--- a/src/base/string/append.c
+++ b/src/base/string/append.c
@@ -5,20 +5,20 @@
// string to our buffer. the result is reallocated if not enough room is present
// in the buffer.
int
-str·appendlen(string *s, vlong n, const byte* b)
+string·appendlen(string *s, vlong n, byte* b)
{
/*
bl = strlen(b);
if (n > bl) panicf("attempted to make a substring longer than string");
*/
- str·grow(s, n);
+ string·grow(s, n);
if(*s == nil)
return 0;
Hdr* h = (Hdr*)(*s - sizeof(Hdr));
- memcpy(*s + str·len(*s), b, n);
+ memcpy(*s + string·len(*s), b, n);
h->len += n;
(*s)[h->len] = '\0';
@@ -28,24 +28,24 @@ str·appendlen(string *s, vlong n, const byte* b)
// append will append the given null terminated c string to the string data
// structure. this variant will append the entire string.
int
-str·append(string *s, const byte* b)
+string·append(string *s, byte* b)
{
- return str·appendlen(s, strlen(b), b);
+ return string·appendlen(s, strlen(b), b);
}
// appendbyte will append the given byte to our string.
// NOTE: as the byte is on the stack, it is not null-terminated.
// can not pass to the above functions.
int
-str·appendbyte(string *s, const byte b)
+string·appendbyte(string *s, byte b)
{
- str·grow(s, 1);
+ string·grow(s, 1);
if(*s == nil)
return 0;
Hdr* h = (Hdr*)(*s - sizeof(Hdr));
- *(*s + str·len(*s)) = b;
+ *(*s + string·len(*s)) = b;
h->len++;
(*s)[h->len] = '\0'; // NOTE: I don't think an explicit zero is required..?