]>
git.cameronkatri.com Git - mandoc.git/blob - private.h
cc6585fff4cc40c1d446b7c9cf21eed5bfcad851
1 /* $Id: private.h,v 1.43 2008/12/17 17:18:38 kristaps Exp $ */
3 * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
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
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.
28 struct mdoc_node
*last
;
29 struct mdoc_node
*first
;
30 struct mdoc_meta meta
;
31 enum mdoc_sec sec_lastn
;
32 enum mdoc_sec sec_last
;
36 int (*fp
)(struct mdoc
*, int, int, int *, char *);
38 #define MDOC_CALLABLE (1 << 0)
39 #define MDOC_EXPLICIT (1 << 1)
42 extern const struct mdoc_macro
*const mdoc_macros
;
44 #define MACRO_PROT_ARGS struct mdoc *mdoc, int tok, \
45 int ppos, int *pos, char *buf
49 int mdoc_err(struct mdoc
*, int, int, enum mdoc_err
);
50 int mdoc_warn(struct mdoc
*, int, int, enum mdoc_warn
);
51 void mdoc_msg(struct mdoc
*, int, const char *, ...);
52 int mdoc_macro(struct mdoc
*, int, int, int *, char *);
53 int mdoc_find(const struct mdoc
*, const char *);
54 void mdoc_word_alloc(struct mdoc
*, int, const char *);
55 void mdoc_elem_alloc(struct mdoc
*, int, int,
56 size_t, const struct mdoc_arg
*,
57 size_t, const char **);
58 void mdoc_block_alloc(struct mdoc
*, int, int,
59 size_t, const struct mdoc_arg
*);
60 void mdoc_head_alloc(struct mdoc
*,
61 int, int, size_t, const char **);
62 void mdoc_body_alloc(struct mdoc
*, int, int);
63 void mdoc_node_free(struct mdoc_node
*);
64 void mdoc_sibling(struct mdoc
*, int, struct mdoc_node
**,
65 struct mdoc_node
**, struct mdoc_node
*);
66 void *mdoc_hash_alloc(void);
67 int mdoc_hash_find(const void *, const char *);
68 void mdoc_hash_free(void *);
69 int mdoc_isdelim(const char *);
70 enum mdoc_sec
mdoc_atosec(size_t, const char **);
71 enum mdoc_msec
mdoc_atomsec(const char *);
72 enum mdoc_vol
mdoc_atovol(const char *);
73 enum mdoc_arch
mdoc_atoarch(const char *);
74 time_t mdoc_atotime(const char *);
76 int macro_text(MACRO_PROT_ARGS
);
77 int macro_scoped_implicit(MACRO_PROT_ARGS
);
78 int macro_prologue_ddate(MACRO_PROT_ARGS
);
79 int macro_prologue_dtitle(MACRO_PROT_ARGS
);