+Wed Apr 26 19:48:52 2006 Ben Pfaff <blp@gnu.org>
+
+ Continue reforming procedure execution. In this phase, assert
+ that add_transformation() is not called during procedure
+ execution. Thanks to John Darrington for the suggestion.
+
+ * procedure.c: (static var in_procedure) New var.
+ (internal_procedure) Get rid of recursive_call local var and
+ logic.
+ (open_active_file) Set in_procedure and make sure it wasn't
+ already set.
+ (close_active_file) Reset in_procedure and make sure it was
+ already set.
+ (add_transformation) Make sure we're not in a procedure.
+
Wed Apr 26 19:33:52 2006 Ben Pfaff <blp@gnu.org>
Continue reforming procedure execution. In this phase, break
/* Time at which vfm was last invoked. */
static time_t last_vfm_invocation;
+/* Whether we're inside a procedure.
+ For debugging purposes only. */
+static bool in_procedure;
+
/* Lag queue. */
int n_lag; /* Number of cases to lag. */
static int lag_count; /* Number of cases in lag_queue so far. */
static bool
internal_procedure (bool (*proc_func) (struct ccase *, void *), void *aux)
{
- static int recursive_call;
struct write_case_data wc_data;
bool ok;
- assert (++recursive_call == 1);
-
wc_data.proc_func = proc_func;
wc_data.aux = aux;
create_trns_case (&wc_data.trns_case, default_dict);
case_destroy (&wc_data.sink_case);
case_destroy (&wc_data.trns_case);
- assert (--recursive_call == 0);
-
return ok;
}
static void
open_active_file (void)
{
+ assert (!in_procedure);
+ in_procedure = true;
+
/* Make temp_dict refer to the dictionary right before data
reaches the sink */
if (!temporary)
process_if_expr = NULL;
dict_set_case_limit (default_dict, 0);
dict_clear_vectors (default_dict);
+
+ assert (in_procedure);
+ in_procedure = false;
+
return cancel_transformations ();
}
\f
add_transformation (trns_proc_func *proc, trns_free_func *free, void *private)
{
struct transformation *trns;
+
+ assert (!in_procedure);
+
if (n_trns >= m_trns)
t_trns = x2nrealloc (t_trns, &m_trns, sizeof *t_trns);
trns = &t_trns[n_trns++];