49 #ifndef _TRAP_INTERNAL_H 50 #define _TRAP_INTERNAL_H 54 #include "../include/libtrap/trap.h" 57 #define MAX_ERROR_MSG_BUFF_SIZE 1024 62 #define DEFAULT_MAX_TERMINAL_WIDTH 85 65 #define SERVICE_GET_COM 10 66 #define SERVICE_SET_COM 11
67 #define SERVICE_OK_REPLY 12
74 #define NEG_RES_CONT 111 75 #define NEG_RES_RECEIVER_FMT_SUBSET 112
76 #define NEG_RES_SENDER_FMT_SUBSET 116
77 #define NEG_RES_FMT_MISMATCH 113
78 #define NEG_RES_FMT_CHANGED 117
81 #define NEG_RES_OK 116 84 #define NEG_RES_FAILED 114 85 #define NEG_RES_FMT_UNKNOWN 115
128 #define TRAP_NO_IFC_SLEEP 4 129 #define TRAP_IFC_TIMEOUT 2000000
142 # define MSG(level,format,args...) if (trap_debug >= level) {snprintf(trap_err_msg, 4095, format, ##args); debug_msg(level,trap_err_msg);} 146 # define MSG_NONL(level,format,args...) if (trap_debug >= level) {snprintf(trap_err_msg, 4095, format, ##args); debug_msg_nonl(trap_err_msg);} 148 # define LINE() {fprintf(stderr, "file: %s, line: %i\n", __FILE__, __LINE__); fflush(stderr);} 154 static inline int __attribute__ ((format (printf, 2, 3)))
MSG(
int l, const
char *fmt, ...)
160 # define MSG(level,string,args...) 164 #define INLINE inline 171 #define VERBOSE(level,format,args...) if (trap_verbose>=level) { \ 172 snprintf(trap_err_msg,4095,"%s:%d "format,__FILE__, __LINE__, ##args); \ 173 trap_verbose_msg(level,trap_err_msg); \ 176 #define VERBOSE(level,format,args...) if (trap_verbose>=level) { \ 177 snprintf(trap_err_msg,4095,format, ##args); \ 178 trap_verbose_msg(level,trap_err_msg); \ 183 #define DEBUG_IFC(X) if (TRAP_DEBUG_IFC) { \ 187 #define DEBUG_BUF(X) if (TRAP_DEBUG_BUFFERING) { \ 350 #define TRAP_IN_IFC_COUNTERS 1 354 #define TRAP_OUT_IFC_COUNTERS 3 360 #ifdef ENABLE_HEADER_TIMESTAMP
#define MAX_ERROR_MSG_BUFF_SIZE
uint64_t __sync_and_and_fetch_8(uint64_t *ptr, uint64_t value)
uint64_t __sync_fetch_and_add_8(uint64_t *ptr, uint64_t value)
char error_msg_buffer[MAX_ERROR_MSG_BUFF_SIZE]
struct autoflush_timeouts ifc_autoflush_t
List of autoflush timeouts of output interfaces.
ifc_autoflush_t * ifc_autoflush_timeout
uint64_t * counter_dropped_message
trap_ctx_priv_t * trap_create_ctx_t()
int service_thread_initialized
uint64_t * counter_recv_message
_Bool __sync_bool_compare_and_swap_8(int64_t *ptr, int64_t oldvar, int64_t newval)
pthread_mutex_t error_mtx
trap_ctx_priv_t * trap_glob_ctx
const char * trap_last_error_msg
uint64_t * recv_delay_timestamp
uint64_t * counter_recv_delay_total
struct trap_buffer_header_s __attribute__((__packed__))
trap_verbose_level
VERBOSE/MSG levels.
struct hello_msg_header_s hello_msg_header_t
uint64_t * counter_recv_buffer
uint64_t * counter_recv_delay_last
List of autoflush timeouts of output interfaces.
uint64_t * counter_autoflush
uint64_t __sync_or_and_fetch_8(uint64_t *ptr, uint64_t value)
uint64_t * counter_send_buffer
enum trap_verbose_level trap_verbose_level_t
VERBOSE/MSG levels.
trap_output_ifc_t * out_ifc_list
Interface of TRAP interfaces.
uint64_t * counter_send_message
#define MSG(level, format, args...)
Debug message macro if DEBUG macro is defined.
void trap_verbose_msg(int level, char *string)
send verbose message to stderr
uint64_t __sync_add_and_fetch_8(uint64_t *ptr, uint64_t value)
trap_input_ifc_t * in_ifc_list