diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-10-06 22:29:12 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-10-06 22:29:12 +0000 |
commit | 04d794422a19264dc0a985a9b145b3748fc69862 (patch) | |
tree | d3a4862033902d2b0715fbc967dad707f873374a /mandoc.h | |
parent | 2b6476580cd1b6473035ea2e2276e33efcb7fa74 (diff) | |
download | mandoc-04d794422a19264dc0a985a9b145b3748fc69862.tar.gz mandoc-04d794422a19264dc0a985a9b145b3748fc69862.tar.zst mandoc-04d794422a19264dc0a985a9b145b3748fc69862.zip |
If -Tman is specified and input is -man, echo the preprocessed (`so'
replaced by file) input. This replaces earlier behaviour of doing
nothing, which I found unexpected (mandoc should always output).
This requires a buffer in read.c that saves the input lines before being
parsed, with a special hook if `so' is invoked. This buffer is just
flushed to output if -mman is the input.
While mucking around doing this, I also alpha-ordered the mandoc.h
functions.
Ok schwarze@, with no screaming when the polished patch was published.
Diffstat (limited to 'mandoc.h')
-rw-r--r-- | mandoc.h | 35 |
1 files changed, 18 insertions, 17 deletions
@@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.95 2011/07/23 18:44:42 kristaps Exp $ */ +/* $Id: mandoc.h,v 1.96 2011/10/06 22:29:12 kristaps Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -400,30 +400,31 @@ struct man; __BEGIN_DECLS -void mparse_free(struct mparse *); -void mparse_reset(struct mparse *); -struct mparse *mparse_alloc(enum mparset, - enum mandoclevel, mandocmsg, void *); -enum mandoclevel mparse_readfd(struct mparse *, int, const char *); -void mparse_result(struct mparse *, struct mdoc **, struct man **); -const char *mparse_strerror(enum mandocerr); -const char *mparse_strlevel(enum mandoclevel); - void *mandoc_calloc(size_t, size_t); +enum mandoc_esc mandoc_escape(const char **, const char **, int *); void *mandoc_malloc(size_t); void *mandoc_realloc(void *, size_t); char *mandoc_strdup(const char *); char *mandoc_strndup(const char *, size_t); - -enum mandoc_esc mandoc_escape(const char **, const char **, int *); - struct mchars *mchars_alloc(void); +void mchars_free(struct mchars *); char mchars_num2char(const char *, size_t); int mchars_num2uc(const char *, size_t); -const char *mchars_spec2str(struct mchars *, const char *, size_t, size_t *); -int mchars_spec2cp(struct mchars *, const char *, size_t); -void mchars_free(struct mchars *); - +int mchars_spec2cp(struct mchars *, + const char *, size_t); +const char *mchars_spec2str(struct mchars *, + const char *, size_t, size_t *); +struct mparse *mparse_alloc(enum mparset, + enum mandoclevel, mandocmsg, void *); +void mparse_free(struct mparse *); +void mparse_keep(struct mparse *); +enum mandoclevel mparse_readfd(struct mparse *, int, const char *); +void mparse_reset(struct mparse *); +void mparse_result(struct mparse *, + struct mdoc **, struct man **); +const char *mparse_getkeep(const struct mparse *); +const char *mparse_strerror(enum mandocerr); +const char *mparse_strlevel(enum mandoclevel); __END_DECLS |