diff options
Diffstat (limited to 'doc.c')
-rw-r--r-- | doc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/doc.c b/doc.c index aa18369..a8e7975 100644 --- a/doc.c +++ b/doc.c @@ -8,8 +8,8 @@ /* initialization / destruction */ void doc_init(struct doc *d) { - buf_init(&d->txt, sizeof(struct doc_line)); - buf_init(&d->lnk, 1); + str_init(&d->txt, sizeof(struct doc_line)); + str_init(&d->lnk, 1); d->txt.sz = sizeof(struct doc_line); *(struct doc_line *)d->txt.buf = (struct doc_line) { .prev = 0, @@ -21,14 +21,14 @@ void doc_init(struct doc *d) { } void doc_fini(struct doc *d) { - buf_free(&d->txt); - buf_free(&d->lnk); + str_free(&d->txt); + str_free(&d->lnk); } /* line creation */ void doc_new_line(struct doc *d) { - buf_grow(&d->txt, sizeof(struct doc_line)); + str_grow(&d->txt, sizeof(struct doc_line)); *(struct doc_line *)&d->txt.buf[d->txt.sz] = (struct doc_line) { .prev = ((struct doc_line *)&d->txt.buf[d->latest])->len, .link = DOC_LINK_NONE, @@ -44,7 +44,7 @@ void doc_add_line(struct doc *d, strv_t s) { } void doc_add_text(struct doc *d, strv_t s) { - buf_grow(&d->txt, s.n); + str_grow(&d->txt, s.n); memcpy(&d->txt.buf[d->txt.sz], s.s, s.n); struct doc_line *dl = (struct doc_line *)&d->txt.buf[d->latest]; d->txt.sz += s.n; @@ -52,8 +52,8 @@ void doc_add_text(struct doc *d, strv_t s) { } unsigned short doc_add_link(struct doc *d, strv_t url) { - buf_cat(&d->lnk, url); - buf_catc(&d->lnk, 0); + str_cat(&d->lnk, url); + str_catc(&d->lnk, 0); return d->linkc++; } |