-
Notifications
You must be signed in to change notification settings - Fork 235
Expand file tree
/
Copy patharray.h
More file actions
76 lines (65 loc) · 2.07 KB
/
Copy patharray.h
File metadata and controls
76 lines (65 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#pragma once
#include "../value.h"
/**
* @brief Initialize a new SIValue array type with given capacity
* @param initialCapacity:
* @retval Initialized array
*/
SIValue SIArray_New(u_int32_t initialCapacity);
/**
* @brief Appends a new SIValue to a given array
* @param siarray: pointer to array
* @param value: new value
*/
void SIArray_Append(SIValue *siarray, SIValue value);
/**
* @brief Returns a volatile copy of the SIValue from an array in a given index
* @note If index is out of bound, SI_NullVal is returned
* Caller is expected either to not free the returned value or take ownership on
* its own copy
* @param siarray: array
* @param index: index
* @retval The value in the requested index
*/
SIValue SIArray_Get(SIValue siarray, u_int32_t index);
/**
* @brief Returns the array length
* @param siarray:
* @retval array length
*/
u_int32_t SIArray_Length(SIValue siarray);
/**
* @brief Returns true if any of the types in 't' are contained in the array
or its nested array children, if any
* @param siarray: array
* @param t: bitmap of types to search for
* @retval a boolean indicating whether any types were matched
*/
bool SIArray_ContainsType(SIValue siarray, SIType t);
/**
* @brief Returns a copy of the array
* @note The caller needs to free the array
* @param siarray:
* @retval A clone of the given array
*/
SIValue SIArray_Clone(SIValue siarray);
/**
* @brief Prints an array into a given buffer
* @param list: array to print
* @param buf: print buffer (pointer to pointer to allow re allocation)
* @param len: print buffer length
* @param bytesWritten: the actual number of bytes written to the buffer
*/
void SIArray_ToString(SIValue list, char **buf, size_t *bufferLen, size_t *bytesWritten);
/**
* @brief Returns the array hash code.
* @param siarray: SIArray.
* @retval The array hashCode.
*/
XXH64_hash_t SIArray_HashCode(SIValue siarray);
/**
* @brief delete an array
* @param siarray:
* @retval None
*/
void SIArray_Free(SIValue siarray);