summaryrefslogtreecommitdiff
path: root/src/zscanner/error.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/zscanner/error.h')
-rw-r--r--src/zscanner/error.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/src/zscanner/error.h b/src/zscanner/error.h
new file mode 100644
index 0000000..6c7766b
--- /dev/null
+++ b/src/zscanner/error.h
@@ -0,0 +1,117 @@
+/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+/*!
+ * \file error.h
+ *
+ * \author Daniel Salzman <daniel.salzman@nic.cz>
+ *
+ * \brief Error codes and handling.
+ * @{
+ */
+
+#ifndef _ZSCANNER__ERROR_H_
+#define _ZSCANNER__ERROR_H_
+
+enum err_codes {
+ ZSCANNER_OK = 0,
+
+ FLOADER_EFSTAT = -1000,
+ FLOADER_EDIRECTORY,
+ FLOADER_EEMPTY,
+ FLOADER_EMMAP,
+ FLOADER_EMUNMAP,
+ FLOADER_ESCANNER,
+
+ ZSCANNER_UNCOVERED_STATE,
+ ZSCANNER_UNCLOSED_MULTILINE,
+ ZSCANNER_ELEFT_PARENTHESIS,
+ ZSCANNER_ERIGHT_PARENTHESIS,
+ ZSCANNER_EUNSUPPORTED_TYPE,
+ ZSCANNER_EBAD_PREVIOUS_OWNER,
+ ZSCANNER_EBAD_DNAME_CHAR,
+ ZSCANNER_EBAD_OWNER,
+ ZSCANNER_ELABEL_OVERFLOW,
+ ZSCANNER_EDNAME_OVERFLOW,
+ ZSCANNER_EBAD_NUMBER,
+ ZSCANNER_EN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CERT_TYPE,
+ ZSCANNER_EBAD_EUI_LENGTH,
+ ZSCANNER_EBAD_L64_LENGTH,
+ ZSCANNER_EBAD_CHAR_COLON,
+ ZSCANNER_EBAD_CHAR_DASH
+};
+
+/*!
+ * \brief Returns error message for the given error code.
+ *
+ * \param code Error code.
+ *
+ * \return String containing the error message.
+ */
+const char* zscanner_strerror(const int code);
+
+/*!
+ * \brief Returns error code name of the given error code.
+ *
+ * \param code Error code.
+ *
+ * \return String containing the error code name.
+ */
+const char* zscanner_errorname(const int code);
+
+#endif // _ZSCANNER__ERROR_H_
+
+/*! @} */