This module contains API functions to handle SVM values.
More...
This module contains API functions to handle SVM values.
Values are containers for data a memory can store.
- Note
- In parameters, values are always passed by reference. Using a set API function on a value passed on a parameter containing a value read from a memory will change the value directly in the memory. This can be used to implement an "extra return parameter" or use a value in memory as a state between several plugin callback function calls.
- Warning
- Changing a value written in memory will bypass all eventual memory synchronisation mecanisms. Use this feature with caution.
- See also
- SVM memories
-
SVM memory synchronisation
◆ svm_value_array_new()
This function creates an array of values.
- Parameters
-
[in] | svm | The SVM pointer passed as first argument of the callback function. |
[in] | size | The size of the array. |
- Returns
- A pointer to a C array of SVM_Value. Every cell of the array has to be initialised by a value before being passed to an API function.
- Note
- The returned array is a valid SVM variable: its scope can be changed if needed, and the pointer shall not be freed explicitely.
- Exceptions
-
FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.) |
◆ svm_value_compare()
This function compares two values.
- Parameters
-
[in] | svm | The SVM pointer passed as first argument of the callback function. |
[in] | left | The left operand of the equality. |
[in] | right | The right operand of the equality. |
- Returns
- The comparison status of the two values.
- Exceptions
-
FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.) |
- See also
- SVM_Comparison_Result
◆ svm_value_copy()
This function creates a copy from a value.
- Parameters
-
[in] | svm | The SVM pointer passed as first argument of the callback function. |
[in] | value | The value to be copied. |
- Note
- If a value can not be copied, a MEMORY interruption is raised.
- Returns
- The non-constant copy of the value.
- Exceptions
-
FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.) |
MEMORY | interruption when the value can not be copied. |
◆ svm_value_is_equal()
This function checks whether two values are equal.
- Parameters
-
[in] | svm | The SVM pointer passed as first argument of the callback function. |
[in] | left | The left operand of the equality. |
[in] | right | The right operand of the equality. |
- Returns
- TRUE if the two values have the same type and the same value, FALSE otherwise.
- Exceptions
-
FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.) |
- See also
- svm_value_compare
◆ svm_value_print()
This function extracts a string representation of a value.
- Parameters
-
[in] | svm | The SVM pointer passed as first argument of the callback function. |
[in] | value | The value to be rendered as string. |
- Note
- If a value can not correctly rendered, an ugly default rendering is returned instead.
- Returns
- The string representation of the value.
- Exceptions
-
FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.) |