Simple Virtual Machine A simple but flexible virtual machine

Functions
SVM types

This module contains API functions to handle SVM types. More...

## Functions
SVM_FUNCTION SVM_Type | svm_type_new_internal (const void *svm, const SVM_Type_Internal internal)
| This function creates an internal value type. More...
SVM_FUNCTION SVM_Type | svm_type_new_external (const void *svm, const SVM_Value_PluginEntryPoint external)
| This function creates an external value type. More...
SVM_FUNCTION SVM_Boolean | svm_type_is_internal (const void *svm, const SVM_Type type)
| This function indicates whether a type contains an internal value type. More...
SVM_FUNCTION SVM_Boolean | svm_type_is_external (const void *svm, const SVM_Type type)
| This function indicates whether a type contains an external value type. More...
SVM_FUNCTION SVM_Type_Internal | svm_type_get_internal (const void *svm, const SVM_Type type)
| This function retrieves the internal type from a type. More...
SVM_FUNCTION SVM_Value_PluginEntryPoint | svm_type_get_external (const void *svm, const SVM_Type type)
| This function retrieves the external type from a type. More...
SVM_FUNCTION SVM_Type | svm_type_copy (const void *svm, const SVM_Type type)
| This function creates a copy of a type. More...
SVM_FUNCTION SVM_String | svm_type_print (const void *svm, const SVM_Type type)
| This function renders a type as a string. More...
SVM_FUNCTION SVM_Boolean | svm_type_equal_internal (const void *svm, const SVM_Type type, const SVM_Type_Internal internal)
| This function checks whether a type is a specific internal type. More...
SVM_FUNCTION SVM_Boolean | svm_type_equal_external (const void *svm, const SVM_Type type, const SVM_Value_PluginEntryPoint external)
| This function checks whether a type is a specific external type. More...
SVM_FUNCTION SVM_Comparison_Result | svm_type_compare (const void *svm, const SVM_Type left, const SVM_Type right)
| This function compares two types. More...

## Detailed Description

This module contains API functions to handle SVM types.

Types are a main characteristic of values, indicating which operations can be applied to values.

See also
  SVM values

## Function Documentation

## ◆ svm_type_compare()

SVM_FUNCTION SVM_Comparison_Result svm_type_compare | ( | const void * | svm,
|  | const SVM_Type | left,
|  | const SVM_Type | right
| ) |  |

This function compares two types.

Parameters

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

Returns
  The comparison status of the two values.

Exceptions

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

See also
  SVM_Comparison_Result

## ◆ svm_type_copy()

SVM_FUNCTION SVM_Type svm_type_copy | ( | const void * | svm,
|  | const SVM_Type | type
| ) |  |

This function creates a copy of a type.

Parameters

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

Returns
  The copy of the type.

Exceptions

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

## ◆ svm_type_equal_external()

SVM_FUNCTION SVM_Boolean svm_type_equal_external | ( | const void * | svm,
|  | const SVM_Type | type,
|  | const SVM_Value_PluginEntryPoint | external
| ) |  |

This function checks whether a type is a specific external type.

Parameters

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

Returns
  TRUE when the type is the given external type, and FALSE otherwise.

Note
  When the type is an internal type, FALSE is returned.

Exceptions

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

## ◆ svm_type_equal_internal()

SVM_FUNCTION SVM_Boolean svm_type_equal_internal | ( | const void * | svm,
|  | const SVM_Type | type,
|  | const SVM_Type_Internal | internal
| ) |  |

This function checks whether a type is a specific internal type.

Parameters

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

Returns
  TRUE when the type is the given internal type, and FALSE otherwise.

Note
  When the type is an external type, FALSE is returned.

Exceptions

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

## ◆ svm_type_get_external()

SVM_FUNCTION SVM_Value_PluginEntryPoint svm_type_get_external | ( | const void * | svm,
|  | const SVM_Type | type
| ) |  |

This function retrieves the external type from a type.

Parameters

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

Returns
  The external type.

Exceptions

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

## ◆ svm_type_get_internal()

SVM_FUNCTION SVM_Type_Internal svm_type_get_internal | ( | const void * | svm,
|  | const SVM_Type | type
| ) |  |

This function retrieves the internal type from a type.

Parameters

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

Returns
  The internal type.

Exceptions

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

## ◆ svm_type_is_external()

SVM_FUNCTION SVM_Boolean svm_type_is_external | ( | const void * | svm,
|  | const SVM_Type | type
| ) |  |

This function indicates whether a type contains an external value type.

Parameters

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

Returns
  TRUE if the type contains an external type, FALSE otherwise.

Exceptions

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

## ◆ svm_type_is_internal()

SVM_FUNCTION SVM_Boolean svm_type_is_internal | ( | const void * | svm,
|  | const SVM_Type | type
| ) |  |

This function indicates whether a type contains an internal value type.

Parameters

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

Returns
  TRUE if the type contains an internal type, FALSE otherwise.

Exceptions

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

## ◆ svm_type_new_external()

SVM_FUNCTION SVM_Type svm_type_new_external | ( | const void * | svm,
|  | const SVM_Value_PluginEntryPoint | external
| ) |  |

This function creates an external value type.

Parameters

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

Returns
  The type containing the external type.

Exceptions

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

## ◆ svm_type_new_internal()

SVM_FUNCTION SVM_Type svm_type_new_internal | ( | const void * | svm,
|  | const SVM_Type_Internal | internal
| ) |  |

This function creates an internal value type.

Parameters

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

Returns
  The type containing the internal type.

Exceptions

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

## ◆ svm_type_print()

SVM_FUNCTION SVM_String svm_type_print | ( | const void * | svm,
|  | const SVM_Type | type
| ) |  |

This function renders a type as a string.

Parameters

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

Returns
  The string representation of the type.

Exceptions

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