/* Returns the newly built instance of #CRDeclaration, or NULL in case of error.  */
CRDeclaration* cr_declaration_new(CRStatement *a_statement, CRString *a_property, CRTerm *a_value)
/* Returns the newly built instance of #CRDeclaration, or NULL in case of error.  */
CRDeclaration* cr_declaration_new(CRStatement *a_statement, CRString *a_property, CRTerm *a_value)
{
        CRDeclaration *result = NULL;
        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);
        result = 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;
}