blob: 3e055248cb481350335773b9cb504667b60bd1a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/*
* This file is part of Hubbub.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
* Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
*/
#ifndef hubbub_utils_parserutilserror_h_
#define hubbub_utils_parserutilserror_h_
#include <parserutils/errors.h>
#include <hubbub/errors.h>
/**
* Convert a ParserUtils error into a LibCSS error
*
* \param error The ParserUtils error to convert
* \return The corresponding LibCSS error
*/
static inline hubbub_error hubbub_error_from_parserutils_error(
parserutils_error error)
{
if (error == PARSERUTILS_OK)
return HUBBUB_OK;
else if (error == PARSERUTILS_NOMEM)
return HUBBUB_NOMEM;
else if (error == PARSERUTILS_BADPARM)
return HUBBUB_BADPARM;
else if (error == PARSERUTILS_INVALID)
return HUBBUB_INVALID;
else if (error == PARSERUTILS_FILENOTFOUND)
return HUBBUB_FILENOTFOUND;
else if (error == PARSERUTILS_NEEDDATA)
return HUBBUB_NEEDDATA;
return HUBBUB_UNKNOWN;
}
#endif
|