version 1.1, 2009/03/19 16:17:27 |
version 1.4, 2009/03/19 18:30:26 |
|
|
|
|
#include "mdoc.h" |
#include "mdoc.h" |
|
|
|
#ifdef __linux__ |
|
extern int getsubopt(char **, char * const *, char **); |
|
# ifndef __dead |
|
# define __dead __attribute__((__noreturn__)) |
|
# endif |
|
#endif |
|
|
#define WARN_WALL 0x03 /* All-warnings mask. */ |
#define WARN_WALL 0x03 /* All-warnings mask. */ |
#define WARN_WCOMPAT (1 << 0) /* Compatibility warnings. */ |
#define WARN_WCOMPAT (1 << 0) /* Compatibility warnings. */ |
#define WARN_WSYNTAX (1 << 1) /* Syntax warnings. */ |
#define WARN_WSYNTAX (1 << 1) /* Syntax warnings. */ |
Line 158 main(int argc, char *argv[]) |
|
Line 165 main(int argc, char *argv[]) |
|
|
|
mdoc = mdoc_alloc(&wflags, fflags, &cb); |
mdoc = mdoc_alloc(&wflags, fflags, &cb); |
|
|
while (*argv) { |
/* |
if ( ! file(&line, &linesz, &buf, &bufsz, *argv, mdoc)) |
* Loop around available files. |
break; |
*/ |
if (outrun && ! (*outrun)(outdata, mdoc)) |
|
break; |
|
|
|
/* Reset the parser for another file. */ |
if (NULL == *argv) { |
mdoc_reset(mdoc); |
c = fdesc(&line, &linesz, &buf, &bufsz, |
argv++; |
"stdin", STDIN_FILENO, mdoc); |
|
rc = 0; |
|
if (c && NULL == outrun) |
|
rc = 1; |
|
else if (c && outrun && (*outrun)(outdata, mdoc)) |
|
rc = 1; |
|
} else { |
|
while (*argv) { |
|
c = file(&line, &linesz, &buf, |
|
&bufsz, *argv, mdoc); |
|
if ( ! c) |
|
break; |
|
if (outrun && ! (*outrun)(outdata, mdoc)) |
|
break; |
|
/* Reset the parser for another file. */ |
|
mdoc_reset(mdoc); |
|
argv++; |
|
} |
|
rc = NULL == *argv; |
} |
} |
|
|
rc = NULL == *argv; |
|
|
|
if (buf) |
if (buf) |
free(buf); |
free(buf); |
if (line) |
if (line) |
Line 405 woptions(int *wflags, char *arg) |
|
Line 426 woptions(int *wflags, char *arg) |
|
} |
} |
|
|
|
|
|
/* ARGSUSED */ |
static int |
static int |
merr(void *arg, int line, int col, const char *msg) |
merr(void *arg, int line, int col, const char *msg) |
{ |
{ |