Logo Search packages:      
Sourcecode: inkscape version File versions

enum CRStatus cr_om_parser_parse_paths_to_cascade ( CROMParser *  a_this,
const guchar *  a_author_path,
const guchar *  a_user_path,
const guchar *  a_ua_path,
enum CREncoding  a_encoding,
CRCascade **  a_result 
)

Parses three sheets located by their paths and build a cascade

Parameters:
a_this the current instance of CROMParser
a_author_path the path to the author stylesheet
a_user_path the path to the user stylesheet
a_ua_path the path to the User Agent stylesheet
a_result out parameter. The resulting cascade if the parsing was okay
Returns:
CR_OK upon successful completion, an error code otherwise

Definition at line 1000 of file cr-om-parser.c.

References cr_om_parser_parse_file().

Referenced by cr_om_parser_simply_parse_paths_to_cascade().

{
        enum CRStatus status = CR_OK;

        /*0->author sheet, 1->user sheet, 2->UA sheet */
        CRStyleSheet *sheets[3];
        guchar *paths[3];
        CRCascade *result = NULL;
        gint i = 0;

        g_return_val_if_fail (a_this, CR_BAD_PARAM_ERROR);

        memset (sheets, 0, sizeof (sheets));
        paths[0] = (guchar *) a_author_path;
        paths[1] = (guchar *) a_user_path;
        paths[2] = (guchar *) a_ua_path;

        for (i = 0; i < 3; i++) {
                status = cr_om_parser_parse_file (a_this, paths[i],
                                                  a_encoding, &sheets[i]);
                if (status != CR_OK) {
                        if (sheets[i]) {
                                cr_stylesheet_unref (sheets[i]);
                                sheets[i] = NULL;
                        }
                        continue;
                }
        }
        result = cr_cascade_new (sheets[0], sheets[1], sheets[2]);
        if (!result) {
                for (i = 0; i < 3; i++) {
                        cr_stylesheet_unref (sheets[i]);
                        sheets[i] = 0;
                }
                return CR_ERROR;
        }
        *a_result = result;
        return CR_OK;
}


Generated by  Doxygen 1.6.0   Back to index