ua_util.c 646 B

1234567891011121314151617181920212223242526272829
  1. #include "ua_util.h"
  2. #define __USE_POSIX
  3. #include <stdlib.h> // malloc, free
  4. #include <string.h> // memcpy
  5. /* the extern inline in a *.c-file is required for other compilation units to
  6. see the inline function. */
  7. void UA_free(void *ptr) {
  8. free(ptr); // checks if ptr != UA_NULL in the background
  9. }
  10. void * UA_malloc(UA_UInt32 size) {
  11. return malloc(size);
  12. }
  13. void * UA_realloc(void *ptr, UA_UInt32 size) {
  14. return realloc(ptr, size);
  15. }
  16. void UA_memcpy(void *dst, void const *src, UA_UInt32 size) {
  17. memcpy(dst, src, size);
  18. }
  19. void * UA_memset(void *ptr, UA_Int32 value, UA_UInt32 size) {
  20. return memset(ptr, value, size);
  21. }