SeedValue

SeedValue — Conversion between, and manipulation of, Seed and C types.

Synopsis


#include <seed/seed.h>

typedef             SeedValue;
void                seed_value_unprotect                (SeedContext ctx,
                                                         SeedValue value);
void                seed_value_protect                  (SeedContext ctx,
                                                         SeedValue value);
gboolean            seed_value_is_null                  (SeedContext ctx,
                                                         SeedValue value);
gboolean            seed_value_is_function              (SeedContext ctx,
                                                         SeedObject value);
gboolean            seed_value_is_object                (SeedContext ctx,
                                                         SeedValue value);
gboolean            seed_value_to_boolean               (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_boolean             (SeedContext ctx,
                                                         gboolean val,
                                                         SeedException *exception);
guint               seed_value_to_uint                  (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_uint                (SeedContext ctx,
                                                         guint val,
                                                         SeedException *exception);
gint                seed_value_to_int                   (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_int                 (SeedContext ctx,
                                                         gint val,
                                                         SeedException *exception);
gchar               seed_value_to_char                  (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_char                (SeedContext ctx,
                                                         gchar val,
                                                         SeedException *exception);
guchar              seed_value_to_uchar                 (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_uchar               (SeedContext ctx,
                                                         guchar val,
                                                         SeedException *exception);
glong               seed_value_to_long                  (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_long                (SeedContext ctx,
                                                         glong val,
                                                         SeedException *exception);
gulong              seed_value_to_ulong                 (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_ulong               (SeedContext ctx,
                                                         gulong val,
                                                         SeedException *exception);
gint64              seed_value_to_int64                 (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_int64               (SeedContext ctx,
                                                         gint64 val,
                                                         SeedException *exception);
guint64             seed_value_to_uint64                (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_uint64              (SeedContext ctx,
                                                         guint64 val,
                                                         SeedException *exception);
gfloat              seed_value_to_float                 (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_float               (SeedContext ctx,
                                                         gfloat val,
                                                         SeedException *exception);
gdouble             seed_value_to_double                (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_double              (SeedContext ctx,
                                                         gdouble val,
                                                         SeedException *exception);
gchar *             seed_value_to_string                (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_string              (SeedContext ctx,
                                                         gchar *val,
                                                         SeedException *exception);
GObject *           seed_value_to_object                (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);
SeedValue           seed_value_from_object              (SeedContext ctx,
                                                         GObject *val,
                                                         SeedException *exception);
gchar *             seed_value_to_filename              (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedValue *exception);
SeedValue           seed_value_from_filename            (SeedContext ctx,
                                                         const gchar *filename,
                                                         SeedValue *exception);

Description

Details

SeedValue

typedef gpointer SeedValue;


seed_value_unprotect ()

void                seed_value_unprotect                (SeedContext ctx,
                                                         SeedValue value);

Decrements the "protection count" of value, as explained in seed_value_protect().

ctx :

A SeedContext.

value :

The SeedValue to unprotect.

seed_value_protect ()

void                seed_value_protect                  (SeedContext ctx,
                                                         SeedValue value);

Increments the "protection count" of value, in case you want to store a reference somewhere where the garbage collector won't be able to find it, and don't want it to be collected!

In order for value to be collected afterwards, it will need to be unprotected the same number of times with seed_value_unprotect().

ctx :

A SeedContext.

value :

The SeedValue to protect.

seed_value_is_null ()

gboolean            seed_value_is_null                  (SeedContext ctx,
                                                         SeedValue value);

ctx :

A SeedContext.

value :

A SeedValue.

Returns :

true if value represents NULL, false otherwise.

seed_value_is_function ()

gboolean            seed_value_is_function              (SeedContext ctx,
                                                         SeedObject value);

ctx :

A SeedContext.

value :

A SeedObject.

Returns :

true if value is a function (and therefore, an object), false otherwise.

seed_value_is_object ()

gboolean            seed_value_is_object                (SeedContext ctx,
                                                         SeedValue value);

ctx :

A SeedContext.

value :

A SeedValue.

Returns :

true if value is an object, false otherwise.

seed_value_to_boolean ()

gboolean            seed_value_to_boolean               (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The SeedValue to convert.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

The gboolean represented by val, or NULL if an exception is raised during the conversion.

seed_value_from_boolean ()

SeedValue           seed_value_from_boolean             (SeedContext ctx,
                                                         gboolean val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The gboolean to represent.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

A SeedValue which represents val, or NULL if an exception is raised during the conversion.

seed_value_to_uint ()

guint               seed_value_to_uint                  (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The SeedValue to convert.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

The guint represented by val, or NULL if an exception is raised during the conversion.

seed_value_from_uint ()

SeedValue           seed_value_from_uint                (SeedContext ctx,
                                                         guint val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The guint to represent.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

A SeedValue which represents val, or NULL if an exception is raised during the conversion.

seed_value_to_int ()

gint                seed_value_to_int                   (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The SeedValue to convert.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

The gint represented by val, or NULL if an exception is raised during the conversion.

seed_value_from_int ()

SeedValue           seed_value_from_int                 (SeedContext ctx,
                                                         gint val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The gint to represent.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

A SeedValue which represents val, or NULL if an exception is raised during the conversion.

seed_value_to_char ()

gchar               seed_value_to_char                  (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The SeedValue to convert.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

The gchar represented by val, or NULL if an exception is raised during the conversion.

seed_value_from_char ()

SeedValue           seed_value_from_char                (SeedContext ctx,
                                                         gchar val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The gchar to represent.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

A SeedValue which represents val, or NULL if an exception is raised during the conversion.

seed_value_to_uchar ()

guchar              seed_value_to_uchar                 (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The SeedValue to convert.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

The guchar represented by val, or NULL if an exception is raised during the conversion.

seed_value_from_uchar ()

SeedValue           seed_value_from_uchar               (SeedContext ctx,
                                                         guchar val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The guchar to represent.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

A SeedValue which represents val, or NULL if an exception is raised during the conversion.

seed_value_to_long ()

glong               seed_value_to_long                  (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The SeedValue to convert.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

The glong represented by val, or NULL if an exception is raised during the conversion.

seed_value_from_long ()

SeedValue           seed_value_from_long                (SeedContext ctx,
                                                         glong val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The glong to represent.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

A SeedValue which represents val, or NULL if an exception is raised during the conversion.

seed_value_to_ulong ()

gulong              seed_value_to_ulong                 (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The SeedValue to convert.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

The gulong represented by val, or NULL if an exception is raised during the conversion.

seed_value_from_ulong ()

SeedValue           seed_value_from_ulong               (SeedContext ctx,
                                                         gulong val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The gulong to represent.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

A SeedValue which represents val, or NULL if an exception is raised during the conversion.

seed_value_to_int64 ()

gint64              seed_value_to_int64                 (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The SeedValue to convert.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

The gint64 represented by val, or NULL if an exception is raised during the conversion.

seed_value_from_int64 ()

SeedValue           seed_value_from_int64               (SeedContext ctx,
                                                         gint64 val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The gint64 to represent.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

A SeedValue which represents val, or NULL if an exception is raised during the conversion.

seed_value_to_uint64 ()

guint64             seed_value_to_uint64                (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The SeedValue to convert.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

The guint64 represented by val, or NULL if an exception is raised during the conversion.

seed_value_from_uint64 ()

SeedValue           seed_value_from_uint64              (SeedContext ctx,
                                                         guint64 val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The guint64 to represent.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

A SeedValue which represents val, or NULL if an exception is raised during the conversion.

seed_value_to_float ()

gfloat              seed_value_to_float                 (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The SeedValue to convert.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

The gfloat represented by val, or NULL if an exception is raised during the conversion.

seed_value_from_float ()

SeedValue           seed_value_from_float               (SeedContext ctx,
                                                         gfloat val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The gfloat to represent.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

A SeedValue which represents val, or NULL if an exception is raised during the conversion.

seed_value_to_double ()

gdouble             seed_value_to_double                (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The SeedValue to convert.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

The gdouble represented by val, or NULL if an exception is raised during the conversion.

seed_value_from_double ()

SeedValue           seed_value_from_double              (SeedContext ctx,
                                                         gdouble val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The gdouble to represent.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

A SeedValue which represents val, or NULL if an exception is raised during the conversion.

seed_value_to_string ()

gchar *             seed_value_to_string                (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The SeedValue to convert.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

The gchar* represented by val, or NULL if an exception is raised during the conversion.

seed_value_from_string ()

SeedValue           seed_value_from_string              (SeedContext ctx,
                                                         gchar *val,
                                                         SeedException *exception);

ctx :

A SeedContext.

val :

The gchar* to represent.

exception :

A reference to a SeedValue in which to store any exceptions. Pass NULL to ignore exceptions.

Returns :

A SeedValue which represents val, or NULL if an exception is raised during the conversion.

seed_value_to_object ()

GObject *           seed_value_to_object                (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedException *exception);

ctx :

val :

exception :

Returns :


seed_value_from_object ()

SeedValue           seed_value_from_object              (SeedContext ctx,
                                                         GObject *val,
                                                         SeedException *exception);

ctx :

val :

exception :

Returns :


seed_value_to_filename ()

gchar *             seed_value_to_filename              (SeedContext ctx,
                                                         SeedValue val,
                                                         SeedValue *exception);

ctx :

val :

exception :

Returns :


seed_value_from_filename ()

SeedValue           seed_value_from_filename            (SeedContext ctx,
                                                         const gchar *filename,
                                                         SeedValue *exception);

ctx :

filename :

exception :

Returns :