diff options
Diffstat (limited to 'doc.h')
-rw-r--r-- | doc.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/doc.h b/doc.h index 3c5dfcc..5e9c18c 100644 --- a/doc.h +++ b/doc.h @@ -1,6 +1,8 @@ #ifndef DOC_H #define DOC_H +#include "buf.h" + enum doc_type { TYPE_UNKNOWN, TYPE_GOPHERDOC, @@ -8,17 +10,24 @@ enum doc_type { TYPE_PLAIN, }; -void doc_new(void); -void doc_prev(void); -void doc_next(void); +#define DOC_LINK_NONE 0xffff + +struct doc_line { + unsigned short prev, link, len; + char txt[]; +}; -void doc_add(const char *, size_t); -void doc_adds(const char *); +struct doc { + struct buf txt, lnk; + size_t latest; +}; -void doc_back_line(void); -void doc_print_line(void); +void doc_init(struct doc *); +void doc_fini(struct doc *); -void doc_init(void); -void doc_fini(void); +void doc_new_line(struct doc *); +void doc_add_line(struct doc *, const char *); +void doc_add_text(struct doc *, const char *); +void doc_add_textn(struct doc *, const char *, size_t); #endif |