示例#1
0
/**************************************************************
 * constructor/destructor
 **************************************************************/
v_cfElement
v_cfElementNew (
    v_configuration config,
    const c_char *tagName)
{
    v_cfElement el;

    assert(C_TYPECHECK(config, v_configuration));
    assert(tagName != NULL);

    el = v_cfElement(v_cfNodeNew(config, V_CFELEMENT));
    v_cfElementInit(el, config, tagName);

    return el;
}
示例#2
0
/**************************************************************
 * constructor/destructor
 **************************************************************/
v_cfData
v_cfDataNew (
    v_configuration config,
    c_value value)
{
    v_cfData data;

    assert(C_TYPECHECK(config, v_configuration));
    assert(value.kind != V_UNDEFINED);

    data = v_cfData(v_cfNodeNew(config, V_CFDATA));
    v_cfDataInit(data, config, value);

    if (data->value.kind == V_UNDEFINED) {
        c_free(data);
        data = NULL;
    }

    return data;
}
示例#3
0
/**************************************************************
 * constructor/destructor
 **************************************************************/
v_cfAttribute
v_cfAttributeNew (
    v_configuration config,
    const c_char *name,
    c_value value)
{
    v_cfAttribute attr;

    assert(C_TYPECHECK(config, v_configuration));
    assert(name != NULL);

    if (value.kind != V_UNDEFINED) {
        attr = v_cfAttribute(v_cfNodeNew(config, V_CFATTRIBUTE));
        v_cfAttributeInit(attr, config, name, value);
    } else {
        attr = NULL;
    }

    return attr;
}