=================================================================== RCS file: /cvs/mandoc/Attic/private.h,v retrieving revision 1.3 retrieving revision 1.41 diff -u -p -r1.3 -r1.41 --- mandoc/Attic/private.h 2008/11/24 08:50:33 1.3 +++ mandoc/Attic/private.h 2008/12/15 01:54:58 1.41 @@ -1,4 +1,4 @@ -/* $Id: private.h,v 1.3 2008/11/24 08:50:33 kristaps Exp $ */ +/* $Id: private.h,v 1.41 2008/12/15 01:54:58 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -19,49 +19,52 @@ #ifndef PRIVATE_H #define PRIVATE_H -struct md_rbuf { - int fd; - char *name; - char *buf; - size_t bufsz; - size_t line; +#include "mdoc.h" + +struct mdoc { + void *data; + struct mdoc_cb cb; + void *htab; + struct mdoc_node *last; + struct mdoc_node *first; }; -struct md_mbuf { - int fd; - char *name; - char *buf; - size_t bufsz; - size_t pos; +struct mdoc_macro { + int (*fp)(struct mdoc *, int, int, int *, char *); + int flags; +#define MDOC_CALLABLE (1 << 0) +#define MDOC_EXPLICIT (1 << 1) }; +extern const struct mdoc_macro *const mdoc_macros; + __BEGIN_DECLS -typedef int (*md_init)(const struct md_args *, struct md_mbuf *, - const struct md_rbuf *, void **); -typedef int (*md_exit)(const struct md_args *, struct md_mbuf *, - const struct md_rbuf *, int, void *); -typedef int (*md_line)(const struct md_args *, - struct md_mbuf *, const struct md_rbuf *, - char *, size_t, void *); +int mdoc_err(struct mdoc *, int, int, enum mdoc_err); +int mdoc_warn(struct mdoc *, int, int, enum mdoc_warn); +void mdoc_msg(struct mdoc *, int, const char *, ...); -int md_line_html4_strict(const struct md_args *, - struct md_mbuf *, const struct md_rbuf *, - char *, size_t, void *); -int md_init_html4_strict(const struct md_args *, - struct md_mbuf *, const struct md_rbuf *, - void **); -int md_exit_html4_strict(const struct md_args *, - struct md_mbuf *, const struct md_rbuf *, - int, void *); +int mdoc_macro(struct mdoc *, int, int, int *, char *); +int mdoc_find(const struct mdoc *, const char *); -int md_line_dummy(const struct md_args *, - struct md_mbuf *, const struct md_rbuf *, - char *, size_t, void *); +void mdoc_word_alloc(struct mdoc *, int, const char *); +void mdoc_elem_alloc(struct mdoc *, int, int, + size_t, const struct mdoc_arg *, + size_t, const char **); +void mdoc_block_alloc(struct mdoc *, int, int, + size_t, const struct mdoc_arg *); +void mdoc_head_alloc(struct mdoc *, + int, int, size_t, const char **); +void mdoc_body_alloc(struct mdoc *, int, int); -int md_buf_puts(struct md_mbuf *, const char *, size_t); -int md_buf_putchar(struct md_mbuf *, char); -int md_buf_putstring(struct md_mbuf *, const char *); +void mdoc_node_free(struct mdoc_node *); + +void mdoc_sibling(struct mdoc *, int, struct mdoc_node **, + struct mdoc_node **, struct mdoc_node *); + +void *mdoc_hash_alloc(void); +int mdoc_hash_find(const void *, const char *); +void mdoc_hash_free(void *); __END_DECLS