15void nomem() { logmsg(
WHO,111,FATAL,
"out of memory"); }
16void die_read() { logmsg(
WHO,110,ERROR,
"unable to read input: "); }
17void die_write() { logmsg(
WHO,110,ERROR,
"unable to write output: "); }
40 if (len >
width[fieldnum])
width[fieldnum] = len;
58 for (i = len; i <
width[fieldnum]; ++i)
67void split(
void (*dofield)(),
void (*doline)())
74 for (
j = i = 0;
j <
file.len; ++
j)
75 if (
file.s[
j] ==
'\n') {
78 while ((
file.s[i] ==
' ') || (
file.s[i] ==
'\t')) ++i;
81 while ((
file.s[i] !=
' ') && (
file.s[i] !=
'\t') && (
file.s[i] !=
'\n')) ++i;
82 dofield(fieldnum++,
file.s + fieldpos,i - fieldpos);
94 if (!stralloc_append(&
file,
"\n"))
nomem();
void maxfield_check(int fieldnum, char *buf, int len)
char outbuf[BUFSIZE_MESS]
void printfield(int fieldnum, char *buf, int len)
void width_check(int fieldnum, char *buf, int len)
void split(void(*dofield)(), void(*doline)())