X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata-list.c;h=49fbf0d76a6a0df876bc7976a4b79b9581681c97;hb=53ceff2865473a6b561b521986fafd31a993a1a6;hp=756fedc8b29219657be598771fe443cb53d8e571;hpb=20fd432b34d65999f06fabfa8e9c3f5efbac41bd;p=pspp diff --git a/src/data-list.c b/src/data-list.c index 756fedc8b2..49fbf0d76a 100644 --- a/src/data-list.c +++ b/src/data-list.c @@ -1,5 +1,5 @@ /* PSPP - computes sample statistics. - Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. Written by Ben Pfaff . This program is free software; you can redistribute it and/or @@ -14,8 +14,8 @@ 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 #include "data-list.h" @@ -41,6 +41,9 @@ #include "tab.h" #include "var.h" #include "vfm.h" + +#include "gettext.h" +#define _(msgid) gettext (msgid) /* Utility function. */ @@ -65,7 +68,7 @@ struct dls_var_spec int fc, lc; /* Column numbers in record. */ /* Free format only. */ - char name[9]; /* Name of variable. */ + char name[LONG_NAME_LEN + 1]; /* Name of variable. */ }; /* Constants for DATA LIST type. */ @@ -80,8 +83,6 @@ enum /* DATA LIST private data structure. */ struct data_list_pgm { - struct trns_header h; - struct dls_var_spec *first, *last; /* Variable parsing specifications. */ struct dfm_reader *reader; /* Data file reader. */ @@ -94,6 +95,8 @@ struct data_list_pgm size_t delim_cnt; /* Number of delimiter, or 0 for spaces. */ }; +static const struct case_source_class data_list_source_class; + static int parse_fixed (struct data_list_pgm *); static int parse_free (struct dls_var_spec **, struct dls_var_spec **); static void dump_fixed_table (const struct dls_var_spec *, @@ -110,9 +113,9 @@ static trns_proc_func data_list_trns_proc; int cmd_data_list (void) { - struct data_list_pgm *dls; /* DATA LIST program under construction. */ + struct data_list_pgm *dls; int table = -1; /* Print table if nonzero, -1=undecided. */ - struct file_handle *fh = NULL; /* File handle of source, NULL=inline file. */ + struct file_handle *fh = fh_inline_file (); if (!case_source_is_complex (vfm_source)) discard_variables (); @@ -132,14 +135,14 @@ cmd_data_list (void) if (lex_match_id ("FILE")) { lex_match ('='); - fh = fh_parse (); + fh = fh_parse (FH_REF_FILE | FH_REF_INLINE); if (fh == NULL) goto error; if (case_source_is_class (vfm_source, &file_type_source_class) - && fh != default_handle) + && fh != fh_get_default_handle ()) { - msg (SE, _("DATA LIST may not use a different file from " - "that specified on its surrounding FILE TYPE.")); + msg (SE, _("DATA LIST must use the same file " + "as the enclosing FILE TYPE.")); goto error; } } @@ -234,7 +237,7 @@ cmd_data_list (void) } dls->case_size = dict_get_case_size (default_dict); - default_handle = fh; + fh_set_default_handle (fh); if (dls->type == -1) dls->type = DLS_FIXED; @@ -267,26 +270,14 @@ cmd_data_list (void) goto error; if (vfm_source != NULL) - { - struct data_list_pgm *new_pgm; - - dls->h.proc = data_list_trns_proc; - dls->h.free = data_list_trns_free; - - new_pgm = xmalloc (sizeof *new_pgm); - memcpy (new_pgm, &dls, sizeof *new_pgm); - add_transformation (&new_pgm->h); - } + add_transformation (data_list_trns_proc, data_list_trns_free, dls); else - vfm_source = create_case_source (&data_list_source_class, - default_dict, dls); + vfm_source = create_case_source (&data_list_source_class, dls); return CMD_SUCCESS; error: - destroy_dls_var_spec (dls->first); - free (dls->delims); - free (dls); + data_list_trns_free (dls); return CMD_FAILURE; } @@ -320,7 +311,7 @@ struct fmt_list struct fixed_parsing_state { char **name; /* Variable names. */ - int name_cnt; /* Number of names. */ + size_t name_cnt; /* Number of names. */ int recno; /* Index of current record. */ int sc; /* 1-based column number of starting column for @@ -340,7 +331,7 @@ static int parse_fixed (struct data_list_pgm *dls) { struct fixed_parsing_state fx; - int i; + size_t i; fx.recno = 0; fx.sc = 1; @@ -350,7 +341,7 @@ parse_fixed (struct data_list_pgm *dls) while (lex_match ('/')) { fx.recno++; - if (lex_integer_p ()) + if (lex_is_integer ()) { if (lex_integer () < fx.recno) { @@ -371,7 +362,7 @@ parse_fixed (struct data_list_pgm *dls) if (!parse_DATA_LIST_vars (&fx.name, &fx.name_cnt, PV_NONE)) return 0; - if (token == T_NUM) + if (lex_is_number ()) { if (!fixed_parse_compatible (&fx, &dls->first, &dls->last)) goto fail; @@ -384,7 +375,7 @@ parse_fixed (struct data_list_pgm *dls) else { msg (SE, _("SPSS-like or FORTRAN-like format " - "specification expected after variable names.")); + "specification expected after variable names.")); goto fail; } @@ -405,12 +396,7 @@ parse_fixed (struct data_list_pgm *dls) } else if (!dls->rec_cnt) dls->rec_cnt = dls->last->rec; - if (token != '.') - { - lex_error (_("expecting end of command")); - return 0; - } - return 1; + return lex_end_of_command () == CMD_SUCCESS; fail: for (i = 0; i < fx.name_cnt; i++) @@ -501,7 +487,7 @@ fixed_parse_compatible (struct fixed_parsing_state *fx, else input.type = FMT_F; - if (lex_integer_p ()) + if (lex_is_integer ()) { if (lex_integer () < 1) { @@ -535,7 +521,7 @@ fixed_parse_compatible (struct fixed_parsing_state *fx, input.type = FMT_F; input.d = 0; } - if (!check_input_specifier (&input)) + if (!check_input_specifier (&input, 1)) return 0; /* Start column for next specification. */ @@ -713,7 +699,7 @@ fixed_parse_fortran_internal (struct fixed_parsing_state *fx, tail = new; /* Parse count. */ - if (lex_integer_p ()) + if (lex_is_integer ()) { new->count = lex_integer (); lex_get (); @@ -731,8 +717,8 @@ fixed_parse_fortran_internal (struct fixed_parsing_state *fx, } else if (lex_match ('/')) new->f.type = FMT_NEWREC; - else if (!parse_format_specifier (&new->f, 1) - || !check_input_specifier (&new->f)) + else if (!parse_format_specifier (&new->f, FMTP_ALLOW_XT) + || !check_input_specifier (&new->f, 1)) goto fail; lex_match (','); @@ -811,15 +797,9 @@ dump_fixed_table (const struct dls_var_spec *specs, fmt_to_string (&spec->input)); } - if (fh != NULL) - tab_title (t, 1, ngettext ("Reading %d record from file %s.", - "Reading %d records from file %s.", rec_cnt), - rec_cnt, handle_get_filename (fh)); - else - tab_title (t, 1, ngettext ("Reading %d record from the command file.", - "Reading %d records from the command file.", - rec_cnt), - rec_cnt); + tab_title (t, 1, ngettext ("Reading %d record from %s.", + "Reading %d records from %s.", rec_cnt), + rec_cnt, fh_get_name (fh)); tab_submit (t); } @@ -836,16 +816,17 @@ parse_free (struct dls_var_spec **first, struct dls_var_spec **last) { struct fmt_spec input, output; char **name; - int name_cnt; + size_t name_cnt; int width; - int i; + size_t i; if (!parse_DATA_LIST_vars (&name, &name_cnt, PV_NONE)) return 0; + if (lex_match ('(')) { if (!parse_format_specifier (&input, 0) - || !check_input_specifier (&input) + || !check_input_specifier (&input, 1) || !lex_force_match (')')) { for (i = 0; i < name_cnt; i++) @@ -858,10 +839,8 @@ parse_free (struct dls_var_spec **first, struct dls_var_spec **last) else { lex_match ('*'); - input.type = FMT_F; - input.w = 8; - input.d = 0; - output = get_format(); + input = make_input_format (FMT_F, 8, 0); + output = *get_format (); } if (input.type == FMT_A || input.type == FMT_AHEX) @@ -874,6 +853,7 @@ parse_free (struct dls_var_spec **first, struct dls_var_spec **last) struct variable *v; v = dict_create_var (default_dict, name[i], width); + if (!v) { msg (SE, _("%s is a duplicate variable name."), name[i]); @@ -888,7 +868,7 @@ parse_free (struct dls_var_spec **first, struct dls_var_spec **last) spec->input = input; spec->v = v; spec->fv = v->fv; - strcpy (spec->name, name[i]); + str_copy_trunc (spec->name, sizeof spec->name, v->name); append_var_spec (first, last, spec); } for (i = 0; i < name_cnt; i++) @@ -896,9 +876,7 @@ parse_free (struct dls_var_spec **first, struct dls_var_spec **last) free (name); } - if (token != '.') - lex_error (_("expecting end of command")); - return 1; + return lex_end_of_command () == CMD_SUCCESS; } /* Displays a table giving information on free-format variable parsing @@ -935,11 +913,7 @@ dump_free_table (const struct data_list_pgm *dls, } } - if (fh != NULL) - tab_title (t, 1, _("Reading free-form data from file %s."), - handle_get_filename (fh)); - else - tab_title (t, 1, _("Reading free-form data from the command file.")); + tab_title (t, 1, _("Reading free-form data from %s."), fh_get_name (fh)); tab_submit (t); } @@ -956,10 +930,10 @@ dump_free_table (const struct data_list_pgm *dls, a 1-based column number indicating the beginning of the field on success. */ static int -cut_field (const struct data_list_pgm *dls, struct len_string *field, +cut_field (const struct data_list_pgm *dls, struct fixed_string *field, int *end_blank) { - struct len_string line; + struct fixed_string line; char *cp; size_t column_start; @@ -1094,7 +1068,7 @@ read_from_data_list_fixed (const struct data_list_pgm *dls, return -2; for (i = 1; i <= dls->rec_cnt; i++) { - struct len_string line; + struct fixed_string line; if (dfm_eof (dls->reader)) { @@ -1113,7 +1087,7 @@ read_from_data_list_fixed (const struct data_list_pgm *dls, data_in_finite_line (&di, ls_c_str (&line), ls_length (&line), var_spec->fc, var_spec->lc); di.v = case_data_rw (c, var_spec->fv); - di.flags = 0; + di.flags = DI_IMPLIED_DECIMALS; di.f1 = var_spec->fc; di.format = var_spec->input; @@ -1138,7 +1112,7 @@ read_from_data_list_free (const struct data_list_pgm *dls, for (var_spec = dls->first; var_spec; var_spec = var_spec->next) { - struct len_string field; + struct fixed_string field; int column; /* Cut out a field and read in a new record if necessary. */ @@ -1189,7 +1163,7 @@ read_from_data_list_list (const struct data_list_pgm *dls, for (var_spec = dls->first; var_spec; var_spec = var_spec->next) { - struct len_string field; + struct fixed_string field; int column; /* Cut out a field and check for end-of-line. */ @@ -1243,23 +1217,22 @@ destroy_dls_var_spec (struct dls_var_spec *spec) } } -/* Destroys DATA LIST transformation PGM. */ +/* Destroys DATA LIST transformation DLS. */ static void -data_list_trns_free (struct trns_header *pgm) +data_list_trns_free (void *dls_) { - struct data_list_pgm *dls = (struct data_list_pgm *) pgm; + struct data_list_pgm *dls = dls_; free (dls->delims); destroy_dls_var_spec (dls->first); dfm_close_reader (dls->reader); - free (pgm); + free (dls); } -/* Handle DATA LIST transformation T, parsing data into C. */ +/* Handle DATA LIST transformation DLS, parsing data into C. */ static int -data_list_trns_proc (struct trns_header *t, struct ccase *c, - int case_num UNUSED) +data_list_trns_proc (void *dls_, struct ccase *c, int case_num UNUSED) { - struct data_list_pgm *dls = (struct data_list_pgm *) t; + struct data_list_pgm *dls = dls_; data_list_read_func *read_func; int retval; @@ -1328,7 +1301,7 @@ data_list_source_destroy (struct case_source *source) data_list_trns_free (source->aux); } -const struct case_source_class data_list_source_class = +static const struct case_source_class data_list_source_class = { "DATA LIST", NULL, @@ -1348,7 +1321,6 @@ struct rpd_num_or_var /* REPEATING DATA private data structure. */ struct repeating_data_trns { - struct trns_header h; struct dls_var_spec *first, *last; /* Variable parsing specifications. */ struct dfm_reader *reader; /* Input file, never NULL. */ @@ -1382,13 +1354,17 @@ cmd_repeating_data (void) { struct repeating_data_trns *rpd; int table = 1; /* Print table? */ - unsigned seen = 0; /* Mark subcommands as already seen. */ - struct file_handle *const fh = default_handle; + bool saw_starts = false; /* Saw STARTS subcommand? */ + bool saw_occurs = false; /* Saw OCCURS subcommand? */ + bool saw_length = false; /* Saw LENGTH subcommand? */ + bool saw_continued = false; /* Saw CONTINUED subcommand? */ + bool saw_id = false; /* Saw ID subcommand? */ + struct file_handle *const fh = fh_get_default_handle (); assert (case_source_is_complex (vfm_source)); rpd = xmalloc (sizeof *rpd); - rpd->reader = dfm_open_reader (default_handle); + rpd->reader = dfm_open_reader (fh); rpd->first = rpd->last = NULL; rpd->starts_beg.num = 0; rpd->starts_beg.var = NULL; @@ -1406,7 +1382,7 @@ cmd_repeating_data (void) { struct file_handle *file; lex_match ('='); - file = fh_parse (); + file = fh_parse (FH_REF_FILE | FH_REF_INLINE); if (file == NULL) goto error; if (file != fh) @@ -1419,13 +1395,13 @@ cmd_repeating_data (void) else if (lex_match_id ("STARTS")) { lex_match ('='); - if (seen & 1) + if (saw_starts) { msg (SE, _("%s subcommand given multiple times."),"STARTS"); goto error; } - seen |= 1; - + saw_starts = true; + if (!parse_num_or_var (&rpd->starts_beg, "STARTS beginning column")) goto error; @@ -1435,11 +1411,10 @@ cmd_repeating_data (void) if (!parse_num_or_var (&rpd->starts_end, "STARTS ending column")) goto error; } else { - /* Otherwise, rpd->starts_end is left uninitialized. - This is okay. We will initialize it later from the - record length of the file. We can't do this now - because we can't be sure that the user has specified - the file handle yet. */ + /* Otherwise, rpd->starts_end is uninitialized. We + will initialize it later from the record length + of the file. We can't do so now because the + file handle may not be specified yet. */ } if (rpd->starts_beg.num != 0 && rpd->starts_end.num != 0 @@ -1454,12 +1429,12 @@ cmd_repeating_data (void) else if (lex_match_id ("OCCURS")) { lex_match ('='); - if (seen & 2) + if (saw_occurs) { msg (SE, _("%s subcommand given multiple times."),"OCCURS"); goto error; } - seen |= 2; + saw_occurs = true; if (!parse_num_or_var (&rpd->occurs, "OCCURS")) goto error; @@ -1467,12 +1442,12 @@ cmd_repeating_data (void) else if (lex_match_id ("LENGTH")) { lex_match ('='); - if (seen & 4) + if (saw_length) { msg (SE, _("%s subcommand given multiple times."),"LENGTH"); goto error; } - seen |= 4; + saw_length = true; if (!parse_num_or_var (&rpd->length, "LENGTH")) goto error; @@ -1480,16 +1455,17 @@ cmd_repeating_data (void) else if (lex_match_id ("CONTINUED")) { lex_match ('='); - if (seen & 8) + if (saw_continued) { msg (SE, _("%s subcommand given multiple times."),"CONTINUED"); goto error; } - seen |= 8; + saw_continued = true; if (!lex_match ('/')) { - if (!parse_num_or_var (&rpd->cont_beg, "CONTINUED beginning column")) + if (!parse_num_or_var (&rpd->cont_beg, + "CONTINUED beginning column")) goto error; lex_negative_to_dash (); @@ -1513,12 +1489,12 @@ cmd_repeating_data (void) else if (lex_match_id ("ID")) { lex_match ('='); - if (seen & 16) + if (saw_id) { msg (SE, _("%s subcommand given multiple times."),"ID"); goto error; } - seen |= 16; + saw_id = true; if (!lex_force_int ()) goto error; @@ -1563,7 +1539,7 @@ cmd_repeating_data (void) goto error; find_variable_input_spec (rpd->id_var, &rpd->id_spec); - rpd->id_value = xmalloc (sizeof *rpd->id_value * rpd->id_var->nv); + rpd->id_value = xnmalloc (rpd->id_var->nv, sizeof *rpd->id_value); } else if (lex_match_id ("TABLE")) table = 1; @@ -1582,64 +1558,74 @@ cmd_repeating_data (void) } /* Comes here when DATA specification encountered. */ - if ((seen & (1 | 2)) != (1 | 2)) + if (!saw_starts || !saw_occurs) { - if ((seen & 1) == 0) + if (!saw_starts) msg (SE, _("Missing required specification STARTS.")); - if ((seen & 2) == 0) + if (!saw_occurs) msg (SE, _("Missing required specification OCCURS.")); goto error; } /* Enforce ID restriction. */ - if ((seen & 16) && !(seen & 8)) + if (saw_id && !saw_continued) { msg (SE, _("ID specified without CONTINUED.")); goto error; } - /* Calculate starts_end, cont_end if necessary. */ - if (rpd->starts_end.num == 0 && rpd->starts_end.var == NULL) - rpd->starts_end.num = handle_get_record_width (fh); - if (rpd->cont_end.num == 0 && rpd->starts_end.var == NULL) - rpd->cont_end.num = handle_get_record_width (fh); - - /* Calculate length if possible. */ - if ((seen & 4) == 0) + /* Calculate and check starts_end, cont_end if necessary. */ + if (rpd->starts_end.num == 0 && rpd->starts_end.var == NULL) { - struct dls_var_spec *iter; - - for (iter = rpd->first; iter; iter = iter->next) - { - if (iter->lc > rpd->length.num) - rpd->length.num = iter->lc; - } - assert (rpd->length.num != 0); + rpd->starts_end.num = fh_get_record_width (fh); + if (rpd->starts_beg.num != 0 + && rpd->starts_beg.num > rpd->starts_end.num) + { + msg (SE, _("STARTS beginning column (%d) exceeds " + "default STARTS ending column taken from file's " + "record width (%d)."), + rpd->starts_beg.num, rpd->starts_end.num); + goto error; + } + } + if (rpd->cont_end.num == 0 && rpd->cont_end.var == NULL) + { + rpd->cont_end.num = fh_get_record_width (fh); + if (rpd->cont_beg.num != 0 + && rpd->cont_beg.num > rpd->cont_end.num) + { + msg (SE, _("CONTINUED beginning column (%d) exceeds " + "default CONTINUED ending column taken from file's " + "record width (%d)."), + rpd->cont_beg.num, rpd->cont_end.num); + goto error; + } } lex_match ('='); if (!parse_repeating_data (&rpd->first, &rpd->last)) goto error; + /* Calculate length if necessary. */ + if (!saw_length) + { + struct dls_var_spec *iter; + + for (iter = rpd->first; iter; iter = iter->next) + if (iter->lc > rpd->length.num) + rpd->length.num = iter->lc; + assert (rpd->length.num != 0); + } + if (table) dump_fixed_table (rpd->first, fh, rpd->last->rec); - { - struct repeating_data_trns *new_trns; - - rpd->h.proc = repeating_data_trns_proc; - rpd->h.free = repeating_data_trns_free; - - new_trns = xmalloc (sizeof *new_trns); - memcpy (new_trns, &rpd, sizeof *new_trns); - add_transformation ((struct trns_header *) new_trns); - } + add_transformation (repeating_data_trns_proc, repeating_data_trns_free, rpd); return lex_end_of_command (); error: - destroy_dls_var_spec (rpd->first); - free (rpd->id_value); + repeating_data_trns_free (rpd); return CMD_FAILURE; } @@ -1649,14 +1635,15 @@ cmd_repeating_data (void) static void find_variable_input_spec (struct variable *v, struct fmt_spec *spec) { - int i; + size_t i; for (i = 0; i < n_trns; i++) { - struct data_list_pgm *pgm = (struct data_list_pgm *) t_trns[i]; + struct transformation *trns = &t_trns[i]; - if (pgm->h.proc == data_list_trns_proc) + if (trns->proc == data_list_trns_proc) { + struct data_list_pgm *pgm = trns->private; struct dls_var_spec *iter; for (iter = pgm->first; iter; iter = iter->next) @@ -1690,7 +1677,7 @@ parse_num_or_var (struct rpd_num_or_var *value, const char *message) return 0; } } - else if (lex_integer_p ()) + else if (lex_is_integer ()) { value->num = lex_integer (); @@ -1715,7 +1702,7 @@ static int parse_repeating_data (struct dls_var_spec **first, struct dls_var_spec **last) { struct fixed_parsing_state fx; - int i; + size_t i; fx.recno = 0; fx.sc = 1; @@ -1725,7 +1712,7 @@ parse_repeating_data (struct dls_var_spec **first, struct dls_var_spec **last) if (!parse_DATA_LIST_vars (&fx.name, &fx.name_cnt, PV_NONE)) return 0; - if (token == T_NUM) + if (lex_is_number ()) { if (!fixed_parse_compatible (&fx, first, last)) goto fail; @@ -1738,7 +1725,7 @@ parse_repeating_data (struct dls_var_spec **first, struct dls_var_spec **last) else { msg (SE, _("SPSS-like or FORTRAN-like format " - "specification expected after variable names.")); + "specification expected after variable names.")); goto fail; } @@ -1746,11 +1733,6 @@ parse_repeating_data (struct dls_var_spec **first, struct dls_var_spec **last) free (fx.name[i]); free (fx.name); } - if (token != '.') - { - lex_error (_("expecting end of command")); - return 0; - } return 1; @@ -1768,21 +1750,13 @@ parse_repeating_data (struct dls_var_spec **first, struct dls_var_spec **last) static int realize_value (struct rpd_num_or_var *n, struct ccase *c) { - if (n->num > 0) - return n->num; - - assert (n->num == 0); if (n->var != NULL) { double v = case_num (c, n->var->fv); - - if (v == SYSMIS || v <= INT_MIN || v >= INT_MAX) - return -1; - else - return v; + return v != SYSMIS && v >= INT_MIN && v <= INT_MAX ? v : -1; } else - return 0; + return n->num; } /* Parameter record passed to rpd_parse_record(). */ @@ -1906,12 +1880,11 @@ rpd_parse_record (const struct rpd_parse_info *info) DATA structure. Returns -1 on success, -2 on end of file or on failure. */ int -repeating_data_trns_proc (struct trns_header *trns, struct ccase *c, - int case_num UNUSED) +repeating_data_trns_proc (void *trns_, struct ccase *c, int case_num UNUSED) { - struct repeating_data_trns *t = (struct repeating_data_trns *) trns; + struct repeating_data_trns *t = trns_; - struct len_string line; /* Current record. */ + struct fixed_string line; /* Current record. */ int starts_beg; /* Starting column. */ int starts_end; /* Ending column. */ @@ -2061,25 +2034,26 @@ repeating_data_trns_proc (struct trns_header *trns, struct ccase *c, /* Frees a REPEATING DATA transformation. */ void -repeating_data_trns_free (struct trns_header *rpd_) +repeating_data_trns_free (void *rpd_) { - struct repeating_data_trns *rpd = (struct repeating_data_trns *) rpd_; + struct repeating_data_trns *rpd = rpd_; destroy_dls_var_spec (rpd->first); dfm_close_reader (rpd->reader); free (rpd->id_value); + free (rpd); } /* Lets repeating_data_trns_proc() know how to write the cases that it composes. Not elegant. */ void -repeating_data_set_write_case (struct trns_header *trns, +repeating_data_set_write_case (struct transformation *trns_, write_case_func *write_case, write_case_data wc_data) { - struct repeating_data_trns *t = (struct repeating_data_trns *) trns; + struct repeating_data_trns *t = trns_->private; - assert (trns->proc == repeating_data_trns_proc); + assert (trns_->proc == repeating_data_trns_proc); t->write_case = write_case; t->wc_data = wc_data; }