#ifndef DOC_H #define DOC_H #include "buf.h" enum doc_type { TYPE_UNKNOWN, TYPE_GOPHERDOC, TYPE_GEMTEXT, TYPE_PLAIN, }; #define DOC_LINK_NONE 0xffff struct doc_line { unsigned short prev, link, len; char txt[]; }; struct doc { struct buf txt, lnk; size_t latest; }; void doc_init(struct doc *); void doc_fini(struct doc *); 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