X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Futilities%2Fecho.c;h=88ece636ad1e1ba1054c45d2fe16b3c6de187cf1;hb=18e998adf231aef51c477bd26d60c65334d19436;hp=b27b40017a367c397901acfb932bb1e81166ad2e;hpb=a258e53c63a08b0ec48aea8f03808eb651729424;p=pspp diff --git a/src/language/utilities/echo.c b/src/language/utilities/echo.c index b27b40017a..88ece636ad 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; }