1 /* 2 * This file is part of LibParserUtils. 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 parserutils_errors_h_ 9 #define parserutils_errors_h_ 10 11 #ifdef __cplusplus 12 extern "C" 13 { 14 #endif 15 16 #include <stddef.h> 17 18 typedef enum parserutils_error { 19 PARSERUTILS_OK = 0, 20 21 PARSERUTILS_NOMEM = 1, 22 PARSERUTILS_BADPARM = 2, 23 PARSERUTILS_INVALID = 3, 24 PARSERUTILS_FILENOTFOUND = 4, 25 PARSERUTILS_NEEDDATA = 5, 26 PARSERUTILS_BADENCODING = 6, 27 PARSERUTILS_EOF = 7 28 } parserutils_error; 29 30 /* Convert a parserutils error value to a string */ 31 const char *parserutils_error_to_string(parserutils_error error); 32 /* Convert a string to a parserutils error value */ 33 parserutils_error parserutils_error_from_string(const char *str, size_t len); 34 35 #ifdef __cplusplus 36 } 37 #endif 38 39 #endif 40 41