"Wrapper" function so that Python can invoke the LkFreeMemoryStringArray function
This "wrapper" function is provided so that python scripts can access functions with double pointers char **,
ptr
|
char*
|
|
pointer to the memory that must be released
|
count
|
uint32_t
|
|
number of elements (number of character strings)
|
Example of use in python:
def LkGetStringArray(self, lkStringMatrix, lkStringMatrixLength):
# Copy to local python array
lkStringArrayPy = []
for i in range(lkStringMatrixLength.value):
lkStringArrayPy.append(lkStringMatrix[i].decode(self.encoding))
# Free Memory Matrix
self.lib_linkar.WrapperPy_LkFreeMemoryStringArray.argtypes = (c_char_p, c_long)
self.lib_linkar.WrapperPy_LkFreeMemoryStringArray.restype = c_void_p
self.lib_linkar.WrapperPy_LkFreeMemoryStringArray(cast(lkStringMatrix, c_char_p), lkStringMatrixLength)
return lkStringArrayPy
|