X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Futilities%2Fset.c;h=9b18bfb0dfb00e31aba44dc8831443cc15d8d3e2;hb=55291dbeef603f85cdcf875da77fa550f9b8f429;hp=4b99bde6d956d37b8c677dcae6159794550028c9;hpb=8abe13514985ae7f280a5b6c20687d1c7c9a20d5;p=pspp diff --git a/src/language/utilities/set.c b/src/language/utilities/set.c index 4b99bde6d9..9b18bfb0df 100644 --- a/src/language/utilities/set.c +++ b/src/language/utilities/set.c @@ -669,6 +669,24 @@ show_LOCALE (const struct dataset *ds UNUSED) return xstrdup (get_default_encoding ()); } +static bool +parse_MDISPLAY (struct lexer *lexer) +{ + int mdisplay = force_parse_enum (lexer, + "TEXT", SETTINGS_MDISPLAY_TEXT, + "TABLES", SETTINGS_MDISPLAY_TABLES); + if (mdisplay >= 0) + settings_set_mdisplay (mdisplay); + return mdisplay >= 0; +} + +static char * +show_MDISPLAY (const struct dataset *ds UNUSED) +{ + return xstrdup (settings_get_mdisplay () == SETTINGS_MDISPLAY_TEXT + ? "TEXT" : "TABLES"); +} + static bool parse_MESSAGES (struct lexer *lexer) { @@ -916,16 +934,28 @@ show_SMALL (const struct dataset *ds UNUSED) return xstrdup (buf); } +static char * +show_SUBTITLE (const struct dataset *ds UNUSED) +{ + return xstrdup (output_get_subtitle ()); +} + static char * show_SYSTEM (const struct dataset *ds UNUSED) { - return strdup (host_system); + return xstrdup (host_system); } static char * show_TEMPDIR (const struct dataset *ds UNUSED) { - return strdup (temp_dir_name ()); + return xstrdup (temp_dir_name ()); +} + +static char * +show_TITLE (const struct dataset *ds UNUSED) +{ + return xstrdup (output_get_title ()); } static bool @@ -1123,7 +1153,7 @@ static void do_show (const struct dataset *ds, const struct setting *s) { char *value = s->show (ds); - msg (SN, _("%s is %s."), s->name, value); + msg (SN, _("%s is %s."), s->name, value ? value : _("empty")); free (value); } @@ -1165,6 +1195,7 @@ static const struct setting settings[] = { { "JOURNAL", parse_JOURNAL, show_JOURNAL }, { "LENGTH", parse_LENGTH, show_LENGTH }, { "LOCALE", parse_LOCALE, show_LOCALE }, + { "MDISPLAY", parse_MDISPLAY, show_MDISPLAY }, { "MESSAGES", parse_MESSAGES, show_MESSAGES }, { "MEXPAND", parse_MEXPAND, show_MEXPAND }, { "MITERATE", parse_MITERATE, show_MITERATE }, @@ -1262,6 +1293,16 @@ cmd_show (struct lexer *lexer, struct dataset *ds) show_warranty (ds); else if (lex_match_id (lexer, "COPYING") || lex_match_id (lexer, "LICENSE")) show_copying (ds); + else if (lex_match_id (lexer, "TITLE")) + { + struct setting s = { .name = "TITLE", .show = show_TITLE }; + do_show (ds, &s); + } + else if (lex_match_id (lexer, "SUBTITLE")) + { + struct setting s = { .name = "SUBTITLE", .show = show_SUBTITLE }; + do_show (ds, &s); + } else if (lex_token (lexer) == T_ID) { int i; @@ -1332,9 +1373,3 @@ cmd_restore (struct lexer *lexer UNUSED, struct dataset *ds UNUSED) return CMD_FAILURE; } } - -/* - Local Variables: - mode: c - End: -*/