From fee81607c448feaa85024f056c54c6a020d10884 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 22 Dec 2012 17:37:29 +0000 Subject: not needed anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@2805 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/!NotAdopted/Skype/debug.c | 75 --------------------------------------- 1 file changed, 75 deletions(-) delete mode 100755 plugins/!NotAdopted/Skype/debug.c (limited to 'plugins/!NotAdopted/Skype/debug.c') diff --git a/plugins/!NotAdopted/Skype/debug.c b/plugins/!NotAdopted/Skype/debug.c deleted file mode 100755 index 879f53b694..0000000000 --- a/plugins/!NotAdopted/Skype/debug.c +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef _DEBUG -#pragma warning (disable: 4206) // nonstandard extension used : translation unit is empty -#else -#include "debug.h" - -#define WIN32_LEAN_AND_MEAN -//#include -#include -//#include -#include "skype.h" -#include -#include - -#define INITBUF 1024 /* Initial size of buffer */ - -#pragma warning (disable: 4706) // assignment within conditional expression - -extern char g_szProtoName[]; - -static CRITICAL_SECTION m_WriteFileMutex; -static FILE *m_fpLogFile = NULL; -static char *m_szLogBuf = NULL; -static DWORD m_iBufSize = 0; - -void init_debug(void) { - char *p; - char logfile[MAX_PATH]; - - ZeroMemory(logfile, sizeof(logfile)); - p=logfile+GetModuleFileNameA(NULL, logfile, sizeof(logfile)); - if (!(p=strrchr (logfile, '\\'))) p=logfile; else p++; - sprintf (p, "%s_log.txt", SKYPE_PROTONAME); - m_szLogBuf = calloc (1, (m_iBufSize = INITBUF)); - m_fpLogFile = fopen(logfile, "a"); - InitializeCriticalSection(&m_WriteFileMutex); -} - -void end_debug (void) { - if (m_szLogBuf) free (m_szLogBuf); - if (m_fpLogFile) fclose (m_fpLogFile); - DeleteCriticalSection(&m_WriteFileMutex); -} - -void do_log(const char *pszFormat, ...) { - char *ct, *pNewBuf; - va_list ap; - time_t lt; - INT64 iLen; - - if (!m_szLogBuf || !m_fpLogFile) return; - EnterCriticalSection(&m_WriteFileMutex); - time(<); - ct=ctime(<); - ct[strlen(ct)-1]=0; - do - { - va_start(ap, pszFormat); - iLen = _vsnprintf(m_szLogBuf, m_iBufSize, pszFormat, ap); - va_end(ap); - if (iLen == -1) - { - if (!(pNewBuf = (char*)realloc (m_szLogBuf, m_iBufSize*2))) - { - iLen = strlen (m_szLogBuf); - break; - } - m_szLogBuf = pNewBuf; - m_iBufSize*=2; - } - } while (iLen == -1); - fprintf (m_fpLogFile, sizeof(time_t) == sizeof(int) ? "%s (%ld) [%08X] %s\n" : "%s (%lld) [%08X] %s\n", ct, lt, GetCurrentThreadId(), m_szLogBuf); - fflush (m_fpLogFile); - LeaveCriticalSection(&m_WriteFileMutex); -} -#endif \ No newline at end of file -- cgit v1.2.3