version 1.70, 2011/03/22 14:05:45 |
version 1.78, 2011/12/02 01:37:14 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
|
|
#ifndef LIBMDOC_H |
#ifndef LIBMDOC_H |
#define LIBMDOC_H |
#define LIBMDOC_H |
|
|
#include "mdoc.h" |
|
|
|
enum mdoc_next { |
enum mdoc_next { |
MDOC_NEXT_SIBLING = 0, |
MDOC_NEXT_SIBLING = 0, |
MDOC_NEXT_CHILD |
MDOC_NEXT_CHILD |
|
|
struct mdoc_meta meta; /* document meta-data */ |
struct mdoc_meta meta; /* document meta-data */ |
enum mdoc_sec lastnamed; |
enum mdoc_sec lastnamed; |
enum mdoc_sec lastsec; |
enum mdoc_sec lastsec; |
struct regset *regs; /* registers */ |
struct roff *roff; |
}; |
}; |
|
|
#define MACRO_PROT_ARGS struct mdoc *m, \ |
#define MACRO_PROT_ARGS struct mdoc *m, \ |
Line 64 struct mdoc_macro { |
|
Line 62 struct mdoc_macro { |
|
|
|
enum margserr { |
enum margserr { |
ARGS_ERROR, |
ARGS_ERROR, |
ARGS_EOLN, |
ARGS_EOLN, /* end-of-line */ |
ARGS_WORD, |
ARGS_WORD, /* normal word */ |
ARGS_PUNCT, |
ARGS_PUNCT, /* series of punctuation */ |
ARGS_QWORD, |
ARGS_QWORD, /* quoted word */ |
ARGS_PHRASE, |
ARGS_PHRASE, /* Ta'd phrase (-column) */ |
ARGS_PPHRASE, |
ARGS_PPHRASE, /* tabbed phrase (-column) */ |
ARGS_PEND |
ARGS_PEND /* last phrase (-column) */ |
}; |
}; |
|
|
enum margverr { |
enum margverr { |
ARGV_ERROR, |
ARGV_ERROR, |
ARGV_EOLN, |
ARGV_EOLN, /* end of line */ |
ARGV_ARG, |
ARGV_ARG, /* valid argument */ |
ARGV_WORD |
ARGV_WORD /* normal word (or bad argument---same thing) */ |
}; |
}; |
|
|
/* |
/* |
Line 126 const char *mdoc_a2lib(const char *); |
|
Line 124 const char *mdoc_a2lib(const char *); |
|
const char *mdoc_a2st(const char *); |
const char *mdoc_a2st(const char *); |
const char *mdoc_a2arch(const char *); |
const char *mdoc_a2arch(const char *); |
const char *mdoc_a2vol(const char *); |
const char *mdoc_a2vol(const char *); |
const char *mdoc_a2msec(const char *); |
|
int mdoc_valid_pre(struct mdoc *, struct mdoc_node *); |
int mdoc_valid_pre(struct mdoc *, struct mdoc_node *); |
int mdoc_valid_post(struct mdoc *); |
int mdoc_valid_post(struct mdoc *); |
enum margverr mdoc_argv(struct mdoc *, int, enum mdoct, |
enum margverr mdoc_argv(struct mdoc *, int, enum mdoct, |
struct mdoc_arg **, int *, char *); |
struct mdoc_arg **, int *, char *); |
void mdoc_argv_free(struct mdoc_arg *); |
void mdoc_argv_free(struct mdoc_arg *); |
void mdoc_argn_free(struct mdoc_arg *, int); |
|
enum margserr mdoc_args(struct mdoc *, int, |
enum margserr mdoc_args(struct mdoc *, int, |
int *, char *, enum mdoct, char **); |
int *, char *, enum mdoct, char **); |
enum margserr mdoc_zargs(struct mdoc *, int, |
enum margserr mdoc_zargs(struct mdoc *, int, |
int *, char *, int, char **); |
int *, char *, char **); |
#define ARGS_DELIM (1 << 1) |
|
#define ARGS_TABSEP (1 << 2) |
|
#define ARGS_NOWARN (1 << 3) |
|
|
|
int mdoc_macroend(struct mdoc *); |
int mdoc_macroend(struct mdoc *); |
|
|
#define DELIMSZ 6 /* hint: max possible size of a delimiter */ |
|
enum mdelim mdoc_isdelim(const char *); |
enum mdelim mdoc_isdelim(const char *); |
|
|
__END_DECLS |
__END_DECLS |