Table Of Contents

Previous topic

SObjectClass Functions

Next topic

Macros

SObject Primitives

Primitive data types (int, float, string) and void types as SObjects.

Summary

SObjectSetInt Create a new SObject from a signed integer.
SObjectResetInt Change the data value (singed integer) of an SObject that has been previously created by SObjectSetInt.
SObjectGetInt Get the signed integer of the SObject object.
SObjectSetFloat Create a new SObject from a float.
SObjectResetFloat Change the data value (float) of an SObject that has been previously created by SObjectSetFloat.
SObjectGetFloat Get the float of the SObject object.
SObjectSetString Create a new SObject from a character string.
SObjectResetString Change the data value (string) of an SObject that has been previously created by SObjectSetString.
SObjectGetString Get the string of the SObject object.
SObjectSetVoid Create a new SObject from a void pointer.
SObjectResetVoid Change the pointer of an SObject that has been previously created by SObjectSetVoid.
SObjectGetVoid Get the void pointer of the SObject object.

Integer

SObject *SObjectSetInt(sint32 i, s_erc *error)

Create a new SObject from a signed integer.

Parameters:
  • i

    The signed integer value.

  • error

    Error code.

Return:

Pointer to the newly created SObject (of type SInt).

void SObjectResetInt(SObject *self, sint32 i, s_erc *error)

Change the data value (singed integer) of an SObject that has been previously created by SObjectSetInt.

Parameters:
  • self

    The SInt type SObject.

  • i

    The new signed integer value.

  • error

    Error code.

sint32 SObjectGetInt(const SObject *self, s_erc *error)

Get the signed integer of the SObject object.

Parameters:
  • self

    The SObject (of type SInt).

  • error

    Error code.

Return:

The signed integer value.

Float

SObject *SObjectSetFloat(float f, s_erc *error)

Create a new SObject from a float.

Parameters:
  • f

    The float value.

  • error

    Error code.

Return:

Pointer to the newly created SObject (of type SFloat).

void SObjectResetFloat(SObject *self, float f, s_erc *error)

Change the data value (float) of an SObject that has been previously created by SObjectSetFloat.

Parameters:
  • self

    The SFloat type SObject.

  • f

    The new float value.

  • error

    Error code.

float SObjectGetFloat(const SObject *self, s_erc *error)

Get the float of the SObject object.

Parameters:
  • self

    The SObject (of type SFloat).

  • error

    Error code.

Return:

The float value.

String

SObject *SObjectSetString(const char *s, s_erc *error)

Create a new SObject from a character string.

Parameters:
  • s

    Pointer to the string.

  • error

    Error code.

Return:

Pointer to the newly created SObject (of type SString).

Note:

The string is copied and not referenced.

void SObjectResetString(SObject *self, const char *s, s_erc *error)

Change the data value (string) of an SObject that has been previously created by SObjectSetString.

Parameters:
  • self

    The SString type SObject.

  • s

    Pointer to the new string.

  • error

    Error code.

const char *SObjectGetString(const SObject *self, s_erc *error)

Get the string of the SObject object.

Parameters:
  • self

    The SObject (of type SString).

  • error

    Error code.

Return:

Pointer to the string.

Void

SObject *SObjectSetVoid(void *ptr, const char *type_name, s_svoid_free_fp free_func, s_erc *error)

Create a new SObject from a void pointer.

Parameters:
  • ptr

    Pointer to the object.

  • type_name

    An identifier for this void object type. Used for safety checks.

  • free_func

    A callback function used to free the object.

  • error

    Error code.

Return:

Pointer to the newly created SObject.

Note:

The type_name is copied and not referenced.

void SObjectResetVoid(SObject *self, void *ptr, const char *type_name, s_svoid_free_fp free_func, s_erc *error)

Change the pointer of an SObject that has been previously created by SObjectSetVoid.

Parameters:
  • self

    The SObject.

  • ptr

    Pointer to the new object.

  • type_name

    An identifier for this void object type. Used for safety checks.

  • free_func

    A callback function used to free the object.

  • error

    Error code.

Note:

The type_name is copied and not referenced.

const void *SObjectGetVoid(const SObject *self, const char *type_name, s_erc *error)

Get the void pointer of the SObject object.

Parameters:
  • self

    The SObject.

  • type_name

    An identifier for this void object type. Used for safety checks.

  • error

    Error code.

Return:

Void pointer.

typedef void(*s_svoid_free_fp)(void *ptr, s_erc *error)

The SVoid SObject type free function typedef.

A pointer to a function that frees the data of the SVoid type SObject void pointer.

Parameters:
  • ptr

    The void type pointer data to free.

  • error

    Error code.