Simple Virtual Machine A simple but flexible virtual machine

Functions
SVM machine

This module contains API functions to handle the SVM machine. More...

## Functions
SVM_FUNCTION void | svm_machine_shutdown (const void *svm, const SVM_Value_Integer return_code)
| This function shuts down the whole machine, with a return code as an integer value. More...
SVM_FUNCTION void | svm_machine_shutdown__raw (const void *svm, const unsigned long int return_code)
| This function shuts down the whole machine, with a return code as a raw integer. More...
SVM_FUNCTION void | svm_machine_trace (const void *svm, const SVM_Value_String trace)
| This function emits an error trace on the logger from a string value. More...
SVM_FUNCTION void | svm_machine_trace__string (const void *svm, const SVM_String trace)
| This function emits an error trace on the logger from a string. More...
SVM_FUNCTION void | svm_machine_trace__raw (const void *svm, const char *trace)
| This function emits an error trace on the logger from a raw C string. More...
SVM_FUNCTION SVM_Value_Interruption * | svm_machine_list_interruption (const void *svm)
| This function returns the list of available interruptions. More...
SVM_FUNCTION SVM_String | svm_machine_config (const void *svm, const char *key)
| This function returns a value from the virtual machine installation. More...
SVM_FUNCTION SVM_Boolean | svm_machine_mode_is_debug (const void *svm)
| This function indicates when the virtual machine is executed in debug mode. More...
SVM_FUNCTION SVM_Boolean | svm_machine_mode_is_performance (const void *svm)
| This function indicates when the virtual machine is executed in performance mode. More...

## Detailed Description

This module contains API functions to handle the SVM machine.

## Function Documentation

## ◆ svm_machine_config()

SVM_FUNCTION SVM_String svm_machine_config | ( | const void * | svm,
|  | const char * | key
| ) |  |

This function returns a value from the virtual machine installation.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | key | The key of the configuration to get.

Returns
  A string containing the value when the key is defined.

Exceptions

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

## ◆ svm_machine_list_interruption()

SVM_FUNCTION SVM_Value_Interruption * svm_machine_list_interruption | ( | const void * | svm | ) |

This function returns the list of available interruptions.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.

Internal and external interruptions are returned.

Returns
  A pointer to a C array of SVM_Value_Interruption, terminated by a C/C++ null pointer.

Note
  The returned array is a valid SVM variable: its scope can be changed if needed, and the pointer shall not be freed explicitely.

Exceptions

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

## ◆ svm_machine_mode_is_debug()

SVM_FUNCTION SVM_Boolean svm_machine_mode_is_debug | ( | const void * | svm | ) |

This function indicates when the virtual machine is executed in debug mode.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.

Returns
  A boolean set to TRUE when the debugger is activated, and FALSE otherwise.

Exceptions

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

## ◆ svm_machine_mode_is_performance()

SVM_FUNCTION SVM_Boolean svm_machine_mode_is_performance | ( | const void * | svm | ) |

This function indicates when the virtual machine is executed in performance mode.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.

Returns
  A boolean set to TRUE when the profiler is activated, and FALSE otherwise.

Exceptions

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

## ◆ svm_machine_shutdown()

SVM_FUNCTION void svm_machine_shutdown | ( | const void * | svm,
|  | const SVM_Value_Integer | return_code
| ) |  |

This function shuts down the whole machine, with a return code as an integer value.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | return_code | The return code of the virtual machine.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  SECURITY | interruption when this API function is called outside a system instruction.

## ◆ svm_machine_shutdown__raw()

SVM_FUNCTION void svm_machine_shutdown__raw | ( | const void * | svm,
|  | const unsigned long int | return_code
| ) |  |

This function shuts down the whole machine, with a return code as a raw integer.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | return_code | The return code of the virtual machine.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  SECURITY | interruption when this API function is called outside a system instruction.

## ◆ svm_machine_trace()

SVM_FUNCTION void svm_machine_trace | ( | const void * | svm,
|  | const SVM_Value_String | trace
| ) |  |

This function emits an error trace on the logger from a string value.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | trace | The trace to emit.

Exceptions

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

## ◆ svm_machine_trace__raw()

SVM_FUNCTION void svm_machine_trace__raw | ( | const void * | svm,
|  | const char * | trace
| ) |  |

This function emits an error trace on the logger from a raw C string.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | trace | The trace to emit.

Exceptions

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

## ◆ svm_machine_trace__string()

SVM_FUNCTION void svm_machine_trace__string | ( | const void * | svm,
|  | const SVM_String | trace
| ) |  |

This function emits an error trace on the logger from a string.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | trace | The trace to emit.

Exceptions

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