working on undo

This commit is contained in:
2025-11-29 13:05:12 -08:00
parent c47287e96e
commit 3b401e770e
3 changed files with 83 additions and 12 deletions

17
abuf.c
View File

@@ -74,6 +74,11 @@ ab_append(abuf *buf, const char *s, size_t len)
void
ab_append_ab(abuf *buf, const abuf *other)
{
assert(buf != NULL);
if (other == NULL) {
return;
}
ab_append(buf, other->b, other->size);
}
@@ -104,6 +109,18 @@ ab_prepend(abuf *buf, const char *s, const size_t len)
}
void
ab_prepend_ab(abuf *buf, const abuf *other)
{
assert(buf != NULL);
if (other == NULL) {
return;
}
ab_prepend(buf, other->b, other->size);
}
void
ab_free(abuf *buf)
{