Abstract the documents within a dictionary a little better. Thanks to
authorBen Pfaff <blp@gnu.org>
Sun, 6 May 2007 22:05:21 +0000 (22:05 +0000)
committerBen Pfaff <blp@gnu.org>
Sun, 6 May 2007 22:05:21 +0000 (22:05 +0000)
commit8021cf8974a46fe82af7b8952e448c0ea6858a48
tree49fee9bd55249c87ad230d3413ffcbcc3ca47e04
parentfad7434e2db08ed248228e03533b314b8335ef2f
Abstract the documents within a dictionary a little better.  Thanks to
John Darrington for suggestion, initial version, and review.  Patch
#5917.

* command/file-label.sh: Update to match new DOCUMENT behavior.

* title.c (add_document_line): Removed.
(add_document_trailer): New function.
(cmd_document): Rewrite to yield SPSS-like output and to use the
updated document API.
(cmd_add_documents): Ditto.

* lexer.c (lex_entire_line): Add const to parameter.
(lex_entire_line_ds): Ditto.
(lex_rest_of_line): Drop end_dot parameter.  Update all callers to
use lex_end_dot instead.
(lex_end_dot): New function.

* get.c (mtf_merge_dictionary): Simplify creating merged document.

* dictionary.c (struct dictionary): Change `documents' member from
char * to struct string.
(dict_clear): Destroy struct string.
(dict_get_documents): Convert struct string to char *.
(dict_set_documents): Set struct string.  Pad to 80-character
multiple.
(dict_clear_documents): New function.
(dict_add_document_line): New function.
(dict_get_document_line_cnt): New function.
(dict_get_document_line): New function.

* dictionary.h (macro DOC_LINE_LENGTH): New macro.

* sys-file-reader.c (read_documents): Use new document functions.
18 files changed:
src/data/ChangeLog
src/data/dictionary.c
src/data/dictionary.h
src/data/sys-file-reader.c
src/language/command.c
src/language/data-io/ChangeLog
src/language/data-io/get.c
src/language/dictionary/sys-file-info.c
src/language/expressions/evaluate.c
src/language/lexer/ChangeLog
src/language/lexer/lexer.c
src/language/lexer/lexer.h
src/language/stats/aggregate.c
src/language/tests/moments-test.c
src/language/utilities/ChangeLog
src/language/utilities/title.c
tests/ChangeLog
tests/command/file-label.sh