PLplot: plargs.c File Reference

PLplot 5.10.0

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Classes | Macros | Typedefs | Functions | Variables
plargs.c File Reference
`#include "plplotP.h"`
`#include <ctype.h>`

Go to the source code of this file.

## Classes
struct | PLOptionInfo
struct | DrvOptCmd

## Macros
#define | OPTMAX 1024
#define | PL_MAX_OPT_TABLES 10

## Typedefs
typedef struct DrvOptCmd | DrvOptCmd

## Functions
static int | ParseOpt (int *, const char ***, int *, const char ***, PLOptionTable *)
static int | ProcessOpt (const char *, PLOptionTable *, int *, const char ***, int *)
static int | GetOptarg (const char **, int *, const char ***, int *)
static void | Help (void)
static void | Syntax (void)
int | plSetOpt (const char *opt, const char *opt_arg)
static int | opt_h (const char *, const char *, void *)
static int | opt_v (const char *, const char *, void *)
static int | opt_verbose (const char *, const char *, void *)
static int | opt_debug (const char *, const char *, void *)
static int | opt_hack (const char *, const char *, void *)
static int | opt_dev (const char *, const char *, void *)
static int | opt_o (const char *, const char *, void *)
static int | opt_geo (const char *, const char *, void *)
static int | opt_a (const char *, const char *, void *)
static int | opt_jx (const char *, const char *, void *)
static int | opt_jy (const char *, const char *, void *)
static int | opt_mar (const char *, const char *, void *)
static int | opt_ori (const char *, const char *, void *)
static int | opt_freeaspect (const char *, const char *, void *)
static int | opt_portrait (const char *, const char *, void *)
static int | opt_width (const char *, const char *, void *)
static int | opt_bg (const char *, const char *, void *)
static int | opt_ncol0 (const char *, const char *, void *)
static int | opt_ncol1 (const char *, const char *, void *)
static int | opt_fam (const char *, const char *, void *)
static int | opt_fsiz (const char *, const char *, void *)
static int | opt_fbeg (const char *, const char *, void *)
static int | opt_finc (const char *, const char *, void *)
static int | opt_fflen (const char *, const char *, void *)
static int | opt_bufmax (const char *, const char *, void *)
static int | opt_nopixmap (const char *, const char *, void *)
static int | opt_db (const char *, const char *, void *)
static int | opt_np (const char *, const char *, void *)
static int | opt_px (const char *, const char *, void *)
static int | opt_py (const char *, const char *, void *)
static int | opt_wplt (const char *, const char *, void *)
static int | opt_drvopt (const char *, const char *, void *)
static int | opt_plserver (const char *, const char *, void *)
static int | opt_plwindow (const char *, const char *, void *)
static int | opt_auto_path (const char *, const char *, void *)
static int | opt_server_name (const char *, const char *, void *)
static int | opt_tk_file (const char *, const char *, void *)
static int | opt_dpi (const char *, const char *, void *)
static int | opt_dev_compression (const char *, const char *, void *)
static int | opt_cmap0 (const char *, const char *, void *)
static int | opt_cmap1 (const char *, const char *, void *)
static int | opt_locale (const char *, const char *, void *)
static int | opt_eofill (const char *, const char *, void *)
int | c_plsetopt (const char *opt, const char *opt_arg)
int | plMergeOpts (PLOptionTable *options, const char *name, const char **notes)
void | plClearOpts (void)
void | plResetOpts (void)
int | c_plparseopts (int *p_argc, const char **argv, PLINT mode)
void | plSetUsage (const char *program_string, const char *usage_string)
void | plOptUsage (void)
int | plParseDrvOpts (DrvOpt *acc_opt)
void | plHelpDrvOpts (DrvOpt *acc_opt)
void | plP_FreeDrvOpts ()
static int | opt_h (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))
static int | opt_v (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))
static int | opt_verbose (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))
static int | opt_debug (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))
static int | opt_hack (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))
static int | opt_dev (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_o (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_mar (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_a (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_jx (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_jy (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_ori (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_freeaspect (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))
static int | opt_portrait (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))
static int | opt_width (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_bg (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_ncol0 (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_ncol1 (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_wplt (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_drvopt (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_fam (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))
static int | opt_fsiz (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_fbeg (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_finc (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_fflen (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_np (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))
static int | opt_nopixmap (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))
static int | opt_db (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))
static int | opt_bufmax (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_server_name (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_plserver (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_plwindow (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_auto_path (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_px (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_py (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_geo (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_tk_file (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_dpi (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_dev_compression (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_cmap0 (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_cmap1 (const char *PL_UNUSED(opt), const char *opt_arg, void *PL_UNUSED(client_data))
static int | opt_locale (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))
static int | opt_eofill (const char *PL_UNUSED(opt), const char *PL_UNUSED(opt_arg), void *PL_UNUSED(client_data))

## Variables
static const char * | program = NULL
static const char * | usage = NULL
static int | mode_full
static int | mode_quiet
static int | mode_nodelete
static int | mode_showall
static int | mode_noprogram
static int | mode_nodash
static int | mode_skip
static char | opttmp [OPTMAX]
static PLOptionTable | ploption_table []
static const char * | plplot_notes []
PLOptionInfo | ploption_info_default
PLOptionInfo | ploption_info [PL_MAX_OPT_TABLES]
static DrvOptCmd | drv_opt = { NULL, NULL, NULL }
static int | tables = 1

## Detailed Description

This file contains routines to extract & process command flags. The command flags recognized by PLplot are stored in the "ploption_table" structure, along with strings giving the syntax, long help message, and option handler.

The command line parser – plparseopts() – removes all recognized flags (decreasing argc accordingly), so that invalid input may be readily detected. It can also be used to process user command line flags. The user can merge an option table of type PLOptionTable into the internal option table info structure using plMergeOpts(). Or, the user can specify that ONLY the external table(s) be parsed by calling plClearOpts() before plMergeOpts().

The default action taken by plparseopts() is as follows:

- Returns with an error if an unrecognized option or badly formed option-value pair are encountered.
- Returns immediately (return code 0) when the first non-option command line argument is found.
- Returns with the return code of the option handler, if one was called.
- Deletes command line arguments from argv list as they are found, and decrements argc accordingly.
- Does not show "invisible" options in usage or help messages.
- Assumes the program name is contained in argv[0].

These behaviors may be controlled through the "mode" argument, which can have the following bits set:

PL_PARSE_FULL – Full parsing of command line and all error messages enabled, including program exit when an error occurs. Anything on the command line that isn't recognized as a valid option or option argument is flagged as an error.

PL_PARSE_QUIET – Turns off all output except in the case of errors.

PL_PARSE_NODELETE – Turns off deletion of processed arguments.

PL_PARSE_SHOWALL – Show invisible options

PL_PARSE_NOPROGRAM – Specified if argv[0] is NOT a pointer to the program name.

PL_PARSE_NODASH – Set if leading dash is NOT required.

PL_PARSE_SKIP – Set to quietly skip over any unrecognized args.

Note: if you want to have both your option and a PLplot option of the same name processed (e.g. the -v option in plrender), do the following:

1. Tag your option with PL_OPT_NODELETE
2. Give it an option handler that uses a return code of 1.
3. Merge your option table in. By merging your table, your option will be processed before the PLplot one. The PL_OPT_NODELETE ensures that the option string is not deleted from the argv list, and the return code of 1 ensures that the parser continues looking for it.

See plrender.c for examples of actual usage.

Definition in file plargs.c.

## Macro Definition Documentation

#define OPTMAX 1024

Definition at line 185 of file plargs.c.

#define PL_MAX_OPT_TABLES 10

Definition at line 701 of file plargs.c.

## Typedef Documentation

typedef struct DrvOptCmd DrvOptCmd

## Function Documentation

int c_plparseopts | ( | int * | p_argc,
|  | const char ** | argv,
|  | PLINT | mode
| ) |  |

Process options list using current ploptions_info structure. An error in parsing the argument list causes a program exit if mode_full is set, otherwise the function returns with an error.

Parameters

  p_argc | ?
  argv | ?
  mode | ?

Returns
  0 if successful.

Definition at line 860 of file plargs.c.

int c_plsetopt | ( | const char * | opt,
|  | const char * | opt_arg
| ) |  |

Definition at line 744 of file plargs.c.

static int GetOptarg | ( | const char ** | popt_arg,
|  | int * | p_myargc,
|  | const char *** | p_argv,
|  | int * | p_argc
| ) |  |
| static

Retrieves an option argument. If an error occurs here it is a true syntax error.

Parameters

  popt_arg | ?
  p_myargc | ?
  p_argv | ?
  p_argc | ?

Returns
  0 if successful.

Definition at line 1192 of file plargs.c.

static void Help | ( | void |  | ) |
| static

Print long help message.

Definition at line 1327 of file plargs.c.

static int opt_a | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_a | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "a": Sets plot aspect ratio on page

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Plot aspect ratio.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1728 of file plargs.c.

static int opt_auto_path | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_auto_path | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "auto_path": Sets additional directories to autoload

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Additional directories to add the the load path (?).
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2472 of file plargs.c.

static int opt_bg | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_bg | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "bg": Sets background color (rgb represented in hex on command line) and alpha (represented as floating point on the command line with underscore delimiter), e.g., -bg ff0000 (set background to red with an alpha value of 1.0) -bg ff0000_0.1 (set background to red with an alpha value of 0.1

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Background RGB color in hex.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1905 of file plargs.c.

static int opt_bufmax | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_bufmax | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "bufmax": Sets size of data buffer for tk driver

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Size of the data buffer for the tk driver.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2384 of file plargs.c.

static int opt_cmap0 | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_cmap0 | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Sets color table 0 based on a cmap0.pal file.

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Name of color map 0 .pal file.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2739 of file plargs.c.

static int opt_cmap1 | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_cmap1 | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Sets color table 1 based on a cmap1.pal file.

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Name of a color map 1 .pal file.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2759 of file plargs.c.

static int opt_db | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_db | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "db": Double buffer X output (update only done on eop or Expose)

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2363 of file plargs.c.

static int opt_debug | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_debug | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "debug": Turn on debugging flag

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1622 of file plargs.c.

static int opt_dev | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_dev | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "dev": Sets output device keyword

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | The name of the output device.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1665 of file plargs.c.

static int opt_dev_compression | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_dev_compression | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Sets device compression

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Device compression (?).
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2710 of file plargs.c.

static int opt_dpi | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_dpi | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "dpi": Set dpi resolution for output device e.g., "-dpi 600x300", will set X dpi to 600 and Y dpi to 300 or e.g., "-dpi 1200" Will set both X and Y dpi to 1200 dpi

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | DPI descriptor string.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2662 of file plargs.c.

static int opt_drvopt | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_drvopt | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Get driver specific options in the form <option[=value]>[,option[=value]]* If "value" is not specified, it defaults to "1".

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | The driver specific option.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2077 of file plargs.c.

static int opt_eofill | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_eofill | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

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.

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2813 of file plargs.c.

static int opt_fam | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_fam | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "fam": Enables family output files

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2167 of file plargs.c.

static int opt_fbeg | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_fbeg | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "fbeg": Starts with the specified family member number.

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Number of the first plot.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2255 of file plargs.c.

static int opt_fflen | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_fflen | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "fflen": Specify minimum field length for family member number.

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Size of the family number field (e.g. "1", "01", "001" ?)
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2299 of file plargs.c.

static int opt_finc | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_finc | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "finc": Specify increment between family members.

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Amount to increment the plot number between plots.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2277 of file plargs.c.

static int opt_freeaspect | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_freeaspect | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "freeaspect": Allow aspect ratio to adjust to orientation swaps.

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1812 of file plargs.c.

static int opt_fsiz | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_fsiz | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "fsiz": Sets size of a family member file (may be somewhat larger since eof must occur at a page break). Also turns on familying. Example usage:

    -fsiz 5M    (5 MB)
    -fsiz 300K  (300 KB)
    -fsiz .3M   (same)
    -fsiz .5G   (half a GB)

Note case of the trailing suffix doesn't matter. If no suffix, defaults to MB.

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Family size setting.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2197 of file plargs.c.

static int opt_geo | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_geo | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "geo": Set geometry for output window, i.e., "-geometry WIDTHxHEIGHT+XOFF+YOFF" where WIDTHxHEIGHT, +XOFF+YOFF, or both must be present, and +XOFF+YOFF stands for one of the four combinations +XOFF+YOFF, +XOFF-YOFF, -XOFF+YOFF, and -XOFF-YOFF. Some examples are the following: -geometry 400x300, -geometry -100+200, and -geometry 400x300-100+200.

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Plot geometry descriptor.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2539 of file plargs.c.

static int opt_h | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_h | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "h": Issues help message

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 2.

Definition at line 1555 of file plargs.c.

static int opt_hack | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_hack | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "hack": Enables driver-specific hack(s)

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1644 of file plargs.c.

static int opt_jx | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_jx | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "jx": Sets relative justification in x

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Plot relative justification in x(?)
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1749 of file plargs.c.

static int opt_jy | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_jy | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "jy": Sets relative justification in y

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Plot relative justification in y(?)
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1770 of file plargs.c.

static int opt_locale | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_locale | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Make PLplot portable to all LC_NUMERIC locales.

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2779 of file plargs.c.

static int opt_mar | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_mar | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "mar": Sets relative margin width

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Plot margin width.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1707 of file plargs.c.

static int opt_ncol0 | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_ncol0 | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "ncol0": Sets number of colors to allocate in cmap 0 (upper bound).

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Number of color map 0 colors.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1988 of file plargs.c.

static int opt_ncol1 | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_ncol1 | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "ncol1": Sets number of colors to allocate in cmap 1 (upper bound).

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Number of color map 1 colors.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2009 of file plargs.c.

static int opt_nopixmap | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_nopixmap | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "nopixmap": Disables use of pixmaps in X drivers

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2342 of file plargs.c.

static int opt_np | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_np | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "np": Disables pause between pages

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2321 of file plargs.c.

static int opt_o | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_o | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "o": Sets output file name

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | The file family name.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1686 of file plargs.c.

static int opt_ori | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_ori | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "ori": Sets orientation

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Plot orientation.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1791 of file plargs.c.

static int opt_plserver | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_plserver | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "plserver": Sets name to use when invoking server (Tcl/TK driver only)

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Name of Tcl/TK server (?).
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2426 of file plargs.c.

static int opt_plwindow | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_plwindow | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "plwindow": Sets PLplot window name

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Name of the window.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2447 of file plargs.c.

static int opt_portrait | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_portrait | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "portrait": Set portrait mode. If plsc->portrait = 1, then the orientation for certain drivers is changed by 90 deg to portrait orientation from the default landscape orientation used by PLplot while the aspect ratio allowed to adjust using freeaspect. N.B. the driver list where this flag is honored is currently limited to ljii, ljiip, psc, ps, and pstex. A 90 deg rotation is just not appropriate for certain other drivers. These drivers where portrait mode is ignored include display drivers (e.g., xwin, tk), drivers which are subequently going to be transformed to another form (e.g., meta or pbm), or drivers which are normally used for web publishing (e.g., png, jpeg). That said, the case is not entirely clear for all drivers so the list of drivers where portrait mode is honored may increase in the future. To add to the list simply copy the small bit of code from ps.c that has to do with pls->portrait to the appropriate driver file.

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1847 of file plargs.c.

static int opt_px | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_px | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "px": Set packing in x

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | X packing (?).
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2493 of file plargs.c.

static int opt_py | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_py | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "py": Set packing in y

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Y packing (?).
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2514 of file plargs.c.

static int opt_server_name | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_server_name | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "server_name": Sets main window name of server (Tcl/TK driver only)

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | The name of the main window.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2405 of file plargs.c.

static int opt_tk_file | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_tk_file | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

File name for plserver tk_file option

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Tk file name.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2632 of file plargs.c.

static int opt_v | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_v | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "v": Issues version message

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 2.

Definition at line 1578 of file plargs.c.

static int opt_verbose | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_verbose | ( | const char * | PL_UNUSEDopt,
|  | const char * | PL_UNUSEDopt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "verbose": Turn on verbosity flag

Parameters

  PL_UNUSED( | opt ) Not used.
  PL_UNUSED( | opt_arg ) Not used.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1601 of file plargs.c.

static int opt_width | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_width | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "width": Sets pen width

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Plot pen width.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 1868 of file plargs.c.

static int opt_wplt | ( | const char * | ,
|  | const char * | ,
|  | void * |
| ) |  |
| static

static int opt_wplt | ( | const char * | PL_UNUSEDopt,
|  | const char * | opt_arg,
|  | void * | PL_UNUSEDclient_data
| ) |  |
| static

Performs appropriate action for option "wplt": Sets (zoom) window into plot (e.g. "0,0,0.5,0.5")

Parameters

  PL_UNUSED( | opt ) Not used.
  opt_arg | Zoom setting.
  PL_UNUSED( | client_data ) Not used.

returns 0.

Definition at line 2030 of file plargs.c.

static int ParseOpt | ( | int * | p_myargc,
|  | const char *** | p_argv,
|  | int * | p_argc,
|  | const char *** | p_argsave,
|  | PLOptionTable * | option_table
| ) |  |
| static

Parses & determines appropriate action for input flag.

Parameters

  p_myargc | ?
  p_argv | ?
  p_argc | ?
  p_argsave | ?
  option_table | ?

Returns
  ?

Definition at line 1003 of file plargs.c.

void plClearOpts | ( | void |  | ) |

Clear internal option table info structure.

Definition at line 825 of file plargs.c.

void plHelpDrvOpts | ( | DrvOpt * | acc_opt | ) |

Give driver specific help

Parameters

  acc_opt | ?

Definition at line 1491 of file plargs.c.

int plMergeOpts | ( | PLOptionTable * | options,
|  | const char * | name,
|  | const char ** | notes
| ) |  |

Merge user option table info structure with internal one.

Parameters

  options | ?
  name | ?
  notes | ?

Definition at line 778 of file plargs.c.

void plOptUsage | ( | void |  | ) |

Print usage & syntax message.

Definition at line 1255 of file plargs.c.

void plP_FreeDrvOpts | ( | void |  | ) |

Tidy up and free memory associated with driver options

Definition at line 1511 of file plargs.c.

int plParseDrvOpts | ( | DrvOpt * | acc_opt | ) |

Parse driver specific options

Parameters

  acc_opt | ?

Returns
  0 if successful.

Definition at line 1412 of file plargs.c.

void plResetOpts | ( | void |  | ) |

Reset internal option table info structure.

Definition at line 838 of file plargs.c.

int plSetOpt | ( | const char * | opt,
|  | const char * | opt_arg
| ) |  |

Process input strings, treating them as an option and argument pair. Returns 1 on an error.

Parameters

  opt | The option.
  opt_arg | The value to set it to.

Returns
  1 on an error.

Definition at line 738 of file plargs.c.

void plSetUsage | ( | const char * | program_string,
|  | const char * | usage_string
| ) |  |

Set the strings used in usage and syntax messages.

Parameters

  program_string | The program name.
  usage_string | String describing how to use the program.

Definition at line 1238 of file plargs.c.

static int ProcessOpt | ( | const char * | opt,
|  | PLOptionTable * | tab,
|  | int * | p_myargc,
|  | const char *** | p_argv,
|  | int * | p_argc
| ) |  |
| static

Process option (and argument if applicable).

Parameters

  opt | ?
  tab | ?
  p_myargc | ?
  p_argv | ?
  p_argc | ?

Returns
  0 if successful.

Definition at line 1063 of file plargs.c.

static void Syntax | ( | void |  | ) |
| static

Print short syntax message.

Definition at line 1276 of file plargs.c.

## Variable Documentation

DrvOptCmd drv_opt = { NULL, NULL, NULL }
| static

Definition at line 720 of file plargs.c.

int mode_full
| static

Definition at line 175 of file plargs.c.

int mode_nodash
| static

Definition at line 180 of file plargs.c.

int mode_nodelete
| static

Definition at line 177 of file plargs.c.

int mode_noprogram
| static

Definition at line 179 of file plargs.c.

int mode_quiet
| static

Definition at line 176 of file plargs.c.

int mode_showall
| static

Definition at line 178 of file plargs.c.

int mode_skip
| static

Definition at line 181 of file plargs.c.

char opttmp[OPTMAX]
| static

Definition at line 186 of file plargs.c.

PLOptionInfo ploption_info[PL_MAX_OPT_TABLES]

Initial value:
{
{
ploption_table,
"PLplot options",
plplot_notes
}
}

Definition at line 702 of file plargs.c.

PLOptionInfo ploption_info_default

Initial value:
{
ploption_table,
"PLplot options",
plplot_notes
}

Definition at line 695 of file plargs.c.

PLOptionTable ploption_table[]
| static

PLPLOT options data structure definition.

The table is defined as follows

typedef struct { const char *opt; int (*handler) (const char *, const char *, void *); void *client_data; void *var; long mode; const char *syntax; const char *desc; } PLOptionTable;

where each entry has the following meaning:

opt option string handler pointer to function for processing the option and (optionally) its argument client_data pointer to data that gets passed to (*handler) var address of variable to set based on "mode" mode governs handling of option (see below) syntax short syntax description desc long syntax description

The syntax and or desc strings can be NULL if the option is never to be described. Usually this is only used for obsolete arguments; those we just wish to hide from normal use are better made invisible (which are made visible by either specifying -showall first or PL_PARSE_SHOWALL).

The mode bits are:

PL_OPT_ARG Option has an argment PL_OPT_NODELETE Don't delete after processing PL_OPT_INVISIBLE Make invisible (usually for debugging) PL_OPT_DISABLED Ignore this option

The following mode bits cause the option to be processed as specified:

PL_OPT_FUNC Call function handler (opt, opt_arg) PL_OPT_BOOL Set *var=1 PL_OPT_INT Set *var=atoi(opt_arg) PL_OPT_FLOAT Set *var=atof(opt_arg) PL_OPT_STRING Set *var=opt_arg

where opt points to the option string and opt_arg points to the argument string.

Definition at line 240 of file plargs.c.

const char* plplot_notes[]
| static

Initial value:
{
"All parameters must be white-space delimited. Some options are driver",
"dependent. Please see the PLplot reference document for more detail.",
NULL
}

Definition at line 666 of file plargs.c.

const char* program = NULL
| static

Definition at line 172 of file plargs.c.

int tables = 1
| static

Definition at line 722 of file plargs.c.

const char* usage = NULL
| static

Definition at line 173 of file plargs.c.