X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Futilities%2Fecho.c;h=88ece636ad1e1ba1054c45d2fe16b3c6de187cf1;hb=81579d9e9f994fb2908f50af41c3eb033d216e58;hp=b27b40017a367c397901acfb932bb1e81166ad2e;hpb=774441e68b4d2e3a4b5c6975e9614dcd4369955e;p=pspp-builds.git diff --git a/src/language/utilities/echo.c b/src/language/utilities/echo.c index b27b4001..88ece636 100644 --- a/src/language/utilities/echo.c +++ b/src/language/utilities/echo.c @@ -15,28 +15,24 @@ along with this program. If not, see . */ #include -#include -#include -#include -#include -#include -#include "xalloc.h" +#include "language/command.h" +#include "language/lexer/lexer.h" +#include "libpspp/message.h" +#include "libpspp/str.h" +#include "output/text-item.h" + +#include "gl/xalloc.h" /* Echos a string to the output stream */ int cmd_echo (struct lexer *lexer, struct dataset *ds UNUSED) { - struct tab_table *tab; - if (!lex_force_string (lexer)) return CMD_FAILURE; - tab = tab_create(1, 1); - - tab_text(tab, 0, 0, 0, ds_cstr (lex_tokstr (lexer))); - - tab_submit(tab); + text_item_submit (text_item_create (TEXT_ITEM_ECHO, lex_tokcstr (lexer))); + lex_get (lexer); return CMD_SUCCESS; }