Simple Virtual Machine A simple but flexible virtual machine

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

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

## Functions
SVM_FUNCTION SVM_Value_Plugin | svm_value_plugin_new (const void *svm, const SVM_Value_PluginEntryPoint type, void *value)
| This function creates a plugin defined value the SVM can store in its memories from a plugin entry point and generic C pointer.
SVM_FUNCTION SVM_Value_Plugin | svm_value_plugin_new_null (const void *svm, const SVM_Value_PluginEntryPoint type)
| This function creates a plugin value the SVM can store in its memories without a value.
SVM_FUNCTION SVM_Value_Plugin | svm_value_plugin_new_const (const void *svm, const SVM_Value_PluginEntryPoint type, const SVM_Value_String value)
| This function creates a plugin defined value the SVM can store in its memories from a plugin entry point and a string value.
SVM_FUNCTION SVM_Value_Plugin | svm_value_plugin_new_const__string (const void *svm, const SVM_Value_PluginEntryPoint type, const SVM_String value)
| This function creates a plugin defined value the SVM can store in its memories from a plugin entry point and a string.
SVM_FUNCTION SVM_Value_Plugin | svm_value_plugin_new_const__raw (const void *svm, const SVM_Value_PluginEntryPoint type, const char *value)
| This function creates a plugin defined value the SVM can store in its memories from a plugin entry point and a raw C string.
SVM_FUNCTION SVM_Boolean | svm_value_type_is_plugin (const void *svm, const SVM_Value value, const SVM_Value_PluginEntryPoint type)
| This function checks whether a value contains a plugin value of a given type.
SVM_FUNCTION SVM_Value_PluginEntryPoint | svm_value_plugin_get_type (const void *svm, const SVM_Value_Plugin plugin)
| This function extracts the plugin value type contained in a plugin value.
SVM_FUNCTION void * | svm_value_plugin_get_internal (const void *svm, const SVM_Value_Plugin plugin)
| This function extracts the plugin value contained in a plugin value.
SVM_FUNCTION void | svm_value_plugin_set (const void *svm, SVM_Value_Plugin value, const SVM_Value_Plugin plugin)
| This function replaces the plugin value by another plugin value.
SVM_FUNCTION void | svm_value_plugin_set_internal (const void *svm, SVM_Value_Plugin value, const SVM_Value_PluginEntryPoint type, void *internal_value)
| This function replaces the type and the value contained in a plugin value from specific values.
SVM_FUNCTION SVM_Value_Plugin_Comparison | svm_value_plugin_compare_convert (const void *svm, const SVM_Comparison_Result compare)
| This function transforms a SVM_Comparison_Result into a SVM_Value_Plugin_Comparison.

## Detailed Description

This module contains API functions to handle SVM plugin values.

## Function Documentation

## ◆ svm_value_plugin_compare_convert()

SVM_FUNCTION SVM_Value_Plugin_Comparison svm_value_plugin_compare_convert | ( | const void * | svm,
|  | const SVM_Comparison_Result | compare
| ) |  |

This function transforms a SVM_Comparison_Result into a SVM_Value_Plugin_Comparison.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | compare | The value to be transformed.

Returns
  The plugin comparison from the comparison value.

Exceptions

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

See also
  SVM_Comparison_Result
  SVM_Value_Plugin_Comparison

## ◆ svm_value_plugin_get_internal()

SVM_FUNCTION void * svm_value_plugin_get_internal | ( | const void * | svm,
|  | const SVM_Value_Plugin | plugin
| ) |  |

This function extracts the plugin value contained in a plugin value.

Parameters

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

Returns
  The plugin raw value of the plugin value.

Note
  Any change done on the value returned by this function will not be synchronised with the debugger until the end of the callback. The API function svm_debug_synchronise allows explicit synchronisation.

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 a plugin value.

See also
  svm_value_type_is_plugin
  svm_value_type_get
  svm_debug_synchronise

## ◆ svm_value_plugin_get_type()

SVM_FUNCTION SVM_Value_PluginEntryPoint svm_value_plugin_get_type | ( | const void * | svm,
|  | const SVM_Value_Plugin | plugin
| ) |  |

This function extracts the plugin value type contained in a plugin value.

Parameters

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

Returns
  The plugin value type of the plugin 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 a plugin value.

See also
  svm_value_type_is_plugin
  svm_value_type_get

## ◆ svm_value_plugin_new()

SVM_FUNCTION SVM_Value_Plugin svm_value_plugin_new | ( | const void * | svm,
|  | const SVM_Value_PluginEntryPoint | type,
|  | void * | value
| ) |  |

This function creates a plugin defined value the SVM can store in its memories from a plugin entry point and generic C pointer.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | type | The extended type name.
  [in] | value | The raw value pointer.

Note
  If the type does not support the copy operation, any write into memory attempt will fail unless the value is flagged movable.

Returns
  The plugin defined value.

Exceptions

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

See also
  svm_value_state_set_movable

## ◆ svm_value_plugin_new_const()

SVM_FUNCTION SVM_Value_Plugin svm_value_plugin_new_const | ( | const void * | svm,
|  | const SVM_Value_PluginEntryPoint | type,
|  | const SVM_Value_String | value
| ) |  |

This function creates a plugin defined value the SVM can store in its memories from a plugin entry point and a string value.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | type | The extended type name.
  [in] | value | The string representation of the value.

Note
  If the type does not support the copy operation, any write into memory attempt will fail unless the value is flagged movable.

Returns
  The plugin defined value.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  MEMORY | interruption when the type does not exist or when not constant constructible.

## ◆ svm_value_plugin_new_const__raw()

SVM_FUNCTION SVM_Value_Plugin svm_value_plugin_new_const__raw | ( | const void * | svm,
|  | const SVM_Value_PluginEntryPoint | type,
|  | const char * | value
| ) |  |

This function creates a plugin defined value the SVM can store in its memories from a plugin entry point and a raw C string.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | type | The extended type name.
  [in] | value | The string representation of the value.

Note
  If the type does not support the copy operation, any write into memory attempt will fail unless the value is flagged movable.

Returns
  The plugin defined value.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  MEMORY | interruption when the type does not exist or when not constant constructible.

## ◆ svm_value_plugin_new_const__string()

SVM_FUNCTION SVM_Value_Plugin svm_value_plugin_new_const__string | ( | const void * | svm,
|  | const SVM_Value_PluginEntryPoint | type,
|  | const SVM_String | value
| ) |  |

This function creates a plugin defined value the SVM can store in its memories from a plugin entry point and a string.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | type | The extended type name.
  [in] | value | The string representation of the value.

Note
  If the type does not support the copy operation, any write into memory attempt will fail unless the value is flagged movable.

Returns
  The plugin defined value.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  MEMORY | interruption when the type does not exist or when not constant constructible.

## ◆ svm_value_plugin_new_null()

SVM_FUNCTION SVM_Value_Plugin svm_value_plugin_new_null | ( | const void * | svm,
|  | const SVM_Value_PluginEntryPoint | type
| ) |  |

This function creates a plugin 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.
  [in] | type | The plugin type of the null value.

Returns
  A non initialised plugin value of specified type.

Exceptions

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

## ◆ svm_value_plugin_set()

SVM_FUNCTION void svm_value_plugin_set | ( | const void * | svm,
|  | SVM_Value_Plugin | value,
|  | const SVM_Value_Plugin | plugin
| ) |  |

This function replaces the plugin value by another plugin value.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | value | The plugin value to update.
  [in] | plugin | The plugin to use for update.

Warning
  The previous value of the updated plugin value is deleted. The new value is copied into the 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 a plugin value.
  FAILURE | interruption when the value parameter can not be deleted.
  FAILURE | interruption when the plugin parameter does not contain a plugin value.
  FAILURE | interruption when the plugin parameter internal value can not be copied.
  FAILURE | interruption when the value and plugin parameters have different types.
  FAILURE | interruption when the value is a constant.

See also
  svm_value_type_is_interruption
  svm_value_type_get

## ◆ svm_value_plugin_set_internal()

SVM_FUNCTION void svm_value_plugin_set_internal | ( | const void * | svm,
|  | SVM_Value_Plugin | value,
|  | const SVM_Value_PluginEntryPoint | type,
|  | void * | internal_value
| ) |  |

This function replaces the type and the value contained in a plugin value from specific values.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | value | The interruption value to update.
  [in] | type | The plugin value type.
  [in] | internal_value | The plugin raw value.

Warning
  The previous value of the updated plugin value is deleted.

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 a plugin value.
  FAILURE | interruption when the value parameter can not be deleted.
  FAILURE | interruption when the type is different from the value one.
  FAILURE | interruption when the value is a constant.
  MEMORY | interruption when the type does not identify a plugin type.

See also
  svm_value_type_is_plugin
  svm_value_type_get
  svm_plugin_has_type

## ◆ svm_value_type_is_plugin()

SVM_FUNCTION SVM_Boolean svm_value_type_is_plugin | ( | const void * | svm,
|  | const SVM_Value | value,
|  | const SVM_Value_PluginEntryPoint | type
| ) |  |

This function checks whether a value contains a plugin value of a given type.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | value | The value to be diagnosed.
  [in] | type | The plugin type.

Returns
  TRUE if the value contains a plugin value of the specified type, FALSE otherwise.

Exceptions

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