static void handle_transform(TSCont contp) { MyData *data; int done; /* Get our data structure for this operation. The private data structure contains the output VIO and output buffer. If the private data structure pointer is NULL, then we'll create it and initialize its internals. */ data = TSContDataGet(contp); if (!data) { data = my_data_alloc(); TSContDataSet(contp, data); } do { switch (data->state) { case STATE_BUFFER_DATA: done = handle_buffering(contp, data); break; case STATE_OUTPUT_DATA: done = handle_output(contp, data); break; default: done = 1; break; } } while (!done); }
static void jcrusher_handle_transform(TSCont contp) { JCrusherData *data; int done; /* Get our data structure for this operation. The private data structure contains the output VIO and output buffer. If the private data structure pointer is NULL, then we'll create it and initialize its internals. */ TSDebug("jcrusher", "Start of handle_transform()"); data = TSContDataGet(contp); if (!data) { data = jcrusher_data_alloc(); TSContDataSet(contp, data); } do { switch (data->state) { case STATE_BUFFER_DATA: TSDebug("jcrusher", "data->state is STATE_BUFFER_DATA"); done = handle_buffering(contp, data); break; case STATE_OUTPUT_DATA: TSDebug("jcrusher", "data->state is STATE_OUTPUT_DATA"); done = handle_output(contp, data); break; default: TSDebug("jcrusher", "data->state is UNKNOWN"); done = 1; break; } } while (!done); TSDebug("jcrusher", "End of handle_transform()"); }