summaryrefslogtreecommitdiffstats
path: root/nanohttp/nanohttp-error.h
diff options
context:
space:
mode:
authorGravatar m0gg2006-11-25 15:06:57 +0000
committerGravatar m0gg2006-11-25 15:06:57 +0000
commit82c14810dd1c101f20052c4ab92f33c57a255cc1 (patch)
tree6d445e22baf26d4df2ae08ad678ba56a19f22e7e /nanohttp/nanohttp-error.h
parent01aaebca2e4b8b2d13aef5cdeda9b8874efe1c31 (diff)
downloadcsoap-82c14810dd1c101f20052c4ab92f33c57a255cc1.tar.gz
csoap-82c14810dd1c101f20052c4ab92f33c57a255cc1.tar.bz2
documentation enhancements and code cleanup
Diffstat (limited to 'nanohttp/nanohttp-error.h')
-rw-r--r--nanohttp/nanohttp-error.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/nanohttp/nanohttp-error.h b/nanohttp/nanohttp-error.h
new file mode 100644
index 0000000..57b6634
--- /dev/null
+++ b/nanohttp/nanohttp-error.h
@@ -0,0 +1,102 @@
+/******************************************************************
+ * $Id: nanohttp-error.h,v 1.1 2006/11/25 15:06:58 m0gg Exp $
+ *
+ * CSOAP Project: A http client/server library in C
+ * Copyright (C) 2003-2004 Ferhat Ayaz
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Email: ferhatayaz@yahoo.com
+ ******************************************************************/
+#ifndef __nanohttp_error_h
+#define __nanohttp_error_h
+
+/* Success flag */
+#define H_OK 0
+
+/* Socket errors */
+#define HSOCKET_ERROR_CREATE 1001
+#define HSOCKET_ERROR_GET_HOSTNAME 1002
+#define HSOCKET_ERROR_CONNECT 1003
+#define HSOCKET_ERROR_SEND 1004
+#define HSOCKET_ERROR_RECEIVE 1005
+#define HSOCKET_ERROR_BIND 1006
+#define HSOCKET_ERROR_LISTEN 1007
+#define HSOCKET_ERROR_ACCEPT 1008
+#define HSOCKET_ERROR_NOT_INITIALIZED 1009
+#define HSOCKET_ERROR_IOCTL 1010
+#define HSOCKET_ERROR_SSLCLOSE 1011
+#define HSOCKET_ERROR_SSLCTX 1011
+
+/* URL errors */
+#define URL_ERROR_UNKNOWN_PROTOCOL 1101
+#define URL_ERROR_NO_PROTOCOL 1102
+#define URL_ERROR_NO_HOST 1103
+
+/* Stream errors */
+#define STREAM_ERROR_INVALID_TYPE 1201
+#define STREAM_ERROR_SOCKET_ERROR 1202
+#define STREAM_ERROR_NO_CHUNK_SIZE 1203
+#define STREAM_ERROR_WRONG_CHUNK_SIZE 1204
+
+/* MIME errors */
+#define MIME_ERROR_NO_BOUNDARY_PARAM 1301
+#define MIME_ERROR_NO_START_PARAM 1302
+#define MIME_ERROR_PARSE_ERROR 1303
+#define MIME_ERROR_NO_ROOT_PART 1304
+#define MIME_ERROR_NOT_MIME_MESSAGE 1305
+
+/* General errors */
+#define GENERAL_INVALID_PARAM 1400
+#define GENERAL_HEADER_PARSE_ERROR 1401
+
+/* Thread errors */
+#define THREAD_BEGIN_ERROR 1500
+
+/* XML Errors */
+#define XML_ERROR_EMPTY_DOCUMENT 1600
+#define XML_ERROR_PARSE 1601
+
+/* SSL Errors */
+#define HSSL_ERROR_CA_LIST 1710
+#define HSSL_ERROR_CONTEXT 1720
+#define HSSL_ERROR_CERTIFICATE 1730
+#define HSSL_ERROR_PEM 1740
+#define HSSL_ERROR_CLIENT 1750
+#define HSSL_ERROR_SERVER 1760
+#define HSSL_ERROR_CONNECT 1770
+
+/* File errors */
+#define FILE_ERROR_OPEN 8000
+#define FILE_ERROR_READ 8001
+
+typedef void *herror_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern herror_t herror_new(const char *func, int errcode, const char *format, ...);
+extern int herror_code(herror_t err);
+extern char *herror_func(herror_t err);
+extern char *herror_message(herror_t err);
+extern void herror_release(herror_t err);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif