Example #1
0
/* ARGSUSED */
static void
print_mdoc_head(MDOC_ARGS)
{

	print_gen_head(h);
	bufinit(h);
	bufcat_fmt(h, "%s(%s)", m->title, m->msec);

	if (m->arch)
		bufcat_fmt(h, " (%s)", m->arch);

	print_otag(h, TAG_TITLE, 0, NULL);
	print_text(h, h->buf);
}
void
buffmt_man(struct html *h, 
		const char *name, const char *sec)
{
	const char	*p, *pp;

	pp = h->base_man;
	
	bufinit(h);
	while (NULL != (p = strchr(pp, '%'))) {
		bufncat(h, pp, (size_t)(p - pp));
		switch (*(p + 1)) {
		case('S'):
			bufcat(h, sec ? sec : "1");
			break;
		case('N'):
			bufcat_fmt(h, "%s", name);
			break;
		default:
			bufncat(h, p, 2);
			break;
		}
		pp = p + 2;
	}
	if (pp)
		bufcat(h, pp);
}
void
bufcat_id(struct html *h, const char *src)
{

	/* Cf. <http://www.w3.org/TR/html4/types.html#h-6.2>. */

	while ('\0' != *src)
		bufcat_fmt(h, "%.2x", *src++);
}
void
bufcat_su(struct html *h, const char *p, const struct roffsu *su)
{
	double		 v;

	v = su->scale;
	if (SCALE_MM == su->unit && 0.0 == (v /= 100.0))
		v = 1.0;

	bufcat_fmt(h, "%s: %.2f%s;", p, v, roffscales[su->unit]);
}
Example #5
0
static void
print_man_head(MAN_ARGS)
{

	print_gen_head(h);
	assert(man->title);
	assert(man->msec);
	bufcat_fmt(h, "%s(%s)", man->title, man->msec);
	print_otag(h, TAG_TITLE, 0, NULL);
	print_text(h, h->buf);
}