X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fprompt.c;h=5ecd42fb34fa6b91a2322aecbecc3f400af43f7d;hb=14aac9fe7a7efbb6c9bded2ed5969a643cb76645;hp=5640c5088097a645e44f50d22d173754ef9a7d84;hpb=b8b67a1e1f709640ccdb3422a591b938edb0ceea;p=pspp diff --git a/src/language/prompt.c b/src/language/prompt.c index 5640c50880..5ecd42fb34 100644 --- a/src/language/prompt.c +++ b/src/language/prompt.c @@ -1,21 +1,18 @@ -/* PSPP - computes sample statistics. +/* PSPP - a program for statistical analysis. Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - Written by Ben Pfaff . - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program. If not, see . */ #include @@ -30,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -39,6 +35,8 @@ #include #include +#include "xalloc.h" + /* Current prompts in each style. */ static char *prompts[PROMPT_CNT]; @@ -47,7 +45,7 @@ static enum prompt_style current_style; /* Initializes prompts. */ void -prompt_init (void) +prompt_init (void) { prompts[PROMPT_FIRST] = xstrdup ("PSPP> "); prompts[PROMPT_LATER] = xstrdup (" > "); @@ -57,11 +55,11 @@ prompt_init (void) /* Frees prompts. */ void -prompt_done (void) +prompt_done (void) { int i; - for (i = 0; i < PROMPT_CNT; i++) + for (i = 0; i < PROMPT_CNT; i++) { free (prompts[i]); prompts[i] = NULL; @@ -69,7 +67,7 @@ prompt_done (void) } /* Gets the command prompt for the given STYLE. */ -const char * +const char * prompt_get (enum prompt_style style) { assert (style < PROMPT_CNT); @@ -87,7 +85,7 @@ prompt_set (enum prompt_style style, const char *string) /* Sets STYLE as the current prompt style. */ void -prompt_set_style (enum prompt_style style) +prompt_set_style (enum prompt_style style) { assert (style < PROMPT_CNT); current_style = style; @@ -95,7 +93,7 @@ prompt_set_style (enum prompt_style style) /* Returns the current prompt. */ enum prompt_style -prompt_get_style (void) +prompt_get_style (void) { return current_style; }