Simple Virtual Machine A simple but flexible virtual machine

Functions
SVM library values
SVM 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | library | The library value to extract from.

Returns
  The code contained in the value.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | code | The code of the library.

Returns
  The library value.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.

Returns
  A non initialised library value.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | value | The library value to update.
  [in] | library | The library to use for update.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the value parameter does not contain an library.
  FAILURE | interruption when the library parameter does not contain an library.
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | value | The library value to update.
  [in] | code | The new code value.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the value parameter does not contain an library.
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | value | The value to be diagnosed.

Returns
  TRUE if the value contains a library, FALSE otherwise.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)