UCX  1.5
Unified Communication X
types.h
1 
7 #ifndef UCS_CONFIG_TYPES_H
8 #define UCS_CONFIG_TYPES_H
9 
10 
11 #include <ucs/sys/compiler_def.h>
12 #include <sys/socket.h>
13 
17 typedef enum {
18  UCS_LOG_LEVEL_FATAL, /* Immediate termination */
19  UCS_LOG_LEVEL_ERROR, /* Error is returned to the user */
20  UCS_LOG_LEVEL_WARN, /* Something's wrong, but we continue */
21  UCS_LOG_LEVEL_INFO, /* Information */
22  UCS_LOG_LEVEL_DEBUG, /* Low-volume debugging */
23  UCS_LOG_LEVEL_TRACE, /* High-volume debugging */
24  UCS_LOG_LEVEL_TRACE_REQ, /* Every send/receive request */
25  UCS_LOG_LEVEL_TRACE_DATA, /* Data sent/received on the transport */
26  UCS_LOG_LEVEL_TRACE_ASYNC, /* Asynchronous progress engine */
27  UCS_LOG_LEVEL_TRACE_FUNC, /* Function calls */
28  UCS_LOG_LEVEL_TRACE_POLL, /* Polling functions */
29  UCS_LOG_LEVEL_LAST,
30  UCS_LOG_LEVEL_PRINT /* Temporary output */
31 } ucs_log_level_t;
32 
33 
37 typedef enum {
38  UCS_ASYNC_MODE_SIGNAL,
39  UCS_ASYNC_MODE_THREAD,
40  UCS_ASYNC_MODE_POLL, /* TODO keep only in debug version */
41  UCS_ASYNC_MODE_LAST
42 } ucs_async_mode_t;
43 
44 
45 extern const char *ucs_async_mode_names[];
46 
47 
51 typedef enum ucs_ternary_value {
52  UCS_NO = 0,
53  UCS_YES = 1,
54  UCS_TRY = 2,
55  UCS_TERNARY_LAST
56 } ucs_ternary_value_t;
57 
58 
62 typedef enum {
63  UCS_HANDLE_ERROR_BACKTRACE, /* Print backtrace */
64  UCS_HANDLE_ERROR_FREEZE, /* Freeze and wait for a debugger */
65  UCS_HANDLE_ERROR_DEBUG, /* Attach debugger */
66  UCS_HANDLE_ERROR_LAST
67 } ucs_handle_error_t;
68 
69 
73 typedef enum {
74  UCS_CONFIG_PRINT_CONFIG = UCS_BIT(0),
75  UCS_CONFIG_PRINT_HEADER = UCS_BIT(1),
76  UCS_CONFIG_PRINT_DOC = UCS_BIT(2),
77  UCS_CONFIG_PRINT_HIDDEN = UCS_BIT(3)
78 } ucs_config_print_flags_t;
79 
80 
81 #define UCS_CONFIG_MEMUNITS_INF SIZE_MAX
82 #define UCS_CONFIG_MEMUNITS_AUTO (SIZE_MAX - 1)
83 
84 #define UCS_CONFIG_ULUNITS_AUTO (SIZE_MAX - 1)
85 
86 
91 #define UCS_CONFIG_ARRAY_FIELD(_type, _array_name) \
92  struct { \
93  _type *_array_name; \
94  unsigned count; \
95  unsigned pad; \
96  }
97 
98 
99 /* Specific structure for an array of strings */
100 #define UCS_CONFIG_STRING_ARRAY_FIELD(_array_name) \
101  UCS_CONFIG_ARRAY_FIELD(char*, _array_name)
102 
103 
104 typedef UCS_CONFIG_STRING_ARRAY_FIELD(names) ucs_config_names_array_t;
105 
110 typedef struct ucs_sock_addr {
111  const struct sockaddr *addr;
112  socklen_t addrlen;
114 
115 #endif /* TYPES_H_ */
struct ucs_sock_addr ucs_sock_addr_t
const struct sockaddr * addr
Definition: types.h:111
socklen_t addrlen
Definition: types.h:112
Definition: types.h:110