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

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]svmThe SVM pointer passed as first argument of the callback function.
[in]compareThe value to be transformed.
Returns
The plugin comparison from the comparison value.
Exceptions
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]pluginThe 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
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]pluginThe plugin value to extract from.
Returns
The plugin value type of the plugin 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 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]svmThe SVM pointer passed as first argument of the callback function.
[in]typeThe extended type name.
[in]valueThe 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
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
MEMORYinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]typeThe extended type name.
[in]valueThe 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
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
MEMORYinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]typeThe extended type name.
[in]valueThe 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
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
MEMORYinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]typeThe extended type name.
[in]valueThe 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
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
MEMORYinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]typeThe plugin type of the null value.
Returns
A non initialised plugin value of specified type.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
MEMORYinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe plugin value to update.
[in]pluginThe 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
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the value parameter does not contain a plugin value.
FAILUREinterruption when the value parameter can not be deleted.
FAILUREinterruption when the plugin parameter does not contain a plugin value.
FAILUREinterruption when the plugin parameter internal value can not be copied.
FAILUREinterruption when the value and plugin parameters have different types.
FAILUREinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe interruption value to update.
[in]typeThe plugin value type.
[in]internal_valueThe plugin raw value.
Warning
The previous value of the updated plugin value is deleted.
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 a plugin value.
FAILUREinterruption when the value parameter can not be deleted.
FAILUREinterruption when the type is different from the value one.
FAILUREinterruption when the value is a constant.
MEMORYinterruption 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]svmThe SVM pointer passed as first argument of the callback function.
[in]valueThe value to be diagnosed.
[in]typeThe plugin type.
Returns
TRUE if the value contains a plugin value of the specified type, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
MEMORYinterruption when the type does not exist.