From 50ecaba08336212e4dc1802f15d7d3f4ffad186a Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Thu, 4 Dec 2008 19:31:57 +0000 Subject: Moved charset recognition into the filter. --- mlg.c | 138 ------------------------------------------------------------------ 1 file changed, 138 deletions(-) (limited to 'mlg.c') diff --git a/mlg.c b/mlg.c index 52bbb822..53dbfa6e 100644 --- a/mlg.c +++ b/mlg.c @@ -70,7 +70,6 @@ static int mlg_rofftail(void *); static int mlg_roffin(void *, int, int *, char **); static int mlg_roffdata(void *, int, const char *, char *); -static int mlg_rofftoken(void *, int, int); static int mlg_roffout(void *, int); static int mlg_roffblkin(void *, int, int *, char **); static int mlg_roffblkout(void *, int); @@ -357,7 +356,6 @@ mlg_alloc(const struct md_args *args, cb.roffspecial = mlg_roffspecial; cb.roffmsg = mlg_roffmsg; cb.roffdata = mlg_roffdata; - cb.rofftoken = mlg_rofftoken; if (NULL == (p = calloc(1, sizeof(struct md_mlg)))) err(1, "calloc"); @@ -551,142 +549,6 @@ mlg_roffmsg(void *arg, enum roffmsg lvl, } -static int -mlg_rofftoken(void *arg, int space, int value) -{ - struct md_mlg *p; - const char *seq; - size_t sz, res; - - assert(arg); - p = (struct md_mlg *)arg; - - switch (value) { - case (ROFFTok_Sp_A): - seq = "\\a"; - sz = 2; - break; - case (ROFFTok_Sp_B): - seq = "\\b"; - sz = 2; - break; - case (ROFFTok_Sp_F): - seq = "\\f"; - sz = 2; - break; - case (ROFFTok_Sp_N): - seq = "\\n"; - sz = 2; - break; - case (ROFFTok_Sp_R): - seq = "\\r"; - sz = 2; - break; - case (ROFFTok_Sp_T): - seq = "\\t"; - sz = 2; - break; - case (ROFFTok_Sp_V): - seq = "\\v"; - sz = 2; - break; - case (ROFFTok_Space): - seq = " "; - sz = 6; - break; - case (ROFFTok_Hyphen): - seq = "‐"; - sz = 7; - break; - case (ROFFTok_Em): - seq = "—"; - sz = 7; - break; - case (ROFFTok_En): - seq = "–"; - sz = 7; - break; - case (ROFFTok_Ge): - seq = "≥"; - sz = 7; - break; - case (ROFFTok_Le): - seq = "≤"; - sz = 7; - break; - case (ROFFTok_Rquote): - seq = "”"; - sz = 7; - break; - case (ROFFTok_Lquote): - seq = "“"; - sz = 7; - break; - case (ROFFTok_Uparrow): - seq = "↑"; - sz = 7; - break; - case (ROFFTok_Acute): - seq = "´"; - sz = 6; - break; - case (ROFFTok_Grave): - seq = "`"; - sz = 5; - break; - case (ROFFTok_Pi): - seq = "π"; - sz = 6; - break; - case (ROFFTok_Ne): - seq = "≠"; - sz = 7; - break; - case (ROFFTok_Lt): - seq = "<"; - sz = 4; - break; - case (ROFFTok_Gt): - seq = ">"; - sz = 4; - break; - case (ROFFTok_Plusmin): - seq = "±"; - sz = 6; - break; - case (ROFFTok_Infty): - seq = "∞"; - sz = 7; - break; - case (ROFFTok_Bar): - seq = "|"; - sz = 6; - break; - case (ROFFTok_Nan): - seq = "Nan"; - sz = 3; - break; - case (ROFFTok_Quote): - seq = """; - sz = 6; - break; - default: - /* TODO: print error. */ - return(0); - } - - if (space && ! ml_nputs(p->mbuf, " ", 1, &res)) - return(0); - p->pos += res; - - if ( ! ml_nputs(p->mbuf, seq, sz, &res)) - return(0); - p->pos += res; - - return(1); -} - - static int mlg_roffdata(void *arg, int space, const char *start, char *buf) { -- cgit