version 1.54, 2014/07/09 09:19:03 |
version 1.57, 2014/07/09 12:09:04 |
|
|
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
#if defined(__sun) |
|
/* for stat() */ |
|
#include <fcntl.h> |
|
#include <sys/types.h> |
|
#include <sys/stat.h> |
|
#endif |
|
|
|
#include "mandoc.h" |
#include "mandoc.h" |
#include "mandoc_aux.h" |
#include "mandoc_aux.h" |
#include "main.h" |
#include "main.h" |
|
|
struct req { |
struct req { |
struct query q; |
struct query q; |
char **p; /* array of available manroots */ |
char **p; /* array of available manroots */ |
size_t psz; |
size_t psz; /* number of available manroots */ |
enum page page; |
enum page page; |
}; |
}; |
|
|
Line 129 html_putchar(char c) |
|
Line 122 html_putchar(char c) |
|
break; |
break; |
} |
} |
} |
} |
|
|
static void |
static void |
http_printquery(const struct req *req) |
http_printquery(const struct req *req) |
{ |
{ |
Line 151 http_printquery(const struct req *req) |
|
Line 145 http_printquery(const struct req *req) |
|
} |
} |
} |
} |
|
|
|
|
static void |
static void |
html_printquery(const struct req *req) |
html_printquery(const struct req *req) |
{ |
{ |
Line 683 format(const struct req *req, const char *file) |
|
Line 676 format(const struct req *req, const char *file) |
|
return; |
return; |
} |
} |
|
|
mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_FATAL, NULL, NULL); |
mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_FATAL, NULL, |
|
req->q.manroot); |
rc = mparse_readfd(mp, fd, file); |
rc = mparse_readfd(mp, fd, file); |
close(fd); |
close(fd); |
|
|
Line 940 pathgen(struct req *req) |
|
Line 934 pathgen(struct req *req) |
|
return; |
return; |
|
|
while (NULL != (dp = fgetln(fp, &dpsz))) { |
while (NULL != (dp = fgetln(fp, &dpsz))) { |
|
if ('\n' == dp[dpsz - 1]) |
|
dpsz--; |
req->p = mandoc_realloc(req->p, |
req->p = mandoc_realloc(req->p, |
(req->psz + 1) * sizeof(char *)); |
(req->psz + 1) * sizeof(char *)); |
req->p[req->psz++] = mandoc_strndup(dp, dpsz); |
req->p[req->psz++] = mandoc_strndup(dp, dpsz); |