void vp_do_repeat(vp_command cmd,void* retval) { if(cmd.dsph && cmd.func){ vp_start(cmd.data); cmd.dsph(cmd.func,&cmd.data,retval); } vp_command* n = cmd.next; while(n){ vp_start(n->data); n->dsph(n->func,&n->data,NULL); n = n->next; } }
void vp_do(vp_command cmd,void* retval) { if(cmd.dsph==NULL||cmd.func==NULL) return; vp_start(cmd.data); cmd.dsph(cmd.func,&cmd.data,retval); vp_end(cmd.data); cmd.dsph = (VP_DISPATCH)NULL; cmd.func = (VP_CALLBACK)NULL; vp_command* n = cmd.next; cmd.next = NULL; vp_command* p; while(n){ vp_start(n->data); n->dsph(n->func,&n->data,NULL); vp_end(n->data); p = n; n = n->next; free(p); } }