⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bsdebug.c

📁 GZip Compress Souce Code
💻 C
字号:

#include "bsdebug.h"
#include <stdio.h>
#include <stdarg.h>

#define MS_DOS_DEBUG_OUT	1

#ifdef MS_DOS_DEBUG_OUT
#undef OutputDebugString
#undef UNICODE
#define OutputDebugString(a)	printf("%s", a);
#endif

static int tabCount = 0;

#define MY_CP_ACP 0
#define NUMofELMS(aa) (sizeof(aa)/sizeof((aa)[0]))



void DbgPrintfi(const char *_format, ...)
{
#if defined(_TRACEHELPER_DEBUG_ALL_) || defined(_TRACEHELPER_DEBUG_EACH_OF_FILE_)
	char str[2048];
	int i;
#ifdef _UNICODE
	wchar_t tstr[1024];
#endif
	va_list _ap; 	
   	va_start(_ap, _format);
	vsprintf(str,  _format, _ap);

#ifdef _UNICODE
	MultiByteToWideChar(MY_CP_ACP, 0, str, -1, tstr, NUMofELMS(tstr));	
	for(i=0; i < tabCount; i++)
		OutputDebugString(L"  ");

	OutputDebugString(tstr);
#else
	for(i=0; i < tabCount; i++)
		OutputDebugString("  ");
	
	OutputDebugString(str);
#endif

	tabCount++;

   	va_end(_ap);
#endif
}

void DbgPrintfo(const char *_format, ...)
{
#if defined(_TRACEHELPER_DEBUG_ALL_) || defined(_TRACEHELPER_DEBUG_EACH_OF_FILE_)
	char str[2048];
	int i;
#ifdef _UNICODE
	wchar_t tstr[1024];
#endif

	va_list _ap; 	
   	va_start(_ap, _format);
	vsprintf(str, _format, _ap);

	tabCount--;

#ifdef _UNICODE
	MultiByteToWideChar(MY_CP_ACP, 0, str, -1, tstr, NUMofELMS(tstr));	
	for(i=0; i < tabCount; i++)
		OutputDebugString(L"  ");

	OutputDebugString(tstr);
#else
	for(i=0; i < tabCount; i++)
		OutputDebugString("  ");
	
	OutputDebugString(str);
#endif

   	va_end(_ap);
#endif
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -