1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
3 Written by Ben Pfaff <blp@gnu.org>.
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 /* Command return values. */
28 /* Successful return values. */
29 CMD_SUCCESS = 1, /* Successfully parsed and executed. */
30 CMD_EOF = 2, /* End of input. */
31 CMD_FINISH = 3, /* FINISH was executed. */
33 /* Range of successful return values available for use
34 by agreement between a command and the caller of
36 CMD_PRIVATE_FIRST = 4,
37 CMD_PRIVATE_LAST = 127,
39 /* Various kinds of failures. */
40 CMD_FAILURE = -1, /* Not executed at all. */
41 CMD_NOT_IMPLEMENTED = -2, /* Command not implemented. */
42 CMD_CASCADING_FAILURE = -3 /* Serious error: don't continue. */
45 bool cmd_result_is_success (enum cmd_result);
46 bool cmd_result_is_failure (enum cmd_result);
48 /* Command processing state. */
51 CMD_STATE_INITIAL, /* No active file yet defined. */
52 CMD_STATE_DATA, /* Active file has been defined. */
53 CMD_STATE_INPUT_PROGRAM, /* Inside INPUT PROGRAM. */
54 CMD_STATE_FILE_TYPE /* Inside FILE TYPE. */
58 enum cmd_result cmd_parse (struct dataset *ds, enum cmd_state);
61 const char *cmd_complete (const char *, const struct command **);
65 /* Prototype all the command functions. */
66 #define DEF_CMD(STATES, FLAGS, NAME, FUNCTION) int FUNCTION (struct dataset *);
67 #define UNIMPL_CMD(NAME, DESCRIPTION)
68 #include "command.def"
72 #endif /* command.h */