Simple Virtual Machine
A simple but flexible virtual machine
SVM integer 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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

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]svmThe SVM pointer passed as first argument of the callback function.
[in]integerThe integer value to extract from.
Returns
The contained integer.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]integerThe integer to initiate the integer value.
Returns
The integer value.
Exceptions
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
Returns
A non initialised integer value.
Exceptions
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe integer value to update.
[in]integerThe new integer 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 integer.
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]valueThe value to be diagnosed.
Returns
TRUE if the value contains an integer, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)