10 #define FATAL "ezmlm-list: fatal: "
13 strerr_die2sys(111,FATAL,"unable to write: ");
17 substdio out = SUBSTDIO_FDBUF(write,1,outbuf,sizeof(outbuf));
23 char fn[14] = "subscribers/?";
34 if (!dir) strerr_die1x(100,"ezmlm-list: usage: ezmlm-list dir");
37 strerr_die4sys(111,FATAL,"unable to switch to ",dir,": ");
39 for (fn[12] = 64;fn[12] < 64 + 53;++fn[12]) {
42 if (errno != error_noent)
43 strerr_die4sys(111,FATAL,"unable to open ",fn,": ");
46 substdio_fdbuf(&in,read,fd,inbuf,sizeof(inbuf));
48 if (getln(&in,&line,&match,'\0') == -1)
49 strerr_die4sys(111,FATAL,"unable to read ",fn,": ");
51 if (line.s[str_chr(line.s,'\n')])
52 strerr_die3x(111,FATAL,"newline in ",fn);
53 if (substdio_puts(&out,line.s + 1)) die_write();
54 if (substdio_put(&out,"\n",1) == -1) die_write();
60 if (substdio_flush(&out) == -1) die_write();