Hubbub
errors.c
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 #include <string.h>
9 
10 #include <hubbub/errors.h>
11 
19 {
20  const char *result = NULL;
21 
22  switch (error) {
23  case HUBBUB_OK:
24  result = "No error";
25  break;
26  case HUBBUB_REPROCESS:
27  result = "Internal (reprocess token)";
28  break;
30  result = "Encoding of document has changed";
31  break;
32  case HUBBUB_PAUSED:
33  result = "Parser is paused";
34  break;
35  case HUBBUB_NOMEM:
36  result = "Insufficient memory";
37  break;
38  case HUBBUB_BADPARM:
39  result = "Bad parameter";
40  break;
41  case HUBBUB_INVALID:
42  result = "Invalid input";
43  break;
45  result = "File not found";
46  break;
47  case HUBBUB_NEEDDATA:
48  result = "Insufficient data";
49  break;
50  case HUBBUB_BADENCODING:
51  result = "Unsupported charset";
52  break;
53  case HUBBUB_UNKNOWN:
54  result = "Unknown error";
55  break;
56  }
57 
58  return result;
59 }
60 
const char * hubbub_error_to_string(hubbub_error error)
Convert a hubbub error code to a string.
Definition: errors.c:18
tokenisation is paused
Definition: errors.h:22
hubbub_error
Definition: errors.h:18
No error.
Definition: errors.h:19