Updated to release 1.11.1 (Bugfixes release only)
[siplcs.git] / src / miranda / miranda-backend.cpp
blobadd3017fa7bb4f4ca6946e1d9ebf1ce894621b73
1 #include <stdio.h>
2 #include <glib.h>
3 #include <windows.h>
4 #include <process.h>
6 #include "sipe-miranda.h"
8 #include <newpluginapi.h>
9 #include <m_system.h>
10 #include <m_database.h>
12 #include "sipe-common.h"
13 #include "sipe-backend.h"
15 extern "C" void
16 sipe_backend_debug(sipe_debug_level level,
17 const gchar *format,
18 ...) G_GNUC_PRINTF(2, 3)
20 va_list va;
21 char szText[32768];
22 FILE *fh;
24 va_start(va,format);
25 vsnprintf(szText,sizeof(szText),format,va);
26 va_end(va);
28 char *str = DBGetString( NULL, SIPSIMPLE_PROTOCOL_NAME, "debuglog");
29 if (!str)
30 str = mir_strdup("c:/sipsimple.log");
32 if (!fopen_s(&fh, str, "a")) {
33 fprintf(fh, "<[%d]> %s", _getpid(), szText);
34 fclose(fh);
36 mir_free(str);
39 extern "C" const gchar *
40 sipe_backend_network_ip_address(void)
42 return "127.0.0.1";