-/* Sets all the lag-related variables based on value of n_lag. */
-static void
-setup_lag (void)
-{
- int i;
-
- if (n_lag == 0)
- return;
-
- lag_count = 0;
- lag_head = 0;
- lag_queue = xmalloc (n_lag * sizeof *lag_queue);
- for (i = 0; i < n_lag; i++)
- lag_queue[i] = xmalloc (dict_get_case_size (temp_dict));
-}
-
-/* There is a lot of potential confusion in the vfm and related
- routines over the number of `value's at each stage of the process.
- Here is each nval count, with explanation, as set up by
- open_active_file():
-
- temp_dict->nval: Number of `value's in the cases after the
- transformations leading up to TEMPORARY have been performed.
-
- compaction_nval: Number of `value's in the cases after the
- transformations leading up to TEMPORARY have been performed
- and the case has been compacted by compact_case(), if
- compaction is necessary. This the number of `value's in the
- cases saved by the sink stream. (However, note that the cases
- passed to the sink stream have not yet been compacted. It is
- the responsibility of the data sink to call compact_case().)
- `compaction' becomes the new value of default_dict.nval after
- the procedure is completed.
-
- default_dict.nval: This is often an alias for temp_dict->nval.
- As such it can really have no separate existence until the
- procedure is complete. For this reason it should *not* be
- referenced inside the execution of a procedure. */
-/* Makes all preparations for reading from the data source and writing
- to the data sink. */
-static void
-open_active_file (void)
-{
- /* Sometimes we want to refer to the dictionary that applies to the
- data actually written to the sink. This is either temp_dict or
- default_dict. However, if TEMPORARY is not on, then temp_dict
- does not apply. So, we can set temp_dict to default_dict in this
- case. */
- if (!temporary)
- {
- temp_trns = n_trns;
- temp_dict = default_dict;
- }
-
- /* No cases passed to the procedure yet. */
- case_count = 0;
-
- /* The rest. */
- prepare_for_writing ();
- arrange_compaction ();
- make_temp_case ();
- vector_initialization ();
- discard_ctl_stack ();
- setup_lag ();
-}
-\f