trace.c

来自「ipsec PNE 3.3 source code, running at mo」· C语言 代码 · 共 49 行

C
49
字号
/************************************************************************@author Julian Bromwich@date April 20, 2004This allows runtime tracing of function calls.(see trace.h for documentation)*************************************************************************/#define __WRN_DEF_TRACE__#ifdef __WRN_DEF_TRACE__#include <stdio.h>char *traceIndent    (    int adjust    );int ipsecTraceOn = 0; /* Run-time switch to enable Tracing */#define MAX_INDENT 80char indentString [] = "                                                                                 ";int lastPosition = 0;int position = 0;char *traceIndent    (    int adjust    )    {    /* Move NULL to new position */    indentString[lastPosition] = ' ';    indentString[position] = '\0';    /* Adjust next position of NULL in indentString */    if ((position + adjust >= 0) && (position + adjust < MAX_INDENT))        {        lastPosition = position;        position += adjust;        }    /* Move NULL to new position right away if negative adjust */    if (adjust < 0)        {        indentString[lastPosition] = ' ';        indentString[position] = '\0';        }    return indentString;    }#endif

⌨️ 快捷键说明

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