]>
git.cameronkatri.com Git - mandoc.git/blob - ml.h
1 /* $Id: ml.h,v 1.15 2008/12/10 12:09:47 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.
26 #define INDENT(x) ((x) > MAXINDENT ? MAXINDENT : (x))
45 int (*ml_begin
)(struct md_mbuf
*,
46 const struct md_args
*,
48 const char *, const char *,
49 enum roffmsec
, enum roffvol
);
50 int (*ml_end
)(struct md_mbuf
*,
51 const struct md_args
*,
53 const char *, const char *,
54 enum roffmsec
, enum roffvol
);
55 ssize_t (*ml_beginstring
)(struct md_mbuf
*,
56 const struct md_args
*,
57 const char *, size_t);
58 ssize_t (*ml_endstring
)(struct md_mbuf
*,
59 const struct md_args
*,
60 const char *, size_t);
61 ssize_t (*ml_endtag
)(struct md_mbuf
*,
62 void *, const struct md_args
*,
64 ssize_t (*ml_begintag
)(struct md_mbuf
*,
65 void *, const struct md_args
*,
67 const int *, const char **);
68 int (*ml_alloc
)(void **);
69 void (*ml_free
)(void *);
74 int ml_putstring(struct md_mbuf
*,
75 const char *, size_t *);
76 int ml_nputstring(struct md_mbuf
*,
77 const char *, size_t, size_t *);
78 int ml_nputs(struct md_mbuf
*,
79 const char *, size_t, size_t *);
80 int ml_puts(struct md_mbuf
*, const char *, size_t *);
81 int ml_putchars(struct md_mbuf
*,
82 char, size_t, size_t *);
84 /* FIXME: move into mlg.h or private.h. */
85 struct md_mlg
*mlg_alloc(const struct md_args
*,
86 const struct md_rbuf
*, struct md_mbuf
*,
87 const struct ml_cbs
*);
88 int mlg_exit(struct md_mlg
*, int);
89 int mlg_line(struct md_mlg
*, char *);
91 int ml_tagput(struct md_mbuf
*,
92 enum ml_scope
, const char *, size_t *);