/* this is where the thread get to do all its work */ void * xsldbgThreadMain(void *) { // int defaultArgc = 2; // char *defaultArgv[2]; // int i; if (getThreadStatus() != XSLDBG_MSG_THREAD_INIT){ fprintf(stderr, "xsldbg thread is not ready to be started. Or one is already running.\n"); return NULL; /* we can't start more than one thread of xsldbg */ } // defaultArgv[0] = xmlMemStrdup("xsldbg"); // defaultArgv[1] = xmlMemStrdup("--shell"); /* defaultArgv[2] = xmlMemStrdup("xsldoc.xsl"); defaultArgv[3] = xmlMemStrdup("xsldoc.xml"); */ /* for (i = 0; i < defaultArgc; i++){ if (defaultArgv[i] == NULL){ fprintf(stderr, "Start thread failed. Unable to create xsldbg arguments\n"); return NULL; } } */ xsldbgSetThreadCleanupFunc(xsldbgThreadCleanupQt); setThreadStatus(XSLDBG_MSG_THREAD_RUN); setInputStatus(XSLDBG_MSG_AWAITING_INPUT); fprintf(stderr, "Starting thread\n"); /* call the "main of xsldbg" found in debugXSL.c */ // xsldbgMain(defaultArgc, defaultArgv); xsldbgMain(0,0); fprintf(stderr, "Stopping thread\n"); /* for (i = 0; i < defaultArgc; i++){ xmlFree(defaultArgv[i]); } */ setThreadStatus(XSLDBG_MSG_THREAD_DEAD); setInputStatus(XSLDBG_MSG_PROCESSING_INPUT); notifyXsldbgApp(XSLDBG_MSG_THREAD_DEAD, NULL); return NULL; }
int exec(){ return xsldbgMain(0, 0); }