Beispiel #1
0
const char USAGE[] =
"ezmlm-cron: usage: ezmlm-cron [-cCdDlLvV] [-w dow] [-t hh:mm] [-i hrs] listadr code";

static const char *flagt = 0;
static const char *flagw = 0;
static unsigned long deltah = 24L;	/* default interval 24h */
static int flagconfig = 0;
static int flagdelete = 0;
static int flaglist = 0;

static struct option options[] = {
  OPT_FLAG(flagconfig,'c',1,0),
  OPT_FLAG(flagconfig,'C',0,0),
  OPT_FLAG(flagdelete,'d',1,0),
  OPT_FLAG(flagdelete,'D',0,0),
  OPT_ULONG(deltah,'i',0),
  OPT_FLAG(flaglist,'l',1,0),
  OPT_FLAG(flaglist,'L',0,0),
  OPT_CSTR(flagt,'t',0),
  OPT_CSTR(flagw,'w',0),
  OPT_END
};

static void die_syntax(stralloc *line)
{
  if (!stralloc_0(line)) die_nomem();
  strerr_die4x(100,FATAL,MSG1(ERR_SYNTAX,TXT_EZCRONRC),": ",line->s);
}

static void die_argument(void)
{
  OPT_FLAG(flagedit,'E',0,0),
  OPT_FLAG(flagstorefrom,'f',1,0),
  OPT_FLAG(flagstorefrom,'F',0,0),
  OPT_FLAG(flaglist,'l',1,"modcanlist"),
  OPT_FLAG(flaglist,'L',0,0),
  OPT_FLAG(flagunsubismod,'m',1,0),
  OPT_FLAG(flagunsubismod,'M',0,0),
  OPT_FLAG(flagnotify,'n',1,0),
  OPT_FLAG(flagnotify,'N',0,0),
  OPT_FLAG(flagsubconf,'s',1,0),
  OPT_FLAG(flagsubconf,'S',0,"nosubconfirm"),
  OPT_FLAG(flagcopyowner,'q',0,0),
  OPT_COUNTER(flagcopyowner,'Q',1,0),
  OPT_FLAG(flagunsubconf,'u',1,0),
  OPT_FLAG(flagunsubconf,'U',0,"nounsubconfirm"),
  OPT_ULONG(copylines,0,"copylines"),
  OPT_FLAG(flagpublic,0,1,"public"),
  OPT_STR(modsub,0,"modsub"),
  OPT_STR(remote,0,"remote"),
  OPT_END
};

static const char hex[]="0123456789ABCDEF";
static char urlstr[] = "%00";	/* to build a url-encoded version of a char */

static const char *dir;
static const char *workdir;
static const char *sender;

static void die_cookie(void)
{
Beispiel #3
0
#include "auto_version.h"

const char FATAL[] = "ezmlm-archive: fatal: ";
const char USAGE[] =
"ezmlm-archive: usage: ezmlm-archive [-cCFsSTvV] [-f min_msg] [-t max_msg] dir";
const char WARNING[] = "ezmlm-archive: warning: inconsistent index: ";

static int flagcreate = 0;
static unsigned long archnum = 0L;
static int flagsyncall = 0;
static unsigned long optto = 0L;

static struct option options[] = {
  OPT_FLAG(flagcreate,'c',1,0),
  OPT_FLAG(flagcreate,'C',0,0),
  OPT_ULONG(archnum,'f',0),
  OPT_ULONG_FLAG(archnum,'F',0,0),
  OPT_FLAG(flagsyncall,'s',1,0),
  OPT_FLAG(flagsyncall,'S',0,0),
  OPT_ULONG(optto,'t',0),
  OPT_ULONG_FLAG(optto,'T',0,0),
  OPT_END
};

substdio ssin;
char inbuf[1024];
substdio ssout;
char outbuf[1024];
substdio ssnum;
char numbuf[16];