version 1.18, 2011/07/21 14:13:00 |
version 1.19, 2011/07/21 15:21:13 |
|
|
#endif |
#endif |
|
|
#include <assert.h> |
#include <assert.h> |
|
#include <limits.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
Line 188 eqn_box(struct eqn_node *ep, struct eqn_box *last, str |
|
Line 189 eqn_box(struct eqn_node *ep, struct eqn_box *last, str |
|
{ |
{ |
size_t sz; |
size_t sz; |
const char *start; |
const char *start; |
int c, i, nextc; |
int c, i, nextc, size; |
enum eqn_fontt font; |
enum eqn_fontt font; |
struct eqn_box *bp; |
struct eqn_box *bp; |
|
|
Line 201 eqn_box(struct eqn_node *ep, struct eqn_box *last, str |
|
Line 202 eqn_box(struct eqn_node *ep, struct eqn_box *last, str |
|
*sv = last; |
*sv = last; |
nextc = 1; |
nextc = 1; |
font = EQNFONT_NONE; |
font = EQNFONT_NONE; |
|
size = EQN_DEFSIZE; |
again: |
again: |
if (NULL == (start = eqn_nexttok(ep, &sz))) |
if (NULL == (start = eqn_nexttok(ep, &sz))) |
return(0); |
return(0); |
|
|
goto again; |
goto again; |
} |
} |
|
|
/* Exit this [hopefully] subexpression. */ |
if (sz == 4 && 0 == strncmp("size", start, 1)) { |
|
if (NULL == (start = eqn_nexttok(ep, &sz))) |
|
return(0); |
|
size = mandoc_strntoi(start, sz, 10); |
|
goto again; |
|
} |
|
|
if (sz == 1 && 0 == strncmp("}", start, 1)) |
if (sz == 1 && 0 == strncmp("}", start, 1)) |
return(1); |
return(1); |
|
|
bp = mandoc_calloc(1, sizeof(struct eqn_box)); |
bp = mandoc_calloc(1, sizeof(struct eqn_box)); |
bp->font = font; |
bp->font = font; |
|
bp->size = size; |
|
|
font = EQNFONT_NONE; |
font = EQNFONT_NONE; |
|
size = EQN_DEFSIZE; |
|
|
if (nextc) |
if (nextc) |
last->child = bp; |
last->child = bp; |