1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 1997-9, 2000, 2007, 2009, 2010 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 #ifndef OUTPUT_OPTIONS_H
18 #define OUTPUT_OPTIONS_H 1
20 /* Helper functions for driver option parsing. */
23 #include "libpspp/compiler.h"
24 #include "libpspp/string-map.h"
25 #include "libpspp/string-array.h"
32 const char *driver_name;
33 struct string_map map;
34 struct string_array garbage;
37 /* An option being parsed. */
40 const char *driver_name; /* Driver's name, for use in error messages. */
41 const char *name; /* Option name, for use in error messages. */
42 const char *value; /* Value supplied by user (NULL if none). */
43 const char *default_value; /* Default value supplied by driver. */
46 struct driver_option driver_option_get (struct driver_options *,
48 const char *default_value);
50 void parse_paper_size (struct driver_option, double *h, double *v);
51 bool parse_boolean (struct driver_option);
53 int parse_enum (struct driver_option, ...) SENTINEL(0);
54 #define parse_enum(...) parse_enum(__VA_ARGS__, NULL_SENTINEL)
56 int parse_int (struct driver_option, int min_value, int max_value);
57 double parse_dimension (struct driver_option);
58 char *parse_string (struct driver_option);
59 char *parse_chart_file_name (struct driver_option);
61 struct cell_color parse_color (struct driver_option);
62 bool parse_color__ (const char *, struct cell_color *);
64 #endif /* output/options.h */