ua_util_internal.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  4. *
  5. * Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer)
  6. * Copyright 2014, 2017 (c) Florian Palm
  7. * Copyright 2015 (c) LEvertz
  8. * Copyright 2015-2016 (c) Sten Grüner
  9. * Copyright 2015 (c) Chris Iatrou
  10. * Copyright 2015-2016 (c) Oleksiy Vasylyev
  11. * Copyright 2017 (c) Stefan Profanter, fortiss GmbH
  12. */
  13. #ifndef UA_UTIL_H_
  14. #define UA_UTIL_H_
  15. #define UA_INTERNAL
  16. #include <open62541/types.h>
  17. #include <open62541/util.h>
  18. _UA_BEGIN_DECLS
  19. /* Macro-Expand for MSVC workarounds */
  20. #define UA_MACRO_EXPAND(x) x
  21. /* Print a NodeId in logs */
  22. #define UA_LOG_NODEID_WRAP(NODEID, LOG) { \
  23. UA_String nodeIdStr = UA_STRING_NULL; \
  24. UA_NodeId_toString(NODEID, &nodeIdStr); \
  25. LOG; \
  26. UA_String_clear(&nodeIdStr); \
  27. }
  28. /* Integer Shortnames
  29. * ------------------
  30. * These are not exposed on the public API, since many user-applications make
  31. * the same definitions in their headers. */
  32. typedef UA_Byte u8;
  33. typedef UA_SByte i8;
  34. typedef UA_UInt16 u16;
  35. typedef UA_Int16 i16;
  36. typedef UA_UInt32 u32;
  37. typedef UA_Int32 i32;
  38. typedef UA_UInt64 u64;
  39. typedef UA_Int64 i64;
  40. typedef UA_StatusCode status;
  41. /* Utility Functions
  42. * ----------------- */
  43. #ifdef UA_DEBUG_DUMP_PKGS
  44. void UA_EXPORT UA_dump_hex_pkg(UA_Byte* buffer, size_t bufferLen);
  45. #endif
  46. _UA_END_DECLS
  47. #endif /* UA_UTIL_H_ */