AFHBA404
AFHBA404 connects ACQ2106 to PCI-Express
Macros | Typedefs | Variables
local.h File Reference
#include <string.h>
#include <sys/syslog.h>

Go to the source code of this file.

Macros

#define STREQ(s1, s2)   (strcmp( s1, s2 ) == 0)
 
#define STREQN(s1, s2, n)   (strncmp( s1, s2, n ) == 0)
 
#define STREQNL(s1, s2)   (strncmp( s1, s2, strlen(s2) ) == 0)
 
#define IN_RANGE(xx, ll, rr)   ((xx)>=(ll)&&(xx)<=(rr))
 
#define CLAMP(xx, ll, rr)   ((xx) = (xx)<(ll)? (ll): (xx)>(rr)? (rr): (xx))
 
#define SWAP(aa, bb, tt)   ( tt = aa, aa = bb, bb = tt )
 
#define MAX(aa, bb)   ((aa)>=(bb)?(aa):(bb))
 
#define MIN(aa, bb)   ((aa)<=(bb)?(aa):(bb))
 
#define ABS(aa)   ((aa)>0?(aa):-(aa))
 
#define SQR(aa)   ((aa)*(aa))
 
#define SIGN(aa)   ((aa)>=0? 1: -1)
 
#define OK   0
 
#define ERR   -1
 
#define FALSE   0
 
#define TRUE   1
 
#define ON   1
 
#define OFF   0
 
#define __U32__
 
#define FN   __FUNCTION__
 
#define PROCLOGNAME   "acq200control"
 
#define ACQ200_SYSLOG_SCREEN   1
 
#define ACQ200_SYSLOG_SYSLOG   2
 
#define ACQ200_SYSLOG_MODE   (ACQ200_SYSLOG_SCREEN|ACQ200_SYSLOG_SYSLOG)
 
#define _ACQ200_SYSLOG_SCREEN(pri, fmt, args...)   fprintf(stderr, fmt, ##args)
 
#define _ACQ200_SYSLOG_SYSLOG(pri, fmt, args...)
 
#define ACQ200_SYSLOG(pri, fmt, args...)
 
#define info(format, arg...)   ACQ200_SYSLOG(LOG_INFO, "%s " format "\n", FN, ## arg )
 
#define err(format, arg...)   ACQ200_SYSLOG(LOG_ERR, "%s ERROR:" format "\n", FN, ## arg )
 
#define dbg(lvl, format, arg...)
 
#define dbgnl(lvl, format, arg...)
 

Typedefs

typedef unsigned u32
 
typedef unsigned short u16
 
typedef unsigned char u8
 

Variables

int acq200_debug
 

Macro Definition Documentation

◆ __U32__

#define __U32__

Definition at line 60 of file local.h.

◆ _ACQ200_SYSLOG_SCREEN

#define _ACQ200_SYSLOG_SCREEN (   pri,
  fmt,
  args... 
)    fprintf(stderr, fmt, ##args)

Definition at line 95 of file local.h.

◆ _ACQ200_SYSLOG_SYSLOG

#define _ACQ200_SYSLOG_SYSLOG (   pri,
  fmt,
  args... 
)
Value:
do { \
openlog(PROCLOGNAME, 0, LOG_USER); \
syslog(pri, fmt, ## args); \
closelog(); \
} while (0)

Definition at line 101 of file local.h.

◆ ABS

#define ABS (   aa)    ((aa)>0?(aa):-(aa))

Definition at line 31 of file local.h.

◆ ACQ200_SYSLOG

#define ACQ200_SYSLOG (   pri,
  fmt,
  args... 
)
Value:
do { \
_ACQ200_SYSLOG_SCREEN(pri, fmt, ## args); \
_ACQ200_SYSLOG_SYSLOG(pri, fmt, ## args); \
}while(0)

Definition at line 112 of file local.h.

◆ ACQ200_SYSLOG_MODE

#define ACQ200_SYSLOG_MODE   (ACQ200_SYSLOG_SCREEN|ACQ200_SYSLOG_SYSLOG)

Definition at line 91 of file local.h.

◆ ACQ200_SYSLOG_SCREEN

#define ACQ200_SYSLOG_SCREEN   1

Definition at line 87 of file local.h.

◆ ACQ200_SYSLOG_SYSLOG

#define ACQ200_SYSLOG_SYSLOG   2

Definition at line 88 of file local.h.

◆ CLAMP

#define CLAMP (   xx,
  ll,
  rr 
)    ((xx) = (xx)<(ll)? (ll): (xx)>(rr)? (rr): (xx))

Definition at line 24 of file local.h.

◆ dbg

#define dbg (   lvl,
  format,
  arg... 
)
Value:
do { \
if(acq200_debug>=lvl ){ \
if (lvl <= 1){ \
ACQ200_SYSLOG( LOG_DEBUG, \
"%s " format "\n", \
FN, ## arg ); \
}else{ \
fprintf(stderr, \
"deb(%d) %s " format "\n", \
lvl, FN, ## arg ); \
} \
} \
} while(0)

Definition at line 125 of file local.h.

◆ dbgnl

#define dbgnl (   lvl,
  format,
  arg... 
)
Value:
do { \
if(acq200_debug>=lvl ){ \
if (lvl <= 1) \
ACQ200_SYSLOG( LOG_DEBUG, "%s " format, \
FN, ## arg ); \
fprintf(stderr, \
"deb(%d) %s " format, \
lvl, FN, ## arg ); \
} \
} while(0)

Definition at line 162 of file local.h.

◆ ERR

#define ERR   -1

Definition at line 44 of file local.h.

◆ err

#define err (   format,
  arg... 
)    ACQ200_SYSLOG(LOG_ERR, "%s ERROR:" format "\n", FN, ## arg )

Definition at line 122 of file local.h.

◆ FALSE

#define FALSE   0

Definition at line 47 of file local.h.

◆ FN

#define FN   __FUNCTION__

Definition at line 77 of file local.h.

◆ IN_RANGE

#define IN_RANGE (   xx,
  ll,
  rr 
)    ((xx)>=(ll)&&(xx)<=(rr))

Definition at line 23 of file local.h.

◆ info

#define info (   format,
  arg... 
)    ACQ200_SYSLOG(LOG_INFO, "%s " format "\n", FN, ## arg )

Definition at line 119 of file local.h.

◆ MAX

#define MAX (   aa,
  bb 
)    ((aa)>=(bb)?(aa):(bb))

Definition at line 27 of file local.h.

◆ MIN

#define MIN (   aa,
  bb 
)    ((aa)<=(bb)?(aa):(bb))

Definition at line 28 of file local.h.

◆ OFF

#define OFF   0

Definition at line 56 of file local.h.

◆ OK

#define OK   0

Definition at line 41 of file local.h.

◆ ON

#define ON   1

Definition at line 53 of file local.h.

◆ PROCLOGNAME

#define PROCLOGNAME   "acq200control"

Definition at line 84 of file local.h.

◆ SIGN

#define SIGN (   aa)    ((aa)>=0? 1: -1)

Definition at line 33 of file local.h.

◆ SQR

#define SQR (   aa)    ((aa)*(aa))

Definition at line 32 of file local.h.

◆ STREQ

#define STREQ (   s1,
  s2 
)    (strcmp( s1, s2 ) == 0)

Definition at line 15 of file local.h.

◆ STREQN

#define STREQN (   s1,
  s2,
 
)    (strncmp( s1, s2, n ) == 0)

Definition at line 16 of file local.h.

◆ STREQNL

#define STREQNL (   s1,
  s2 
)    (strncmp( s1, s2, strlen(s2) ) == 0)

Definition at line 17 of file local.h.

◆ SWAP

#define SWAP (   aa,
  bb,
  tt 
)    ( tt = aa, aa = bb, bb = tt )

Definition at line 25 of file local.h.

◆ TRUE

#define TRUE   1

Definition at line 50 of file local.h.

Typedef Documentation

◆ u16

typedef unsigned short u16

Definition at line 61 of file local.h.

◆ u32

typedef unsigned u32

Definition at line 60 of file local.h.

◆ u8

typedef unsigned char u8

Definition at line 62 of file local.h.

Variable Documentation

◆ acq200_debug

int acq200_debug

Definition at line 76 of file mmap.c.

FN
#define FN
Definition: local.h:76
acq200_debug
int acq200_debug
Definition: mmap.c:76
PROCLOGNAME
#define PROCLOGNAME
Definition: local.h:83