Simple Virtual Machine A simple but flexible virtual machine

Loading...
Searching...
No Matches
Functions
SVM pointer values
SVM 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.

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

Returns
  The first address of the pointer.

Exceptions

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

Returns
  The size of the pointer.

Exceptions

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

Returns
  The pointer value.

Exceptions

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

Returns
  The pointer value.

Exceptions

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

Returns
  A non initialised pointer value.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | value | The pointer value to update.
  [in] | pointer | The pointer 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 pointer.
  FAILURE | interruption when the pointer parameter does not contain an pointer.
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | value | The pointer value to update.
  [in] | address | The new first address of the pointer.

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

Exceptions

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

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

Exceptions

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

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

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the pointer parameter does not contain an pointer.
  FAILURE | interruption 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] | 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 pointer, FALSE otherwise.

Exceptions

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