Commits


move load_page_from_str to telescope.c I'd like to use parser{,_gophermap,_gemtext}.c in standalone testing programs, and this function is getting in the way since it depends on ui.c


parsers: add serialize function Add a parser_serialize function and an optional function `serialize' for parsers. The default implementation just prints the text line, which is suitable for parser_textplain and parser_textpatch; gemtext and gophermap uses their own specific unparse functions. This is intended for an incoming cache refactoring: we'll cache the page serialized in the correct format, not once it has been translated to gemtext. This will allow in the future to provide commands such as ``save page to disk'' or interface with an on-disk cache.


add fn pointer to the parser init function to struct parser will come in handy in the future cache refactoring.


delay erase_buffer until parser_init The idea is to handle better non-displayable pages (like images), and keeping the old page until the server replies is the first step. It also simplifies the memory management btw.


update the misleading comment in parser_free


fmt (some missing space -> tab conversion)


include compat first and our headers after system ones


move more stuff outta telescope.c


tilde-heuristics for titles use `~username' as tab title if the page doesn't have any headings


fix off-by-one Thanks to the fact that we're using a bigger buffer in the net process, and thanks to the way otto@' malloc works, it was easy to detect this off-by-one in a large page (RFC3089 in particular).


simplify parsers api; use domain name if no title


move parser declarations so parser.h


drop the in_body field and use a bit in the flags field


deal with BOM -- that is, ignore it


style(9)