X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Futilities%2Ftitle.c;h=ffb2a48ee939e3389d9f2499dc8312a9e6a6e97c;hb=8297784ffdab47d35820735eb130a484ba9b6c01;hp=15e5a404983a1d85fa321b825691b52b927b993c;hpb=a19b858e0ac3c69e4a28c0ca6d8674427268a863;p=pspp diff --git a/src/language/utilities/title.c b/src/language/utilities/title.c index 15e5a40498..ffb2a48ee9 100644 --- a/src/language/utilities/title.c +++ b/src/language/utilities/title.c @@ -18,24 +18,24 @@ 02110-1301, USA. */ #include + #include #include -#include -#include + #include -#include +#include +#include +#include #include -#include +#include +#include #include -#include #include -#include +#include #include "gettext.h" #define _(msgid) gettext (msgid) -#include - static int get_title (const char *cmd, char **title); int @@ -56,7 +56,6 @@ get_title (const char *cmd, char **title) int c; c = lex_look_ahead (); - debug_printf ((_("%s before: %s\n"), cmd, *title ? *title : _(""))); if (c == '"' || c == '\'') { lex_get (); @@ -64,7 +63,7 @@ get_title (const char *cmd, char **title) return CMD_FAILURE; if (*title) free (*title); - *title = xstrdup (ds_c_str (&tokstr)); + *title = ds_xstrdup (&tokstr); lex_get (); if (token != '.') { @@ -84,7 +83,6 @@ get_title (const char *cmd, char **title) *cp = toupper ((unsigned char) (*cp)); token = '.'; } - debug_printf ((_("%s after: %s\n"), cmd, *title)); return CMD_SUCCESS; } @@ -99,13 +97,13 @@ cmd_file_label (void) while (isspace ((unsigned char) *label)) label++; - dict_set_label (default_dict, label); + dict_set_label (dataset_dict (current_dataset), label); token = '.'; return CMD_SUCCESS; } -/* Add LINE as a line of document information to default_dict, +/* Add LINE as a line of document information to dataset_dict (current_dataset), indented by INDENT spaces. */ static void add_document_line (const char *line, int indent) @@ -114,7 +112,7 @@ add_document_line (const char *line, int indent) size_t old_len; char *new_documents; - old_documents = dict_get_documents (default_dict); + old_documents = dict_get_documents (dataset_dict (current_dataset)); old_len = old_documents != NULL ? strlen (old_documents) : 0; new_documents = xmalloc (old_len + 81); @@ -123,7 +121,7 @@ add_document_line (const char *line, int indent) buf_copy_str_rpad (new_documents + old_len + indent, 80 - indent, line); new_documents[old_len + 80] = '\0'; - dict_set_documents (default_dict, new_documents); + dict_set_documents (dataset_dict (current_dataset), new_documents); free (new_documents); } @@ -136,7 +134,7 @@ cmd_document (void) { char buf[256]; - if (dict_get_documents (default_dict) != NULL) + if (dict_get_documents (dataset_dict (current_dataset)) != NULL) add_document_line ("", 0); sprintf (buf, _("Document entered %s by %s:"), get_start_date (), version); @@ -175,7 +173,7 @@ cmd_document (void) int cmd_drop_documents (void) { - dict_set_documents (default_dict, NULL); + dict_set_documents (dataset_dict (current_dataset), NULL); return lex_end_of_command (); }