datatypes.rst 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. Data Types
  2. ==========
  3. Introduction
  4. ------------
  5. In open62541, all data types share the same basic API for creation, copying and
  6. deletion. The following functions are present for all data types ``T``.
  7. ``void T_init(T *ptr)``
  8. Initialize the data type. This is synonymous with zeroing out the memory, i.e. *memset(dataptr, 0, sizeof(T))*.
  9. ``T* T_new()``
  10. Allocate and return the memory for the data type. The memory is already initialized.
  11. ``UA_StatusCode T_copy(const T *src, T *dst)``
  12. Copy the content of the data type. Returns *UA_STATUSCODE_GOOD* if it succeeded.
  13. ``void T_deleteMembers(T *ptr)``
  14. Delete the dynamically allocated content of the data type, but not the data type itself.
  15. ``void T_delete(T *ptr)``
  16. Delete the content of the data type and the memory for the data type itself.
  17. The builtin data types
  18. ----------------------
  19. OPC UA defines 25 builtin data types. All other data types are combinations of
  20. the 25 builtin data types.
  21. UA_Boolean
  22. ^^^^^^^^^^
  23. A two-state logical value (true or false).
  24. .. code-block:: c
  25. typedef bool UA_Boolean;
  26. #define UA_TRUE true
  27. #define UA_FALSE false
  28. UA_SByte
  29. ^^^^^^^^
  30. An integer value between -128 and 127.
  31. .. code-block:: c
  32. typedef int8_t UA_SByte;
  33. UA_Byte
  34. ^^^^^^^
  35. An integer value between 0 and 256.
  36. .. code-block:: c
  37. typedef uint8_t UA_Byte;
  38. UA_Int16
  39. ^^^^^^^^
  40. An integer value between -32,768 and 32,767.
  41. .. code-block:: c
  42. typedef int16_t UA_Int16;
  43. UA_UInt16
  44. ^^^^^^^^^
  45. An integer value between 0 and 65,535.
  46. .. code-block:: c
  47. typedef uint16_t UA_UInt16;
  48. UA_Int32
  49. ^^^^^^^^
  50. An integer value between -2,147,483,648 and 2,147,483,647.
  51. .. code-block:: c
  52. typedef int32_t UA_Int32;
  53. UA_UInt32
  54. ^^^^^^^^^
  55. An integer value between 0 and 4,294,967,295.
  56. .. code-block:: c
  57. typedef uint32_t UA_UInt32;
  58. UA_Int64
  59. ^^^^^^^^
  60. An integer value between -10,223,372,036,854,775,808 and 9,223,372,036,854,775,807.
  61. .. code-block:: c
  62. typedef int64_t UA_Int64;
  63. UA_UInt64
  64. ^^^^^^^^^
  65. An integer value between 0 and 18,446,744,073,709,551,615.
  66. .. code-block:: c
  67. typedef uint64_t UA_UInt64;
  68. UA_Float
  69. ^^^^^^^^
  70. An IEEE single precision (32 bit) floating point value.
  71. .. code-block:: c
  72. typedef float UA_Float;
  73. UA_Double
  74. ^^^^^^^^^
  75. An IEEE double precision (64 bit) floating point value.
  76. .. code-block:: c
  77. typedef double UA_Double;
  78. UA_DateTime
  79. ^^^^^^^^^^^
  80. An instance in time. A DateTime value is encoded as a 64-bit signed integer
  81. which represents the number of 100 nanosecond intervals since January 1, 1601
  82. (UTC).
  83. .. code-block:: c
  84. typedef UA_Int64 UA_DateTime;
  85. The following functions and definitions are used with UA_DateTime.
  86. .. code-block:: c
  87. UA_DateTime UA_DateTime_now(void);
  88. typedef struct UA_DateTimeStruct {
  89. UA_UInt16 nanoSec;
  90. UA_UInt16 microSec;
  91. UA_UInt16 milliSec;
  92. UA_UInt16 sec;
  93. UA_UInt16 min;
  94. UA_UInt16 hour;
  95. UA_UInt16 day;
  96. UA_UInt16 month;
  97. UA_UInt16 year;
  98. } UA_DateTimeStruct;
  99. UA_DateTimeStruct UA_EXPORT UA_DateTime_toStruct(UA_DateTime time);
  100. UA_String UA_EXPORT UA_DateTime_toString(UA_DateTime time);
  101. UA_Guid
  102. ^^^^^^^
  103. A 16 byte value that can be used as a globally unique identifier.
  104. .. code-block:: c
  105. typedef struct {
  106. UA_UInt32 data1;
  107. UA_UInt16 data2;
  108. UA_UInt16 data3;
  109. UA_Byte data4[8];
  110. } UA_Guid;
  111. The following functions and definitions are used with UA_Guid.
  112. .. code-block:: c
  113. UA_Boolean UA_Guid_equal(const UA_Guid *g1, const UA_Guid *g2);
  114. UA_Guid UA_Guid_random(UA_UInt32 *seed);
  115. UA_String
  116. ^^^^^^^^^
  117. A sequence of Unicode characters. See also the section :ref:`array-handling` for
  118. the usage of arrays in open62541.
  119. .. code-block:: c
  120. typedef struct {
  121. size_t length; // The length of the string
  122. UA_Byte *data; // The string's content (not null-terminated)
  123. } UA_String;
  124. The following functions and definitions are used with UA_String.
  125. .. code-block:: c
  126. extern const UA_String UA_STRING_NULL;
  127. UA_String UA_STRING(char *chars);
  128. #define UA_STRING_ALLOC(CHARS) UA_String_fromChars(CHARS)
  129. /** Copies the content on the heap. Returns a null-string when alloc fails */
  130. UA_String UA_String_fromChars(char const src[]);
  131. UA_Boolean UA_String_equal(const UA_String *s1, const UA_String *s2);
  132. Here's a small example for the usage of UA_String.
  133. .. code-block:: c
  134. /* The definition of UA_String copied from ua_types.h */
  135. typedef struct {
  136. size_t length; ///< The length of the string
  137. UA_Byte *data; ///< The string's content (not null-terminated)
  138. } UA_String;
  139. UA_String s1 = UA_STRING("test1"); /* s1 points to the statically allocated string buffer */
  140. UA_String_init(&s1); /* Reset s1 (no memleak due to the statically allocated buffer) */
  141. UA_String s2 = UA_STRING_ALLOC("test2"); /* s2 points to a new copy of the string buffer (with malloc) */
  142. UA_String_deleteMembers(&s2); /* Free the content of s2, but not s2 itself */
  143. UA_String *s3 = UA_String_new(); /* The string s3 is malloced and initialized */
  144. *s3 = UA_STRING_ALLOC("test3"); /* s3 points to a new copy of the string buffer */
  145. UA_String s4;
  146. UA_copy(s3, &s4); /* Copy the content of s3 to s4 */
  147. UA_String_delete(s3); /* Free the string buffer and the string itself */
  148. UA_String_deleteMembers(&s4); /* Again, delete only the string buffer */
  149. UA_ByteString
  150. ^^^^^^^^^^^^^
  151. A sequence of octets.
  152. .. code-block:: c
  153. typedef UA_String UA_ByteString;
  154. UA_XmlEelement
  155. ^^^^^^^^^^^^^^
  156. An XML element.
  157. .. code-block:: c
  158. typedef UA_String UA_XmlElement;
  159. UA_NodeId
  160. ^^^^^^^^^
  161. An identifier for a node in the address space of an OPC UA Server.
  162. .. code-block:: c
  163. enum UA_NodeIdType {
  164. UA_NODEIDTYPE_NUMERIC = 0, // On the wire, this can be 0, 1 or 2 (shortened numeric nodeids)
  165. UA_NODEIDTYPE_STRING = 3,
  166. UA_NODEIDTYPE_GUID = 4,
  167. UA_NODEIDTYPE_BYTESTRING = 5
  168. };
  169. typedef struct {
  170. UA_UInt16 namespaceIndex;
  171. enum UA_NodeIdType identifierType;
  172. union {
  173. UA_UInt32 numeric;
  174. UA_String string;
  175. UA_Guid guid;
  176. UA_ByteString byteString;
  177. } identifier;
  178. } UA_NodeId;
  179. The following functions and definitions are used with UA_NodeId.
  180. .. code-block:: c
  181. UA_Boolean UA_NodeId_isNull(const UA_NodeId *p);
  182. UA_Boolean UA_NodeId_equal(const UA_NodeId *n1, const UA_NodeId *n2);
  183. extern const UA_NodeId UA_NODEID_NULL;
  184. UA_NodeId UA_NODEID_NUMERIC(UA_UInt16 nsIndex, UA_Int32 identifier);
  185. UA_NodeId UA_NODEID_STRING(UA_UInt16 nsIndex, char *chars) {
  186. UA_NodeId UA_NODEID_STRING_ALLOC(UA_UInt16 nsIndex, const char *chars);
  187. UA_NodeId UA_NODEID_GUID(UA_UInt16 nsIndex, UA_Guid guid);
  188. UA_NodeId UA_NODEID_BYTESTRING(UA_UInt16 nsIndex, char *chars);
  189. UA_NodeId UA_NODEID_BYTESTRING_ALLOC(UA_UInt16 nsIndex, const char *chars);
  190. UA_ExpandedNodeId
  191. ^^^^^^^^^^^^^^^^^
  192. A NodeId that allows the namespace URI to be specified instead of an index.
  193. .. code-block:: c
  194. typedef struct {
  195. UA_NodeId nodeId;
  196. UA_String namespaceUri;
  197. UA_UInt32 serverIndex;
  198. } UA_ExpandedNodeId;
  199. The following functions and definitions are used with UA_ExpandedNodeId.
  200. .. code-block:: c
  201. UA_ExpandedNodeId UA_EXPANDEDNODEID_NUMERIC(UA_UInt16 nsIndex, UA_Int32 identifier);
  202. UA_ExpandedNodeId UA_EXPANDEDNODEID_STRING(UA_UInt16 nsIndex, char *chars);
  203. UA_ExpandedNodeId UA_EXPANDEDNODEID_STRING_ALLOC(UA_UInt16 nsIndex, const char *chars);
  204. UA_ExpandedNodeId UA_EXPANDEDNODEID_STRING_GUID(UA_UInt16 nsIndex, UA_Guid guid);
  205. UA_ExpandedNodeId UA_EXPANDEDNODEID_BYTESTRING(UA_UInt16 nsIndex, char *chars);
  206. UA_ExpandedNodeId UA_EXPANDEDNODEID_BYTESTRING_ALLOC(UA_UInt16 nsIndex, const char *chars);
  207. UA_QualifiedName
  208. ^^^^^^^^^^^^^^^^
  209. A name qualified by a namespace.
  210. .. code-block:: c
  211. typedef struct {
  212. UA_UInt16 namespaceIndex;
  213. UA_String name;
  214. } UA_QualifiedName;
  215. The following functions and definitions are used with UA_QualifiedName.
  216. .. code-block:: c
  217. UA_QualifiedName UA_QUALIFIEDNAME(UA_UInt16 nsIndex, char *chars);
  218. UA_QualifiedName UA_QUALIFIEDNAME_ALLOC(UA_UInt16 nsIndex, const char *chars);
  219. UA_LocalizedText
  220. ^^^^^^^^^^^^^^^^
  221. Human readable text with an optional locale identifier.
  222. .. code-block:: c
  223. typedef struct {
  224. UA_String locale;
  225. UA_String text;
  226. } UA_LocalizedText;
  227. The following functions and definitions are used with UA_LocalizedText.
  228. .. code-block:: c
  229. UA_LocalizedText UA_LOCALIZEDTEXT(char *locale, char *text);
  230. UA_LocalizedText UA_LOCALIZEDTEXT_ALLOC(const char *locale, const char *text);
  231. UA_ExtensionObject
  232. ^^^^^^^^^^^^^^^^^^
  233. A structure that contains an application specific data type that may not be
  234. recognized by the receiver.
  235. .. code-block:: c
  236. typedef struct {
  237. enum {
  238. UA_EXTENSIONOBJECT_ENCODED_NOBODY = 0,
  239. UA_EXTENSIONOBJECT_ENCODED_BYTESTRING = 1,
  240. UA_EXTENSIONOBJECT_ENCODED_XML = 2,
  241. UA_EXTENSIONOBJECT_DECODED = 3, ///< There is a pointer to the decoded data
  242. UA_EXTENSIONOBJECT_DECODED_NODELETE = 4 ///< Don't delete the decoded data at the lifecycle end
  243. } encoding;
  244. union {
  245. struct {
  246. UA_NodeId typeId; ///< The nodeid of the datatype
  247. UA_ByteString body; ///< The bytestring of the encoded data
  248. } encoded;
  249. struct {
  250. const UA_DataType *type;
  251. void *data;
  252. } decoded;
  253. } content;
  254. } UA_ExtensionObject;
  255. UA_Variant
  256. ^^^^^^^^^^
  257. Stores (arrays of) any data type. Please see section :ref:`generic-handling` for
  258. the usage of UA_DataType. The semantics of the arrayLength field is explained in
  259. section :ref:`array-handling`.
  260. .. code-block:: c
  261. typedef struct {
  262. const UA_DataType *type; // The data type description
  263. enum {
  264. UA_VARIANT_DATA, /* The data has the same lifecycle as the variant */
  265. UA_VARIANT_DATA_NODELETE, /* The data is "borrowed" by the variant and shall not be
  266. deleted at the end of the variant's lifecycle. */
  267. } storageType;
  268. size_t arrayLength; // The number of elements in the data array
  269. void *data; // Points to the scalar or array data
  270. size_t arrayDimensionsSize; // The number of dimensions the data-array has
  271. UA_UInt32 *arrayDimensions; // The length of each dimension of the data-array
  272. } UA_Variant;
  273. /* NumericRanges are used to indicate subsets of a (multidimensional) variant
  274. * array. NumericRange has no official type structure in the standard. On the
  275. * wire, it only exists as an encoded string, such as "1:2,0:3,5". The colon
  276. * separates min/max index and the comma separates dimensions. A single value
  277. * indicates a range with a single element (min==max). */
  278. typedef struct {
  279. size_t dimensionsSize;
  280. struct UA_NumericRangeDimension {
  281. UA_UInt32 min;
  282. UA_UInt32 max;
  283. } *dimensions;
  284. } UA_NumericRange;
  285. The following functions and definitions are used with UA_Variant.
  286. .. code-block:: c
  287. /**
  288. * Returns true if the variant contains a scalar value. Note that empty
  289. * variants contain an array of length -1 (undefined).
  290. *
  291. * @param v The variant
  292. * @return Does the variant contain a scalar value.
  293. */
  294. UA_Boolean UA_Variant_isScalar(const UA_Variant *v);
  295. /**
  296. * Set the variant to a scalar value that already resides in memory. The value
  297. * takes on the lifecycle of the variant and is deleted with it.
  298. *
  299. * @param v The variant
  300. * @param p A pointer to the value data
  301. * @param type The datatype of the value in question
  302. */
  303. UA_Variant_setScalar(UA_Variant *v, void * UA_RESTRICT p, const UA_DataType *type);
  304. /**
  305. * Set the variant to a scalar value that is copied from an existing variable.
  306. *
  307. * @param v The variant
  308. * @param p A pointer to the value data
  309. * @param type The datatype of the value
  310. * @return Indicates whether the operation succeeded or returns an error code
  311. */
  312. UA_StatusCode UA_Variant_setScalarCopy(UA_Variant *v, const void *p, const UA_DataType *type);
  313. /**
  314. * Set the variant to an array that already resides in memory. The array takes
  315. * on the lifecycle of the variant and is deleted with it.
  316. *
  317. * @param v The variant
  318. * @param array A pointer to the array data
  319. * @param arraySize The size of the array
  320. * @param type The datatype of the array
  321. */
  322. void UA_Variant_setArray(UA_Variant *v, void * UA_RESTRICT array,
  323. size_t arraySize, const UA_DataType *type);
  324. /**
  325. * Set the variant to an array that is copied from an existing array.
  326. *
  327. * @param v The variant
  328. * @param array A pointer to the array data
  329. * @param arraySize The size of the array
  330. * @param type The datatype of the array
  331. * @return Indicates whether the operation succeeded or returns an error code
  332. */
  333. UA_StatusCode UA_Variant_setArrayCopy(UA_Variant *v, const void *array,
  334. size_t arraySize, const UA_DataType *type);
  335. /**
  336. * Copy the variant, but use only a subset of the (multidimensional) array
  337. * into a variant. Returns an error code if the variant is not an array or if
  338. * the indicated range does not fit.
  339. *
  340. * @param src The source variant
  341. * @param dst The target variant
  342. * @param range The range of the copied data
  343. * @return Returns UA_STATUSCODE_GOOD or an error code
  344. */
  345. UA_StatusCode UA_Variant_copyRange(const UA_Variant *src, UA_Variant *dst,
  346. const UA_NumericRange range);
  347. /**
  348. * Insert a range of data into an existing variant. The data array can't be
  349. * reused afterwards if it contains types without a fixed size (e.g. strings)
  350. * since the members are moved into the variant and take on its lifecycle.
  351. *
  352. * @param v The variant
  353. * @param dataArray The data array. The type must match the variant
  354. * @param dataArraySize The length of the data array. This is checked to match the range size.
  355. * @param range The range of where the new data is inserted
  356. * @return Returns UA_STATUSCODE_GOOD or an error code
  357. */
  358. UA_StatusCode UA_Variant_setRange(UA_Variant *v, void * UA_RESTRICT array,
  359. size_t arraySize, const UA_NumericRange range);
  360. /**
  361. * Deep-copy a range of data into an existing variant.
  362. *
  363. * @param v The variant
  364. * @param dataArray The data array. The type must match the variant
  365. * @param dataArraySize The length of the data array. This is checked to match the range size.
  366. * @param range The range of where the new data is inserted
  367. * @return Returns UA_STATUSCODE_GOOD or an error code
  368. */
  369. UA_StatusCode UA_Variant_setRangeCopy(UA_Variant *v, const void *array,
  370. size_t arraySize, const UA_NumericRange range);
  371. UA_DataValue
  372. ^^^^^^^^^^^^
  373. A data value with an associated status code and timestamps.
  374. .. code-block:: c
  375. typedef struct {
  376. UA_Boolean hasValue : 1;
  377. UA_Boolean hasStatus : 1;
  378. UA_Boolean hasSourceTimestamp : 1;
  379. UA_Boolean hasServerTimestamp : 1;
  380. UA_Boolean hasSourcePicoseconds : 1;
  381. UA_Boolean hasServerPicoseconds : 1;
  382. UA_Variant value;
  383. UA_StatusCode status;
  384. UA_DateTime sourceTimestamp;
  385. UA_Int16 sourcePicoseconds;
  386. UA_DateTime serverTimestamp;
  387. UA_Int16 serverPicoseconds;
  388. } UA_DataValue;
  389. UA_DiagnosticInfo
  390. ^^^^^^^^^^^^^^^^^
  391. A structure that contains detailed error and diagnostic information associated
  392. with a StatusCode.
  393. .. code-block:: c
  394. typedef struct UA_DiagnosticInfo {
  395. UA_Boolean hasSymbolicId : 1;
  396. UA_Boolean hasNamespaceUri : 1;
  397. UA_Boolean hasLocalizedText : 1;
  398. UA_Boolean hasLocale : 1;
  399. UA_Boolean hasAdditionalInfo : 1;
  400. UA_Boolean hasInnerStatusCode : 1;
  401. UA_Boolean hasInnerDiagnosticInfo : 1;
  402. UA_Int32 symbolicId;
  403. UA_Int32 namespaceUri;
  404. UA_Int32 localizedText;
  405. UA_Int32 locale;
  406. UA_String additionalInfo;
  407. UA_StatusCode innerStatusCode;
  408. struct UA_DiagnosticInfo *innerDiagnosticInfo;
  409. } UA_DiagnosticInfo;
  410. .. _generic-handling:
  411. Generic Data Type Handling
  412. --------------------------
  413. All standard-defined data types are described with an ``UA_DataType`` structure.
  414. In addition to the 25 builtin data types, OPC UA defines many more. But they are
  415. mere combinations of the builtin data types. We handle all types in a unified
  416. way by storing their internal structure. So it is not necessary to define
  417. specialized functions for all additional types.
  418. The ``UA_TYPES`` array contains the description of every standard-defined data
  419. type.
  420. .. code-block:: c
  421. extern const UA_DataType UA_TYPES[UA_TYPES_COUNT];
  422. The following is an excerpt from ``ua_types_generated.h`` with the definition of
  423. OPC UA read requests. This file is auto-generated from the XML-description of
  424. the OPC UA data types that is part of the ISO/IEC 62541 standard.
  425. .. code-block:: c
  426. typedef struct {
  427. UA_RequestHeader requestHeader;
  428. UA_Double maxAge;
  429. UA_TimestampsToReturn timestampsToReturn;
  430. size_t nodesToReadSize;
  431. UA_ReadValueId *nodesToRead;
  432. } UA_ReadRequest;
  433. #define UA_TYPES_READREQUEST 118
  434. static UA_INLINE void UA_ReadRequest_init(UA_ReadRequest *p) {
  435. memset(p, 0, sizeof(UA_ReadRequest)); }
  436. static UA_INLINE void UA_ReadRequest_delete(UA_ReadRequest *p) {
  437. UA_delete(p, &UA_TYPES[UA_TYPES_READREQUEST]); }
  438. static UA_INLINE void UA_ReadRequest_deleteMembers(UA_ReadRequest *p) {
  439. UA_deleteMembers(p, &UA_TYPES[UA_TYPES_READREQUEST]); }
  440. static UA_INLINE UA_ReadRequest * UA_ReadRequest_new(void) {
  441. return (UA_ReadRequest*) UA_new(&UA_TYPES[UA_TYPES_READREQUEST]); }
  442. static UA_INLINE UA_StatusCode
  443. UA_ReadRequest_copy(const UA_ReadRequest *src, UA_ReadRequest *dst) {
  444. return UA_copy(src, dst, &UA_TYPES[UA_TYPES_READREQUEST]); }
  445. .. _array-handling:
  446. Array Handling
  447. --------------
  448. In OPC UA, all arrays can be undefined, have length 0 or a positive length. In
  449. data structures, all arrays are represented by a ``size_t`` length field and an
  450. appropriate pointer directly afterwards. In order to distinguish between
  451. undefined and length-zero arrays, we define the following.
  452. .. code-block:: c
  453. #define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  454. - size == 0 and data == NULL: The array is undefined
  455. - size == 0 and data == ``UA_EMPTY_ARRAY_SENTINEL``: The array has length 0
  456. - size > 0: The array at the given memory address has the given size
  457. The following functions are defined for array handling.
  458. .. code-block:: c
  459. /**
  460. * Allocates and initializes an array of variables of a specific type
  461. *
  462. * @param size The requested array length
  463. * @param type The datatype description
  464. * @return Returns the memory location of the variable or (void*)0 if no memory could be allocated
  465. */
  466. void * UA_Array_new(size_t size, const UA_DataType *type);
  467. /**
  468. * Allocates and copies an array. dst is set to (void*)0 if not enough memory is available.
  469. *
  470. * @param src The memory location of the source array
  471. * @param src_size The size of the array
  472. * @param dst The location of the pointer to the new array
  473. * @param type The datatype of the array members
  474. * @return Returns whether copying succeeded
  475. */
  476. UA_StatusCode UA_Array_copy(const void *src, size_t src_size, void **dst,
  477. const UA_DataType *type);
  478. /**
  479. * Deletes an array.
  480. *
  481. * @param p The memory location of the array
  482. * @param size The size of the array
  483. * @param type The datatype of the array members
  484. */
  485. void UA_Array_delete(void *p, size_t size, const UA_DataType *type);