version 1.1, 2017/02/04 12:03:07 |
version 1.3, 2017/02/06 19:02:37 |
|
|
#include <err.h> |
#include <err.h> |
#endif |
#endif |
#include <limits.h> |
#include <limits.h> |
|
#include <stdint.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
Line 113 main(int argc, char *argv[]) |
|
Line 114 main(int argc, char *argv[]) |
|
struct manoutput options; |
struct manoutput options; |
struct mparse *parser; |
struct mparse *parser; |
void *formatter; |
void *formatter; |
|
const char *defos; |
const char *errstr; |
const char *errstr; |
int clientfd; |
int clientfd; |
int old_stdin; |
int old_stdin; |
Line 122 main(int argc, char *argv[]) |
|
Line 124 main(int argc, char *argv[]) |
|
int state, opt; |
int state, opt; |
enum outt outtype; |
enum outt outtype; |
|
|
|
defos = NULL; |
outtype = OUTT_ASCII; |
outtype = OUTT_ASCII; |
while ((opt = getopt(argc, argv, "T:")) != -1) { |
while ((opt = getopt(argc, argv, "I:T:")) != -1) { |
switch (opt) { |
switch (opt) { |
|
case 'I': |
|
if (strncmp(optarg, "os=", 3) == 0) |
|
defos = optarg + 3; |
|
else { |
|
warnx("-I %s: Bad argument", optarg); |
|
usage(); |
|
} |
|
break; |
case 'T': |
case 'T': |
if (strcmp(optarg, "ascii") == 0) |
if (strcmp(optarg, "ascii") == 0) |
outtype = OUTT_ASCII; |
outtype = OUTT_ASCII; |
Line 156 main(int argc, char *argv[]) |
|
Line 167 main(int argc, char *argv[]) |
|
|
|
mchars_alloc(); |
mchars_alloc(); |
parser = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1, |
parser = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1, |
MANDOCLEVEL_BADARG, NULL, NULL); |
MANDOCLEVEL_BADARG, NULL, defos); |
|
|
memset(&options, 0, sizeof(options)); |
memset(&options, 0, sizeof(options)); |
switch (outtype) { |
switch (outtype) { |
Line 265 process(struct mparse *parser, enum outt outtype, void |
|
Line 276 process(struct mparse *parser, enum outt outtype, void |
|
void |
void |
usage(void) |
usage(void) |
{ |
{ |
fprintf(stderr, "usage: mandocd [-T output] socket_fd\n"); |
fprintf(stderr, "usage: mandocd [-I os=name] [-T output] socket_fd\n"); |
exit(1); |
exit(1); |
} |
} |