diff options
Diffstat (limited to 'kxsldbg/kxsldbgpart/libqtnotfier')
-rw-r--r-- | kxsldbg/kxsldbgpart/libqtnotfier/qtnotifier2.cpp | 6 | ||||
-rw-r--r-- | kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp | 40 |
2 files changed, 23 insertions, 23 deletions
diff --git a/kxsldbg/kxsldbgpart/libqtnotfier/qtnotifier2.cpp b/kxsldbg/kxsldbgpart/libqtnotfier/qtnotifier2.cpp index 98c4ea95..0db9d1f0 100644 --- a/kxsldbg/kxsldbgpart/libqtnotfier/qtnotifier2.cpp +++ b/kxsldbg/kxsldbgpart/libqtnotfier/qtnotifier2.cpp @@ -27,12 +27,12 @@ XsldbgDebuggerBase *_debugger = 0L; int qtNotifyXsldbgApp(XsldbgMessageEnum type, const void *data) { int result = 0; - if (::getThreadtqStatus() == XSLDBG_MSG_THREAD_NOTUSED){ + if (::getThreadStatus() == XSLDBG_MSG_THREAD_NOTUSED){ return 1; } /* clear the input ready flag as quickly as possible*/ - if ( ::getInputtqStatus() == XSLDBG_MSG_READ_INPUT) + if ( ::getInputStatus() == XSLDBG_MSG_READ_INPUT) ::setInputReady(0); /* state of the thread */ @@ -45,7 +45,7 @@ int qtNotifyXsldbgApp(XsldbgMessageEnum type, const void *data) } } - if (::getThreadtqStatus() == XSLDBG_MSG_THREAD_STOP) + if (::getThreadStatus() == XSLDBG_MSG_THREAD_STOP) ::xsldbgThreadCleanup(); /* thread has died so cleanup after it */ result++; /* at the moment this function will always work */ diff --git a/kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp b/kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp index 1f997919..4fe2e02c 100644 --- a/kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp +++ b/kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp @@ -83,7 +83,7 @@ xsldbgThreadInit(void) int result = 0; fprintf(stderr, "mainInit()\n"); xsltSetGenericErrorFunc(0, xsldbgGenericErrorFunc); - setThreadtqStatus(XSLDBG_MSG_THREAD_INIT); + setThreadStatus(XSLDBG_MSG_THREAD_INIT); xsldbgSetAppFunc(qtNotifyXsldbgApp); xsldbgSetAppStateFunc(qtNotifyStateXsldbgApp); xsldbgSetTextFunc(qtNotifyTextXsldbgApp); @@ -94,12 +94,12 @@ xsldbgThreadInit(void) if (pthread_create(&mythread, NULL, xsldbgThreadMain, NULL) != EAGAIN) { int counter; for (counter = 0; counter < 11; counter++){ - if (getThreadtqStatus() != XSLDBG_MSG_THREAD_INIT) + if (getThreadStatus() != XSLDBG_MSG_THREAD_INIT) break; usleep(250000); /*guess that it will take at most 2.5 seconds to startup */ } /* xsldbg should have started by now if it can */ - if (getThreadtqStatus() == XSLDBG_MSG_THREAD_RUN){ + if (getThreadStatus() == XSLDBG_MSG_THREAD_RUN){ fprintf(stderr, "Created thread\n"); result++; }else @@ -117,13 +117,13 @@ void xsldbgThreadFree(void) { fprintf(stderr, "xsldbgThreadFree()\n"); - if (getThreadtqStatus() != XSLDBG_MSG_THREAD_DEAD) + if (getThreadStatus() != XSLDBG_MSG_THREAD_DEAD) { int counter; fprintf(stderr, "Killing xsldbg thread\n"); - setThreadtqStatus(XSLDBG_MSG_THREAD_STOP); + setThreadStatus(XSLDBG_MSG_THREAD_STOP); for (counter = 0; counter < 11; counter++){ - if (getThreadtqStatus() == XSLDBG_MSG_THREAD_DEAD) + if (getThreadStatus() == XSLDBG_MSG_THREAD_DEAD) break; usleep(250000); /*guess that it will take at most 2.5 seconds to stop */ } @@ -143,7 +143,7 @@ fakeInput(const char *text) { int result = 0; - if (!text || (getInputReady() == 1) || (getThreadtqStatus() != XSLDBG_MSG_THREAD_RUN)) + if (!text || (getInputReady() == 1) || (getThreadStatus() != XSLDBG_MSG_THREAD_RUN)) return result; // fprintf(stderr, "\nFaking input of \"%s\"\n", text); @@ -172,7 +172,7 @@ qtXslDbgShellReadline(xmlChar * prompt) static char last_read[DEBUG_BUFFER_SIZE] = { '\0' }; - if (getThreadtqStatus() != XSLDBG_MSG_THREAD_RUN) + if (getThreadStatus() != XSLDBG_MSG_THREAD_RUN) { #ifdef HAVE_READLINE xmlChar *line_read; @@ -209,20 +209,20 @@ qtXslDbgShellReadline(xmlChar * prompt) } else{ - setInputtqStatus(XSLDBG_MSG_AWAITING_INPUT); + setInputStatus(XSLDBG_MSG_AWAITING_INPUT); notifyXsldbgApp(XSLDBG_MSG_AWAITING_INPUT, NULL); while (getInputReady() == 0){ usleep(10000); /* have we been told to die */ - if (getThreadtqStatus() == XSLDBG_MSG_THREAD_STOP){ + if (getThreadStatus() == XSLDBG_MSG_THREAD_STOP){ fprintf(stderr, "About to stop thread\n"); xslDebugStatus = DEBUG_TQUIT; return NULL; } } - setInputtqStatus(XSLDBG_MSG_READ_INPUT); + setInputStatus(XSLDBG_MSG_READ_INPUT); inputReadBuff = getFakeInput(); if(inputReadBuff){ notifyXsldbgApp(XSLDBG_MSG_READ_INPUT, inputReadBuff); @@ -283,7 +283,7 @@ xsldbgThreadMain(void *) // char *defaultArgv[2]; // int i; - if (getThreadtqStatus() != XSLDBG_MSG_THREAD_INIT){ + 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 */ } @@ -302,8 +302,8 @@ xsldbgThreadMain(void *) } */ xsldbgSetThreadCleanupFunc(xsldbgThreadCleanupTQt); - setThreadtqStatus(XSLDBG_MSG_THREAD_RUN); - setInputtqStatus(XSLDBG_MSG_AWAITING_INPUT); + setThreadStatus(XSLDBG_MSG_THREAD_RUN); + setInputStatus(XSLDBG_MSG_AWAITING_INPUT); fprintf(stderr, "Starting thread\n"); /* call the "main of xsldbg" found in debugXSL.c */ @@ -316,8 +316,8 @@ xsldbgThreadMain(void *) } */ - setThreadtqStatus(XSLDBG_MSG_THREAD_DEAD); - setInputtqStatus(XSLDBG_MSG_PROCESSING_INPUT); + setThreadStatus(XSLDBG_MSG_THREAD_DEAD); + setInputStatus(XSLDBG_MSG_PROCESSING_INPUT); notifyXsldbgApp(XSLDBG_MSG_THREAD_DEAD, NULL); return NULL; } @@ -330,12 +330,12 @@ void xsldbgThreadCleanupTQt(void) { fprintf(stderr, "Thread has finished\n"); - if (getThreadtqStatus() == XSLDBG_MSG_THREAD_RUN) + if (getThreadStatus() == XSLDBG_MSG_THREAD_RUN) { xsldbgThreadFree(); } - /* its safe to modify threadtqStatus as the thread is now dead */ - setThreadtqStatus(XSLDBG_MSG_THREAD_DEAD); + /* its safe to modify threadStatus as the thread is now dead */ + setThreadStatus(XSLDBG_MSG_THREAD_DEAD); } @@ -346,7 +346,7 @@ xsldbgThreadStdoutReader(void *data) if (!stdoutIO) return data; - while (getThreadtqStatus() == XSLDBG_MSG_THREAD_RUN){ + while (getThreadStatus() == XSLDBG_MSG_THREAD_RUN){ if (fgets(outputBuffer, sizeof(outputBuffer -1), stdoutIO)){ usleep(10000); strcat(outputBuffer, "\n"); |