Annotation of mandoc/ml.h, Revision 1.7
1.7 ! kristaps 1: /* $Id: ml.h,v 1.6 2008/12/05 17:43:14 kristaps Exp $ */
1.1 kristaps 2: /*
3: * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
4: *
5: * Permission to use, copy, modify, and distribute this software for any
6: * purpose with or without fee is hereby granted, provided that the
7: * above copyright notice and this permission notice appear in all
8: * copies.
9: *
10: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11: * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12: * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13: * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14: * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15: * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16: * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17: * PERFORMANCE OF THIS SOFTWARE.
18: */
19: #ifndef ML_H
20: #define ML_H
21:
22: struct md_mlg;
23:
24: enum md_ns {
25: MD_NS_BLOCK,
1.2 kristaps 26: MD_NS_HEAD,
27: MD_NS_BODY,
1.1 kristaps 28: MD_NS_INLINE,
29: MD_NS_DEFAULT,
30: };
31:
1.7 ! kristaps 32: struct ml_cbs {
! 33: int (*ml_begin)(struct md_mbuf *,
! 34: const struct md_args *,
! 35: const struct tm *,
! 36: const char *, const char *,
1.3 kristaps 37: const char *, const char *);
1.7 ! kristaps 38: int (*ml_end)(struct md_mbuf *,
1.3 kristaps 39: const struct md_args *);
1.7 ! kristaps 40: ssize_t (*ml_endtag)(struct md_mbuf *,
! 41: void *, const struct md_args *,
! 42: enum md_ns, int);
! 43: ssize_t (*ml_begintag)(struct md_mbuf *,
! 44: void *, const struct md_args *,
! 45: enum md_ns, int,
1.3 kristaps 46: const int *, const char **);
1.7 ! kristaps 47: int (*ml_alloc)(void **);
! 48: void (*ml_free)(void *);
! 49: };
1.1 kristaps 50:
51: __BEGIN_DECLS
52:
1.5 kristaps 53: int ml_putstring(struct md_mbuf *,
54: const char *, size_t *);
1.1 kristaps 55: int ml_nputstring(struct md_mbuf *,
56: const char *, size_t, size_t *);
57: int ml_nputs(struct md_mbuf *,
58: const char *, size_t, size_t *);
1.2 kristaps 59: int ml_puts(struct md_mbuf *, const char *, size_t *);
1.1 kristaps 60: int ml_putchars(struct md_mbuf *,
61: char, size_t, size_t *);
62:
1.7 ! kristaps 63: struct md_mlg *mlg_alloc(const struct md_args *,
1.1 kristaps 64: const struct md_rbuf *, struct md_mbuf *,
1.7 ! kristaps 65: const struct ml_cbs *);
1.1 kristaps 66: int mlg_exit(struct md_mlg *, int);
67: int mlg_line(struct md_mlg *, char *);
68:
69: __END_DECLS
70:
71: #endif /*!ML_H*/
CVSweb