/* Returns the newly built instance of #CRStatement or NULL if an error arises.  */
CRStatement* cr_statement_new_at_charset_rule(CRStyleSheet *a_sheet, CRString *a_charset)
/* Returns the newly built instance of #CRStatement or NULL if an error arises.  */
CRStatement* cr_statement_new_at_charset_rule(CRStyleSheet *a_sheet, CRString *a_charset)
{
        CRStatement *result = NULL;
        g_return_val_if_fail (a_charset, NULL);
        result = g_try_malloc (sizeof (CRStatement));
        if (!result) {
                cr_utils_trace_info ("Out of memory");
                return NULL;
        }
        memset (result, 0, sizeof (CRStatement));
        result->type = AT_CHARSET_RULE_STMT;
        result->kind.charset_rule = g_try_malloc (sizeof (CRAtCharsetRule));
        if (!result->kind.charset_rule) {
                cr_utils_trace_info ("Out of memory");
                g_free (result);
                return NULL;
        }
        memset (result->kind.charset_rule, 0, sizeof (CRAtCharsetRule));
        result->kind.charset_rule->charset = a_charset;
        cr_statement_set_parent_sheet (result, a_sheet);
        return result;
}