This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
astyle --brackets=linux --indent=spaces=4 --indent-preprocessor --min-conditional-indent=0 --max-instatement-indent=40 --pad-oper --unpad-paren --pad-header --fill-empty-lines --align-pointer=name --align-reference=name --convert-tabs --lineend=linux --formatted `find ./ -type f -name '*.c' -or -name '*.h' -or -name '*.cpp'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TARGET = applicationName | |
DESTDIR = ../../build | |
outDir = $$DESTDIR | |
outDir = $$replace(outDir, /, \\) | |
system(mkdir $$outDir) | |
system(xcopy /V /R /Y "%QTDIR%\bin\libgcc_s_dw2-1.dll" $$outDir) | |
system(xcopy /V /R /Y "%QTDIR%\bin\libwinpthread-1.dll" $$outDir) | |
system(xcopy /V /R /Y "%QTDIR%\bin\libstdc++-6.dll" $$outDir) | |
system(xcopy /V /R /Y "%QTDIR%\bin\icu*.dll" $$outDir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int CALLBACK wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) | |
{ | |
// Avoid multiple instances of application | |
const WCHAR *applicationMutexName = L"autorun_st"; | |
HANDLE mutexAppHandle = CreateMutex(NULL, TRUE, applicationMutexName); | |
if (GetLastError() == ERROR_ALREADY_EXISTS) { | |
CloseHandle(mutexAppHandle); | |
return EXIT_FAILURE; | |
} | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QSharedMemory> | |
int main(int argc, char *argv[]) | |
{ | |
// Verify unique instance of application | |
QSharedMemory sharedMemory("service"); | |
if (sharedMemory.attach()) | |
return EXIT_FAILURE; | |
if (!sharedMemory.create(1)) | |
return EXIT_FAILURE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QtDebug> | |
#include <QTranslator> | |
#include <QTextCodec> | |
#include <QLocale> | |
#include <QTime> | |
#include <QDir> | |
static QTextCodec *logCodec = NULL; | |
static FILE *logStream = NULL; | |
QString g_logFilePath = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdarg.h> | |
#include <syslog.h> | |
#include <time.h> | |
/** | |
* \brief Log levels. Used to control applications's verbosity. | |
* | |
* Verbosity is as follows: LOG_CRITICAL_ERROR is least verbose, | |
* LOG_EVENT is the most verbose log level. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef enum { | |
LOG_INFO = 0, /**< Notification for better debugging */ | |
LOG_WARNING = 1,/**< Incorrect work of application, but it doesn't lead to crash */ | |
LOG_ERROR = 2 /**< Big problem - application is crashed */ | |
} logLevel_e; | |
static FILE *g_logStream = NULL; | |
static WCHAR g_logFilePath[MAX_PATH]; | |
static WCHAR g_logMessage[10000]; |