Logo Search packages:      
Sourcecode: inkscape version File versions

CRDeclaration* cr_declaration_new ( CRStatement *  a_statement,
CRString *  a_property,
CRTerm a_value 
)

Constructor of CRDeclaration.

Parameters:
a_property the property string of the declaration
a_value the value expression of the declaration.
Returns:
the newly built instance of CRDeclaration, or NULL in case of error.

Definition at line 62 of file cr-declaration.c.

References AT_FONT_FACE_RULE_STMT, AT_PAGE_RULE_STMT, cr_term_ref(), and cr_utils_trace_info.

Referenced by cr_declaration_append2(), cr_declaration_parse_from_buf(), and cr_declaration_parse_list_from_buf().

{
        g_return_val_if_fail (a_property, NULL);

        if (a_statement)
                g_return_val_if_fail (a_statement
                                      && ((a_statement->type == RULESET_STMT)
                                          || (a_statement->type
                                              == AT_FONT_FACE_RULE_STMT)
                                          || (a_statement->type
                                              == AT_PAGE_RULE_STMT)), NULL);

        CRDeclaration * result = (CRDeclaration *)g_try_malloc (sizeof (CRDeclaration));
        if (!result) {
                cr_utils_trace_info ("Out of memory");
                return NULL;
        }
        memset (result, 0, sizeof (CRDeclaration));
        result->property = a_property;
        result->value = a_value;

        if (a_value) {
                cr_term_ref (a_value);
        }
        result->parent_statement = a_statement;
        return result;
}


Generated by  Doxygen 1.6.0   Back to index