Logo Search packages:      
Sourcecode: inkscape version File versions

enum CRStatus cr_om_parser_simply_parse_file ( const guchar *  a_file_path,
enum CREncoding  a_enc,
CRStyleSheet **  a_result 
)

The simpler method to parse a css2 file.

Parameters:
a_file_path the css2 local file path.
a_enc the file encoding.
a_result out parameter. The returned css stylesheet. Must be freed by the caller using cr_stylesheet_destroy.
Returns:
CR_OK upon successfull completion, an error code otherwise. Note that this method uses cr_om_parser_parse_file() so both methods have the same return values.

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

References cr_om_parser_destroy(), cr_om_parser_new(), cr_om_parser_parse_file(), and cr_utils_trace_info.

{
        CROMParser *parser = NULL;
        enum CRStatus status = CR_OK;

        parser = cr_om_parser_new (NULL);
        if (!parser) {
                cr_utils_trace_info ("Could not allocate om parser");
                cr_utils_trace_info ("System may be out of memory");
                return CR_ERROR;
        }

        status = cr_om_parser_parse_file (parser, a_file_path,
                                          a_enc, a_result);
        if (parser) {
                cr_om_parser_destroy (parser);
                parser = NULL;
        }

        return status;
}


Generated by  Doxygen 1.6.0   Back to index