C API for BALTECH SDK
common.h
Go to the documentation of this file.
1 
12 #ifndef __COMMONDEFS_H__
13 #define __COMMONDEFS_H__
14 
15 
21 #include <stdlib.h>
22 #include <string.h>
23 
24 // boolean definitions
25 #if (__STDC_VERSION__ >= 199901L)
26  #include <stdbool.h>
27 #else
28  #define false 0
29  #define true 1
30  #define bool unsigned char
31 #endif
32 #if ! defined(BRP_LIB)
33  #if defined(_MSC_VER)
34  #if defined(brp_lib_EXPORTS)
35  #define BRP_LIB __declspec(dllexport)
36  #else
37  #define BRP_LIB __declspec(dllimport)
38  #endif
39  #else
40  #define BRP_LIB
41  #endif
42 #endif
43 
44 
45 #if ! defined(min)
46  #define min(a,b) (((a)<(b))?(a):(b))
47 #endif
48 #if ! defined(max)
49  #define max(a,b) (((a)>(b))?(a):(b))
50 #endif
51 
52 
61 typedef unsigned char * brp_buf;
62 
63 
67 typedef unsigned long brp_time;
68 
69 
73 #define BRP_INFINITE 0xFFFFFFFF
74 
75 
76 #define BRP_TIME_SUBTRACT(time, delta) { \
77  if ((time) != BRP_INFINITE) { \
78  if ((time) < delta) (time) = 0; \
79  else (time) -= (delta); } }
80 
81 
82 #endif
83  // end of defgroup brp_lib
unsigned long brp_time
absolute/relative timeout/delay in ms.
Definition: common.h:67
unsigned char * brp_buf
represents a pointer to a protocol data buffer.
Definition: common.h:61