X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Futilities%2Fset.c;h=cfd1ca96d56ad87e5b465308a84e511e83196716;hb=1fec85d2c2a80ec32f351bfa3fa369070f1f848d;hp=11b3dac914db6d9a6cd7da97ac3b7a4606d4445c;hpb=78d5f809e7dedb2fa85ac1961a340089fd2e2711;p=pspp diff --git a/src/language/utilities/set.c b/src/language/utilities/set.c index 11b3dac914..cfd1ca96d5 100644 --- a/src/language/utilities/set.c +++ b/src/language/utilities/set.c @@ -490,25 +490,39 @@ parse_MESSAGES (struct lexer *lexer) static bool parse_MEXPAND (struct lexer *lexer) { - return parse_unimplemented (lexer, "MEXPAND"); + int mexpand = force_parse_bool (lexer); + if (mexpand != -1) + settings_set_mexpand (mexpand); + return mexpand != -1; } static bool parse_MITERATE (struct lexer *lexer) { - return parse_unimplemented (lexer, "MITERATE"); + if (!lex_force_int_range (lexer, "MITERATE", 1, INT_MAX)) + return false; + settings_set_miterate (lex_integer (lexer)); + lex_get (lexer); + return true; } static bool parse_MNEST (struct lexer *lexer) { - return parse_unimplemented (lexer, "MNEST"); + if (!lex_force_int_range (lexer, "MNEST", 1, INT_MAX)) + return false; + settings_set_mnest (lex_integer (lexer)); + lex_get (lexer); + return true; } static bool parse_MPRINT (struct lexer *lexer) { - return parse_unimplemented (lexer, "MPRINT"); + int mprint = force_parse_bool (lexer); + if (mprint != -1) + settings_set_mprint (mprint); + return mprint != -1; } static bool @@ -915,6 +929,30 @@ show_locale (const struct dataset *ds UNUSED) return xstrdup (get_default_encoding ()); } +static char * +show_mexpand (const struct dataset *ds UNUSED) +{ + return xstrdup (settings_get_mexpand () ? "ON" : "OFF"); +} + +static char * +show_mprint (const struct dataset *ds UNUSED) +{ + return xstrdup (settings_get_mprint () ? "ON" : "OFF"); +} + +static char * +show_miterate (const struct dataset *ds UNUSED) +{ + return xasprintf ("%d", settings_get_miterate ()); +} + +static char * +show_mnest (const struct dataset *ds UNUSED) +{ + return xasprintf ("%d", settings_get_mnest ()); +} + static char * show_messages (const struct dataset *ds UNUSED) { @@ -1141,6 +1179,10 @@ const struct show_sbc show_table[] = {"JOURNAL", show_journal}, {"LENGTH", show_length}, {"LOCALE", show_locale}, + {"MEXPAND", show_mexpand}, + {"MPRINT", show_mprint}, + {"MITERATE", show_miterate}, + {"MNEST", show_mnest}, {"MESSAGES", show_messages}, {"MXERRS", show_mxerrs}, {"MXLOOPS", show_mxloops},