libdmtx 0.7.8.7
libdmtx is a software library that enables programs to read and write Data Matrix barcodes of the modern ECC200 variety.
Loading...
Searching...
No Matches
dmtxlog.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "dmtx.h"
#include "dmtxstatic.h"

Go to the source code of this file.

Classes

struct  Callback
 

Macros

#define MAX_CALLBACKS   32
 
#define DmtxPrint   fprintf
 

Functions

static void stdoutCallback (DmtxLogEvent *ev)
 
static void fileCallback (DmtxLogEvent *ev)
 
static void unlock (void)
 
const char * dmtxLogLevelString (int level)
 
void dmtxLogSetLock (DmtxLogLockFn fn, void *udata)
 
void dmtxLogSetLevel (int level)
 
void dmtxLogSetQuiet (DmtxBoolean enable)
 
int dmtxLogAddCallback (DmtxLogFn fn, void *udata, int level)
 
int dmtxLogAddFp (FILE *fp, int level)
 
static void initEvent (DmtxLogEvent *ev, void *udata)
 
void dmtxLog (int level, const char *file, int line, const char *fmt,...)
 

Variables

struct { 
 
   void *   udata 
 
   DmtxLogLockFn   lock 
 
   int   level 
 
   unsigned int   quiet 
 
   Callback   callbacks [MAX_CALLBACKS
 
l 
 
static const char * levelStrings [] = {"TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"}
 

Macro Definition Documentation

◆ DmtxPrint

#define DmtxPrint   fprintf

Definition at line 36 of file dmtxlog.c.

◆ MAX_CALLBACKS

#define MAX_CALLBACKS   32

Definition at line 31 of file dmtxlog.c.

Function Documentation

◆ dmtxLog()

void dmtxLog ( int level,
const char * file,
int line,
const char * fmt,
... )
extern

Definition at line 154 of file dmtxlog.c.

◆ dmtxLogAddCallback()

int dmtxLogAddCallback ( DmtxLogFn fn,
void * udata,
int level )

Definition at line 121 of file dmtxlog.c.

◆ dmtxLogAddFp()

int dmtxLogAddFp ( FILE * fp,
int level )

Definition at line 132 of file dmtxlog.c.

◆ dmtxLogLevelString()

const char * dmtxLogLevelString ( int level)

Definition at line 100 of file dmtxlog.c.

◆ dmtxLogSetLevel()

void dmtxLogSetLevel ( int level)
extern

Definition at line 111 of file dmtxlog.c.

◆ dmtxLogSetLock()

void dmtxLogSetLock ( DmtxLogLockFn fn,
void * udata )

Definition at line 105 of file dmtxlog.c.

◆ dmtxLogSetQuiet()

void dmtxLogSetQuiet ( DmtxBoolean enable)
extern

Definition at line 116 of file dmtxlog.c.

◆ fileCallback()

static void fileCallback ( DmtxLogEvent * ev)
static

Definition at line 76 of file dmtxlog.c.

◆ initEvent()

static void initEvent ( DmtxLogEvent * ev,
void * udata )
static

Definition at line 137 of file dmtxlog.c.

◆ stdoutCallback()

static void stdoutCallback ( DmtxLogEvent * ev)
static

Definition at line 61 of file dmtxlog.c.

◆ unlock()

static void unlock ( void )
static

Definition at line 93 of file dmtxlog.c.

Variable Documentation

◆ callbacks

Callback callbacks[MAX_CALLBACKS]

Definition at line 52 of file dmtxlog.c.

◆ [struct]

struct { ... } l

◆ level

int level

Definition at line 50 of file dmtxlog.c.

◆ levelStrings

const char* levelStrings[] = {"TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"}
static

Definition at line 55 of file dmtxlog.c.

◆ lock

static void lock ( void )

Definition at line 49 of file dmtxlog.c.

◆ quiet

unsigned int quiet

Definition at line 51 of file dmtxlog.c.

◆ udata

void* udata

Definition at line 48 of file dmtxlog.c.