#pragma prototyped
static const char null_usage[] =
"[-1ls5P?\n@(#)$Id: dss null query (AT&T Research) 2002-12-10 $\n]"
USAGE_LICENSE
"[+PLUGIN?\findex\f]"
"[+DESCRIPTION?The \bdss\b \bnull\b query selects all records"
" but otherwise generates no output.]"
;
static int
null_beg(Cx_t* cx, Cxexpr_t* expr, void* data, Cxdisc_t* disc)
{
char** argv = (char**)data;
int errors = error_info.errors;
for (;;)
{
switch (optget(argv, null_usage))
{
case '?':
if (disc->errorf)
(*disc->errorf)(NiL, disc, ERROR_USAGE|4, "%s", opt_info.arg);
continue;
case ':':
if (disc->errorf)
(*disc->errorf)(NiL, disc, 2, "%s", opt_info.arg);
continue;
}
break;
}
if (error_info.errors > errors)
return -1;
argv += opt_info.index;
if (*argv)
{
if (disc->errorf)
(*disc->errorf)(NiL, disc, ERROR_USAGE|4, "%s", optusage(NiL));
return -1;
}
return 0;
}
#define QUERY_null \
{ \
"null", \
"select all records; generate no output", \
CXH, \
null_beg, \
0, \
0, \
0 \
}