ulib uprintf to pipe not termdev, ulib Add stringbuffer and linearlist, tb Capture subshell output

This commit is contained in:
2025-10-01 20:08:44 +02:00
parent 0e4a35eb86
commit 62cf07afc7
11 changed files with 210 additions and 13 deletions

View File

@ -0,0 +1,26 @@
#include <stdint.h>
#include <stddef.h>
#include <string/stringbuffer.h>
#include <umalloc/umalloc.h>
#include <string/string.h>
#include <linearlist.h>
void stringbuffer_init(StringBuffer *sb) {
string_memset(sb, 0, sizeof(*sb));
}
void stringbuffer_free(StringBuffer *sb) {
LINLIST_FREE(sb);
}
void stringbuffer_appendchar(StringBuffer *sb, char c) {
LINLIST_APPEND(sb, c);
}
void stringbuffer_appendcstr(StringBuffer *sb, char *cstr) {
char *s = cstr;
while (*s) {
stringbuffer_appendchar(sb, *s);
s++;
}
}