1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 1997-9, 2000 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/>. */
25 #include <data/file-name.h>
26 #include <data/settings.h>
27 #include <data/variable.h>
28 #include <language/command.h>
29 #include <language/lexer/lexer.h>
30 #include <libpspp/assertion.h>
31 #include <libpspp/message.h>
32 #include <libpspp/message.h>
33 #include <libpspp/str.h>
34 #include <libpspp/verbose-msg.h>
35 #include <libpspp/version.h>
36 #include <output/table.h>
40 /* Current prompts in each style. */
41 static char *prompts[PROMPT_CNT];
43 /* Current prompting style. */
44 static enum prompt_style current_style;
46 /* Initializes prompts. */
50 prompts[PROMPT_FIRST] = xstrdup ("PSPP> ");
51 prompts[PROMPT_LATER] = xstrdup (" > ");
52 prompts[PROMPT_DATA] = xstrdup ("data> ");
53 current_style = PROMPT_FIRST;
62 for (i = 0; i < PROMPT_CNT; i++)
69 /* Gets the command prompt for the given STYLE. */
71 prompt_get (enum prompt_style style)
73 assert (style < PROMPT_CNT);
74 return prompts[style];
77 /* Sets the given STYLE's prompt to STRING. */
79 prompt_set (enum prompt_style style, const char *string)
81 assert (style < PROMPT_CNT);
82 free (prompts[style]);
83 prompts[style] = xstrdup (string);
86 /* Sets STYLE as the current prompt style. */
88 prompt_set_style (enum prompt_style style)
90 assert (style < PROMPT_CNT);
91 current_style = style;
94 /* Returns the current prompt. */
96 prompt_get_style (void)