Simple Virtual Machine
A simple but flexible virtual machine
SVM library values

This module contains API functions to handle SVM library values. More...

Functions

SVM_FUNCTION SVM_Value_Library svm_value_library_new (const void *svm, const SVM_Code code)
 This function creates a library value the SVM can store in its memories from a SVM_Code. More...
 
SVM_FUNCTION SVM_Value_Library svm_value_library_new_null (const void *svm)
 This function creates a library value the SVM can store in its memories without a value. More...
 
SVM_FUNCTION SVM_Boolean svm_value_type_is_library (const void *svm, const SVM_Value value)
 This function checks whether a value contains a library. More...
 
SVM_FUNCTION SVM_Code svm_value_library_get_code (const void *svm, const SVM_Value_Library library)
 This function extracts the code contained in a library value. More...
 
SVM_FUNCTION void svm_value_library_set (const void *svm, SVM_Value_Library value, const SVM_Value_Library library)
 This function replaces the library value by another library value. More...
 
SVM_FUNCTION void svm_value_library_set_code (const void *svm, SVM_Value_Library value, const SVM_Code code)
 This function replaces the code contained in a library value from a SVM_Code. More...
 

Detailed Description

This module contains API functions to handle SVM library values.

Function Documentation

◆ svm_value_library_get_code()

SVM_FUNCTION SVM_Code svm_value_library_get_code ( const void *  svm,
const SVM_Value_Library  library 
)

This function extracts the code contained in a library value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]libraryThe library value to extract from.
Returns
The code contained in the value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the library parameter does not contain an library.
See also
svm_value_type_is_library
svm_value_type_get

◆ svm_value_library_new()

SVM_FUNCTION SVM_Value_Library svm_value_library_new ( const void *  svm,
const SVM_Code  code 
)

This function creates a library value the SVM can store in its memories from a SVM_Code.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]codeThe code of the library.
Returns
The library value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_value_library_new_null()

SVM_FUNCTION SVM_Value_Library svm_value_library_new_null ( const void *  svm)

This function creates a library value the SVM can store in its memories without a value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
Returns
A non initialised library value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_value_library_set()

SVM_FUNCTION void svm_value_library_set ( const void *  svm,
SVM_Value_Library  value,
const SVM_Value_Library  library 
)

This function replaces the library value by another library value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe library value to update.
[in]libraryThe library to use for update.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the value parameter does not contain an library.
FAILUREinterruption when the library parameter does not contain an library.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_library
svm_value_type_get

◆ svm_value_library_set_code()

SVM_FUNCTION void svm_value_library_set_code ( const void *  svm,
SVM_Value_Library  value,
const SVM_Code  code 
)

This function replaces the code contained in a library value from a SVM_Code.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe library value to update.
[in]codeThe new code value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the value parameter does not contain an library.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_library
svm_value_type_get

◆ svm_value_type_is_library()

SVM_FUNCTION SVM_Boolean svm_value_type_is_library ( const void *  svm,
const SVM_Value  value 
)

This function checks whether a value contains a library.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]valueThe value to be diagnosed.
Returns
TRUE if the value contains a library, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)