version 1.147, 2010/06/11 07:23:04 |
version 1.150, 2010/06/26 15:36:37 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> |
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
|
|
#include "chars.h" |
#include "chars.h" |
#include "out.h" |
#include "out.h" |
#include "term.h" |
#include "term.h" |
#include "man.h" |
|
#include "mdoc.h" |
|
#include "main.h" |
#include "main.h" |
|
|
static void spec(struct termp *, const char *, size_t); |
static void spec(struct termp *, const char *, size_t); |
Line 87 term_alloc(enum termenc enc) |
|
Line 85 term_alloc(enum termenc enc) |
|
exit(EXIT_FAILURE); |
exit(EXIT_FAILURE); |
} |
} |
|
|
p->tabwidth = 5; |
|
p->enc = enc; |
p->enc = enc; |
p->defrmargin = 78; |
|
return(p); |
return(p); |
} |
} |
|
|
Line 626 encode(struct termp *p, const char *word, size_t sz) |
|
Line 622 encode(struct termp *p, const char *word, size_t sz) |
|
|
|
|
|
size_t |
size_t |
term_vspan(const struct roffsu *su) |
term_len(const struct termp *p, size_t sz) |
{ |
{ |
|
|
|
return((*p->width)(p, ' ') * sz); |
|
} |
|
|
|
|
|
size_t |
|
term_strlen(const struct termp *p, const char *cp) |
|
{ |
|
size_t sz; |
|
|
|
for (sz = 0; *cp; cp++) |
|
sz += (*p->width)(p, *cp); |
|
|
|
return(sz); |
|
} |
|
|
|
|
|
size_t |
|
term_vspan(const struct termp *p, const struct roffsu *su) |
|
{ |
double r; |
double r; |
|
|
switch (su->unit) { |
switch (su->unit) { |
Line 662 term_vspan(const struct roffsu *su) |
|
Line 678 term_vspan(const struct roffsu *su) |
|
|
|
|
|
size_t |
size_t |
term_hspan(const struct roffsu *su) |
term_hspan(const struct termp *p, const struct roffsu *su) |
{ |
{ |
double r; |
double r; |
|
|