Update all #include directives to the currently preferred style.
[pspp-builds.git] / src / language / prompt.c
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 1997-9, 2000, 2010, 2011 Free Software Foundation, Inc.
3
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.
8
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.
13
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/>. */
16
17 #include <config.h>
18
19 #include <stdio.h>
20 #include <errno.h>
21 #include <stdlib.h>
22
23 #include "language/prompt.h"
24
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/str.h"
33 #include "libpspp/version.h"
34 #include "output/tab.h"
35
36 #include "gl/xalloc.h"
37
38 /* Current prompting style. */
39 static enum prompt_style current_style;
40
41 /* Gets the command prompt for the given STYLE. */
42 const char *
43 prompt_get (enum prompt_style style)
44 {
45   switch (style)
46     {
47     case PROMPT_FIRST:
48       return "PSPP> ";
49
50     case PROMPT_LATER:
51       return "    > ";
52
53     case PROMPT_DATA:
54       return "data> ";
55
56     case PROMPT_CNT:
57       NOT_REACHED ();
58     }
59   NOT_REACHED ();
60 }
61
62 /* Sets STYLE as the current prompt style. */
63 void
64 prompt_set_style (enum prompt_style style)
65 {
66   assert (style < PROMPT_CNT);
67   current_style = style;
68 }
69
70 /* Returns the current prompt. */
71 enum prompt_style
72 prompt_get_style (void)
73 {
74   return current_style;
75 }