static stralloc from = {0}; static stralloc owner = {0}; static stralloc fromline = {0}; static stralloc fnedit = {0}; static stralloc fneditn = {0}; static datetime_sec when; static int match; static char strnum[FMT_ULONG]; static char hash[COOKIE]; char boundary[COOKIE]; static datetime_sec hashdate; static char inbuf[1024]; static substdio ssin = SUBSTDIO_FDBUF(read,0,inbuf,(int) sizeof(inbuf)); static substdio ssin2 = SUBSTDIO_FDBUF(read,0,inbuf,(int) sizeof(inbuf)); static substdio sstext; /* editing texts and reading "from" */ static char textbuf[512]; static substdio ssfrom; /* writing "from" */ static char frombuf[512]; static int fdlock; struct qmail qq; void lock(void) { fdlock = lockfile("lock");
#include "substdio.h" #include "readwrite.h" #include "exit.h" #include "scan.h" #include "fmt.h" char buf1[256]; substdio ss1 = SUBSTDIO_FDBUF(write,1,buf1,sizeof(buf1)); void puts(s) char *s; { if (substdio_puts(&ss1,s) == -1) _exit(111); } int main(argc,argv) int argc; char **argv; { char *name; char *value; unsigned long num; char strnum[FMT_ULONG]; name = argv[1]; if (!name) _exit(100); value = argv[2]; if (!value) _exit(100); scan_8long(value,&num); strnum[fmt_ulong(strnum,num)] = 0;
#include "readwrite.h" #include "substdio.h" #include "subfd.h" static char errbuf[256]; static substdio it = SUBSTDIO_FDBUF(write,2,errbuf,sizeof errbuf); substdio *const subfderr = ⁢
const char *workdir; const char *sender; const char *digestcode; struct qmail qq; int subto(const char *s,unsigned int l) { qmail_put(&qq,"T",1); qmail_put(&qq,s,l); qmail_put(&qq,"",1); return (int) l; } char inbuf[1024]; substdio ssin = SUBSTDIO_FDBUF(read,0,inbuf,sizeof(inbuf)); substdio ssin2 = SUBSTDIO_FDBUF(read,0,inbuf,sizeof(inbuf)); substdio ssnum; char numbuf[16]; substdio sstext; char textbuf[1024]; substdio ssindex; char indexbuf[1024]; int fdlock; void lockup(void) /* lock unless locked */
#include "readwrite.h" #include "substdio.h" #include "subfd.h" static char outbuf[1024]; static substdio it = SUBSTDIO_FDBUF(write,1,outbuf,sizeof outbuf); substdio *const subfdout = ⁢
OPT_FLAG(flagtook,'T',1,0), OPT_END }; stralloc mimeremove = {0}; stralloc mimereject = {0}; stralloc headerreject = {0}; struct constmap mimeremovemap; struct constmap mimerejectmap; struct constmap headerrejectmap; int mimeremoveflag = 0; char strnum[FMT_ULONG]; char buf0[256]; substdio ssin = SUBSTDIO_FDBUF(read,0,buf0,(int) sizeof(buf0)); substdio ssin2 = SUBSTDIO_FDBUF(read,0,buf0,(int) sizeof(buf0)); struct qmail qq; stralloc line = {0}; stralloc to = {0}; stralloc content = {0}; stralloc subject = {0}; stralloc boundary = {0}; stralloc precd = {0}; stralloc mydtline = {0}; unsigned int findlocal(const stralloc *sa,unsigned int n) /* n is index of '@' within sa. Returns index to last postition */ /* of local, n otherwise. */
stream.next_out = zbuf; } break; default: die_format(); } } while (stream.avail_in != 0); return len; #endif r = timeoutwrite(60,qmqpfd,buf,len); if (r <= 0) die_conn(); return r; } char buf[1024]; substdio to = SUBSTDIO_FDBUF(safewrite,-1,buf,sizeof buf); substdio from = SUBSTDIO_FDBUF(saferead,-1,buf,sizeof buf); substdio envelope = SUBSTDIO_FDBUF(subread,1,buf,sizeof buf); /* WARNING: can use only one of these at a time! */ stralloc beforemessage = {0}; stralloc message = {0}; stralloc aftermessage = {0}; char strnum[FMT_ULONG]; stralloc line = {0}; void getmess() { int match;
int r; r = timeoutread(1200,fd,buf,len); if (r <= 0) die(); return r; } int safewrite(int fd, void *buf, int len) { int r; r = timeoutwrite(1200,fd,buf,len); if (r <= 0) die(); return r; } char ssoutbuf[128]; substdio ssout = SUBSTDIO_FDBUF(safewrite,1,ssoutbuf,sizeof ssoutbuf); char ssinbuf[128]; substdio ssin = SUBSTDIO_FDBUF(saferead,0,ssinbuf,sizeof ssinbuf); void putstr(const char *s) { substdio_puts(&ssout,s); } void flush(void) { substdio_flush(&ssout); } void err(const char *s) { putstr("-ERR ");
#include <sys/types.h> #include <sys/time.h> #include <sys/param.h> #include <sys/socket.h> #include <netinet/in.h> #include "strerr.h" #include "ip.h" #include "str.h" #include "byte.h" #include "substdio.h" #include "readwrite.h" #include "select.h" #include "taia.h" char outbuf[16]; substdio ssout = SUBSTDIO_FDBUF(write,1,outbuf,sizeof outbuf); #define FATAL "taiclock: fatal: " #define WARNING "taiclock: warning: " void die_usage() { strerr_die1x(100,"taiclock: usage: taiclock ip.ad.dr.ess"); } char *host; struct ip_address ipremote; struct sockaddr_in sa; int s; char initdeltaoffset[] = {0,0,0,0,0,2,163,0,0,0,0,0,0,0,0,0};
#include "readwrite.h" #include "substdio.h" #include "subfd.h" char subfd_outbuf[SUBSTDIO_OUTSIZE]; static substdio it = SUBSTDIO_FDBUF(write,1,subfd_outbuf,SUBSTDIO_OUTSIZE); substdio *subfdout = ⁢
} int lookup(stralloc *); int lookup_cdb(const char *); int lookup_passwd(const char *); int timeout = 5; int saferead(int fd, void *buf, int len) { return timeoutread(timeout,fd,buf,len); } char ssinbuf[512]; substdio ssin = SUBSTDIO_FDBUF(saferead,0,ssinbuf,sizeof ssinbuf); stralloc line = {0}; ctrlfunc ctrls[] = { qldap_ctrl_trylogin, qldap_ctrl_generic, localdelivery_init, 0 }; int main(int argc, char **argv) { int match; unsigned int at; log_init(STDERR, ~256, 0);