Annotation of mandoc/mmain.h, Revision 1.5
1.5 ! kristaps 1: /* $Id: mmain.h,v 1.4 2009/02/23 15:34:53 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 MMAIN_H
20: #define MMAIN_H
21:
22: /*
23: * This is a convenience library for utilities implementing mdoc(3)
24: * accepting a similar set of command-line patterns. mmain handles
1.2 kristaps 25: * error reporting (to the terminal), command-line parsing, preparing
26: * and reading the input file, and enacting the parse itself.
1.1 kristaps 27: */
28:
29: #include "mdoc.h"
30:
1.4 kristaps 31: /* Rules for "dead" functions: */
32: #if defined(__NetBSD__)
33: #define dead_pre __dead
34: #define dead_post __attribute__((__noreturn__))
35: #elif defined(__OpenBSD__)
36: #define dead_pre __dead
37: #define dead_post /* Nothing. */
38: #else
39: #define dead_pre /* Nothing. */
40: #define dead_post __attribute__((__noreturn__))
1.3 kristaps 41: #endif
42:
1.1 kristaps 43: __BEGIN_DECLS
44:
45: struct mmain;
46:
47: struct mmain *mmain_alloc(void);
1.4 kristaps 48: dead_pre void mmain_exit(struct mmain *, int) dead_post;
1.2 kristaps 49: int mmain_getopt(struct mmain *, int, char *[],
1.5 ! kristaps 50: const char *, const char *,
! 51: const char *, void *,
! 52: int (*)(void *, int, char *));
! 53: struct mdoc *mmain_mdoc(struct mmain *, const char *);
! 54: void mmain_reset(struct mmain *);
! 55: void mmain_free(struct mmain *);
! 56: void mmain_prepare(struct mmain *, const char *);
! 57: struct mdoc *mmain_process(struct mmain *);
1.1 kristaps 58:
59: __END_DECLS
60:
61: #endif /*!MMAIN_H*/
CVSweb