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