-/* $Id: mdoc.h,v 1.62 2009/07/06 09:21:24 kristaps Exp $ */
+/* $Id: mdoc.h,v 1.73 2009/10/30 05:58:38 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
#ifndef MDOC_H
#define MDOC_H
-#include <time.h>
-
/*
* This library implements a validating scanner/parser for ``mdoc'' roff
* macro documents, a.k.a. BSD manual page documents. The mdoc.c file
#define MDOC_En 115
#define MDOC_Dx 116
#define MDOC__Q 117
-#define MDOC_MAX 118
+#define MDOC_br 118
+#define MDOC_sp 119
+#define MDOC__U 120
+#define MDOC_MAX 121
/* What follows is a list of ALL possible macro arguments. */
#define MDOC_Emphasis 23
#define MDOC_Symbolic 24
#define MDOC_Nested 25
-#define MDOC_ARG_MAX 26
+#define MDOC_Centred 26
+#define MDOC_ARG_MAX 27
/* Type of a syntax node. */
enum mdoc_type {
SEC_SYNOPSIS,
SEC_DESCRIPTION,
SEC_IMPLEMENTATION,
+ SEC_EXIT_STATUS,
SEC_RETURN_VALUES,
- SEC_ENVIRONMENT,
+ SEC_ENVIRONMENT,
SEC_FILES,
SEC_EXAMPLES,
SEC_DIAGNOSTICS,
SEC_AUTHORS,
SEC_CAVEATS,
SEC_BUGS,
+ SEC_SECURITY,
SEC_CUSTOM /* User-defined. */
};
enum mdoc_type type;
enum mdoc_sec sec;
- /* FIXME: union/struct this with #defines. */
struct mdoc_arg *args; /* BLOCK/ELEM */
struct mdoc_node *head; /* BLOCK */
struct mdoc_node *body; /* BLOCK */
#define MDOC_IGN_CHARS (1 << 3) /* Ignore disallowed chars. */
/* Call-backs for parse messages. */
-/* FIXME: unify somehow with man_cb. */
+
struct mdoc_cb {
int (*mdoc_err)(void *, int, int, const char *);
int (*mdoc_warn)(void *, int, int, const char *);
void mdoc_free(struct mdoc *);
struct mdoc *mdoc_alloc(void *, int, const struct mdoc_cb *);
-int mdoc_reset(struct mdoc *);
+void mdoc_reset(struct mdoc *);
int mdoc_parseln(struct mdoc *, int, char *buf);
const struct mdoc_node *mdoc_node(const struct mdoc *);
const struct mdoc_meta *mdoc_meta(const struct mdoc *);
int mdoc_endparse(struct mdoc *);
-const char *mdoc_a2att(const char *);
-const char *mdoc_a2lib(const char *);
-const char *mdoc_a2st(const char *);
-
__END_DECLS
#endif /*!MDOC_H*/