## Operating on JavaScript types Operating on JavaScript types — Determining the type of a SeedValue |

## Synopsis

    #include <seed/seed.h>

    void                seed_value_unprotect                (SeedContext ctx,
                                                             SeedValue value);
    void                seed_value_protect                  (SeedContext ctx,
                                                             SeedValue value);
    gboolean            seed_value_is_undefined             (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_number                (SeedContext ctx,
                                                             SeedValue value);
    gboolean            seed_value_is_string                (SeedContext ctx,
                                                             SeedValue value);
    gboolean            seed_value_is_object_of_class       (SeedContext ctx,
                                                             SeedValue value,
                                                             SeedClass klass);
    gboolean            seed_value_is_object                (SeedContext ctx,
                                                             SeedValue value);
    SeedType            seed_value_get_type                 (SeedContext ctx,
                                                             SeedValue value);

## Description

Long description

## Details

### 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_undefined ()

    gboolean            seed_value_is_undefined             (SeedContext ctx,
                                                             SeedValue value);

Determine whether or not `value` represents the JavaScript undefined value

`ctx` : | A SeedContext.
`value` : | A SeedValue.
Returns : | A gboolean (`true` if `value` is 'undefined')

### seed_value_is_null ()

    gboolean            seed_value_is_null                  (SeedContext ctx,
                                                             SeedValue value);

Determine whether or not `value` represents the JavaScript null value

`ctx` : | A SeedContext.
`value` : | A SeedValue.
Returns : | A gboolean (`true` if `value` is 'null')

### seed_value_is_function ()

    gboolean            seed_value_is_function              (SeedContext ctx,
                                                             SeedObject value);

Determine whether or not `value` is a JavaScript function (and, therefore, an object)

`ctx` : | A SeedContext.
`value` : | A SeedValue.
Returns : | A gboolean (`true` if `value` is a function)

### seed_value_is_number ()

    gboolean            seed_value_is_number                (SeedContext ctx,
                                                             SeedValue value);

Determine whether or not `value` is a JavaScript number

`ctx` : | A SeedContext.
`value` : | A SeedValue.
Returns : | A gboolean (`true` if `value` is a number)

### seed_value_is_string ()

    gboolean            seed_value_is_string                (SeedContext ctx,
                                                             SeedValue value);

Determine whether or not `value` is a JavaScript string

`ctx` : | A SeedContext.
`value` : | A SeedValue.
Returns : | A gboolean (`true` if `value` is a string)

### seed_value_is_object_of_class ()

    gboolean            seed_value_is_object_of_class       (SeedContext ctx,
                                                             SeedValue value,
                                                             SeedClass klass);

Determine whether or not `value` is an object of the specified class

`ctx` : | A SeedContext.
`value` : | A SeedValue.
`klass` : | A SeedClass.
Returns : | A gboolean (`true` if `value` is of class `klass`)

### seed_value_is_object ()

    gboolean            seed_value_is_object                (SeedContext ctx,
                                                             SeedValue value);

Determine whether or not `value` is a JavaScript object

`ctx` : | A SeedContext.
`value` : | A SeedValue.
Returns : | A gboolean (`true` if `value` is an object)

### seed_value_get_type ()

    SeedType            seed_value_get_type                 (SeedContext ctx,
                                                             SeedValue value);

`ctx` : | A valid SeedContext
`value` : | A SeedValue
Returns : | The type of `value`