2 * $Id: command.h,v 1.41.2.2 2008/07/23 19:25:25 sfeam Exp $
5 /* GNUPLOT - command.h */
8 * Copyright 1999, 2004 Thomas Williams, Colin Kelley
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.
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,
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
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.
33 * This software is provided "as is" without express or implied warranty
34 * to the extent permitted by applicable law.
37 #ifndef GNUPLOT_COMMAND_H
38 # define GNUPLOT_COMMAND_H
43 extern char *gp_input_line;
44 extern size_t gp_input_line_len;
46 extern int inline_num;
48 typedef struct lexical_unit { /* produced by scanner */
49 TBOOLEAN is_token; /* true if token, false if a value */
51 int start_index; /* index of first char in token */
52 int length; /* length of token in chars */
55 extern struct lexical_unit *token;
56 extern int token_table_size;
57 extern int plot_token;
58 #define END_OF_COMMAND (c_token >= num_tokens || equals(c_token,";"))
60 extern char *replot_line;
62 /* flag to disable `replot` when some data are sent through stdin;
63 * used by mouse/hotkey capable terminals */
64 extern TBOOLEAN replot_disabled;
67 extern int paused_for_mouse; /* Flag the end condition we are paused until */
68 #define PAUSE_BUTTON1 001 /* Mouse button 1 */
69 #define PAUSE_BUTTON2 002 /* Mouse button 2 */
70 #define PAUSE_BUTTON3 004 /* Mouse button 3 */
71 #define PAUSE_CLICK 007 /* Any button click */
72 #define PAUSE_KEYSTROKE 010 /* Any keystroke */
73 #define PAUSE_WINCLOSE 020 /* Window close event */
74 #define PAUSE_ANY 077 /* Terminate on any of the above */
78 extern TBOOLEAN expand_macros;
81 /* output file for the print command */
82 extern FILE *print_out;
83 extern char *print_out_name;
85 extern struct udft_entry *dummy_func;
91 #if defined(MSDOS) || defined(DOS386)
93 extern char HelpFile[]; /* patch for do_help - AP */
97 extern char HelpFile[]; /* patch for do_help - DJL */
98 # endif /* _Windows */
103 # define SET_CURSOR_WAIT SetCursor(LoadCursor((HINSTANCE) NULL, IDC_WAIT))
104 # define SET_CURSOR_ARROW SetCursor(LoadCursor((HINSTANCE) NULL, IDC_ARROW))
106 # define SET_CURSOR_WAIT /* nought, zilch */
107 # define SET_CURSOR_ARROW /* nought, zilch */
110 /* wrapper for calling kill_pending_Pause_dialog() from win/winmain.c */
112 void call_kill_pending_Pause_dialog(void);
115 /* input data, parsing variables */
117 extern __far int num_tokens, c_token;
119 extern int num_tokens, c_token;
122 void raise_lower_command __PROTO((int));
123 void raise_command __PROTO((void));
124 void lower_command __PROTO((void));
126 extern void pm_raise_terminal_window __PROTO((void));
127 extern void pm_lower_terminal_window __PROTO((void));
130 extern void x11_raise_terminal_window __PROTO((int));
131 extern void x11_raise_terminal_group __PROTO((void));
132 extern void x11_lower_terminal_window __PROTO((int));
133 extern void x11_lower_terminal_group __PROTO((void));
136 extern void win_raise_terminal_window();
137 extern void win_lower_terminal_window();
140 extern void wxt_raise_terminal_window __PROTO((int));
141 extern void wxt_raise_terminal_group __PROTO((void));
142 extern void wxt_lower_terminal_window __PROTO((int));
143 extern void wxt_lower_terminal_group __PROTO((void));
147 void bind_command __PROTO((void));
148 void restore_prompt __PROTO((void));
150 void call_command __PROTO((void));
151 void changedir_command __PROTO((void));
152 void clear_command __PROTO((void));
153 void exit_command __PROTO((void));
154 void help_command __PROTO((void));
155 void history_command __PROTO((void));
156 void if_command __PROTO((void));
157 void else_command __PROTO((void));
158 void invalid_command __PROTO((void));
159 void load_command __PROTO((void));
160 void null_command __PROTO((void));
161 void pause_command __PROTO((void));
162 void plot_command __PROTO((void));
163 void print_command __PROTO((void));
164 void pwd_command __PROTO((void));
165 void replot_command __PROTO((void));
166 void reread_command __PROTO((void));
167 void save_command __PROTO((void));
168 void screendump_command __PROTO((void));
169 void splot_command __PROTO((void));
170 void system_command __PROTO((void));
171 void test_command __PROTO((void));
172 void update_command __PROTO((void));
173 void do_shell __PROTO((void));
174 void undefine_command __PROTO((void));
176 /* Prototypes for functions exported by command.c */
177 void extend_input_line __PROTO((void));
178 void extend_token_table __PROTO((void));
179 int com_line __PROTO((void));
180 int do_line __PROTO((void));
181 void do_string __PROTO((char* s));
183 void toggle_display_of_ipc_commands __PROTO((void));
184 int display_ipc_commands __PROTO((void));
185 void do_string_replot __PROTO((char* s));
187 #ifdef VMS /* HBB 990829: used only on VMS */
188 void done __PROTO((int status));
190 void define __PROTO((void));
192 void replotrequest __PROTO((void)); /* used in command.c & mouse.c */
194 void print_set_output __PROTO((char *, TBOOLEAN)); /* set print output file */
195 char *print_show_output __PROTO((void)); /* show print output file */
197 /* Activate/deactive effects of 'set view map' before 'splot'/'plot',
198 * respectively. Required for proper mousing during 'set view map';
199 * actually it won't be necessary if gnuplot keeps a copy of all variables for
200 * the current plot and don't share them with 'set' commands.
201 * These routines need to be executed before each plotrequest() and
204 void splot_map_activate __PROTO((void));
205 void splot_map_deactivate __PROTO((void));
207 int do_system_func __PROTO((const char *cmd, char **output));
209 #endif /* GNUPLOT_COMMAND_H */