debug.c

来自「一个在Windows环境下允许用户程序访问USB设备的接口库的源代码.」· C语言 代码 · 共 36 行

C
36
字号
#include "libusb_filter.h"#include <stdarg.h>#include <stdio.h>#include <stddef.h>#define DEBUG_BUFFER_SIZE 1024static int debug_level = DEBUG_MSG;void debug_print_nl(void){  if(debug_level) KdPrint((" "));}void debug_set_level(int level){  debug_level = level;}void debug_printf(int level, char *format, ...) {  char tmp[DEBUG_BUFFER_SIZE];  va_list args;  if(level <= debug_level)    {      va_start(args, format);      vsprintf(tmp, format, args);      va_end(args);      KdPrint(("LIBUSB_FILTER - %s\n", tmp));    }}

⌨️ 快捷键说明

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