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

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

Functions

SVM_FUNCTION SVM_Value_Pointer svm_value_pointer_new (const void *svm, const SVM_Value_Integer address, const SVM_Value_Integer size)
 This function creates a pointer value the SVM can store in its memories from two integer values. More...
 
SVM_FUNCTION SVM_Value_Pointer svm_value_pointer_new__raw (const void *svm, const SVM_Address address, const SVM_Size size)
 This function creates a pointer value the SVM can store in its memories from two raw integers. More...
 
SVM_FUNCTION SVM_Value_Pointer svm_value_pointer_new_null (const void *svm)
 This function creates a pointer value the SVM can store in its memories without a value. More...
 
SVM_FUNCTION SVM_Boolean svm_value_type_is_pointer (const void *svm, const SVM_Value value)
 This function checks whether a value contains a pointer. More...
 
SVM_FUNCTION SVM_Address svm_value_pointer_get_address (const void *svm, const SVM_Value_Pointer pointer)
 This function extracts the first pointer address contained in a pointer value. More...
 
SVM_FUNCTION SVM_Size svm_value_pointer_get_size (const void *svm, const SVM_Value_Pointer pointer)
 This function extracts the pointer size contained in a pointer value. More...
 
SVM_FUNCTION void svm_value_pointer_set (const void *svm, SVM_Value_Pointer value, const SVM_Value_Pointer pointer)
 This function replaces the pointer value by another pointer value. More...
 
SVM_FUNCTION void svm_value_pointer_set_address (const void *svm, SVM_Value_Pointer value, const SVM_Value_Integer address)
 This function replaces the first address contained in a pointer value from an integer value. More...
 
SVM_FUNCTION void svm_value_pointer_set_address__raw (const void *svm, SVM_Value_Pointer value, const SVM_Address address)
 This function replaces the first address contained in a pointer value from a raw value. More...
 
SVM_FUNCTION void svm_value_pointer_set_size (const void *svm, SVM_Value_Pointer value, const SVM_Value_Integer size)
 This function replaces the size contained in a pointer value from an integer value. More...
 
SVM_FUNCTION void svm_value_pointer_set_size__raw (const void *svm, SVM_Value_Pointer value, const SVM_Size size)
 This function replaces the size contained in a pointer value from a raw value. More...
 
SVM_FUNCTION void svm_value_pointer_set_addresssize (const void *svm, SVM_Value_Pointer value, const SVM_Value_Integer address, const SVM_Value_Integer size)
 This function replaces the first address and the size contained in a pointer value from two integer values. More...
 
SVM_FUNCTION void svm_value_pointer_set_addresssize__raw (const void *svm, SVM_Value_Pointer value, const SVM_Address address, const SVM_Size size)
 This function replaces the first address and the size contained in a pointer value from two raw values. More...
 

Detailed Description

This module contains API functions to handle SVM pointer values.

Function Documentation

◆ svm_value_pointer_get_address()

SVM_FUNCTION SVM_Address svm_value_pointer_get_address ( const void *  svm,
const SVM_Value_Pointer  pointer 
)

This function extracts the first pointer address contained in a pointer value.

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

◆ svm_value_pointer_get_size()

SVM_FUNCTION SVM_Size svm_value_pointer_get_size ( const void *  svm,
const SVM_Value_Pointer  pointer 
)

This function extracts the pointer size contained in a pointer value.

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

◆ svm_value_pointer_new()

SVM_FUNCTION SVM_Value_Pointer svm_value_pointer_new ( const void *  svm,
const SVM_Value_Integer  address,
const SVM_Value_Integer  size 
)

This function creates a pointer value the SVM can store in its memories from two integer values.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]addressThe first address of the pointer.
[in]sizeThe size of the pointer.
Returns
The pointer value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the address or the size is a negative number.

◆ svm_value_pointer_new__raw()

SVM_FUNCTION SVM_Value_Pointer svm_value_pointer_new__raw ( const void *  svm,
const SVM_Address  address,
const SVM_Size  size 
)

This function creates a pointer value the SVM can store in its memories from two raw integers.

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

◆ svm_value_pointer_new_null()

SVM_FUNCTION SVM_Value_Pointer svm_value_pointer_new_null ( const void *  svm)

This function creates a pointer 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 pointer value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_value_pointer_set()

SVM_FUNCTION void svm_value_pointer_set ( const void *  svm,
SVM_Value_Pointer  value,
const SVM_Value_Pointer  pointer 
)

This function replaces the pointer value by another pointer value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe pointer value to update.
[in]pointerThe pointer 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 pointer.
FAILUREinterruption when the pointer parameter does not contain an pointer.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_pointer
svm_value_type_get

◆ svm_value_pointer_set_address()

SVM_FUNCTION void svm_value_pointer_set_address ( const void *  svm,
SVM_Value_Pointer  value,
const SVM_Value_Integer  address 
)

This function replaces the first address contained in a pointer value from an integer value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe pointer value to update.
[in]addressThe new first address of the pointer.
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 pointer.
FAILUREinterruption when the address or the size is a negative integer.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_pointer
svm_value_type_get

◆ svm_value_pointer_set_address__raw()

SVM_FUNCTION void svm_value_pointer_set_address__raw ( const void *  svm,
SVM_Value_Pointer  value,
const SVM_Address  address 
)

This function replaces the first address contained in a pointer value from a raw value.

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

◆ svm_value_pointer_set_addresssize()

SVM_FUNCTION void svm_value_pointer_set_addresssize ( const void *  svm,
SVM_Value_Pointer  value,
const SVM_Value_Integer  address,
const SVM_Value_Integer  size 
)

This function replaces the first address and the size contained in a pointer value from two integer values.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe pointer value to update.
[in]addressThe new first address of the pointer.
[in]sizeThe new pointer size.
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 pointer.
FAILUREinterruption when the address or the size is a negative integer.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_pointer
svm_value_type_get

◆ svm_value_pointer_set_addresssize__raw()

SVM_FUNCTION void svm_value_pointer_set_addresssize__raw ( const void *  svm,
SVM_Value_Pointer  value,
const SVM_Address  address,
const SVM_Size  size 
)

This function replaces the first address and the size contained in a pointer value from two raw values.

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

◆ svm_value_pointer_set_size()

SVM_FUNCTION void svm_value_pointer_set_size ( const void *  svm,
SVM_Value_Pointer  value,
const SVM_Value_Integer  size 
)

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

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe pointer value to update.
[in]sizeThe new pointer size.
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 pointer.
FAILUREinterruption when the address or the size is a negative integer.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_pointer
svm_value_type_get

◆ svm_value_pointer_set_size__raw()

SVM_FUNCTION void svm_value_pointer_set_size__raw ( const void *  svm,
SVM_Value_Pointer  value,
const SVM_Size  size 
)

This function replaces the size contained in a pointer value from a raw value.

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

◆ svm_value_type_is_pointer()

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

This function checks whether a value contains a pointer.

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 pointer, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)