version 1.3, 2008/12/28 00:34:20 |
version 1.6, 2009/01/14 11:58:24 |
|
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <string.h> |
#include <string.h> |
|
#ifdef __linux__ |
|
#include <time.h> |
|
#endif |
|
|
#include "private.h" |
#include "private.h" |
|
|
|
#ifdef __linux__ |
|
extern char *strptime(const char *, const char *, struct tm *); |
|
#endif |
|
|
int |
int |
mdoc_iscdelim(char p) |
mdoc_iscdelim(char p) |
{ |
{ |
Line 126 mdoc_atotime(const char *p) |
|
Line 133 mdoc_atotime(const char *p) |
|
{ |
{ |
struct tm tm; |
struct tm tm; |
|
|
|
(void)memset(&tm, 0, sizeof(struct tm)); |
|
|
if (strptime(p, "%b %d %Y", &tm)) |
if (strptime(p, "%b %d %Y", &tm)) |
return(mktime(&tm)); |
return(mktime(&tm)); |
if (strptime(p, "%b %d, %Y", &tm)) |
if (strptime(p, "%b %d, %Y", &tm)) |
Line 263 mdoc_atoarch(const char *p) |
|
Line 272 mdoc_atoarch(const char *p) |
|
return(ARCH_zaurus); |
return(ARCH_zaurus); |
|
|
return(ARCH_DEFAULT); |
return(ARCH_DEFAULT); |
|
} |
|
|
|
|
|
enum mdoc_att |
|
mdoc_atoatt(const char *p) |
|
{ |
|
|
|
assert(p); |
|
if (0 == strcmp(p, "v1")) |
|
return(ATT_v1); |
|
else if (0 == strcmp(p, "v2")) |
|
return(ATT_v2); |
|
else if (0 == strcmp(p, "v3")) |
|
return(ATT_v3); |
|
else if (0 == strcmp(p, "v4")) |
|
return(ATT_v4); |
|
else if (0 == strcmp(p, "v5")) |
|
return(ATT_v5); |
|
else if (0 == strcmp(p, "v6")) |
|
return(ATT_v6); |
|
else if (0 == strcmp(p, "v7")) |
|
return(ATT_v7); |
|
else if (0 == strcmp(p, "32v")) |
|
return(ATT_32v); |
|
else if (0 == strcmp(p, "V.1")) |
|
return(ATT_V1); |
|
else if (0 == strcmp(p, "V.2")) |
|
return(ATT_V2); |
|
else if (0 == strcmp(p, "V.3")) |
|
return(ATT_V3); |
|
else if (0 == strcmp(p, "V.4")) |
|
return(ATT_V4); |
|
|
|
return(ATT_DEFAULT); |
|
} |
|
|
|
|
|
char * |
|
mdoc_type2a(enum mdoc_type type) |
|
{ |
|
switch (type) { |
|
case (MDOC_ROOT): |
|
return("root"); |
|
case (MDOC_BLOCK): |
|
return("block"); |
|
case (MDOC_HEAD): |
|
return("block-head"); |
|
case (MDOC_BODY): |
|
return("block-body"); |
|
case (MDOC_TAIL): |
|
return("block-tail"); |
|
case (MDOC_ELEM): |
|
return("elem"); |
|
case (MDOC_TEXT): |
|
return("text"); |
|
default: |
|
break; |
|
} |
|
|
|
abort(); |
|
/* NOTREACHED */ |
} |
} |