103 #ifdef HAVE_CRT_EXTERNS_H
107 #include <crt_externs.h>
114 static int GetOptarg(
const char **,
int *,
const char ***,
int * );
115 static void Help(
void );
116 static void Syntax(
void );
118 #ifndef PL_DEPRECATED
119 int plSetOpt(
const char *
opt,
const char *opt_arg );
124 static int opt_h(
const char *,
const char *,
void * );
125 static int opt_v(
const char *,
const char *,
void * );
126 static int opt_verbose(
const char *,
const char *,
void * );
127 static int opt_debug(
const char *,
const char *,
void * );
128 static int opt_hack(
const char *,
const char *,
void * );
129 static int opt_dev(
const char *,
const char *,
void * );
130 static int opt_o(
const char *,
const char *,
void * );
131 static int opt_geo(
const char *,
const char *,
void * );
132 static int opt_a(
const char *,
const char *,
void * );
133 static int opt_jx(
const char *,
const char *,
void * );
134 static int opt_jy(
const char *,
const char *,
void * );
135 static int opt_mar(
const char *,
const char *,
void * );
136 static int opt_ori(
const char *,
const char *,
void * );
138 static int opt_portrait(
const char *,
const char *,
void * );
139 static int opt_width(
const char *,
const char *,
void * );
140 static int opt_bg(
const char *,
const char *,
void * );
141 static int opt_ncol0(
const char *,
const char *,
void * );
142 static int opt_ncol1(
const char *,
const char *,
void * );
143 static int opt_fam(
const char *,
const char *,
void * );
144 static int opt_fsiz(
const char *,
const char *,
void * );
145 static int opt_fbeg(
const char *,
const char *,
void * );
146 static int opt_finc(
const char *,
const char *,
void * );
147 static int opt_fflen(
const char *,
const char *,
void * );
148 static int opt_bufmax(
const char *,
const char *,
void * );
149 static int opt_nopixmap(
const char *,
const char *,
void * );
150 static int opt_db(
const char *,
const char *,
void * );
151 static int opt_np(
const char *,
const char *,
void * );
152 static int opt_px(
const char *,
const char *,
void * );
153 static int opt_py(
const char *,
const char *,
void * );
154 static int opt_wplt(
const char *,
const char *,
void * );
155 static int opt_drvopt(
const char *,
const char *,
void * );
157 static int opt_plserver(
const char *,
const char *,
void * );
158 static int opt_plwindow(
const char *,
const char *,
void * );
159 static int opt_auto_path(
const char *,
const char *,
void * );
160 static int opt_bufmax(
const char *,
const char *,
void * );
162 static int opt_tk_file(
const char *,
const char *,
void * );
163 static int opt_dpi(
const char *,
const char *,
void * );
165 static int opt_cmap0(
const char *,
const char *,
void * );
166 static int opt_cmap1(
const char *,
const char *,
void * );
167 static int opt_locale(
const char *,
const char *,
void * );
168 static int opt_eofill(
const char *,
const char *,
void * );
248 "Turns on invisible options"
257 "Print out this message"
266 "Print out the PLplot library version number"
275 "Be more verbose than usual"
284 "Print debugging info (implies -verbose)"
293 "Enable driver-specific hack(s)"
320 "X server to contact"
329 "Plots per page in x"
338 "Plots per page in y"
347 "Window size/position specified as in X, e.g., 400x300, 400x300-100+200, +100-200, etc."
356 "Window size/position specified as in X, e.g., 400x300, 400x300-100+200, +100-200, etc."
365 "Relative coordinates [0-1] of window into plot"
374 "Margin space in relative coordinates (0 to 0.5, def 0)"
383 "Page aspect ratio (def: same as output device)"
392 "Page justification in x (-0.5 to 0.5, def 0)"
401 "Page justification in y (-0.5 to 0.5, def 0)"
410 "Plot orientation (0,1,2,3=landscape,portrait,seascape,upside-down)"
419 "Allow aspect ratio to adjust to orientation swaps"
428 "Sets portrait mode (both orientation and aspect ratio)"
437 "Sets pen width (0 <= width)"
446 "Background color (FF0000=opaque red, 0000FF_0.1=blue with alpha of 0.1)"
455 "Number of colors to allocate in cmap 0 (upper bound)"
464 "Number of colors to allocate in cmap 1 (upper bound)"
473 "Create a family of output files"
481 "-fsiz size[kKmMgG]",
482 "Output family file size (e.g. -fsiz 0.5G, def MB)"
491 "First family member number on output"
500 "Increment between family members"
509 "Family member number minimum field width"
518 "Don't use pixmaps in X-based drivers"
527 "Double buffer X window output"
536 "No pause between pages"
545 "bytes sent before flushing output"
554 "Main window name of PLplot server (tk driver)"
563 "Invoked name of PLplot server (tk driver)"
572 "Name of PLplot container window (tk driver)"
581 "Additional directory(s) to autoload (tk driver)"
590 "file for plserver (tk driver)"
599 "Resolution, in dots per inch (e.g. -dpi 360x360)"
608 "Sets compression level in supporting devices"
617 "Initializes color table 0 from a cmap0.pal format file in one of standard PLplot paths."
626 "Initializes color table 1 from a cmap1.pal format file in one of standard PLplot paths."
635 "Use locale environment (e.g., LC_ALL, LC_NUMERIC, or LANG) to set LC_NUMERIC locale (which affects decimal point separator)."
644 "For the case where the boundary of the filled region is self-intersecting, use the even-odd fill rule rather than the default nonzero fill rule."
652 "-drvopt option[=value][,option[=value]]*",
653 "Driver specific options"
667 "All parameters must be white-space delimited. Some options are driver",
668 "dependent. Please see the PLplot reference document for more detail.",
701 #define PL_MAX_OPT_TABLES 10
746 int mode = 0,
argc = 2, status;
761 fprintf( stderr,
"plSetOpt: Unrecognized option %s\n", opt );
791 if ( ( tab->
handler != NULL ) ||
793 ( tab->
var != NULL ) ||
794 ( tab->
mode != 0 ) ||
795 ( tab->
syntax != NULL ) ||
796 ( tab->
desc != NULL ) )
798 plabort(
"plMergeOpts: input table improperly terminated" );
806 plabort(
"plMergeOpts: max tables limit exceeded, table not merged" );
862 const char **argsave, **argend;
863 int i, myargc, status = 0;
877 myargc = ( *p_argc );
878 argend = argv + myargc;
884 plsc->program =
plstrdup( argv[0] );
885 program = (
const char *) plsc->program;
894 for (; myargc > 0; --myargc, ++
argv )
898 if ( *argv == NULL || *argv[0] ==
'\0' )
903 for ( i =
tables - 1; i >= 0; i-- )
907 status =
ParseOpt( &myargc, &argv, p_argc, &argsave,
931 fprintf( stderr,
"\nBad command line option \"%s\"\n", argv[0] );
939 else if ( status == 1 )
945 fprintf( stderr,
"\nBad command line option \"%s\"\n", argv[0] );
953 else if ( status == 2 )
965 for ( i = 0; i < myargc; i++ )
966 *argsave++ = *argv++;
968 if ( argsave < argend )
971 #ifdef HAVE_NSGETARGC
979 *_NSGetArgc() = *p_argc;
1003 ParseOpt(
int *p_myargc,
const char ***p_argv,
int *p_argc,
const char ***p_argsave,
1013 opt = ( *p_argv )[0];
1017 for ( tab = option_table; tab->
opt; tab++ )
1026 if ( *opt == *tab->
opt && !strcmp( opt, tab->
opt ) )
1033 ( *( *p_argsave )++ ) = ( **p_argv );
1040 return (
ProcessOpt( opt, tab, p_myargc, p_argv, p_argc ) );
1067 const char *opt_arg = NULL;
1073 if ( tab->
mode & need_arg )
1075 if (
GetOptarg( &opt_arg, p_myargc, p_argv, p_argc ) )
1081 switch ( tab->
mode & 0xFF00 )
1090 "ProcessOpt: no handler specified for option %s\n",
1099 (
char *) malloc( (
size_t) ( 1 + strlen( opt_arg ) ) *
sizeof (
char ) );
1102 plabort(
"ProcessOpt: out of memory" );
1105 strcpy( copy, opt_arg );
1107 free( (
void *) copy );
1119 if ( tab->
var == NULL )
1122 "ProcessOpt: no variable specified for option %s\n",
1126 *(
int *) tab->
var = 1;
1133 if ( tab->
var == NULL )
1136 "ProcessOpt: no variable specified for option %s\n",
1140 *(
int *) tab->
var = atoi( opt_arg );
1147 if ( tab->
var == NULL )
1150 "ProcessOpt: no variable specified for option %s\n",
1154 *(
PLFLT *) tab->
var = atof( opt_arg );
1161 *(
const char **) tab->
var = opt_arg;
1169 "ProcessOpt: invalid processing mode for option %s\n",
1192 GetOptarg(
const char **popt_arg,
int *p_myargc,
const char ***p_argv,
int *p_argc )
1198 if ( ( *p_myargc ) <= 0 )
1204 if ( ( *p_argv )[0][0] ==
'-' && isalpha( ( *p_argv )[0][1] ) )
1214 *popt_arg = ( *p_argv )[0];
1220 fprintf( stderr,
"Argument missing for %s option.\n", ( *p_argv )[0] );
1238 plSetUsage(
const char *program_string,
const char *usage_string )
1240 if ( program_string != NULL )
1243 if ( usage_string != NULL )
1244 usage = usage_string;
1257 if (
usage == NULL )
1258 fprintf( stderr,
"\nUsage:\n %s [options]\n",
program );
1260 fputs(
usage, stderr );
1264 fprintf( stderr,
"\n\nType %s -h for a full description.\n\n",
1283 for ( i =
tables - 1; i >= 0; i-- )
1287 if ( ploption_info[i].
name )
1288 fprintf( stderr,
"\n%s:", ploption_info[i].name );
1290 fputs(
"\nUser options:", stderr );
1295 for ( tab = ploption_info[i].
options; tab->
opt; tab++ )
1303 if ( tab->
syntax == NULL )
1306 len = 3 + (int) strlen( tab->
syntax );
1307 if ( col + len > 79 )
1309 fprintf( stderr,
"\n " );
1312 fprintf( stderr,
" [%s]", tab->
syntax );
1315 fprintf( stderr,
"\n" );
1332 FILE *outfile = stderr;
1336 if ( getenv(
"PAGER" ) != NULL )
1337 pager = (FILE *) popen(
"$PAGER",
"w" );
1338 if ( pager == NULL )
1339 pager = (FILE *) popen(
"more",
"w" );
1340 if ( pager != NULL )
1346 if (
usage == NULL )
1347 fprintf( outfile,
"\nUsage:\n %s [options]\n",
program );
1349 fputs(
usage, outfile );
1353 for ( i =
tables - 1; i >= 0; i-- )
1357 if ( ploption_info[i].
name )
1358 fprintf( outfile,
"\n%s:\n", ploption_info[i].name );
1360 fputs(
"\nUser options:\n", outfile );
1364 for ( tab = ploption_info[i].
options; tab->
opt; tab++ )
1372 if ( tab->
desc == NULL )
1376 fprintf( outfile,
" * %-20s %s\n", tab->
syntax, tab->
desc );
1378 fprintf( outfile,
" %-20s %s\n", tab->
syntax, tab->
desc );
1383 if ( ploption_info[i].notes )
1385 putc(
'\n', outfile );
1386 for ( note = ploption_info[i].notes; *note; note++ )
1388 fputs( *note, outfile );
1389 putc(
'\n', outfile );
1395 if ( pager != NULL )
1418 memset( msg,
'\0',
sizeof ( msg ) );
1426 t = acc_opt; fl = 0;
1429 if ( strcmp( drvp->
option, t->
opt ) == 0 )
1437 fprintf( stderr,
"plParseDrvOpts: %s %s\n", t->
opt, *(
char **) t->
var_ptr );
1442 if ( sscanf( drvp->
value,
"%d", (
int *) t->
var_ptr ) != 1 )
1444 snprintf( msg,
sizeof ( msg ) - 1,
"Incorrect argument to '%s' option", drvp->
option );
1448 fprintf( stderr,
"plParseDrvOpts: %s %d\n", t->
opt, *(
int *) t->
var_ptr );
1453 if ( sscanf( drvp->
value,
"%f", (
float *) t->
var_ptr ) != 1 )
1455 snprintf( msg,
sizeof ( msg ) - 1,
"Incorrect argument to '%s' option", drvp->
option );
1459 fprintf( stderr,
"plParseDrvOpts: %s %f\n", t->
opt, *(
float *) t->
var_ptr );
1469 snprintf( msg,
sizeof ( msg ) - 1,
"Option '%s' not recognized.\n\nRecognized options for this driver are:\n", drvp->
option );
1475 while ( ( drvp = drvp->
next ) )
1498 fprintf( stderr,
"%s:\t%s\n", t->
opt, t->
hlp_msg );
1522 free( drvpl->
value );
1525 if ( drvpl != &drv_opt )
1527 }
while ( drvp != NULL );
1531 drv_opt.
value = NULL;
1532 drv_opt.
next = NULL;
1581 fprintf( stderr,
"PLplot library version: %s\n",
VERSION );
1814 plsc->freeaspect = 1;
1872 width = atof( opt_arg );
1875 fprintf( stderr,
"?invalid width\n" );
1881 plsc->widthlock = 1;
1908 char *color_field, *alpha_field;
1915 if ( *opt_arg ==
'#' )
1923 if ( strchr(
opttmp,
'_' ) )
1926 color_field = strtok(
opttmp,
"_" );
1927 alpha_field = strtok( NULL,
"_" );
1935 bgcolor = strtol( color_field, NULL, 16 );
1940 switch ( strlen( color_field ) )
1943 r = (
PLINT) ( ( bgcolor & 0xF00 ) >> 8 );
1944 g = (
PLINT) ( ( bgcolor & 0x0F0 ) >> 4 );
1945 b = (
PLINT) ( bgcolor & 0x00F );
1953 r = (
PLINT) ( ( bgcolor & 0xFF0000 ) >> 16 );
1954 g = (
PLINT) ( ( bgcolor & 0x00FF00 ) >> 8 );
1955 b = (
PLINT) ( bgcolor & 0x0000FF );
1959 fprintf( stderr,
"Unrecognized background color value %s\n", color_field );
1964 a = atof( alpha_field );
1990 plsc->ncol0 = atoi( opt_arg );
2011 plsc->ncol1 = atoi( opt_arg );
2038 if ( ( field = strtok(
opttmp,
"," ) ) == NULL )
2043 if ( ( field = strtok( NULL,
"," ) ) == NULL )
2048 if ( ( field = strtok( NULL,
"," ) ) == NULL )
2053 if ( ( field = strtok( NULL,
"," ) ) == NULL )
2083 option = (
char *) malloc( (
size_t) ( 1 + strlen( opt_arg ) ) *
sizeof (
char ) );
2084 if ( option == NULL )
2085 plexit(
"opt_drvopt: Out of memory!?" );
2087 value = (
char *) malloc( (
size_t) ( 1 + strlen( opt_arg ) ) *
sizeof (
char ) );
2088 if ( value == NULL )
2089 plexit(
"opt_drvopt: Out of memory!?" );
2092 *option = *value =
'\0';
2094 while ( ( t = *opt_arg++ ) )
2111 if ( drvp->
next == NULL )
2112 plexit(
"opt_drvopt: Out of memory!?\n" );
2119 *tt =
'\0'; tt =
value;
2139 fprintf( stderr,
"\nopt_drvopt: -drvopt parsed options:\n" );
2142 fprintf( stderr,
"%s %s\n", drvp->
option, drvp->
value );
2143 while ( drvp = drvp->
next );
2144 fprintf( stderr,
"\n" );
2147 free( option ); free( value );
2200 size_t len = strlen( opt_arg );
2201 char lastchar = opt_arg[len - 1];
2202 PLFLT multiplier = 1.0e6;
2203 char *spec = (
char *) malloc( len + 1 );
2206 plexit(
"opt_fsiz: Insufficient memory" );
2214 multiplier = 1.0e3; len--;
2218 multiplier = 1.0e6; len--;
2222 multiplier = 1.0e9; len--;
2225 strncpy( spec, opt_arg, len );
2228 bytemax = (
PLINT) ( multiplier * atof( spec ) );
2231 fprintf( stderr,
"?invalid file size %d. 2.14G is the maximum.\n", bytemax );
2234 plsfam( 1, -1, bytemax );
2257 plsc->member = atoi( opt_arg );
2279 plsc->finc = atoi( opt_arg );
2301 plsc->fflen = atoi( opt_arg );
2386 plsc->bufmax = atoi( opt_arg );
2407 plsc->server_name =
plstrdup( opt_arg );
2428 plsc->plserver =
plstrdup( opt_arg );
2449 if ( ( plsc->plwindow = (
char *) malloc( (
size_t) ( 1 + strlen( opt_arg ) ) *
sizeof (
char ) ) ) == NULL )
2451 plexit(
"opt_plwindow: Insufficient memory" );
2453 strcpy( plsc->plwindow, opt_arg );
2474 plsc->auto_path =
plstrdup( opt_arg );
2495 plssub( atoi( opt_arg ), -1 );
2516 plssub( -1, atoi( opt_arg ) );
2542 PLFLT xdpi = 0., ydpi = 0.;
2543 PLINT xwid, ywid, xoff, yoff;
2547 if ( ( plsc->geometry = (
char *) malloc( (
size_t) ( 1 + strlen( opt_arg ) ) *
sizeof (
char ) ) ) == NULL )
2549 plexit(
"opt_geo: Insufficient memory" );
2552 strcpy( plsc->geometry, opt_arg );
2554 numargs = sscanf( opt_arg,
"%dx%d%d%d", &xwid, &ywid, &xoff, &yoff );
2560 fprintf( stderr,
"?invalid xwid in -geometry %s\n", opt_arg );
2562 fprintf( stderr,
"?invalid ywid in -geometry %s\n", opt_arg );
2565 fprintf( stderr,
"?invalid xwid in -geometry %s\n", opt_arg );
2570 fprintf( stderr,
"?invalid ywid in -geometry %s\n", opt_arg );
2574 else if ( numargs == 4 )
2577 fprintf( stderr,
"?invalid xwid in -geometry %s\n", opt_arg );
2579 fprintf( stderr,
"?invalid ywid in -geometry %s\n", opt_arg );
2582 fprintf( stderr,
"?invalid xwid in -geometry %s\n", opt_arg );
2587 fprintf( stderr,
"?invalid ywid in -geometry %s\n", opt_arg );
2590 if ( abs( xoff ) == 0 )
2591 fprintf( stderr,
"?invalid xoff in -geometry %s\n", opt_arg );
2592 if ( abs( yoff ) == 0 )
2593 fprintf( stderr,
"?invalid yoff in -geometry %s\n", opt_arg );
2597 numargs = sscanf( opt_arg,
"%d%d", &xoff, &yoff );
2602 if ( abs( xoff ) == 0 )
2603 fprintf( stderr,
"?invalid xoff in -geometry %s\n", opt_arg );
2604 if ( abs( yoff ) == 0 )
2605 fprintf( stderr,
"?invalid yoff in -geometry %s\n", opt_arg );
2609 fprintf( stderr,
"?invalid -geometry %s\n", opt_arg );
2614 plspage( xdpi, ydpi, xwid, ywid, xoff, yoff );
2634 if ( ( plsc->tk_file = (
char *) malloc( (
size_t) ( 1 + strlen( opt_arg ) ) *
sizeof (
char ) ) ) == NULL )
2636 plexit(
"opt_tk_file: Insufficient memory" );
2639 strcpy( plsc->tk_file, opt_arg );
2665 PLFLT xdpi = 0., ydpi = 0.;
2666 PLINT xwid = 0, ywid = 0, xoff = 0, yoff = 0;
2670 if ( strchr(
opttmp,
'x' ) )
2672 field = strtok(
opttmp,
"x" );
2673 xdpi = atof( field );
2675 fprintf( stderr,
"?invalid xdpi\n" );
2677 if ( ( field = strtok( NULL,
" " ) ) == NULL )
2680 ydpi = atof( field );
2682 fprintf( stderr,
"?invalid ydpi\n" );
2692 plspage( xdpi, ydpi, xwid, ywid, xoff, yoff );
2714 comp = atoi( opt_arg );
2717 fprintf( stderr,
"?invalid compression\n" );
2782 if ( ( locale = setlocale( LC_NUMERIC,
"" ) ) )
2784 printf(
"LC_NUMERIC locale set to \"%s\"\n", locale );
2788 plwarn(
"Could not use invalid environment (e.g., LC_ALL, LC_NUMERIC, or LANG) to set LC_NUMERIC locale. Falling back to LC_NUMERIC \"C\" locale instead.\n" );
2789 if ( !( locale = setlocale( LC_NUMERIC,
"C" ) ) )
2791 plexit(
"Your platform is seriously broken. Not even a \"C\" locale could be set." );
2815 plsc->dev_eofill = 1;
#define PL_MAX_OPT_TABLES
int plParseDrvOpts(DrvOpt *acc_opt)
static int opt_bg(const char *, const char *, void *)
static int opt_py(const char *, const char *, void *)
#define PL_PARSE_NOPROGRAM
static int opt_o(const char *, const char *, void *)
static int opt_cmap0(const char *, const char *, void *)
static int opt_fsiz(const char *, const char *, void *)
static int opt_debug(const char *, const char *, void *)
static int opt_px(const char *, const char *, void *)
static int opt_tk_file(const char *, const char *, void *)
static int opt_fam(const char *, const char *, void *)
static int opt_wplt(const char *, const char *, void *)
void plSetUsage(const char *program_string, const char *usage_string)
static int opt_eofill(const char *, const char *, void *)
#define PL_PARSE_NODELETE
static int opt_a(const char *, const char *, void *)
void PLFLT PLINT PLINT PLFLT PLFLT PLFLT PLFLT PLINT PLINT PLINT PLFLT PLFLT PLINT PLFLT PLINT const PLINT const char *const PLINT const char *const const PLFLT const PLINT const PLINT const PLFLT * a
static int opt_fbeg(const char *, const char *, void *)
static const char * plplot_notes[]
static int opt_bufmax(const char *, const char *, void *)
static int opt_dev_compression(const char *, const char *, void *)
static const char * program
struct DrvOptCmd DrvOptCmd
static int opt_nopixmap(const char *, const char *, void *)
static int opt_fflen(const char *, const char *, void *)
int(* handler)(const char *, const char *, void *)
static int ProcessOpt(const char *, PLOptionTable *, int *, const char ***, int *)
static int opt_plserver(const char *, const char *, void *)
xl
set sign_dx [expr ($dx > 0) ? 1 : -1] set sign_dy [expr ($dy > 0) ? 1 : -1]
static int opt_finc(const char *, const char *, void *)
PLOptionInfo ploption_info_default
static int opt_server_name(const char *, const char *, void *)
int plSetOpt(const char *opt, const char *opt_arg)
static int ParseOpt(int *, const char ***, int *, const char ***, PLOptionTable *)
subroutine plspal0(filename)
static int opt_cmap1(const char *, const char *, void *)
static char opttmp[OPTMAX]
void plHelpDrvOpts(DrvOpt *acc_opt)
static const char * usage
static int opt_ncol0(const char *, const char *, void *)
static int opt_ncol1(const char *, const char *, void *)
int plMergeOpts(PLOptionTable *options, const char *name, const char **notes)
static int opt_portrait(const char *, const char *, void *)
char PLDLLIMPEXP * plstrdup(const char *src)
static int opt_dev(const char *, const char *, void *)
static int opt_mar(const char *, const char *, void *)
static int opt_dpi(const char *, const char *, void *)
static int opt_v(const char *, const char *, void *)
static int opt_h(const char *, const char *, void *)
static PLFLT value(double n1, double n2, double hue)
void plabort(const char *errormsg)
static PLOptionTable options[]
void plwarn(const char *errormsg)
static int GetOptarg(const char **, int *, const char ***, int *)
static int opt_geo(const char *, const char *, void *)
static int opt_width(const char *, const char *, void *)
static int mode_noprogram
subroutine plspal1(filename, interpolate)
static int opt_np(const char *, const char *, void *)
static int opt_jy(const char *, const char *, void *)
static int opt_locale(const char *, const char *, void *)
static int opt_jx(const char *, const char *, void *)
static int opt_ori(const char *, const char *, void *)
static int opt_plwindow(const char *, const char *, void *)
PLOptionInfo ploption_info[PL_MAX_OPT_TABLES]
int c_plsetopt(const char *opt, const char *opt_arg)
static int opt_db(const char *, const char *, void *)
int c_plparseopts(int *p_argc, const char **argv, PLINT mode)
static PLOptionTable ploption_table[]
static int opt_hack(const char *, const char *, void *)
static int opt_verbose(const char *, const char *, void *)
static int opt_auto_path(const char *, const char *, void *)
static int opt_freeaspect(const char *, const char *, void *)
void plexit(const char *errormsg)
static int opt_drvopt(const char *, const char *, void *)