version 1.7, 2019/04/28 15:03:29 |
version 1.9, 2019/05/01 07:14:17 |
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
*/ |
*/ |
#include <getopt.h> |
#include <getopt.h> |
|
#include <libgen.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
#include "node.h" |
#include "node.h" |
#include "parse.h" |
#include "parse.h" |
|
#include "reorg.h" |
#include "format.h" |
#include "format.h" |
|
|
/* |
/* |
Line 40 main(int argc, char *argv[]) |
|
Line 42 main(int argc, char *argv[]) |
|
struct parse *parser; |
struct parse *parser; |
struct ptree *tree; |
struct ptree *tree; |
const char *progname; |
const char *progname; |
const char *fname; |
const char *fname, *bname; |
int ch, fd, rc, warn; |
int ch, fd, rc, warn; |
enum outt outtype; |
enum outt outtype; |
|
|
Line 96 main(int argc, char *argv[]) |
|
Line 98 main(int argc, char *argv[]) |
|
|
|
parser = parse_alloc(warn); |
parser = parse_alloc(warn); |
tree = parse_file(parser, fd, fname); |
tree = parse_file(parser, fd, fname); |
|
ptree_reorg(tree); |
rc = tree->flags & TREE_ERROR ? 3 : tree->flags & TREE_WARN ? 2 : 0; |
rc = tree->flags & TREE_ERROR ? 3 : tree->flags & TREE_WARN ? 2 : 0; |
|
|
/* Format. */ |
/* Format. */ |
Line 103 main(int argc, char *argv[]) |
|
Line 106 main(int argc, char *argv[]) |
|
if (outtype != OUTT_LINT && tree->root != NULL) { |
if (outtype != OUTT_LINT && tree->root != NULL) { |
if (rc > 2) |
if (rc > 2) |
fputc('\n', stderr); |
fputc('\n', stderr); |
if (outtype == OUTT_MDOC) |
if (outtype == OUTT_MDOC) { |
|
if (fd == -1 && (bname = basename(fname)) != NULL) |
|
printf(".\\\" automatically generated " |
|
"with %s %s\n", progname, bname); |
ptree_print_mdoc(tree); |
ptree_print_mdoc(tree); |
else |
} else |
ptree_print_tree(tree); |
ptree_print_tree(tree); |
if (rc > 2) |
if (rc > 2) |
fputs("\nThe output may be incomplete, see the " |
fputs("\nThe output may be incomplete, see the " |