9#ifndef UCS_TYPES_STATUS_H_
10#define UCS_TYPES_STATUS_H_
12#include <ucs/sys/compiler_def.h>
89#define UCS_IS_LINK_ERROR(_code) \
90 (((_code) <= UCS_ERR_FIRST_LINK_FAILURE) && \
91 ((_code) >= UCS_ERR_LAST_LINK_FAILURE))
93#define UCS_IS_ENDPOINT_ERROR(_code) \
94 (((_code) <= UCS_ERR_FIRST_ENDPOINT_FAILURE) && \
95 ((_code) >= UCS_ERR_LAST_ENDPOINT_FAILURE))
108#define UCS_PTR_IS_ERR(_ptr) (((uintptr_t)(_ptr)) >= ((uintptr_t)UCS_ERR_LAST))
109#define UCS_PTR_IS_PTR(_ptr) (((uintptr_t)(_ptr) - 1) < ((uintptr_t)UCS_ERR_LAST - 1))
110#define UCS_PTR_RAW_STATUS(_ptr) ((ucs_status_t)(intptr_t)(_ptr))
111#define UCS_PTR_STATUS(_ptr) (UCS_PTR_IS_PTR(_ptr) ? UCS_INPROGRESS : UCS_PTR_RAW_STATUS(_ptr))
112#define UCS_STATUS_PTR(_status) ((void*)(intptr_t)(_status))
113#define UCS_STATUS_IS_ERR(_status) ((_status) < 0)
ucs_status_t
Status codes.
Definition status.h:45
void * ucs_status_ptr_t
Status pointer.
Definition status.h:106
@ UCS_ERR_NOT_CONNECTED
Definition status.h:76
@ UCS_OK
Definition status.h:47
@ UCS_ERR_NO_MESSAGE
Definition status.h:53
@ UCS_ERR_FIRST_ENDPOINT_FAILURE
Definition status.h:81
@ UCS_ERR_UNSUPPORTED
Definition status.h:74
@ UCS_ERR_TIMED_OUT
Definition status.h:72
@ UCS_ERR_BUFFER_TOO_SMALL
Definition status.h:63
@ UCS_ERR_BUSY
Definition status.h:67
@ UCS_ERR_LAST
Definition status.h:85
@ UCS_ERR_CONNECTION_RESET
Definition status.h:77
@ UCS_ERR_CANCELED
Definition status.h:68
@ UCS_ERR_EXCEEDS_LIMIT
Definition status.h:73
@ UCS_ERR_SHMEM_SEGMENT
Definition status.h:69
@ UCS_ERR_NOT_IMPLEMENTED
Definition status.h:60
@ UCS_INPROGRESS
Definition status.h:50
@ UCS_ERR_OUT_OF_RANGE
Definition status.h:71
@ UCS_ERR_REJECTED
Definition status.h:75
@ UCS_ERR_ALREADY_EXISTS
Definition status.h:70
@ UCS_ERR_FIRST_LINK_FAILURE
Definition status.h:79
@ UCS_ERR_NO_RESOURCE
Definition status.h:54
@ UCS_ERR_NO_MEMORY
Definition status.h:56
@ UCS_ERR_LAST_LINK_FAILURE
Definition status.h:80
@ UCS_ERR_NO_PROGRESS
Definition status.h:62
@ UCS_ERR_LAST_ENDPOINT_FAILURE
Definition status.h:83
@ UCS_ERR_SOME_CONNECTS_FAILED
Definition status.h:65
@ UCS_ERR_IO_ERROR
Definition status.h:55
@ UCS_ERR_INVALID_ADDR
Definition status.h:59
@ UCS_ERR_UNREACHABLE
Definition status.h:58
@ UCS_ERR_INVALID_PARAM
Definition status.h:57
@ UCS_ERR_NO_ELEM
Definition status.h:64
@ UCS_ERR_ENDPOINT_TIMEOUT
Definition status.h:82
@ UCS_ERR_MESSAGE_TRUNCATED
Definition status.h:61
@ UCS_ERR_NO_DEVICE
Definition status.h:66