Simple Virtual Machine A simple but flexible virtual machine

Loading...
Searching...
No Matches
Functions
SVM integer values
SVM values

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

## Functions
SVM_FUNCTION SVM_Value_Integer | svm_value_integer_new (const void *svm, const long int integer)
| This function creates an integer value the SVM can store in its memories from a raw integer.
SVM_FUNCTION SVM_Value_Integer | svm_value_integer_new_null (const void *svm)
| This function creates an integer value the SVM can store in its memories without a value.
SVM_FUNCTION SVM_Boolean | svm_value_type_is_integer (const void *svm, const SVM_Value value)
| This function checks whether a value contains an integer.
SVM_FUNCTION long long int | svm_value_integer_get (const void *svm, const SVM_Value_Integer integer)
| This function extracts the raw integer contained in an integer value.
SVM_FUNCTION void | svm_value_integer_set (const void *svm, SVM_Value_Integer value, const long long int integer)
| This function replaces the raw integer contained in an integer value from a raw integer.

## Detailed Description

This module contains API functions to handle SVM integer values.

## Function Documentation

## ◆ svm_value_integer_get()

SVM_FUNCTION long long int svm_value_integer_get | ( | const void * | svm,
|  | const SVM_Value_Integer | integer
| ) |  |

This function extracts the raw integer contained in an integer value.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | integer | The integer value to extract from.

Returns
  The contained integer.

Exceptions

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

See also
  svm_value_type_is_integer
  svm_value_type_get

## ◆ svm_value_integer_new()

SVM_FUNCTION SVM_Value_Integer svm_value_integer_new | ( | const void * | svm,
|  | const long int | integer
| ) |  |

This function creates an integer value the SVM can store in its memories from a raw integer.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | integer | The integer to initiate the integer value.

Returns
  The integer value.

Exceptions

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

## ◆ svm_value_integer_new_null()

SVM_FUNCTION SVM_Value_Integer svm_value_integer_new_null | ( | const void * | svm | ) |

This function creates an integer 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 integer value.

Exceptions

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

## ◆ svm_value_integer_set()

SVM_FUNCTION void svm_value_integer_set | ( | const void * | svm,
|  | SVM_Value_Integer | value,
|  | const long long int | integer
| ) |  |

This function replaces the raw integer contained in an integer value from a raw integer.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | value | The integer value to update.
  [in] | integer | The new integer 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 integer.
  FAILURE | interruption when the value is a constant.

See also
  svm_value_type_is_integer
  svm_value_type_get

## ◆ svm_value_type_is_integer()

SVM_FUNCTION SVM_Boolean svm_value_type_is_integer | ( | const void * | svm,
|  | const SVM_Value | value
| ) |  |

This function checks whether a value contains an integer.

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 an integer, FALSE otherwise.

Exceptions

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