CACHE: Implement command as no-op.
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 5 Nov 2010 03:37:01 +0000 (20:37 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 5 Nov 2010 03:37:01 +0000 (20:37 -0700)
Requested by Matej Kovacic <matej.kovacic@owca.info>.

doc/utilities.texi
src/language/command.def
src/language/utilities/automake.mk
src/language/utilities/cache.c [new file with mode: 0644]
tests/automake.mk
tests/language/utilities/cache.at [new file with mode: 0644]

index 9f57a76739b43c0a7921b96df18bf66c32905e26..bcb97618a099d1f98c4a01281d2b9c3deaca4419 100644 (file)
@@ -10,6 +10,7 @@ encountered in the input.
 
 @menu
 * ADD DOCUMENT::                Add documentary text to the active file.
+* CACHE::                       Ignored for compatibility.
 * CD::                          Change the current directory.
 * COMMENT::                     Document your syntax file.
 * DOCUMENT::                    Document the active file.
@@ -52,6 +53,16 @@ DOCUMENTS}.
 Each line of documentary text must be enclosed in quotation marks, and 
 may not be more than 80 bytes long. @xref{DOCUMENT}.
 
+@node CACHE
+@section CACHE
+@vindex CACHE
+
+@display
+CACHE.
+@end display
+
+This command is accepted, for compatibility, but it has no effect.
+
 @node CD
 @section CD
 @vindex CD
index adfaa950e1bec95a07bc9f61c0a9b5361c9dcc6e..c87f37f6e3b267566f287be16fbe7e4fcbd33278 100644 (file)
@@ -17,6 +17,7 @@
 /* Utility commands acceptable anywhere. */
 DEF_CMD (S_ANY, F_ENHANCED, "CLOSE FILE HANDLE", cmd_close_file_handle)
 DEF_CMD (S_ANY, F_KEEP_FINAL_TOKEN, "COMMENT", cmd_comment)
+DEF_CMD (S_ANY, 0, "CACHE", cmd_cache)
 DEF_CMD (S_ANY, 0, "CD", cmd_cd)
 DEF_CMD (S_ANY, 0, "ECHO", cmd_echo)
 DEF_CMD (S_ANY, 0, "ERASE", cmd_erase)
index 3a3e16d50af4ab1176215e9246ff9a868ef24751..46fe09c4518eb9c4bc06b3e308f10c979e1be819 100644 (file)
@@ -5,6 +5,7 @@ src_language_utilities_built_sources = \
        src/language/utilities/set.c
 
 language_utilities_sources = \
+       src/language/utilities/cache.c \
        src/language/utilities/cd.c \
        src/language/utilities/date.c \
        src/language/utilities/echo.c \
diff --git a/src/language/utilities/cache.c b/src/language/utilities/cache.c
new file mode 100644 (file)
index 0000000..2d818af
--- /dev/null
@@ -0,0 +1,34 @@
+/* PSPP - a program for statistical analysis.
+   Copyright (C) 2010 Free Software Foundation, Inc.
+
+   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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "language/command.h"
+#include "language/lexer/lexer.h"
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+/* Parses the CACHE command. */
+int
+cmd_cache (struct lexer *lexer, struct dataset *ds UNUSED)
+{
+  return lex_end_of_command (lexer);
+}
+
index 017e573ee39c16e880d839c3f82b50dbe077e1d3..8be58e18f55fed21792b3861668de8d110f0162c 100644 (file)
@@ -277,6 +277,7 @@ TESTSUITE_AT = \
        tests/language/stats/roc.at \
        tests/language/stats/sort-cases.at \
        tests/language/stats/t-test.at \
+       tests/language/utilities/cache.at \
        tests/language/utilities/date.at \
        tests/language/utilities/insert.at \
        tests/language/utilities/permissions.at \
diff --git a/tests/language/utilities/cache.at b/tests/language/utilities/cache.at
new file mode 100644 (file)
index 0000000..2edda09
--- /dev/null
@@ -0,0 +1,8 @@
+AT_BANNER([CACHE])
+
+AT_SETUP([CACHE])
+AT_DATA([cache.sps], [dnl
+CACHE.
+])
+AT_CHECK([pspp -O format=csv cache.sps])
+AT_CLEANUP