1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 1997-9, 2000, 2006, 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/>. */
22 /* Command return values. */
25 /* Successful return values. */
26 CMD_SUCCESS = 1, /* Successfully parsed and executed. */
27 CMD_EOF = 2, /* End of input. */
28 CMD_FINISH = 3, /* FINISH was executed. */
30 /* Range of successful return values available for use
31 by agreement between a command and the caller of
33 CMD_PRIVATE_FIRST = 4,
34 CMD_PRIVATE_LAST = 127,
36 /* Various kinds of failures. */
37 CMD_FAILURE = -1, /* Not executed at all. */
38 CMD_NOT_IMPLEMENTED = -2, /* Command not implemented. */
39 CMD_CASCADING_FAILURE = -3 /* Serious error: don't continue. */
42 bool cmd_result_is_success (enum cmd_result);
43 bool cmd_result_is_failure (enum cmd_result);
45 /* Command processing state. */
48 CMD_STATE_INITIAL, /* No active dataset yet defined. */
49 CMD_STATE_DATA, /* Active dataset has been defined. */
50 CMD_STATE_INPUT_PROGRAM, /* Inside INPUT PROGRAM. */
51 CMD_STATE_FILE_TYPE /* Inside FILE TYPE. */
57 enum cmd_result cmd_parse_in_state (struct lexer *lexer, struct dataset *ds,
60 enum cmd_result cmd_parse (struct lexer *lexer, struct dataset *ds);
63 const char *cmd_complete (const char *, const struct command **);
67 /* Prototype all the command functions. */
68 #define DEF_CMD(STATES, FLAGS, NAME, FUNCTION) int FUNCTION (struct lexer *, struct dataset *);
69 #define UNIMPL_CMD(NAME, DESCRIPTION)
70 #include "command.def"
74 #endif /* command.h */