From 4e850413037c618ed375ac0b988dbe1bc12ca0fd Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 9 Nov 2008 18:25:20 +0000 Subject: Convert PARSERUTILS_BADENCODING into HUBBUB_BADENCODING svn path=/trunk/hubbub/; revision=5667 --- include/hubbub/errors.h | 3 ++- src/utils/errors.c | 3 +++ src/utils/parserutilserror.h | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/hubbub/errors.h b/include/hubbub/errors.h index 6398766..dd137ae 100644 --- a/include/hubbub/errors.h +++ b/include/hubbub/errors.h @@ -21,8 +21,9 @@ typedef enum hubbub_error { HUBBUB_INVALID = 7, HUBBUB_FILENOTFOUND = 8, HUBBUB_NEEDDATA = 9, + HUBBUB_BADENCODING = 10, - HUBBUB_UNKNOWN = 10 + HUBBUB_UNKNOWN = 11 } hubbub_error; /* Convert a hubbub error value to a string */ diff --git a/src/utils/errors.c b/src/utils/errors.c index cded6be..722fbd0 100644 --- a/src/utils/errors.c +++ b/src/utils/errors.c @@ -47,6 +47,9 @@ const char *hubbub_error_to_string(hubbub_error error) case HUBBUB_NEEDDATA: result = "Insufficient data"; break; + case HUBBUB_BADENCODING: + result = "Unsupported charset"; + break; case HUBBUB_UNKNOWN: result = "Unknown error"; break; diff --git a/src/utils/parserutilserror.h b/src/utils/parserutilserror.h index 9e0c8f5..4b1b99e 100644 --- a/src/utils/parserutilserror.h +++ b/src/utils/parserutilserror.h @@ -33,6 +33,8 @@ static inline hubbub_error hubbub_error_from_parserutils_error( return HUBBUB_FILENOTFOUND; else if (error == PARSERUTILS_NEEDDATA) return HUBBUB_NEEDDATA; + else if (error == PARSERUTILS_BADENCODING) + return HUBBUB_BADENCODING; return HUBBUB_UNKNOWN; } -- cgit v1.2.3