version 1.1, 2010/12/29 14:38:14 |
version 1.2, 2010/12/29 15:21:34 |
Line 28 struct tbl_phrase { |
|
Line 28 struct tbl_phrase { |
|
enum tbl_cellt key; |
enum tbl_cellt key; |
}; |
}; |
|
|
#define KEYS_MAX 17 |
#define KEYS_MAX 11 |
|
|
static const struct tbl_phrase keys[KEYS_MAX] = { |
static const struct tbl_phrase keys[KEYS_MAX] = { |
{ 'c', TBL_CELL_CENTRE }, |
{ 'c', TBL_CELL_CENTRE }, |
{ 'C', TBL_CELL_CENTRE }, |
|
{ 'r', TBL_CELL_RIGHT }, |
{ 'r', TBL_CELL_RIGHT }, |
{ 'R', TBL_CELL_RIGHT }, |
|
{ 'l', TBL_CELL_LEFT }, |
{ 'l', TBL_CELL_LEFT }, |
{ 'L', TBL_CELL_LEFT }, |
|
{ 'n', TBL_CELL_NUMBER }, |
{ 'n', TBL_CELL_NUMBER }, |
{ 'N', TBL_CELL_NUMBER }, |
|
{ 's', TBL_CELL_SPAN }, |
{ 's', TBL_CELL_SPAN }, |
{ 'S', TBL_CELL_SPAN }, |
|
{ 'a', TBL_CELL_LONG }, |
{ 'a', TBL_CELL_LONG }, |
{ 'A', TBL_CELL_LONG }, |
|
{ '^', TBL_CELL_DOWN }, |
{ '^', TBL_CELL_DOWN }, |
{ '-', TBL_CELL_HORIZ }, |
{ '-', TBL_CELL_HORIZ }, |
{ '_', TBL_CELL_HORIZ }, |
{ '_', TBL_CELL_HORIZ }, |
|
|
|
|
/* TODO: GNU has many more extensions. */ |
/* TODO: GNU has many more extensions. */ |
|
|
switch (p[(*pos)++]) { |
switch (tolower(p[(*pos)++])) { |
case ('z'): |
case ('z'): |
/* FALLTHROUGH */ |
|
case ('Z'): |
|
cp->flags |= TBL_CELL_WIGN; |
cp->flags |= TBL_CELL_WIGN; |
goto mod; |
goto mod; |
case ('u'): |
case ('u'): |
/* FALLTHROUGH */ |
|
case ('U'): |
|
cp->flags |= TBL_CELL_UP; |
cp->flags |= TBL_CELL_UP; |
goto mod; |
goto mod; |
case ('e'): |
case ('e'): |
/* FALLTHROUGH */ |
|
case ('E'): |
|
cp->flags |= TBL_CELL_EQUAL; |
cp->flags |= TBL_CELL_EQUAL; |
goto mod; |
goto mod; |
case ('t'): |
case ('t'): |
/* FALLTHROUGH */ |
|
case ('T'): |
|
cp->flags |= TBL_CELL_TALIGN; |
cp->flags |= TBL_CELL_TALIGN; |
goto mod; |
goto mod; |
case ('d'): |
case ('d'): |
/* FALLTHROUGH */ |
|
case ('D'): |
|
cp->flags |= TBL_CELL_BALIGN; |
cp->flags |= TBL_CELL_BALIGN; |
goto mod; |
goto mod; |
case ('f'): |
case ('f'): |
/* FALLTHROUGH */ |
break; |
case ('B'): |
|
/* FALLTHROUGH */ |
|
case ('I'): |
|
/* FALLTHROUGH */ |
|
case ('b'): |
case ('b'): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case ('i'): |
case ('i'): |
|
(*pos)--; |
break; |
break; |
default: |
default: |
TBL_MSG(tbl, MANDOCERR_TBLLAYOUT, ln, *pos - 1); |
TBL_MSG(tbl, MANDOCERR_TBLLAYOUT, ln, *pos - 1); |
return(0); |
return(0); |
} |
} |
|
|
switch (p[(*pos)++]) { |
switch (tolower(p[(*pos)++])) { |
case ('b'): |
case ('b'): |
/* FALLTHROUGH */ |
|
case ('B'): |
|
cp->flags |= TBL_CELL_BOLD; |
cp->flags |= TBL_CELL_BOLD; |
goto mod; |
goto mod; |
case ('i'): |
case ('i'): |
/* FALLTHROUGH */ |
|
case ('I'): |
|
cp->flags |= TBL_CELL_ITALIC; |
cp->flags |= TBL_CELL_ITALIC; |
goto mod; |
goto mod; |
default: |
default: |
Line 182 cell(struct tbl *tbl, struct tbl_row *rp, |
|
Line 159 cell(struct tbl *tbl, struct tbl_row *rp, |
|
/* Parse the column position (`r', `R', `|', ...). */ |
/* Parse the column position (`r', `R', `|', ...). */ |
|
|
for (i = 0; i < KEYS_MAX; i++) |
for (i = 0; i < KEYS_MAX; i++) |
if (p[*pos] == keys[i].name) |
if (tolower(p[*pos]) == keys[i].name) |
break; |
break; |
|
|
if (KEYS_MAX == i) { |
if (KEYS_MAX == i) { |