/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
/* Write variable names as first case. */
for (i = 0; i < flip->var_cnt; i++)
buf_copy_str_rpad (flip->output_buf[i].s, MAX_SHORT_STRING,
/* Write variable names as first case. */
for (i = 0; i < flip->var_cnt; i++)
buf_copy_str_rpad (flip->output_buf[i].s, MAX_SHORT_STRING,
if (fwrite (flip->output_buf, sizeof *flip->output_buf,
flip->var_cnt, flip->file) != (size_t) flip->var_cnt)
{
if (fwrite (flip->output_buf, sizeof *flip->output_buf,
flip->var_cnt, flip->file) != (size_t) flip->var_cnt)
{
if (flip->new_names != NULL)
{
struct varname *v = pool_alloc (flip->pool, sizeof *v);
if (flip->new_names != NULL)
{
struct varname *v = pool_alloc (flip->pool, sizeof *v);
- int width = MIN (flip->new_names->width, MAX_SHORT_STRING);
- memcpy (v->name, case_str (c, flip->idx_to_fv[flip->new_names->index]),
- width);
+ int width = MIN (var_get_width (flip->new_names), MAX_SHORT_STRING);
+ memcpy (v->name, case_str_idx (c, fv), width);
- if (flip->var[i]->type == NUMERIC)
- out = case_num (c, flip->idx_to_fv[flip->var[i]->index]);
+ if (var_is_numeric (flip->var[i]))
+ {
+ int fv = flip->idx_to_fv[var_get_dict_index (flip->var[i])];
+ out = case_num_idx (c, fv);
+ }