debuglog.c File Reference

This handles debugging. More...

#include "config.h"
#include <syslog.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>
#include <sys/types.h>
#include "pcsclite.h"
#include "misc.h"
#include "debuglog.h"
#include "sys_generic.h"
#include "strlcpycat.h"

Go to the source code of this file.

Defines

#define DEBUG_BUF_SIZE   2048
 Max string size when dumping a 256 bytes longs APDU Should be bigger than 256*3+30.
#define DEBUG_INFO_LENGTH   80

Functions

void log_msg (const int priority, const char *fmt,...)
void log_xxd (const int priority, const char *msg, const unsigned char *buffer, const int len)
void DebugLogSetLogType (const int dbgtype)
void DebugLogSetLevel (const int level)
INTERNAL int DebugLogSetCategory (const int dbginfo)
INTERNAL void DebugLogCategory (const int category, const unsigned char *buffer, const int len)
char * pcsc_stringify_error (long pcscError)
 This function return a human readable text for the given PC/SC error code.

Variables

static char LogSuppress = DEBUGLOG_LOG_ENTRIES
static char LogMsgType = DEBUGLOG_NO_DEBUG
static char LogCategory = DEBUG_CATEGORY_NOTHING
static char LogLevel = PCSC_LOG_INFO
static signed char LogDoColor = 0


Detailed Description

This handles debugging.

Definition in file debuglog.c.


Function Documentation

char* pcsc_stringify_error long  pcscError  ) 
 

This function return a human readable text for the given PC/SC error code.

Parameters:
[in] pcscError Error code to be translated to text.
Returns:
Text representing de error code passed.
Test:
 SCARDCONTEXT hContext;
 LONG rv;
 rv = SCardEstablishContext(SCARD\_SCOPE\_SYSTEM, NULL, NULL, &hContext);
 if (rv != SCARD_S_SUCCESS)
     printf("SCardReleaseContext: %s (0x%lX)\n",
         pcsc_stringify_error(rv), rv);

Definition at line 270 of file debuglog.c.

References SCARD_E_CANCELLED, SCARD_E_CANT_DISPOSE, SCARD_E_CARD_UNSUPPORTED, SCARD_E_DUPLICATE_READER, SCARD_E_INSUFFICIENT_BUFFER, SCARD_E_INVALID_ATR, SCARD_E_INVALID_HANDLE, SCARD_E_INVALID_PARAMETER, SCARD_E_INVALID_TARGET, SCARD_E_INVALID_VALUE, SCARD_E_NO_MEMORY, SCARD_E_NO_SERVICE, SCARD_E_NO_SMARTCARD, SCARD_E_NOT_READY, SCARD_E_NOT_TRANSACTED, SCARD_E_PCI_TOO_SMALL, SCARD_E_PROTO_MISMATCH, SCARD_E_READER_UNAVAILABLE, SCARD_E_READER_UNSUPPORTED, SCARD_E_SERVICE_STOPPED, SCARD_E_SHARING_VIOLATION, SCARD_E_SYSTEM_CANCELLED, SCARD_E_TIMEOUT, SCARD_E_UNKNOWN_CARD, SCARD_E_UNKNOWN_READER, SCARD_E_UNSUPPORTED_FEATURE, SCARD_F_COMM_ERROR, SCARD_F_INTERNAL_ERROR, SCARD_F_UNKNOWN_ERROR, SCARD_F_WAITED_TOO_LONG, SCARD_S_SUCCESS, SCARD_W_INSERTED_CARD, SCARD_W_REMOVED_CARD, SCARD_W_RESET_CARD, SCARD_W_UNPOWERED_CARD, SCARD_W_UNRESPONSIVE_CARD, and SCARD_W_UNSUPPORTED_CARD.

Referenced by main(), and RFCleanupReaders().


Generated on Fri Mar 24 04:30:06 2006 for pcsc-lite by  doxygen 1.4.6