version 1.3, 2009/04/12 19:45:26 |
version 1.6, 2009/06/17 09:41:00 |
|
|
|
|
#include "libmdoc.h" |
#include "libmdoc.h" |
|
|
/* |
|
* Various string-literal operations: converting scalars to and from |
|
* strings, etc. |
|
*/ |
|
|
|
struct mdoc_secname { |
struct mdoc_secname { |
const char *name; |
const char *name; /* Name of section. */ |
int flag; |
int flag; |
#define MSECNAME_META (1 << 0) |
#define MSECNAME_META (1 << 0)/* Logical section (not real). */ |
}; |
}; |
|
|
/* Section names corresponding to mdoc_sec. */ |
/* Section names corresponding to mdoc_sec. */ |
Line 147 mdoc_iscdelim(char p) |
|
Line 142 mdoc_iscdelim(char p) |
|
{ |
{ |
|
|
switch (p) { |
switch (p) { |
|
case('|'): |
|
/* FALLTHROUGH */ |
case('.'): |
case('.'): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case(','): |
case(','): |
Line 214 mdoc_atotime(const char *p) |
|
Line 211 mdoc_atotime(const char *p) |
|
|
|
(void)memset(&tm, 0, sizeof(struct tm)); |
(void)memset(&tm, 0, sizeof(struct tm)); |
|
|
if (0 == strcmp(p, "$Mdocdate$")) |
if (0 == strcmp(p, "$" "Mdocdate$")) |
return(time(NULL)); |
return(time(NULL)); |
if ((pp = strptime(p, "$Mdocdate$", &tm)) && 0 == *pp) |
if ((pp = strptime(p, "$" "Mdocdate: %b %d %Y $", &tm)) && 0 == *pp) |
return(mktime(&tm)); |
return(mktime(&tm)); |
/* XXX - this matches "June 1999", which is wrong. */ |
/* XXX - this matches "June 1999", which is wrong. */ |
if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp) |
if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp) |