projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Constness and global namespace patrol.
[pspp]
/
src
/
language
/
utilities
/
title.c
diff --git
a/src/language/utilities/title.c
b/src/language/utilities/title.c
index d494e35e8e2cad2aa96cc1ebb736929c4ca421cf..ffb2a48ee939e3389d9f2499dc8312a9e6a6e97c 100644
(file)
--- a/
src/language/utilities/title.c
+++ b/
src/language/utilities/title.c
@@
-18,18
+18,20
@@
02110-1301, USA. */
#include <config.h>
02110-1301, USA. */
#include <config.h>
+
#include <ctype.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdlib.h>
-#include <libpspp/alloc.h>
-#include <language/command.h>
+
#include <data/dictionary.h>
#include <data/dictionary.h>
-#include <libpspp/message.h>
+#include <data/procedure.h>
+#include <data/variable.h>
+#include <language/command.h>
#include <language/lexer/lexer.h>
#include <language/lexer/lexer.h>
-#include <output/output.h>
+#include <libpspp/alloc.h>
+#include <libpspp/message.h>
#include <libpspp/start-date.h>
#include <libpspp/start-date.h>
-#include <data/variable.h>
#include <libpspp/version.h>
#include <libpspp/version.h>
-#include <
procedure
.h>
+#include <
output/output
.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "gettext.h"
#define _(msgid) gettext (msgid)
@@
-61,7
+63,7
@@
get_title (const char *cmd, char **title)
return CMD_FAILURE;
if (*title)
free (*title);
return CMD_FAILURE;
if (*title)
free (*title);
- *title =
xstrdup (ds_c_str (&tokstr)
);
+ *title =
ds_xstrdup (&tokstr
);
lex_get ();
if (token != '.')
{
lex_get ();
if (token != '.')
{
@@
-95,13
+97,13
@@
cmd_file_label (void)
while (isspace ((unsigned char) *label))
label++;
while (isspace ((unsigned char) *label))
label++;
- dict_set_label (d
efault_dict
, label);
+ dict_set_label (d
ataset_dict (current_dataset)
, label);
token = '.';
return CMD_SUCCESS;
}
token = '.';
return CMD_SUCCESS;
}
-/* Add LINE as a line of document information to d
efault_dict
,
+/* Add LINE as a line of document information to d
ataset_dict (current_dataset)
,
indented by INDENT spaces. */
static void
add_document_line (const char *line, int indent)
indented by INDENT spaces. */
static void
add_document_line (const char *line, int indent)
@@
-110,7
+112,7
@@
add_document_line (const char *line, int indent)
size_t old_len;
char *new_documents;
size_t old_len;
char *new_documents;
- old_documents = dict_get_documents (d
efault_dict
);
+ old_documents = dict_get_documents (d
ataset_dict (current_dataset)
);
old_len = old_documents != NULL ? strlen (old_documents) : 0;
new_documents = xmalloc (old_len + 81);
old_len = old_documents != NULL ? strlen (old_documents) : 0;
new_documents = xmalloc (old_len + 81);
@@
-119,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';
buf_copy_str_rpad (new_documents + old_len + indent, 80 - indent, line);
new_documents[old_len + 80] = '\0';
- dict_set_documents (d
efault_dict
, new_documents);
+ dict_set_documents (d
ataset_dict (current_dataset)
, new_documents);
free (new_documents);
}
free (new_documents);
}
@@
-132,7
+134,7
@@
cmd_document (void)
{
char buf[256];
{
char buf[256];
- if (dict_get_documents (d
efault_dict
) != NULL)
+ if (dict_get_documents (d
ataset_dict (current_dataset)
) != NULL)
add_document_line ("", 0);
sprintf (buf, _("Document entered %s by %s:"), get_start_date (), version);
add_document_line ("", 0);
sprintf (buf, _("Document entered %s by %s:"), get_start_date (), version);
@@
-171,7
+173,7
@@
cmd_document (void)
int
cmd_drop_documents (void)
{
int
cmd_drop_documents (void)
{
- dict_set_documents (d
efault_dict
, NULL);
+ dict_set_documents (d
ataset_dict (current_dataset)
, NULL);
return lex_end_of_command ();
}
return lex_end_of_command ();
}