X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Futilities%2Fset.q;h=5552984b3f068e6c55fc6ed6a798a16ea4bad184;hb=fdcc4b6875ccdbf7bd01bc401e87afbeb71c2bfd;hp=e2d993e7f1fcb7c8be5d83e1e3533e752eb4fb71;hpb=68b73d179454af3151156c62c2e27804019900d2;p=pspp-builds.git diff --git a/src/language/utilities/set.q b/src/language/utilities/set.q index e2d993e7..5552984b 100644 --- a/src/language/utilities/set.q +++ b/src/language/utilities/set.q @@ -41,6 +41,7 @@ #include #include #include +#include #include #if HAVE_LIBTERMCAP @@ -83,6 +84,7 @@ int tgetnum (const char *); histogram=string "x==1" "one character long"; include=inc:on/off; journal=custom; + log=custom; length=custom; listing=custom; lowres=lores:auto/on/off; @@ -507,19 +509,29 @@ static int stc_custom_journal (struct lexer *lexer, struct dataset *ds UNUSED, struct cmd_set *cmd UNUSED, void *aux UNUSED) { lex_match (lexer, '='); - if (!lex_match_id (lexer, "ON") && !lex_match_id (lexer, "OFF")) + if (lex_match_id (lexer, "ON") || lex_match_id (lexer, "YES")) + journal_enable (); + else if (lex_match_id (lexer, "OFF") || lex_match_id (lexer, "NO")) + journal_disable (); + else if (lex_token (lexer) == T_STRING || lex_token (lexer) == T_ID) { - if (lex_token (lexer) == T_STRING) - lex_get (lexer); - else - { - lex_error (lexer, NULL); - return 0; - } + journal_set_file_name (ds_cstr (lex_tokstr (lexer))); + lex_get (lexer); + } + else + { + lex_error (lexer, NULL); + return 0; } return 1; } +static int +stc_custom_log (struct lexer *lexer, struct dataset *ds UNUSED, struct cmd_set *cmd UNUSED, void *aux UNUSED) +{ + return stc_custom_journal (lexer, ds, cmd, aux); +} + static int stc_custom_listing (struct lexer *lexer, struct dataset *ds UNUSED, struct cmd_set *cmd UNUSED, void *aux UNUSED) {