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

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

Functions

SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_internal (const void *svm, const SVM_Interruption_Internal interruption, const SVM_Value_String message, const SVM_Interruption_Kind kind)
 This function creates an interruption the SVM can store in its memories from an interruption type and a string value. More...
 
SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_internal__string (const void *svm, const SVM_Interruption_Internal interruption, const SVM_String message, const SVM_Interruption_Kind kind)
 This function creates an interruption the SVM can store in its memories from an interruption type and a SVM_String. More...
 
SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_internal__raw (const void *svm, const SVM_Interruption_Internal interruption, const char *message, const SVM_Interruption_Kind kind)
 This function creates an interruption the SVM can store in its memories from an interruption type and a C nul-terminated string. More...
 
SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_external (const void *svm, const SVM_Value_PluginEntryPoint name, const SVM_Value_String message)
 This function creates an interruption the SVM can store in its memories from a plugin entry point and a string value. More...
 
SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_external__string (const void *svm, const SVM_Value_PluginEntryPoint name, const SVM_String message)
 This function creates an interruption the SVM can store in its memories from a plugin entry point and a SVM_String. More...
 
SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_external__raw (const void *svm, const SVM_Value_PluginEntryPoint name, const char *message)
 This function creates an interruption the SVM can store in its memories from a plugin entry point and a C nul-terminated string. More...
 
SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_null (const void *svm)
 This function creates an interruption value the SVM can store in its memories without a value. More...
 
SVM_FUNCTION SVM_Boolean svm_value_type_is_interruption (const void *svm, const SVM_Value value)
 This function checks whether a value contains an interruption. More...
 
SVM_FUNCTION SVM_Boolean svm_value_interruption_is_internal (const void *svm, const SVM_Value_Interruption interruption)
 This function extracts the interruption type contained in an interruption value. More...
 
SVM_FUNCTION SVM_Boolean svm_value_interruption_is_external (const void *svm, const SVM_Value_Interruption interruption)
 This function extracts the interruption extension name contained in an interruption value. More...
 
SVM_FUNCTION SVM_Interruption_Internal svm_value_interruption_get_internal (const void *svm, const SVM_Value_Interruption interruption)
 This function extracts the interruption type contained in an interruption value. More...
 
SVM_FUNCTION SVM_Value_PluginEntryPoint svm_value_interruption_get_external (const void *svm, const SVM_Value_Interruption interruption)
 This function extracts the interruption extension name contained in an interruption value. More...
 
SVM_FUNCTION SVM_String svm_value_interruption_get_message (const void *svm, const SVM_Value_Interruption interruption)
 This function extracts the interruption message contained in an interruption value. More...
 
SVM_FUNCTION SVM_Interruption_Kind svm_value_interruption_get_kind (const void *svm, const SVM_Value_Interruption interruption)
 This function extracts the interruption kind contained in an interruption value. More...
 
SVM_FUNCTION SVM_String svm_value_interruption_get_location (const void *svm, const SVM_Value_Interruption interruption)
 This function extracts the interruption location contained in an interruption value. More...
 
SVM_FUNCTION void svm_value_interruption_set (const void *svm, SVM_Value_Interruption value, const SVM_Value_Interruption interruption)
 This function replaces the interruption value by another interruption value. More...
 
SVM_FUNCTION void svm_value_interruption_set_internal (const void *svm, SVM_Value_Interruption value, const SVM_Interruption_Internal type, const SVM_Value_String message, const SVM_Interruption_Kind kind)
 This function replaces the interruption type, the message and the kind of interruption contained in an interruption value from specific values and a string value message. More...
 
SVM_FUNCTION void svm_value_interruption_set_internal__string (const void *svm, SVM_Value_Interruption value, const SVM_Interruption_Internal type, const SVM_String message, const SVM_Interruption_Kind kind)
 This function replaces the interruption type, the message and the kind of interruption contained in an interruption value from specific values and a SVM_String message. More...
 
SVM_FUNCTION void svm_value_interruption_set_internal__raw (const void *svm, SVM_Value_Interruption value, const SVM_Interruption_Internal type, const char *message, const SVM_Interruption_Kind kind)
 This function replaces the interruption type, the message and the kind of interruption contained in an interruption value from specific values and a C nul-terminated string message. More...
 
SVM_FUNCTION void svm_value_interruption_set_external (const void *svm, SVM_Value_Interruption value, const SVM_Value_PluginEntryPoint name, const SVM_Value_String message)
 This function replaces the interruption name and the message contained in an interruption value from specific values and a string value message. More...
 
SVM_FUNCTION void svm_value_interruption_set_external__string (const void *svm, SVM_Value_Interruption value, const SVM_Value_PluginEntryPoint name, const SVM_String message)
 This function replaces the interruption name and the message contained in an interruption value from specific values and a SVM_String message. More...
 
SVM_FUNCTION void svm_value_interruption_set_external__raw (const void *svm, SVM_Value_Interruption value, const SVM_Value_PluginEntryPoint name, const char *message)
 This function replaces the interruption name and the message contained in an interruption value from specific values and a C nul-terminated string message. More...
 

Detailed Description

This module contains API functions to handle SVM interruption values.

Function Documentation

◆ svm_value_interruption_get_external()

SVM_FUNCTION SVM_Value_PluginEntryPoint svm_value_interruption_get_external ( const void *  svm,
const SVM_Value_Interruption  interruption 
)

This function extracts the interruption extension name contained in an interruption value.

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

◆ svm_value_interruption_get_internal()

SVM_FUNCTION SVM_Interruption_Internal svm_value_interruption_get_internal ( const void *  svm,
const SVM_Value_Interruption  interruption 
)

This function extracts the interruption type contained in an interruption value.

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

◆ svm_value_interruption_get_kind()

SVM_FUNCTION SVM_Interruption_Kind svm_value_interruption_get_kind ( const void *  svm,
const SVM_Value_Interruption  interruption 
)

This function extracts the interruption kind contained in an interruption value.

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

◆ svm_value_interruption_get_location()

SVM_FUNCTION SVM_String svm_value_interruption_get_location ( const void *  svm,
const SVM_Value_Interruption  interruption 
)

This function extracts the interruption location contained in an interruption value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]interruptionThe interruption value to extract from.
Returns
The interruption location as a string contained in the value.
Note
When the interruption as no location, an empty string is returned.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the interruption parameter does not contain an interruption.
See also
svm_value_type_is_interruption
svm_value_type_get

◆ svm_value_interruption_get_message()

SVM_FUNCTION SVM_String svm_value_interruption_get_message ( const void *  svm,
const SVM_Value_Interruption  interruption 
)

This function extracts the interruption message contained in an interruption value.

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

◆ svm_value_interruption_is_external()

SVM_FUNCTION SVM_Boolean svm_value_interruption_is_external ( const void *  svm,
const SVM_Value_Interruption  interruption 
)

This function extracts the interruption extension name contained in an interruption value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]interruptionThe interruption value to extract from.
Returns
TRUE when the interruption is external, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the interruption parameter does not contain an interruption.
FAILUREinterruption when the interruption is internal.
See also
svm_value_type_is_interruption
svm_value_type_get

◆ svm_value_interruption_is_internal()

SVM_FUNCTION SVM_Boolean svm_value_interruption_is_internal ( const void *  svm,
const SVM_Value_Interruption  interruption 
)

This function extracts the interruption type contained in an interruption value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]interruptionThe interruption value to extract from.
Returns
TRUE when the interruption is internal, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the interruption parameter does not contain an interruption.
FAILUREinterruption when the interruption is external.
See also
svm_value_type_is_interruption
svm_value_type_get

◆ svm_value_interruption_new_external()

SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_external ( const void *  svm,
const SVM_Value_PluginEntryPoint  name,
const SVM_Value_String  message 
)

This function creates an interruption 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]nameThe interruption extended type.
[in]messageA string for the SVM user.

The created interruption has a type defined in a plugin. The interruption type is automatically set to PLUGIN_INTERRUPTION.

Returns
The interruption value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the name parameter does not identify a plugin interruption.

◆ svm_value_interruption_new_external__raw()

SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_external__raw ( const void *  svm,
const SVM_Value_PluginEntryPoint  name,
const char *  message 
)

This function creates an interruption the SVM can store in its memories from a plugin entry point and a C nul-terminated string.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe interruption extended type.
[in]messageA string for the SVM user.

The created interruption has a type defined in a plugin. The interruption type is automatically set to PLUGIN_INTERRUPTION.

Returns
The interruption value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the name parameter does not identify a plugin interruption.

◆ svm_value_interruption_new_external__string()

SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_external__string ( const void *  svm,
const SVM_Value_PluginEntryPoint  name,
const SVM_String  message 
)

This function creates an interruption the SVM can store in its memories from a plugin entry point and a SVM_String.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe interruption extended type.
[in]messageA string for the SVM user.

The created interruption has a type defined in a plugin. The interruption type is automatically set to PLUGIN_INTERRUPTION.

Returns
The interruption value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the name parameter does not identify a plugin interruption.

◆ svm_value_interruption_new_internal()

SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_internal ( const void *  svm,
const SVM_Interruption_Internal  interruption,
const SVM_Value_String  message,
const SVM_Interruption_Kind  kind 
)

This function creates an interruption the SVM can store in its memories from an interruption type and a string value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]interruptionThe interruption code.
[in]messageA string for the SVM user.
[in]kindThe interruption type.

The created interruption has an internal type and can be set as an hardware interruption.

Returns
The interruption value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the interruption is set to PLUGIN_INTERRUPTION.

◆ svm_value_interruption_new_internal__raw()

SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_internal__raw ( const void *  svm,
const SVM_Interruption_Internal  interruption,
const char *  message,
const SVM_Interruption_Kind  kind 
)

This function creates an interruption the SVM can store in its memories from an interruption type and a C nul-terminated string.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]interruptionThe interruption code.
[in]messageA string for the SVM user.
[in]kindThe interruption type.

The created interruption has an internal type and can be set as an hardware interruption.

Returns
The interruption value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the interruption is set to PLUGIN_INTERRUPTION.

◆ svm_value_interruption_new_internal__string()

SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_internal__string ( const void *  svm,
const SVM_Interruption_Internal  interruption,
const SVM_String  message,
const SVM_Interruption_Kind  kind 
)

This function creates an interruption the SVM can store in its memories from an interruption type and a SVM_String.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]interruptionThe interruption code.
[in]messageA string for the SVM user.
[in]kindThe interruption type.

The created interruption has an internal type and can be set as an hardware interruption.

Returns
The interruption value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the interruption is set to PLUGIN_INTERRUPTION.

◆ svm_value_interruption_new_null()

SVM_FUNCTION SVM_Value_Interruption svm_value_interruption_new_null ( const void *  svm)

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

◆ svm_value_interruption_set()

SVM_FUNCTION void svm_value_interruption_set ( const void *  svm,
SVM_Value_Interruption  value,
const SVM_Value_Interruption  interruption 
)

This function replaces the interruption value by another interruption value.

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

◆ svm_value_interruption_set_external()

SVM_FUNCTION void svm_value_interruption_set_external ( const void *  svm,
SVM_Value_Interruption  value,
const SVM_Value_PluginEntryPoint  name,
const SVM_Value_String  message 
)

This function replaces the interruption name and the message contained in an interruption value from specific values and a string value message.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe interruption value to update.
[in]nameThe new interruption extension name.
[in]messageThe new interruption message.

The interruption type is automatically set to PLUGIN_INTERRUPTION.

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 interruption.
FAILUREinterruption when the name parameter does not identify a plugin interruption.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_interruption
svm_value_type_get

◆ svm_value_interruption_set_external__raw()

SVM_FUNCTION void svm_value_interruption_set_external__raw ( const void *  svm,
SVM_Value_Interruption  value,
const SVM_Value_PluginEntryPoint  name,
const char *  message 
)

This function replaces the interruption name and the message contained in an interruption value from specific values and a C nul-terminated string message.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe interruption value to update.
[in]nameThe new interruption extension name.
[in]messageThe new interruption message.

The interruption type is automatically set to PLUGIN_INTERRUPTION.

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 interruption.
FAILUREinterruption when the name parameter does not identify a plugin interruption.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_interruption
svm_value_type_get

◆ svm_value_interruption_set_external__string()

SVM_FUNCTION void svm_value_interruption_set_external__string ( const void *  svm,
SVM_Value_Interruption  value,
const SVM_Value_PluginEntryPoint  name,
const SVM_String  message 
)

This function replaces the interruption name and the message contained in an interruption value from specific values and a SVM_String message.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe interruption value to update.
[in]nameThe new interruption extension name.
[in]messageThe new interruption message.

The interruption type is automatically set to PLUGIN_INTERRUPTION.

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 interruption.
FAILUREinterruption when the name parameter does not identify a plugin interruption.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_interruption
svm_value_type_get

◆ svm_value_interruption_set_internal()

SVM_FUNCTION void svm_value_interruption_set_internal ( const void *  svm,
SVM_Value_Interruption  value,
const SVM_Interruption_Internal  type,
const SVM_Value_String  message,
const SVM_Interruption_Kind  kind 
)

This function replaces the interruption type, the message and the kind of interruption contained in an interruption value from specific values and a string value message.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe interruption value to update.
[in]typeThe new interruption type.
[in]messageThe new interruption message.
[in]kindThe new interruption kind.
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 interruption.
FAILUREinterruption when the value is a constant.
FAILUREinterruption when the interruption type is PLUGIN_INTERRUPTION.
See also
svm_value_type_is_interruption
svm_value_type_get

◆ svm_value_interruption_set_internal__raw()

SVM_FUNCTION void svm_value_interruption_set_internal__raw ( const void *  svm,
SVM_Value_Interruption  value,
const SVM_Interruption_Internal  type,
const char *  message,
const SVM_Interruption_Kind  kind 
)

This function replaces the interruption type, the message and the kind of interruption contained in an interruption value from specific values and a C nul-terminated string message.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe interruption value to update.
[in]typeThe new interruption type.
[in]messageThe new interruption message.
[in]kindThe new interruption kind.
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 interruption.
FAILUREinterruption when the value is a constant.
FAILUREinterruption when the interruption type is PLUGIN_INTERRUPTION.
See also
svm_value_type_is_interruption
svm_value_type_get

◆ svm_value_interruption_set_internal__string()

SVM_FUNCTION void svm_value_interruption_set_internal__string ( const void *  svm,
SVM_Value_Interruption  value,
const SVM_Interruption_Internal  type,
const SVM_String  message,
const SVM_Interruption_Kind  kind 
)

This function replaces the interruption type, the message and the kind of interruption contained in an interruption value from specific values and a SVM_String message.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe interruption value to update.
[in]typeThe new interruption type.
[in]messageThe new interruption message.
[in]kindThe new interruption kind.
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 interruption.
FAILUREinterruption when the value is a constant.
FAILUREinterruption when the interruption type is PLUGIN_INTERRUPTION.
See also
svm_value_type_is_interruption
svm_value_type_get

◆ svm_value_type_is_interruption()

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

This function checks whether a value contains an interruption.

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