working on undo
This commit is contained in:
17
abuf.c
17
abuf.c
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user