c643fed8474b7bd45471868c5e99a4f7825b716a
2 ** NetXMS - Network Management System
4 ** Copyright (C) 2003, 2004, 2005, 2006, 2007 Victor Kirhenshtein
6 ** This program is free software; you can redistribute it and/or modify
7 ** it under the terms of the GNU General Public License as published by
8 ** the Free Software Foundation; either version 2 of the License, or
9 ** (at your option) any later version.
11 ** This program is distributed in the hope that it will be useful,
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ** GNU General Public License for more details.
16 ** You should have received a copy of the GNU General Public License
17 ** along with this program; if not, write to the Free Software
18 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 static void (*s_dbgPrintCb
)(int, const TCHAR
*, va_list) = NULL
;
38 void __DBWriteLog(WORD level
, const TCHAR
*format
, ...)
43 va_start(args
, format
);
44 _vsntprintf(buffer
, 4096, format
, args
);
46 nxlog_write(g_logMsgCode
, level
, "s", buffer
);
54 void __DBDbgPrintf(int level
, const TCHAR
*format
, ...)
56 if (s_dbgPrintCb
!= NULL
)
60 va_start(args
, format
);
61 s_dbgPrintCb(level
, format
, args
);
68 // Set debug print callback
71 void LIBNXDB_EXPORTABLE
DBSetDebugPrintCallback(void (*cb
)(int, const TCHAR
*, va_list))
83 BOOL WINAPI
DllMain(HINSTANCE hInstance
, DWORD dwReason
, LPVOID lpReserved
)
85 if (dwReason
== DLL_PROCESS_ATTACH
)
86 DisableThreadLibraryCalls(hInstance
);