XROAD
xroad_common_types.h File Reference
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
Include dependency graph for xroad_common_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  xroad_tsc_t
 
union  xroad_context_t
 Union of values for transparently passing to callbacks instead of void* More...
 
struct  xroad_data_buf_t
 Basic data buffer (either with data or for data) More...
 
struct  xroad_data_cbuf_t
 Basic constant data buffer (either with data or for data) More...
 

Macros

#define XROAD_OK   0
 
#define XROAD_FAILED   -1
 
#define XROAD_IS_SUCCEEDED(x)   ((x) >= XROAD_OK)
 
#define XROAD_IS_FAILED(x)   ((x) < XROAD_OK)
 
#define XROAD_ERROR_NOT_FOUND   -2
 
#define XROAD_ERROR_INVALID_ARG   -3
 
#define XROAD_ERROR_TOO_LONG   -4
 
#define XROAD_ERROR_DUPLICATE_VAL   -5
 
#define XROAD_ERROR_NOT_CONNECTED   -6
 
#define XROAD_ERROR_INVALID_OBJECT   -7
 
#define XROAD_ERROR_CHECK_FAILED   -8
 
#define XROAD_ERROR_WRONG_FORMAT   -9
 
#define XROAD_ERROR_ALREADY_EXISTS   -10
 
#define XROAD_ERROR_ALREADY_CONNECTED   -11
 
#define XROAD_ERROR_NO_MORE_RESOURCES   -12
 
#define XROAD_ERROR_NOT_IMPL   -13
 
#define XROAD_ERROR_ALREADY_DONE   -14
 
#define XROAD_ERROR_WRONG_STATE   -15
 
#define XROAD_ERROR_BUSY   -16
 
#define XROAD_ERROR_UNABLE_TO_ROUTE   -17
 
#define XROAD_ERROR_IGNORED   -18
 
#define XROAD_ERROR_WRONG_SYSTEM_ROLE   -19
 
#define XROAD_ERROR_DENIED   -20
 
#define XROAD_ERROR_WRONG_TYPE   -21
 
#define XROAD_ERROR_RATE_LIMIT   -22
 
#define XROAD_EPSILON   0.000000001
 
#define XROAD_SECONDS_IN_DAY   86400L
 
#define XROAD_SECONDS_IN_HOUR   3600L
 
#define XROAD_SECONDS_IN_MINUTE   60L
 
#define XROAD_MICROSECONDS   1000000L
 
#define XROAD_MILLISECONDS   1000L
 
#define XROAD_CACHELINE_SZ   64U
 Size of CPU cacheline.
 
#define XROAD_NONDESTRUCTIVE_OFFSET   128U
 Offset that guarantee no false-sharing (even via pre-fetch)
 
#define xroad_bad_pointer   ((void*)~0ull)
 Error value for functions that return pointers and where NULL is a valid result.
 
#define xroad_ctx_null   ((xroad_context_t){0})
 Macro for creating a zero/null context.
 

Typedefs

typedef int32_t xroad_errno_t
 
typedef int32_t xroad_result_t
 Non-negative integer result or negative error code (like xroad_errno_t)
 
typedef int64_t xroad_timestamp_t
 
typedef uint64_t xroad_object_id_t
 Type for xroad object ID.
 
typedef struct xroad_object_ref_s xroad_object_ref_t
 Object reference type.
 

Enumerations

enum  xroad_bin_types_t {
  xroad_bin_type_none , xroad_bin_type_char , xroad_bin_type_int , xroad_bin_type_uint ,
  xroad_bin_type_tsc , xroad_bin_type_float , xroad_bin_type_str , xroad_bin_type_cstr ,
  xroad_bin_type_bin , xroad_bin_type_date , xroad_bin_type_time , xroad_bin_type_datetime ,
  xroad_bin_type_obj , xroad_bin_type_objref , xroad_bin_type_ts , xroad_bin_type_max
}
 Binary type class identifiers for tracing and logging. More...
 

Detailed Description

Enumeration Type Documentation

◆ xroad_bin_types_t

Binary type class identifiers for tracing and logging.

Enumerator
xroad_bin_type_none 

No type.

xroad_bin_type_char 

Char type.

xroad_bin_type_int 

Signed integet.

xroad_bin_type_uint 

Unsigned integer.

xroad_bin_type_tsc 

Timestamp in TSC.

xroad_bin_type_float 

Floating point types.

xroad_bin_type_str 

String (size, bytes)

xroad_bin_type_cstr 

C-string (zero-terminated)

xroad_bin_type_bin 

Binary data (size, bytes)

xroad_bin_type_date 

xroad_date_t

xroad_bin_type_time 

xroad_time_t

xroad_bin_type_datetime 

xroad_datetime_t

xroad_bin_type_obj 

XROAD object (size, bytes)

xroad_bin_type_objref 

XROAD object reference {type, ID}.

xroad_bin_type_ts 

Timestamp in usec since Epoch.

xroad_bin_type_max 

Internal constant.