gobj_create_gobj()

gobj_create_gobj()#

Creates a new GObj based on the specified GClass, name, and parent-child hierarchy.

Prototype

PUBLIC hgobj gobj_create_gobj(
    const char      *gobj_name,
    gclass_name_t   gclass_name,
    json_t          *kw, // owned
    hgobj           parent,
    gobj_flag_t     gobj_flag
);

Parameters

Key

Type

Description

gobj_name

const char *

The name of the GObj to be created.

gclass_name

gclass_name_t

The name of the GClass from which the GObj is instantiated.

kw

json_t *

JSON object containing attributes to initialize the GObj. This parameter is owned by the function.

parent

hgobj

Handle to the parent GObj. If NULL, the GObj is created without a parent.

gobj_flag

gobj_flag_t

Flags to modify the behavior of the GObj (e.g., gobj_flag_yuno, gobj_flag_service).

Return Value

  • Returns the handle (hgobj) to the created GObj.

  • Returns NULL if the creation fails.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples