-/* $Id: libmdoc.h,v 1.48 2010/05/17 22:11:42 kristaps Exp $ */
+/* $Id: libmdoc.h,v 1.54 2010/06/26 15:36:37 kristaps Exp $ */
/*
- * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
+ * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#ifndef LIBMDOC_H
#define LIBMDOC_H
+#include "regs.h"
#include "mdoc.h"
enum mdoc_next {
#define MDOC_NEWLINE (1 << 3) /* first macro/text in a line */
#define MDOC_PHRASELIT (1 << 4) /* literal within a partila phrase */
#define MDOC_PPHRASE (1 << 5) /* within a partial phrase */
+#define MDOC_FREECOL (1 << 6) /* `It' invocation should close */
int pflags;
enum mdoc_next next;
struct mdoc_node *last;
enum mdoc_sec lastsec;
};
-enum merr {
- ETAILWS = 0,
- EQUOTPARM,
- EQUOTTERM,
- EARGVAL,
- EBODYPROL,
- EPROLBODY,
- ETEXTPROL,
- ENOBLANK,
- ETOOLONG,
- EESCAPE,
- EPRINT,
- ENODAT,
- ENOPROLOGUE,
- ELINE,
- EATT,
- ENAME,
- ELISTTYPE,
- EDISPTYPE,
- EMULTIDISP,
- EMULTILIST,
- ESECNAME,
- ENAMESECINC,
- EARGREP,
- EBOOL,
- ECOLMIS,
- ENESTDISP,
- EMISSWIDTH,
- EWRONGMSEC,
- ESECOOO,
- ESECREP,
- EBADSTAND,
- ENOMULTILINE,
- EMULTILINE,
- ENOLINE,
- EPROLOOO,
- EPROLREP,
- EBADMSEC,
- EFONT,
- EBADDATE,
- ENUMFMT,
- ENOWIDTH,
- EUTSNAME,
- EOBS,
- EIMPBRK,
- EIGNE,
- EOPEN,
- EQUOTPHR,
- ENOCTX,
- ELIB,
- EBADCHILD,
- ENOTYPE,
- EBADCOMMENT,
- MERRMAX
-};
-
#define MACRO_PROT_ARGS struct mdoc *m, enum mdoct tok, \
int line, int ppos, int *pos, char *buf
const char *mdoc_a2arch(const char *);
const char *mdoc_a2vol(const char *);
const char *mdoc_a2msec(const char *);
-int mdoc_valid_pre(struct mdoc *,
- const struct mdoc_node *);
+int mdoc_valid_pre(struct mdoc *, struct mdoc_node *);
int mdoc_valid_post(struct mdoc *);
int mdoc_action_pre(struct mdoc *,
- const struct mdoc_node *);
+ struct mdoc_node *);
int mdoc_action_post(struct mdoc *);
enum margverr mdoc_argv(struct mdoc *, int, enum mdoct,
struct mdoc_arg **, int *, char *);