Hubbub $Id$
parserutilserror.h
Go to the documentation of this file.
1/*
2 * This file is part of Hubbub.
3 * Licensed under the MIT License,
4 * http://www.opensource.org/licenses/mit-license.php
5 * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
6 */
7
8#ifndef hubbub_utils_parserutilserror_h_
9#define hubbub_utils_parserutilserror_h_
10
11#include <parserutils/errors.h>
12
13#include <hubbub/errors.h>
14
21static inline hubbub_error hubbub_error_from_parserutils_error(
22 parserutils_error error)
23{
24 if (error == PARSERUTILS_OK)
25 return HUBBUB_OK;
26 else if (error == PARSERUTILS_NOMEM)
27 return HUBBUB_NOMEM;
28 else if (error == PARSERUTILS_BADPARM)
29 return HUBBUB_BADPARM;
30 else if (error == PARSERUTILS_INVALID)
31 return HUBBUB_INVALID;
32 else if (error == PARSERUTILS_FILENOTFOUND)
34 else if (error == PARSERUTILS_NEEDDATA)
35 return HUBBUB_NEEDDATA;
36 else if (error == PARSERUTILS_BADENCODING)
37 return HUBBUB_BADENCODING;
38 else if (error == PARSERUTILS_EOF)
39 return HUBBUB_OK;
40
41 return HUBBUB_UNKNOWN;
42}
43
44#endif
45
hubbub_error
Definition: errors.h:18
@ HUBBUB_FILENOTFOUND
Definition: errors.h:27
@ HUBBUB_NEEDDATA
Definition: errors.h:28
@ HUBBUB_BADENCODING
Definition: errors.h:29
@ HUBBUB_BADPARM
Definition: errors.h:25
@ HUBBUB_NOMEM
Definition: errors.h:24
@ HUBBUB_UNKNOWN
Definition: errors.h:31
@ HUBBUB_INVALID
Definition: errors.h:26
@ HUBBUB_OK
No error.
Definition: errors.h:19