X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Ffile-type.c;h=4633c7c00ba23518b437bbd5ddf233f2d92b5a64;hb=30728b09540b323fef43b23dd5f1e4d1e8298c92;hp=99a5d050d21c5757fe521b4d47311b23eea762e6;hpb=3fc7b08b53d3a07385327d6f2aff11a2f9abce08;p=pspp-builds.git diff --git a/src/language/data-io/file-type.c b/src/language/data-io/file-type.c index 99a5d050..4633c7c0 100644 --- a/src/language/data-io/file-type.c +++ b/src/language/data-io/file-type.c @@ -18,20 +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 +#include #include -#include #include #include "gettext.h" @@ -96,6 +100,17 @@ struct file_type_pgm static int parse_col_spec (struct col_spec *, const char *); static void create_col_var (struct col_spec *c); +static const struct case_source_class file_type_source_class; + +static bool inside_file_type; + +/* Returns true if we're parsing the inside of a FILE TYPE...END + FILE TYPE construct, false otherwise. */ +bool +in_file_type (void) +{ + return inside_file_type; +} int cmd_file_type (void); @@ -390,15 +405,6 @@ cmd_record_type (void) struct file_type_pgm *fty; struct record_type *rct; - /* Make sure we're inside a FILE TYPE structure. */ - if (pgm_state != STATE_INPUT - || !case_source_is_class (vfm_source, &file_type_source_class)) - { - msg (SE, _("This command may only appear within a " - "FILE TYPE/END FILE TYPE structure.")); - return CMD_CASCADING_FAILURE; - } - fty = vfm_source->aux; /* Initialize the record_type structure. */ @@ -580,13 +586,6 @@ cmd_end_file_type (void) { struct file_type_pgm *fty; - if (pgm_state != STATE_INPUT - || case_source_is_class (vfm_source, &file_type_source_class)) - { - msg (SE, _("This command may only appear within a " - "FILE TYPE/END FILE TYPE structure.")); - return CMD_CASCADING_FAILURE; - } fty = vfm_source->aux; fty->case_size = dict_get_case_size (default_dict); @@ -735,7 +734,7 @@ file_type_source_destroy (struct case_source *source) } } -const struct case_source_class file_type_source_class = +static const struct case_source_class file_type_source_class = { "FILE TYPE", NULL,