aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/zstd/error_public.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-08 16:59:45 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-08 17:00:14 +0100
commitbd10330aa73c9f6eab293b38cf1c86e03fe46fa1 (patch)
treed82e7505b0903a9155f35202e486455066826b1e /contrib/zstd/error_public.h
parente3c5642da397104ed4d5c0171353e997f4ceba77 (diff)
downloadrspamd-bd10330aa73c9f6eab293b38cf1c86e03fe46fa1.tar.gz
rspamd-bd10330aa73c9f6eab293b38cf1c86e03fe46fa1.zip
[Feature] Add zstd compression library
Diffstat (limited to 'contrib/zstd/error_public.h')
-rw-r--r--contrib/zstd/error_public.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/contrib/zstd/error_public.h b/contrib/zstd/error_public.h
new file mode 100644
index 000000000..d46abd2c7
--- /dev/null
+++ b/contrib/zstd/error_public.h
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ */
+
+#ifndef ERROR_PUBLIC_H_MODULE
+#define ERROR_PUBLIC_H_MODULE
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+/*===== dependency =====*/
+#include <stddef.h> /* size_t */
+
+
+/*-****************************************
+* error codes list
+******************************************/
+typedef enum {
+ ZSTD_error_no_error,
+ ZSTD_error_GENERIC,
+ ZSTD_error_prefix_unknown,
+ ZSTD_error_version_unsupported,
+ ZSTD_error_parameter_unknown,
+ ZSTD_error_frameParameter_unsupported,
+ ZSTD_error_frameParameter_unsupportedBy32bits,
+ ZSTD_error_compressionParameter_unsupported,
+ ZSTD_error_init_missing,
+ ZSTD_error_memory_allocation,
+ ZSTD_error_stage_wrong,
+ ZSTD_error_dstSize_tooSmall,
+ ZSTD_error_srcSize_wrong,
+ ZSTD_error_corruption_detected,
+ ZSTD_error_checksum_wrong,
+ ZSTD_error_tableLog_tooLarge,
+ ZSTD_error_maxSymbolValue_tooLarge,
+ ZSTD_error_maxSymbolValue_tooSmall,
+ ZSTD_error_dictionary_corrupted,
+ ZSTD_error_dictionary_wrong,
+ ZSTD_error_maxCode
+} ZSTD_ErrorCode;
+
+/*! ZSTD_getErrorCode() :
+ convert a `size_t` function result into a `ZSTD_ErrorCode` enum type,
+ which can be used to compare directly with enum list published into "error_public.h" */
+ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
+const char* ZSTD_getErrorString(ZSTD_ErrorCode code);
+
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif /* ERROR_PUBLIC_H_MODULE */