version 1.14, 2009/02/23 12:45:19 |
version 1.17, 2009/02/24 13:46:54 |
|
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <string.h> |
#include <string.h> |
#ifdef __linux__ |
#ifndef __OpenBSD__ |
#include <time.h> |
#include <time.h> |
#endif |
#endif |
|
|
|
|
#ifdef __linux__ |
#ifdef __linux__ |
extern char *strptime(const char *, const char *, struct tm *); |
extern char *strptime(const char *, const char *, struct tm *); |
#endif |
#endif |
|
|
|
|
|
size_t |
|
mdoc_isescape(const char *p) |
|
{ |
|
size_t c; |
|
|
|
if ('\\' != *p++) |
|
return(0); |
|
|
|
switch (*p) { |
|
case ('\\'): |
|
/* FALLTHROUGH */ |
|
case ('\''): |
|
/* FALLTHROUGH */ |
|
case ('`'): |
|
/* FALLTHROUGH */ |
|
case ('-'): |
|
/* FALLTHROUGH */ |
|
case (' '): |
|
/* FALLTHROUGH */ |
|
case ('&'): |
|
/* FALLTHROUGH */ |
|
case ('.'): |
|
/* FALLTHROUGH */ |
|
case ('e'): |
|
return(2); |
|
case ('('): |
|
if (0 == *++p || ! isgraph(*p)) |
|
return(0); |
|
if (0 == *++p || ! isgraph(*p)) |
|
return(0); |
|
return(4); |
|
case ('['): |
|
break; |
|
default: |
|
return(0); |
|
} |
|
|
|
for (c = 3, p++; *p && ']' != *p; p++, c++) |
|
if ( ! isgraph(*p)) |
|
break; |
|
|
|
return(*p == ']' ? c : 0); |
|
} |
|
|
|
|
int |
int |
mdoc_iscdelim(char p) |
mdoc_iscdelim(char p) |