You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include <config.h>
#include <stdlib.h>
/* Limited variable column specifications. */
struct col_spec
{
- char name[9]; /* Variable name. */
+ char name[LONG_NAME_LEN + 1]; /* Variable name. */
int fc, nc; /* First column (1-based), # of columns. */
int fmt; /* Format type. */
struct variable *v; /* Variable. */
static int parse_col_spec (struct col_spec *, const char *);
static void create_col_var (struct col_spec *c);
+int cmd_file_type (void);
+
/* Parses FILE TYPE command. */
int
cmd_file_type (void)
goto error;
}
- if (!strcmp (fty->case_sbc.name, fty->record.name))
+ if (!strcasecmp (fty->case_sbc.name, fty->record.name))
{
msg (SE, _("CASE and RECORD must specify different variable "
"names."));
create_col_var (&fty->record);
if (fty->case_sbc.name[0])
create_col_var (&fty->case_sbc);
- vfm_source = create_case_source (&file_type_source_class, default_dict, fty);
+ vfm_source = create_case_source (&file_type_source_class, fty);
return CMD_SUCCESS;
spec.type = c->fmt;
spec.w = c->nc;
spec.d = 0;
- return check_input_specifier (&spec);
+ return check_input_specifier (&spec, 1);
}
\f
/* RECORD TYPE. */
{
int mv = 0;
- while (token == T_NUM || token == T_STRING)
+ while (lex_is_number () || token == T_STRING)
{
if (rct->nv >= mv)
{
if (!lex_force_string ())
goto error;
rct->v[rct->nv].c = xmalloc (fty->record.nc + 1);
- st_bare_pad_copy (rct->v[rct->nv].c, ds_c_str (&tokstr),
- fty->record.nc + 1);
+ buf_copy_str_rpad (rct->v[rct->nv].c, fty->record.nc + 1,
+ ds_c_str (&tokstr));
}
else
{
\f
/* END FILE TYPE. */
+int cmd_end_file_type (void);
int
cmd_end_file_type (void)
{
format.d = 0;
while (!dfm_eof (fty->reader))
{
- struct len_string line;
+ struct fixed_string line;
struct record_type *iter;
union value v;
int i;