#include <config.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <limits.h>
#include "mdvi.h"
#include "private.h"
Go to the source code of this file.
Definition at line 292 of file pagesel.c.
296 for(i = 0; i < 11; i++)
int mdvi_in_range |
( |
DviRange * |
range, |
|
|
int |
nitems, |
|
|
int |
value |
|
) |
| |
Definition at line 304 of file pagesel.c.
308 for(r = range; r < range + nitems; r++) {
316 cond = (value <= r->
from) && (value >= r->
to);
318 cond = (value <= r->
to) && (value >= r->
from);
319 if(cond && ((value - r->
from) % r->
step) == 0)
326 cond = (value < r->
from);
328 cond = (value > r->
from);
329 if(cond && ((value - r->
from) % r->
step) == 0)
336 cond = (value > r->
to);
338 cond = (value < r->
to);
339 if(cond && ((value - r->
to) % r->
step) == 0)
343 if((value % r->
step) == 0)
Definition at line 268 of file pagesel.c.
277 spec[0]->nranges, dvipage);
281 for(i = 1; i <= 10; i++) {
285 spec[i]->nranges, (
int)page[i]);
DviPageSpec* mdvi_parse_page_spec |
( |
const char * |
format) | |
|
Definition at line 190 of file pagesel.c.
204 for(i = 0; i < 11; i++)
212 mdvi_error(
_(
"invalid page specification `%s'\n"), format);
218 if(*format ==
'D' || *format ==
'd' || *ptr !=
'.')
232 mdvi_warning(
_(
"garbage after DVI page specification ignored\n"));
236 for(i++; *ptr ==
'.' && i <= 10; i++) {
260 mdvi_warning(
_(
"more than 10 counters in page specification\n"));
262 mdvi_warning(
_(
"garbage after TeX page specification ignored\n"));
DviRange* mdvi_parse_range |
( |
const char * |
format, |
|
|
DviRange * |
limit, |
|
|
int * |
nitems, |
|
|
char ** |
endptr |
|
) |
| |
Definition at line 36 of file pagesel.c.
51 quoted = (*format ==
'{');
92 for(cp = text = copy; !done; cp++) {
100 if(*cp == 0 || *cp ==
'.' || (*cp ==
'}' && quoted))
117 f = strtol(text, NULL, 0);
131 t = strtol(text, NULL, 0);
137 s = strtol(text, NULL, 0);
139 if(lower_given && upper_given)
141 else if(lower_given) {
147 }
else if(upper_given) {
164 one.
type = this_type;
179 if(quoted && *cp ==
'}')
182 *endptr = (
char *)format + (cp - copy);
183 if(curr && curr < size)
int mdvi_range_length |
( |
DviRange * |
range, |
|
|
int |
nitems |
|
) |
| |
Definition at line 351 of file pagesel.c.
356 for(r = range; r < range + nitems; r++) {
char* program_name = "page" |