Initial release of Maemo 5 port of gnuplot
[gnuplot] / src / tables.h
1 /*
2  * $Id: tables.h,v 1.57.2.3 2008/06/01 06:13:48 sfeam Exp $
3  */
4
5 /* GNUPLOT - tables.h */
6
7 /*[
8  * Copyright 1999, 2004  Lars Hecking
9  *
10  * Permission to use, copy, and distribute this software and its
11  * documentation for any purpose with or without fee is hereby granted,
12  * provided that the above copyright notice appear in all copies and
13  * that both that copyright notice and this permission notice appear
14  * in supporting documentation.
15  *
16  * Permission to modify the software is granted, but not the right to
17  * distribute the complete modified source code.  Modifications are to
18  * be distributed as patches to the released version.  Permission to
19  * distribute binaries produced by compiling modified sources is granted,
20  * provided you
21  *   1. distribute the corresponding source modifications from the
22  *    released version in the form of a patch file along with the binaries,
23  *   2. add special version identification to distinguish your version
24  *    in addition to the base release version number,
25  *   3. provide your name and address as the primary contact for the
26  *    support of your modified version, and
27  *   4. retain our contact information in regard to use of the base
28  *    software.
29  * Permission to distribute the released version of the source code along
30  * with corresponding source modifications in the form of a patch file is
31  * granted with same provisions 2 through 4 for binary distributions.
32  *
33  * This software is provided "as is" without express or implied warranty
34  * to the extent permitted by applicable law.
35 ]*/
36
37 #ifndef GNUPLOT_TABLES_H
38 #define GNUPLOT_TABLES_H
39
40 #include "syscfg.h"
41
42
43 typedef void (*parsefuncp_t) __PROTO((void));
44
45 struct gen_ftable {
46     const char *key;
47     parsefuncp_t value;
48 };
49
50 /* The basic structure */
51 struct gen_table {
52     const char *key;
53     int value;
54 };
55
56 /* options for plot/splot */
57 enum plot_id {
58     P_INVALID,
59     P_AXES, P_BINARY, P_EVERY, P_INDEX, P_MATRIX, P_SMOOTH, P_THRU,
60     P_TITLE, P_NOTITLE, P_USING, P_WITH
61 };
62
63 /* options for plot ax[ei]s */
64 enum plot_axes_id {
65     AXES_X1Y1, AXES_X2Y2, AXES_X1Y2, AXES_X2Y1, AXES_NONE
66 };
67
68 /* plot smooth parameters in plot.h */
69
70 /* options for 'save' command */
71 enum save_id { SAVE_INVALID, SAVE_FUNCS, SAVE_TERMINAL, SAVE_SET, SAVE_VARS };
72
73 /* options for 'show' and 'set' commands
74  * this is rather big, we might be better off with a hash table */
75 enum set_id {
76     S_INVALID,
77     S_ACTIONTABLE, S_ALL, S_ANGLES, S_ARROW, S_AUTOSCALE, S_BARS, S_BORDER,
78     S_BOXWIDTH, S_CLABEL, S_CLIP, S_CNTRPARAM, S_CONTOUR, S_DATA, S_DATAFILE,
79     S_FUNCTIONS, S_DGRID3D, S_DUMMY, S_ENCODING, S_DECIMALSIGN, S_FIT,
80     S_FONTPATH, S_FORMAT,
81     S_GRID, S_HIDDEN3D, S_HISTORYSIZE, S_ISOSAMPLES, S_KEY,
82     S_KEYTITLE, S_LABEL,
83     S_LINESTYLE, S_LOADPATH, S_LOCALE, S_LOGSCALE, S_MACROS,
84     S_MAPPING, S_MARGIN, S_LMARGIN, S_RMARGIN, S_TMARGIN, S_BMARGIN, S_MISSING,
85 #ifdef USE_MOUSE
86     S_MOUSE,
87 #endif
88     S_MULTIPLOT, S_MX2TICS, S_NOMX2TICS, S_MXTICS, S_NOMXTICS,
89     S_MY2TICS, S_NOMY2TICS, S_MYTICS, S_NOMYTICS,
90     S_MZTICS, S_NOMZTICS,
91     S_OFFSETS, S_ORIGIN, SET_OUTPUT, S_PARAMETRIC,
92     S_PALETTE, S_PM3D, S_COLORBOX, S_COLORNAMES,
93     S_CBLABEL, S_CBRANGE, S_CBTICS, S_NOCBTICS, S_MCBTICS, S_NOMCBTICS,
94     S_CBDATA, S_CBDTICS, S_NOCBDTICS, S_CBMTICS, S_NOCBMTICS,
95     S_OBJECT, S_PLOT, S_POINTSIZE, S_POLAR, S_PRINT,
96     S_RRANGE, S_SAMPLES, S_SIZE, S_SURFACE, S_STYLE, 
97     S_TABLE, S_TERMINAL, S_TERMOPTIONS,
98     S_TICS, S_TICSCALE, S_TICSLEVEL, S_TIMEFMT, S_TIMESTAMP, S_TITLE,
99     S_TRANGE, S_URANGE, S_VARIABLES, S_VERSION, S_VIEW, S_VRANGE,
100
101     S_X2DATA, S_X2DTICS, S_NOX2DTICS, S_X2LABEL, S_X2MTICS, S_NOX2MTICS,
102     S_X2RANGE, S_X2TICS, S_NOX2TICS,
103     S_XDATA, S_XDTICS, S_NOXDTICS, S_XLABEL, S_XMTICS, S_NOXMTICS, S_XRANGE,
104     S_XTICS, S_NOXTICS,
105
106     S_Y2DATA, S_Y2DTICS, S_NOY2DTICS, S_Y2LABEL, S_Y2MTICS, S_NOY2MTICS,
107     S_Y2RANGE, S_Y2TICS, S_NOY2TICS,
108     S_YDATA, S_YDTICS, S_NOYDTICS, S_YLABEL, S_YMTICS, S_NOYMTICS, S_YRANGE,
109     S_YTICS, S_NOYTICS,
110
111     S_ZDATA, S_ZDTICS, S_NOZDTICS, S_ZLABEL, S_ZMTICS, S_NOZMTICS, S_ZRANGE,
112     S_ZTICS, S_NOZTICS,
113
114     S_ZERO, S_ZEROAXIS, S_XZEROAXIS, S_X2ZEROAXIS, S_YZEROAXIS, S_Y2ZEROAXIS,
115     S_ZZEROAXIS
116 };
117
118 enum set_hidden3d_id {
119     S_HI_INVALID,
120     S_HI_DEFAULTS, S_HI_OFFSET, S_HI_NOOFFSET, S_HI_TRIANGLEPATTERN,
121     S_HI_UNDEFINED, S_HI_NOUNDEFINED, S_HI_ALTDIAGONAL, S_HI_NOALTDIAGONAL,
122     S_HI_BENTOVER, S_HI_NOBENTOVER
123 };
124
125 enum set_key_id {
126     S_KEY_INVALID,
127     S_KEY_TOP, S_KEY_BOTTOM, S_KEY_LEFT, S_KEY_RIGHT, S_KEY_CENTER,
128     S_KEY_VERTICAL, S_KEY_HORIZONTAL, S_KEY_OVER, S_KEY_UNDER, S_KEY_MANUAL,
129     S_KEY_INSIDE, S_KEY_OUTSIDE, S_KEY_ABOVE, S_KEY_BELOW,
130     S_KEY_TMARGIN, S_KEY_BMARGIN, S_KEY_LMARGIN, S_KEY_RMARGIN,
131     S_KEY_LLEFT, S_KEY_RRIGHT, S_KEY_REVERSE, S_KEY_NOREVERSE,
132     S_KEY_INVERT, S_KEY_NOINVERT,
133     S_KEY_ENHANCED, S_KEY_NOENHANCED,
134     S_KEY_BOX, S_KEY_NOBOX, S_KEY_SAMPLEN, S_KEY_SPACING, S_KEY_WIDTH,
135     S_KEY_HEIGHT, S_KEY_TITLE,
136     S_KEY_AUTOTITLES, S_KEY_NOAUTOTITLES,
137     S_KEY_DEFAULT, S_KEY_ON, S_KEY_OFF
138 };
139
140 enum set_colorbox_id {
141     S_COLORBOX_INVALID,
142     S_COLORBOX_VERTICAL, S_COLORBOX_HORIZONTAL,
143     S_COLORBOX_DEFAULT, S_COLORBOX_USER,
144     S_COLORBOX_BORDER, S_COLORBOX_BDEFAULT, S_COLORBOX_NOBORDER,
145     S_COLORBOX_ORIGIN, S_COLORBOX_SIZE,
146     S_COLORBOX_FRONT, S_COLORBOX_BACK
147 };
148
149 enum set_palette_id {
150     S_PALETTE_INVALID,
151     S_PALETTE_POSITIVE, S_PALETTE_NEGATIVE,
152     S_PALETTE_GRAY, S_PALETTE_COLOR, S_PALETTE_RGBFORMULAE,
153     S_PALETTE_NOPS_ALLCF, S_PALETTE_PS_ALLCF, S_PALETTE_MAXCOLORS,
154     S_PALETTE_DEFINED, S_PALETTE_FILE, S_PALETTE_FUNCTIONS,
155     S_PALETTE_MODEL, S_PALETTE_GAMMA
156 };
157
158 enum set_pm3d_id {
159     S_PM3D_INVALID,
160     S_PM3D_AT,
161     S_PM3D_INTERPOLATE,
162     S_PM3D_SCANSFORWARD, S_PM3D_SCANSBACKWARD, S_PM3D_SCANS_AUTOMATIC,
163     S_PM3D_DEPTH,
164     S_PM3D_FLUSH, S_PM3D_FTRIANGLES, S_PM3D_NOFTRIANGLES,
165     S_PM3D_CLIP_1IN, S_PM3D_CLIP_4IN,
166     S_PM3D_MAP, S_PM3D_HIDDEN, S_PM3D_NOHIDDEN,
167     S_PM3D_SOLID, S_PM3D_NOTRANSPARENT, S_PM3D_NOSOLID, S_PM3D_TRANSPARENT,
168     S_PM3D_IMPLICIT, S_PM3D_NOEXPLICIT, S_PM3D_NOIMPLICIT, S_PM3D_EXPLICIT,
169     S_PM3D_WHICH_CORNER
170 };
171
172 enum test_id {
173     TEST_INVALID,
174     TEST_TERMINAL,
175     TEST_PALETTE,
176     TEST_TIME
177 };
178
179 enum show_style_id {
180     SHOW_STYLE_INVALID,
181     SHOW_STYLE_DATA, SHOW_STYLE_FUNCTION, SHOW_STYLE_LINE,
182     SHOW_STYLE_FILLING, SHOW_STYLE_ARROW, SHOW_STYLE_RECTANGLE,
183     SHOW_STYLE_INCREMENT
184 #ifdef EAM_HISTOGRAMS
185     , SHOW_STYLE_HISTOGRAM
186 #endif
187 };
188
189 enum filledcurves_opts_id {
190     FILLEDCURVES_CLOSED,
191     FILLEDCURVES_X1, FILLEDCURVES_Y1, FILLEDCURVES_X2, FILLEDCURVES_Y2,
192     /* requirement: FILLEDCURVES_ATX1 = FILLEDCURVES_X1+4 */
193     FILLEDCURVES_ATX1, FILLEDCURVES_ATY1, FILLEDCURVES_ATX2, FILLEDCURVES_ATY2,
194     FILLEDCURVES_ATXY,
195     FILLEDCURVES_ABOVE, FILLEDCURVES_BELOW,
196     FILLEDCURVES_BETWEEN
197 };
198
199 extern const struct gen_table command_tbl[];
200 /* pm 011129: unused for 2 yers, therefore #if 0 .. #endif; in future should
201  * be split into datafile_tbl and plot_tbl: */
202 #if 0
203 extern const struct gen_table plot_tbl[];
204 #endif
205 extern const struct gen_table plot_axes_tbl[];
206 extern const struct gen_table plot_smooth_tbl[];
207 extern const struct gen_table save_tbl[];
208 extern const struct gen_table set_tbl[];
209 extern const struct gen_table test_tbl[];
210 extern const struct gen_table set_key_tbl[];
211 extern const struct gen_table set_colorbox_tbl[];
212 extern const struct gen_table set_palette_tbl[];
213 extern const struct gen_table set_pm3d_tbl[];
214 extern const struct gen_table color_model_tbl[];
215 extern const struct gen_table pm3d_color_names_tbl[];
216 extern const struct gen_table set_hidden3d_tbl[];
217 extern const struct gen_table show_style_tbl[];
218 extern const struct gen_table plotstyle_tbl[];
219
220 extern const struct gen_ftable command_ftbl[];
221
222 extern const struct gen_table filledcurves_opts_tbl[];
223
224 /* Function prototypes */
225 int lookup_table __PROTO((const struct gen_table *, int));
226 parsefuncp_t lookup_ftable __PROTO((const struct gen_ftable *, int));
227 int lookup_table_entry __PROTO((const struct gen_table *tbl, const char *search_str));
228 int lookup_table_nth __PROTO((const struct gen_table *tbl, const char *search_str));
229 int lookup_table_nth_reverse __PROTO((const struct gen_table *tbl, int table_len, const char *search_str));
230 const char * reverse_table_lookup __PROTO((const struct gen_table *tbl, int entry));
231
232
233 #endif /* GNUPLT_TABLES_H */