version 1.89, 2009/11/15 06:45:31 |
version 1.92, 2010/01/01 17:14:27 |
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
*/ |
*/ |
|
#ifdef HAVE_CONFIG_H |
|
#include "config.h" |
|
#endif |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
|
|
#include <assert.h> |
#include <assert.h> |
Line 66 static const struct htmldata htmltags[TAG_MAX] = { |
|
Line 70 static const struct htmldata htmltags[TAG_MAX] = { |
|
{"base", HTML_CLRLINE | HTML_NOSTACK}, /* TAG_BASE */ |
{"base", HTML_CLRLINE | HTML_NOSTACK}, /* TAG_BASE */ |
}; |
}; |
|
|
|
static const char *const htmlfonts[HTMLFONT_MAX] = { |
|
"roman", |
|
"bold", |
|
"italic" |
|
}; |
|
|
static const char *const htmlattrs[ATTR_MAX] = { |
static const char *const htmlattrs[ATTR_MAX] = { |
"http-equiv", |
"http-equiv", |
"content", |
"content", |
Line 83 static const char *const htmlattrs[ATTR_MAX] = { |
|
Line 93 static const char *const htmlattrs[ATTR_MAX] = { |
|
"summary", |
"summary", |
}; |
}; |
|
|
#ifdef __linux__ |
|
extern int getsubopt(char **, char * const *, char **); |
|
#endif |
|
|
|
|
|
static void print_spec(struct html *, const char *, size_t); |
static void print_spec(struct html *, const char *, size_t); |
static void print_res(struct html *, const char *, size_t); |
static void print_res(struct html *, const char *, size_t); |
static void print_ctag(struct html *, enum htmltag); |
static void print_ctag(struct html *, enum htmltag); |
Line 221 print_res(struct html *h, const char *p, size_t len) |
|
Line 226 print_res(struct html *h, const char *p, size_t len) |
|
} |
} |
|
|
|
|
|
struct tag * |
|
print_ofont(struct html *h, enum htmlfont font) |
|
{ |
|
struct htmlpair tag; |
|
|
|
h->metal = h->metac; |
|
h->metac = font; |
|
|
|
/* FIXME: DECO_ROMAN should just close out preexisting. */ |
|
|
|
if (h->metaf && h->tags.head == h->metaf) |
|
print_tagq(h, h->metaf); |
|
|
|
PAIR_CLASS_INIT(&tag, htmlfonts[font]); |
|
h->metaf = print_otag(h, TAG_SPAN, 1, &tag); |
|
return(h->metaf); |
|
} |
|
|
|
|
static void |
static void |
print_metaf(struct html *h, enum roffdeco deco) |
print_metaf(struct html *h, enum roffdeco deco) |
{ |
{ |
const char *class; |
enum htmlfont font; |
struct htmlpair tag; |
|
|
|
switch (deco) { |
switch (deco) { |
case (DECO_BOLD): |
case (DECO_PREVIOUS): |
class = "bold"; |
font = h->metal; |
break; |
break; |
case (DECO_ITALIC): |
case (DECO_ITALIC): |
class = "italic"; |
font = HTMLFONT_ITALIC; |
break; |
break; |
|
case (DECO_BOLD): |
|
font = HTMLFONT_BOLD; |
|
break; |
case (DECO_ROMAN): |
case (DECO_ROMAN): |
class = "roman"; |
font = HTMLFONT_NONE; |
break; |
break; |
default: |
default: |
abort(); |
abort(); |
/* NOTREACHED */ |
/* NOTREACHED */ |
} |
} |
|
|
if (h->metaf) { |
(void)print_ofont(h, font); |
assert(h->tags.head); |
|
assert(h->metaf == h->tags.head); |
|
print_tagq(h, h->metaf); |
|
} |
|
|
|
PAIR_CLASS_INIT(&tag, class); |
|
h->metaf = print_otag(h, TAG_SPAN, 1, &tag); |
|
} |
} |
|
|
|
|
Line 292 print_encode(struct html *h, const char *p, int norecu |
|
Line 311 print_encode(struct html *h, const char *p, int norecu |
|
case (DECO_SPECIAL): |
case (DECO_SPECIAL): |
print_spec(h, seq, sz); |
print_spec(h, seq, sz); |
break; |
break; |
|
case (DECO_PREVIOUS): |
|
/* FALLTHROUGH */ |
case (DECO_BOLD): |
case (DECO_BOLD): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (DECO_ITALIC): |
case (DECO_ITALIC): |
Line 352 print_otag(struct html *h, enum htmltag tag, |
|
Line 373 print_otag(struct html *h, enum htmltag tag, |
|
} |
} |
|
|
|
|
/* ARGSUSED */ |
|
static void |
static void |
print_ctag(struct html *h, enum htmltag tag) |
print_ctag(struct html *h, enum htmltag tag) |
{ |
{ |