open62541 1.3.14
Open source implementation of OPC UA
Loading...
Searching...
No Matches
ua_util_internal.h File Reference

Go to the source code of this file.

Data Structures

union  UA_Request
 
union  UA_Response
 

Macros

#define UA_INTERNAL
 
#define UA_MACRO_EXPAND(x)   x
 
#define UA_LOG_NODEID_INTERNAL(NODEID, LOG)
 
#define UA_LOG_NODEID_TRACE(NODEID, LOG)    UA_LOG_NODEID_INTERNAL(NODEID, LOG)
 
#define UA_LOG_NODEID_DEBUG(NODEID, LOG)    UA_LOG_NODEID_INTERNAL(NODEID, LOG)
 
#define UA_LOG_NODEID_INFO(NODEID, LOG)    UA_LOG_NODEID_INTERNAL(NODEID, LOG)
 
#define UA_LOG_NODEID_WARNING(NODEID, LOG)    UA_LOG_NODEID_INTERNAL(NODEID, LOG)
 
#define UA_LOG_NODEID_ERROR(NODEID, LOG)    UA_LOG_NODEID_INTERNAL(NODEID, LOG)
 
#define UA_LOG_NODEID_FATAL(NODEID, LOG)    UA_LOG_NODEID_INTERNAL(NODEID, LOG)
 
#define UA_CHECK(A, EVAL_ON_ERROR)
 
#define UA_CHECK_STATUS(STATUSCODE, EVAL_ON_ERROR)    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
 
#define UA_CHECK_MEM(STATUSCODE, EVAL_ON_ERROR)    UA_CHECK(isNonNull(STATUSCODE), EVAL_ON_ERROR)
 
#define UA_CHECK_LOG_INTERNAL(A, STATUSCODE, EVAL, LOG, LOGGER, CAT, MSG, ...)
 
#define UA_CHECK_LOG(A, EVAL, LEVEL, LOGGER, CAT, ...)
 
#define UA_CHECK_STATUS_LOG(STATUSCODE, EVAL, LEVEL, LOGGER, CAT, ...)
 
#define UA_CHECK_MEM_LOG(PTR, EVAL, LEVEL, LOGGER, CAT, ...)
 
#define UA_CHECK_FATAL(A, EVAL, LOGGER, CAT, ...)    UA_MACRO_EXPAND(UA_CHECK_LOG(A, EVAL, FATAL, LOGGER, CAT, __VA_ARGS__))
 
#define UA_CHECK_ERROR(A, EVAL, LOGGER, CAT, ...)    UA_MACRO_EXPAND(UA_CHECK_LOG(A, EVAL, ERROR, LOGGER, CAT, __VA_ARGS__))
 
#define UA_CHECK_WARN(A, EVAL, LOGGER, CAT, ...)    UA_MACRO_EXPAND(UA_CHECK_LOG(A, EVAL, WARNING, LOGGER, CAT, __VA_ARGS__))
 
#define UA_CHECK_INFO(A, EVAL, LOGGER, CAT, ...)    UA_MACRO_EXPAND(UA_CHECK_LOG(A, EVAL, INFO, LOGGER, CAT, __VA_ARGS__))
 
#define UA_CHECK_STATUS_FATAL(STATUSCODE, EVAL, LOGGER, CAT, ...)
 
#define UA_CHECK_STATUS_ERROR(STATUSCODE, EVAL, LOGGER, CAT, ...)
 
#define UA_CHECK_STATUS_WARN(STATUSCODE, EVAL, LOGGER, CAT, ...)
 
#define UA_CHECK_STATUS_INFO(STATUSCODE, EVAL, LOGGER, CAT, ...)
 
#define UA_CHECK_MEM_FATAL(PTR, EVAL, LOGGER, CAT, ...)
 
#define UA_CHECK_MEM_ERROR(PTR, EVAL, LOGGER, CAT, ...)
 
#define UA_CHECK_MEM_WARN(PTR, EVAL, LOGGER, CAT, ...)
 
#define UA_CHECK_MEM_INFO(PTR, EVAL, LOGGER, CAT, ...)
 
#define UA_ENCODING_HELPERS(TYPE, UPCASE_TYPE)
 

Typedefs

typedef UA_Byte u8
 
typedef UA_SByte i8
 
typedef UA_UInt16 u16
 
typedef UA_Int16 i16
 
typedef UA_UInt32 u32
 
typedef UA_Int32 i32
 
typedef UA_UInt64 u64
 
typedef UA_Int64 i64
 
typedef UA_StatusCode status
 

Functions

const UA_DataTypeUA_findDataTypeWithCustom (const UA_NodeId *typeId, const UA_DataTypeArray *customTypes)
 
size_t getCountOfOptionalFields (const UA_DataType *type)
 
UA_Boolean UA_String_equal_ignorecase (const UA_String *s1, const UA_String *s2)
 

Macro Definition Documentation

◆ UA_INTERNAL

#define UA_INTERNAL

This Source Code Form is subject to the terms of the Mozilla Public License, v.

2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) Copyright 2014, 2017 (c) Florian Palm Copyright 2015 (c) LEvertz Copyright 2015-2016 (c) Sten GrĂ¼ner Copyright 2015 (c) Chris Iatrou Copyright 2015-2016 (c) Oleksiy Vasylyev Copyright 2017 (c) Stefan Profanter, fortiss GmbH Copyright 2021 (c) Fraunhofer IOSB (Author: Jan Hermes)

Definition at line 18 of file ua_util_internal.h.

◆ UA_MACRO_EXPAND

#define UA_MACRO_EXPAND ( x)    x

Macro-Expand for MSVC workarounds.

Definition at line 28 of file ua_util_internal.h.

◆ UA_LOG_NODEID_INTERNAL

#define UA_LOG_NODEID_INTERNAL ( NODEID,
LOG )
Value:
do { \
UA_String nodeIdStr = UA_STRING_NULL; \
UA_NodeId_print(NODEID, &nodeIdStr); \
LOG; \
UA_String_clear(&nodeIdStr); \
} while(0)
UA_EXPORT const UA_String UA_STRING_NULL

Print a NodeId in logs.

Definition at line 31 of file ua_util_internal.h.

◆ UA_LOG_NODEID_TRACE

#define UA_LOG_NODEID_TRACE ( NODEID,
LOG )    UA_LOG_NODEID_INTERNAL(NODEID, LOG)

Definition at line 40 of file ua_util_internal.h.

◆ UA_LOG_NODEID_DEBUG

#define UA_LOG_NODEID_DEBUG ( NODEID,
LOG )    UA_LOG_NODEID_INTERNAL(NODEID, LOG)

Definition at line 47 of file ua_util_internal.h.

◆ UA_LOG_NODEID_INFO

#define UA_LOG_NODEID_INFO ( NODEID,
LOG )    UA_LOG_NODEID_INTERNAL(NODEID, LOG)

Definition at line 54 of file ua_util_internal.h.

◆ UA_LOG_NODEID_WARNING

#define UA_LOG_NODEID_WARNING ( NODEID,
LOG )    UA_LOG_NODEID_INTERNAL(NODEID, LOG)

Definition at line 61 of file ua_util_internal.h.

◆ UA_LOG_NODEID_ERROR

#define UA_LOG_NODEID_ERROR ( NODEID,
LOG )    UA_LOG_NODEID_INTERNAL(NODEID, LOG)

Definition at line 68 of file ua_util_internal.h.

◆ UA_LOG_NODEID_FATAL

#define UA_LOG_NODEID_FATAL ( NODEID,
LOG )    UA_LOG_NODEID_INTERNAL(NODEID, LOG)

Definition at line 75 of file ua_util_internal.h.

◆ UA_CHECK

#define UA_CHECK ( A,
EVAL_ON_ERROR )
Value:
do { \
if(UA_UNLIKELY(!isTrue(A))) { \
EVAL_ON_ERROR; \
} \
} while(0)
#define UA_UNLIKELY(x)

Definition at line 110 of file ua_util_internal.h.

◆ UA_CHECK_STATUS

#define UA_CHECK_STATUS ( STATUSCODE,
EVAL_ON_ERROR )    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)

Definition at line 117 of file ua_util_internal.h.

◆ UA_CHECK_MEM

#define UA_CHECK_MEM ( STATUSCODE,
EVAL_ON_ERROR )    UA_CHECK(isNonNull(STATUSCODE), EVAL_ON_ERROR)

Definition at line 120 of file ua_util_internal.h.

◆ UA_CHECK_LOG_INTERNAL

#define UA_CHECK_LOG_INTERNAL ( A,
STATUSCODE,
EVAL,
LOG,
LOGGER,
CAT,
MSG,
... )
Value:
UA_CHECK(A, LOG(LOGGER, CAT, "" MSG "%s (statuscode: %s)", __VA_ARGS__, \
UA_StatusCode_name(STATUSCODE)); \
EVAL))
UA_EXPORT const char * UA_StatusCode_name(UA_StatusCode code)
Returns the human-readable name of the StatusCode.
#define UA_MACRO_EXPAND(x)
Macro-Expand for MSVC workarounds.
#define UA_CHECK(A, EVAL_ON_ERROR)

Definition at line 130 of file ua_util_internal.h.

◆ UA_CHECK_LOG

#define UA_CHECK_LOG ( A,
EVAL,
LEVEL,
LOGGER,
CAT,
... )
Value:
LOGGER, CAT, __VA_ARGS__, ""))
#define UA_STATUSCODE_BAD
"The operation failed."
Definition statuscodes.h:16
#define UA_CHECK_LOG_INTERNAL(A, STATUSCODE, EVAL, LOG, LOGGER, CAT, MSG,...)

Definition at line 137 of file ua_util_internal.h.

◆ UA_CHECK_STATUS_LOG

#define UA_CHECK_STATUS_LOG ( STATUSCODE,
EVAL,
LEVEL,
LOGGER,
CAT,
... )
Value:
UA_MACRO_EXPAND(UA_CHECK_LOG_INTERNAL(isGood(STATUSCODE), STATUSCODE, \
EVAL, UA_LOG_##LEVEL, LOGGER, CAT, \
__VA_ARGS__, ""))

Definition at line 141 of file ua_util_internal.h.

◆ UA_CHECK_MEM_LOG

#define UA_CHECK_MEM_LOG ( PTR,
EVAL,
LEVEL,
LOGGER,
CAT,
... )
Value:
EVAL, UA_LOG_##LEVEL, LOGGER, CAT, \
__VA_ARGS__, ""))
#define UA_STATUSCODE_BADOUTOFMEMORY
"Not enough memory to complete the operation."
Definition statuscodes.h:25

Definition at line 146 of file ua_util_internal.h.

◆ UA_CHECK_FATAL

#define UA_CHECK_FATAL ( A,
EVAL,
LOGGER,
CAT,
... )    UA_MACRO_EXPAND(UA_CHECK_LOG(A, EVAL, FATAL, LOGGER, CAT, __VA_ARGS__))

Definition at line 152 of file ua_util_internal.h.

◆ UA_CHECK_ERROR

#define UA_CHECK_ERROR ( A,
EVAL,
LOGGER,
CAT,
... )    UA_MACRO_EXPAND(UA_CHECK_LOG(A, EVAL, ERROR, LOGGER, CAT, __VA_ARGS__))

Definition at line 154 of file ua_util_internal.h.

◆ UA_CHECK_WARN

#define UA_CHECK_WARN ( A,
EVAL,
LOGGER,
CAT,
... )    UA_MACRO_EXPAND(UA_CHECK_LOG(A, EVAL, WARNING, LOGGER, CAT, __VA_ARGS__))

Definition at line 156 of file ua_util_internal.h.

◆ UA_CHECK_INFO

#define UA_CHECK_INFO ( A,
EVAL,
LOGGER,
CAT,
... )    UA_MACRO_EXPAND(UA_CHECK_LOG(A, EVAL, INFO, LOGGER, CAT, __VA_ARGS__))

Definition at line 158 of file ua_util_internal.h.

◆ UA_CHECK_STATUS_FATAL

#define UA_CHECK_STATUS_FATAL ( STATUSCODE,
EVAL,
LOGGER,
CAT,
... )
Value:
UA_CHECK_STATUS_LOG(STATUSCODE, EVAL, FATAL, LOGGER, CAT, __VA_ARGS__))
#define UA_CHECK_STATUS_LOG(STATUSCODE, EVAL, LEVEL, LOGGER, CAT,...)

Definition at line 161 of file ua_util_internal.h.

◆ UA_CHECK_STATUS_ERROR

#define UA_CHECK_STATUS_ERROR ( STATUSCODE,
EVAL,
LOGGER,
CAT,
... )
Value:
UA_CHECK_STATUS_LOG(STATUSCODE, EVAL, ERROR, LOGGER, CAT, __VA_ARGS__))

Definition at line 164 of file ua_util_internal.h.

◆ UA_CHECK_STATUS_WARN

#define UA_CHECK_STATUS_WARN ( STATUSCODE,
EVAL,
LOGGER,
CAT,
... )
Value:
UA_CHECK_STATUS_LOG(STATUSCODE, EVAL, WARNING, LOGGER, CAT, __VA_ARGS__))

Definition at line 167 of file ua_util_internal.h.

◆ UA_CHECK_STATUS_INFO

#define UA_CHECK_STATUS_INFO ( STATUSCODE,
EVAL,
LOGGER,
CAT,
... )
Value:
UA_CHECK_STATUS_LOG(STATUSCODE, EVAL, INFO, LOGGER, CAT, __VA_ARGS__))

Definition at line 170 of file ua_util_internal.h.

◆ UA_CHECK_MEM_FATAL

#define UA_CHECK_MEM_FATAL ( PTR,
EVAL,
LOGGER,
CAT,
... )
Value:
UA_CHECK_MEM_LOG(PTR, EVAL, FATAL, LOGGER, CAT, __VA_ARGS__))
#define UA_CHECK_MEM_LOG(PTR, EVAL, LEVEL, LOGGER, CAT,...)

Definition at line 174 of file ua_util_internal.h.

◆ UA_CHECK_MEM_ERROR

#define UA_CHECK_MEM_ERROR ( PTR,
EVAL,
LOGGER,
CAT,
... )
Value:
UA_CHECK_MEM_LOG(PTR, EVAL, ERROR, LOGGER, CAT, __VA_ARGS__))

Definition at line 177 of file ua_util_internal.h.

◆ UA_CHECK_MEM_WARN

#define UA_CHECK_MEM_WARN ( PTR,
EVAL,
LOGGER,
CAT,
... )
Value:
UA_CHECK_MEM_LOG(PTR, EVAL, WARNING, LOGGER, CAT, __VA_ARGS__))

Definition at line 180 of file ua_util_internal.h.

◆ UA_CHECK_MEM_INFO

#define UA_CHECK_MEM_INFO ( PTR,
EVAL,
LOGGER,
CAT,
... )
Value:
UA_CHECK_MEM_LOG(PTR, EVAL, INFO, LOGGER, CAT, __VA_ARGS__))

Definition at line 183 of file ua_util_internal.h.

◆ UA_ENCODING_HELPERS

#define UA_ENCODING_HELPERS ( TYPE,
UPCASE_TYPE )
Value:
static size_t \
UA_##TYPE##_calcSizeBinary(const UA_##TYPE *src) { \
return UA_calcSizeBinary(src, &UA_TYPES[UA_TYPES_##UPCASE_TYPE]); \
} \
static UA_StatusCode \
UA_##TYPE##_encodeBinary(const UA_##TYPE *src, UA_Byte **bufPos, const UA_Byte *bufEnd) { \
return UA_encodeBinaryInternal(src, &UA_TYPES[UA_TYPES_##UPCASE_TYPE], \
bufPos, &bufEnd, NULL, NULL); \
} \
static UA_StatusCode \
UA_##TYPE##_decodeBinary(const UA_ByteString *src, size_t *offset, UA_##TYPE *dst) { \
return UA_decodeBinaryInternal(src, offset, dst, \
&UA_TYPES[UA_TYPES_##UPCASE_TYPE], NULL); \
}
UA_EXPORT size_t UA_calcSizeBinary(const void *p, const UA_DataType *type)
Returns the number of bytes the value p takes in binary encoding.
uint8_t UA_Byte
Definition types.h:36
const UA_DataType UA_TYPES[191]
UA_StatusCode UA_encodeBinaryInternal(const void *src, const UA_DataType *type, UA_Byte **bufPos, const UA_Byte **bufEnd, UA_exchangeEncodeBuffer exchangeCallback, void *exchangeHandle)
Encodes the scalar value described by type in the binary encoding.
UA_StatusCode UA_decodeBinaryInternal(const UA_ByteString *src, size_t *offset, void *dst, const UA_DataType *type, const UA_DataTypeArray *customTypes)
Decodes a scalar value described by type from binary encoding.

Encoding Helpers.

Definition at line 307 of file ua_util_internal.h.

Typedef Documentation

◆ u8

typedef UA_Byte u8

Short names for integer.

These are not exposed on the public API, since many user-applications make the same definitions in their headers.

Definition at line 83 of file ua_util_internal.h.

◆ i8

typedef UA_SByte i8

Definition at line 84 of file ua_util_internal.h.

◆ u16

typedef UA_UInt16 u16

Definition at line 85 of file ua_util_internal.h.

◆ i16

typedef UA_Int16 i16

Definition at line 86 of file ua_util_internal.h.

◆ u32

typedef UA_UInt32 u32

Definition at line 87 of file ua_util_internal.h.

◆ i32

typedef UA_Int32 i32

Definition at line 88 of file ua_util_internal.h.

◆ u64

typedef UA_UInt64 u64

Definition at line 89 of file ua_util_internal.h.

◆ i64

typedef UA_Int64 i64

Definition at line 90 of file ua_util_internal.h.

◆ status

Definition at line 91 of file ua_util_internal.h.

Function Documentation

◆ UA_findDataTypeWithCustom()

const UA_DataType * UA_findDataTypeWithCustom ( const UA_NodeId * typeId,
const UA_DataTypeArray * customTypes )

◆ getCountOfOptionalFields()

size_t getCountOfOptionalFields ( const UA_DataType * type)

Get the number of optional fields contained in an structure type.

◆ UA_String_equal_ignorecase()

UA_Boolean UA_String_equal_ignorecase ( const UA_String * s1,
const UA_String * s2 )

Do not expose UA_String_equal_ignorecase to public API as it currently only handles ASCII strings, and not UTF8!