version 1.14, 2015/02/25 14:37:17 |
version 1.15, 2015/02/25 14:49:14 |
Line 122 texiabort(struct texi *p, const char *errstring) |
|
Line 122 texiabort(struct texi *p, const char *errstring) |
|
void |
void |
texiwarn(const struct texi *p, const char *fmt, ...) |
texiwarn(const struct texi *p, const char *fmt, ...) |
{ |
{ |
va_list ap; |
va_list ap; |
|
const struct texifile *f; |
|
|
fprintf(stderr, "%s:%zu:%zu: warning: ", |
f = &p->files[p->filepos - 1]; |
p->files[p->filepos - 1].name, |
|
p->files[p->filepos - 1].line + 1, |
if (f->insplice) |
p->files[p->filepos - 1].col + 1); |
fprintf(stderr, "%s:%zu:%zu (%zuB left in splice): " |
|
"warning: ", f->name, f->line + 1, |
|
f->col + 1, f->insplice); |
|
else |
|
fprintf(stderr, "%s:%zu:%zu: warning: ", |
|
f->name, f->line + 1, f->col + 1); |
|
|
va_start(ap, fmt); |
va_start(ap, fmt); |
vfprintf(stderr, fmt, ap); |
vfprintf(stderr, fmt, ap); |
va_end(ap); |
va_end(ap); |
Line 141 texiwarn(const struct texi *p, const char *fmt, ...) |
|
Line 148 texiwarn(const struct texi *p, const char *fmt, ...) |
|
void |
void |
texierr(struct texi *p, const char *fmt, ...) |
texierr(struct texi *p, const char *fmt, ...) |
{ |
{ |
va_list ap; |
va_list ap; |
|
struct texifile *f; |
|
|
fprintf(stderr, "%s:%zu:%zu: error: ", |
f = &p->files[p->filepos - 1]; |
p->files[p->filepos - 1].name, |
|
p->files[p->filepos - 1].line + 1, |
if (f->insplice) |
p->files[p->filepos - 1].col + 1); |
fprintf(stderr, "%s:%zu:%zu: (%zuB left in splice): " |
|
"error: ", f->name, f->line + 1, |
|
f->col + 1, f->insplice); |
|
else |
|
fprintf(stderr, "%s:%zu:%zu: error: ", |
|
f->name, f->line + 1, f->col + 1); |
|
|
va_start(ap, fmt); |
va_start(ap, fmt); |
vfprintf(stderr, fmt, ap); |
vfprintf(stderr, fmt, ap); |
va_end(ap); |
va_end(ap); |
Line 306 texivspace(struct texi *p) |
|
Line 320 texivspace(struct texi *p) |
|
void |
void |
advance(struct texi *p, size_t *pos) |
advance(struct texi *p, size_t *pos) |
{ |
{ |
|
struct texifile *f; |
|
|
if ('\n' == BUF(p)[*pos]) { |
f = &p->files[p->filepos - 1]; |
p->files[p->filepos - 1].line++; |
|
p->files[p->filepos - 1].col = 0; |
if (0 == f->insplice) { |
|
if ('\n' == BUF(p)[*pos]) { |
|
f->line++; |
|
f->col = 0; |
|
} else |
|
f->col++; |
} else |
} else |
p->files[p->filepos - 1].col++; |
--f->insplice; |
|
|
(*pos)++; |
(*pos)++; |
} |
} |
Line 871 texisplice(struct texi *p, const char *buf, size_t sz, |
|
Line 891 texisplice(struct texi *p, const char *buf, size_t sz, |
|
f->map = cp; |
f->map = cp; |
} |
} |
|
|
|
f->insplice += sz; |
memmove(f->map + *pos + sz, f->map + *pos, f->mapsz - *pos); |
memmove(f->map + *pos + sz, f->map + *pos, f->mapsz - *pos); |
memcpy(f->map + *pos, buf, sz); |
memcpy(f->map + *pos, buf, sz); |
f->mapsz += sz; |
f->mapsz += sz; |