cryptlib  3.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
Macros | Functions | Variables
debug.h File Reference
#include <assert.h>
#include <stdio.h>

Go to the source code of this file.

Macros

#define ASSERT_CONCAT_(a, b)   a##b
 
#define ASSERT_CONCAT(a, b)   ASSERT_CONCAT_( a, b )
 
#define __COUNTER__   __LINE__
 
#define static_assert(expr, string)   { enum { ASSERT_CONCAT( static_assert_, __COUNTER__ ) = 1 / ( !!( expr ) ) }; }
 
#define static_assert_opt(expr, string)   assert( expr )
 
#define DEBUG_WARN   0
 
#define DEBUG_PRINT(x)   printf x
 
#define DEBUG_OUT(string)   printf( "%s", string )
 
#define DEBUG_ENTER()   DEBUG_PRINT(( "Enter %s:%d.\n", __FILE__, __LINE__ ))
 
#define DEBUG_IN()   DEBUG_PRINT(( "In %s:%d.\n", __FILE__, __LINE__ ))
 
#define DEBUG_EXIT()   DEBUG_PRINT(( "Exit %s:%d, status %d.\n", __FILE__, __LINE__, status ))
 
#define DEBUG_EXIT_NONE()   DEBUG_PRINT(( "Exit %s:%d.\n", __FILE__, __LINE__ ))
 
#define DEBUG_DIAG(x)
 
#define DEBUG_DUMP_FILE   debugDumpFile
 
#define DEBUG_DUMP_CERT   debugDumpFileCert
 
#define DEBUG_DUMP_HEX   debugDumpHex
 
#define DEBUG_DUMP_DATA   debugDumpData
 
#define DEBUG_DUMP_STREAM   debugDumpStream
 
#define DEBUG_GET_STREAMBYTE   debugGetStreamByte
 
#define DEBUG_DUMP_LIST(label, listHead, listTail, listType)
 
#define clAlloc(string, size)   malloc( size )
 
#define clFree(string, memblock)   free( memblock )
 
#define clDynAlloc(string, size)   clAlloc( string, size )
 

Functions

 STDC_NONNULL_ARG ((1, 2)) void debugDumpFile(IN_STRING const char *fileName
 
 IN_BUFFER (dataLength) const void *data
 
 STDC_NONNULL_ARG ((1)) void debugDumpFileCert(IN_STRING const char *fileName
 

Variables

IN_LENGTH_SHORT const int dataLength
 
IN_HANDLE const CRYPT_CERTIFICATE iCryptCert
 
IN_LENGTH const int position
 
IN_LENGTH const int IN_LENGTH
const int 
length
 

Macro Definition Documentation

#define __COUNTER__   __LINE__

Definition at line 73 of file debug.h.

#define ASSERT_CONCAT (   a,
 
)    ASSERT_CONCAT_( a, b )

Definition at line 68 of file debug.h.

#define ASSERT_CONCAT_ (   a,
 
)    a##b

Definition at line 67 of file debug.h.

#define clAlloc (   string,
  size 
)    malloc( size )

Definition at line 304 of file debug.h.

#define clDynAlloc (   string,
  size 
)    clAlloc( string, size )

Definition at line 310 of file debug.h.

#define clFree (   string,
  memblock 
)    free( memblock )

Definition at line 305 of file debug.h.

#define DEBUG_DIAG (   x)
Value:
DEBUG_PRINT(( "%s:%d: ", __FILE__, __LINE__ )); \
DEBUG_PRINT( x ); \
DEBUG_PRINT(( ".\n" ))

Definition at line 183 of file debug.h.

#define DEBUG_DUMP_CERT   debugDumpFileCert

Definition at line 220 of file debug.h.

#define DEBUG_DUMP_DATA   debugDumpData

Definition at line 222 of file debug.h.

#define DEBUG_DUMP_FILE   debugDumpFile

Definition at line 219 of file debug.h.

#define DEBUG_DUMP_HEX   debugDumpHex

Definition at line 221 of file debug.h.

#define DEBUG_DUMP_LIST (   label,
  listHead,
  listTail,
  listType 
)
Value:
{ \
listType *listPtr; \
DEBUG_PRINT(( "%s: Walking list beginning at %lX.\n", \
label, ( listHead ) )); \
for( listPtr = ( listHead ); \
listPtr != NULL; listPtr = listPtr->next ) \
{ \
DEBUG_PRINT(( " Ptr = %lX, prev = %lX, next = %lX.\n", \
listPtr, listPtr->prev, listPtr->next )); \
} \
if( ( listHead ) != NULL ) \
DEBUG_PRINT(( " List tail = %lX.\n", ( listTail ) )); \
DEBUG_PRINT(( "Finished walking list beginning at %lX.\n", ( listHead ) )); \
}

Definition at line 255 of file debug.h.

#define DEBUG_DUMP_STREAM   debugDumpStream

Definition at line 223 of file debug.h.

#define DEBUG_ENTER ( )    DEBUG_PRINT(( "Enter %s:%d.\n", __FILE__, __LINE__ ))

Definition at line 177 of file debug.h.

#define DEBUG_EXIT ( )    DEBUG_PRINT(( "Exit %s:%d, status %d.\n", __FILE__, __LINE__, status ))

Definition at line 179 of file debug.h.

#define DEBUG_EXIT_NONE ( )    DEBUG_PRINT(( "Exit %s:%d.\n", __FILE__, __LINE__ ))

Definition at line 180 of file debug.h.

#define DEBUG_GET_STREAMBYTE   debugGetStreamByte

Definition at line 224 of file debug.h.

#define DEBUG_IN ( )    DEBUG_PRINT(( "In %s:%d.\n", __FILE__, __LINE__ ))

Definition at line 178 of file debug.h.

#define DEBUG_OUT (   string)    printf( "%s", string )

Definition at line 150 of file debug.h.

#define DEBUG_PRINT (   x)    printf x

Definition at line 149 of file debug.h.

#define DEBUG_WARN   0

Definition at line 95 of file debug.h.

#define static_assert (   expr,
  string 
)    { enum { ASSERT_CONCAT( static_assert_, __COUNTER__ ) = 1 / ( !!( expr ) ) }; }

Definition at line 87 of file debug.h.

#define static_assert_opt (   expr,
  string 
)    assert( expr )

Definition at line 89 of file debug.h.

Function Documentation

IN_BUFFER ( dataLength  ) const
STDC_NONNULL_ARG ( (1, 2)  ) const
STDC_NONNULL_ARG ( (1)  ) const

Variable Documentation

IN_LENGTH_SHORT const int dataLength

Definition at line 229 of file debug.h.

Definition at line 232 of file debug.h.

IN_LENGTH const int IN_LENGTH const int length

Definition at line 242 of file debug.h.

Definition at line 242 of file debug.h.