コード例 #1
0
ファイル: translate.c プロジェクト: Roghetti/ServiceManager
prop_list rpc_property_array_to_property_list (rpc_property_t rplist[],
                                               unsigned int length)
{
    RETURN_IF_NULL (rplist);
    register unsigned rp_index;
    prop_list box = List_new ();

    if (length == 0)
        return box;

    for (rp_index = 0; rp_index < length; rp_index++)
    {
        prop_list_add (box, rpc_property_to_property (&rplist[rp_index]));
    }

    return box;
}
コード例 #2
0
ファイル: object.c プロジェクト: Prospero86/ServiceManager
void svc_object_set_property_int (svc_t * Svc, const char * key, long value)
{
    if ((!key) | (!Svc))
        return;
    DestroyPropIfExists (Svc->properties, key);
    svc_id_t rnum;
    property_t * newProp = calloc (1, sizeof (property_t));

    newProp->name = strdup (key);
    while (prop_find_id (Svc->properties, rnum))
        rnum = rand ();
    newProp->id = rnum;
    newProp->value.type = NUMBER;
    newProp->value.pval_u.i = value;

    prop_list_add (Svc->properties, newProp);
}