7#define WHO "printmaillist"
11 logmsg(
WHO,100,FATAL,
"bad database format");
15 logmsg(
WHO,111,FATAL,
"out of memory");
21 r = buffer_get(buffer_0small,ch,1);
23 logmsg(
WHO,111,FATAL,
"unable to read input");
30 if (buffer_put(buffer_1small,ch,1) == -1)
31 logmsg(
WHO,111,FATAL,
"unable to write output");
46 if ((ch <= 32) || (ch ==
',') || (ch ==
':') || (ch ==
';') || (ch ==
'\\') || (ch ==
'#'))
68 for (i = 0; i < 4; ++i)
70 eod = cdb_unpack(
buf);
72 for (i = 4; i < 2048; ++i)
79 for (i = 0; i < 8; ++i)
getch(
buf + i);
80 klen = cdb_unpack(
buf);
89 if (!stralloc_append(&
key,&ch))
nomem();
102 if (
key.s[0] ==
'?') {
108 else if (
key.s[0] ==
':') {
115 if ((
data.s[i] ==
'.') || (
data.s[i] ==
'/')) {
120 else if ((
data.s[i] ==
'|') || (
data.s[i] ==
'!')) {
125 else if ((
data.s[i] ==
'&') && (
j - i < 900)) {
139 if (buffer_flush(buffer_1small) == -1)
140 logmsg(
WHO,111,FATAL,
"unable to write output");
int stralloc_copys(stralloc *, char const *)
void printsafe(char *buf, int len)