diff --git a/jansson/2.1.2/AIX-00FB437F4C00/AIX-00FB437F4C00.tar b/jansson/2.1.2/AIX-00FB437F4C00/AIX-00FB437F4C00.tar new file mode 100644 index 0000000000000000000000000000000000000000..4d8bcd84f239560c68a1f8fd2d4401e54a65bb31 Binary files /dev/null and b/jansson/2.1.2/AIX-00FB437F4C00/AIX-00FB437F4C00.tar differ diff --git a/jansson/2.1.2/AIX-00FB437F4C00/libark_jansson.a b/jansson/2.1.2/AIX-00FB437F4C00/libark_jansson.a new file mode 120000 index 0000000000000000000000000000000000000000..e10abc802998ebcb1ed6f5eb5670dfb1407394dc --- /dev/null +++ b/jansson/2.1.2/AIX-00FB437F4C00/libark_jansson.a @@ -0,0 +1 @@ +libark_jansson.a.1 \ No newline at end of file diff --git a/jansson/2.1.2/AIX-00FB437F4C00/libark_jansson.a.1 b/jansson/2.1.2/AIX-00FB437F4C00/libark_jansson.a.1 new file mode 100755 index 0000000000000000000000000000000000000000..befa70e093d6f5390791fb4cc2667dda2afac8f4 Binary files /dev/null and b/jansson/2.1.2/AIX-00FB437F4C00/libark_jansson.a.1 differ diff --git a/jansson/2.1.2/AIX-00FB90154C00/AIX-00FB90154C00.tar b/jansson/2.1.2/AIX-00FB90154C00/AIX-00FB90154C00.tar new file mode 100644 index 0000000000000000000000000000000000000000..ad18754de97f7e808b2a389ae1cd39d32033223e Binary files /dev/null and b/jansson/2.1.2/AIX-00FB90154C00/AIX-00FB90154C00.tar differ diff --git a/jansson/2.1.2/AIX-00FB90154C00/libark_jansson.a b/jansson/2.1.2/AIX-00FB90154C00/libark_jansson.a new file mode 120000 index 0000000000000000000000000000000000000000..e10abc802998ebcb1ed6f5eb5670dfb1407394dc --- /dev/null +++ b/jansson/2.1.2/AIX-00FB90154C00/libark_jansson.a @@ -0,0 +1 @@ +libark_jansson.a.1 \ No newline at end of file diff --git a/jansson/2.1.2/AIX-00FB90154C00/libark_jansson.a.1 b/jansson/2.1.2/AIX-00FB90154C00/libark_jansson.a.1 new file mode 100755 index 0000000000000000000000000000000000000000..befa70e093d6f5390791fb4cc2667dda2afac8f4 Binary files /dev/null and b/jansson/2.1.2/AIX-00FB90154C00/libark_jansson.a.1 differ diff --git a/jansson/2.1.2/HP-UX-ia64/HP-UX-ia64.tar b/jansson/2.1.2/HP-UX-ia64/HP-UX-ia64.tar new file mode 100644 index 0000000000000000000000000000000000000000..312d77da544ed4eff4f5228b4c0e5fe88ad68c06 Binary files /dev/null and b/jansson/2.1.2/HP-UX-ia64/HP-UX-ia64.tar differ diff --git a/jansson/2.1.2/HP-UX-ia64/libark_jansson.so b/jansson/2.1.2/HP-UX-ia64/libark_jansson.so new file mode 120000 index 0000000000000000000000000000000000000000..56df34e03b8a85dbcb371de0c8109970737d6730 --- /dev/null +++ b/jansson/2.1.2/HP-UX-ia64/libark_jansson.so @@ -0,0 +1 @@ +libark_jansson.so.1 \ No newline at end of file diff --git a/jansson/2.1.2/HP-UX-ia64/libark_jansson.so.1 b/jansson/2.1.2/HP-UX-ia64/libark_jansson.so.1 new file mode 100755 index 0000000000000000000000000000000000000000..f36d1e6ce34854ead2cc7a78c1fc510ea3dee4c1 Binary files /dev/null and b/jansson/2.1.2/HP-UX-ia64/libark_jansson.so.1 differ diff --git a/jansson/2.1.2/Linux-x86_64/Linux-x86_64.tar b/jansson/2.1.2/Linux-x86_64/Linux-x86_64.tar new file mode 100644 index 0000000000000000000000000000000000000000..054163bf81bda723ac4d883cce7dbd74d4352c60 Binary files /dev/null and b/jansson/2.1.2/Linux-x86_64/Linux-x86_64.tar differ diff --git a/jansson/2.1.2/Linux-x86_64/libark_jansson.so b/jansson/2.1.2/Linux-x86_64/libark_jansson.so new file mode 120000 index 0000000000000000000000000000000000000000..6fa43ee28179e33c9c45066f889e71abf013ae35 --- /dev/null +++ b/jansson/2.1.2/Linux-x86_64/libark_jansson.so @@ -0,0 +1 @@ +libark_jansson.so.2.12 \ No newline at end of file diff --git a/jansson/2.1.2/Linux-x86_64/libark_jansson.so.2 b/jansson/2.1.2/Linux-x86_64/libark_jansson.so.2 new file mode 120000 index 0000000000000000000000000000000000000000..6fa43ee28179e33c9c45066f889e71abf013ae35 --- /dev/null +++ b/jansson/2.1.2/Linux-x86_64/libark_jansson.so.2 @@ -0,0 +1 @@ +libark_jansson.so.2.12 \ No newline at end of file diff --git a/jansson/2.1.2/Linux-x86_64/libark_jansson.so.2.12 b/jansson/2.1.2/Linux-x86_64/libark_jansson.so.2.12 new file mode 100755 index 0000000000000000000000000000000000000000..b255d368c5b2dc87a4aad0475a6b81113d4feff4 Binary files /dev/null and b/jansson/2.1.2/Linux-x86_64/libark_jansson.so.2.12 differ diff --git a/jansson/2.1.2/Linux-x86_64_5/Linux-x86_64_5.tar b/jansson/2.1.2/Linux-x86_64_5/Linux-x86_64_5.tar new file mode 100644 index 0000000000000000000000000000000000000000..2290bfee62b32b3cf8426329d6f9829732ad580c Binary files /dev/null and b/jansson/2.1.2/Linux-x86_64_5/Linux-x86_64_5.tar differ diff --git a/jansson/2.1.2/Linux-x86_64_5/libark_jansson.so b/jansson/2.1.2/Linux-x86_64_5/libark_jansson.so new file mode 120000 index 0000000000000000000000000000000000000000..46d8c6c0abae7ed0717e631f2cd4d088bece2c99 --- /dev/null +++ b/jansson/2.1.2/Linux-x86_64_5/libark_jansson.so @@ -0,0 +1 @@ +libark_jansson.so.3 \ No newline at end of file diff --git a/jansson/2.1.2/Linux-x86_64_5/libark_jansson.so.3 b/jansson/2.1.2/Linux-x86_64_5/libark_jansson.so.3 new file mode 100755 index 0000000000000000000000000000000000000000..e73b97d5b9fd3f419dff36399822cb07c2eb2886 Binary files /dev/null and b/jansson/2.1.2/Linux-x86_64_5/libark_jansson.so.3 differ diff --git a/jansson/2.1.2/Linux-x86_64_6/Linux-x86_64_6.tar b/jansson/2.1.2/Linux-x86_64_6/Linux-x86_64_6.tar new file mode 100644 index 0000000000000000000000000000000000000000..4e976de79e49e0d5bd44327399a3a9277f63cace Binary files /dev/null and b/jansson/2.1.2/Linux-x86_64_6/Linux-x86_64_6.tar differ diff --git a/jansson/2.1.2/Linux-x86_64_6/libark_jansson.so b/jansson/2.1.2/Linux-x86_64_6/libark_jansson.so new file mode 120000 index 0000000000000000000000000000000000000000..46d8c6c0abae7ed0717e631f2cd4d088bece2c99 --- /dev/null +++ b/jansson/2.1.2/Linux-x86_64_6/libark_jansson.so @@ -0,0 +1 @@ +libark_jansson.so.3 \ No newline at end of file diff --git a/jansson/2.1.2/Linux-x86_64_6/libark_jansson.so.3 b/jansson/2.1.2/Linux-x86_64_6/libark_jansson.so.3 new file mode 100755 index 0000000000000000000000000000000000000000..e73b97d5b9fd3f419dff36399822cb07c2eb2886 Binary files /dev/null and b/jansson/2.1.2/Linux-x86_64_6/libark_jansson.so.3 differ diff --git a/jansson/2.1.2/SunOS-5.10/SunOS-5.10.tar b/jansson/2.1.2/SunOS-5.10/SunOS-5.10.tar new file mode 100644 index 0000000000000000000000000000000000000000..84a6d3735d316ef979863bfd1aa646472544c548 Binary files /dev/null and b/jansson/2.1.2/SunOS-5.10/SunOS-5.10.tar differ diff --git a/jansson/2.1.2/SunOS-5.10/libark_jansson.so b/jansson/2.1.2/SunOS-5.10/libark_jansson.so new file mode 120000 index 0000000000000000000000000000000000000000..56df34e03b8a85dbcb371de0c8109970737d6730 --- /dev/null +++ b/jansson/2.1.2/SunOS-5.10/libark_jansson.so @@ -0,0 +1 @@ +libark_jansson.so.1 \ No newline at end of file diff --git a/jansson/2.1.2/SunOS-5.10/libark_jansson.so.1 b/jansson/2.1.2/SunOS-5.10/libark_jansson.so.1 new file mode 100755 index 0000000000000000000000000000000000000000..bb7a40f3be15a3051b1ab75f8ec5e507eebf8185 Binary files /dev/null and b/jansson/2.1.2/SunOS-5.10/libark_jansson.so.1 differ diff --git a/jansson/2.1.2/SunOS-sun4v/SunOS-sun4v.tar b/jansson/2.1.2/SunOS-sun4v/SunOS-sun4v.tar new file mode 100644 index 0000000000000000000000000000000000000000..3d27f881d964ca91dca104203a1ad26f33426789 Binary files /dev/null and b/jansson/2.1.2/SunOS-sun4v/SunOS-sun4v.tar differ diff --git a/jansson/2.1.2/SunOS-sun4v/libark_jansson.so b/jansson/2.1.2/SunOS-sun4v/libark_jansson.so new file mode 120000 index 0000000000000000000000000000000000000000..56df34e03b8a85dbcb371de0c8109970737d6730 --- /dev/null +++ b/jansson/2.1.2/SunOS-sun4v/libark_jansson.so @@ -0,0 +1 @@ +libark_jansson.so.1 \ No newline at end of file diff --git a/jansson/2.1.2/SunOS-sun4v/libark_jansson.so.1 b/jansson/2.1.2/SunOS-sun4v/libark_jansson.so.1 new file mode 100755 index 0000000000000000000000000000000000000000..bb7a40f3be15a3051b1ab75f8ec5e507eebf8185 Binary files /dev/null and b/jansson/2.1.2/SunOS-sun4v/libark_jansson.so.1 differ diff --git a/jansson/2.1.2/include.tar b/jansson/2.1.2/include.tar new file mode 100644 index 0000000000000000000000000000000000000000..33b9e35124cfa42503f6ac715d585b6d74c0d225 Binary files /dev/null and b/jansson/2.1.2/include.tar differ diff --git a/jansson/2.1.2/include/jansson.h b/jansson/2.1.2/include/jansson.h new file mode 100644 index 0000000000000000000000000000000000000000..e4e73e2f9a524043405c38e46195db1a156c0c02 --- /dev/null +++ b/jansson/2.1.2/include/jansson.h @@ -0,0 +1,367 @@ +/* + * Copyright (c) 2009-2016 Petri Lehtinen + * + * Jansson is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef JANSSON_H +#define JANSSON_H + +#include +#include /* for size_t */ +#include + +#include "jansson_config.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* version */ + +#define JANSSON_MAJOR_VERSION 2 +#define JANSSON_MINOR_VERSION 12 +#define JANSSON_MICRO_VERSION 0 + +/* Micro version is omitted if it's 0 */ +#define JANSSON_VERSION "2.12" + +/* Version as a 3-byte hex number, e.g. 0x010201 == 1.2.1. Use this + for numeric comparisons, e.g. #if JANSSON_VERSION_HEX >= ... */ +#define JANSSON_VERSION_HEX ((JANSSON_MAJOR_VERSION << 16) | \ + (JANSSON_MINOR_VERSION << 8) | \ + (JANSSON_MICRO_VERSION << 0)) + +/* If __atomic or __sync builtins are available the library is thread + * safe for all read-only functions plus reference counting. */ +#if JSON_HAVE_ATOMIC_BUILTINS || JSON_HAVE_SYNC_BUILTINS +#define JANSSON_THREAD_SAFE_REFCOUNT 1 +#endif + +#if defined(__GNUC__) || defined(__clang__) +#define JANSSON_ATTRS(...) __attribute__((__VA_ARGS__)) +#else +#define JANSSON_ATTRS(...) +#endif + +/* types */ + +typedef enum { + JSON_OBJECT, + JSON_ARRAY, + JSON_STRING, + JSON_INTEGER, + JSON_REAL, + JSON_TRUE, + JSON_FALSE, + JSON_NULL +} json_type; + +typedef struct json_t { + json_type type; + volatile size_t refcount; +} json_t; + +#ifndef JANSSON_USING_CMAKE /* disabled if using cmake */ +#if JSON_INTEGER_IS_LONG_LONG +#ifdef _WIN32 +#define JSON_INTEGER_FORMAT "I64d" +#else +#define JSON_INTEGER_FORMAT "lld" +#endif +typedef long long json_int_t; +#else +#define JSON_INTEGER_FORMAT "ld" +typedef long json_int_t; +#endif /* JSON_INTEGER_IS_LONG_LONG */ +#endif + +#define json_typeof(json) ((json)->type) +#define json_is_object(json) ((json) && json_typeof(json) == JSON_OBJECT) +#define json_is_array(json) ((json) && json_typeof(json) == JSON_ARRAY) +#define json_is_string(json) ((json) && json_typeof(json) == JSON_STRING) +#define json_is_integer(json) ((json) && json_typeof(json) == JSON_INTEGER) +#define json_is_real(json) ((json) && json_typeof(json) == JSON_REAL) +#define json_is_number(json) (json_is_integer(json) || json_is_real(json)) +#define json_is_true(json) ((json) && json_typeof(json) == JSON_TRUE) +#define json_is_false(json) ((json) && json_typeof(json) == JSON_FALSE) +#define json_boolean_value json_is_true +#define json_is_boolean(json) (json_is_true(json) || json_is_false(json)) +#define json_is_null(json) ((json) && json_typeof(json) == JSON_NULL) + +/* construction, destruction, reference counting */ + +json_t *json_object(void); +json_t *json_array(void); +json_t *json_string(const char *value); +json_t *json_stringn(const char *value, size_t len); +json_t *json_string_nocheck(const char *value); +json_t *json_stringn_nocheck(const char *value, size_t len); +json_t *json_integer(json_int_t value); +json_t *json_real(double value); +json_t *json_true(void); +json_t *json_false(void); +#define json_boolean(val) ((val) ? json_true() : json_false()) +json_t *json_null(void); + +/* do not call JSON_INTERNAL_INCREF or JSON_INTERNAL_DECREF directly */ +#if JSON_HAVE_ATOMIC_BUILTINS +#define JSON_INTERNAL_INCREF(json) __atomic_add_fetch(&json->refcount, 1, __ATOMIC_ACQUIRE) +#define JSON_INTERNAL_DECREF(json) __atomic_sub_fetch(&json->refcount, 1, __ATOMIC_RELEASE) +#elif JSON_HAVE_SYNC_BUILTINS +#define JSON_INTERNAL_INCREF(json) __sync_add_and_fetch(&json->refcount, 1) +#define JSON_INTERNAL_DECREF(json) __sync_sub_and_fetch(&json->refcount, 1) +#else +#define JSON_INTERNAL_INCREF(json) (++json->refcount) +#define JSON_INTERNAL_DECREF(json) (--json->refcount) +#endif + +static JSON_INLINE +json_t *json_incref(json_t *json) +{ + if(json && json->refcount != (size_t)-1) + JSON_INTERNAL_INCREF(json); + return json; +} + +/* do not call json_delete directly */ +void json_delete(json_t *json); + +static JSON_INLINE +void json_decref(json_t *json) +{ + if(json && json->refcount != (size_t)-1 && JSON_INTERNAL_DECREF(json) == 0) + json_delete(json); +} + +#if defined(__GNUC__) || defined(__clang__) +static JSON_INLINE +void json_decrefp(json_t **json) +{ + if(json) { + json_decref(*json); + *json = NULL; + } +} + +#define json_auto_t json_t __attribute__((cleanup(json_decrefp))) +#endif + + +/* error reporting */ + +#define JSON_ERROR_TEXT_LENGTH 160 +#define JSON_ERROR_SOURCE_LENGTH 80 + +typedef struct json_error_t { + int line; + int column; + int position; + char source[JSON_ERROR_SOURCE_LENGTH]; + char text[JSON_ERROR_TEXT_LENGTH]; +} json_error_t; + +enum json_error_code { + json_error_unknown, + json_error_out_of_memory, + json_error_stack_overflow, + json_error_cannot_open_file, + json_error_invalid_argument, + json_error_invalid_utf8, + json_error_premature_end_of_input, + json_error_end_of_input_expected, + json_error_invalid_syntax, + json_error_invalid_format, + json_error_wrong_type, + json_error_null_character, + json_error_null_value, + json_error_null_byte_in_key, + json_error_duplicate_key, + json_error_numeric_overflow, + json_error_item_not_found, + json_error_index_out_of_range +}; + +static JSON_INLINE enum json_error_code json_error_code(const json_error_t *e) { + return (enum json_error_code)e->text[JSON_ERROR_TEXT_LENGTH - 1]; +} + +/* getters, setters, manipulation */ + +void json_object_seed(size_t seed); +size_t json_object_size(const json_t *object); +json_t *json_object_get(const json_t *object, const char *key) JANSSON_ATTRS(warn_unused_result); +int json_object_set_new(json_t *object, const char *key, json_t *value); +int json_object_set_new_nocheck(json_t *object, const char *key, json_t *value); +int json_object_del(json_t *object, const char *key); +int json_object_clear(json_t *object); +int json_object_update(json_t *object, json_t *other); +int json_object_update_existing(json_t *object, json_t *other); +int json_object_update_missing(json_t *object, json_t *other); +void *json_object_iter(json_t *object); +void *json_object_iter_at(json_t *object, const char *key); +void *json_object_key_to_iter(const char *key); +void *json_object_iter_next(json_t *object, void *iter); +const char *json_object_iter_key(void *iter); +json_t *json_object_iter_value(void *iter); +int json_object_iter_set_new(json_t *object, void *iter, json_t *value); + +#define json_object_foreach(object, key, value) \ + for(key = json_object_iter_key(json_object_iter(object)); \ + key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ + key = json_object_iter_key(json_object_iter_next(object, json_object_key_to_iter(key)))) + +#define json_object_foreach_safe(object, n, key, value) \ + for(key = json_object_iter_key(json_object_iter(object)), \ + n = json_object_iter_next(object, json_object_key_to_iter(key)); \ + key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ + key = json_object_iter_key(n), \ + n = json_object_iter_next(object, json_object_key_to_iter(key))) + +#define json_array_foreach(array, index, value) \ + for(index = 0; \ + index < json_array_size(array) && (value = json_array_get(array, index)); \ + index++) + +static JSON_INLINE +int json_object_set(json_t *object, const char *key, json_t *value) +{ + return json_object_set_new(object, key, json_incref(value)); +} + +static JSON_INLINE +int json_object_set_nocheck(json_t *object, const char *key, json_t *value) +{ + return json_object_set_new_nocheck(object, key, json_incref(value)); +} + +static JSON_INLINE +int json_object_iter_set(json_t *object, void *iter, json_t *value) +{ + return json_object_iter_set_new(object, iter, json_incref(value)); +} + +size_t json_array_size(const json_t *array); +json_t *json_array_get(const json_t *array, size_t index) JANSSON_ATTRS(warn_unused_result); +int json_array_set_new(json_t *array, size_t index, json_t *value); +int json_array_append_new(json_t *array, json_t *value); +int json_array_insert_new(json_t *array, size_t index, json_t *value); +int json_array_remove(json_t *array, size_t index); +int json_array_clear(json_t *array); +int json_array_extend(json_t *array, json_t *other); + +static JSON_INLINE +int json_array_set(json_t *array, size_t ind, json_t *value) +{ + return json_array_set_new(array, ind, json_incref(value)); +} + +static JSON_INLINE +int json_array_append(json_t *array, json_t *value) +{ + return json_array_append_new(array, json_incref(value)); +} + +static JSON_INLINE +int json_array_insert(json_t *array, size_t ind, json_t *value) +{ + return json_array_insert_new(array, ind, json_incref(value)); +} + +const char *json_string_value(const json_t *string); +size_t json_string_length(const json_t *string); +json_int_t json_integer_value(const json_t *integer); +double json_real_value(const json_t *real); +double json_number_value(const json_t *json); + +int json_string_set(json_t *string, const char *value); +int json_string_setn(json_t *string, const char *value, size_t len); +int json_string_set_nocheck(json_t *string, const char *value); +int json_string_setn_nocheck(json_t *string, const char *value, size_t len); +int json_integer_set(json_t *integer, json_int_t value); +int json_real_set(json_t *real, double value); + +/* pack, unpack */ + +json_t *json_pack(const char *fmt, ...) JANSSON_ATTRS(warn_unused_result); +json_t *json_pack_ex(json_error_t *error, size_t flags, const char *fmt, ...) JANSSON_ATTRS(warn_unused_result); +json_t *json_vpack_ex(json_error_t *error, size_t flags, const char *fmt, va_list ap) JANSSON_ATTRS(warn_unused_result); + +#define JSON_VALIDATE_ONLY 0x1 +#define JSON_STRICT 0x2 + +int json_unpack(json_t *root, const char *fmt, ...); +int json_unpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, ...); +int json_vunpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, va_list ap); + +/* sprintf */ + +json_t *json_sprintf(const char *fmt, ...) JANSSON_ATTRS(warn_unused_result, format(printf, 1, 2)); +json_t *json_vsprintf(const char *fmt, va_list ap) JANSSON_ATTRS(warn_unused_result, format(printf, 1, 0)); + + +/* equality */ + +int json_equal(const json_t *value1, const json_t *value2); + + +/* copying */ + +json_t *json_copy(json_t *value) JANSSON_ATTRS(warn_unused_result); +json_t *json_deep_copy(const json_t *value) JANSSON_ATTRS(warn_unused_result); + + +/* decoding */ + +#define JSON_REJECT_DUPLICATES 0x1 +#define JSON_DISABLE_EOF_CHECK 0x2 +#define JSON_DECODE_ANY 0x4 +#define JSON_DECODE_INT_AS_REAL 0x8 +#define JSON_ALLOW_NUL 0x10 + +typedef size_t (*json_load_callback_t)(void *buffer, size_t buflen, void *data); + +json_t *json_loads(const char *input, size_t flags, json_error_t *error) JANSSON_ATTRS(warn_unused_result); +json_t *json_loadb(const char *buffer, size_t buflen, size_t flags, json_error_t *error) JANSSON_ATTRS(warn_unused_result); +json_t *json_loadf(FILE *input, size_t flags, json_error_t *error) JANSSON_ATTRS(warn_unused_result); +json_t *json_loadfd(int input, size_t flags, json_error_t *error) JANSSON_ATTRS(warn_unused_result); +json_t *json_load_file(const char *path, size_t flags, json_error_t *error) JANSSON_ATTRS(warn_unused_result); +json_t *json_load_callback(json_load_callback_t callback, void *data, size_t flags, json_error_t *error) JANSSON_ATTRS(warn_unused_result); + + +/* encoding */ + +#define JSON_MAX_INDENT 0x1F +#define JSON_INDENT(n) ((n) & JSON_MAX_INDENT) +#define JSON_COMPACT 0x20 +#define JSON_ENSURE_ASCII 0x40 +#define JSON_SORT_KEYS 0x80 +#define JSON_PRESERVE_ORDER 0x100 +#define JSON_ENCODE_ANY 0x200 +#define JSON_ESCAPE_SLASH 0x400 +#define JSON_REAL_PRECISION(n) (((n) & 0x1F) << 11) +#define JSON_EMBED 0x10000 + +typedef int (*json_dump_callback_t)(const char *buffer, size_t size, void *data); + +char *json_dumps(const json_t *json, size_t flags) JANSSON_ATTRS(warn_unused_result); +size_t json_dumpb(const json_t *json, char *buffer, size_t size, size_t flags); +int json_dumpf(const json_t *json, FILE *output, size_t flags); +int json_dumpfd(const json_t *json, int output, size_t flags); +int json_dump_file(const json_t *json, const char *path, size_t flags); +int json_dump_callback(const json_t *json, json_dump_callback_t callback, void *data, size_t flags); + +/* custom memory allocation */ + +typedef void *(*json_malloc_t)(size_t); +typedef void (*json_free_t)(void *); + +void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn); +void json_get_alloc_funcs(json_malloc_t *malloc_fn, json_free_t *free_fn); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/jansson/2.1.2/include/jansson_config.h b/jansson/2.1.2/include/jansson_config.h new file mode 100644 index 0000000000000000000000000000000000000000..b34baa55166bd2af5fedccd59c848632e63c38f1 --- /dev/null +++ b/jansson/2.1.2/include/jansson_config.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2010-2016 Petri Lehtinen + * + * Jansson is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + * + * + * This file specifies a part of the site-specific configuration for + * Jansson, namely those things that affect the public API in + * jansson.h. + * + * The configure script copies this file to jansson_config.h and + * replaces @var@ substitutions by values that fit your system. If you + * cannot run the configure script, you can do the value substitution + * by hand. + */ + +#ifndef JANSSON_CONFIG_H +#define JANSSON_CONFIG_H + +/* If your compiler supports the inline keyword in C, JSON_INLINE is + defined to `inline', otherwise empty. In C++, the inline is always + supported. */ +#ifdef __cplusplus +#define JSON_INLINE inline +#else +#define JSON_INLINE inline +#endif + +/* If your compiler supports the `long long` type and the strtoll() + library function, JSON_INTEGER_IS_LONG_LONG is defined to 1, + otherwise to 0. */ +#define JSON_INTEGER_IS_LONG_LONG 1 + +/* If locale.h and localeconv() are available, define to 1, + otherwise to 0. */ +#define JSON_HAVE_LOCALECONV 1 + +/* If __atomic builtins are available they will be used to manage + reference counts of json_t. */ +#define JSON_HAVE_ATOMIC_BUILTINS 1 + +/* If __atomic builtins are not available we try using __sync builtins + to manage reference counts of json_t. */ +#define JSON_HAVE_SYNC_BUILTINS 1 + +/* Maximum recursion depth for parsing JSON input. + This limits the depth of e.g. array-within-array constructions. */ +#define JSON_PARSER_MAX_DEPTH 2048 + +#endif diff --git a/microhttpd/0.9.70/AIX-00FB437F4C00/AIX-00FB437F4C00.tar b/microhttpd/0.9.70/AIX-00FB437F4C00/AIX-00FB437F4C00.tar new file mode 100644 index 0000000000000000000000000000000000000000..f093252595f8cdfe9fc23850165c4054400af8f8 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB437F4C00/AIX-00FB437F4C00.tar differ diff --git a/microhttpd/0.9.70/AIX-00FB437F4C00/libatomic.a b/microhttpd/0.9.70/AIX-00FB437F4C00/libatomic.a new file mode 100644 index 0000000000000000000000000000000000000000..c515b059b740099fc83f91103b119382a7493819 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB437F4C00/libatomic.a differ diff --git a/microhttpd/0.9.70/AIX-00FB437F4C00/libffi.a b/microhttpd/0.9.70/AIX-00FB437F4C00/libffi.a new file mode 100644 index 0000000000000000000000000000000000000000..9686b8c40197089aec5c4a09735278de8b1d3fc5 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB437F4C00/libffi.a differ diff --git a/microhttpd/0.9.70/AIX-00FB437F4C00/libgcc_s.a b/microhttpd/0.9.70/AIX-00FB437F4C00/libgcc_s.a new file mode 100644 index 0000000000000000000000000000000000000000..d86b79d15f8784ae0b68090c19343aff454edcca Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB437F4C00/libgcc_s.a differ diff --git a/microhttpd/0.9.70/AIX-00FB437F4C00/libgmp.a b/microhttpd/0.9.70/AIX-00FB437F4C00/libgmp.a new file mode 100644 index 0000000000000000000000000000000000000000..ed9c44bc68c402017b3c0883a1578ba307cfa920 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB437F4C00/libgmp.a differ diff --git a/microhttpd/0.9.70/AIX-00FB437F4C00/libgnutls.a b/microhttpd/0.9.70/AIX-00FB437F4C00/libgnutls.a new file mode 100644 index 0000000000000000000000000000000000000000..124069fd777e61d9e7bd72820996c27195e54d51 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB437F4C00/libgnutls.a differ diff --git a/microhttpd/0.9.70/AIX-00FB437F4C00/libhogweed.a b/microhttpd/0.9.70/AIX-00FB437F4C00/libhogweed.a new file mode 100644 index 0000000000000000000000000000000000000000..25e34ddf342bbba3172d38d9642bfc1cc382fdcd Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB437F4C00/libhogweed.a differ diff --git a/microhttpd/0.9.70/AIX-00FB437F4C00/libmicrohttpd.a b/microhttpd/0.9.70/AIX-00FB437F4C00/libmicrohttpd.a new file mode 100644 index 0000000000000000000000000000000000000000..caf6708b3c194c2189e3fd47916b7add107913b3 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB437F4C00/libmicrohttpd.a differ diff --git a/microhttpd/0.9.70/AIX-00FB437F4C00/libnettle.a b/microhttpd/0.9.70/AIX-00FB437F4C00/libnettle.a new file mode 100644 index 0000000000000000000000000000000000000000..744db9b58b4e8976437f8fdd91aeceedb7a717b2 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB437F4C00/libnettle.a differ diff --git a/microhttpd/0.9.70/AIX-00FB437F4C00/libp11-kit.a b/microhttpd/0.9.70/AIX-00FB437F4C00/libp11-kit.a new file mode 100644 index 0000000000000000000000000000000000000000..f63f0a66e5204969ce3265e127f60fbdf1880aea Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB437F4C00/libp11-kit.a differ diff --git a/microhttpd/0.9.70/AIX-00FB437F4C00/libstdc++.a b/microhttpd/0.9.70/AIX-00FB437F4C00/libstdc++.a new file mode 100644 index 0000000000000000000000000000000000000000..c0ee9f17c9676db513c5b1e1248b300c4aedfc26 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB437F4C00/libstdc++.a differ diff --git a/microhttpd/0.9.70/AIX-00FB90154C00/AIX-00FB90154C00.tar b/microhttpd/0.9.70/AIX-00FB90154C00/AIX-00FB90154C00.tar new file mode 100644 index 0000000000000000000000000000000000000000..f093252595f8cdfe9fc23850165c4054400af8f8 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB90154C00/AIX-00FB90154C00.tar differ diff --git a/microhttpd/0.9.70/AIX-00FB90154C00/libatomic.a b/microhttpd/0.9.70/AIX-00FB90154C00/libatomic.a new file mode 100644 index 0000000000000000000000000000000000000000..c515b059b740099fc83f91103b119382a7493819 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB90154C00/libatomic.a differ diff --git a/microhttpd/0.9.70/AIX-00FB90154C00/libffi.a b/microhttpd/0.9.70/AIX-00FB90154C00/libffi.a new file mode 100644 index 0000000000000000000000000000000000000000..9686b8c40197089aec5c4a09735278de8b1d3fc5 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB90154C00/libffi.a differ diff --git a/microhttpd/0.9.70/AIX-00FB90154C00/libgcc_s.a b/microhttpd/0.9.70/AIX-00FB90154C00/libgcc_s.a new file mode 100644 index 0000000000000000000000000000000000000000..d86b79d15f8784ae0b68090c19343aff454edcca Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB90154C00/libgcc_s.a differ diff --git a/microhttpd/0.9.70/AIX-00FB90154C00/libgmp.a b/microhttpd/0.9.70/AIX-00FB90154C00/libgmp.a new file mode 100644 index 0000000000000000000000000000000000000000..ed9c44bc68c402017b3c0883a1578ba307cfa920 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB90154C00/libgmp.a differ diff --git a/microhttpd/0.9.70/AIX-00FB90154C00/libgnutls.a b/microhttpd/0.9.70/AIX-00FB90154C00/libgnutls.a new file mode 100644 index 0000000000000000000000000000000000000000..124069fd777e61d9e7bd72820996c27195e54d51 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB90154C00/libgnutls.a differ diff --git a/microhttpd/0.9.70/AIX-00FB90154C00/libhogweed.a b/microhttpd/0.9.70/AIX-00FB90154C00/libhogweed.a new file mode 100644 index 0000000000000000000000000000000000000000..25e34ddf342bbba3172d38d9642bfc1cc382fdcd Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB90154C00/libhogweed.a differ diff --git a/microhttpd/0.9.70/AIX-00FB90154C00/libmicrohttpd.a b/microhttpd/0.9.70/AIX-00FB90154C00/libmicrohttpd.a new file mode 100644 index 0000000000000000000000000000000000000000..caf6708b3c194c2189e3fd47916b7add107913b3 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB90154C00/libmicrohttpd.a differ diff --git a/microhttpd/0.9.70/AIX-00FB90154C00/libnettle.a b/microhttpd/0.9.70/AIX-00FB90154C00/libnettle.a new file mode 100644 index 0000000000000000000000000000000000000000..744db9b58b4e8976437f8fdd91aeceedb7a717b2 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB90154C00/libnettle.a differ diff --git a/microhttpd/0.9.70/AIX-00FB90154C00/libp11-kit.a b/microhttpd/0.9.70/AIX-00FB90154C00/libp11-kit.a new file mode 100644 index 0000000000000000000000000000000000000000..f63f0a66e5204969ce3265e127f60fbdf1880aea Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB90154C00/libp11-kit.a differ diff --git a/microhttpd/0.9.70/AIX-00FB90154C00/libstdc++.a b/microhttpd/0.9.70/AIX-00FB90154C00/libstdc++.a new file mode 100644 index 0000000000000000000000000000000000000000..c0ee9f17c9676db513c5b1e1248b300c4aedfc26 Binary files /dev/null and b/microhttpd/0.9.70/AIX-00FB90154C00/libstdc++.a differ diff --git a/microhttpd/0.9.70/HP-UX-ia64/HP-UX-ia64.tar b/microhttpd/0.9.70/HP-UX-ia64/HP-UX-ia64.tar new file mode 100644 index 0000000000000000000000000000000000000000..5d7979a568d990d35efb85d99b3814c220d31f12 Binary files /dev/null and b/microhttpd/0.9.70/HP-UX-ia64/HP-UX-ia64.tar differ diff --git a/microhttpd/0.9.70/HP-UX-ia64/libmicrohttpd.so b/microhttpd/0.9.70/HP-UX-ia64/libmicrohttpd.so new file mode 120000 index 0000000000000000000000000000000000000000..d30f1cbc8394844b899668e176357708010e9900 --- /dev/null +++ b/microhttpd/0.9.70/HP-UX-ia64/libmicrohttpd.so @@ -0,0 +1 @@ +libmicrohttpd.so.67 \ No newline at end of file diff --git a/microhttpd/0.9.70/HP-UX-ia64/libmicrohttpd.so.67 b/microhttpd/0.9.70/HP-UX-ia64/libmicrohttpd.so.67 new file mode 100755 index 0000000000000000000000000000000000000000..76bd59576ff9b92cf98cd93d467dce8035ee7d19 Binary files /dev/null and b/microhttpd/0.9.70/HP-UX-ia64/libmicrohttpd.so.67 differ diff --git a/microhttpd/0.9.70/Linux-x86_64/Linux-x86_64.tar b/microhttpd/0.9.70/Linux-x86_64/Linux-x86_64.tar new file mode 100644 index 0000000000000000000000000000000000000000..255be1452edddef80b05a520d3232a63381f7775 Binary files /dev/null and b/microhttpd/0.9.70/Linux-x86_64/Linux-x86_64.tar differ diff --git a/microhttpd/0.9.70/Linux-x86_64/libmicrohttpd.so b/microhttpd/0.9.70/Linux-x86_64/libmicrohttpd.so new file mode 120000 index 0000000000000000000000000000000000000000..5162fca8f9a38b996137c388ff6707bbb2bf5f7d --- /dev/null +++ b/microhttpd/0.9.70/Linux-x86_64/libmicrohttpd.so @@ -0,0 +1 @@ +libmicrohttpd.so.12.55.0 \ No newline at end of file diff --git a/microhttpd/0.9.70/Linux-x86_64/libmicrohttpd.so.12 b/microhttpd/0.9.70/Linux-x86_64/libmicrohttpd.so.12 new file mode 120000 index 0000000000000000000000000000000000000000..5162fca8f9a38b996137c388ff6707bbb2bf5f7d --- /dev/null +++ b/microhttpd/0.9.70/Linux-x86_64/libmicrohttpd.so.12 @@ -0,0 +1 @@ +libmicrohttpd.so.12.55.0 \ No newline at end of file diff --git a/microhttpd/0.9.70/Linux-x86_64/libmicrohttpd.so.12.55.0 b/microhttpd/0.9.70/Linux-x86_64/libmicrohttpd.so.12.55.0 new file mode 100755 index 0000000000000000000000000000000000000000..3e6658de870c5bc36a201fa7839b7ecf3954ab6b Binary files /dev/null and b/microhttpd/0.9.70/Linux-x86_64/libmicrohttpd.so.12.55.0 differ diff --git a/microhttpd/0.9.70/Linux-x86_64_5/Linux-x86_64_5.tar b/microhttpd/0.9.70/Linux-x86_64_5/Linux-x86_64_5.tar new file mode 100644 index 0000000000000000000000000000000000000000..b4e5e12cee077ed54ecc1d3c4a6e113e4d3f5567 Binary files /dev/null and b/microhttpd/0.9.70/Linux-x86_64_5/Linux-x86_64_5.tar differ diff --git a/microhttpd/0.9.70/Linux-x86_64_5/libgnutls.so b/microhttpd/0.9.70/Linux-x86_64_5/libgnutls.so new file mode 120000 index 0000000000000000000000000000000000000000..7fba0606aa66fdb971314d2763a5e40023bc46b2 --- /dev/null +++ b/microhttpd/0.9.70/Linux-x86_64_5/libgnutls.so @@ -0,0 +1 @@ +libgnutls.so.26 \ No newline at end of file diff --git a/microhttpd/0.9.70/Linux-x86_64_5/libgnutls.so.26 b/microhttpd/0.9.70/Linux-x86_64_5/libgnutls.so.26 new file mode 120000 index 0000000000000000000000000000000000000000..d8db83d91c454af911b390e44a6ebde8710e7440 --- /dev/null +++ b/microhttpd/0.9.70/Linux-x86_64_5/libgnutls.so.26 @@ -0,0 +1 @@ +libgnutls.so.26.16.14 \ No newline at end of file diff --git a/microhttpd/0.9.70/Linux-x86_64_5/libgnutls.so.26.16.14 b/microhttpd/0.9.70/Linux-x86_64_5/libgnutls.so.26.16.14 new file mode 100755 index 0000000000000000000000000000000000000000..a3b1c2877c912bd0aab37c08fa3477174f283432 Binary files /dev/null and b/microhttpd/0.9.70/Linux-x86_64_5/libgnutls.so.26.16.14 differ diff --git a/microhttpd/0.9.70/Linux-x86_64_5/libmicrohttpd.so b/microhttpd/0.9.70/Linux-x86_64_5/libmicrohttpd.so new file mode 120000 index 0000000000000000000000000000000000000000..e2b70f8b602931f01f6b9273ccfcbfbccefa0b8d --- /dev/null +++ b/microhttpd/0.9.70/Linux-x86_64_5/libmicrohttpd.so @@ -0,0 +1 @@ +libmicrohttpd.so.12.53.0 \ No newline at end of file diff --git a/microhttpd/0.9.70/Linux-x86_64_5/libmicrohttpd.so.12 b/microhttpd/0.9.70/Linux-x86_64_5/libmicrohttpd.so.12 new file mode 120000 index 0000000000000000000000000000000000000000..e2b70f8b602931f01f6b9273ccfcbfbccefa0b8d --- /dev/null +++ b/microhttpd/0.9.70/Linux-x86_64_5/libmicrohttpd.so.12 @@ -0,0 +1 @@ +libmicrohttpd.so.12.53.0 \ No newline at end of file diff --git a/microhttpd/0.9.70/Linux-x86_64_5/libmicrohttpd.so.12.53.0 b/microhttpd/0.9.70/Linux-x86_64_5/libmicrohttpd.so.12.53.0 new file mode 100755 index 0000000000000000000000000000000000000000..cf3b97c86c2d6ac7469de1b84d824f1c3981cfe3 Binary files /dev/null and b/microhttpd/0.9.70/Linux-x86_64_5/libmicrohttpd.so.12.53.0 differ diff --git a/microhttpd/0.9.70/Linux-x86_64_6/Linux-x86_64_6.tar b/microhttpd/0.9.70/Linux-x86_64_6/Linux-x86_64_6.tar new file mode 100644 index 0000000000000000000000000000000000000000..00a7d70de996d2256593483517fad3d461f1eba2 Binary files /dev/null and b/microhttpd/0.9.70/Linux-x86_64_6/Linux-x86_64_6.tar differ diff --git a/microhttpd/0.9.70/Linux-x86_64_6/libgnutls.so b/microhttpd/0.9.70/Linux-x86_64_6/libgnutls.so new file mode 120000 index 0000000000000000000000000000000000000000..7fba0606aa66fdb971314d2763a5e40023bc46b2 --- /dev/null +++ b/microhttpd/0.9.70/Linux-x86_64_6/libgnutls.so @@ -0,0 +1 @@ +libgnutls.so.26 \ No newline at end of file diff --git a/microhttpd/0.9.70/Linux-x86_64_6/libgnutls.so.26 b/microhttpd/0.9.70/Linux-x86_64_6/libgnutls.so.26 new file mode 120000 index 0000000000000000000000000000000000000000..d8db83d91c454af911b390e44a6ebde8710e7440 --- /dev/null +++ b/microhttpd/0.9.70/Linux-x86_64_6/libgnutls.so.26 @@ -0,0 +1 @@ +libgnutls.so.26.16.14 \ No newline at end of file diff --git a/microhttpd/0.9.70/Linux-x86_64_6/libgnutls.so.26.16.14 b/microhttpd/0.9.70/Linux-x86_64_6/libgnutls.so.26.16.14 new file mode 100755 index 0000000000000000000000000000000000000000..a3b1c2877c912bd0aab37c08fa3477174f283432 Binary files /dev/null and b/microhttpd/0.9.70/Linux-x86_64_6/libgnutls.so.26.16.14 differ diff --git a/microhttpd/0.9.70/Linux-x86_64_6/libmicrohttpd.so b/microhttpd/0.9.70/Linux-x86_64_6/libmicrohttpd.so new file mode 120000 index 0000000000000000000000000000000000000000..e2b70f8b602931f01f6b9273ccfcbfbccefa0b8d --- /dev/null +++ b/microhttpd/0.9.70/Linux-x86_64_6/libmicrohttpd.so @@ -0,0 +1 @@ +libmicrohttpd.so.12.53.0 \ No newline at end of file diff --git a/microhttpd/0.9.70/Linux-x86_64_6/libmicrohttpd.so.12 b/microhttpd/0.9.70/Linux-x86_64_6/libmicrohttpd.so.12 new file mode 120000 index 0000000000000000000000000000000000000000..e2b70f8b602931f01f6b9273ccfcbfbccefa0b8d --- /dev/null +++ b/microhttpd/0.9.70/Linux-x86_64_6/libmicrohttpd.so.12 @@ -0,0 +1 @@ +libmicrohttpd.so.12.53.0 \ No newline at end of file diff --git a/microhttpd/0.9.70/Linux-x86_64_6/libmicrohttpd.so.12.53.0 b/microhttpd/0.9.70/Linux-x86_64_6/libmicrohttpd.so.12.53.0 new file mode 100755 index 0000000000000000000000000000000000000000..cf3b97c86c2d6ac7469de1b84d824f1c3981cfe3 Binary files /dev/null and b/microhttpd/0.9.70/Linux-x86_64_6/libmicrohttpd.so.12.53.0 differ diff --git a/microhttpd/0.9.70/SunOS-5.10/SunOS-5.10.tar b/microhttpd/0.9.70/SunOS-5.10/SunOS-5.10.tar new file mode 100644 index 0000000000000000000000000000000000000000..53bde535e03e62ec2c987d42813fbc713132595c Binary files /dev/null and b/microhttpd/0.9.70/SunOS-5.10/SunOS-5.10.tar differ diff --git a/microhttpd/0.9.70/SunOS-5.10/libmicrohttpd.so b/microhttpd/0.9.70/SunOS-5.10/libmicrohttpd.so new file mode 120000 index 0000000000000000000000000000000000000000..5162fca8f9a38b996137c388ff6707bbb2bf5f7d --- /dev/null +++ b/microhttpd/0.9.70/SunOS-5.10/libmicrohttpd.so @@ -0,0 +1 @@ +libmicrohttpd.so.12.55.0 \ No newline at end of file diff --git a/microhttpd/0.9.70/SunOS-5.10/libmicrohttpd.so.12 b/microhttpd/0.9.70/SunOS-5.10/libmicrohttpd.so.12 new file mode 120000 index 0000000000000000000000000000000000000000..5162fca8f9a38b996137c388ff6707bbb2bf5f7d --- /dev/null +++ b/microhttpd/0.9.70/SunOS-5.10/libmicrohttpd.so.12 @@ -0,0 +1 @@ +libmicrohttpd.so.12.55.0 \ No newline at end of file diff --git a/microhttpd/0.9.70/SunOS-5.10/libmicrohttpd.so.12.55.0 b/microhttpd/0.9.70/SunOS-5.10/libmicrohttpd.so.12.55.0 new file mode 100755 index 0000000000000000000000000000000000000000..be30f45a44595c6a6ff52fc4f7a09b21382c6a9e Binary files /dev/null and b/microhttpd/0.9.70/SunOS-5.10/libmicrohttpd.so.12.55.0 differ diff --git a/microhttpd/0.9.70/SunOS-sun4v/SunOS-sun4v.tar b/microhttpd/0.9.70/SunOS-sun4v/SunOS-sun4v.tar new file mode 100644 index 0000000000000000000000000000000000000000..e505b2070e7c413548369ee4deb94cf2fda1154f Binary files /dev/null and b/microhttpd/0.9.70/SunOS-sun4v/SunOS-sun4v.tar differ diff --git a/microhttpd/0.9.70/SunOS-sun4v/libmicrohttpd.so b/microhttpd/0.9.70/SunOS-sun4v/libmicrohttpd.so new file mode 120000 index 0000000000000000000000000000000000000000..5162fca8f9a38b996137c388ff6707bbb2bf5f7d --- /dev/null +++ b/microhttpd/0.9.70/SunOS-sun4v/libmicrohttpd.so @@ -0,0 +1 @@ +libmicrohttpd.so.12.55.0 \ No newline at end of file diff --git a/microhttpd/0.9.70/SunOS-sun4v/libmicrohttpd.so.12 b/microhttpd/0.9.70/SunOS-sun4v/libmicrohttpd.so.12 new file mode 120000 index 0000000000000000000000000000000000000000..5162fca8f9a38b996137c388ff6707bbb2bf5f7d --- /dev/null +++ b/microhttpd/0.9.70/SunOS-sun4v/libmicrohttpd.so.12 @@ -0,0 +1 @@ +libmicrohttpd.so.12.55.0 \ No newline at end of file diff --git a/microhttpd/0.9.70/SunOS-sun4v/libmicrohttpd.so.12.55.0 b/microhttpd/0.9.70/SunOS-sun4v/libmicrohttpd.so.12.55.0 new file mode 100755 index 0000000000000000000000000000000000000000..be30f45a44595c6a6ff52fc4f7a09b21382c6a9e Binary files /dev/null and b/microhttpd/0.9.70/SunOS-sun4v/libmicrohttpd.so.12.55.0 differ diff --git a/microhttpd/0.9.70/include.tar b/microhttpd/0.9.70/include.tar new file mode 100644 index 0000000000000000000000000000000000000000..af0df19b7551610b14f42c376df13b93cf2700fc Binary files /dev/null and b/microhttpd/0.9.70/include.tar differ diff --git a/microhttpd/0.9.70/include/microhttpd.h b/microhttpd/0.9.70/include/microhttpd.h new file mode 100644 index 0000000000000000000000000000000000000000..b2bcaaf581d3db60bc4e5925e8b50e905eaf89f0 --- /dev/null +++ b/microhttpd/0.9.70/include/microhttpd.h @@ -0,0 +1,4055 @@ +/* + This file is part of libmicrohttpd + Copyright (C) 2006--2019 Christian Grothoff (and other contributing authors) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/** + * @file microhttpd.h + * @brief public interface to libmicrohttpd + * @author Christian Grothoff + * @author Karlson2k (Evgeny Grin) + * @author Chris GauthierDickey + * + * All symbols defined in this header start with MHD. MHD is a small + * HTTP daemon library. As such, it does not have any API for logging + * errors (you can only enable or disable logging to stderr). Also, + * it may not support all of the HTTP features directly, where + * applicable, portions of HTTP may have to be handled by clients of + * the library. + * + * The library is supposed to handle everything that it must handle + * (because the API would not allow clients to do this), such as basic + * connection management; however, detailed interpretations of headers + * -- such as range requests -- and HTTP methods are left to clients. + * The library does understand HEAD and will only send the headers of + * the response and not the body, even if the client supplied a body. + * The library also understands headers that control connection + * management (specifically, "Connection: close" and "Expect: 100 + * continue" are understood and handled automatically). + * + * MHD understands POST data and is able to decode certain formats + * (at the moment only "application/x-www-form-urlencoded" and + * "mulitpart/formdata"). Unsupported encodings and large POST + * submissions may require the application to manually process + * the stream, which is provided to the main application (and thus can be + * processed, just not conveniently by MHD). + * + * The header file defines various constants used by the HTTP protocol. + * This does not mean that MHD actually interprets all of these + * values. The provided constants are exported as a convenience + * for users of the library. MHD does not verify that transmitted + * HTTP headers are part of the standard specification; users of the + * library are free to define their own extensions of the HTTP + * standard and use those with MHD. + * + * All functions are guaranteed to be completely reentrant and + * thread-safe (with the exception of #MHD_set_connection_value, + * which must only be used in a particular context). + * + * + * @defgroup event event-loop control + * MHD API to start and stop the HTTP server and manage the event loop. + * @defgroup response generation of responses + * MHD API used to generate responses. + * @defgroup request handling of requests + * MHD API used to access information about requests. + * @defgroup authentication HTTP authentication + * MHD API related to basic and digest HTTP authentication. + * @defgroup logging logging + * MHD API to mange logging and error handling + * @defgroup specialized misc. specialized functions + * This group includes functions that do not fit into any particular + * category and that are rarely used. + */ + +#ifndef MHD_MICROHTTPD_H +#define MHD_MICROHTTPD_H + +#ifdef __cplusplus +extern "C" +{ +#if 0 /* keep Emacsens' auto-indent happy */ +} +#endif +#endif + +/* While we generally would like users to use a configure-driven + build process which detects which headers are present and + hence works on any platform, we use "standard" includes here + to build out-of-the-box for beginning users on common systems. + + If generic headers don't work on your platform, include headers + which define 'va_list', 'size_t', 'ssize_t', 'intptr_t', + 'uint16_t', 'uint32_t', 'uint64_t', 'off_t', 'struct sockaddr', + 'socklen_t', 'fd_set' and "#define MHD_PLATFORM_H" before + including "microhttpd.h". Then the following "standard" + includes won't be used (which might be a good idea, especially + on platforms where they do not exist). + */ +#ifndef MHD_PLATFORM_H +#if defined(_WIN32) && ! defined(__CYGWIN__) && \ + ! defined(_CRT_DECLARE_NONSTDC_NAMES) +#define _CRT_DECLARE_NONSTDC_NAMES 1 +#endif /* _WIN32 && ! __CYGWIN__ && ! _CRT_DECLARE_NONSTDC_NAMES */ +#include +#include +#include +#if ! defined(_WIN32) || defined(__CYGWIN__) +#include +#include +#include +#else /* _WIN32 && ! __CYGWIN__ */ +/* Declare POSIX-compatible names */ +#define _CRT_DECLARE_NONSTDC_NAMES 1 +#include +#if defined(_MSC_FULL_VER) && ! defined (_SSIZE_T_DEFINED) +#define _SSIZE_T_DEFINED +typedef intptr_t ssize_t; +#endif /* !_SSIZE_T_DEFINED */ +#endif /* _WIN32 && ! __CYGWIN__ */ +#endif + +#if defined(__CYGWIN__) && ! defined(_SYS_TYPES_FD_SET) +/* Do not define __USE_W32_SOCKETS under Cygwin! */ +#error Cygwin with winsock fd_set is not supported +#endif + +/** + * Current version of the library. + * 0x01093001 = 1.9.30-1. + */ +#define MHD_VERSION 0x00097000 + +/** + * MHD-internal return code for "YES". + */ +#define MHD_YES 1 + +/** + * MHD-internal return code for "NO". + */ +#define MHD_NO 0 + +/** + * MHD digest auth internal code for an invalid nonce. + */ +#define MHD_INVALID_NONCE -1 + +/** + * Constant used to indicate unknown size (use when + * creating a response). + */ +#ifdef UINT64_MAX +#define MHD_SIZE_UNKNOWN UINT64_MAX +#else +#define MHD_SIZE_UNKNOWN ((uint64_t) -1LL) +#endif + +#ifdef SIZE_MAX +#define MHD_CONTENT_READER_END_OF_STREAM SIZE_MAX +#define MHD_CONTENT_READER_END_WITH_ERROR (SIZE_MAX - 1) +#else +#define MHD_CONTENT_READER_END_OF_STREAM ((size_t) -1LL) +#define MHD_CONTENT_READER_END_WITH_ERROR (((size_t) -1LL) - 1) +#endif + +#ifndef _MHD_EXTERN +#if defined(_WIN32) && defined(MHD_W32LIB) +#define _MHD_EXTERN extern +#elif defined (_WIN32) && defined(MHD_W32DLL) +/* Define MHD_W32DLL when using MHD as W32 .DLL to speed up linker a little */ +#define _MHD_EXTERN __declspec(dllimport) +#else +#define _MHD_EXTERN extern +#endif +#endif + +#ifndef MHD_SOCKET_DEFINED +/** + * MHD_socket is type for socket FDs + */ +#if ! defined(_WIN32) || defined(_SYS_TYPES_FD_SET) +#define MHD_POSIX_SOCKETS 1 +typedef int MHD_socket; +#define MHD_INVALID_SOCKET (-1) +#else /* !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) */ +#define MHD_WINSOCK_SOCKETS 1 +#include +typedef SOCKET MHD_socket; +#define MHD_INVALID_SOCKET (INVALID_SOCKET) +#endif /* !defined(_WIN32) || defined(_SYS_TYPES_FD_SET) */ +#define MHD_SOCKET_DEFINED 1 +#endif /* MHD_SOCKET_DEFINED */ + +/** + * Define MHD_NO_DEPRECATION before including "microhttpd.h" to disable deprecation messages + */ +#ifdef MHD_NO_DEPRECATION +#define _MHD_DEPR_MACRO(msg) +#define _MHD_NO_DEPR_IN_MACRO 1 +#define _MHD_DEPR_IN_MACRO(msg) +#define _MHD_NO_DEPR_FUNC 1 +#define _MHD_DEPR_FUNC(msg) +#endif /* MHD_NO_DEPRECATION */ + +#ifndef _MHD_DEPR_MACRO +#if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1500 +/* VS 2008 or later */ +/* Stringify macros */ +#define _MHD_INSTRMACRO(a) #a +#define _MHD_STRMACRO(a) _MHD_INSTRMACRO (a) +/* deprecation message */ +#define _MHD_DEPR_MACRO(msg) __pragma (message (__FILE__ "(" _MHD_STRMACRO ( \ + __LINE__) "): warning: " msg)) +#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg) +#elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__) +/* clang or GCC since 3.0 */ +#define _MHD_GCC_PRAG(x) _Pragma (#x) +#if (defined(__clang__) && (__clang_major__ + 0 >= 5 || \ + (! defined(__apple_build_version__) && \ + (__clang_major__ + 0 > 3 || (__clang_major__ + 0 == 3 && __clang_minor__ >= \ + 3))))) || \ + __GNUC__ + 0 > 4 || (__GNUC__ + 0 == 4 && __GNUC_MINOR__ + 0 >= 8) +/* clang >= 3.3 (or XCode's clang >= 5.0) or + GCC >= 4.8 */ +#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (GCC warning msg) +#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg) +#else /* older clang or GCC */ +/* clang < 3.3, XCode's clang < 5.0, 3.0 <= GCC < 4.8 */ +#define _MHD_DEPR_MACRO(msg) _MHD_GCC_PRAG (message msg) +#if (defined(__clang__) && (__clang_major__ + 0 > 2 || (__clang_major__ + 0 == \ + 2 && __clang_minor__ >= \ + 9))) /* FIXME: clang >= 2.9, earlier versions not tested */ +/* clang handles inline pragmas better than GCC */ +#define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg) +#endif /* clang >= 2.9 */ +#endif /* older clang or GCC */ +/* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */ +#endif /* clang || GCC >= 3.0 */ +#endif /* !_MHD_DEPR_MACRO */ + +#ifndef _MHD_DEPR_MACRO +#define _MHD_DEPR_MACRO(msg) +#endif /* !_MHD_DEPR_MACRO */ + +#ifndef _MHD_DEPR_IN_MACRO +#define _MHD_NO_DEPR_IN_MACRO 1 +#define _MHD_DEPR_IN_MACRO(msg) +#endif /* !_MHD_DEPR_IN_MACRO */ + +#ifndef _MHD_DEPR_FUNC +#if defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1400 +/* VS 2005 or later */ +#define _MHD_DEPR_FUNC(msg) __declspec(deprecated (msg)) +#elif defined(_MSC_FULL_VER) && _MSC_VER + 0 >= 1310 +/* VS .NET 2003 deprecation do not support custom messages */ +#define _MHD_DEPR_FUNC(msg) __declspec(deprecated) +#elif (__GNUC__ + 0 >= 5) || (defined (__clang__) && \ + (__clang_major__ + 0 > 2 || (__clang_major__ + 0 == 2 && __clang_minor__ >= \ + 9))) /* FIXME: earlier versions not tested */ +/* GCC >= 5.0 or clang >= 2.9 */ +#define _MHD_DEPR_FUNC(msg) __attribute__((deprecated (msg))) +#elif defined (__clang__) || __GNUC__ + 0 > 3 || (__GNUC__ + 0 == 3 && \ + __GNUC_MINOR__ + 0 >= 1) +/* 3.1 <= GCC < 5.0 or clang < 2.9 */ +/* old GCC-style deprecation do not support custom messages */ +#define _MHD_DEPR_FUNC(msg) __attribute__((__deprecated__)) +/* #elif defined(SOMEMACRO) */ /* add compiler-specific macros here if required */ +#endif /* clang < 2.9 || GCC >= 3.1 */ +#endif /* !_MHD_DEPR_FUNC */ + +#ifndef _MHD_DEPR_FUNC +#define _MHD_NO_DEPR_FUNC 1 +#define _MHD_DEPR_FUNC(msg) +#endif /* !_MHD_DEPR_FUNC */ + +/** + * Not all architectures and `printf()`'s support the `long long` type. + * This gives the ability to replace `long long` with just a `long`, + * standard `int` or a `short`. + */ +#ifndef MHD_LONG_LONG +/** + * @deprecated use #MHD_UNSIGNED_LONG_LONG instead! + */ +#define MHD_LONG_LONG long long +#define MHD_UNSIGNED_LONG_LONG unsigned long long +#else /* MHD_LONG_LONG */ +_MHD_DEPR_MACRO ( + "Macro MHD_LONG_LONG is deprecated, use MHD_UNSIGNED_LONG_LONG") +#endif +/** + * Format string for printing a variable of type #MHD_LONG_LONG. + * You should only redefine this if you also define #MHD_LONG_LONG. + */ +#ifndef MHD_LONG_LONG_PRINTF +/** + * @deprecated use #MHD_UNSIGNED_LONG_LONG_PRINTF instead! + */ +#define MHD_LONG_LONG_PRINTF "ll" +#define MHD_UNSIGNED_LONG_LONG_PRINTF "%llu" +#else /* MHD_LONG_LONG_PRINTF */ +_MHD_DEPR_MACRO ( + "Macro MHD_LONG_LONG_PRINTF is deprecated, use MHD_UNSIGNED_LONG_LONG_PRINTF") +#endif + + +/** + * Length of the binary output of the MD5 hash function. + */ +#define MHD_MD5_DIGEST_SIZE 16 + + +/** + * @defgroup httpcode HTTP response codes. + * These are the status codes defined for HTTP responses. + * See: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml + * Registry export date: 2019-06-09 + * @{ + */ + +/* 100 "Continue". RFC7231, Section 6.2.1. */ +#define MHD_HTTP_CONTINUE 100 +/* 101 "Switching Protocols". RFC7231, Section 6.2.2. */ +#define MHD_HTTP_SWITCHING_PROTOCOLS 101 +/* 102 "Processing". RFC2518. */ +#define MHD_HTTP_PROCESSING 102 +/* 103 "Early Hints". RFC8297. */ +#define MHD_HTTP_EARLY_HINTS 103 + +/* 200 "OK". RFC7231, Section 6.3.1. */ +#define MHD_HTTP_OK 200 +/* 201 "Created". RFC7231, Section 6.3.2. */ +#define MHD_HTTP_CREATED 201 +/* 202 "Accepted". RFC7231, Section 6.3.3. */ +#define MHD_HTTP_ACCEPTED 202 +/* 203 "Non-Authoritative Information". RFC7231, Section 6.3.4. */ +#define MHD_HTTP_NON_AUTHORITATIVE_INFORMATION 203 +/* 204 "No Content". RFC7231, Section 6.3.5. */ +#define MHD_HTTP_NO_CONTENT 204 +/* 205 "Reset Content". RFC7231, Section 6.3.6. */ +#define MHD_HTTP_RESET_CONTENT 205 +/* 206 "Partial Content". RFC7233, Section 4.1. */ +#define MHD_HTTP_PARTIAL_CONTENT 206 +/* 207 "Multi-Status". RFC4918. */ +#define MHD_HTTP_MULTI_STATUS 207 +/* 208 "Already Reported". RFC5842. */ +#define MHD_HTTP_ALREADY_REPORTED 208 + +/* 226 "IM Used". RFC3229. */ +#define MHD_HTTP_IM_USED 226 + +/* 300 "Multiple Choices". RFC7231, Section 6.4.1. */ +#define MHD_HTTP_MULTIPLE_CHOICES 300 +/* 301 "Moved Permanently". RFC7231, Section 6.4.2. */ +#define MHD_HTTP_MOVED_PERMANENTLY 301 +/* 302 "Found". RFC7231, Section 6.4.3. */ +#define MHD_HTTP_FOUND 302 +/* 303 "See Other". RFC7231, Section 6.4.4. */ +#define MHD_HTTP_SEE_OTHER 303 +/* 304 "Not Modified". RFC7232, Section 4.1. */ +#define MHD_HTTP_NOT_MODIFIED 304 +/* 305 "Use Proxy". RFC7231, Section 6.4.5. */ +#define MHD_HTTP_USE_PROXY 305 +/* 306 "Switch Proxy". Not used! RFC7231, Section 6.4.6. */ +#define MHD_HTTP_SWITCH_PROXY 306 +/* 307 "Temporary Redirect". RFC7231, Section 6.4.7. */ +#define MHD_HTTP_TEMPORARY_REDIRECT 307 +/* 308 "Permanent Redirect". RFC7538. */ +#define MHD_HTTP_PERMANENT_REDIRECT 308 + +/* 400 "Bad Request". RFC7231, Section 6.5.1. */ +#define MHD_HTTP_BAD_REQUEST 400 +/* 401 "Unauthorized". RFC7235, Section 3.1. */ +#define MHD_HTTP_UNAUTHORIZED 401 +/* 402 "Payment Required". RFC7231, Section 6.5.2. */ +#define MHD_HTTP_PAYMENT_REQUIRED 402 +/* 403 "Forbidden". RFC7231, Section 6.5.3. */ +#define MHD_HTTP_FORBIDDEN 403 +/* 404 "Not Found". RFC7231, Section 6.5.4. */ +#define MHD_HTTP_NOT_FOUND 404 +/* 405 "Method Not Allowed". RFC7231, Section 6.5.5. */ +#define MHD_HTTP_METHOD_NOT_ALLOWED 405 +/* 406 "Not Acceptable". RFC7231, Section 6.5.6. */ +#define MHD_HTTP_NOT_ACCEPTABLE 406 +/* 407 "Proxy Authentication Required". RFC7235, Section 3.2. */ +#define MHD_HTTP_PROXY_AUTHENTICATION_REQUIRED 407 +/* 408 "Request Timeout". RFC7231, Section 6.5.7. */ +#define MHD_HTTP_REQUEST_TIMEOUT 408 +/* 409 "Conflict". RFC7231, Section 6.5.8. */ +#define MHD_HTTP_CONFLICT 409 +/* 410 "Gone". RFC7231, Section 6.5.9. */ +#define MHD_HTTP_GONE 410 +/* 411 "Length Required". RFC7231, Section 6.5.10. */ +#define MHD_HTTP_LENGTH_REQUIRED 411 +/* 412 "Precondition Failed". RFC7232, Section 4.2; RFC8144, Section 3.2. */ +#define MHD_HTTP_PRECONDITION_FAILED 412 +/* 413 "Payload Too Large". RFC7231, Section 6.5.11. */ +#define MHD_HTTP_PAYLOAD_TOO_LARGE 413 +/* 414 "URI Too Long". RFC7231, Section 6.5.12. */ +#define MHD_HTTP_URI_TOO_LONG 414 +/* 415 "Unsupported Media Type". RFC7231, Section 6.5.13; RFC7694, Section 3. */ +#define MHD_HTTP_UNSUPPORTED_MEDIA_TYPE 415 +/* 416 "Range Not Satisfiable". RFC7233, Section 4.4. */ +#define MHD_HTTP_RANGE_NOT_SATISFIABLE 416 +/* 417 "Expectation Failed". RFC7231, Section 6.5.14. */ +#define MHD_HTTP_EXPECTATION_FAILED 417 + +/* 421 "Misdirected Request". RFC7540, Section 9.1.2. */ +#define MHD_HTTP_MISDIRECTED_REQUEST 421 +/* 422 "Unprocessable Entity". RFC4918. */ +#define MHD_HTTP_UNPROCESSABLE_ENTITY 422 +/* 423 "Locked". RFC4918. */ +#define MHD_HTTP_LOCKED 423 +/* 424 "Failed Dependency". RFC4918. */ +#define MHD_HTTP_FAILED_DEPENDENCY 424 +/* 425 "Too Early". RFC8470. */ +#define MHD_HTTP_TOO_EARLY 425 +/* 426 "Upgrade Required". RFC7231, Section 6.5.15. */ +#define MHD_HTTP_UPGRADE_REQUIRED 426 + +/* 428 "Precondition Required". RFC6585. */ +#define MHD_HTTP_PRECONDITION_REQUIRED 428 +/* 429 "Too Many Requests". RFC6585. */ +#define MHD_HTTP_TOO_MANY_REQUESTS 429 + +/* 431 "Request Header Fields Too Large". RFC6585. */ +#define MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE 431 + +/* 451 "Unavailable For Legal Reasons". RFC7725. */ +#define MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451 + +/* 500 "Internal Server Error". RFC7231, Section 6.6.1. */ +#define MHD_HTTP_INTERNAL_SERVER_ERROR 500 +/* 501 "Not Implemented". RFC7231, Section 6.6.2. */ +#define MHD_HTTP_NOT_IMPLEMENTED 501 +/* 502 "Bad Gateway". RFC7231, Section 6.6.3. */ +#define MHD_HTTP_BAD_GATEWAY 502 +/* 503 "Service Unavailable". RFC7231, Section 6.6.4. */ +#define MHD_HTTP_SERVICE_UNAVAILABLE 503 +/* 504 "Gateway Timeout". RFC7231, Section 6.6.5. */ +#define MHD_HTTP_GATEWAY_TIMEOUT 504 +/* 505 "HTTP Version Not Supported". RFC7231, Section 6.6.6. */ +#define MHD_HTTP_HTTP_VERSION_NOT_SUPPORTED 505 +/* 506 "Variant Also Negotiates". RFC2295. */ +#define MHD_HTTP_VARIANT_ALSO_NEGOTIATES 506 +/* 507 "Insufficient Storage". RFC4918. */ +#define MHD_HTTP_INSUFFICIENT_STORAGE 507 +/* 508 "Loop Detected". RFC5842. */ +#define MHD_HTTP_LOOP_DETECTED 508 + +/* 510 "Not Extended". RFC2774. */ +#define MHD_HTTP_NOT_EXTENDED 510 +/* 511 "Network Authentication Required". RFC6585. */ +#define MHD_HTTP_NETWORK_AUTHENTICATION_REQUIRED 511 + + +/* Not registered non-standard codes */ +/* 449 "Reply With". MS IIS extension. */ +#define MHD_HTTP_RETRY_WITH 449 + +/* 450 "Blocked by Windows Parental Controls". MS extension. */ +#define MHD_HTTP_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS 450 + +/* 509 "Bandwidth Limit Exceeded". Apache extension. */ +#define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509 + + +/* Deprecated codes */ +/** @deprecated */ +#define MHD_HTTP_METHOD_NOT_ACCEPTABLE \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_HTTP_METHOD_NOT_ACCEPTABLE is deprecated, use MHD_HTTP_NOT_ACCEPTABLE") \ + 406 + +/** @deprecated */ +#define MHD_HTTP_REQUEST_ENTITY_TOO_LARGE \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_HTTP_REQUEST_ENTITY_TOO_LARGE is deprecated, use MHD_HTTP_PAYLOAD_TOO_LARGE") \ + 413 + +/** @deprecated */ +#define MHD_HTTP_REQUEST_URI_TOO_LONG \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_HTTP_REQUEST_URI_TOO_LONG is deprecated, use MHD_HTTP_URI_TOO_LONG") \ + 414 + +/** @deprecated */ +#define MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_HTTP_REQUESTED_RANGE_NOT_SATISFIABLE is deprecated, use MHD_HTTP_RANGE_NOT_SATISFIABLE") \ + 416 + +/** @deprecated */ +#define MHD_HTTP_UNORDERED_COLLECTION \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_HTTP_UNORDERED_COLLECTION is deprecated as it was removed from RFC") \ + 425 + +/** @deprecated */ +#define MHD_HTTP_NO_RESPONSE \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_HTTP_NO_RESPONSE is deprecated as it is nginx internal code for logs only") \ + 444 + + +/** @} */ /* end of group httpcode */ + +/** + * Returns the string reason phrase for a response code. + * + * If message string is not available for a status code, + * "Unknown" string will be returned. + */ +_MHD_EXTERN const char * +MHD_get_reason_phrase_for (unsigned int code); + + +/** + * Flag to be or-ed with MHD_HTTP status code for + * SHOUTcast. This will cause the response to begin + * with the SHOUTcast "ICY" line instad of "HTTP". + * @ingroup specialized + */ +#define MHD_ICY_FLAG ((uint32_t) (((uint32_t) 1) << 31)) + +/** + * @defgroup headers HTTP headers + * These are the standard headers found in HTTP requests and responses. + * See: http://www.iana.org/assignments/message-headers/message-headers.xml + * Registry export date: 2019-06-09 + * @{ + */ + +/* Main HTTP headers. */ +/* Standard. RFC7231, Section 5.3.2 */ +#define MHD_HTTP_HEADER_ACCEPT "Accept" +/* Standard. RFC7231, Section 5.3.3 */ +#define MHD_HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset" +/* Standard. RFC7231, Section 5.3.4; RFC7694, Section 3 */ +#define MHD_HTTP_HEADER_ACCEPT_ENCODING "Accept-Encoding" +/* Standard. RFC7231, Section 5.3.5 */ +#define MHD_HTTP_HEADER_ACCEPT_LANGUAGE "Accept-Language" +/* Standard. RFC7233, Section 2.3 */ +#define MHD_HTTP_HEADER_ACCEPT_RANGES "Accept-Ranges" +/* Standard. RFC7234, Section 5.1 */ +#define MHD_HTTP_HEADER_AGE "Age" +/* Standard. RFC7231, Section 7.4.1 */ +#define MHD_HTTP_HEADER_ALLOW "Allow" +/* Standard. RFC7235, Section 4.2 */ +#define MHD_HTTP_HEADER_AUTHORIZATION "Authorization" +/* Standard. RFC7234, Section 5.2 */ +#define MHD_HTTP_HEADER_CACHE_CONTROL "Cache-Control" +/* Reserved. RFC7230, Section 8.1 */ +#define MHD_HTTP_HEADER_CLOSE "Close" +/* Standard. RFC7230, Section 6.1 */ +#define MHD_HTTP_HEADER_CONNECTION "Connection" +/* Standard. RFC7231, Section 3.1.2.2 */ +#define MHD_HTTP_HEADER_CONTENT_ENCODING "Content-Encoding" +/* Standard. RFC7231, Section 3.1.3.2 */ +#define MHD_HTTP_HEADER_CONTENT_LANGUAGE "Content-Language" +/* Standard. RFC7230, Section 3.3.2 */ +#define MHD_HTTP_HEADER_CONTENT_LENGTH "Content-Length" +/* Standard. RFC7231, Section 3.1.4.2 */ +#define MHD_HTTP_HEADER_CONTENT_LOCATION "Content-Location" +/* Standard. RFC7233, Section 4.2 */ +#define MHD_HTTP_HEADER_CONTENT_RANGE "Content-Range" +/* Standard. RFC7231, Section 3.1.1.5 */ +#define MHD_HTTP_HEADER_CONTENT_TYPE "Content-Type" +/* Standard. RFC7231, Section 7.1.1.2 */ +#define MHD_HTTP_HEADER_DATE "Date" +/* Standard. RFC7232, Section 2.3 */ +#define MHD_HTTP_HEADER_ETAG "ETag" +/* Standard. RFC7231, Section 5.1.1 */ +#define MHD_HTTP_HEADER_EXPECT "Expect" +/* Standard. RFC7234, Section 5.3 */ +#define MHD_HTTP_HEADER_EXPIRES "Expires" +/* Standard. RFC7231, Section 5.5.1 */ +#define MHD_HTTP_HEADER_FROM "From" +/* Standard. RFC7230, Section 5.4 */ +#define MHD_HTTP_HEADER_HOST "Host" +/* Standard. RFC7232, Section 3.1 */ +#define MHD_HTTP_HEADER_IF_MATCH "If-Match" +/* Standard. RFC7232, Section 3.3 */ +#define MHD_HTTP_HEADER_IF_MODIFIED_SINCE "If-Modified-Since" +/* Standard. RFC7232, Section 3.2 */ +#define MHD_HTTP_HEADER_IF_NONE_MATCH "If-None-Match" +/* Standard. RFC7233, Section 3.2 */ +#define MHD_HTTP_HEADER_IF_RANGE "If-Range" +/* Standard. RFC7232, Section 3.4 */ +#define MHD_HTTP_HEADER_IF_UNMODIFIED_SINCE "If-Unmodified-Since" +/* Standard. RFC7232, Section 2.2 */ +#define MHD_HTTP_HEADER_LAST_MODIFIED "Last-Modified" +/* Standard. RFC7231, Section 7.1.2 */ +#define MHD_HTTP_HEADER_LOCATION "Location" +/* Standard. RFC7231, Section 5.1.2 */ +#define MHD_HTTP_HEADER_MAX_FORWARDS "Max-Forwards" +/* Standard. RFC7231, Appendix A.1 */ +#define MHD_HTTP_HEADER_MIME_VERSION "MIME-Version" +/* Standard. RFC7234, Section 5.4 */ +#define MHD_HTTP_HEADER_PRAGMA "Pragma" +/* Standard. RFC7235, Section 4.3 */ +#define MHD_HTTP_HEADER_PROXY_AUTHENTICATE "Proxy-Authenticate" +/* Standard. RFC7235, Section 4.4 */ +#define MHD_HTTP_HEADER_PROXY_AUTHORIZATION "Proxy-Authorization" +/* Standard. RFC7233, Section 3.1 */ +#define MHD_HTTP_HEADER_RANGE "Range" +/* Standard. RFC7231, Section 5.5.2 */ +#define MHD_HTTP_HEADER_REFERER "Referer" +/* Standard. RFC7231, Section 7.1.3 */ +#define MHD_HTTP_HEADER_RETRY_AFTER "Retry-After" +/* Standard. RFC7231, Section 7.4.2 */ +#define MHD_HTTP_HEADER_SERVER "Server" +/* Standard. RFC7230, Section 4.3 */ +#define MHD_HTTP_HEADER_TE "TE" +/* Standard. RFC7230, Section 4.4 */ +#define MHD_HTTP_HEADER_TRAILER "Trailer" +/* Standard. RFC7230, Section 3.3.1 */ +#define MHD_HTTP_HEADER_TRANSFER_ENCODING "Transfer-Encoding" +/* Standard. RFC7230, Section 6.7 */ +#define MHD_HTTP_HEADER_UPGRADE "Upgrade" +/* Standard. RFC7231, Section 5.5.3 */ +#define MHD_HTTP_HEADER_USER_AGENT "User-Agent" +/* Standard. RFC7231, Section 7.1.4 */ +#define MHD_HTTP_HEADER_VARY "Vary" +/* Standard. RFC7230, Section 5.7.1 */ +#define MHD_HTTP_HEADER_VIA "Via" +/* Standard. RFC7235, Section 4.1 */ +#define MHD_HTTP_HEADER_WWW_AUTHENTICATE "WWW-Authenticate" +/* Standard. RFC7234, Section 5.5 */ +#define MHD_HTTP_HEADER_WARNING "Warning" + +/* Additional HTTP headers. */ +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_A_IM "A-IM" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_ACCEPT_ADDITIONS "Accept-Additions" +/* Informational. RFC7089 */ +#define MHD_HTTP_HEADER_ACCEPT_DATETIME "Accept-Datetime" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_ACCEPT_FEATURES "Accept-Features" +/* No category. RFC5789 */ +#define MHD_HTTP_HEADER_ACCEPT_PATCH "Accept-Patch" +/* Standard. https://www.w3.org/TR/ldp/ */ +#define MHD_HTTP_HEADER_ACCEPT_POST "Accept-Post" +/* Standard. RFC7639, Section 2 */ +#define MHD_HTTP_HEADER_ALPN "ALPN" +/* Standard. RFC7838 */ +#define MHD_HTTP_HEADER_ALT_SVC "Alt-Svc" +/* Standard. RFC7838 */ +#define MHD_HTTP_HEADER_ALT_USED "Alt-Used" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_ALTERNATES "Alternates" +/* No category. RFC4437 */ +#define MHD_HTTP_HEADER_APPLY_TO_REDIRECT_REF "Apply-To-Redirect-Ref" +/* Experimental. RFC8053, Section 4 */ +#define MHD_HTTP_HEADER_AUTHENTICATION_CONTROL "Authentication-Control" +/* Standard. RFC7615, Section 3 */ +#define MHD_HTTP_HEADER_AUTHENTICATION_INFO "Authentication-Info" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_C_EXT "C-Ext" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_C_MAN "C-Man" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_C_OPT "C-Opt" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_C_PEP "C-PEP" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_C_PEP_INFO "C-PEP-Info" +/* Standard. RFC8607, Section 5.1 */ +#define MHD_HTTP_HEADER_CAL_MANAGED_ID "Cal-Managed-ID" +/* Standard. RFC7809, Section 7.1 */ +#define MHD_HTTP_HEADER_CALDAV_TIMEZONES "CalDAV-Timezones" +/* Standard. RFC8586 */ +#define MHD_HTTP_HEADER_CDN_LOOP "CDN-Loop" +/* Obsoleted. RFC2068; RFC2616 */ +#define MHD_HTTP_HEADER_CONTENT_BASE "Content-Base" +/* Standard. RFC6266 */ +#define MHD_HTTP_HEADER_CONTENT_DISPOSITION "Content-Disposition" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_CONTENT_ID "Content-ID" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_CONTENT_MD5 "Content-MD5" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_CONTENT_SCRIPT_TYPE "Content-Script-Type" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_CONTENT_STYLE_TYPE "Content-Style-Type" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_CONTENT_VERSION "Content-Version" +/* Standard. RFC6265 */ +#define MHD_HTTP_HEADER_COOKIE "Cookie" +/* Obsoleted. RFC2965; RFC6265 */ +#define MHD_HTTP_HEADER_COOKIE2 "Cookie2" +/* Standard. RFC5323 */ +#define MHD_HTTP_HEADER_DASL "DASL" +/* Standard. RFC4918 */ +#define MHD_HTTP_HEADER_DAV "DAV" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_DEFAULT_STYLE "Default-Style" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_DELTA_BASE "Delta-Base" +/* Standard. RFC4918 */ +#define MHD_HTTP_HEADER_DEPTH "Depth" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_DERIVED_FROM "Derived-From" +/* Standard. RFC4918 */ +#define MHD_HTTP_HEADER_DESTINATION "Destination" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_DIFFERENTIAL_ID "Differential-ID" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_DIGEST "Digest" +/* Standard. RFC8470 */ +#define MHD_HTTP_HEADER_EARLY_DATA "Early-Data" +/* Experimental. RFC-ietf-httpbis-expect-ct-08 */ +#define MHD_HTTP_HEADER_EXPECT_CT "Expect-CT" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_EXT "Ext" +/* Standard. RFC7239 */ +#define MHD_HTTP_HEADER_FORWARDED "Forwarded" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_GETPROFILE "GetProfile" +/* Experimental. RFC7486, Section 6.1.1 */ +#define MHD_HTTP_HEADER_HOBAREG "Hobareg" +/* Standard. RFC7540, Section 3.2.1 */ +#define MHD_HTTP_HEADER_HTTP2_SETTINGS "HTTP2-Settings" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_IM "IM" +/* Standard. RFC4918 */ +#define MHD_HTTP_HEADER_IF "If" +/* Standard. RFC6638 */ +#define MHD_HTTP_HEADER_IF_SCHEDULE_TAG_MATCH "If-Schedule-Tag-Match" +/* Standard. RFC8473 */ +#define MHD_HTTP_HEADER_INCLUDE_REFERRED_TOKEN_BINDING_ID \ + "Include-Referred-Token-Binding-ID" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_KEEP_ALIVE "Keep-Alive" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_LABEL "Label" +/* Standard. RFC8288 */ +#define MHD_HTTP_HEADER_LINK "Link" +/* Standard. RFC4918 */ +#define MHD_HTTP_HEADER_LOCK_TOKEN "Lock-Token" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_MAN "Man" +/* Informational. RFC7089 */ +#define MHD_HTTP_HEADER_MEMENTO_DATETIME "Memento-Datetime" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_METER "Meter" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_NEGOTIATE "Negotiate" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_OPT "Opt" +/* Experimental. RFC8053, Section 3 */ +#define MHD_HTTP_HEADER_OPTIONAL_WWW_AUTHENTICATE "Optional-WWW-Authenticate" +/* Standard. RFC4229 */ +#define MHD_HTTP_HEADER_ORDERING_TYPE "Ordering-Type" +/* Standard. RFC6454 */ +#define MHD_HTTP_HEADER_ORIGIN "Origin" +/* Standard. RFC-ietf-core-object-security-16, Section 11.1 */ +#define MHD_HTTP_HEADER_OSCORE "OSCORE" +/* Standard. RFC4918 */ +#define MHD_HTTP_HEADER_OVERWRITE "Overwrite" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_P3P "P3P" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_PEP "PEP" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_PICS_LABEL "PICS-Label" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_PEP_INFO "Pep-Info" +/* Standard. RFC4229 */ +#define MHD_HTTP_HEADER_POSITION "Position" +/* Standard. RFC7240 */ +#define MHD_HTTP_HEADER_PREFER "Prefer" +/* Standard. RFC7240 */ +#define MHD_HTTP_HEADER_PREFERENCE_APPLIED "Preference-Applied" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_PROFILEOBJECT "ProfileObject" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_PROTOCOL "Protocol" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_PROTOCOL_INFO "Protocol-Info" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_PROTOCOL_QUERY "Protocol-Query" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_PROTOCOL_REQUEST "Protocol-Request" +/* Standard. RFC7615, Section 4 */ +#define MHD_HTTP_HEADER_PROXY_AUTHENTICATION_INFO "Proxy-Authentication-Info" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_PROXY_FEATURES "Proxy-Features" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_PROXY_INSTRUCTION "Proxy-Instruction" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_PUBLIC "Public" +/* Standard. RFC7469 */ +#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS "Public-Key-Pins" +/* Standard. RFC7469 */ +#define MHD_HTTP_HEADER_PUBLIC_KEY_PINS_REPORT_ONLY \ + "Public-Key-Pins-Report-Only" +/* No category. RFC4437 */ +#define MHD_HTTP_HEADER_REDIRECT_REF "Redirect-Ref" +/* Standard. RFC8555, Section 6.5.1 */ +#define MHD_HTTP_HEADER_REPLAY_NONCE "Replay-Nonce" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_SAFE "Safe" +/* Standard. RFC6638 */ +#define MHD_HTTP_HEADER_SCHEDULE_REPLY "Schedule-Reply" +/* Standard. RFC6638 */ +#define MHD_HTTP_HEADER_SCHEDULE_TAG "Schedule-Tag" +/* Standard. RFC8473 */ +#define MHD_HTTP_HEADER_SEC_TOKEN_BINDING "Sec-Token-Binding" +/* Standard. RFC6455 */ +#define MHD_HTTP_HEADER_SEC_WEBSOCKET_ACCEPT "Sec-WebSocket-Accept" +/* Standard. RFC6455 */ +#define MHD_HTTP_HEADER_SEC_WEBSOCKET_EXTENSIONS "Sec-WebSocket-Extensions" +/* Standard. RFC6455 */ +#define MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY "Sec-WebSocket-Key" +/* Standard. RFC6455 */ +#define MHD_HTTP_HEADER_SEC_WEBSOCKET_PROTOCOL "Sec-WebSocket-Protocol" +/* Standard. RFC6455 */ +#define MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION "Sec-WebSocket-Version" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_SECURITY_SCHEME "Security-Scheme" +/* Standard. RFC6265 */ +#define MHD_HTTP_HEADER_SET_COOKIE "Set-Cookie" +/* Obsoleted. RFC2965; RFC6265 */ +#define MHD_HTTP_HEADER_SET_COOKIE2 "Set-Cookie2" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_SETPROFILE "SetProfile" +/* Standard. RFC5023 */ +#define MHD_HTTP_HEADER_SLUG "SLUG" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_SOAPACTION "SoapAction" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_STATUS_URI "Status-URI" +/* Standard. RFC6797 */ +#define MHD_HTTP_HEADER_STRICT_TRANSPORT_SECURITY "Strict-Transport-Security" +/* Informational. RFC8594 */ +#define MHD_HTTP_HEADER_SUNSET "Sunset" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_SURROGATE_CAPABILITY "Surrogate-Capability" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_SURROGATE_CONTROL "Surrogate-Control" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_TCN "TCN" +/* Standard. RFC4918 */ +#define MHD_HTTP_HEADER_TIMEOUT "Timeout" +/* Standard. RFC8030, Section 5.4 */ +#define MHD_HTTP_HEADER_TOPIC "Topic" +/* Standard. RFC8030, Section 5.2 */ +#define MHD_HTTP_HEADER_TTL "TTL" +/* Standard. RFC8030, Section 5.3 */ +#define MHD_HTTP_HEADER_URGENCY "Urgency" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_URI "URI" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_VARIANT_VARY "Variant-Vary" +/* No category. RFC4229 */ +#define MHD_HTTP_HEADER_WANT_DIGEST "Want-Digest" +/* Standard. https://fetch.spec.whatwg.org/#x-content-type-options-header */ +#define MHD_HTTP_HEADER_X_CONTENT_TYPE_OPTIONS "X-Content-Type-Options" +/* Informational. RFC7034 */ +#define MHD_HTTP_HEADER_X_FRAME_OPTIONS "X-Frame-Options" + +/* Some provisional headers. */ +#define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN \ + "Access-Control-Allow-Origin" +/** @} */ /* end of group headers */ + +/** + * @defgroup versions HTTP versions + * These strings should be used to match against the first line of the + * HTTP header. + * @{ + */ +#define MHD_HTTP_VERSION_1_0 "HTTP/1.0" +#define MHD_HTTP_VERSION_1_1 "HTTP/1.1" + +/** @} */ /* end of group versions */ + +/** + * @defgroup methods HTTP methods + * HTTP methods (as strings). + * See: http://www.iana.org/assignments/http-methods/http-methods.xml + * Registry export date: 2019-06-09 + * @{ + */ + +/* Main HTTP methods. */ +/* Not safe. Not idempotent. RFC7231, Section 4.3.6. */ +#define MHD_HTTP_METHOD_CONNECT "CONNECT" +/* Not safe. Idempotent. RFC7231, Section 4.3.5. */ +#define MHD_HTTP_METHOD_DELETE "DELETE" +/* Safe. Idempotent. RFC7231, Section 4.3.1. */ +#define MHD_HTTP_METHOD_GET "GET" +/* Safe. Idempotent. RFC7231, Section 4.3.2. */ +#define MHD_HTTP_METHOD_HEAD "HEAD" +/* Safe. Idempotent. RFC7231, Section 4.3.7. */ +#define MHD_HTTP_METHOD_OPTIONS "OPTIONS" +/* Not safe. Not idempotent. RFC7231, Section 4.3.3. */ +#define MHD_HTTP_METHOD_POST "POST" +/* Not safe. Idempotent. RFC7231, Section 4.3.4. */ +#define MHD_HTTP_METHOD_PUT "PUT" +/* Safe. Idempotent. RFC7231, Section 4.3.8. */ +#define MHD_HTTP_METHOD_TRACE "TRACE" + +/* Additional HTTP methods. */ +/* Not safe. Idempotent. RFC3744, Section 8.1. */ +#define MHD_HTTP_METHOD_ACL "ACL" +/* Not safe. Idempotent. RFC3253, Section 12.6. */ +#define MHD_HTTP_METHOD_BASELINE_CONTROL "BASELINE-CONTROL" +/* Not safe. Idempotent. RFC5842, Section 4. */ +#define MHD_HTTP_METHOD_BIND "BIND" +/* Not safe. Idempotent. RFC3253, Section 4.4, Section 9.4. */ +#define MHD_HTTP_METHOD_CHECKIN "CHECKIN" +/* Not safe. Idempotent. RFC3253, Section 4.3, Section 8.8. */ +#define MHD_HTTP_METHOD_CHECKOUT "CHECKOUT" +/* Not safe. Idempotent. RFC4918, Section 9.8. */ +#define MHD_HTTP_METHOD_COPY "COPY" +/* Not safe. Idempotent. RFC3253, Section 8.2. */ +#define MHD_HTTP_METHOD_LABEL "LABEL" +/* Not safe. Idempotent. RFC2068, Section 19.6.1.2. */ +#define MHD_HTTP_METHOD_LINK "LINK" +/* Not safe. Not idempotent. RFC4918, Section 9.10. */ +#define MHD_HTTP_METHOD_LOCK "LOCK" +/* Not safe. Idempotent. RFC3253, Section 11.2. */ +#define MHD_HTTP_METHOD_MERGE "MERGE" +/* Not safe. Idempotent. RFC3253, Section 13.5. */ +#define MHD_HTTP_METHOD_MKACTIVITY "MKACTIVITY" +/* Not safe. Idempotent. RFC4791, Section 5.3.1; RFC8144, Section 2.3. */ +#define MHD_HTTP_METHOD_MKCALENDAR "MKCALENDAR" +/* Not safe. Idempotent. RFC4918, Section 9.3; RFC5689, Section 3; RFC8144, Section 2.3. */ +#define MHD_HTTP_METHOD_MKCOL "MKCOL" +/* Not safe. Idempotent. RFC4437, Section 6. */ +#define MHD_HTTP_METHOD_MKREDIRECTREF "MKREDIRECTREF" +/* Not safe. Idempotent. RFC3253, Section 6.3. */ +#define MHD_HTTP_METHOD_MKWORKSPACE "MKWORKSPACE" +/* Not safe. Idempotent. RFC4918, Section 9.9. */ +#define MHD_HTTP_METHOD_MOVE "MOVE" +/* Not safe. Idempotent. RFC3648, Section 7. */ +#define MHD_HTTP_METHOD_ORDERPATCH "ORDERPATCH" +/* Not safe. Not idempotent. RFC5789, Section 2. */ +#define MHD_HTTP_METHOD_PATCH "PATCH" +/* Safe. Idempotent. RFC7540, Section 3.5. */ +#define MHD_HTTP_METHOD_PRI "PRI" +/* Safe. Idempotent. RFC4918, Section 9.1; RFC8144, Section 2.1. */ +#define MHD_HTTP_METHOD_PROPFIND "PROPFIND" +/* Not safe. Idempotent. RFC4918, Section 9.2; RFC8144, Section 2.2. */ +#define MHD_HTTP_METHOD_PROPPATCH "PROPPATCH" +/* Not safe. Idempotent. RFC5842, Section 6. */ +#define MHD_HTTP_METHOD_REBIND "REBIND" +/* Safe. Idempotent. RFC3253, Section 3.6; RFC8144, Section 2.1. */ +#define MHD_HTTP_METHOD_REPORT "REPORT" +/* Safe. Idempotent. RFC5323, Section 2. */ +#define MHD_HTTP_METHOD_SEARCH "SEARCH" +/* Not safe. Idempotent. RFC5842, Section 5. */ +#define MHD_HTTP_METHOD_UNBIND "UNBIND" +/* Not safe. Idempotent. RFC3253, Section 4.5. */ +#define MHD_HTTP_METHOD_UNCHECKOUT "UNCHECKOUT" +/* Not safe. Idempotent. RFC2068, Section 19.6.1.3. */ +#define MHD_HTTP_METHOD_UNLINK "UNLINK" +/* Not safe. Idempotent. RFC4918, Section 9.11. */ +#define MHD_HTTP_METHOD_UNLOCK "UNLOCK" +/* Not safe. Idempotent. RFC3253, Section 7.1. */ +#define MHD_HTTP_METHOD_UPDATE "UPDATE" +/* Not safe. Idempotent. RFC4437, Section 7. */ +#define MHD_HTTP_METHOD_UPDATEREDIRECTREF "UPDATEREDIRECTREF" +/* Not safe. Idempotent. RFC3253, Section 3.5. */ +#define MHD_HTTP_METHOD_VERSION_CONTROL "VERSION-CONTROL" + +/** @} */ /* end of group methods */ + +/** + * @defgroup postenc HTTP POST encodings + * See also: http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4 + * @{ + */ +#define MHD_HTTP_POST_ENCODING_FORM_URLENCODED \ + "application/x-www-form-urlencoded" +#define MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA "multipart/form-data" + +/** @} */ /* end of group postenc */ + + +/** + * @brief Handle for the daemon (listening on a socket for HTTP traffic). + * @ingroup event + */ +struct MHD_Daemon; + +/** + * @brief Handle for a connection / HTTP request. + * + * With HTTP/1.1, multiple requests can be run over the same + * connection. However, MHD will only show one request per TCP + * connection to the client at any given time. + * @ingroup request + */ +struct MHD_Connection; + +/** + * @brief Handle for a response. + * @ingroup response + */ +struct MHD_Response; + +/** + * @brief Handle for POST processing. + * @ingroup response + */ +struct MHD_PostProcessor; + + +/** + * @brief Flags for the `struct MHD_Daemon`. + * + * Note that MHD will run automatically in background thread(s) only + * if #MHD_USE_INTERNAL_POLLING_THREAD is used. Otherwise caller (application) + * must use #MHD_run() or #MHD_run_from_select() to have MHD processed + * network connections and data. + * + * Starting the daemon may also fail if a particular option is not + * implemented or not supported on the target platform (i.e. no + * support for TLS, epoll or IPv6). + */ +enum MHD_FLAG +{ + /** + * No options selected. + */ + MHD_NO_FLAG = 0, + + /** + * Print errors messages to custom error logger or to `stderr` if + * custom error logger is not set. + * @sa ::MHD_OPTION_EXTERNAL_LOGGER + */ + MHD_USE_ERROR_LOG = 1, + + /** + * Run in debug mode. If this flag is used, the library should + * print error messages and warnings to `stderr`. + */ + MHD_USE_DEBUG = 1, + + /** + * Run in HTTPS mode. The modern protocol is called TLS. + */ + MHD_USE_TLS = 2, + + /** @deprecated */ + MHD_USE_SSL = 2, +#if 0 + /* let's do this later once versions that define MHD_USE_TLS a more widely deployed. */ +#define MHD_USE_SSL \ + _MHD_DEPR_IN_MACRO ("Value MHD_USE_SSL is deprecated, use MHD_USE_TLS") \ + MHD_USE_TLS +#endif + + /** + * Run using one thread per connection. + * Must be used only with #MHD_USE_INTERNAL_POLLING_THREAD. + */ + MHD_USE_THREAD_PER_CONNECTION = 4, + + /** + * Run using an internal thread (or thread pool) for sockets sending + * and receiving and data processing. Without this flag MHD will not + * run automatically in background thread(s). + * If this flag is set, #MHD_run() and #MHD_run_from_select() couldn't + * be used. + * This flag is set explicitly by #MHD_USE_POLL_INTERNAL_THREAD and + * by #MHD_USE_EPOLL_INTERNAL_THREAD. + */ + MHD_USE_INTERNAL_POLLING_THREAD = 8, + + /** @deprecated */ + MHD_USE_SELECT_INTERNALLY = 8, +#if 0 /* Will be marked for real deprecation later. */ +#define MHD_USE_SELECT_INTERNALLY \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_USE_SELECT_INTERNALLY is deprecated, use MHD_USE_INTERNAL_POLLING_THREAD instead") \ + MHD_USE_INTERNAL_POLLING_THREAD +#endif /* 0 */ + + /** + * Run using the IPv6 protocol (otherwise, MHD will just support + * IPv4). If you want MHD to support IPv4 and IPv6 using a single + * socket, pass #MHD_USE_DUAL_STACK, otherwise, if you only pass + * this option, MHD will try to bind to IPv6-only (resulting in + * no IPv4 support). + */ + MHD_USE_IPv6 = 16, + + /** + * Be pedantic about the protocol (as opposed to as tolerant as + * possible). Specifically, at the moment, this flag causes MHD to + * reject HTTP 1.1 connections without a "Host" header. This is + * required by the standard, but of course in violation of the "be + * as liberal as possible in what you accept" norm. It is + * recommended to turn this ON if you are testing clients against + * MHD, and OFF in production. + */ + MHD_USE_PEDANTIC_CHECKS = 32, +#if 0 /* Will be marked for real deprecation later. */ +#define MHD_USE_PEDANTIC_CHECKS \ + _MHD_DEPR_IN_MACRO ( \ + "Flag MHD_USE_PEDANTIC_CHECKS is deprecated, use option MHD_OPTION_STRICT_FOR_CLIENT instead") \ + 32 +#endif /* 0 */ + + /** + * Use `poll()` instead of `select()`. This allows sockets with `fd >= + * FD_SETSIZE`. This option is not compatible with using an + * 'external' polling mode (as there is no API to get the file + * descriptors for the external poll() from MHD) and must also not + * be used in combination with #MHD_USE_EPOLL. + * @sa ::MHD_FEATURE_POLL, #MHD_USE_POLL_INTERNAL_THREAD + */ + MHD_USE_POLL = 64, + + /** + * Run using an internal thread (or thread pool) doing `poll()`. + * @sa ::MHD_FEATURE_POLL, #MHD_USE_POLL, #MHD_USE_INTERNAL_POLLING_THREAD + */ + MHD_USE_POLL_INTERNAL_THREAD = MHD_USE_POLL | MHD_USE_INTERNAL_POLLING_THREAD, + + /** @deprecated */ + MHD_USE_POLL_INTERNALLY = MHD_USE_POLL | MHD_USE_INTERNAL_POLLING_THREAD, +#if 0 /* Will be marked for real deprecation later. */ +#define MHD_USE_POLL_INTERNALLY \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_USE_POLL_INTERNALLY is deprecated, use MHD_USE_POLL_INTERNAL_THREAD instead") \ + MHD_USE_POLL_INTERNAL_THREAD +#endif /* 0 */ + + /** + * Suppress (automatically) adding the 'Date:' header to HTTP responses. + * This option should ONLY be used on systems that do not have a clock + * and that DO provide other mechanisms for cache control. See also + * RFC 2616, section 14.18 (exception 3). + */ + MHD_USE_SUPPRESS_DATE_NO_CLOCK = 128, + + /** @deprecated */ + MHD_SUPPRESS_DATE_NO_CLOCK = 128, +#if 0 /* Will be marked for real deprecation later. */ +#define MHD_SUPPRESS_DATE_NO_CLOCK \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_SUPPRESS_DATE_NO_CLOCK is deprecated, use MHD_USE_SUPPRESS_DATE_NO_CLOCK instead") \ + MHD_USE_SUPPRESS_DATE_NO_CLOCK +#endif /* 0 */ + + /** + * Run without a listen socket. This option only makes sense if + * #MHD_add_connection is to be used exclusively to connect HTTP + * clients to the HTTP server. This option is incompatible with + * using a thread pool; if it is used, #MHD_OPTION_THREAD_POOL_SIZE + * is ignored. + */ + MHD_USE_NO_LISTEN_SOCKET = 256, + + /** + * Use `epoll()` instead of `select()` or `poll()` for the event loop. + * This option is only available on some systems; using the option on + * systems without epoll will cause #MHD_start_daemon to fail. Using + * this option is not supported with #MHD_USE_THREAD_PER_CONNECTION. + * @sa ::MHD_FEATURE_EPOLL + */ + MHD_USE_EPOLL = 512, + + /** @deprecated */ + MHD_USE_EPOLL_LINUX_ONLY = 512, +#if 0 /* Will be marked for real deprecation later. */ +#define MHD_USE_EPOLL_LINUX_ONLY \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_USE_EPOLL_LINUX_ONLY is deprecated, use MHD_USE_EPOLL") \ + MHD_USE_EPOLL +#endif /* 0 */ + + /** + * Run using an internal thread (or thread pool) doing `epoll()`. + * This option is only available on certain platforms; using the option on + * platform without `epoll` support will cause #MHD_start_daemon to fail. + * @sa ::MHD_FEATURE_EPOLL, #MHD_USE_EPOLL, #MHD_USE_INTERNAL_POLLING_THREAD + */ + MHD_USE_EPOLL_INTERNAL_THREAD = MHD_USE_EPOLL + | MHD_USE_INTERNAL_POLLING_THREAD, + + /** @deprecated */ + MHD_USE_EPOLL_INTERNALLY = MHD_USE_EPOLL | MHD_USE_INTERNAL_POLLING_THREAD, + /** @deprecated */ + MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY = MHD_USE_EPOLL + | MHD_USE_INTERNAL_POLLING_THREAD, +#if 0 /* Will be marked for real deprecation later. */ +#define MHD_USE_EPOLL_INTERNALLY \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_USE_EPOLL_INTERNALLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \ + MHD_USE_EPOLL_INTERNAL_THREAD + /** @deprecated */ +#define MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY is deprecated, use MHD_USE_EPOLL_INTERNAL_THREAD") \ + MHD_USE_EPOLL_INTERNAL_THREAD +#endif /* 0 */ + + /** + * Use inter-thread communication channel. + * #MHD_USE_ITC can be used with #MHD_USE_INTERNAL_POLLING_THREAD + * and is ignored with any "external" mode. + * It's required for use of #MHD_quiesce_daemon + * or #MHD_add_connection. + * This option is enforced by #MHD_ALLOW_SUSPEND_RESUME or + * #MHD_USE_NO_LISTEN_SOCKET. + * #MHD_USE_ITC is always used automatically on platforms + * where select()/poll()/other ignore shutdown of listen + * socket. + */ + MHD_USE_ITC = 1024, + + /** @deprecated */ + MHD_USE_PIPE_FOR_SHUTDOWN = 1024, +#if 0 /* Will be marked for real deprecation later. */ +#define MHD_USE_PIPE_FOR_SHUTDOWN \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_USE_PIPE_FOR_SHUTDOWN is deprecated, use MHD_USE_ITC") \ + MHD_USE_ITC +#endif /* 0 */ + + /** + * Use a single socket for IPv4 and IPv6. + */ + MHD_USE_DUAL_STACK = MHD_USE_IPv6 | 2048, + + /** + * Enable `turbo`. Disables certain calls to `shutdown()`, + * enables aggressive non-blocking optimistic reads and + * other potentially unsafe optimizations. + * Most effects only happen with #MHD_USE_EPOLL. + */ + MHD_USE_TURBO = 4096, + + /** @deprecated */ + MHD_USE_EPOLL_TURBO = 4096, +#if 0 /* Will be marked for real deprecation later. */ +#define MHD_USE_EPOLL_TURBO \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_USE_EPOLL_TURBO is deprecated, use MHD_USE_TURBO") \ + MHD_USE_TURBO +#endif /* 0 */ + + /** + * Enable suspend/resume functions, which also implies setting up + * ITC to signal resume. + */ + MHD_ALLOW_SUSPEND_RESUME = 8192 | MHD_USE_ITC, + + /** @deprecated */ + MHD_USE_SUSPEND_RESUME = 8192 | MHD_USE_ITC, +#if 0 /* Will be marked for real deprecation later. */ +#define MHD_USE_SUSPEND_RESUME \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_USE_SUSPEND_RESUME is deprecated, use MHD_ALLOW_SUSPEND_RESUME instead") \ + MHD_ALLOW_SUSPEND_RESUME +#endif /* 0 */ + + /** + * Enable TCP_FASTOPEN option. This option is only available on Linux with a + * kernel >= 3.6. On other systems, using this option cases #MHD_start_daemon + * to fail. + */ + MHD_USE_TCP_FASTOPEN = 16384, + + /** + * You need to set this option if you want to use HTTP "Upgrade". + * "Upgrade" may require usage of additional internal resources, + * which we do not want to use unless necessary. + */ + MHD_ALLOW_UPGRADE = 32768, + + /** + * Automatically use best available polling function. + * Choice of polling function is also depend on other daemon options. + * If #MHD_USE_INTERNAL_POLLING_THREAD is specified then epoll, poll() or + * select() will be used (listed in decreasing preference order, first + * function available on system will be used). + * If #MHD_USE_THREAD_PER_CONNECTION is specified then poll() or select() + * will be used. + * If those flags are not specified then epoll or select() will be + * used (as the only suitable for MHD_get_fdset()) + */ + MHD_USE_AUTO = 65536, + + /** + * Run using an internal thread (or thread pool) with best available on + * system polling function. + * This is combination of #MHD_USE_AUTO and #MHD_USE_INTERNAL_POLLING_THREAD + * flags. + */ + MHD_USE_AUTO_INTERNAL_THREAD = MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD, + + /** + * Flag set to enable post-handshake client authentication + * (only useful in combination with #MHD_USE_TLS). + */ + MHD_USE_POST_HANDSHAKE_AUTH_SUPPORT = 1U << 17, + + /** + * Flag set to enable TLS 1.3 early data. This has + * security implications, be VERY careful when using this. + */ + MHD_USE_INSECURE_TLS_EARLY_DATA = 1U << 18 + +}; + + +/** + * Type of a callback function used for logging by MHD. + * + * @param cls closure + * @param fm format string (`printf()`-style) + * @param ap arguments to @a fm + * @ingroup logging + */ +typedef void +(*MHD_LogCallback)(void *cls, + const char *fm, + va_list ap); + + +/** + * Function called to lookup the pre shared key (@a psk) for a given + * HTTP connection based on the @a username. + * + * @param cls closure + * @param connection the HTTPS connection + * @param username the user name claimed by the other side + * @param[out] psk to be set to the pre-shared-key; should be allocated with malloc(), + * will be freed by MHD + * @param[out] psk_size to be set to the number of bytes in @a psk + * @return 0 on success, -1 on errors + */ +typedef int +(*MHD_PskServerCredentialsCallback)(void *cls, + const struct MHD_Connection *connection, + const char *username, + void **psk, + size_t *psk_size); + +/** + * @brief MHD options. + * + * Passed in the varargs portion of #MHD_start_daemon. + */ +enum MHD_OPTION +{ + + /** + * No more options / last option. This is used + * to terminate the VARARGs list. + */ + MHD_OPTION_END = 0, + + /** + * Maximum memory size per connection (followed by a `size_t`). + * Default is 32 kb (#MHD_POOL_SIZE_DEFAULT). + * Values above 128k are unlikely to result in much benefit, as half + * of the memory will be typically used for IO, and TCP buffers are + * unlikely to support window sizes above 64k on most systems. + */ + MHD_OPTION_CONNECTION_MEMORY_LIMIT = 1, + + /** + * Maximum number of concurrent connections to + * accept (followed by an `unsigned int`). + */ + MHD_OPTION_CONNECTION_LIMIT = 2, + + /** + * After how many seconds of inactivity should a + * connection automatically be timed out? (followed + * by an `unsigned int`; use zero for no timeout). + */ + MHD_OPTION_CONNECTION_TIMEOUT = 3, + + /** + * Register a function that should be called whenever a request has + * been completed (this can be used for application-specific clean + * up). Requests that have never been presented to the application + * (via #MHD_AccessHandlerCallback) will not result in + * notifications. + * + * This option should be followed by TWO pointers. First a pointer + * to a function of type #MHD_RequestCompletedCallback and second a + * pointer to a closure to pass to the request completed callback. + * The second pointer maybe NULL. + */ + MHD_OPTION_NOTIFY_COMPLETED = 4, + + /** + * Limit on the number of (concurrent) connections made to the + * server from the same IP address. Can be used to prevent one + * IP from taking over all of the allowed connections. If the + * same IP tries to establish more than the specified number of + * connections, they will be immediately rejected. The option + * should be followed by an `unsigned int`. The default is + * zero, which means no limit on the number of connections + * from the same IP address. + */ + MHD_OPTION_PER_IP_CONNECTION_LIMIT = 5, + + /** + * Bind daemon to the supplied `struct sockaddr`. This option should + * be followed by a `struct sockaddr *`. If #MHD_USE_IPv6 is + * specified, the `struct sockaddr*` should point to a `struct + * sockaddr_in6`, otherwise to a `struct sockaddr_in`. + */ + MHD_OPTION_SOCK_ADDR = 6, + + /** + * Specify a function that should be called before parsing the URI from + * the client. The specified callback function can be used for processing + * the URI (including the options) before it is parsed. The URI after + * parsing will no longer contain the options, which maybe inconvenient for + * logging. This option should be followed by two arguments, the first + * one must be of the form + * + * void * my_logger(void *cls, const char *uri, struct MHD_Connection *con) + * + * where the return value will be passed as + * (`* con_cls`) in calls to the #MHD_AccessHandlerCallback + * when this request is processed later; returning a + * value of NULL has no special significance (however, + * note that if you return non-NULL, you can no longer + * rely on the first call to the access handler having + * `NULL == *con_cls` on entry;) + * "cls" will be set to the second argument following + * #MHD_OPTION_URI_LOG_CALLBACK. Finally, uri will + * be the 0-terminated URI of the request. + * + * Note that during the time of this call, most of the connection's + * state is not initialized (as we have not yet parsed the headers). + * However, information about the connecting client (IP, socket) + * is available. + * + * The specified function is called only once per request, therefore some + * programmers may use it to instantiate their own request objects, freeing + * them in the notifier #MHD_OPTION_NOTIFY_COMPLETED. + */ + MHD_OPTION_URI_LOG_CALLBACK = 7, + + /** + * Memory pointer for the private key (key.pem) to be used by the + * HTTPS daemon. This option should be followed by a + * `const char *` argument. + * This should be used in conjunction with #MHD_OPTION_HTTPS_MEM_CERT. + */ + MHD_OPTION_HTTPS_MEM_KEY = 8, + + /** + * Memory pointer for the certificate (cert.pem) to be used by the + * HTTPS daemon. This option should be followed by a + * `const char *` argument. + * This should be used in conjunction with #MHD_OPTION_HTTPS_MEM_KEY. + */ + MHD_OPTION_HTTPS_MEM_CERT = 9, + + /** + * Daemon credentials type. + * Followed by an argument of type + * `gnutls_credentials_type_t`. + */ + MHD_OPTION_HTTPS_CRED_TYPE = 10, + + /** + * Memory pointer to a `const char *` specifying the + * cipher algorithm (default: "NORMAL"). + */ + MHD_OPTION_HTTPS_PRIORITIES = 11, + + /** + * Pass a listen socket for MHD to use (systemd-style). If this + * option is used, MHD will not open its own listen socket(s). The + * argument passed must be of type `MHD_socket` and refer to an + * existing socket that has been bound to a port and is listening. + */ + MHD_OPTION_LISTEN_SOCKET = 12, + + /** + * Use the given function for logging error messages. This option + * must be followed by two arguments; the first must be a pointer to + * a function of type #MHD_LogCallback and the second a pointer + * `void *` which will be passed as the first argument to the log + * callback. + * + * Note that MHD will not generate any log messages + * if it was compiled without the "--enable-messages" + * flag being set. + */ + MHD_OPTION_EXTERNAL_LOGGER = 13, + + /** + * Number (`unsigned int`) of threads in thread pool. Enable + * thread pooling by setting this value to to something + * greater than 1. Currently, thread mode must be + * #MHD_USE_INTERNAL_POLLING_THREAD if thread pooling is enabled + * (#MHD_start_daemon returns NULL for an unsupported thread + * mode). + */ + MHD_OPTION_THREAD_POOL_SIZE = 14, + + /** + * Additional options given in an array of `struct MHD_OptionItem`. + * The array must be terminated with an entry `{MHD_OPTION_END, 0, NULL}`. + * An example for code using #MHD_OPTION_ARRAY is: + * + * struct MHD_OptionItem ops[] = { + * { MHD_OPTION_CONNECTION_LIMIT, 100, NULL }, + * { MHD_OPTION_CONNECTION_TIMEOUT, 10, NULL }, + * { MHD_OPTION_END, 0, NULL } + * }; + * d = MHD_start_daemon (0, 8080, NULL, NULL, dh, NULL, + * MHD_OPTION_ARRAY, ops, + * MHD_OPTION_END); + * + * For options that expect a single pointer argument, the + * second member of the `struct MHD_OptionItem` is ignored. + * For options that expect two pointer arguments, the first + * argument must be cast to `intptr_t`. + */ + MHD_OPTION_ARRAY = 15, + + /** + * Specify a function that should be called for unescaping escape + * sequences in URIs and URI arguments. Note that this function + * will NOT be used by the `struct MHD_PostProcessor`. If this + * option is not specified, the default method will be used which + * decodes escape sequences of the form "%HH". This option should + * be followed by two arguments, the first one must be of the form + * + * size_t my_unescaper(void *cls, + * struct MHD_Connection *c, + * char *s) + * + * where the return value must be the length of the value left in + * "s" (without the 0-terminator) and "s" should be updated. Note + * that the unescape function must not lengthen "s" (the result must + * be shorter than the input and must still be 0-terminated). + * However, it may also include binary zeros before the + * 0-termination. "cls" will be set to the second argument + * following #MHD_OPTION_UNESCAPE_CALLBACK. + */ + MHD_OPTION_UNESCAPE_CALLBACK = 16, + + /** + * Memory pointer for the random values to be used by the Digest + * Auth module. This option should be followed by two arguments. + * First an integer of type `size_t` which specifies the size + * of the buffer pointed to by the second argument in bytes. + * Note that the application must ensure that the buffer of the + * second argument remains allocated and unmodified while the + * deamon is running. + */ + MHD_OPTION_DIGEST_AUTH_RANDOM = 17, + + /** + * Size of the internal array holding the map of the nonce and + * the nonce counter. This option should be followed by an `unsigend int` + * argument. + */ + MHD_OPTION_NONCE_NC_SIZE = 18, + + /** + * Desired size of the stack for threads created by MHD. Followed + * by an argument of type `size_t`. Use 0 for system default. + */ + MHD_OPTION_THREAD_STACK_SIZE = 19, + + /** + * Memory pointer for the certificate (ca.pem) to be used by the + * HTTPS daemon for client authentication. + * This option should be followed by a `const char *` argument. + */ + MHD_OPTION_HTTPS_MEM_TRUST = 20, + + /** + * Increment to use for growing the read buffer (followed by a + * `size_t`). Must fit within #MHD_OPTION_CONNECTION_MEMORY_LIMIT. + */ + MHD_OPTION_CONNECTION_MEMORY_INCREMENT = 21, + + /** + * Use a callback to determine which X.509 certificate should be + * used for a given HTTPS connection. This option should be + * followed by a argument of type `gnutls_certificate_retrieve_function2 *`. + * This option provides an + * alternative to #MHD_OPTION_HTTPS_MEM_KEY, + * #MHD_OPTION_HTTPS_MEM_CERT. You must use this version if + * multiple domains are to be hosted at the same IP address using + * TLS's Server Name Indication (SNI) extension. In this case, + * the callback is expected to select the correct certificate + * based on the SNI information provided. The callback is expected + * to access the SNI data using `gnutls_server_name_get()`. + * Using this option requires GnuTLS 3.0 or higher. + */ + MHD_OPTION_HTTPS_CERT_CALLBACK = 22, + + /** + * When using #MHD_USE_TCP_FASTOPEN, this option changes the default TCP + * fastopen queue length of 50. Note that having a larger queue size can + * cause resource exhaustion attack as the TCP stack has to now allocate + * resources for the SYN packet along with its DATA. This option should be + * followed by an `unsigned int` argument. + */ + MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE = 23, + + /** + * Memory pointer for the Diffie-Hellman parameters (dh.pem) to be used by the + * HTTPS daemon for key exchange. + * This option must be followed by a `const char *` argument. + */ + MHD_OPTION_HTTPS_MEM_DHPARAMS = 24, + + /** + * If present and set to true, allow reusing address:port socket + * (by using SO_REUSEPORT on most platform, or platform-specific ways). + * If present and set to false, disallow reusing address:port socket + * (does nothing on most plaform, but uses SO_EXCLUSIVEADDRUSE on Windows). + * This option must be followed by a `unsigned int` argument. + */ + MHD_OPTION_LISTENING_ADDRESS_REUSE = 25, + + /** + * Memory pointer for a password that decrypts the private key (key.pem) + * to be used by the HTTPS daemon. This option should be followed by a + * `const char *` argument. + * This should be used in conjunction with #MHD_OPTION_HTTPS_MEM_KEY. + * @sa ::MHD_FEATURE_HTTPS_KEY_PASSWORD + */ + MHD_OPTION_HTTPS_KEY_PASSWORD = 26, + + /** + * Register a function that should be called whenever a connection is + * started or closed. + * + * This option should be followed by TWO pointers. First a pointer + * to a function of type #MHD_NotifyConnectionCallback and second a + * pointer to a closure to pass to the request completed callback. + * The second pointer maybe NULL. + */ + MHD_OPTION_NOTIFY_CONNECTION = 27, + + /** + * Allow to change maximum length of the queue of pending connections on + * listen socket. If not present than default platform-specific SOMAXCONN + * value is used. This option should be followed by an `unsigned int` + * argument. + */ + MHD_OPTION_LISTEN_BACKLOG_SIZE = 28, + + /** + * If set to 1 - be strict about the protocol. Use -1 to be + * as tolerant as possible. + * + * Specifically, at the moment, at 1 this flag + * causes MHD to reject HTTP 1.1 connections without a "Host" header, + * and to disallow spaces in the URL or (at -1) in HTTP header key strings. + * + * These are required by some versions of the standard, but of + * course in violation of the "be as liberal as possible in what you + * accept" norm. It is recommended to set this to 1 if you are + * testing clients against MHD, and 0 in production. This option + * should be followed by an `int` argument. + */ + MHD_OPTION_STRICT_FOR_CLIENT = 29, + + /** + * This should be a pointer to callback of type + * gnutls_psk_server_credentials_function that will be given to + * gnutls_psk_set_server_credentials_function. It is used to + * retrieve the shared key for a given username. + */ + MHD_OPTION_GNUTLS_PSK_CRED_HANDLER = 30, + + /** + * Use a callback to determine which X.509 certificate should be + * used for a given HTTPS connection. This option should be + * followed by a argument of type `gnutls_certificate_retrieve_function3 *`. + * This option provides an + * alternative/extension to #MHD_OPTION_HTTPS_CERT_CALLBACK. + * You must use this version if you want to use OCSP stapling. + * Using this option requires GnuTLS 3.6.3 or higher. + */ + MHD_OPTION_HTTPS_CERT_CALLBACK2 = 31, + + /** + * Allows the application to disable certain sanity precautions + * in MHD. With these, the client can break the HTTP protocol, + * so this should never be used in production. The options are, + * however, useful for testing HTTP clients against "broken" + * server implementations. + * This argument must be followed by an "unsigned int", corresponding + * to an `enum MHD_DisableSanityCheck`. + */ + MHD_OPTION_SERVER_INSANITY = 32 +}; + + +/** + * Bitfield for the #MHD_OPTION_SERVER_INSANITY specifying + * which santiy checks should be disabled. + */ +enum MHD_DisableSanityCheck +{ + /** + * All sanity checks are enabled. + */ + MHD_DSC_SANE = 0 + +}; + + +/** + * Entry in an #MHD_OPTION_ARRAY. + */ +struct MHD_OptionItem +{ + /** + * Which option is being given. Use #MHD_OPTION_END + * to terminate the array. + */ + enum MHD_OPTION option; + + /** + * Option value (for integer arguments, and for options requiring + * two pointer arguments); should be 0 for options that take no + * arguments or only a single pointer argument. + */ + intptr_t value; + + /** + * Pointer option value (use NULL for options taking no arguments + * or only an integer option). + */ + void *ptr_value; + +}; + + +/** + * The `enum MHD_ValueKind` specifies the source of + * the key-value pairs in the HTTP protocol. + */ +enum MHD_ValueKind +{ + + /** + * Response header + * @deprecated + */ + MHD_RESPONSE_HEADER_KIND = 0, +#define MHD_RESPONSE_HEADER_KIND \ + _MHD_DEPR_IN_MACRO ( \ + "Value MHD_RESPONSE_HEADER_KIND is deprecated and not used") \ + MHD_RESPONSE_HEADER_KIND + + /** + * HTTP header (request/response). + */ + MHD_HEADER_KIND = 1, + + /** + * Cookies. Note that the original HTTP header containing + * the cookie(s) will still be available and intact. + */ + MHD_COOKIE_KIND = 2, + + /** + * POST data. This is available only if a content encoding + * supported by MHD is used (currently only URL encoding), + * and only if the posted content fits within the available + * memory pool. Note that in that case, the upload data + * given to the #MHD_AccessHandlerCallback will be + * empty (since it has already been processed). + */ + MHD_POSTDATA_KIND = 4, + + /** + * GET (URI) arguments. + */ + MHD_GET_ARGUMENT_KIND = 8, + + /** + * HTTP footer (only for HTTP 1.1 chunked encodings). + */ + MHD_FOOTER_KIND = 16 +}; + + +/** + * The `enum MHD_RequestTerminationCode` specifies reasons + * why a request has been terminated (or completed). + * @ingroup request + */ +enum MHD_RequestTerminationCode +{ + + /** + * We finished sending the response. + * @ingroup request + */ + MHD_REQUEST_TERMINATED_COMPLETED_OK = 0, + + /** + * Error handling the connection (resources + * exhausted, other side closed connection, + * application error accepting request, etc.) + * @ingroup request + */ + MHD_REQUEST_TERMINATED_WITH_ERROR = 1, + + /** + * No activity on the connection for the number + * of seconds specified using + * #MHD_OPTION_CONNECTION_TIMEOUT. + * @ingroup request + */ + MHD_REQUEST_TERMINATED_TIMEOUT_REACHED = 2, + + /** + * We had to close the session since MHD was being + * shut down. + * @ingroup request + */ + MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN = 3, + + /** + * We tried to read additional data, but the other side closed the + * connection. This error is similar to + * #MHD_REQUEST_TERMINATED_WITH_ERROR, but specific to the case where + * the connection died because the other side did not send expected + * data. + * @ingroup request + */ + MHD_REQUEST_TERMINATED_READ_ERROR = 4, + + /** + * The client terminated the connection by closing the socket + * for writing (TCP half-closed); MHD aborted sending the + * response according to RFC 2616, section 8.1.4. + * @ingroup request + */ + MHD_REQUEST_TERMINATED_CLIENT_ABORT = 5 + +}; + + +/** + * The `enum MHD_ConnectionNotificationCode` specifies types + * of connection notifications. + * @ingroup request + */ +enum MHD_ConnectionNotificationCode +{ + + /** + * A new connection has been started. + * @ingroup request + */ + MHD_CONNECTION_NOTIFY_STARTED = 0, + + /** + * A connection is closed. + * @ingroup request + */ + MHD_CONNECTION_NOTIFY_CLOSED = 1 + +}; + + +/** + * Information about a connection. + */ +union MHD_ConnectionInfo +{ + + /** + * Cipher algorithm used, of type "enum gnutls_cipher_algorithm". + */ + int /* enum gnutls_cipher_algorithm */ cipher_algorithm; + + /** + * Protocol used, of type "enum gnutls_protocol". + */ + int /* enum gnutls_protocol */ protocol; + + /** + * The suspended status of a connection. + */ + int /* MHD_YES or MHD_NO */ suspended; + + /** + * Amount of second that connection could spend in idle state + * before automatically disconnected. + * Zero for no timeout (unlimited idle time). + */ + unsigned int connection_timeout; + + /** + * Connect socket + */ + MHD_socket connect_fd; + + /** + * Size of the client's HTTP header. + */ + size_t header_size; + + /** + * GNUtls session handle, of type "gnutls_session_t". + */ + void * /* gnutls_session_t */ tls_session; + + /** + * GNUtls client certificate handle, of type "gnutls_x509_crt_t". + */ + void * /* gnutls_x509_crt_t */ client_cert; + + /** + * Address information for the client. + */ + struct sockaddr *client_addr; + + /** + * Which daemon manages this connection (useful in case there are many + * daemons running). + */ + struct MHD_Daemon *daemon; + + /** + * Socket-specific client context. Points to the same address as + * the "socket_context" of the #MHD_NotifyConnectionCallback. + */ + void *socket_context; +}; + + +/** + * Values of this enum are used to specify what + * information about a connection is desired. + * @ingroup request + */ +enum MHD_ConnectionInfoType +{ + /** + * What cipher algorithm is being used. + * Takes no extra arguments. + * @ingroup request + */ + MHD_CONNECTION_INFO_CIPHER_ALGO, + + /** + * + * Takes no extra arguments. + * @ingroup request + */ + MHD_CONNECTION_INFO_PROTOCOL, + + /** + * Obtain IP address of the client. Takes no extra arguments. + * Returns essentially a `struct sockaddr **` (since the API returns + * a `union MHD_ConnectionInfo *` and that union contains a `struct + * sockaddr *`). + * @ingroup request + */ + MHD_CONNECTION_INFO_CLIENT_ADDRESS, + + /** + * Get the gnuTLS session handle. + * @ingroup request + */ + MHD_CONNECTION_INFO_GNUTLS_SESSION, + + /** + * Get the gnuTLS client certificate handle. Dysfunctional (never + * implemented, deprecated). Use #MHD_CONNECTION_INFO_GNUTLS_SESSION + * to get the `gnutls_session_t` and then call + * gnutls_certificate_get_peers(). + */ + MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT, + + /** + * Get the `struct MHD_Daemon *` responsible for managing this connection. + * @ingroup request + */ + MHD_CONNECTION_INFO_DAEMON, + + /** + * Request the file descriptor for the connection socket. + * No extra arguments should be passed. + * @ingroup request + */ + MHD_CONNECTION_INFO_CONNECTION_FD, + + /** + * Returns the client-specific pointer to a `void *` that was (possibly) + * set during a #MHD_NotifyConnectionCallback when the socket was + * first accepted. Note that this is NOT the same as the "con_cls" + * argument of the #MHD_AccessHandlerCallback. The "con_cls" is + * fresh for each HTTP request, while the "socket_context" is fresh + * for each socket. + */ + MHD_CONNECTION_INFO_SOCKET_CONTEXT, + + /** + * Check whether the connection is suspended. + * @ingroup request + */ + MHD_CONNECTION_INFO_CONNECTION_SUSPENDED, + + /** + * Get connection timeout + * @ingroup request + */ + MHD_CONNECTION_INFO_CONNECTION_TIMEOUT, + + /** + * Return length of the client's HTTP request header. + * @ingroup request + */ + MHD_CONNECTION_INFO_REQUEST_HEADER_SIZE +}; + + +/** + * Values of this enum are used to specify what + * information about a deamon is desired. + */ +enum MHD_DaemonInfoType +{ + /** + * No longer supported (will return NULL). + */ + MHD_DAEMON_INFO_KEY_SIZE, + + /** + * No longer supported (will return NULL). + */ + MHD_DAEMON_INFO_MAC_KEY_SIZE, + + /** + * Request the file descriptor for the listening socket. + * No extra arguments should be passed. + */ + MHD_DAEMON_INFO_LISTEN_FD, + + /** + * Request the file descriptor for the external epoll. + * No extra arguments should be passed. + * Waiting on epoll FD must not block longer than value + * returned by #MHD_get_timeout(). + */ + MHD_DAEMON_INFO_EPOLL_FD_LINUX_ONLY, + MHD_DAEMON_INFO_EPOLL_FD = MHD_DAEMON_INFO_EPOLL_FD_LINUX_ONLY, + + /** + * Request the number of current connections handled by the daemon. + * No extra arguments should be passed. + * Note: when using MHD in external polling mode, this type of request + * could be used only when #MHD_run()/#MHD_run_from_select is not + * working in other thread at the same time. + */ + MHD_DAEMON_INFO_CURRENT_CONNECTIONS, + + /** + * Request the daemon flags. + * No extra arguments should be passed. + * Note: flags may differ from original 'flags' specified for + * daemon, especially if #MHD_USE_AUTO was set. + */ + MHD_DAEMON_INFO_FLAGS, + + /** + * Request the port number of daemon's listen socket. + * No extra arguments should be passed. + * Note: if port '0' was specified for #MHD_start_daemon(), returned + * value will be real port number. + */ + MHD_DAEMON_INFO_BIND_PORT +}; + + +/** + * Callback for serious error condition. The default action is to print + * an error message and `abort()`. + * + * @param cls user specified value + * @param file where the error occured + * @param line where the error occured + * @param reason error detail, may be NULL + * @ingroup logging + */ +typedef void +(*MHD_PanicCallback) (void *cls, + const char *file, + unsigned int line, + const char *reason); + +/** + * Allow or deny a client to connect. + * + * @param cls closure + * @param addr address information from the client + * @param addrlen length of @a addr + * @return #MHD_YES if connection is allowed, #MHD_NO if not + */ +typedef int +(*MHD_AcceptPolicyCallback) (void *cls, + const struct sockaddr *addr, + socklen_t addrlen); + + +/** + * A client has requested the given url using the given method + * (#MHD_HTTP_METHOD_GET, #MHD_HTTP_METHOD_PUT, + * #MHD_HTTP_METHOD_DELETE, #MHD_HTTP_METHOD_POST, etc). The callback + * must call MHD callbacks to provide content to give back to the + * client and return an HTTP status code (i.e. #MHD_HTTP_OK, + * #MHD_HTTP_NOT_FOUND, etc.). + * + * @param cls argument given together with the function + * pointer when the handler was registered with MHD + * @param url the requested url + * @param method the HTTP method used (#MHD_HTTP_METHOD_GET, + * #MHD_HTTP_METHOD_PUT, etc.) + * @param version the HTTP version string (i.e. + * #MHD_HTTP_VERSION_1_1) + * @param upload_data the data being uploaded (excluding HEADERS, + * for a POST that fits into memory and that is encoded + * with a supported encoding, the POST data will NOT be + * given in upload_data and is instead available as + * part of #MHD_get_connection_values; very large POST + * data *will* be made available incrementally in + * @a upload_data) + * @param[in,out] upload_data_size set initially to the size of the + * @a upload_data provided; the method must update this + * value to the number of bytes NOT processed; + * @param[in,out] con_cls pointer that the callback can set to some + * address and that will be preserved by MHD for future + * calls for this request; since the access handler may + * be called many times (i.e., for a PUT/POST operation + * with plenty of upload data) this allows the application + * to easily associate some request-specific state. + * If necessary, this state can be cleaned up in the + * global #MHD_RequestCompletedCallback (which + * can be set with the #MHD_OPTION_NOTIFY_COMPLETED). + * Initially, `*con_cls` will be NULL. + * @return #MHD_YES if the connection was handled successfully, + * #MHD_NO if the socket must be closed due to a serios + * error while handling the request + */ +typedef int +(*MHD_AccessHandlerCallback) (void *cls, + struct MHD_Connection *connection, + const char *url, + const char *method, + const char *version, + const char *upload_data, + size_t *upload_data_size, + void **con_cls); + + +/** + * Signature of the callback used by MHD to notify the + * application about completed requests. + * + * @param cls client-defined closure + * @param connection connection handle + * @param con_cls value as set by the last call to + * the #MHD_AccessHandlerCallback + * @param toe reason for request termination + * @see #MHD_OPTION_NOTIFY_COMPLETED + * @ingroup request + */ +typedef void +(*MHD_RequestCompletedCallback) (void *cls, + struct MHD_Connection *connection, + void **con_cls, + enum MHD_RequestTerminationCode toe); + + +/** + * Signature of the callback used by MHD to notify the + * application about started/stopped connections + * + * @param cls client-defined closure + * @param connection connection handle + * @param socket_context socket-specific pointer where the + * client can associate some state specific + * to the TCP connection; note that this is + * different from the "con_cls" which is per + * HTTP request. The client can initialize + * during #MHD_CONNECTION_NOTIFY_STARTED and + * cleanup during #MHD_CONNECTION_NOTIFY_CLOSED + * and access in the meantime using + * #MHD_CONNECTION_INFO_SOCKET_CONTEXT. + * @param toe reason for connection notification + * @see #MHD_OPTION_NOTIFY_CONNECTION + * @ingroup request + */ +typedef void +(*MHD_NotifyConnectionCallback) (void *cls, + struct MHD_Connection *connection, + void **socket_context, + enum MHD_ConnectionNotificationCode toe); + + +/** + * Iterator over key-value pairs. This iterator + * can be used to iterate over all of the cookies, + * headers, or POST-data fields of a request, and + * also to iterate over the headers that have been + * added to a response. + * + * @param cls closure + * @param kind kind of the header we are looking at + * @param key key for the value, can be an empty string + * @param value corresponding value, can be NULL + * @return #MHD_YES to continue iterating, + * #MHD_NO to abort the iteration + * @ingroup request + */ +typedef int +(*MHD_KeyValueIterator) (void *cls, + enum MHD_ValueKind kind, + const char *key, + const char *value); + + +/** + * Iterator over key-value pairs with size parameters. + * This iterator can be used to iterate over all of + * the cookies, headers, or POST-data fields of a + * request, and also to iterate over the headers that + * have been added to a response. + * @note Available since #MHD_VERSION 0x00096303 + * + * @param cls closure + * @param kind kind of the header we are looking at + * @param key key for the value, can be an empty string + * @param value corresponding value, can be NULL + * @param value_size number of bytes in @a value, NEW since #MHD_VERSION 0x00096301; + * for C-strings, the length excludes the 0-terminator + * @return #MHD_YES to continue iterating, + * #MHD_NO to abort the iteration + * @ingroup request + */ +typedef int +(*MHD_KeyValueIteratorN) (void *cls, + enum MHD_ValueKind kind, + const char *key, + size_t key_size, + const char *value, + size_t value_size); + + +/** + * Callback used by libmicrohttpd in order to obtain content. The + * callback is to copy at most @a max bytes of content into @a buf. The + * total number of bytes that has been placed into @a buf should be + * returned. + * + * Note that returning zero will cause libmicrohttpd to try again. + * Thus, returning zero should only be used in conjunction + * with MHD_suspend_connection() to avoid busy waiting. + * + * @param cls extra argument to the callback + * @param pos position in the datastream to access; + * note that if a `struct MHD_Response` object is re-used, + * it is possible for the same content reader to + * be queried multiple times for the same data; + * however, if a `struct MHD_Response` is not re-used, + * libmicrohttpd guarantees that "pos" will be + * the sum of all non-negative return values + * obtained from the content reader so far. + * @param buf where to copy the data + * @param max maximum number of bytes to copy to @a buf (size of @a buf) + * @return number of bytes written to @a buf; + * 0 is legal unless we are running in internal select mode (since + * this would cause busy-waiting); 0 in external select mode + * will cause this function to be called again once the external + * select calls MHD again; + * #MHD_CONTENT_READER_END_OF_STREAM (-1) for the regular + * end of transmission (with chunked encoding, MHD will then + * terminate the chunk and send any HTTP footers that might be + * present; without chunked encoding and given an unknown + * response size, MHD will simply close the connection; note + * that while returning #MHD_CONTENT_READER_END_OF_STREAM is not technically + * legal if a response size was specified, MHD accepts this + * and treats it just as #MHD_CONTENT_READER_END_WITH_ERROR; + * #MHD_CONTENT_READER_END_WITH_ERROR (-2) to indicate a server + * error generating the response; this will cause MHD to simply + * close the connection immediately. If a response size was + * given or if chunked encoding is in use, this will indicate + * an error to the client. Note, however, that if the client + * does not know a response size and chunked encoding is not in + * use, then clients will not be able to tell the difference between + * #MHD_CONTENT_READER_END_WITH_ERROR and #MHD_CONTENT_READER_END_OF_STREAM. + * This is not a limitation of MHD but rather of the HTTP protocol. + */ +typedef ssize_t +(*MHD_ContentReaderCallback) (void *cls, + uint64_t pos, + char *buf, + size_t max); + + +/** + * This method is called by libmicrohttpd if we + * are done with a content reader. It should + * be used to free resources associated with the + * content reader. + * + * @param cls closure + * @ingroup response + */ +typedef void +(*MHD_ContentReaderFreeCallback) (void *cls); + + +/** + * Iterator over key-value pairs where the value + * maybe made available in increments and/or may + * not be zero-terminated. Used for processing + * POST data. + * + * @param cls user-specified closure + * @param kind type of the value, always #MHD_POSTDATA_KIND when called from MHD + * @param key 0-terminated key for the value + * @param filename name of the uploaded file, NULL if not known + * @param content_type mime-type of the data, NULL if not known + * @param transfer_encoding encoding of the data, NULL if not known + * @param data pointer to @a size bytes of data at the + * specified offset + * @param off offset of data in the overall value + * @param size number of bytes in @a data available + * @return #MHD_YES to continue iterating, + * #MHD_NO to abort the iteration + */ +typedef int +(*MHD_PostDataIterator) (void *cls, + enum MHD_ValueKind kind, + const char *key, + const char *filename, + const char *content_type, + const char *transfer_encoding, + const char *data, + uint64_t off, + size_t size); + +/* **************** Daemon handling functions ***************** */ + +/** + * Start a webserver on the given port. + * + * @param flags combination of `enum MHD_FLAG` values + * @param port port to bind to (in host byte order), + * use '0' to bind to random free port, + * ignored if MHD_OPTION_SOCK_ADDR or + * MHD_OPTION_LISTEN_SOCKET is provided + * or MHD_USE_NO_LISTEN_SOCKET is specified + * @param apc callback to call to check which clients + * will be allowed to connect; you can pass NULL + * in which case connections from any IP will be + * accepted + * @param apc_cls extra argument to apc + * @param dh handler called for all requests (repeatedly) + * @param dh_cls extra argument to @a dh + * @param ap list of options (type-value pairs, + * terminated with #MHD_OPTION_END). + * @return NULL on error, handle to daemon on success + * @ingroup event + */ +_MHD_EXTERN struct MHD_Daemon * +MHD_start_daemon_va (unsigned int flags, + uint16_t port, + MHD_AcceptPolicyCallback apc, void *apc_cls, + MHD_AccessHandlerCallback dh, void *dh_cls, + va_list ap); + + +/** + * Start a webserver on the given port. Variadic version of + * #MHD_start_daemon_va. + * + * @param flags combination of `enum MHD_FLAG` values + * @param port port to bind to (in host byte order), + * use '0' to bind to random free port, + * ignored if MHD_OPTION_SOCK_ADDR or + * MHD_OPTION_LISTEN_SOCKET is provided + * or MHD_USE_NO_LISTEN_SOCKET is specified + * @param apc callback to call to check which clients + * will be allowed to connect; you can pass NULL + * in which case connections from any IP will be + * accepted + * @param apc_cls extra argument to apc + * @param dh handler called for all requests (repeatedly) + * @param dh_cls extra argument to @a dh + * @return NULL on error, handle to daemon on success + * @ingroup event + */ +_MHD_EXTERN struct MHD_Daemon * +MHD_start_daemon (unsigned int flags, + uint16_t port, + MHD_AcceptPolicyCallback apc, void *apc_cls, + MHD_AccessHandlerCallback dh, void *dh_cls, + ...); + + +/** + * Stop accepting connections from the listening socket. Allows + * clients to continue processing, but stops accepting new + * connections. Note that the caller is responsible for closing the + * returned socket; however, if MHD is run using threads (anything but + * external select mode), it must not be closed until AFTER + * #MHD_stop_daemon has been called (as it is theoretically possible + * that an existing thread is still using it). + * + * Note that some thread modes require the caller to have passed + * #MHD_USE_ITC when using this API. If this daemon is + * in one of those modes and this option was not given to + * #MHD_start_daemon, this function will return #MHD_INVALID_SOCKET. + * + * @param daemon daemon to stop accepting new connections for + * @return old listen socket on success, #MHD_INVALID_SOCKET if + * the daemon was already not listening anymore + * @ingroup specialized + */ +_MHD_EXTERN MHD_socket +MHD_quiesce_daemon (struct MHD_Daemon *daemon); + + +/** + * Shutdown an HTTP daemon. + * + * @param daemon daemon to stop + * @ingroup event + */ +_MHD_EXTERN void +MHD_stop_daemon (struct MHD_Daemon *daemon); + + +/** + * Add another client connection to the set of connections managed by + * MHD. This API is usually not needed (since MHD will accept inbound + * connections on the server socket). Use this API in special cases, + * for example if your HTTP server is behind NAT and needs to connect + * out to the HTTP client, or if you are building a proxy. + * + * If you use this API in conjunction with a internal select or a + * thread pool, you must set the option + * #MHD_USE_ITC to ensure that the freshly added + * connection is immediately processed by MHD. + * + * The given client socket will be managed (and closed!) by MHD after + * this call and must no longer be used directly by the application + * afterwards. + * + * @param daemon daemon that manages the connection + * @param client_socket socket to manage (MHD will expect + * to receive an HTTP request from this socket next). + * @param addr IP address of the client + * @param addrlen number of bytes in @a addr + * @return #MHD_YES on success, #MHD_NO if this daemon could + * not handle the connection (i.e. `malloc()` failed, etc). + * The socket will be closed in any case; `errno` is + * set to indicate further details about the error. + * @ingroup specialized + */ +_MHD_EXTERN int +MHD_add_connection (struct MHD_Daemon *daemon, + MHD_socket client_socket, + const struct sockaddr *addr, + socklen_t addrlen); + + +/** + * Obtain the `select()` sets for this daemon. + * Daemon's FDs will be added to fd_sets. To get only + * daemon FDs in fd_sets, call FD_ZERO for each fd_set + * before calling this function. FD_SETSIZE is assumed + * to be platform's default. + * + * This function should only be called in when MHD is configured to + * use external select with 'select()' or with 'epoll'. + * In the latter case, it will only add the single 'epoll()' file + * descriptor used by MHD to the sets. + * It's necessary to use #MHD_get_timeout() in combination with + * this function. + * + * This function must be called only for daemon started + * without #MHD_USE_INTERNAL_POLLING_THREAD flag. + * + * @param daemon daemon to get sets from + * @param read_fd_set read set + * @param write_fd_set write set + * @param except_fd_set except set + * @param max_fd increased to largest FD added (if larger + * than existing value); can be NULL + * @return #MHD_YES on success, #MHD_NO if this + * daemon was not started with the right + * options for this call or any FD didn't + * fit fd_set. + * @ingroup event + */ +_MHD_EXTERN int +MHD_get_fdset (struct MHD_Daemon *daemon, + fd_set *read_fd_set, + fd_set *write_fd_set, + fd_set *except_fd_set, + MHD_socket *max_fd); + + +/** + * Obtain the `select()` sets for this daemon. + * Daemon's FDs will be added to fd_sets. To get only + * daemon FDs in fd_sets, call FD_ZERO for each fd_set + * before calling this function. + * + * Passing custom FD_SETSIZE as @a fd_setsize allow usage of + * larger/smaller than platform's default fd_sets. + * + * This function should only be called in when MHD is configured to + * use external select with 'select()' or with 'epoll'. + * In the latter case, it will only add the single 'epoll' file + * descriptor used by MHD to the sets. + * It's necessary to use #MHD_get_timeout() in combination with + * this function. + * + * This function must be called only for daemon started + * without #MHD_USE_INTERNAL_POLLING_THREAD flag. + * + * @param daemon daemon to get sets from + * @param read_fd_set read set + * @param write_fd_set write set + * @param except_fd_set except set + * @param max_fd increased to largest FD added (if larger + * than existing value); can be NULL + * @param fd_setsize value of FD_SETSIZE + * @return #MHD_YES on success, #MHD_NO if this + * daemon was not started with the right + * options for this call or any FD didn't + * fit fd_set. + * @ingroup event + */ +_MHD_EXTERN int +MHD_get_fdset2 (struct MHD_Daemon *daemon, + fd_set *read_fd_set, + fd_set *write_fd_set, + fd_set *except_fd_set, + MHD_socket *max_fd, + unsigned int fd_setsize); + + +/** + * Obtain the `select()` sets for this daemon. + * Daemon's FDs will be added to fd_sets. To get only + * daemon FDs in fd_sets, call FD_ZERO for each fd_set + * before calling this function. Size of fd_set is + * determined by current value of FD_SETSIZE. + * It's necessary to use #MHD_get_timeout() in combination with + * this function. + * + * This function could be called only for daemon started + * without #MHD_USE_INTERNAL_POLLING_THREAD flag. + * + * @param daemon daemon to get sets from + * @param read_fd_set read set + * @param write_fd_set write set + * @param except_fd_set except set + * @param max_fd increased to largest FD added (if larger + * than existing value); can be NULL + * @return #MHD_YES on success, #MHD_NO if this + * daemon was not started with the right + * options for this call or any FD didn't + * fit fd_set. + * @ingroup event + */ +#define MHD_get_fdset(daemon,read_fd_set,write_fd_set,except_fd_set,max_fd) \ + MHD_get_fdset2 ((daemon),(read_fd_set),(write_fd_set),(except_fd_set), \ + (max_fd),FD_SETSIZE) + + +/** + * Obtain timeout value for polling function for this daemon. + * This function set value to amount of milliseconds for which polling + * function (`select()` or `poll()`) should at most block, not the + * timeout value set for connections. + * It is important to always use this function, even if connection + * timeout is not set, as in some cases MHD may already have more + * data to process on next turn (data pending in TLS buffers, + * connections are already ready with epoll etc.) and returned timeout + * will be zero. + * + * @param daemon daemon to query for timeout + * @param timeout set to the timeout (in milliseconds) + * @return #MHD_YES on success, #MHD_NO if timeouts are + * not used (or no connections exist that would + * necessitate the use of a timeout right now). + * @ingroup event + */ +_MHD_EXTERN int +MHD_get_timeout (struct MHD_Daemon *daemon, + MHD_UNSIGNED_LONG_LONG *timeout); + + +/** + * Run webserver operations (without blocking unless in client + * callbacks). This method should be called by clients in combination + * with #MHD_get_fdset if the client-controlled select method is used and + * #MHD_get_timeout(). + * + * This function is a convenience method, which is useful if the + * fd_sets from #MHD_get_fdset were not directly passed to `select()`; + * with this function, MHD will internally do the appropriate `select()` + * call itself again. While it is always safe to call #MHD_run (if + * #MHD_USE_INTERNAL_POLLING_THREAD is not set), you should call + * #MHD_run_from_select if performance is important (as it saves an + * expensive call to `select()`). + * + * @param daemon daemon to run + * @return #MHD_YES on success, #MHD_NO if this + * daemon was not started with the right + * options for this call. + * @ingroup event + */ +_MHD_EXTERN int +MHD_run (struct MHD_Daemon *daemon); + + +/** + * Run webserver operations. This method should be called by clients + * in combination with #MHD_get_fdset and #MHD_get_timeout() if the + * client-controlled select method is used. + * + * You can use this function instead of #MHD_run if you called + * `select()` on the result from #MHD_get_fdset. File descriptors in + * the sets that are not controlled by MHD will be ignored. Calling + * this function instead of #MHD_run is more efficient as MHD will + * not have to call `select()` again to determine which operations are + * ready. + * + * This function cannot be used with daemon started with + * #MHD_USE_INTERNAL_POLLING_THREAD flag. + * + * @param daemon daemon to run select loop for + * @param read_fd_set read set + * @param write_fd_set write set + * @param except_fd_set except set + * @return #MHD_NO on serious errors, #MHD_YES on success + * @ingroup event + */ +_MHD_EXTERN int +MHD_run_from_select (struct MHD_Daemon *daemon, + const fd_set *read_fd_set, + const fd_set *write_fd_set, + const fd_set *except_fd_set); + + +/* **************** Connection handling functions ***************** */ + +/** + * Get all of the headers from the request. + * + * @param connection connection to get values from + * @param kind types of values to iterate over, can be a bitmask + * @param iterator callback to call on each header; + * maybe NULL (then just count headers) + * @param iterator_cls extra argument to @a iterator + * @return number of entries iterated over, + * -1 if connection is NULL. + * @ingroup request + */ +_MHD_EXTERN int +MHD_get_connection_values (struct MHD_Connection *connection, + enum MHD_ValueKind kind, + MHD_KeyValueIterator iterator, + void *iterator_cls); + + +/** + * Get all of the headers from the request. + * + * @param connection connection to get values from + * @param kind types of values to iterate over, can be a bitmask + * @param iterator callback to call on each header; + * maybe NULL (then just count headers) + * @param iterator_cls extra argument to @a iterator + * @return number of entries iterated over, + * -1 if connection is NULL. + * @ingroup request + */ +_MHD_EXTERN int +MHD_get_connection_values_n (struct MHD_Connection *connection, + enum MHD_ValueKind kind, + MHD_KeyValueIteratorN iterator, + void *iterator_cls); + + +/** + * This function can be used to add an entry to the HTTP headers of a + * connection (so that the #MHD_get_connection_values function will + * return them -- and the `struct MHD_PostProcessor` will also see + * them). This maybe required in certain situations (see Mantis + * #1399) where (broken) HTTP implementations fail to supply values + + * needed by the post processor (or other parts of the application). + * + * This function MUST only be called from within the + * #MHD_AccessHandlerCallback (otherwise, access maybe improperly + * synchronized). Furthermore, the client must guarantee that the key + * and value arguments are 0-terminated strings that are NOT freed + * until the connection is closed. (The easiest way to do this is by + * passing only arguments to permanently allocated strings.). + * + * @param connection the connection for which a + * value should be set + * @param kind kind of the value + * @param key key for the value + * @param value the value itself + * @return #MHD_NO if the operation could not be + * performed due to insufficient memory; + * #MHD_YES on success + * @ingroup request + */ +_MHD_EXTERN int +MHD_set_connection_value (struct MHD_Connection *connection, + enum MHD_ValueKind kind, + const char *key, + const char *value); + + +/** + * This function can be used to add an arbitrary entry to connection. + * This function could add entry with binary zero, which is allowed + * for #MHD_GET_ARGUMENT_KIND. For other kind on entries it is + * recommended to use #MHD_set_connection_value. + * + * This function MUST only be called from within the + * #MHD_AccessHandlerCallback (otherwise, access maybe improperly + * synchronized). Furthermore, the client must guarantee that the key + * and value arguments are 0-terminated strings that are NOT freed + * until the connection is closed. (The easiest way to do this is by + * passing only arguments to permanently allocated strings.). + * + * @param connection the connection for which a + * value should be set + * @param kind kind of the value + * @param key key for the value, must be zero-terminated + * @param key_size number of bytes in @a key (excluding 0-terminator) + * @param value the value itself, must be zero-terminated + * @param value_size number of bytes in @a value (excluding 0-terminator) + * @return #MHD_NO if the operation could not be + * performed due to insufficient memory; + * #MHD_YES on success + * @ingroup request + */ +int +MHD_set_connection_value_n (struct MHD_Connection *connection, + enum MHD_ValueKind kind, + const char *key, + size_t key_size, + const char *value, + size_t value_size); + + +/** + * Sets the global error handler to a different implementation. @a cb + * will only be called in the case of typically fatal, serious + * internal consistency issues. These issues should only arise in the + * case of serious memory corruption or similar problems with the + * architecture. While @a cb is allowed to return and MHD will then + * try to continue, this is never safe. + * + * The default implementation that is used if no panic function is set + * simply prints an error message and calls `abort()`. Alternative + * implementations might call `exit()` or other similar functions. + * + * @param cb new error handler + * @param cls passed to @a cb + * @ingroup logging + */ +_MHD_EXTERN void +MHD_set_panic_func (MHD_PanicCallback cb, void *cls); + + +/** + * Process escape sequences ('%HH') Updates val in place; the + * result should be UTF-8 encoded and cannot be larger than the input. + * The result must also still be 0-terminated. + * + * @param val value to unescape (modified in the process) + * @return length of the resulting val (`strlen(val)` may be + * shorter afterwards due to elimination of escape sequences) + */ +_MHD_EXTERN size_t +MHD_http_unescape (char *val); + + +/** + * Get a particular header value. If multiple + * values match the kind, return any one of them. + * + * @param connection connection to get values from + * @param kind what kind of value are we looking for + * @param key the header to look for, NULL to lookup 'trailing' value without a key + * @return NULL if no such item was found + * @ingroup request + */ +_MHD_EXTERN const char * +MHD_lookup_connection_value (struct MHD_Connection *connection, + enum MHD_ValueKind kind, + const char *key); + + +/** + * Get a particular header value. If multiple + * values match the kind, return any one of them. + * @note Since MHD_VERSION 0x00096304 + * + * @param connection connection to get values from + * @param kind what kind of value are we looking for + * @param key the header to look for, NULL to lookup 'trailing' value without a key + * @param key_size the length of @a key in bytes + * @param[out] value_ptr the pointer to variable, which will be set to found value, + * will not be updated if key not found, + * could be NULL to just check for presence of @a key + * @param[out] value_size_ptr the pointer variable, which will set to found value, + * will not be updated if key not found, + * could be NULL + * @return #MHD_YES if key is found, + * #MHD_NO otherwise. + * @ingroup request + */ +_MHD_EXTERN int +MHD_lookup_connection_value_n (struct MHD_Connection *connection, + enum MHD_ValueKind kind, + const char *key, + size_t key_size, + const char **value_ptr, + size_t *value_size_ptr); + + +/** + * Queue a response to be transmitted to the client (as soon as + * possible but after #MHD_AccessHandlerCallback returns). + * + * @param connection the connection identifying the client + * @param status_code HTTP status code (i.e. #MHD_HTTP_OK) + * @param response response to transmit + * @return #MHD_NO on error (i.e. reply already sent), + * #MHD_YES on success or if message has been queued + * @ingroup response + */ +_MHD_EXTERN int +MHD_queue_response (struct MHD_Connection *connection, + unsigned int status_code, + struct MHD_Response *response); + + +/** + * Suspend handling of network data for a given connection. This can + * be used to dequeue a connection from MHD's event loop for a while. + * + * If you use this API in conjunction with a internal select or a + * thread pool, you must set the option #MHD_USE_ITC to + * ensure that a resumed connection is immediately processed by MHD. + * + * Suspended connections continue to count against the total number of + * connections allowed (per daemon, as well as per IP, if such limits + * are set). Suspended connections will NOT time out; timeouts will + * restart when the connection handling is resumed. While a + * connection is suspended, MHD will not detect disconnects by the + * client. + * + * The only safe time to suspend a connection is from the + * #MHD_AccessHandlerCallback. + * + * Finally, it is an API violation to call #MHD_stop_daemon while + * having suspended connections (this will at least create memory and + * socket leaks or lead to undefined behavior). You must explicitly + * resume all connections before stopping the daemon. + * + * @param connection the connection to suspend + */ +_MHD_EXTERN void +MHD_suspend_connection (struct MHD_Connection *connection); + + +/** + * Resume handling of network data for suspended connection. It is + * safe to resume a suspended connection at any time. Calling this + * function on a connection that was not previously suspended will + * result in undefined behavior. + * + * If you are using this function in ``external'' select mode, you must + * make sure to run #MHD_run() and #MHD_get_timeout() afterwards (before + * again calling #MHD_get_fdset()), as otherwise the change may not be + * reflected in the set returned by #MHD_get_fdset() and you may end up + * with a connection that is stuck until the next network activity. + * + * @param connection the connection to resume + */ +_MHD_EXTERN void +MHD_resume_connection (struct MHD_Connection *connection); + + +/* **************** Response manipulation functions ***************** */ + + +/** + * Flags for special handling of responses. + */ +enum MHD_ResponseFlags +{ + /** + * Default: no special flags. + */ + MHD_RF_NONE = 0, + + /** + * Only respond in conservative HTTP 1.0-mode. In particular, + * do not (automatically) sent "Connection" headers and always + * close the connection after generating the response. + * By default, MHD will respond using the same HTTP version which + * was set in the request. You can also set the + * #MHD_RF_HTTP_VERSION_1_0_RESPONSE flag to force version 1.0 + * in the response. + */ + MHD_RF_HTTP_VERSION_1_0_ONLY = 1, + + /** + * Only respond in HTTP 1.0-mode. Contrary to the + * #MHD_RF_HTTP_VERSION_1_0_ONLY flag, the response's HTTP version will + * always be set to 1.0 and "Connection" headers are still supported. + */ + MHD_RF_HTTP_VERSION_1_0_RESPONSE = 2, + + /** + * Disable sanity check preventing clients from manually + * setting the HTTP content length option. + */ + MHD_RF_INSANITY_HEADER_CONTENT_LENGTH = 4 + + +}; + + +/** + * MHD options (for future extensions). + */ +enum MHD_ResponseOptions +{ + /** + * End of the list of options. + */ + MHD_RO_END = 0 +}; + + +/** + * Set special flags and options for a response. + * + * @param response the response to modify + * @param flags to set for the response + * @param ... #MHD_RO_END terminated list of options + * @return #MHD_YES on success, #MHD_NO on error + */ +_MHD_EXTERN int +MHD_set_response_options (struct MHD_Response *response, + enum MHD_ResponseFlags flags, + ...); + + +/** + * Create a response object. The response object can be extended with + * header information and then be used any number of times. + * + * @param size size of the data portion of the response, #MHD_SIZE_UNKNOWN for unknown + * @param block_size preferred block size for querying crc (advisory only, + * MHD may still call @a crc using smaller chunks); this + * is essentially the buffer size used for IO, clients + * should pick a value that is appropriate for IO and + * memory performance requirements + * @param crc callback to use to obtain response data + * @param crc_cls extra argument to @a crc + * @param crfc callback to call to free @a crc_cls resources + * @return NULL on error (i.e. invalid arguments, out of memory) + * @ingroup response + */ +_MHD_EXTERN struct MHD_Response * +MHD_create_response_from_callback (uint64_t size, + size_t block_size, + MHD_ContentReaderCallback crc, void *crc_cls, + MHD_ContentReaderFreeCallback crfc); + + +/** + * Create a response object. The response object can be extended with + * header information and then be used any number of times. + * + * @param size size of the @a data portion of the response + * @param data the data itself + * @param must_free libmicrohttpd should free data when done + * @param must_copy libmicrohttpd must make a copy of @a data + * right away, the data maybe released anytime after + * this call returns + * @return NULL on error (i.e. invalid arguments, out of memory) + * @deprecated use #MHD_create_response_from_buffer instead + * @ingroup response + */ +_MHD_DEPR_FUNC ( + "MHD_create_response_from_data() is deprecated, use MHD_create_response_from_buffer()") \ + _MHD_EXTERN struct MHD_Response * +MHD_create_response_from_data (size_t size, + void *data, + int must_free, + int must_copy); + + +/** + * Specification for how MHD should treat the memory buffer + * given for the response. + * @ingroup response + */ +enum MHD_ResponseMemoryMode +{ + + /** + * Buffer is a persistent (static/global) buffer that won't change + * for at least the lifetime of the response, MHD should just use + * it, not free it, not copy it, just keep an alias to it. + * @ingroup response + */ + MHD_RESPMEM_PERSISTENT, + + /** + * Buffer is heap-allocated with `malloc()` (or equivalent) and + * should be freed by MHD after processing the response has + * concluded (response reference counter reaches zero). + * @ingroup response + */ + MHD_RESPMEM_MUST_FREE, + + /** + * Buffer is in transient memory, but not on the heap (for example, + * on the stack or non-`malloc()` allocated) and only valid during the + * call to #MHD_create_response_from_buffer. MHD must make its + * own private copy of the data for processing. + * @ingroup response + */ + MHD_RESPMEM_MUST_COPY + +}; + + +/** + * Create a response object. The response object can be extended with + * header information and then be used any number of times. + * + * @param size size of the data portion of the response + * @param buffer size bytes containing the response's data portion + * @param mode flags for buffer management + * @return NULL on error (i.e. invalid arguments, out of memory) + * @ingroup response + */ +_MHD_EXTERN struct MHD_Response * +MHD_create_response_from_buffer (size_t size, + void *buffer, + enum MHD_ResponseMemoryMode mode); + + +/** + * Create a response object. The response object can be extended with + * header information and then be used any number of times. + * + * @param size size of the data portion of the response + * @param buffer size bytes containing the response's data portion + * @param crfc function to call to free the @a buffer + * @return NULL on error (i.e. invalid arguments, out of memory) + * @ingroup response + */ +_MHD_EXTERN struct MHD_Response * +MHD_create_response_from_buffer_with_free_callback (size_t size, + void *buffer, + MHD_ContentReaderFreeCallback + crfc); + + +/** + * Create a response object. The response object can be extended with + * header information and then be used any number of times. + * + * @param size size of the data portion of the response + * @param fd file descriptor referring to a file on disk with the + * data; will be closed when response is destroyed; + * fd should be in 'blocking' mode + * @return NULL on error (i.e. invalid arguments, out of memory) + * @ingroup response + */ +_MHD_EXTERN struct MHD_Response * +MHD_create_response_from_fd (size_t size, + int fd); + + +/** + * Create a response object. The response object can be extended with + * header information and then be used any number of times. + * + * @param size size of the data portion of the response; + * sizes larger than 2 GiB may be not supported by OS or + * MHD build; see ::MHD_FEATURE_LARGE_FILE + * @param fd file descriptor referring to a file on disk with the + * data; will be closed when response is destroyed; + * fd should be in 'blocking' mode + * @return NULL on error (i.e. invalid arguments, out of memory) + * @ingroup response + */ +_MHD_EXTERN struct MHD_Response * +MHD_create_response_from_fd64 (uint64_t size, + int fd); + + +/** + * Create a response object. The response object can be extended with + * header information and then be used any number of times. + * + * @param size size of the data portion of the response + * @param fd file descriptor referring to a file on disk with the + * data; will be closed when response is destroyed; + * fd should be in 'blocking' mode + * @param offset offset to start reading from in the file; + * Be careful! `off_t` may have been compiled to be a + * 64-bit variable for MHD, in which case your application + * also has to be compiled using the same options! Read + * the MHD manual for more details. + * @return NULL on error (i.e. invalid arguments, out of memory) + * @ingroup response + */ +_MHD_DEPR_FUNC ( + "Function MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \ + _MHD_EXTERN struct MHD_Response * +MHD_create_response_from_fd_at_offset (size_t size, + int fd, + off_t offset); + +#if ! defined(_MHD_NO_DEPR_IN_MACRO) || defined(_MHD_NO_DEPR_FUNC) +/* Substitute MHD_create_response_from_fd_at_offset64() instead of MHD_create_response_from_fd_at_offset() + to minimize potential problems with different off_t sizes */ +#define MHD_create_response_from_fd_at_offset(size,fd,offset) \ + _MHD_DEPR_IN_MACRO ( \ + "Usage of MHD_create_response_from_fd_at_offset() is deprecated, use MHD_create_response_from_fd_at_offset64()") \ + MHD_create_response_from_fd_at_offset64 ((size),(fd),(offset)) +#endif /* !_MHD_NO_DEPR_IN_MACRO || _MHD_NO_DEPR_FUNC */ + + +/** + * Create a response object. The response object can be extended with + * header information and then be used any number of times. + * + * @param size size of the data portion of the response; + * sizes larger than 2 GiB may be not supported by OS or + * MHD build; see ::MHD_FEATURE_LARGE_FILE + * @param fd file descriptor referring to a file on disk with the + * data; will be closed when response is destroyed; + * fd should be in 'blocking' mode + * @param offset offset to start reading from in the file; + * reading file beyond 2 GiB may be not supported by OS or + * MHD build; see ::MHD_FEATURE_LARGE_FILE + * @return NULL on error (i.e. invalid arguments, out of memory) + * @ingroup response + */ +_MHD_EXTERN struct MHD_Response * +MHD_create_response_from_fd_at_offset64 (uint64_t size, + int fd, + uint64_t offset); + + +/** + * Enumeration for actions MHD should perform on the underlying socket + * of the upgrade. This API is not finalized, and in particular + * the final set of actions is yet to be decided. This is just an + * idea for what we might want. + */ +enum MHD_UpgradeAction +{ + + /** + * Close the socket, the application is done with it. + * + * Takes no extra arguments. + */ + MHD_UPGRADE_ACTION_CLOSE = 0, + + /** + * Enable CORKing on the underlying socket. + */ + MHD_UPGRADE_ACTION_CORK_ON = 1, + + /** + * Disable CORKing on the underlying socket. + */ + MHD_UPGRADE_ACTION_CORK_OFF = 2 + +}; + + +/** + * Handle given to the application to manage special + * actions relating to MHD responses that "upgrade" + * the HTTP protocol (i.e. to WebSockets). + */ +struct MHD_UpgradeResponseHandle; + + +/** + * This connection-specific callback is provided by MHD to + * applications (unusual) during the #MHD_UpgradeHandler. + * It allows applications to perform 'special' actions on + * the underlying socket from the upgrade. + * + * @param urh the handle identifying the connection to perform + * the upgrade @a action on. + * @param action which action should be performed + * @param ... arguments to the action (depends on the action) + * @return #MHD_NO on error, #MHD_YES on success + */ +_MHD_EXTERN int +MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh, + enum MHD_UpgradeAction action, + ...); + + +/** + * Function called after a protocol "upgrade" response was sent + * successfully and the socket should now be controlled by some + * protocol other than HTTP. + * + * Any data already received on the socket will be made available in + * @e extra_in. This can happen if the application sent extra data + * before MHD send the upgrade response. The application should + * treat data from @a extra_in as if it had read it from the socket. + * + * Note that the application must not close() @a sock directly, + * but instead use #MHD_upgrade_action() for special operations + * on @a sock. + * + * Data forwarding to "upgraded" @a sock will be started as soon + * as this function return. + * + * Except when in 'thread-per-connection' mode, implementations + * of this function should never block (as it will still be called + * from within the main event loop). + * + * @param cls closure, whatever was given to #MHD_create_response_for_upgrade(). + * @param connection original HTTP connection handle, + * giving the function a last chance + * to inspect the original HTTP request + * @param con_cls last value left in `con_cls` of the `MHD_AccessHandlerCallback` + * @param extra_in if we happened to have read bytes after the + * HTTP header already (because the client sent + * more than the HTTP header of the request before + * we sent the upgrade response), + * these are the extra bytes already read from @a sock + * by MHD. The application should treat these as if + * it had read them from @a sock. + * @param extra_in_size number of bytes in @a extra_in + * @param sock socket to use for bi-directional communication + * with the client. For HTTPS, this may not be a socket + * that is directly connected to the client and thus certain + * operations (TCP-specific setsockopt(), getsockopt(), etc.) + * may not work as expected (as the socket could be from a + * socketpair() or a TCP-loopback). The application is expected + * to perform read()/recv() and write()/send() calls on the socket. + * The application may also call shutdown(), but must not call + * close() directly. + * @param urh argument for #MHD_upgrade_action()s on this @a connection. + * Applications must eventually use this callback to (indirectly) + * perform the close() action on the @a sock. + */ +typedef void +(*MHD_UpgradeHandler)(void *cls, + struct MHD_Connection *connection, + void *con_cls, + const char *extra_in, + size_t extra_in_size, + MHD_socket sock, + struct MHD_UpgradeResponseHandle *urh); + + +/** + * Create a response object that can be used for 101 UPGRADE + * responses, for example to implement WebSockets. After sending the + * response, control over the data stream is given to the callback (which + * can then, for example, start some bi-directional communication). + * If the response is queued for multiple connections, the callback + * will be called for each connection. The callback + * will ONLY be called after the response header was successfully passed + * to the OS; if there are communication errors before, the usual MHD + * connection error handling code will be performed. + * + * Setting the correct HTTP code (i.e. MHD_HTTP_SWITCHING_PROTOCOLS) + * and setting correct HTTP headers for the upgrade must be done + * manually (this way, it is possible to implement most existing + * WebSocket versions using this API; in fact, this API might be useful + * for any protocol switch, not just WebSockets). Note that + * draft-ietf-hybi-thewebsocketprotocol-00 cannot be implemented this + * way as the header "HTTP/1.1 101 WebSocket Protocol Handshake" + * cannot be generated; instead, MHD will always produce "HTTP/1.1 101 + * Switching Protocols" (if the response code 101 is used). + * + * As usual, the response object can be extended with header + * information and then be used any number of times (as long as the + * header information is not connection-specific). + * + * @param upgrade_handler function to call with the "upgraded" socket + * @param upgrade_handler_cls closure for @a upgrade_handler + * @return NULL on error (i.e. invalid arguments, out of memory) + */ +_MHD_EXTERN struct MHD_Response * +MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler, + void *upgrade_handler_cls); + + +/** + * Destroy a response object and associated resources. Note that + * libmicrohttpd may keep some of the resources around if the response + * is still in the queue for some clients, so the memory may not + * necessarily be freed immediatley. + * + * @param response response to destroy + * @ingroup response + */ +_MHD_EXTERN void +MHD_destroy_response (struct MHD_Response *response); + + +/** + * Add a header line to the response. + * + * @param response response to add a header to + * @param header the header to add + * @param content value to add + * @return #MHD_NO on error (i.e. invalid header or content format), + * or out of memory + * @ingroup response + */ +_MHD_EXTERN int +MHD_add_response_header (struct MHD_Response *response, + const char *header, + const char *content); + + +/** + * Add a footer line to the response. + * + * @param response response to remove a header from + * @param footer the footer to delete + * @param content value to delete + * @return #MHD_NO on error (i.e. invalid footer or content format). + * @ingroup response + */ +_MHD_EXTERN int +MHD_add_response_footer (struct MHD_Response *response, + const char *footer, + const char *content); + + +/** + * Delete a header (or footer) line from the response. + * + * @param response response to remove a header from + * @param header the header to delete + * @param content value to delete + * @return #MHD_NO on error (no such header known) + * @ingroup response + */ +_MHD_EXTERN int +MHD_del_response_header (struct MHD_Response *response, + const char *header, + const char *content); + + +/** + * Get all of the headers (and footers) added to a response. + * + * @param response response to query + * @param iterator callback to call on each header; + * maybe NULL (then just count headers) + * @param iterator_cls extra argument to @a iterator + * @return number of entries iterated over + * @ingroup response + */ +_MHD_EXTERN int +MHD_get_response_headers (struct MHD_Response *response, + MHD_KeyValueIterator iterator, + void *iterator_cls); + + +/** + * Get a particular header (or footer) from the response. + * + * @param response response to query + * @param key which header to get + * @return NULL if header does not exist + * @ingroup response + */ +_MHD_EXTERN const char * +MHD_get_response_header (struct MHD_Response *response, + const char *key); + + +/* ********************** PostProcessor functions ********************** */ + +/** + * Create a `struct MHD_PostProcessor`. + * + * A `struct MHD_PostProcessor` can be used to (incrementally) parse + * the data portion of a POST request. Note that some buggy browsers + * fail to set the encoding type. If you want to support those, you + * may have to call #MHD_set_connection_value with the proper encoding + * type before creating a post processor (if no supported encoding + * type is set, this function will fail). + * + * @param connection the connection on which the POST is + * happening (used to determine the POST format) + * @param buffer_size maximum number of bytes to use for + * internal buffering (used only for the parsing, + * specifically the parsing of the keys). A + * tiny value (256-1024) should be sufficient. + * Do NOT use a value smaller than 256. For good + * performance, use 32 or 64k (i.e. 65536). + * @param iter iterator to be called with the parsed data, + * Must NOT be NULL. + * @param iter_cls first argument to @a iter + * @return NULL on error (out of memory, unsupported encoding), + * otherwise a PP handle + * @ingroup request + */ +_MHD_EXTERN struct MHD_PostProcessor * +MHD_create_post_processor (struct MHD_Connection *connection, + size_t buffer_size, + MHD_PostDataIterator iter, void *iter_cls); + + +/** + * Parse and process POST data. Call this function when POST data is + * available (usually during an #MHD_AccessHandlerCallback) with the + * "upload_data" and "upload_data_size". Whenever possible, this will + * then cause calls to the #MHD_PostDataIterator. + * + * @param pp the post processor + * @param post_data @a post_data_len bytes of POST data + * @param post_data_len length of @a post_data + * @return #MHD_YES on success, #MHD_NO on error + * (out-of-memory, iterator aborted, parse error) + * @ingroup request + */ +_MHD_EXTERN int +MHD_post_process (struct MHD_PostProcessor *pp, + const char *post_data, size_t post_data_len); + + +/** + * Release PostProcessor resources. + * + * @param pp the PostProcessor to destroy + * @return #MHD_YES if processing completed nicely, + * #MHD_NO if there were spurious characters / formatting + * problems; it is common to ignore the return + * value of this function + * @ingroup request + */ +_MHD_EXTERN int +MHD_destroy_post_processor (struct MHD_PostProcessor *pp); + + +/* ********************* Digest Authentication functions *************** */ + + +/** + * Constant to indicate that the nonce of the provided + * authentication code was wrong. + * @ingroup authentication + */ +#define MHD_INVALID_NONCE -1 + + +/** + * Get the username from the authorization header sent by the client + * + * @param connection The MHD connection structure + * @return NULL if no username could be found, a pointer + * to the username if found, free using #MHD_free(). + * @ingroup authentication + */ +_MHD_EXTERN char * +MHD_digest_auth_get_username (struct MHD_Connection *connection); + + +/** + * Free the memory given by @a ptr. Calls "free(ptr)". This function + * should be used to free the username returned by + * #MHD_digest_auth_get_username(). + * @note Since v0.9.56 + * + * @param ptr pointer to free. + */ +_MHD_EXTERN void +MHD_free (void *ptr); + + +/** + * Which digest algorithm should MHD use for HTTP digest authentication? + */ +enum MHD_DigestAuthAlgorithm +{ + + /** + * MHD should pick (currently defaults to SHA-256). + */ + MHD_DIGEST_ALG_AUTO = 0, + + /** + * Force use of MD5. + */ + MHD_DIGEST_ALG_MD5, + + /** + * Force use of SHA-256. + */ + MHD_DIGEST_ALG_SHA256 + +}; + + +/** + * Authenticates the authorization header sent by the client. + * + * @param connection The MHD connection structure + * @param realm The realm presented to the client + * @param username The username needs to be authenticated + * @param password The password used in the authentication + * @param nonce_timeout The amount of time for a nonce to be + * invalid in seconds + * @param algo digest algorithms allowed for verification + * @return #MHD_YES if authenticated, #MHD_NO if not, + * #MHD_INVALID_NONCE if nonce is invalid + * @ingroup authentication + */ +_MHD_EXTERN int +MHD_digest_auth_check2 (struct MHD_Connection *connection, + const char *realm, + const char *username, + const char *password, + unsigned int nonce_timeout, + enum MHD_DigestAuthAlgorithm algo); + + +/** + * Authenticates the authorization header sent by the client. + * Uses #MHD_DIGEST_ALG_MD5 (for now, for backwards-compatibility). + * Note that this MAY change to #MHD_DIGEST_ALG_AUTO in the future. + * If you want to be sure you get MD5, use #MHD_digest_auth_check2() + * and specifiy MD5 explicitly. + * + * @param connection The MHD connection structure + * @param realm The realm presented to the client + * @param username The username needs to be authenticated + * @param password The password used in the authentication + * @param nonce_timeout The amount of time for a nonce to be + * invalid in seconds + * @return #MHD_YES if authenticated, #MHD_NO if not, + * #MHD_INVALID_NONCE if nonce is invalid + * @ingroup authentication + * @deprecated use MHD_digest_auth_check2() + */ +_MHD_EXTERN int +MHD_digest_auth_check (struct MHD_Connection *connection, + const char *realm, + const char *username, + const char *password, + unsigned int nonce_timeout); + + +/** + * Authenticates the authorization header sent by the client. + * + * @param connection The MHD connection structure + * @param realm The realm presented to the client + * @param username The username needs to be authenticated + * @param digest An `unsigned char *' pointer to the binary MD5 sum + * for the precalculated hash value "username:realm:password" + * of @a digest_size bytes + * @param digest_size number of bytes in @a digest (size must match @a algo!) + * @param nonce_timeout The amount of time for a nonce to be + * invalid in seconds + * @param algo digest algorithms allowed for verification + * @return #MHD_YES if authenticated, #MHD_NO if not, + * #MHD_INVALID_NONCE if nonce is invalid + * @ingroup authentication + */ +_MHD_EXTERN int +MHD_digest_auth_check_digest2 (struct MHD_Connection *connection, + const char *realm, + const char *username, + const uint8_t *digest, + size_t digest_size, + unsigned int nonce_timeout, + enum MHD_DigestAuthAlgorithm algo); + + +/** + * Authenticates the authorization header sent by the client + * Uses #MHD_DIGEST_ALG_MD5 (required, as @a digest is of fixed + * size). + * + * @param connection The MHD connection structure + * @param realm The realm presented to the client + * @param username The username needs to be authenticated + * @param digest An `unsigned char *' pointer to the binary hash + * for the precalculated hash value "username:realm:password"; + * length must be #MHD_MD5_DIGEST_SIZE bytes + * @param nonce_timeout The amount of time for a nonce to be + * invalid in seconds + * @return #MHD_YES if authenticated, #MHD_NO if not, + * #MHD_INVALID_NONCE if nonce is invalid + * @ingroup authentication + * @deprecated use #MHD_digest_auth_check_digest2() + */ +_MHD_EXTERN int +MHD_digest_auth_check_digest (struct MHD_Connection *connection, + const char *realm, + const char *username, + const uint8_t digest[MHD_MD5_DIGEST_SIZE], + unsigned int nonce_timeout); + + +/** + * Queues a response to request authentication from the client + * + * @param connection The MHD connection structure + * @param realm the realm presented to the client + * @param opaque string to user for opaque value + * @param response reply to send; should contain the "access denied" + * body; note that this function will set the "WWW Authenticate" + * header and that the caller should not do this + * @param signal_stale #MHD_YES if the nonce is invalid to add + * 'stale=true' to the authentication header + * @param algo digest algorithm to use + * @return #MHD_YES on success, #MHD_NO otherwise + * @ingroup authentication + */ +_MHD_EXTERN int +MHD_queue_auth_fail_response2 (struct MHD_Connection *connection, + const char *realm, + const char *opaque, + struct MHD_Response *response, + int signal_stale, + enum MHD_DigestAuthAlgorithm algo); + + +/** + * Queues a response to request authentication from the client + * For now uses MD5 (for backwards-compatibility). Still, if you + * need to be sure, use #MHD_queue_fail_auth_response2(). + * + * @param connection The MHD connection structure + * @param realm The realm presented to the client + * @param opaque string to user for opaque value + * @param response reply to send; should contain the "access denied" + * body; note that this function will set the "WWW Authenticate" + * header and that the caller should not do this + * @param signal_stale #MHD_YES if the nonce is invalid to add + * 'stale=true' to the authentication header + * @return #MHD_YES on success, #MHD_NO otherwise + * @ingroup authentication + * @deprecated use MHD_queue_auth_fail_response2() + */ +_MHD_EXTERN int +MHD_queue_auth_fail_response (struct MHD_Connection *connection, + const char *realm, + const char *opaque, + struct MHD_Response *response, + int signal_stale); + + +/** + * Get the username and password from the basic authorization header sent by the client + * + * @param connection The MHD connection structure + * @param[out] password a pointer for the password, free using #MHD_free(). + * @return NULL if no username could be found, a pointer + * to the username if found, free using #MHD_free(). + * @ingroup authentication + */ +_MHD_EXTERN char * +MHD_basic_auth_get_username_password (struct MHD_Connection *connection, + char**password); + + +/** + * Queues a response to request basic authentication from the client + * The given response object is expected to include the payload for + * the response; the "WWW-Authenticate" header will be added and the + * response queued with the 'UNAUTHORIZED' status code. + * + * @param connection The MHD connection structure + * @param realm the realm presented to the client + * @param response response object to modify and queue + * @return #MHD_YES on success, #MHD_NO otherwise + * @ingroup authentication + */ +_MHD_EXTERN int +MHD_queue_basic_auth_fail_response (struct MHD_Connection *connection, + const char *realm, + struct MHD_Response *response); + +/* ********************** generic query functions ********************** */ + + +/** + * Obtain information about the given connection. + * + * @param connection what connection to get information about + * @param info_type what information is desired? + * @param ... depends on @a info_type + * @return NULL if this information is not available + * (or if the @a info_type is unknown) + * @ingroup specialized + */ +_MHD_EXTERN const union MHD_ConnectionInfo * +MHD_get_connection_info (struct MHD_Connection *connection, + enum MHD_ConnectionInfoType info_type, + ...); + + +/** + * MHD connection options. Given to #MHD_set_connection_option to + * set custom options for a particular connection. + */ +enum MHD_CONNECTION_OPTION +{ + + /** + * Set a custom timeout for the given connection. Specified + * as the number of seconds, given as an `unsigned int`. Use + * zero for no timeout. + * If timeout was set to zero (or unset) before, setup of new value by + * MHD_set_connection_option() will reset timeout timer. + */ + MHD_CONNECTION_OPTION_TIMEOUT + +}; + + +/** + * Set a custom option for the given connection, overriding defaults. + * + * @param connection connection to modify + * @param option option to set + * @param ... arguments to the option, depending on the option type + * @return #MHD_YES on success, #MHD_NO if setting the option failed + * @ingroup specialized + */ +_MHD_EXTERN int +MHD_set_connection_option (struct MHD_Connection *connection, + enum MHD_CONNECTION_OPTION option, + ...); + + +/** + * Information about an MHD daemon. + */ +union MHD_DaemonInfo +{ + /** + * Size of the key, no longer supported. + * @deprecated + */ + size_t key_size; + + /** + * Size of the mac key, no longer supported. + * @deprecated + */ + size_t mac_key_size; + + /** + * Socket, returned for #MHD_DAEMON_INFO_LISTEN_FD. + */ + MHD_socket listen_fd; + + /** + * Bind port number, returned for #MHD_DAEMON_INFO_BIND_PORT. + */ + uint16_t port; + + /** + * epoll FD, returned for #MHD_DAEMON_INFO_EPOLL_FD. + */ + int epoll_fd; + + /** + * Number of active connections, for #MHD_DAEMON_INFO_CURRENT_CONNECTIONS. + */ + unsigned int num_connections; + + /** + * Combination of #MHD_FLAG values, for #MHD_DAEMON_INFO_FLAGS. + * This value is actually a bitfield. + * Note: flags may differ from original 'flags' specified for + * daemon, especially if #MHD_USE_AUTO was set. + */ + enum MHD_FLAG flags; +}; + + +/** + * Obtain information about the given daemon + * (not fully implemented!). + * + * @param daemon what daemon to get information about + * @param info_type what information is desired? + * @param ... depends on @a info_type + * @return NULL if this information is not available + * (or if the @a info_type is unknown) + * @ingroup specialized + */ +_MHD_EXTERN const union MHD_DaemonInfo * +MHD_get_daemon_info (struct MHD_Daemon *daemon, + enum MHD_DaemonInfoType info_type, + ...); + + +/** + * Obtain the version of this library + * + * @return static version string, e.g. "0.9.9" + * @ingroup specialized + */ +_MHD_EXTERN const char* +MHD_get_version (void); + + +/** + * Types of information about MHD features, + * used by #MHD_is_feature_supported(). + */ +enum MHD_FEATURE +{ + /** + * Get whether messages are supported. If supported then in debug + * mode messages can be printed to stderr or to external logger. + */ + MHD_FEATURE_MESSAGES = 1, + + /** + * Get whether HTTPS is supported. If supported then flag + * #MHD_USE_TLS and options #MHD_OPTION_HTTPS_MEM_KEY, + * #MHD_OPTION_HTTPS_MEM_CERT, #MHD_OPTION_HTTPS_MEM_TRUST, + * #MHD_OPTION_HTTPS_MEM_DHPARAMS, #MHD_OPTION_HTTPS_CRED_TYPE, + * #MHD_OPTION_HTTPS_PRIORITIES can be used. + */ + MHD_FEATURE_TLS = 2, + MHD_FEATURE_SSL = 2, + + /** + * Get whether option #MHD_OPTION_HTTPS_CERT_CALLBACK is + * supported. + */ + MHD_FEATURE_HTTPS_CERT_CALLBACK = 3, + + /** + * Get whether IPv6 is supported. If supported then flag + * #MHD_USE_IPv6 can be used. + */ + MHD_FEATURE_IPv6 = 4, + + /** + * Get whether IPv6 without IPv4 is supported. If not supported + * then IPv4 is always enabled in IPv6 sockets and + * flag #MHD_USE_DUAL_STACK if always used when #MHD_USE_IPv6 is + * specified. + */ + MHD_FEATURE_IPv6_ONLY = 5, + + /** + * Get whether `poll()` is supported. If supported then flag + * #MHD_USE_POLL can be used. + */ + MHD_FEATURE_POLL = 6, + + /** + * Get whether `epoll()` is supported. If supported then Flags + * #MHD_USE_EPOLL and + * #MHD_USE_EPOLL_INTERNAL_THREAD can be used. + */ + MHD_FEATURE_EPOLL = 7, + + /** + * Get whether shutdown on listen socket to signal other + * threads is supported. If not supported flag + * #MHD_USE_ITC is automatically forced. + */ + MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET = 8, + + /** + * Get whether socketpair is used internally instead of pipe to + * signal other threads. + */ + MHD_FEATURE_SOCKETPAIR = 9, + + /** + * Get whether TCP Fast Open is supported. If supported then + * flag #MHD_USE_TCP_FASTOPEN and option + * #MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE can be used. + */ + MHD_FEATURE_TCP_FASTOPEN = 10, + + /** + * Get whether HTTP Basic authorization is supported. If supported + * then functions #MHD_basic_auth_get_username_password and + * #MHD_queue_basic_auth_fail_response can be used. + */ + MHD_FEATURE_BASIC_AUTH = 11, + + /** + * Get whether HTTP Digest authorization is supported. If + * supported then options #MHD_OPTION_DIGEST_AUTH_RANDOM, + * #MHD_OPTION_NONCE_NC_SIZE and + * #MHD_digest_auth_check() can be used. + */ + MHD_FEATURE_DIGEST_AUTH = 12, + + /** + * Get whether postprocessor is supported. If supported then + * functions #MHD_create_post_processor(), #MHD_post_process() and + * #MHD_destroy_post_processor() can + * be used. + */ + MHD_FEATURE_POSTPROCESSOR = 13, + + /** + * Get whether password encrypted private key for HTTPS daemon is + * supported. If supported then option + * ::MHD_OPTION_HTTPS_KEY_PASSWORD can be used. + */ + MHD_FEATURE_HTTPS_KEY_PASSWORD = 14, + + /** + * Get whether reading files beyond 2 GiB boundary is supported. + * If supported then #MHD_create_response_from_fd(), + * #MHD_create_response_from_fd64 #MHD_create_response_from_fd_at_offset() + * and #MHD_create_response_from_fd_at_offset64() can be used with sizes and + * offsets larger than 2 GiB. If not supported value of size+offset is + * limited to 2 GiB. + */ + MHD_FEATURE_LARGE_FILE = 15, + + /** + * Get whether MHD set names on generated threads. + */ + MHD_FEATURE_THREAD_NAMES = 16, + MHD_THREAD_NAMES = 16, + + /** + * Get whether HTTP "Upgrade" is supported. + * If supported then #MHD_ALLOW_UPGRADE, #MHD_upgrade_action() and + * #MHD_create_response_for_upgrade() can be used. + */ + MHD_FEATURE_UPGRADE = 17, + + /** + * Get whether it's safe to use same FD for multiple calls of + * #MHD_create_response_from_fd() and whether it's safe to use single + * response generated by #MHD_create_response_from_fd() with multiple + * connections at same time. + * If #MHD_is_feature_supported() return #MHD_NO for this feature then + * usage of responses with same file FD in multiple parallel threads may + * results in incorrect data sent to remote client. + * It's always safe to use same file FD in multiple responses if MHD + * is run in any single thread mode. + */ + MHD_FEATURE_RESPONSES_SHARED_FD = 18, + + /** + * Get whether MHD support automatic detection of bind port number. + * @sa #MHD_DAEMON_INFO_BIND_PORT + */ + MHD_FEATURE_AUTODETECT_BIND_PORT = 19, + + /** + * Get whether MHD support SIGPIPE suppression. + * If SIGPIPE suppression is not supported, application must handle + * SIGPIPE signal by itself. + */ + MHD_FEATURE_AUTOSUPPRESS_SIGPIPE = 20, + + /** + * Get whether MHD use system's sendfile() function to send + * file-FD based responses over non-TLS connections. + * @note Since v0.9.56 + */ + MHD_FEATURE_SENDFILE = 21, + + /** + * Get whether MHD supports threads. + */ + MHD_FEATURE_THREADS = 22, + + /** + * Get whether option #MHD_OPTION_HTTPS_CERT_CALLBACK2 is + * supported. + */ + MHD_FEATURE_HTTPS_CERT_CALLBACK2 = 23 +}; + + +/** + * Get information about supported MHD features. + * Indicate that MHD was compiled with or without support for + * particular feature. Some features require additional support + * by kernel. Kernel support is not checked by this function. + * + * @param feature type of requested information + * @return #MHD_YES if feature is supported by MHD, #MHD_NO if + * feature is not supported or feature is unknown. + * @ingroup specialized + */ +_MHD_EXTERN int +MHD_is_feature_supported (enum MHD_FEATURE feature); + + +#if 0 /* keep Emacsens' auto-indent happy */ +{ +#endif +#ifdef __cplusplus +} +#endif + +#endif diff --git a/msgpackc/3.2.1/AIX-00FB437F4C00/AIX-00FB437F4C00.tar b/msgpackc/3.2.1/AIX-00FB437F4C00/AIX-00FB437F4C00.tar new file mode 100644 index 0000000000000000000000000000000000000000..965ddaf2089e5d2b690bdf93e2c9d96019f3a013 Binary files /dev/null and b/msgpackc/3.2.1/AIX-00FB437F4C00/AIX-00FB437F4C00.tar differ diff --git a/msgpackc/3.2.1/AIX-00FB437F4C00/libmsgpackc.a b/msgpackc/3.2.1/AIX-00FB437F4C00/libmsgpackc.a new file mode 100644 index 0000000000000000000000000000000000000000..fac0b5d711986ce9fbe8cd110d57740734fc3536 Binary files /dev/null and b/msgpackc/3.2.1/AIX-00FB437F4C00/libmsgpackc.a differ diff --git a/msgpackc/3.2.1/AIX-00FB90154C00/AIX-00FB90154C00.tar b/msgpackc/3.2.1/AIX-00FB90154C00/AIX-00FB90154C00.tar new file mode 100644 index 0000000000000000000000000000000000000000..965ddaf2089e5d2b690bdf93e2c9d96019f3a013 Binary files /dev/null and b/msgpackc/3.2.1/AIX-00FB90154C00/AIX-00FB90154C00.tar differ diff --git a/msgpackc/3.2.1/AIX-00FB90154C00/libmsgpackc.a b/msgpackc/3.2.1/AIX-00FB90154C00/libmsgpackc.a new file mode 100644 index 0000000000000000000000000000000000000000..fac0b5d711986ce9fbe8cd110d57740734fc3536 Binary files /dev/null and b/msgpackc/3.2.1/AIX-00FB90154C00/libmsgpackc.a differ diff --git a/msgpackc/3.2.1/HP-UX-ia64/HP-UX-ia64.tar b/msgpackc/3.2.1/HP-UX-ia64/HP-UX-ia64.tar new file mode 100644 index 0000000000000000000000000000000000000000..21390da96204daef6708449543fa47344dd78b16 Binary files /dev/null and b/msgpackc/3.2.1/HP-UX-ia64/HP-UX-ia64.tar differ diff --git a/msgpackc/3.2.1/HP-UX-ia64/libmsgpackc.sl b/msgpackc/3.2.1/HP-UX-ia64/libmsgpackc.sl new file mode 120000 index 0000000000000000000000000000000000000000..d7bc79fb44aa25f1cb242336a148563a21a5c960 --- /dev/null +++ b/msgpackc/3.2.1/HP-UX-ia64/libmsgpackc.sl @@ -0,0 +1 @@ +libmsgpackc.sl.1 \ No newline at end of file diff --git a/msgpackc/3.2.1/HP-UX-ia64/libmsgpackc.sl.1 b/msgpackc/3.2.1/HP-UX-ia64/libmsgpackc.sl.1 new file mode 100755 index 0000000000000000000000000000000000000000..6115d9f0165ed46fad34bd6ae19e273697d4c132 Binary files /dev/null and b/msgpackc/3.2.1/HP-UX-ia64/libmsgpackc.sl.1 differ diff --git a/msgpackc/3.2.1/Linux-x86_64/Linux-x86_64.tar b/msgpackc/3.2.1/Linux-x86_64/Linux-x86_64.tar new file mode 100644 index 0000000000000000000000000000000000000000..01300684f339acfa9e5a046cae2f63268f224ae4 Binary files /dev/null and b/msgpackc/3.2.1/Linux-x86_64/Linux-x86_64.tar differ diff --git a/msgpackc/3.2.1/Linux-x86_64/libmsgpackc.so b/msgpackc/3.2.1/Linux-x86_64/libmsgpackc.so new file mode 120000 index 0000000000000000000000000000000000000000..8d6f0f93ec29beec81bc3a54f47a65645a5db0c9 --- /dev/null +++ b/msgpackc/3.2.1/Linux-x86_64/libmsgpackc.so @@ -0,0 +1 @@ +libmsgpackc.so.1 \ No newline at end of file diff --git a/msgpackc/3.2.1/Linux-x86_64/libmsgpackc.so.1 b/msgpackc/3.2.1/Linux-x86_64/libmsgpackc.so.1 new file mode 120000 index 0000000000000000000000000000000000000000..59058c5fb7f52f3d24b0ea666a43aa0d9597d73f --- /dev/null +++ b/msgpackc/3.2.1/Linux-x86_64/libmsgpackc.so.1 @@ -0,0 +1 @@ +libmsgpackc.so.3.2.1 \ No newline at end of file diff --git a/msgpackc/3.2.1/Linux-x86_64/libmsgpackc.so.3.2.1 b/msgpackc/3.2.1/Linux-x86_64/libmsgpackc.so.3.2.1 new file mode 100755 index 0000000000000000000000000000000000000000..192f76b90d014b8c160c89692fbf0f02206a8380 Binary files /dev/null and b/msgpackc/3.2.1/Linux-x86_64/libmsgpackc.so.3.2.1 differ diff --git a/msgpackc/3.2.1/Linux-x86_64_5/Linux-x86_64_5.tar b/msgpackc/3.2.1/Linux-x86_64_5/Linux-x86_64_5.tar new file mode 100644 index 0000000000000000000000000000000000000000..23428b6e4d8b4b4fd48f0dbd189677bc69fe1c7c Binary files /dev/null and b/msgpackc/3.2.1/Linux-x86_64_5/Linux-x86_64_5.tar differ diff --git a/msgpackc/3.2.1/Linux-x86_64_5/libmsgpackc.so b/msgpackc/3.2.1/Linux-x86_64_5/libmsgpackc.so new file mode 120000 index 0000000000000000000000000000000000000000..8d6f0f93ec29beec81bc3a54f47a65645a5db0c9 --- /dev/null +++ b/msgpackc/3.2.1/Linux-x86_64_5/libmsgpackc.so @@ -0,0 +1 @@ +libmsgpackc.so.1 \ No newline at end of file diff --git a/msgpackc/3.2.1/Linux-x86_64_5/libmsgpackc.so.1 b/msgpackc/3.2.1/Linux-x86_64_5/libmsgpackc.so.1 new file mode 100755 index 0000000000000000000000000000000000000000..3fbd7e44b5b0e5178087f3bce880822ef218c5dd Binary files /dev/null and b/msgpackc/3.2.1/Linux-x86_64_5/libmsgpackc.so.1 differ diff --git a/msgpackc/3.2.1/Linux-x86_64_6/Linux-x86_64_6.tar b/msgpackc/3.2.1/Linux-x86_64_6/Linux-x86_64_6.tar new file mode 100644 index 0000000000000000000000000000000000000000..32789772746abb57c83a98023cf9c6a1a74eb2cc Binary files /dev/null and b/msgpackc/3.2.1/Linux-x86_64_6/Linux-x86_64_6.tar differ diff --git a/msgpackc/3.2.1/Linux-x86_64_6/libmsgpackc.so b/msgpackc/3.2.1/Linux-x86_64_6/libmsgpackc.so new file mode 120000 index 0000000000000000000000000000000000000000..8d6f0f93ec29beec81bc3a54f47a65645a5db0c9 --- /dev/null +++ b/msgpackc/3.2.1/Linux-x86_64_6/libmsgpackc.so @@ -0,0 +1 @@ +libmsgpackc.so.1 \ No newline at end of file diff --git a/msgpackc/3.2.1/Linux-x86_64_6/libmsgpackc.so.1 b/msgpackc/3.2.1/Linux-x86_64_6/libmsgpackc.so.1 new file mode 100755 index 0000000000000000000000000000000000000000..3fbd7e44b5b0e5178087f3bce880822ef218c5dd Binary files /dev/null and b/msgpackc/3.2.1/Linux-x86_64_6/libmsgpackc.so.1 differ diff --git a/msgpackc/3.2.1/SunOS-5.10/SunOS-5.10.tar b/msgpackc/3.2.1/SunOS-5.10/SunOS-5.10.tar new file mode 100644 index 0000000000000000000000000000000000000000..efcf340e41ff96dada24f6f994b2b3c96e5130ef Binary files /dev/null and b/msgpackc/3.2.1/SunOS-5.10/SunOS-5.10.tar differ diff --git a/msgpackc/3.2.1/SunOS-5.10/libmsgpackc.so b/msgpackc/3.2.1/SunOS-5.10/libmsgpackc.so new file mode 120000 index 0000000000000000000000000000000000000000..8d6f0f93ec29beec81bc3a54f47a65645a5db0c9 --- /dev/null +++ b/msgpackc/3.2.1/SunOS-5.10/libmsgpackc.so @@ -0,0 +1 @@ +libmsgpackc.so.1 \ No newline at end of file diff --git a/msgpackc/3.2.1/SunOS-5.10/libmsgpackc.so.1 b/msgpackc/3.2.1/SunOS-5.10/libmsgpackc.so.1 new file mode 100755 index 0000000000000000000000000000000000000000..ca9510425b2cd6ee5b3f89282dc3785fa2539c93 Binary files /dev/null and b/msgpackc/3.2.1/SunOS-5.10/libmsgpackc.so.1 differ diff --git a/msgpackc/3.2.1/SunOS-sun4v/SunOS-sun4v.tar b/msgpackc/3.2.1/SunOS-sun4v/SunOS-sun4v.tar new file mode 100644 index 0000000000000000000000000000000000000000..76eeddde30e9361c896dc320514069bf0f594c33 Binary files /dev/null and b/msgpackc/3.2.1/SunOS-sun4v/SunOS-sun4v.tar differ diff --git a/msgpackc/3.2.1/SunOS-sun4v/libmsgpackc.so b/msgpackc/3.2.1/SunOS-sun4v/libmsgpackc.so new file mode 120000 index 0000000000000000000000000000000000000000..8d6f0f93ec29beec81bc3a54f47a65645a5db0c9 --- /dev/null +++ b/msgpackc/3.2.1/SunOS-sun4v/libmsgpackc.so @@ -0,0 +1 @@ +libmsgpackc.so.1 \ No newline at end of file diff --git a/msgpackc/3.2.1/SunOS-sun4v/libmsgpackc.so.1 b/msgpackc/3.2.1/SunOS-sun4v/libmsgpackc.so.1 new file mode 100755 index 0000000000000000000000000000000000000000..ca9510425b2cd6ee5b3f89282dc3785fa2539c93 Binary files /dev/null and b/msgpackc/3.2.1/SunOS-sun4v/libmsgpackc.so.1 differ diff --git a/msgpackc/3.2.1/include.tar b/msgpackc/3.2.1/include.tar new file mode 100644 index 0000000000000000000000000000000000000000..494fc7cba8453480714f773ea367dc86ada60300 Binary files /dev/null and b/msgpackc/3.2.1/include.tar differ diff --git a/msgpackc/3.2.1/include/msgpack.h b/msgpackc/3.2.1/include/msgpack.h new file mode 100644 index 0000000000000000000000000000000000000000..af557a5cdb275515e7845f275d7595912d14f3cb --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack.h @@ -0,0 +1,24 @@ +/* + * MessagePack for C + * + * Copyright (C) 2008-2009 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +/** + * @defgroup msgpack MessagePack C + * @{ + * @} + */ + +#include "msgpack/util.h" +#include "msgpack/object.h" +#include "msgpack/zone.h" +#include "msgpack/pack.h" +#include "msgpack/unpack.h" +#include "msgpack/sbuffer.h" +#include "msgpack/vrefbuffer.h" +#include "msgpack/version.h" + diff --git a/msgpackc/3.2.1/include/msgpack/fbuffer.h b/msgpackc/3.2.1/include/msgpack/fbuffer.h new file mode 100644 index 0000000000000000000000000000000000000000..d478008c8d65b72484aeba5ac93e9804fe9aef35 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/fbuffer.h @@ -0,0 +1,38 @@ +/* + * MessagePack for C FILE* buffer adaptor + * + * Copyright (C) 2013 Vladimir Volodko + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_FBUFFER_H +#define MSGPACK_FBUFFER_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @defgroup msgpack_fbuffer FILE* buffer + * @ingroup msgpack_buffer + * @{ + */ + +static inline int msgpack_fbuffer_write(void* data, const char* buf, size_t len) +{ + return (1 == fwrite(buf, len, 1, (FILE *)data)) ? 0 : -1; +} + +/** @} */ + + +#ifdef __cplusplus +} +#endif + +#endif /* msgpack/fbuffer.h */ diff --git a/msgpackc/3.2.1/include/msgpack/gcc_atomic.h b/msgpackc/3.2.1/include/msgpack/gcc_atomic.h new file mode 100644 index 0000000000000000000000000000000000000000..6b1b1a799654fd4ecc975617bac56ff51488b60e --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/gcc_atomic.h @@ -0,0 +1,25 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ + +#ifndef MSGPACK_GCC_ATOMIC_H +#define MSGPACK_GCC_ATOMIC_H + +#if defined(__cplusplus) +extern "C" { +#endif + +typedef int _msgpack_atomic_counter_t; + +int _msgpack_sync_decr_and_fetch(volatile _msgpack_atomic_counter_t* ptr); +int _msgpack_sync_incr_and_fetch(volatile _msgpack_atomic_counter_t* ptr); + + +#if defined(__cplusplus) +} +#endif + + +#endif // MSGPACK_GCC_ATOMIC_H diff --git a/msgpackc/3.2.1/include/msgpack/object.h b/msgpackc/3.2.1/include/msgpack/object.h new file mode 100644 index 0000000000000000000000000000000000000000..e9431744b70b954259456cf4379ffad75d7769a8 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/object.h @@ -0,0 +1,118 @@ +/* + * MessagePack for C dynamic typing routine + * + * Copyright (C) 2008-2009 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_OBJECT_H +#define MSGPACK_OBJECT_H + +#include "zone.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @defgroup msgpack_object Dynamically typed object + * @ingroup msgpack + * @{ + */ + +typedef enum { + MSGPACK_OBJECT_NIL = 0x00, + MSGPACK_OBJECT_BOOLEAN = 0x01, + MSGPACK_OBJECT_POSITIVE_INTEGER = 0x02, + MSGPACK_OBJECT_NEGATIVE_INTEGER = 0x03, + MSGPACK_OBJECT_FLOAT32 = 0x0a, + MSGPACK_OBJECT_FLOAT64 = 0x04, + MSGPACK_OBJECT_FLOAT = 0x04, +#if defined(MSGPACK_USE_LEGACY_NAME_AS_FLOAT) + MSGPACK_OBJECT_DOUBLE = MSGPACK_OBJECT_FLOAT, /* obsolete */ +#endif /* MSGPACK_USE_LEGACY_NAME_AS_FLOAT */ + MSGPACK_OBJECT_STR = 0x05, + MSGPACK_OBJECT_ARRAY = 0x06, + MSGPACK_OBJECT_MAP = 0x07, + MSGPACK_OBJECT_BIN = 0x08, + MSGPACK_OBJECT_EXT = 0x09 +} msgpack_object_type; + + +struct msgpack_object; +struct msgpack_object_kv; + +typedef struct { + uint32_t size; + struct msgpack_object* ptr; +} msgpack_object_array; + +typedef struct { + uint32_t size; + struct msgpack_object_kv* ptr; +} msgpack_object_map; + +typedef struct { + uint32_t size; + const char* ptr; +} msgpack_object_str; + +typedef struct { + uint32_t size; + const char* ptr; +} msgpack_object_bin; + +typedef struct { + int8_t type; + uint32_t size; + const char* ptr; +} msgpack_object_ext; + +typedef union { + bool boolean; + uint64_t u64; + int64_t i64; +#if defined(MSGPACK_USE_LEGACY_NAME_AS_FLOAT) + double dec; /* obsolete*/ +#endif /* MSGPACK_USE_LEGACY_NAME_AS_FLOAT */ + double f64; + msgpack_object_array array; + msgpack_object_map map; + msgpack_object_str str; + msgpack_object_bin bin; + msgpack_object_ext ext; +} msgpack_object_union; + +typedef struct msgpack_object { + msgpack_object_type type; + msgpack_object_union via; +} msgpack_object; + +typedef struct msgpack_object_kv { + msgpack_object key; + msgpack_object val; +} msgpack_object_kv; + +#if !defined(_KERNEL_MODE) +MSGPACK_DLLEXPORT +void msgpack_object_print(FILE* out, msgpack_object o); +#endif + +MSGPACK_DLLEXPORT +int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object o); + +MSGPACK_DLLEXPORT +bool msgpack_object_equal(const msgpack_object x, const msgpack_object y); + +/** @} */ + + +#ifdef __cplusplus +} +#endif + +#endif /* msgpack/object.h */ diff --git a/msgpackc/3.2.1/include/msgpack/pack.h b/msgpackc/3.2.1/include/msgpack/pack.h new file mode 100644 index 0000000000000000000000000000000000000000..f2dddb3c5fb215e92c6817a54eed248cb6aad6e4 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/pack.h @@ -0,0 +1,151 @@ +/* + * MessagePack for C packing routine + * + * Copyright (C) 2008-2009 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_PACK_H +#define MSGPACK_PACK_H + +#include "pack_define.h" +#include "object.h" +#include "timestamp.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @defgroup msgpack_buffer Buffers + * @ingroup msgpack + * @{ + * @} + */ + +/** + * @defgroup msgpack_pack Serializer + * @ingroup msgpack + * @{ + */ + +typedef int (*msgpack_packer_write)(void* data, const char* buf, size_t len); + +typedef struct msgpack_packer { + void* data; + msgpack_packer_write callback; +} msgpack_packer; + +static void msgpack_packer_init(msgpack_packer* pk, void* data, msgpack_packer_write callback); + +static msgpack_packer* msgpack_packer_new(void* data, msgpack_packer_write callback); +static void msgpack_packer_free(msgpack_packer* pk); + +static int msgpack_pack_char(msgpack_packer* pk, char d); + +static int msgpack_pack_signed_char(msgpack_packer* pk, signed char d); +static int msgpack_pack_short(msgpack_packer* pk, short d); +static int msgpack_pack_int(msgpack_packer* pk, int d); +static int msgpack_pack_long(msgpack_packer* pk, long d); +static int msgpack_pack_long_long(msgpack_packer* pk, long long d); +static int msgpack_pack_unsigned_char(msgpack_packer* pk, unsigned char d); +static int msgpack_pack_unsigned_short(msgpack_packer* pk, unsigned short d); +static int msgpack_pack_unsigned_int(msgpack_packer* pk, unsigned int d); +static int msgpack_pack_unsigned_long(msgpack_packer* pk, unsigned long d); +static int msgpack_pack_unsigned_long_long(msgpack_packer* pk, unsigned long long d); + +static int msgpack_pack_uint8(msgpack_packer* pk, uint8_t d); +static int msgpack_pack_uint16(msgpack_packer* pk, uint16_t d); +static int msgpack_pack_uint32(msgpack_packer* pk, uint32_t d); +static int msgpack_pack_uint64(msgpack_packer* pk, uint64_t d); +static int msgpack_pack_int8(msgpack_packer* pk, int8_t d); +static int msgpack_pack_int16(msgpack_packer* pk, int16_t d); +static int msgpack_pack_int32(msgpack_packer* pk, int32_t d); +static int msgpack_pack_int64(msgpack_packer* pk, int64_t d); + +static int msgpack_pack_fix_uint8(msgpack_packer* pk, uint8_t d); +static int msgpack_pack_fix_uint16(msgpack_packer* pk, uint16_t d); +static int msgpack_pack_fix_uint32(msgpack_packer* pk, uint32_t d); +static int msgpack_pack_fix_uint64(msgpack_packer* pk, uint64_t d); +static int msgpack_pack_fix_int8(msgpack_packer* pk, int8_t d); +static int msgpack_pack_fix_int16(msgpack_packer* pk, int16_t d); +static int msgpack_pack_fix_int32(msgpack_packer* pk, int32_t d); +static int msgpack_pack_fix_int64(msgpack_packer* pk, int64_t d); + +static int msgpack_pack_float(msgpack_packer* pk, float d); +static int msgpack_pack_double(msgpack_packer* pk, double d); + +static int msgpack_pack_nil(msgpack_packer* pk); +static int msgpack_pack_true(msgpack_packer* pk); +static int msgpack_pack_false(msgpack_packer* pk); + +static int msgpack_pack_array(msgpack_packer* pk, size_t n); + +static int msgpack_pack_map(msgpack_packer* pk, size_t n); + +static int msgpack_pack_str(msgpack_packer* pk, size_t l); +static int msgpack_pack_str_body(msgpack_packer* pk, const void* b, size_t l); + +static int msgpack_pack_v4raw(msgpack_packer* pk, size_t l); +static int msgpack_pack_v4raw_body(msgpack_packer* pk, const void* b, size_t l); + +static int msgpack_pack_bin(msgpack_packer* pk, size_t l); +static int msgpack_pack_bin_body(msgpack_packer* pk, const void* b, size_t l); + +static int msgpack_pack_ext(msgpack_packer* pk, size_t l, int8_t type); +static int msgpack_pack_ext_body(msgpack_packer* pk, const void* b, size_t l); + +static int msgpack_pack_timestamp(msgpack_packer* pk, const msgpack_timestamp* d); + +MSGPACK_DLLEXPORT +int msgpack_pack_object(msgpack_packer* pk, msgpack_object d); + + +/** @} */ + + +#define msgpack_pack_inline_func(name) \ + inline int msgpack_pack ## name + +#define msgpack_pack_inline_func_cint(name) \ + inline int msgpack_pack ## name + +#define msgpack_pack_inline_func_fixint(name) \ + inline int msgpack_pack_fix ## name + +#define msgpack_pack_user msgpack_packer* + +#define msgpack_pack_append_buffer(user, buf, len) \ + return (*(user)->callback)((user)->data, (const char*)buf, len) + +#include "pack_template.h" + +inline void msgpack_packer_init(msgpack_packer* pk, void* data, msgpack_packer_write callback) +{ + pk->data = data; + pk->callback = callback; +} + +inline msgpack_packer* msgpack_packer_new(void* data, msgpack_packer_write callback) +{ + msgpack_packer* pk = (msgpack_packer*)calloc(1, sizeof(msgpack_packer)); + if(!pk) { return NULL; } + msgpack_packer_init(pk, data, callback); + return pk; +} + +inline void msgpack_packer_free(msgpack_packer* pk) +{ + free(pk); +} + + +#ifdef __cplusplus +} +#endif + +#endif /* msgpack/pack.h */ diff --git a/msgpackc/3.2.1/include/msgpack/pack_define.h b/msgpackc/3.2.1/include/msgpack/pack_define.h new file mode 100644 index 0000000000000000000000000000000000000000..ce98b67558a3bb053d7ec5ca1098e16b255b75cc --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/pack_define.h @@ -0,0 +1,18 @@ +/* + * MessagePack unpacking routine template + * + * Copyright (C) 2008-2010 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_PACK_DEFINE_H +#define MSGPACK_PACK_DEFINE_H + +#include "msgpack/sysdep.h" +#include +#include + +#endif /* msgpack/pack_define.h */ + diff --git a/msgpackc/3.2.1/include/msgpack/pack_template.h b/msgpackc/3.2.1/include/msgpack/pack_template.h new file mode 100644 index 0000000000000000000000000000000000000000..ac112e1d920af94c172e8fab5d50e910df44b366 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/pack_template.h @@ -0,0 +1,945 @@ +/* + * MessagePack packing routine template + * + * Copyright (C) 2008-2010 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ + +#if MSGPACK_ENDIAN_LITTLE_BYTE +#define TAKE8_8(d) ((uint8_t*)&d)[0] +#define TAKE8_16(d) ((uint8_t*)&d)[0] +#define TAKE8_32(d) ((uint8_t*)&d)[0] +#define TAKE8_64(d) ((uint8_t*)&d)[0] +#elif MSGPACK_ENDIAN_BIG_BYTE +#define TAKE8_8(d) ((uint8_t*)&d)[0] +#define TAKE8_16(d) ((uint8_t*)&d)[1] +#define TAKE8_32(d) ((uint8_t*)&d)[3] +#define TAKE8_64(d) ((uint8_t*)&d)[7] +#else +#error msgpack-c supports only big endian and little endian +#endif + +#ifndef msgpack_pack_inline_func +#error msgpack_pack_inline_func template is not defined +#endif + +#ifndef msgpack_pack_user +#error msgpack_pack_user type is not defined +#endif + +#ifndef msgpack_pack_append_buffer +#error msgpack_pack_append_buffer callback is not defined +#endif + +#if defined(_MSC_VER) +# pragma warning(push) +# pragma warning(disable : 4204) /* nonstandard extension used: non-constant aggregate initializer */ +#endif + +/* + * Integer + */ + +#define msgpack_pack_real_uint8(x, d) \ +do { \ + if(d < (1<<7)) { \ + /* fixnum */ \ + msgpack_pack_append_buffer(x, &TAKE8_8(d), 1); \ + } else { \ + /* unsigned 8 */ \ + unsigned char buf[2] = {0xcc, TAKE8_8(d)}; \ + msgpack_pack_append_buffer(x, buf, 2); \ + } \ +} while(0) + +#define msgpack_pack_real_uint16(x, d) \ +do { \ + if(d < (1<<7)) { \ + /* fixnum */ \ + msgpack_pack_append_buffer(x, &TAKE8_16(d), 1); \ + } else if(d < (1<<8)) { \ + /* unsigned 8 */ \ + unsigned char buf[2] = {0xcc, TAKE8_16(d)}; \ + msgpack_pack_append_buffer(x, buf, 2); \ + } else { \ + /* unsigned 16 */ \ + unsigned char buf[3]; \ + buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \ + msgpack_pack_append_buffer(x, buf, 3); \ + } \ +} while(0) + +#define msgpack_pack_real_uint32(x, d) \ +do { \ + if(d < (1<<8)) { \ + if(d < (1<<7)) { \ + /* fixnum */ \ + msgpack_pack_append_buffer(x, &TAKE8_32(d), 1); \ + } else { \ + /* unsigned 8 */ \ + unsigned char buf[2] = {0xcc, TAKE8_32(d)}; \ + msgpack_pack_append_buffer(x, buf, 2); \ + } \ + } else { \ + if(d < (1<<16)) { \ + /* unsigned 16 */ \ + unsigned char buf[3]; \ + buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \ + msgpack_pack_append_buffer(x, buf, 3); \ + } else { \ + /* unsigned 32 */ \ + unsigned char buf[5]; \ + buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \ + msgpack_pack_append_buffer(x, buf, 5); \ + } \ + } \ +} while(0) + +#define msgpack_pack_real_uint64(x, d) \ +do { \ + if(d < (1ULL<<8)) { \ + if(d < (1ULL<<7)) { \ + /* fixnum */ \ + msgpack_pack_append_buffer(x, &TAKE8_64(d), 1); \ + } else { \ + /* unsigned 8 */ \ + unsigned char buf[2] = {0xcc, TAKE8_64(d)}; \ + msgpack_pack_append_buffer(x, buf, 2); \ + } \ + } else { \ + if(d < (1ULL<<16)) { \ + /* unsigned 16 */ \ + unsigned char buf[3]; \ + buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \ + msgpack_pack_append_buffer(x, buf, 3); \ + } else if(d < (1ULL<<32)) { \ + /* unsigned 32 */ \ + unsigned char buf[5]; \ + buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \ + msgpack_pack_append_buffer(x, buf, 5); \ + } else { \ + /* unsigned 64 */ \ + unsigned char buf[9]; \ + buf[0] = 0xcf; _msgpack_store64(&buf[1], d); \ + msgpack_pack_append_buffer(x, buf, 9); \ + } \ + } \ +} while(0) + +#define msgpack_pack_real_int8(x, d) \ +do { \ + if(d < -(1<<5)) { \ + /* signed 8 */ \ + unsigned char buf[2] = {0xd0, TAKE8_8(d)}; \ + msgpack_pack_append_buffer(x, buf, 2); \ + } else { \ + /* fixnum */ \ + msgpack_pack_append_buffer(x, &TAKE8_8(d), 1); \ + } \ +} while(0) + +#define msgpack_pack_real_int16(x, d) \ +do { \ + if(d < -(1<<5)) { \ + if(d < -(1<<7)) { \ + /* signed 16 */ \ + unsigned char buf[3]; \ + buf[0] = 0xd1; _msgpack_store16(&buf[1], (int16_t)d); \ + msgpack_pack_append_buffer(x, buf, 3); \ + } else { \ + /* signed 8 */ \ + unsigned char buf[2] = {0xd0, TAKE8_16(d)}; \ + msgpack_pack_append_buffer(x, buf, 2); \ + } \ + } else if(d < (1<<7)) { \ + /* fixnum */ \ + msgpack_pack_append_buffer(x, &TAKE8_16(d), 1); \ + } else { \ + if(d < (1<<8)) { \ + /* unsigned 8 */ \ + unsigned char buf[2] = {0xcc, TAKE8_16(d)}; \ + msgpack_pack_append_buffer(x, buf, 2); \ + } else { \ + /* unsigned 16 */ \ + unsigned char buf[3]; \ + buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \ + msgpack_pack_append_buffer(x, buf, 3); \ + } \ + } \ +} while(0) + +#define msgpack_pack_real_int32(x, d) \ +do { \ + if(d < -(1<<5)) { \ + if(d < -(1<<15)) { \ + /* signed 32 */ \ + unsigned char buf[5]; \ + buf[0] = 0xd2; _msgpack_store32(&buf[1], (int32_t)d); \ + msgpack_pack_append_buffer(x, buf, 5); \ + } else if(d < -(1<<7)) { \ + /* signed 16 */ \ + unsigned char buf[3]; \ + buf[0] = 0xd1; _msgpack_store16(&buf[1], (int16_t)d); \ + msgpack_pack_append_buffer(x, buf, 3); \ + } else { \ + /* signed 8 */ \ + unsigned char buf[2] = {0xd0, TAKE8_32(d)}; \ + msgpack_pack_append_buffer(x, buf, 2); \ + } \ + } else if(d < (1<<7)) { \ + /* fixnum */ \ + msgpack_pack_append_buffer(x, &TAKE8_32(d), 1); \ + } else { \ + if(d < (1<<8)) { \ + /* unsigned 8 */ \ + unsigned char buf[2] = {0xcc, TAKE8_32(d)}; \ + msgpack_pack_append_buffer(x, buf, 2); \ + } else if(d < (1<<16)) { \ + /* unsigned 16 */ \ + unsigned char buf[3]; \ + buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \ + msgpack_pack_append_buffer(x, buf, 3); \ + } else { \ + /* unsigned 32 */ \ + unsigned char buf[5]; \ + buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \ + msgpack_pack_append_buffer(x, buf, 5); \ + } \ + } \ +} while(0) + +#define msgpack_pack_real_int64(x, d) \ +do { \ + if(d < -(1LL<<5)) { \ + if(d < -(1LL<<15)) { \ + if(d < -(1LL<<31)) { \ + /* signed 64 */ \ + unsigned char buf[9]; \ + buf[0] = 0xd3; _msgpack_store64(&buf[1], d); \ + msgpack_pack_append_buffer(x, buf, 9); \ + } else { \ + /* signed 32 */ \ + unsigned char buf[5]; \ + buf[0] = 0xd2; _msgpack_store32(&buf[1], (int32_t)d); \ + msgpack_pack_append_buffer(x, buf, 5); \ + } \ + } else { \ + if(d < -(1<<7)) { \ + /* signed 16 */ \ + unsigned char buf[3]; \ + buf[0] = 0xd1; _msgpack_store16(&buf[1], (int16_t)d); \ + msgpack_pack_append_buffer(x, buf, 3); \ + } else { \ + /* signed 8 */ \ + unsigned char buf[2] = {0xd0, TAKE8_64(d)}; \ + msgpack_pack_append_buffer(x, buf, 2); \ + } \ + } \ + } else if(d < (1<<7)) { \ + /* fixnum */ \ + msgpack_pack_append_buffer(x, &TAKE8_64(d), 1); \ + } else { \ + if(d < (1LL<<16)) { \ + if(d < (1<<8)) { \ + /* unsigned 8 */ \ + unsigned char buf[2] = {0xcc, TAKE8_64(d)}; \ + msgpack_pack_append_buffer(x, buf, 2); \ + } else { \ + /* unsigned 16 */ \ + unsigned char buf[3]; \ + buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \ + msgpack_pack_append_buffer(x, buf, 3); \ + } \ + } else { \ + if(d < (1LL<<32)) { \ + /* unsigned 32 */ \ + unsigned char buf[5]; \ + buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \ + msgpack_pack_append_buffer(x, buf, 5); \ + } else { \ + /* unsigned 64 */ \ + unsigned char buf[9]; \ + buf[0] = 0xcf; _msgpack_store64(&buf[1], d); \ + msgpack_pack_append_buffer(x, buf, 9); \ + } \ + } \ + } \ +} while(0) + + +#ifdef msgpack_pack_inline_func_fixint + +msgpack_pack_inline_func_fixint(_uint8)(msgpack_pack_user x, uint8_t d) +{ + unsigned char buf[2] = {0xcc, TAKE8_8(d)}; + msgpack_pack_append_buffer(x, buf, 2); +} + +msgpack_pack_inline_func_fixint(_uint16)(msgpack_pack_user x, uint16_t d) +{ + unsigned char buf[3]; + buf[0] = 0xcd; _msgpack_store16(&buf[1], d); + msgpack_pack_append_buffer(x, buf, 3); +} + +msgpack_pack_inline_func_fixint(_uint32)(msgpack_pack_user x, uint32_t d) +{ + unsigned char buf[5]; + buf[0] = 0xce; _msgpack_store32(&buf[1], d); + msgpack_pack_append_buffer(x, buf, 5); +} + +msgpack_pack_inline_func_fixint(_uint64)(msgpack_pack_user x, uint64_t d) +{ + unsigned char buf[9]; + buf[0] = 0xcf; _msgpack_store64(&buf[1], d); + msgpack_pack_append_buffer(x, buf, 9); +} + +msgpack_pack_inline_func_fixint(_int8)(msgpack_pack_user x, int8_t d) +{ + unsigned char buf[2] = {0xd0, TAKE8_8(d)}; + msgpack_pack_append_buffer(x, buf, 2); +} + +msgpack_pack_inline_func_fixint(_int16)(msgpack_pack_user x, int16_t d) +{ + unsigned char buf[3]; + buf[0] = 0xd1; _msgpack_store16(&buf[1], d); + msgpack_pack_append_buffer(x, buf, 3); +} + +msgpack_pack_inline_func_fixint(_int32)(msgpack_pack_user x, int32_t d) +{ + unsigned char buf[5]; + buf[0] = 0xd2; _msgpack_store32(&buf[1], d); + msgpack_pack_append_buffer(x, buf, 5); +} + +msgpack_pack_inline_func_fixint(_int64)(msgpack_pack_user x, int64_t d) +{ + unsigned char buf[9]; + buf[0] = 0xd3; _msgpack_store64(&buf[1], d); + msgpack_pack_append_buffer(x, buf, 9); +} + +#undef msgpack_pack_inline_func_fixint +#endif + + +msgpack_pack_inline_func(_uint8)(msgpack_pack_user x, uint8_t d) +{ + msgpack_pack_real_uint8(x, d); +} + +msgpack_pack_inline_func(_uint16)(msgpack_pack_user x, uint16_t d) +{ + msgpack_pack_real_uint16(x, d); +} + +msgpack_pack_inline_func(_uint32)(msgpack_pack_user x, uint32_t d) +{ + msgpack_pack_real_uint32(x, d); +} + +msgpack_pack_inline_func(_uint64)(msgpack_pack_user x, uint64_t d) +{ + msgpack_pack_real_uint64(x, d); +} + +msgpack_pack_inline_func(_int8)(msgpack_pack_user x, int8_t d) +{ + msgpack_pack_real_int8(x, d); +} + +msgpack_pack_inline_func(_int16)(msgpack_pack_user x, int16_t d) +{ + msgpack_pack_real_int16(x, d); +} + +msgpack_pack_inline_func(_int32)(msgpack_pack_user x, int32_t d) +{ + msgpack_pack_real_int32(x, d); +} + +msgpack_pack_inline_func(_int64)(msgpack_pack_user x, int64_t d) +{ + msgpack_pack_real_int64(x, d); +} + +msgpack_pack_inline_func(_char)(msgpack_pack_user x, char d) +{ +#if defined(CHAR_MIN) +#if CHAR_MIN < 0 + msgpack_pack_real_int8(x, d); +#else + msgpack_pack_real_uint8(x, d); +#endif +#else +#error CHAR_MIN is not defined +#endif +} + +msgpack_pack_inline_func(_signed_char)(msgpack_pack_user x, signed char d) +{ + msgpack_pack_real_int8(x, d); +} + +msgpack_pack_inline_func(_unsigned_char)(msgpack_pack_user x, unsigned char d) +{ + msgpack_pack_real_uint8(x, d); +} + +#ifdef msgpack_pack_inline_func_cint + +msgpack_pack_inline_func_cint(_short)(msgpack_pack_user x, short d) +{ +#if defined(SIZEOF_SHORT) +#if SIZEOF_SHORT == 2 + msgpack_pack_real_int16(x, d); +#elif SIZEOF_SHORT == 4 + msgpack_pack_real_int32(x, d); +#else + msgpack_pack_real_int64(x, d); +#endif + +#elif defined(SHRT_MAX) +#if SHRT_MAX == 0x7fff + msgpack_pack_real_int16(x, d); +#elif SHRT_MAX == 0x7fffffff + msgpack_pack_real_int32(x, d); +#else + msgpack_pack_real_int64(x, d); +#endif + +#else +if(sizeof(short) == 2) { + msgpack_pack_real_int16(x, d); +} else if(sizeof(short) == 4) { + msgpack_pack_real_int32(x, d); +} else { + msgpack_pack_real_int64(x, d); +} +#endif +} + +msgpack_pack_inline_func_cint(_int)(msgpack_pack_user x, int d) +{ +#if defined(SIZEOF_INT) +#if SIZEOF_INT == 2 + msgpack_pack_real_int16(x, d); +#elif SIZEOF_INT == 4 + msgpack_pack_real_int32(x, d); +#else + msgpack_pack_real_int64(x, d); +#endif + +#elif defined(INT_MAX) +#if INT_MAX == 0x7fff + msgpack_pack_real_int16(x, d); +#elif INT_MAX == 0x7fffffff + msgpack_pack_real_int32(x, d); +#else + msgpack_pack_real_int64(x, d); +#endif + +#else +if(sizeof(int) == 2) { + msgpack_pack_real_int16(x, d); +} else if(sizeof(int) == 4) { + msgpack_pack_real_int32(x, d); +} else { + msgpack_pack_real_int64(x, d); +} +#endif +} + +msgpack_pack_inline_func_cint(_long)(msgpack_pack_user x, long d) +{ +#if defined(SIZEOF_LONG) +#if SIZEOF_LONG == 2 + msgpack_pack_real_int16(x, d); +#elif SIZEOF_LONG == 4 + msgpack_pack_real_int32(x, d); +#else + msgpack_pack_real_int64(x, d); +#endif + +#elif defined(LONG_MAX) +#if LONG_MAX == 0x7fffL + msgpack_pack_real_int16(x, d); +#elif LONG_MAX == 0x7fffffffL + msgpack_pack_real_int32(x, d); +#else + msgpack_pack_real_int64(x, d); +#endif + +#else +if(sizeof(long) == 2) { + msgpack_pack_real_int16(x, d); +} else if(sizeof(long) == 4) { + msgpack_pack_real_int32(x, d); +} else { + msgpack_pack_real_int64(x, d); +} +#endif +} + +msgpack_pack_inline_func_cint(_long_long)(msgpack_pack_user x, long long d) +{ +#if defined(SIZEOF_LONG_LONG) +#if SIZEOF_LONG_LONG == 2 + msgpack_pack_real_int16(x, d); +#elif SIZEOF_LONG_LONG == 4 + msgpack_pack_real_int32(x, d); +#else + msgpack_pack_real_int64(x, d); +#endif + +#elif defined(LLONG_MAX) +#if LLONG_MAX == 0x7fffL + msgpack_pack_real_int16(x, d); +#elif LLONG_MAX == 0x7fffffffL + msgpack_pack_real_int32(x, d); +#else + msgpack_pack_real_int64(x, d); +#endif + +#else +if(sizeof(long long) == 2) { + msgpack_pack_real_int16(x, d); +} else if(sizeof(long long) == 4) { + msgpack_pack_real_int32(x, d); +} else { + msgpack_pack_real_int64(x, d); +} +#endif +} + +msgpack_pack_inline_func_cint(_unsigned_short)(msgpack_pack_user x, unsigned short d) +{ +#if defined(SIZEOF_SHORT) +#if SIZEOF_SHORT == 2 + msgpack_pack_real_uint16(x, d); +#elif SIZEOF_SHORT == 4 + msgpack_pack_real_uint32(x, d); +#else + msgpack_pack_real_uint64(x, d); +#endif + +#elif defined(USHRT_MAX) +#if USHRT_MAX == 0xffffU + msgpack_pack_real_uint16(x, d); +#elif USHRT_MAX == 0xffffffffU + msgpack_pack_real_uint32(x, d); +#else + msgpack_pack_real_uint64(x, d); +#endif + +#else +if(sizeof(unsigned short) == 2) { + msgpack_pack_real_uint16(x, d); +} else if(sizeof(unsigned short) == 4) { + msgpack_pack_real_uint32(x, d); +} else { + msgpack_pack_real_uint64(x, d); +} +#endif +} + +msgpack_pack_inline_func_cint(_unsigned_int)(msgpack_pack_user x, unsigned int d) +{ +#if defined(SIZEOF_INT) +#if SIZEOF_INT == 2 + msgpack_pack_real_uint16(x, d); +#elif SIZEOF_INT == 4 + msgpack_pack_real_uint32(x, d); +#else + msgpack_pack_real_uint64(x, d); +#endif + +#elif defined(UINT_MAX) +#if UINT_MAX == 0xffffU + msgpack_pack_real_uint16(x, d); +#elif UINT_MAX == 0xffffffffU + msgpack_pack_real_uint32(x, d); +#else + msgpack_pack_real_uint64(x, d); +#endif + +#else +if(sizeof(unsigned int) == 2) { + msgpack_pack_real_uint16(x, d); +} else if(sizeof(unsigned int) == 4) { + msgpack_pack_real_uint32(x, d); +} else { + msgpack_pack_real_uint64(x, d); +} +#endif +} + +msgpack_pack_inline_func_cint(_unsigned_long)(msgpack_pack_user x, unsigned long d) +{ +#if defined(SIZEOF_LONG) +#if SIZEOF_LONG == 2 + msgpack_pack_real_uint16(x, d); +#elif SIZEOF_LONG == 4 + msgpack_pack_real_uint32(x, d); +#else + msgpack_pack_real_uint64(x, d); +#endif + +#elif defined(ULONG_MAX) +#if ULONG_MAX == 0xffffUL + msgpack_pack_real_uint16(x, d); +#elif ULONG_MAX == 0xffffffffUL + msgpack_pack_real_uint32(x, d); +#else + msgpack_pack_real_uint64(x, d); +#endif + +#else +if(sizeof(unsigned long) == 2) { + msgpack_pack_real_uint16(x, d); +} else if(sizeof(unsigned long) == 4) { + msgpack_pack_real_uint32(x, d); +} else { + msgpack_pack_real_uint64(x, d); +} +#endif +} + +msgpack_pack_inline_func_cint(_unsigned_long_long)(msgpack_pack_user x, unsigned long long d) +{ +#if defined(SIZEOF_LONG_LONG) +#if SIZEOF_LONG_LONG == 2 + msgpack_pack_real_uint16(x, d); +#elif SIZEOF_LONG_LONG == 4 + msgpack_pack_real_uint32(x, d); +#else + msgpack_pack_real_uint64(x, d); +#endif + +#elif defined(ULLONG_MAX) +#if ULLONG_MAX == 0xffffUL + msgpack_pack_real_uint16(x, d); +#elif ULLONG_MAX == 0xffffffffUL + msgpack_pack_real_uint32(x, d); +#else + msgpack_pack_real_uint64(x, d); +#endif + +#else +if(sizeof(unsigned long long) == 2) { + msgpack_pack_real_uint16(x, d); +} else if(sizeof(unsigned long long) == 4) { + msgpack_pack_real_uint32(x, d); +} else { + msgpack_pack_real_uint64(x, d); +} +#endif +} + +#undef msgpack_pack_inline_func_cint +#endif + + + +/* + * Float + */ + +msgpack_pack_inline_func(_float)(msgpack_pack_user x, float d) +{ + unsigned char buf[5]; + union { float f; uint32_t i; } mem; + mem.f = d; + buf[0] = 0xca; _msgpack_store32(&buf[1], mem.i); + msgpack_pack_append_buffer(x, buf, 5); +} + +msgpack_pack_inline_func(_double)(msgpack_pack_user x, double d) +{ + unsigned char buf[9]; + union { double f; uint64_t i; } mem; + mem.f = d; + buf[0] = 0xcb; +#if defined(TARGET_OS_IPHONE) + // ok +#elif defined(__arm__) && !(__ARM_EABI__) // arm-oabi + // https://github.com/msgpack/msgpack-perl/pull/1 + mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL); +#endif + _msgpack_store64(&buf[1], mem.i); + msgpack_pack_append_buffer(x, buf, 9); +} + + +/* + * Nil + */ + +msgpack_pack_inline_func(_nil)(msgpack_pack_user x) +{ + static const unsigned char d = 0xc0; + msgpack_pack_append_buffer(x, &d, 1); +} + + +/* + * Boolean + */ + +msgpack_pack_inline_func(_true)(msgpack_pack_user x) +{ + static const unsigned char d = 0xc3; + msgpack_pack_append_buffer(x, &d, 1); +} + +msgpack_pack_inline_func(_false)(msgpack_pack_user x) +{ + static const unsigned char d = 0xc2; + msgpack_pack_append_buffer(x, &d, 1); +} + + +/* + * Array + */ + +msgpack_pack_inline_func(_array)(msgpack_pack_user x, size_t n) +{ + if(n < 16) { + unsigned char d = 0x90 | (uint8_t)n; + msgpack_pack_append_buffer(x, &d, 1); + } else if(n < 65536) { + unsigned char buf[3]; + buf[0] = 0xdc; _msgpack_store16(&buf[1], (uint16_t)n); + msgpack_pack_append_buffer(x, buf, 3); + } else { + unsigned char buf[5]; + buf[0] = 0xdd; _msgpack_store32(&buf[1], (uint32_t)n); + msgpack_pack_append_buffer(x, buf, 5); + } +} + + +/* + * Map + */ + +msgpack_pack_inline_func(_map)(msgpack_pack_user x, size_t n) +{ + if(n < 16) { + unsigned char d = 0x80 | (uint8_t)n; + msgpack_pack_append_buffer(x, &TAKE8_8(d), 1); + } else if(n < 65536) { + unsigned char buf[3]; + buf[0] = 0xde; _msgpack_store16(&buf[1], (uint16_t)n); + msgpack_pack_append_buffer(x, buf, 3); + } else { + unsigned char buf[5]; + buf[0] = 0xdf; _msgpack_store32(&buf[1], (uint32_t)n); + msgpack_pack_append_buffer(x, buf, 5); + } +} + + +/* + * Str + */ + +msgpack_pack_inline_func(_str)(msgpack_pack_user x, size_t l) +{ + if(l < 32) { + unsigned char d = 0xa0 | (uint8_t)l; + msgpack_pack_append_buffer(x, &TAKE8_8(d), 1); + } else if(l < 256) { + unsigned char buf[2]; + buf[0] = 0xd9; buf[1] = (uint8_t)l; + msgpack_pack_append_buffer(x, buf, 2); + } else if(l < 65536) { + unsigned char buf[3]; + buf[0] = 0xda; _msgpack_store16(&buf[1], (uint16_t)l); + msgpack_pack_append_buffer(x, buf, 3); + } else { + unsigned char buf[5]; + buf[0] = 0xdb; _msgpack_store32(&buf[1], (uint32_t)l); + msgpack_pack_append_buffer(x, buf, 5); + } +} + +msgpack_pack_inline_func(_str_body)(msgpack_pack_user x, const void* b, size_t l) +{ + msgpack_pack_append_buffer(x, (const unsigned char*)b, l); +} + +/* + * Raw (V4) + */ + +msgpack_pack_inline_func(_v4raw)(msgpack_pack_user x, size_t l) +{ + if(l < 32) { + unsigned char d = 0xa0 | (uint8_t)l; + msgpack_pack_append_buffer(x, &TAKE8_8(d), 1); + } else if(l < 65536) { + unsigned char buf[3]; + buf[0] = 0xda; _msgpack_store16(&buf[1], (uint16_t)l); + msgpack_pack_append_buffer(x, buf, 3); + } else { + unsigned char buf[5]; + buf[0] = 0xdb; _msgpack_store32(&buf[1], (uint32_t)l); + msgpack_pack_append_buffer(x, buf, 5); + } +} + +msgpack_pack_inline_func(_v4raw_body)(msgpack_pack_user x, const void* b, size_t l) +{ + msgpack_pack_append_buffer(x, (const unsigned char*)b, l); +} + +/* + * Bin + */ + +msgpack_pack_inline_func(_bin)(msgpack_pack_user x, size_t l) +{ + if(l < 256) { + unsigned char buf[2]; + buf[0] = 0xc4; buf[1] = (uint8_t)l; + msgpack_pack_append_buffer(x, buf, 2); + } else if(l < 65536) { + unsigned char buf[3]; + buf[0] = 0xc5; _msgpack_store16(&buf[1], (uint16_t)l); + msgpack_pack_append_buffer(x, buf, 3); + } else { + unsigned char buf[5]; + buf[0] = 0xc6; _msgpack_store32(&buf[1], (uint32_t)l); + msgpack_pack_append_buffer(x, buf, 5); + } +} + +msgpack_pack_inline_func(_bin_body)(msgpack_pack_user x, const void* b, size_t l) +{ + msgpack_pack_append_buffer(x, (const unsigned char*)b, l); +} + +/* + * Ext + */ + +msgpack_pack_inline_func(_ext)(msgpack_pack_user x, size_t l, int8_t type) +{ + switch(l) { + case 1: { + unsigned char buf[2]; + buf[0] = 0xd4; + buf[1] = (unsigned char)type; + msgpack_pack_append_buffer(x, buf, 2); + } break; + case 2: { + unsigned char buf[2]; + buf[0] = 0xd5; + buf[1] = (unsigned char)type; + msgpack_pack_append_buffer(x, buf, 2); + } break; + case 4: { + unsigned char buf[2]; + buf[0] = 0xd6; + buf[1] = (unsigned char)type; + msgpack_pack_append_buffer(x, buf, 2); + } break; + case 8: { + unsigned char buf[2]; + buf[0] = 0xd7; + buf[1] = (unsigned char)type; + msgpack_pack_append_buffer(x, buf, 2); + } break; + case 16: { + unsigned char buf[2]; + buf[0] = 0xd8; + buf[1] = (unsigned char)type; + msgpack_pack_append_buffer(x, buf, 2); + } break; + default: + if(l < 256) { + unsigned char buf[3]; + buf[0] = 0xc7; + buf[1] = (unsigned char)l; + buf[2] = (unsigned char)type; + msgpack_pack_append_buffer(x, buf, 3); + } else if(l < 65536) { + unsigned char buf[4]; + buf[0] = 0xc8; + _msgpack_store16(&buf[1], l); + buf[3] = (unsigned char)type; + msgpack_pack_append_buffer(x, buf, 4); + } else { + unsigned char buf[6]; + buf[0] = 0xc9; + _msgpack_store32(&buf[1], l); + buf[5] = (unsigned char)type; + msgpack_pack_append_buffer(x, buf, 6); + } + break; + } +} + +msgpack_pack_inline_func(_ext_body)(msgpack_pack_user x, const void* b, size_t l) +{ + msgpack_pack_append_buffer(x, (const unsigned char*)b, l); +} + +msgpack_pack_inline_func(_timestamp)(msgpack_pack_user x, const msgpack_timestamp* d) +{ + if ((((int64_t)d->tv_sec) >> 34) == 0) { + uint64_t data64 = ((uint64_t) d->tv_nsec << 34) | (uint64_t)d->tv_sec; + if ((data64 & 0xffffffff00000000L) == 0) { + // timestamp 32 + char buf[4]; + uint32_t data32 = (uint32_t)data64; + msgpack_pack_ext(x, 4, -1); + _msgpack_store32(buf, data32); + msgpack_pack_append_buffer(x, buf, 4); + } else { + // timestamp 64 + char buf[8]; + msgpack_pack_ext(x, 8, -1); + _msgpack_store64(buf, data64); + msgpack_pack_append_buffer(x, buf, 8); + } + } else { + // timestamp 96 + char buf[12]; + _msgpack_store32(&buf[0], d->tv_nsec); + _msgpack_store64(&buf[4], d->tv_sec); + msgpack_pack_ext(x, 12, -1); + msgpack_pack_append_buffer(x, buf, 12); + } +} + +#undef msgpack_pack_inline_func +#undef msgpack_pack_user +#undef msgpack_pack_append_buffer + +#undef TAKE8_8 +#undef TAKE8_16 +#undef TAKE8_32 +#undef TAKE8_64 + +#undef msgpack_pack_real_uint8 +#undef msgpack_pack_real_uint16 +#undef msgpack_pack_real_uint32 +#undef msgpack_pack_real_uint64 +#undef msgpack_pack_real_int8 +#undef msgpack_pack_real_int16 +#undef msgpack_pack_real_int32 +#undef msgpack_pack_real_int64 + +#if defined(_MSC_VER) +# pragma warning(pop) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef.h b/msgpackc/3.2.1/include/msgpack/predef.h new file mode 100644 index 0000000000000000000000000000000000000000..0f8d5f589582ab838d25393424bc2987f2e3c663 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef.h @@ -0,0 +1,24 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#if !defined(MSGPACK_PREDEF_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS) +#ifndef MSGPACK_PREDEF_H +#define MSGPACK_PREDEF_H +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture.h b/msgpackc/3.2.1/include/msgpack/predef/architecture.h new file mode 100644 index 0000000000000000000000000000000000000000..2a615cf15636e5f6151db3f9fb96ff2b4c8eae3b --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture.h @@ -0,0 +1,33 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#if !defined(MSGPACK_PREDEF_ARCHITECTURE_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS) +#ifndef MSGPACK_PREDEF_ARCHITECTURE_H +#define MSGPACK_PREDEF_ARCHITECTURE_H +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +/*#include */ + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/alpha.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/alpha.h new file mode 100644 index 0000000000000000000000000000000000000000..e1a39d0e13198251c7d750b786960b01f7d87a70 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/alpha.h @@ -0,0 +1,59 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_ALPHA_H +#define MSGPACK_PREDEF_ARCHITECTURE_ALPHA_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_ALPHA`] + +[@http://en.wikipedia.org/wiki/DEC_Alpha DEC Alpha] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + [[`__alpha__`] [__predef_detection__]] + [[`__alpha`] [__predef_detection__]] + [[`_M_ALPHA`] [__predef_detection__]] + + [[`__alpha_ev4__`] [4.0.0]] + [[`__alpha_ev5__`] [5.0.0]] + [[`__alpha_ev6__`] [6.0.0]] + ] + */ + +#define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__alpha__) || defined(__alpha) || \ + defined(_M_ALPHA) +# undef MSGPACK_ARCH_ALPHA +# if !defined(MSGPACK_ARCH_ALPHA) && defined(__alpha_ev4__) +# define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER(4,0,0) +# endif +# if !defined(MSGPACK_ARCH_ALPHA) && defined(__alpha_ev5__) +# define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER(5,0,0) +# endif +# if !defined(MSGPACK_ARCH_ALPHA) && defined(__alpha_ev6__) +# define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER(6,0,0) +# endif +# if !defined(MSGPACK_ARCH_ALPHA) +# define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_ARCH_ALPHA +# define MSGPACK_ARCH_ALPHA_AVAILABLE +#endif + +#define MSGPACK_ARCH_ALPHA_NAME "DEC Alpha" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_ALPHA,MSGPACK_ARCH_ALPHA_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/arm.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/arm.h new file mode 100644 index 0000000000000000000000000000000000000000..4421824b3a0bbf5d5675420b4cc1c7b4fc38e7d0 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/arm.h @@ -0,0 +1,80 @@ +/* +Copyright Rene Rivera 2008-2015 +Copyright Franz Detro 2014 +Copyright (c) Microsoft Corporation 2014 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_ARM_H +#define MSGPACK_PREDEF_ARCHITECTURE_ARM_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_ARM`] + +[@http://en.wikipedia.org/wiki/ARM_architecture ARM] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__arm__`] [__predef_detection__]] + [[`__arm64`] [__predef_detection__]] + [[`__thumb__`] [__predef_detection__]] + [[`__TARGET_ARCH_ARM`] [__predef_detection__]] + [[`__TARGET_ARCH_THUMB`] [__predef_detection__]] + [[`_M_ARM`] [__predef_detection__]] + [[`_M_ARM64`] [__predef_detection__]] + + [[`__arm64`] [8.0.0]] + [[`__TARGET_ARCH_ARM`] [V.0.0]] + [[`__TARGET_ARCH_THUMB`] [V.0.0]] + [[`__ARM_ARCH`] [V.0.0]] + [[`_M_ARM`] [V.0.0]] + [[`_M_ARM64`] [8.0.0]] + ] + */ + +#define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__arm__) || defined(__arm64) || defined(__thumb__) || \ + defined(__TARGET_ARCH_ARM) || defined(__TARGET_ARCH_THUMB) || \ + defined(__ARM_ARCH) || \ + defined(_M_ARM) || defined(_M_ARM64) +# undef MSGPACK_ARCH_ARM +# if !defined(MSGPACK_ARCH_ARM) && defined(__arm64) +# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(8,0,0) +# endif +# if !defined(MSGPACK_ARCH_ARM) && defined(__TARGET_ARCH_ARM) +# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(__TARGET_ARCH_ARM,0,0) +# endif +# if !defined(MSGPACK_ARCH_ARM) && defined(__TARGET_ARCH_THUMB) +# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(__TARGET_ARCH_THUMB,0,0) +# endif +# if !defined(MSGPACK_ARCH_ARM) && defined(__ARM_ARCH) +# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(__ARM_ARCH,0,0) +# endif +# if !defined(MSGPACK_ARCH_ARM) && defined(_M_ARM64) +# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(8,0,0) +# endif +# if !defined(MSGPACK_ARCH_ARM) && defined(_M_ARM) +# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(_M_ARM,0,0) +# endif +# if !defined(MSGPACK_ARCH_ARM) +# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_ARCH_ARM +# define MSGPACK_ARCH_ARM_AVAILABLE +#endif + +#define MSGPACK_ARCH_ARM_NAME "ARM" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_ARM,MSGPACK_ARCH_ARM_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/blackfin.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/blackfin.h new file mode 100644 index 0000000000000000000000000000000000000000..c3e580d87e502a3b7269c94dd0a425d564022fb8 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/blackfin.h @@ -0,0 +1,46 @@ +/* +Copyright Rene Rivera 2013-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_BLACKFIN_H +#define MSGPACK_PREDEF_ARCHITECTURE_BLACKFIN_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_BLACKFIN`] + +Blackfin Processors from Analog Devices. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__bfin__`] [__predef_detection__]] + [[`__BFIN__`] [__predef_detection__]] + [[`bfin`] [__predef_detection__]] + [[`BFIN`] [__predef_detection__]] + ] + */ + +#define MSGPACK_ARCH_BLACKFIN MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__bfin__) || defined(__BFIN__) || \ + defined(bfin) || defined(BFIN) +# undef MSGPACK_ARCH_BLACKFIN +# define MSGPACK_ARCH_BLACKFIN MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_ARCH_BLACKFIN +# define MSGPACK_ARCH_BLACKFIN_AVAILABLE +#endif + +#define MSGPACK_ARCH_BLACKFIN_NAME "Blackfin" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_BLACKFIN,MSGPACK_ARCH_BLACKFIN_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/convex.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/convex.h new file mode 100644 index 0000000000000000000000000000000000000000..6509ffd2a45ce12a33b2ce9d0023da6e1aad3d2a --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/convex.h @@ -0,0 +1,65 @@ +/* +Copyright Rene Rivera 2011-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_CONVEX_H +#define MSGPACK_PREDEF_ARCHITECTURE_CONVEX_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_CONVEX`] + +[@http://en.wikipedia.org/wiki/Convex_Computer Convex Computer] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__convex__`] [__predef_detection__]] + + [[`__convex_c1__`] [1.0.0]] + [[`__convex_c2__`] [2.0.0]] + [[`__convex_c32__`] [3.2.0]] + [[`__convex_c34__`] [3.4.0]] + [[`__convex_c38__`] [3.8.0]] + ] + */ + +#define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__convex__) +# undef MSGPACK_ARCH_CONVEX +# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c1__) +# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(1,0,0) +# endif +# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c2__) +# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(2,0,0) +# endif +# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c32__) +# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(3,2,0) +# endif +# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c34__) +# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(3,4,0) +# endif +# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c38__) +# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(3,8,0) +# endif +# if !defined(MSGPACK_ARCH_CONVEX) +# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_ARCH_CONVEX +# define MSGPACK_ARCH_CONVEX_AVAILABLE +#endif + +#define MSGPACK_ARCH_CONVEX_NAME "Convex Computer" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_CONVEX,MSGPACK_ARCH_CONVEX_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/ia64.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/ia64.h new file mode 100644 index 0000000000000000000000000000000000000000..f6a0da03df7df9a9397bea873b8b0451f8784589 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/ia64.h @@ -0,0 +1,49 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_IA64_H +#define MSGPACK_PREDEF_ARCHITECTURE_IA64_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_IA64`] + +[@http://en.wikipedia.org/wiki/Ia64 Intel Itanium 64] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__ia64__`] [__predef_detection__]] + [[`_IA64`] [__predef_detection__]] + [[`__IA64__`] [__predef_detection__]] + [[`__ia64`] [__predef_detection__]] + [[`_M_IA64`] [__predef_detection__]] + [[`__itanium__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_ARCH_IA64 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__ia64__) || defined(_IA64) || \ + defined(__IA64__) || defined(__ia64) || \ + defined(_M_IA64) || defined(__itanium__) +# undef MSGPACK_ARCH_IA64 +# define MSGPACK_ARCH_IA64 MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_ARCH_IA64 +# define MSGPACK_ARCH_IA64_AVAILABLE +#endif + +#define MSGPACK_ARCH_IA64_NAME "Intel Itanium 64" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_IA64,MSGPACK_ARCH_IA64_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/m68k.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/m68k.h new file mode 100644 index 0000000000000000000000000000000000000000..0112a47358ef76d5b38bc01ee4d117d624285efd --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/m68k.h @@ -0,0 +1,82 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_M68K_H +#define MSGPACK_PREDEF_ARCHITECTURE_M68K_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_M68K`] + +[@http://en.wikipedia.org/wiki/M68k Motorola 68k] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__m68k__`] [__predef_detection__]] + [[`M68000`] [__predef_detection__]] + + [[`__mc68060__`] [6.0.0]] + [[`mc68060`] [6.0.0]] + [[`__mc68060`] [6.0.0]] + [[`__mc68040__`] [4.0.0]] + [[`mc68040`] [4.0.0]] + [[`__mc68040`] [4.0.0]] + [[`__mc68030__`] [3.0.0]] + [[`mc68030`] [3.0.0]] + [[`__mc68030`] [3.0.0]] + [[`__mc68020__`] [2.0.0]] + [[`mc68020`] [2.0.0]] + [[`__mc68020`] [2.0.0]] + [[`__mc68010__`] [1.0.0]] + [[`mc68010`] [1.0.0]] + [[`__mc68010`] [1.0.0]] + [[`__mc68000__`] [0.0.1]] + [[`mc68000`] [0.0.1]] + [[`__mc68000`] [0.0.1]] + ] + */ + +#define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__m68k__) || defined(M68000) +# undef MSGPACK_ARCH_M68K +# if !defined(MSGPACK_ARCH_M68K) && (defined(__mc68060__) || defined(mc68060) || defined(__mc68060)) +# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER(6,0,0) +# endif +# if !defined(MSGPACK_ARCH_M68K) && (defined(__mc68040__) || defined(mc68040) || defined(__mc68040)) +# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER(4,0,0) +# endif +# if !defined(MSGPACK_ARCH_M68K) && (defined(__mc68030__) || defined(mc68030) || defined(__mc68030)) +# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER(3,0,0) +# endif +# if !defined(MSGPACK_ARCH_M68K) && (defined(__mc68020__) || defined(mc68020) || defined(__mc68020)) +# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER(2,0,0) +# endif +# if !defined(MSGPACK_ARCH_M68K) && (defined(__mc68010__) || defined(mc68010) || defined(__mc68010)) +# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER(1,0,0) +# endif +# if !defined(MSGPACK_ARCH_M68K) && (defined(__mc68000__) || defined(mc68000) || defined(__mc68000)) +# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +# if !defined(MSGPACK_ARCH_M68K) +# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_ARCH_M68K +# define MSGPACK_ARCH_M68K_AVAILABLE +#endif + +#define MSGPACK_ARCH_M68K_NAME "Motorola 68k" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_M68K,MSGPACK_ARCH_M68K_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/mips.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/mips.h new file mode 100644 index 0000000000000000000000000000000000000000..c83021a6583034f338b8959a7235486606aba16c --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/mips.h @@ -0,0 +1,73 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_MIPS_H +#define MSGPACK_PREDEF_ARCHITECTURE_MIPS_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_MIPS`] + +[@http://en.wikipedia.org/wiki/MIPS_architecture MIPS] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__mips__`] [__predef_detection__]] + [[`__mips`] [__predef_detection__]] + [[`__MIPS__`] [__predef_detection__]] + + [[`__mips`] [V.0.0]] + [[`_MIPS_ISA_MIPS1`] [1.0.0]] + [[`_R3000`] [1.0.0]] + [[`_MIPS_ISA_MIPS2`] [2.0.0]] + [[`__MIPS_ISA2__`] [2.0.0]] + [[`_R4000`] [2.0.0]] + [[`_MIPS_ISA_MIPS3`] [3.0.0]] + [[`__MIPS_ISA3__`] [3.0.0]] + [[`_MIPS_ISA_MIPS4`] [4.0.0]] + [[`__MIPS_ISA4__`] [4.0.0]] + ] + */ + +#define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__mips__) || defined(__mips) || \ + defined(__MIPS__) +# undef MSGPACK_ARCH_MIPS +# if !defined(MSGPACK_ARCH_MIPS) && (defined(__mips)) +# define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER(__mips,0,0) +# endif +# if !defined(MSGPACK_ARCH_MIPS) && (defined(_MIPS_ISA_MIPS1) || defined(_R3000)) +# define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER(1,0,0) +# endif +# if !defined(MSGPACK_ARCH_MIPS) && (defined(_MIPS_ISA_MIPS2) || defined(__MIPS_ISA2__) || defined(_R4000)) +# define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER(2,0,0) +# endif +# if !defined(MSGPACK_ARCH_MIPS) && (defined(_MIPS_ISA_MIPS3) || defined(__MIPS_ISA3__)) +# define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER(3,0,0) +# endif +# if !defined(MSGPACK_ARCH_MIPS) && (defined(_MIPS_ISA_MIPS4) || defined(__MIPS_ISA4__)) +# define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER(4,0,0) +# endif +# if !defined(MSGPACK_ARCH_MIPS) +# define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_ARCH_MIPS +# define MSGPACK_ARCH_MIPS_AVAILABLE +#endif + +#define MSGPACK_ARCH_MIPS_NAME "MIPS" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_MIPS,MSGPACK_ARCH_MIPS_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/parisc.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/parisc.h new file mode 100644 index 0000000000000000000000000000000000000000..cb6a3087bf678b15d1cd3e06fd47098374e9c3c9 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/parisc.h @@ -0,0 +1,64 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_PARISC_H +#define MSGPACK_PREDEF_ARCHITECTURE_PARISC_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_PARISC`] + +[@http://en.wikipedia.org/wiki/PA-RISC_family HP/PA RISC] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__hppa__`] [__predef_detection__]] + [[`__hppa`] [__predef_detection__]] + [[`__HPPA__`] [__predef_detection__]] + + [[`_PA_RISC1_0`] [1.0.0]] + [[`_PA_RISC1_1`] [1.1.0]] + [[`__HPPA11__`] [1.1.0]] + [[`__PA7100__`] [1.1.0]] + [[`_PA_RISC2_0`] [2.0.0]] + [[`__RISC2_0__`] [2.0.0]] + [[`__HPPA20__`] [2.0.0]] + [[`__PA8000__`] [2.0.0]] + ] + */ + +#define MSGPACK_ARCH_PARISC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__hppa__) || defined(__hppa) || defined(__HPPA__) +# undef MSGPACK_ARCH_PARISC +# if !defined(MSGPACK_ARCH_PARISC) && (defined(_PA_RISC1_0)) +# define MSGPACK_ARCH_PARISC MSGPACK_VERSION_NUMBER(1,0,0) +# endif +# if !defined(MSGPACK_ARCH_PARISC) && (defined(_PA_RISC1_1) || defined(__HPPA11__) || defined(__PA7100__)) +# define MSGPACK_ARCH_PARISC MSGPACK_VERSION_NUMBER(1,1,0) +# endif +# if !defined(MSGPACK_ARCH_PARISC) && (defined(_PA_RISC2_0) || defined(__RISC2_0__) || defined(__HPPA20__) || defined(__PA8000__)) +# define MSGPACK_ARCH_PARISC MSGPACK_VERSION_NUMBER(2,0,0) +# endif +# if !defined(MSGPACK_ARCH_PARISC) +# define MSGPACK_ARCH_PARISC MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_ARCH_PARISC +# define MSGPACK_ARCH_PARISC_AVAILABLE +#endif + +#define MSGPACK_ARCH_PARISC_NAME "HP/PA RISC" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_PARISC,MSGPACK_ARCH_PARISC_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/ppc.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/ppc.h new file mode 100644 index 0000000000000000000000000000000000000000..29cad9298bef752d7673a7d68d2237a1e75c6150 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/ppc.h @@ -0,0 +1,72 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_PPC_H +#define MSGPACK_PREDEF_ARCHITECTURE_PPC_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_PPC`] + +[@http://en.wikipedia.org/wiki/PowerPC PowerPC] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__powerpc`] [__predef_detection__]] + [[`__powerpc__`] [__predef_detection__]] + [[`__POWERPC__`] [__predef_detection__]] + [[`__ppc__`] [__predef_detection__]] + [[`_M_PPC`] [__predef_detection__]] + [[`_ARCH_PPC`] [__predef_detection__]] + [[`__PPCGECKO__`] [__predef_detection__]] + [[`__PPCBROADWAY__`] [__predef_detection__]] + [[`_XENON`] [__predef_detection__]] + + [[`__ppc601__`] [6.1.0]] + [[`_ARCH_601`] [6.1.0]] + [[`__ppc603__`] [6.3.0]] + [[`_ARCH_603`] [6.3.0]] + [[`__ppc604__`] [6.4.0]] + [[`__ppc604__`] [6.4.0]] + ] + */ + +#define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__powerpc) || defined(__powerpc__) || \ + defined(__POWERPC__) || defined(__ppc__) || \ + defined(_M_PPC) || defined(_ARCH_PPC) || \ + defined(__PPCGECKO__) || defined(__PPCBROADWAY__) || \ + defined(_XENON) +# undef MSGPACK_ARCH_PPC +# if !defined (MSGPACK_ARCH_PPC) && (defined(__ppc601__) || defined(_ARCH_601)) +# define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER(6,1,0) +# endif +# if !defined (MSGPACK_ARCH_PPC) && (defined(__ppc603__) || defined(_ARCH_603)) +# define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER(6,3,0) +# endif +# if !defined (MSGPACK_ARCH_PPC) && (defined(__ppc604__) || defined(__ppc604__)) +# define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER(6,4,0) +# endif +# if !defined (MSGPACK_ARCH_PPC) +# define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_ARCH_PPC +# define MSGPACK_ARCH_PPC_AVAILABLE +#endif + +#define MSGPACK_ARCH_PPC_NAME "PowerPC" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_PPC,MSGPACK_ARCH_PPC_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/ptx.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/ptx.h new file mode 100644 index 0000000000000000000000000000000000000000..686c5eeddbefc862f71d3e0dd3e10b149bc93df2 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/ptx.h @@ -0,0 +1,44 @@ +/* +Copyright Benjamin Worpitz 2018 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_PTX_H +#define MSGPACK_PREDEF_ARCHITECTURE_PTX_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_PTX`] + +[@https://en.wikipedia.org/wiki/Parallel_Thread_Execution PTX] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__CUDA_ARCH__`] [__predef_detection__]] + + [[`__CUDA_ARCH__`] [V.R.0]] + ] + */ + +#define MSGPACK_ARCH_PTX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__CUDA_ARCH__) +# undef MSGPACK_ARCH_PTX +# define MSGPACK_ARCH_PTX MSGPACK_PREDEF_MAKE_10_VR0(__CUDA_ARCH__) +#endif + +#if MSGPACK_ARCH_PTX +# define MSGPACK_ARCH_PTX_AVAILABLE +#endif + +#define MSGPACK_ARCH_PTX_NAME "PTX" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_PTX,MSGPACK_ARCH_PTX_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/pyramid.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/pyramid.h new file mode 100644 index 0000000000000000000000000000000000000000..5799d831b03fd66e30c972c1bb3204656e34393f --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/pyramid.h @@ -0,0 +1,42 @@ +/* +Copyright Rene Rivera 2011-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_PYRAMID_H +#define MSGPACK_PREDEF_ARCHITECTURE_PYRAMID_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_PYRAMID`] + +Pyramid 9810 architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`pyr`] [__predef_detection__]] + ] + */ + +#define MSGPACK_ARCH_PYRAMID MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(pyr) +# undef MSGPACK_ARCH_PYRAMID +# define MSGPACK_ARCH_PYRAMID MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_ARCH_PYRAMID +# define MSGPACK_ARCH_PYRAMID_AVAILABLE +#endif + +#define MSGPACK_ARCH_PYRAMID_NAME "Pyramid 9810" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_PYRAMID,MSGPACK_ARCH_PYRAMID_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/rs6k.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/rs6k.h new file mode 100644 index 0000000000000000000000000000000000000000..241876059eb728590c94e92e1a1fa9e0dcb55eb7 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/rs6k.h @@ -0,0 +1,56 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_RS6K_H +#define MSGPACK_PREDEF_ARCHITECTURE_RS6K_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_RS6000`] + +[@http://en.wikipedia.org/wiki/RS/6000 RS/6000] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__THW_RS6000`] [__predef_detection__]] + [[`_IBMR2`] [__predef_detection__]] + [[`_POWER`] [__predef_detection__]] + [[`_ARCH_PWR`] [__predef_detection__]] + [[`_ARCH_PWR2`] [__predef_detection__]] + ] + */ + +#define MSGPACK_ARCH_RS6000 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__THW_RS6000) || defined(_IBMR2) || \ + defined(_POWER) || defined(_ARCH_PWR) || \ + defined(_ARCH_PWR2) +# undef MSGPACK_ARCH_RS6000 +# define MSGPACK_ARCH_RS6000 MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_ARCH_RS6000 +# define MSGPACK_ARCH_RS6000_AVAILABLE +#endif + +#define MSGPACK_ARCH_RS6000_NAME "RS/6000" + +#define MSGPACK_ARCH_PWR MSGPACK_ARCH_RS6000 + +#if MSGPACK_ARCH_PWR +# define MSGPACK_ARCH_PWR_AVAILABLE +#endif + +#define MSGPACK_ARCH_PWR_NAME MSGPACK_ARCH_RS6000_NAME + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_RS6000,MSGPACK_ARCH_RS6000_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/sparc.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/sparc.h new file mode 100644 index 0000000000000000000000000000000000000000..4cb764e59db1e3ba6cee08e1cb36223c5bb7a769 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/sparc.h @@ -0,0 +1,54 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_SPARC_H +#define MSGPACK_PREDEF_ARCHITECTURE_SPARC_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_SPARC`] + +[@http://en.wikipedia.org/wiki/SPARC SPARC] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__sparc__`] [__predef_detection__]] + [[`__sparc`] [__predef_detection__]] + + [[`__sparcv9`] [9.0.0]] + [[`__sparcv8`] [8.0.0]] + ] + */ + +#define MSGPACK_ARCH_SPARC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__sparc__) || defined(__sparc) +# undef MSGPACK_ARCH_SPARC +# if !defined(MSGPACK_ARCH_SPARC) && defined(__sparcv9) +# define MSGPACK_ARCH_SPARC MSGPACK_VERSION_NUMBER(9,0,0) +# endif +# if !defined(MSGPACK_ARCH_SPARC) && defined(__sparcv8) +# define MSGPACK_ARCH_SPARC MSGPACK_VERSION_NUMBER(8,0,0) +# endif +# if !defined(MSGPACK_ARCH_SPARC) +# define MSGPACK_ARCH_SPARC MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_ARCH_SPARC +# define MSGPACK_ARCH_SPARC_AVAILABLE +#endif + +#define MSGPACK_ARCH_SPARC_NAME "SPARC" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_SPARC,MSGPACK_ARCH_SPARC_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/superh.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/superh.h new file mode 100644 index 0000000000000000000000000000000000000000..8256d2b8b7253292bea930bbcf173541b59960bb --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/superh.h @@ -0,0 +1,67 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_SUPERH_H +#define MSGPACK_PREDEF_ARCHITECTURE_SUPERH_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_SH`] + +[@http://en.wikipedia.org/wiki/SuperH SuperH] architecture: +If available versions \[1-5\] are specifically detected. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__sh__`] [__predef_detection__]] + + [[`__SH5__`] [5.0.0]] + [[`__SH4__`] [4.0.0]] + [[`__sh3__`] [3.0.0]] + [[`__SH3__`] [3.0.0]] + [[`__sh2__`] [2.0.0]] + [[`__sh1__`] [1.0.0]] + ] + */ + +#define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__sh__) +# undef MSGPACK_ARCH_SH +# if !defined(MSGPACK_ARCH_SH) && (defined(__SH5__)) +# define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER(5,0,0) +# endif +# if !defined(MSGPACK_ARCH_SH) && (defined(__SH4__)) +# define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER(4,0,0) +# endif +# if !defined(MSGPACK_ARCH_SH) && (defined(__sh3__) || defined(__SH3__)) +# define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER(3,0,0) +# endif +# if !defined(MSGPACK_ARCH_SH) && (defined(__sh2__)) +# define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER(2,0,0) +# endif +# if !defined(MSGPACK_ARCH_SH) && (defined(__sh1__)) +# define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER(1,0,0) +# endif +# if !defined(MSGPACK_ARCH_SH) +# define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_ARCH_SH +# define MSGPACK_ARCH_SH_AVAILABLE +#endif + +#define MSGPACK_ARCH_SH_NAME "SuperH" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_SH,MSGPACK_ARCH_SH_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/sys370.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/sys370.h new file mode 100644 index 0000000000000000000000000000000000000000..a03b6911379c5b2387e826148e1e35ab66ebf78e --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/sys370.h @@ -0,0 +1,43 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_SYS370_H +#define MSGPACK_PREDEF_ARCHITECTURE_SYS370_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_SYS370`] + +[@http://en.wikipedia.org/wiki/System/370 System/370] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__370__`] [__predef_detection__]] + [[`__THW_370__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_ARCH_SYS370 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__370__) || defined(__THW_370__) +# undef MSGPACK_ARCH_SYS370 +# define MSGPACK_ARCH_SYS370 MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_ARCH_SYS370 +# define MSGPACK_ARCH_SYS370_AVAILABLE +#endif + +#define MSGPACK_ARCH_SYS370_NAME "System/370" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_SYS370,MSGPACK_ARCH_SYS370_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/sys390.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/sys390.h new file mode 100644 index 0000000000000000000000000000000000000000..20fbb1d3493e65c71d61ff5208faf1ffd1a60da0 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/sys390.h @@ -0,0 +1,43 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_SYS390_H +#define MSGPACK_PREDEF_ARCHITECTURE_SYS390_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_SYS390`] + +[@http://en.wikipedia.org/wiki/System/390 System/390] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__s390__`] [__predef_detection__]] + [[`__s390x__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_ARCH_SYS390 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__s390__) || defined(__s390x__) +# undef MSGPACK_ARCH_SYS390 +# define MSGPACK_ARCH_SYS390 MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_ARCH_SYS390 +# define MSGPACK_ARCH_SYS390_AVAILABLE +#endif + +#define MSGPACK_ARCH_SYS390_NAME "System/390" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_SYS390,MSGPACK_ARCH_SYS390_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/x86.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/x86.h new file mode 100644 index 0000000000000000000000000000000000000000..02353b15d8450176d31e2b6ef79f92b479527765 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/x86.h @@ -0,0 +1,38 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#include +#include + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_X86_H +#define MSGPACK_PREDEF_ARCHITECTURE_X86_H + +/*` +[heading `MSGPACK_ARCH_X86`] + +[@http://en.wikipedia.org/wiki/X86 Intel x86] architecture. This is +a category to indicate that either `MSGPACK_ARCH_X86_32` or +`MSGPACK_ARCH_X86_64` is detected. + */ + +#define MSGPACK_ARCH_X86 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if MSGPACK_ARCH_X86_32 || MSGPACK_ARCH_X86_64 +# undef MSGPACK_ARCH_X86 +# define MSGPACK_ARCH_X86 MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_ARCH_X86 +# define MSGPACK_ARCH_X86_AVAILABLE +#endif + +#define MSGPACK_ARCH_X86_NAME "Intel x86" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_X86,MSGPACK_ARCH_X86_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/x86/32.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/x86/32.h new file mode 100644 index 0000000000000000000000000000000000000000..82cff0195e8eb39f7b21c68ed794e2b0d99909e4 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/x86/32.h @@ -0,0 +1,87 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_X86_32_H +#define MSGPACK_PREDEF_ARCHITECTURE_X86_32_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_X86_32`] + +[@http://en.wikipedia.org/wiki/X86 Intel x86] architecture: +If available versions \[3-6\] are specifically detected. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`i386`] [__predef_detection__]] + [[`__i386__`] [__predef_detection__]] + [[`__i486__`] [__predef_detection__]] + [[`__i586__`] [__predef_detection__]] + [[`__i686__`] [__predef_detection__]] + [[`__i386`] [__predef_detection__]] + [[`_M_IX86`] [__predef_detection__]] + [[`_X86_`] [__predef_detection__]] + [[`__THW_INTEL__`] [__predef_detection__]] + [[`__I86__`] [__predef_detection__]] + [[`__INTEL__`] [__predef_detection__]] + + [[`__I86__`] [V.0.0]] + [[`_M_IX86`] [V.0.0]] + [[`__i686__`] [6.0.0]] + [[`__i586__`] [5.0.0]] + [[`__i486__`] [4.0.0]] + [[`__i386__`] [3.0.0]] + ] + */ + +#define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(i386) || defined(__i386__) || \ + defined(__i486__) || defined(__i586__) || \ + defined(__i686__) || defined(__i386) || \ + defined(_M_IX86) || defined(_X86_) || \ + defined(__THW_INTEL__) || defined(__I86__) || \ + defined(__INTEL__) +# undef MSGPACK_ARCH_X86_32 +# if !defined(MSGPACK_ARCH_X86_32) && defined(__I86__) +# define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER(__I86__,0,0) +# endif +# if !defined(MSGPACK_ARCH_X86_32) && defined(_M_IX86) +# define MSGPACK_ARCH_X86_32 MSGPACK_PREDEF_MAKE_10_VV00(_M_IX86) +# endif +# if !defined(MSGPACK_ARCH_X86_32) && defined(__i686__) +# define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER(6,0,0) +# endif +# if !defined(MSGPACK_ARCH_X86_32) && defined(__i586__) +# define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER(5,0,0) +# endif +# if !defined(MSGPACK_ARCH_X86_32) && defined(__i486__) +# define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER(4,0,0) +# endif +# if !defined(MSGPACK_ARCH_X86_32) && defined(__i386__) +# define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER(3,0,0) +# endif +# if !defined(MSGPACK_ARCH_X86_32) +# define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_ARCH_X86_32 +# define MSGPACK_ARCH_X86_32_AVAILABLE +#endif + +#define MSGPACK_ARCH_X86_32_NAME "Intel x86-32" + +#include + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_X86_32,MSGPACK_ARCH_X86_32_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/x86/64.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/x86/64.h new file mode 100644 index 0000000000000000000000000000000000000000..72a05c26b2fc15befffb65dbaed9be570de39bc9 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/x86/64.h @@ -0,0 +1,50 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_X86_64_H +#define MSGPACK_PREDEF_ARCHITECTURE_X86_64_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_X86_64`] + +[@http://en.wikipedia.org/wiki/Ia64 Intel IA-64] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__x86_64`] [__predef_detection__]] + [[`__x86_64__`] [__predef_detection__]] + [[`__amd64__`] [__predef_detection__]] + [[`__amd64`] [__predef_detection__]] + [[`_M_X64`] [__predef_detection__]] + ] + */ + +#define MSGPACK_ARCH_X86_64 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__x86_64) || defined(__x86_64__) || \ + defined(__amd64__) || defined(__amd64) || \ + defined(_M_X64) +# undef MSGPACK_ARCH_X86_64 +# define MSGPACK_ARCH_X86_64 MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_ARCH_X86_64 +# define MSGPACK_ARCH_X86_64_AVAILABLE +#endif + +#define MSGPACK_ARCH_X86_64_NAME "Intel x86-64" + +#include + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_X86_64,MSGPACK_ARCH_X86_64_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/architecture/z.h b/msgpackc/3.2.1/include/msgpack/predef/architecture/z.h new file mode 100644 index 0000000000000000000000000000000000000000..f5e9f859ca0c8e9f9efeea118586ab71bf764c0e --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/architecture/z.h @@ -0,0 +1,42 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ARCHITECTURE_Z_H +#define MSGPACK_PREDEF_ARCHITECTURE_Z_H + +#include +#include + +/*` +[heading `MSGPACK_ARCH_Z`] + +[@http://en.wikipedia.org/wiki/Z/Architecture z/Architecture] architecture. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__SYSC_ZARCH__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_ARCH_Z MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__SYSC_ZARCH__) +# undef MSGPACK_ARCH_Z +# define MSGPACK_ARCH_Z MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_ARCH_Z +# define MSGPACK_ARCH_Z_AVAILABLE +#endif + +#define MSGPACK_ARCH_Z_NAME "z/Architecture" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_Z,MSGPACK_ARCH_Z_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler.h b/msgpackc/3.2.1/include/msgpack/predef/compiler.h new file mode 100644 index 0000000000000000000000000000000000000000..c4ebb2dbc3d937e96a0b5fd0cea1aa65128bc218 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler.h @@ -0,0 +1,44 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#if !defined(MSGPACK_PREDEF_COMPILER_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS) +#ifndef MSGPACK_PREDEF_COMPILER_H +#define MSGPACK_PREDEF_COMPILER_H +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/borland.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/borland.h new file mode 100644 index 0000000000000000000000000000000000000000..89e0d9f2ceb484f1b2d3242aaf6aa77b8236bb37 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/borland.h @@ -0,0 +1,63 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_BORLAND_H +#define MSGPACK_PREDEF_COMPILER_BORLAND_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_BORLAND`] + +[@http://en.wikipedia.org/wiki/C_plus_plus_builder Borland C++] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__BORLANDC__`] [__predef_detection__]] + [[`__CODEGEARC__`] [__predef_detection__]] + + [[`__BORLANDC__`] [V.R.P]] + [[`__CODEGEARC__`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_BORLAND MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__BORLANDC__) || defined(__CODEGEARC__) +# if !defined(MSGPACK_COMP_BORLAND_DETECTION) && (defined(__CODEGEARC__)) +# define MSGPACK_COMP_BORLAND_DETECTION MSGPACK_PREDEF_MAKE_0X_VVRP(__CODEGEARC__) +# endif +# if !defined(MSGPACK_COMP_BORLAND_DETECTION) +# define MSGPACK_COMP_BORLAND_DETECTION MSGPACK_PREDEF_MAKE_0X_VVRP(__BORLANDC__) +# endif +#endif + +#ifdef MSGPACK_COMP_BORLAND_DETECTION +# define MSGPACK_COMP_BORLAND_AVAILABLE +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_BORLAND_EMULATED MSGPACK_COMP_BORLAND_DETECTION +# else +# undef MSGPACK_COMP_BORLAND +# define MSGPACK_COMP_BORLAND MSGPACK_COMP_BORLAND_DETECTION +# endif +# include +#endif + +#define MSGPACK_COMP_BORLAND_NAME "Borland C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_BORLAND,MSGPACK_COMP_BORLAND_NAME) + +#ifdef MSGPACK_COMP_BORLAND_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_BORLAND_EMULATED,MSGPACK_COMP_BORLAND_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/clang.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/clang.h new file mode 100644 index 0000000000000000000000000000000000000000..93616cf53fe47bf11ccde04ef885f0f09136b936 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/clang.h @@ -0,0 +1,56 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_CLANG_H +#define MSGPACK_PREDEF_COMPILER_CLANG_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_CLANG`] + +[@http://en.wikipedia.org/wiki/Clang Clang] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__clang__`] [__predef_detection__]] + + [[`__clang_major__`, `__clang_minor__`, `__clang_patchlevel__`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_CLANG MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__clang__) +# define MSGPACK_COMP_CLANG_DETECTION MSGPACK_VERSION_NUMBER(__clang_major__,__clang_minor__,__clang_patchlevel__) +#endif + +#ifdef MSGPACK_COMP_CLANG_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_CLANG_EMULATED MSGPACK_COMP_CLANG_DETECTION +# else +# undef MSGPACK_COMP_CLANG +# define MSGPACK_COMP_CLANG MSGPACK_COMP_CLANG_DETECTION +# endif +# define MSGPACK_COMP_CLANG_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_CLANG_NAME "Clang" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_CLANG,MSGPACK_COMP_CLANG_NAME) + +#ifdef MSGPACK_COMP_CLANG_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_CLANG_EMULATED,MSGPACK_COMP_CLANG_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/comeau.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/comeau.h new file mode 100644 index 0000000000000000000000000000000000000000..f944bca863d5a3d647a5a4a85e19020b5811059a --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/comeau.h @@ -0,0 +1,61 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_COMEAU_H +#define MSGPACK_PREDEF_COMPILER_COMEAU_H + +#include +#include + +#define MSGPACK_COMP_COMO MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +/*` +[heading `MSGPACK_COMP_COMO`] + +[@http://en.wikipedia.org/wiki/Comeau_C/C%2B%2B Comeau C++] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__COMO__`] [__predef_detection__]] + + [[`__COMO_VERSION__`] [V.R.P]] + ] + */ + +#if defined(__COMO__) +# if !defined(MSGPACK_COMP_COMO_DETECTION) && defined(__COMO_VERSION__) +# define MSGPACK_COMP_COMO_DETECTION MSGPACK_PREDEF_MAKE_0X_VRP(__COMO_VERSION__) +# endif +# if !defined(MSGPACK_COMP_COMO_DETECTION) +# define MSGPACK_COMP_COMO_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_COMP_COMO_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_COMO_EMULATED MSGPACK_COMP_COMO_DETECTION +# else +# undef MSGPACK_COMP_COMO +# define MSGPACK_COMP_COMO MSGPACK_COMP_COMO_DETECTION +# endif +# define MSGPACK_COMP_COMO_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_COMO_NAME "Comeau C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_COMO,MSGPACK_COMP_COMO_NAME) + +#ifdef MSGPACK_COMP_COMO_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_COMO_EMULATED,MSGPACK_COMP_COMO_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/compaq.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/compaq.h new file mode 100644 index 0000000000000000000000000000000000000000..b2771a73c8ea502f8d5542d763c71588b3cfe03b --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/compaq.h @@ -0,0 +1,66 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_COMPAQ_H +#define MSGPACK_PREDEF_COMPILER_COMPAQ_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_DEC`] + +[@http://www.openvms.compaq.com/openvms/brochures/deccplus/ Compaq C/C++] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__DECCXX`] [__predef_detection__]] + [[`__DECC`] [__predef_detection__]] + + [[`__DECCXX_VER`] [V.R.P]] + [[`__DECC_VER`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_DEC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__DECC) || defined(__DECCXX) +# if !defined(MSGPACK_COMP_DEC_DETECTION) && defined(__DECCXX_VER) +# define MSGPACK_COMP_DEC_DETECTION MSGPACK_PREDEF_MAKE_10_VVRR0PP00(__DECCXX_VER) +# endif +# if !defined(MSGPACK_COMP_DEC_DETECTION) && defined(__DECC_VER) +# define MSGPACK_COMP_DEC_DETECTION MSGPACK_PREDEF_MAKE_10_VVRR0PP00(__DECC_VER) +# endif +# if !defined(MSGPACK_COMP_DEC_DETECTION) +# define MSGPACK_COM_DEC_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_COMP_DEC_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_DEC_EMULATED MSGPACK_COMP_DEC_DETECTION +# else +# undef MSGPACK_COMP_DEC +# define MSGPACK_COMP_DEC MSGPACK_COMP_DEC_DETECTION +# endif +# define MSGPACK_COMP_DEC_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_DEC_NAME "Compaq C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_DEC,MSGPACK_COMP_DEC_NAME) + +#ifdef MSGPACK_COMP_DEC_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_DEC_EMULATED,MSGPACK_COMP_DEC_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/diab.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/diab.h new file mode 100644 index 0000000000000000000000000000000000000000..a365a35c52b72ff94d1d6a0d4552874c4752a465 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/diab.h @@ -0,0 +1,56 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_DIAB_H +#define MSGPACK_PREDEF_COMPILER_DIAB_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_DIAB`] + +[@http://www.windriver.com/products/development_suite/wind_river_compiler/ Diab C/C++] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__DCC__`] [__predef_detection__]] + + [[`__VERSION_NUMBER__`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_DIAB MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__DCC__) +# define MSGPACK_COMP_DIAB_DETECTION MSGPACK_PREDEF_MAKE_10_VRPP(__VERSION_NUMBER__) +#endif + +#ifdef MSGPACK_COMP_DIAB_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_DIAB_EMULATED MSGPACK_COMP_DIAB_DETECTION +# else +# undef MSGPACK_COMP_DIAB +# define MSGPACK_COMP_DIAB MSGPACK_COMP_DIAB_DETECTION +# endif +# define MSGPACK_COMP_DIAB_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_DIAB_NAME "Diab C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_DIAB,MSGPACK_COMP_DIAB_NAME) + +#ifdef MSGPACK_COMP_DIAB_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_DIAB_EMULATED,MSGPACK_COMP_DIAB_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/digitalmars.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/digitalmars.h new file mode 100644 index 0000000000000000000000000000000000000000..eca2a3123ecd6824b577c250e7f1c64723a68226 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/digitalmars.h @@ -0,0 +1,56 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_DIGITALMARS_H +#define MSGPACK_PREDEF_COMPILER_DIGITALMARS_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_DMC`] + +[@http://en.wikipedia.org/wiki/Digital_Mars Digital Mars] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__DMC__`] [__predef_detection__]] + + [[`__DMC__`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_DMC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__DMC__) +# define MSGPACK_COMP_DMC_DETECTION MSGPACK_PREDEF_MAKE_0X_VRP(__DMC__) +#endif + +#ifdef MSGPACK_COMP_DMC_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_DMC_EMULATED MSGPACK_COMP_DMC_DETECTION +# else +# undef MSGPACK_COMP_DMC +# define MSGPACK_COMP_DMC MSGPACK_COMP_DMC_DETECTION +# endif +# define MSGPACK_COMP_DMC_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_DMC_NAME "Digital Mars" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_DMC,MSGPACK_COMP_DMC_NAME) + +#ifdef MSGPACK_COMP_DMC_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_DMC_EMULATED,MSGPACK_COMP_DMC_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/dignus.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/dignus.h new file mode 100644 index 0000000000000000000000000000000000000000..8040baa9b444977cefc8c39f04b44fb68687ba6c --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/dignus.h @@ -0,0 +1,56 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_DIGNUS_H +#define MSGPACK_PREDEF_COMPILER_DIGNUS_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_SYSC`] + +[@http://www.dignus.com/dcxx/ Dignus Systems/C++] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__SYSC__`] [__predef_detection__]] + + [[`__SYSC_VER__`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_SYSC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__SYSC__) +# define MSGPACK_COMP_SYSC_DETECTION MSGPACK_PREDEF_MAKE_10_VRRPP(__SYSC_VER__) +#endif + +#ifdef MSGPACK_COMP_SYSC_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_SYSC_EMULATED MSGPACK_COMP_SYSC_DETECTION +# else +# undef MSGPACK_COMP_SYSC +# define MSGPACK_COMP_SYSC MSGPACK_COMP_SYSC_DETECTION +# endif +# define MSGPACK_COMP_SYSC_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_SYSC_NAME "Dignus Systems/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_SYSC,MSGPACK_COMP_SYSC_NAME) + +#ifdef MSGPACK_COMP_SYSC_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_SYSC_EMULATED,MSGPACK_COMP_SYSC_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/edg.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/edg.h new file mode 100644 index 0000000000000000000000000000000000000000..700f8bdc4dc6e945ec1b90873786804231983d87 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/edg.h @@ -0,0 +1,56 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_EDG_H +#define MSGPACK_PREDEF_COMPILER_EDG_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_EDG`] + +[@http://en.wikipedia.org/wiki/Edison_Design_Group EDG C++ Frontend] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__EDG__`] [__predef_detection__]] + + [[`__EDG_VERSION__`] [V.R.0]] + ] + */ + +#define MSGPACK_COMP_EDG MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__EDG__) +# define MSGPACK_COMP_EDG_DETECTION MSGPACK_PREDEF_MAKE_10_VRR(__EDG_VERSION__) +#endif + +#ifdef MSGPACK_COMP_EDG_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_EDG_EMULATED MSGPACK_COMP_EDG_DETECTION +# else +# undef MSGPACK_COMP_EDG +# define MSGPACK_COMP_EDG MSGPACK_COMP_EDG_DETECTION +# endif +# define MSGPACK_COMP_EDG_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_EDG_NAME "EDG C++ Frontend" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_EDG,MSGPACK_COMP_EDG_NAME) + +#ifdef MSGPACK_COMP_EDG_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_EDG_EMULATED,MSGPACK_COMP_EDG_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/ekopath.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/ekopath.h new file mode 100644 index 0000000000000000000000000000000000000000..72fda2723b77739266b0fcb5afc8deca93a02e0b --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/ekopath.h @@ -0,0 +1,57 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_EKOPATH_H +#define MSGPACK_PREDEF_COMPILER_EKOPATH_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_PATH`] + +[@http://en.wikipedia.org/wiki/PathScale EKOpath] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__PATHCC__`] [__predef_detection__]] + + [[`__PATHCC__`, `__PATHCC_MINOR__`, `__PATHCC_PATCHLEVEL__`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_PATH MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__PATHCC__) +# define MSGPACK_COMP_PATH_DETECTION \ + MSGPACK_VERSION_NUMBER(__PATHCC__,__PATHCC_MINOR__,__PATHCC_PATCHLEVEL__) +#endif + +#ifdef MSGPACK_COMP_PATH_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_PATH_EMULATED MSGPACK_COMP_PATH_DETECTION +# else +# undef MSGPACK_COMP_PATH +# define MSGPACK_COMP_PATH MSGPACK_COMP_PATH_DETECTION +# endif +# define MSGPACK_COMP_PATH_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_PATH_NAME "EKOpath" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_PATH,MSGPACK_COMP_PATH_NAME) + +#ifdef MSGPACK_COMP_PATH_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_PATH_EMULATED,MSGPACK_COMP_PATH_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/gcc.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/gcc.h new file mode 100644 index 0000000000000000000000000000000000000000..03fcd2a7848b194d01d8af6d1c876ab05447ae7c --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/gcc.h @@ -0,0 +1,68 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_GCC_H +#define MSGPACK_PREDEF_COMPILER_GCC_H + +/* Other compilers that emulate this one need to be detected first. */ + +#include + +#include +#include + +/*` +[heading `MSGPACK_COMP_GNUC`] + +[@http://en.wikipedia.org/wiki/GNU_Compiler_Collection Gnu GCC C/C++] compiler. +Version number available as major, minor, and patch (if available). + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__GNUC__`] [__predef_detection__]] + + [[`__GNUC__`, `__GNUC_MINOR__`, `__GNUC_PATCHLEVEL__`] [V.R.P]] + [[`__GNUC__`, `__GNUC_MINOR__`] [V.R.0]] + ] + */ + +#define MSGPACK_COMP_GNUC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__GNUC__) +# if !defined(MSGPACK_COMP_GNUC_DETECTION) && defined(__GNUC_PATCHLEVEL__) +# define MSGPACK_COMP_GNUC_DETECTION \ + MSGPACK_VERSION_NUMBER(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) +# endif +# if !defined(MSGPACK_COMP_GNUC_DETECTION) +# define MSGPACK_COMP_GNUC_DETECTION \ + MSGPACK_VERSION_NUMBER(__GNUC__,__GNUC_MINOR__,0) +# endif +#endif + +#ifdef MSGPACK_COMP_GNUC_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_GNUC_EMULATED MSGPACK_COMP_GNUC_DETECTION +# else +# undef MSGPACK_COMP_GNUC +# define MSGPACK_COMP_GNUC MSGPACK_COMP_GNUC_DETECTION +# endif +# define MSGPACK_COMP_GNUC_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_GNUC_NAME "Gnu GCC C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GNUC,MSGPACK_COMP_GNUC_NAME) + +#ifdef MSGPACK_COMP_GNUC_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GNUC_EMULATED,MSGPACK_COMP_GNUC_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/gcc_xml.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/gcc_xml.h new file mode 100644 index 0000000000000000000000000000000000000000..678cf71c7651f131bf2d2290489102dfb1e4091b --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/gcc_xml.h @@ -0,0 +1,53 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_GCC_XML_H +#define MSGPACK_PREDEF_COMPILER_GCC_XML_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_GCCXML`] + +[@http://www.gccxml.org/ GCC XML] compiler. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__GCCXML__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_COMP_GCCXML MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__GCCXML__) +# define MSGPACK_COMP_GCCXML_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#ifdef MSGPACK_COMP_GCCXML_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_GCCXML_EMULATED MSGPACK_COMP_GCCXML_DETECTION +# else +# undef MSGPACK_COMP_GCCXML +# define MSGPACK_COMP_GCCXML MSGPACK_COMP_GCCXML_DETECTION +# endif +# define MSGPACK_COMP_GCCXML_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_GCCXML_NAME "GCC XML" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GCCXML,MSGPACK_COMP_GCCXML_NAME) + +#ifdef MSGPACK_COMP_GCCXML_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GCCXML_EMULATED,MSGPACK_COMP_GCCXML_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/greenhills.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/greenhills.h new file mode 100644 index 0000000000000000000000000000000000000000..f99784367339fb69397a2b9dbf2153e8159fbb13 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/greenhills.h @@ -0,0 +1,66 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_GREENHILLS_H +#define MSGPACK_PREDEF_COMPILER_GREENHILLS_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_GHS`] + +[@http://en.wikipedia.org/wiki/Green_Hills_Software Green Hills C/C++] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__ghs`] [__predef_detection__]] + [[`__ghs__`] [__predef_detection__]] + + [[`__GHS_VERSION_NUMBER__`] [V.R.P]] + [[`__ghs`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_GHS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__ghs) || defined(__ghs__) +# if !defined(MSGPACK_COMP_GHS_DETECTION) && defined(__GHS_VERSION_NUMBER__) +# define MSGPACK_COMP_GHS_DETECTION MSGPACK_PREDEF_MAKE_10_VRP(__GHS_VERSION_NUMBER__) +# endif +# if !defined(MSGPACK_COMP_GHS_DETECTION) && defined(__ghs) +# define MSGPACK_COMP_GHS_DETECTION MSGPACK_PREDEF_MAKE_10_VRP(__ghs) +# endif +# if !defined(MSGPACK_COMP_GHS_DETECTION) +# define MSGPACK_COMP_GHS_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_COMP_GHS_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_GHS_EMULATED MSGPACK_COMP_GHS_DETECTION +# else +# undef MSGPACK_COMP_GHS +# define MSGPACK_COMP_GHS MSGPACK_COMP_GHS_DETECTION +# endif +# define MSGPACK_COMP_GHS_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_GHS_NAME "Green Hills C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GHS,MSGPACK_COMP_GHS_NAME) + +#ifdef MSGPACK_COMP_GHS_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GHS_EMULATED,MSGPACK_COMP_GHS_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/hp_acc.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/hp_acc.h new file mode 100644 index 0000000000000000000000000000000000000000..5a47ae4df9601c90a83e56ccd9c7838324c699b6 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/hp_acc.h @@ -0,0 +1,61 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_HP_ACC_H +#define MSGPACK_PREDEF_COMPILER_HP_ACC_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_HPACC`] + +HP aC++ compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__HP_aCC`] [__predef_detection__]] + + [[`__HP_aCC`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_HPACC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__HP_aCC) +# if !defined(MSGPACK_COMP_HPACC_DETECTION) && (__HP_aCC > 1) +# define MSGPACK_COMP_HPACC_DETECTION MSGPACK_PREDEF_MAKE_10_VVRRPP(__HP_aCC) +# endif +# if !defined(MSGPACK_COMP_HPACC_DETECTION) +# define MSGPACK_COMP_HPACC_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_COMP_HPACC_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_HPACC_EMULATED MSGPACK_COMP_HPACC_DETECTION +# else +# undef MSGPACK_COMP_HPACC +# define MSGPACK_COMP_HPACC MSGPACK_COMP_HPACC_DETECTION +# endif +# define MSGPACK_COMP_HPACC_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_HPACC_NAME "HP aC++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_HPACC,MSGPACK_COMP_HPACC_NAME) + +#ifdef MSGPACK_COMP_HPACC_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_HPACC_EMULATED,MSGPACK_COMP_HPACC_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/iar.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/iar.h new file mode 100644 index 0000000000000000000000000000000000000000..2cce96003cc7a1be3c4bf8740e020851e7f2970e --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/iar.h @@ -0,0 +1,56 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_IAR_H +#define MSGPACK_PREDEF_COMPILER_IAR_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_IAR`] + +IAR C/C++ compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__IAR_SYSTEMS_ICC__`] [__predef_detection__]] + + [[`__VER__`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_IAR MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__IAR_SYSTEMS_ICC__) +# define MSGPACK_COMP_IAR_DETECTION MSGPACK_PREDEF_MAKE_10_VVRR(__VER__) +#endif + +#ifdef MSGPACK_COMP_IAR_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_IAR_EMULATED MSGPACK_COMP_IAR_DETECTION +# else +# undef MSGPACK_COMP_IAR +# define MSGPACK_COMP_IAR MSGPACK_COMP_IAR_DETECTION +# endif +# define MSGPACK_COMP_IAR_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_IAR_NAME "IAR C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_IAR,MSGPACK_COMP_IAR_NAME) + +#ifdef MSGPACK_COMP_IAR_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_IAR_EMULATED,MSGPACK_COMP_IAR_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/ibm.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/ibm.h new file mode 100644 index 0000000000000000000000000000000000000000..fc4ecfae03a37d9aef9cb25f77cb5924bf669cba --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/ibm.h @@ -0,0 +1,72 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_IBM_H +#define MSGPACK_PREDEF_COMPILER_IBM_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_IBM`] + +[@http://en.wikipedia.org/wiki/VisualAge IBM XL C/C++] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__IBMCPP__`] [__predef_detection__]] + [[`__xlC__`] [__predef_detection__]] + [[`__xlc__`] [__predef_detection__]] + + [[`__COMPILER_VER__`] [V.R.P]] + [[`__xlC__`] [V.R.P]] + [[`__xlc__`] [V.R.P]] + [[`__IBMCPP__`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_IBM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__IBMCPP__) || defined(__xlC__) || defined(__xlc__) +# if !defined(MSGPACK_COMP_IBM_DETECTION) && defined(__COMPILER_VER__) +# define MSGPACK_COMP_IBM_DETECTION MSGPACK_PREDEF_MAKE_0X_VRRPPPP(__COMPILER_VER__) +# endif +# if !defined(MSGPACK_COMP_IBM_DETECTION) && defined(__xlC__) +# define MSGPACK_COMP_IBM_DETECTION MSGPACK_PREDEF_MAKE_0X_VVRR(__xlC__) +# endif +# if !defined(MSGPACK_COMP_IBM_DETECTION) && defined(__xlc__) +# define MSGPACK_COMP_IBM_DETECTION MSGPACK_PREDEF_MAKE_0X_VVRR(__xlc__) +# endif +# if !defined(MSGPACK_COMP_IBM_DETECTION) +# define MSGPACK_COMP_IBM_DETECTION MSGPACK_PREDEF_MAKE_10_VRP(__IBMCPP__) +# endif +#endif + +#ifdef MSGPACK_COMP_IBM_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_IBM_EMULATED MSGPACK_COMP_IBM_DETECTION +# else +# undef MSGPACK_COMP_IBM +# define MSGPACK_COMP_IBM MSGPACK_COMP_IBM_DETECTION +# endif +# define MSGPACK_COMP_IBM_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_IBM_NAME "IBM XL C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_IBM,MSGPACK_COMP_IBM_NAME) + +#ifdef MSGPACK_COMP_IBM_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_IBM_EMULATED,MSGPACK_COMP_IBM_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/intel.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/intel.h new file mode 100644 index 0000000000000000000000000000000000000000..c908b9db3c066f0e39fbdf1c31a461a2dd60cc1a --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/intel.h @@ -0,0 +1,79 @@ +/* +Copyright Rene Rivera 2008-2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_INTEL_H +#define MSGPACK_PREDEF_COMPILER_INTEL_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_INTEL`] + +[@http://en.wikipedia.org/wiki/Intel_C%2B%2B Intel C/C++] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__INTEL_COMPILER`] [__predef_detection__]] + [[`__ICL`] [__predef_detection__]] + [[`__ICC`] [__predef_detection__]] + [[`__ECC`] [__predef_detection__]] + + [[`__INTEL_COMPILER`] [V.R]] + [[`__INTEL_COMPILER` and `__INTEL_COMPILER_UPDATE`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_INTEL MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || \ + defined(__ECC) +/*` +[note Because of an Intel mistake in the release version numbering when +`__INTEL_COMPILER` is `9999` it is detected as version 12.1.0.] + */ +# if !defined(MSGPACK_COMP_INTEL_DETECTION) && defined(__INTEL_COMPILER) && (__INTEL_COMPILER == 9999) +# define MSGPACK_COMP_INTEL_DETECTION MSGPACK_VERSION_NUMBER(12,1,0) +# endif +# if !defined(MSGPACK_COMP_INTEL_DETECTION) && defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) +# define MSGPACK_COMP_INTEL_DETECTION MSGPACK_VERSION_NUMBER( \ + MSGPACK_VERSION_NUMBER_MAJOR(MSGPACK_PREDEF_MAKE_10_VVRR(__INTEL_COMPILER)), \ + MSGPACK_VERSION_NUMBER_MINOR(MSGPACK_PREDEF_MAKE_10_VVRR(__INTEL_COMPILER)), \ + __INTEL_COMPILER_UPDATE) +# endif +# if !defined(MSGPACK_COMP_INTEL_DETECTION) && defined(__INTEL_COMPILER) +# define MSGPACK_COMP_INTEL_DETECTION MSGPACK_PREDEF_MAKE_10_VVRR(__INTEL_COMPILER) +# endif +# if !defined(MSGPACK_COMP_INTEL_DETECTION) +# define MSGPACK_COMP_INTEL_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_COMP_INTEL_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_INTEL_EMULATED MSGPACK_COMP_INTEL_DETECTION +# else +# undef MSGPACK_COMP_INTEL +# define MSGPACK_COMP_INTEL MSGPACK_COMP_INTEL_DETECTION +# endif +# define MSGPACK_COMP_INTEL_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_INTEL_NAME "Intel C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_INTEL,MSGPACK_COMP_INTEL_NAME) + +#ifdef MSGPACK_COMP_INTEL_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_INTEL_EMULATED,MSGPACK_COMP_INTEL_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/kai.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/kai.h new file mode 100644 index 0000000000000000000000000000000000000000..232d54d5f0b3d4e0598dee0d818e956c6efcb59e --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/kai.h @@ -0,0 +1,56 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_KAI_H +#define MSGPACK_PREDEF_COMPILER_KAI_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_KCC`] + +Kai C++ compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__KCC`] [__predef_detection__]] + + [[`__KCC_VERSION`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_KCC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__KCC) +# define MSGPACK_COMP_KCC_DETECTION MSGPACK_PREDEF_MAKE_0X_VRPP(__KCC_VERSION) +#endif + +#ifdef MSGPACK_COMP_KCC_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_KCC_EMULATED MSGPACK_COMP_KCC_DETECTION +# else +# undef MSGPACK_COMP_KCC +# define MSGPACK_COMP_KCC MSGPACK_COMP_KCC_DETECTION +# endif +# define MSGPACK_COMP_KCC_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_KCC_NAME "Kai C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_KCC,MSGPACK_COMP_KCC_NAME) + +#ifdef MSGPACK_COMP_KCC_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_KCC_EMULATED,MSGPACK_COMP_KCC_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/llvm.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/llvm.h new file mode 100644 index 0000000000000000000000000000000000000000..873d3087316b7bc8cd427f97f4f5ecf51f2e6ffe --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/llvm.h @@ -0,0 +1,57 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_LLVM_H +#define MSGPACK_PREDEF_COMPILER_LLVM_H + +/* Other compilers that emulate this one need to be detected first. */ + +#include + +#include +#include + +/*` +[heading `MSGPACK_COMP_LLVM`] + +[@http://en.wikipedia.org/wiki/LLVM LLVM] compiler. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__llvm__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_COMP_LLVM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__llvm__) +# define MSGPACK_COMP_LLVM_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#ifdef MSGPACK_COMP_LLVM_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_LLVM_EMULATED MSGPACK_COMP_LLVM_DETECTION +# else +# undef MSGPACK_COMP_LLVM +# define MSGPACK_COMP_LLVM MSGPACK_COMP_LLVM_DETECTION +# endif +# define MSGPACK_COMP_LLVM_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_LLVM_NAME "LLVM" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_LLVM,MSGPACK_COMP_LLVM_NAME) + +#ifdef MSGPACK_COMP_LLVM_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_LLVM_EMULATED,MSGPACK_COMP_LLVM_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/metaware.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/metaware.h new file mode 100644 index 0000000000000000000000000000000000000000..a3c66adcd3c749c843bc5a0f5ca53928e645f8a5 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/metaware.h @@ -0,0 +1,53 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_METAWARE_H +#define MSGPACK_PREDEF_COMPILER_METAWARE_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_HIGHC`] + +MetaWare High C/C++ compiler. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__HIGHC__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_COMP_HIGHC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__HIGHC__) +# define MSGPACK_COMP_HIGHC_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#ifdef MSGPACK_COMP_HIGHC_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_HIGHC_EMULATED MSGPACK_COMP_HIGHC_DETECTION +# else +# undef MSGPACK_COMP_HIGHC +# define MSGPACK_COMP_HIGHC MSGPACK_COMP_HIGHC_DETECTION +# endif +# define MSGPACK_COMP_HIGHC_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_HIGHC_NAME "MetaWare High C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_HIGHC,MSGPACK_COMP_HIGHC_NAME) + +#ifdef MSGPACK_COMP_HIGHC_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_HIGHC_EMULATED,MSGPACK_COMP_HIGHC_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/metrowerks.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/metrowerks.h new file mode 100644 index 0000000000000000000000000000000000000000..2b902b371c81f8474f1f33d0cd874ae6aeb2f3a5 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/metrowerks.h @@ -0,0 +1,77 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_METROWERKS_H +#define MSGPACK_PREDEF_COMPILER_METROWERKS_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_MWERKS`] + +[@http://en.wikipedia.org/wiki/CodeWarrior Metrowerks CodeWarrior] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MWERKS__`] [__predef_detection__]] + [[`__CWCC__`] [__predef_detection__]] + + [[`__CWCC__`] [V.R.P]] + [[`__MWERKS__`] [V.R.P >= 4.2.0]] + [[`__MWERKS__`] [9.R.0]] + [[`__MWERKS__`] [8.R.0]] + ] + */ + +#define MSGPACK_COMP_MWERKS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MWERKS__) || defined(__CWCC__) +# if !defined(MSGPACK_COMP_MWERKS_DETECTION) && defined(__CWCC__) +# define MSGPACK_COMP_MWERKS_DETECTION MSGPACK_PREDEF_MAKE_0X_VRPP(__CWCC__) +# endif +# if !defined(MSGPACK_COMP_MWERKS_DETECTION) && (__MWERKS__ >= 0x4200) +# define MSGPACK_COMP_MWERKS_DETECTION MSGPACK_PREDEF_MAKE_0X_VRPP(__MWERKS__) +# endif +# if !defined(MSGPACK_COMP_MWERKS_DETECTION) && (__MWERKS__ >= 0x3204) // note the "skip": 04->9.3 +# define MSGPACK_COMP_MWERKS_DETECTION MSGPACK_VERSION_NUMBER(9,(__MWERKS__)%100-1,0) +# endif +# if !defined(MSGPACK_COMP_MWERKS_DETECTION) && (__MWERKS__ >= 0x3200) +# define MSGPACK_COMP_MWERKS_DETECTION MSGPACK_VERSION_NUMBER(9,(__MWERKS__)%100,0) +# endif +# if !defined(MSGPACK_COMP_MWERKS_DETECTION) && (__MWERKS__ >= 0x3000) +# define MSGPACK_COMP_MWERKS_DETECTION MSGPACK_VERSION_NUMBER(8,(__MWERKS__)%100,0) +# endif +# if !defined(MSGPACK_COMP_MWERKS_DETECTION) +# define MSGPACK_COMP_MWERKS_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_COMP_MWERKS_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_MWERKS_EMULATED MSGPACK_COMP_MWERKS_DETECTION +# else +# undef MSGPACK_COMP_MWERKS +# define MSGPACK_COMP_MWERKS MSGPACK_COMP_MWERKS_DETECTION +# endif +# define MSGPACK_COMP_MWERKS_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_MWERKS_NAME "Metrowerks CodeWarrior" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MWERKS,MSGPACK_COMP_MWERKS_NAME) + +#ifdef MSGPACK_COMP_MWERKS_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MWERKS_EMULATED,MSGPACK_COMP_MWERKS_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/microtec.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/microtec.h new file mode 100644 index 0000000000000000000000000000000000000000..bc9c360284ae6ca77d4462077bfb3d4c00537bcb --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/microtec.h @@ -0,0 +1,53 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_MICROTEC_H +#define MSGPACK_PREDEF_COMPILER_MICROTEC_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_MRI`] + +[@http://www.mentor.com/microtec/ Microtec C/C++] compiler. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`_MRI`] [__predef_detection__]] + ] + */ + +#define MSGPACK_COMP_MRI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(_MRI) +# define MSGPACK_COMP_MRI_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#ifdef MSGPACK_COMP_MRI_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_MRI_EMULATED MSGPACK_COMP_MRI_DETECTION +# else +# undef MSGPACK_COMP_MRI +# define MSGPACK_COMP_MRI MSGPACK_COMP_MRI_DETECTION +# endif +# define MSGPACK_COMP_MRI_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_MRI_NAME "Microtec C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MRI,MSGPACK_COMP_MRI_NAME) + +#ifdef MSGPACK_COMP_MRI_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MRI_EMULATED,MSGPACK_COMP_MRI_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/mpw.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/mpw.h new file mode 100644 index 0000000000000000000000000000000000000000..81788f9dfdb91df7f9f073b63ec757f3baacac62 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/mpw.h @@ -0,0 +1,63 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_MPW_H +#define MSGPACK_PREDEF_COMPILER_MPW_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_MPW`] + +[@http://en.wikipedia.org/wiki/Macintosh_Programmer%27s_Workshop MPW C++] compiler. +Version number available as major, and minor. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MRC__`] [__predef_detection__]] + [[`MPW_C`] [__predef_detection__]] + [[`MPW_CPLUS`] [__predef_detection__]] + + [[`__MRC__`] [V.R.0]] + ] + */ + +#define MSGPACK_COMP_MPW MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MRC__) || defined(MPW_C) || defined(MPW_CPLUS) +# if !defined(MSGPACK_COMP_MPW_DETECTION) && defined(__MRC__) +# define MSGPACK_COMP_MPW_DETECTION MSGPACK_PREDEF_MAKE_0X_VVRR(__MRC__) +# endif +# if !defined(MSGPACK_COMP_MPW_DETECTION) +# define MSGPACK_COMP_MPW_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_COMP_MPW_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_MPW_EMULATED MSGPACK_COMP_MPW_DETECTION +# else +# undef MSGPACK_COMP_MPW +# define MSGPACK_COMP_MPW MSGPACK_COMP_MPW_DETECTION +# endif +# define MSGPACK_COMP_MPW_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_MPW_NAME "MPW C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MPW,MSGPACK_COMP_MPW_NAME) + +#ifdef MSGPACK_COMP_MPW_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MPW_EMULATED,MSGPACK_COMP_MPW_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/nvcc.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/nvcc.h new file mode 100644 index 0000000000000000000000000000000000000000..902e6372c385eb5743cbe03cfcb30ddeed6b5ba4 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/nvcc.h @@ -0,0 +1,60 @@ +/* +Copyright Benjamin Worpitz 2018 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_NVCC_H +#define MSGPACK_PREDEF_COMPILER_NVCC_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_NVCC`] + +[@https://en.wikipedia.org/wiki/NVIDIA_CUDA_Compiler NVCC] compiler. +Version number available as major, minor, and patch beginning with version 7.5. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__NVCC__`] [__predef_detection__]] + + [[`__CUDACC_VER_MAJOR__`, `__CUDACC_VER_MINOR__`, `__CUDACC_VER_BUILD__`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_NVCC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__NVCC__) +# if !defined(__CUDACC_VER_MAJOR__) || !defined(__CUDACC_VER_MINOR__) || !defined(__CUDACC_VER_BUILD__) +# define MSGPACK_COMP_NVCC_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# else +# define MSGPACK_COMP_NVCC_DETECTION MSGPACK_VERSION_NUMBER(__CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, __CUDACC_VER_BUILD__) +# endif +#endif + +#ifdef MSGPACK_COMP_NVCC_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_NVCC_EMULATED MSGPACK_COMP_NVCC_DETECTION +# else +# undef MSGPACK_COMP_NVCC +# define MSGPACK_COMP_NVCC MSGPACK_COMP_NVCC_DETECTION +# endif +# define MSGPACK_COMP_NVCC_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_NVCC_NAME "NVCC" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_NVCC,MSGPACK_COMP_NVCC_NAME) + +#ifdef MSGPACK_COMP_NVCC_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_NVCC_EMULATED,MSGPACK_COMP_NVCC_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/palm.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/palm.h new file mode 100644 index 0000000000000000000000000000000000000000..0134cd29399c196a22ac9f338b2b82b02c87d449 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/palm.h @@ -0,0 +1,56 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_PALM_H +#define MSGPACK_PREDEF_COMPILER_PALM_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_PALM`] + +Palm C/C++ compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`_PACC_VER`] [__predef_detection__]] + + [[`_PACC_VER`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_PALM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(_PACC_VER) +# define MSGPACK_COMP_PALM_DETECTION MSGPACK_PREDEF_MAKE_0X_VRRPP000(_PACC_VER) +#endif + +#ifdef MSGPACK_COMP_PALM_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_PALM_EMULATED MSGPACK_COMP_PALM_DETECTION +# else +# undef MSGPACK_COMP_PALM +# define MSGPACK_COMP_PALM MSGPACK_COMP_PALM_DETECTION +# endif +# define MSGPACK_COMP_PALM_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_PALM_NAME "Palm C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_PALM,MSGPACK_COMP_PALM_NAME) + +#ifdef MSGPACK_COMP_PALM_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_PALM_EMULATED,MSGPACK_COMP_PALM_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/pgi.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/pgi.h new file mode 100644 index 0000000000000000000000000000000000000000..a8399dd371597688502c6bdd36c5cc4e66abf0a5 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/pgi.h @@ -0,0 +1,60 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_PGI_H +#define MSGPACK_PREDEF_COMPILER_PGI_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_PGI`] + +[@http://en.wikipedia.org/wiki/The_Portland_Group Portland Group C/C++] compiler. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__PGI`] [__predef_detection__]] + + [[`__PGIC__`, `__PGIC_MINOR__`, `__PGIC_PATCHLEVEL__`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_PGI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__PGI) +# if !defined(MSGPACK_COMP_PGI_DETECTION) && (defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__)) +# define MSGPACK_COMP_PGI_DETECTION MSGPACK_VERSION_NUMBER(__PGIC__,__PGIC_MINOR__,__PGIC_PATCHLEVEL__) +# endif +# if !defined(MSGPACK_COMP_PGI_DETECTION) +# define MSGPACK_COMP_PGI_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_COMP_PGI_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_PGI_EMULATED MSGPACK_COMP_PGI_DETECTION +# else +# undef MSGPACK_COMP_PGI +# define MSGPACK_COMP_PGI MSGPACK_COMP_PGI_DETECTION +# endif +# define MSGPACK_COMP_PGI_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_PGI_NAME "Portland Group C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_PGI,MSGPACK_COMP_PGI_NAME) + +#ifdef MSGPACK_COMP_PGI_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_PGI_EMULATED,MSGPACK_COMP_PGI_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/sgi_mipspro.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/sgi_mipspro.h new file mode 100644 index 0000000000000000000000000000000000000000..673b9bedc6055f8f435c61fe0ceaa657b7a85c1b --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/sgi_mipspro.h @@ -0,0 +1,66 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_SGI_MIPSPRO_H +#define MSGPACK_PREDEF_COMPILER_SGI_MIPSPRO_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_SGI`] + +[@http://en.wikipedia.org/wiki/MIPSpro SGI MIPSpro] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__sgi`] [__predef_detection__]] + [[`sgi`] [__predef_detection__]] + + [[`_SGI_COMPILER_VERSION`] [V.R.P]] + [[`_COMPILER_VERSION`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_SGI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__sgi) || defined(sgi) +# if !defined(MSGPACK_COMP_SGI_DETECTION) && defined(_SGI_COMPILER_VERSION) +# define MSGPACK_COMP_SGI_DETECTION MSGPACK_PREDEF_MAKE_10_VRP(_SGI_COMPILER_VERSION) +# endif +# if !defined(MSGPACK_COMP_SGI_DETECTION) && defined(_COMPILER_VERSION) +# define MSGPACK_COMP_SGI_DETECTION MSGPACK_PREDEF_MAKE_10_VRP(_COMPILER_VERSION) +# endif +# if !defined(MSGPACK_COMP_SGI_DETECTION) +# define MSGPACK_COMP_SGI_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_COMP_SGI_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_SGI_EMULATED MSGPACK_COMP_SGI_DETECTION +# else +# undef MSGPACK_COMP_SGI +# define MSGPACK_COMP_SGI MSGPACK_COMP_SGI_DETECTION +# endif +# define MSGPACK_COMP_SGI_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_SGI_NAME "SGI MIPSpro" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_SGI,MSGPACK_COMP_SGI_NAME) + +#ifdef MSGPACK_COMP_SGI_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_SGI_EMULATED,MSGPACK_COMP_SGI_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/sunpro.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/sunpro.h new file mode 100644 index 0000000000000000000000000000000000000000..0b77334eded2caa3404687ec6e73ddce10d14e93 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/sunpro.h @@ -0,0 +1,76 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_SUNPRO_H +#define MSGPACK_PREDEF_COMPILER_SUNPRO_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_SUNPRO`] + +[@http://en.wikipedia.org/wiki/Oracle_Solaris_Studio Oracle Solaris Studio] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__SUNPRO_CC`] [__predef_detection__]] + [[`__SUNPRO_C`] [__predef_detection__]] + + [[`__SUNPRO_CC`] [V.R.P]] + [[`__SUNPRO_C`] [V.R.P]] + [[`__SUNPRO_CC`] [VV.RR.P]] + [[`__SUNPRO_C`] [VV.RR.P]] + ] + */ + +#define MSGPACK_COMP_SUNPRO MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__SUNPRO_CC) || defined(__SUNPRO_C) +# if !defined(MSGPACK_COMP_SUNPRO_DETECTION) && defined(__SUNPRO_CC) +# if (__SUNPRO_CC < 0x5100) +# define MSGPACK_COMP_SUNPRO_DETECTION MSGPACK_PREDEF_MAKE_0X_VRP(__SUNPRO_CC) +# else +# define MSGPACK_COMP_SUNPRO_DETECTION MSGPACK_PREDEF_MAKE_0X_VVRRP(__SUNPRO_CC) +# endif +# endif +# if !defined(MSGPACK_COMP_SUNPRO_DETECTION) && defined(__SUNPRO_C) +# if (__SUNPRO_C < 0x5100) +# define MSGPACK_COMP_SUNPRO_DETECTION MSGPACK_PREDEF_MAKE_0X_VRP(__SUNPRO_C) +# else +# define MSGPACK_COMP_SUNPRO_DETECTION MSGPACK_PREDEF_MAKE_0X_VVRRP(__SUNPRO_C) +# endif +# endif +# if !defined(MSGPACK_COMP_SUNPRO_DETECTION) +# define MSGPACK_COMP_SUNPRO_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_COMP_SUNPRO_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_SUNPRO_EMULATED MSGPACK_COMP_SUNPRO_DETECTION +# else +# undef MSGPACK_COMP_SUNPRO +# define MSGPACK_COMP_SUNPRO MSGPACK_COMP_SUNPRO_DETECTION +# endif +# define MSGPACK_COMP_SUNPRO_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_SUNPRO_NAME "Oracle Solaris Studio" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_SUNPRO,MSGPACK_COMP_SUNPRO_NAME) + +#ifdef MSGPACK_COMP_SUNPRO_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_SUNPRO_EMULATED,MSGPACK_COMP_SUNPRO_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/tendra.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/tendra.h new file mode 100644 index 0000000000000000000000000000000000000000..e90df56006b8262f15441542fd37f7ff80b20b76 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/tendra.h @@ -0,0 +1,53 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_TENDRA_H +#define MSGPACK_PREDEF_COMPILER_TENDRA_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_TENDRA`] + +[@http://en.wikipedia.org/wiki/TenDRA_Compiler TenDRA C/C++] compiler. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__TenDRA__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_COMP_TENDRA MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__TenDRA__) +# define MSGPACK_COMP_TENDRA_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#ifdef MSGPACK_COMP_TENDRA_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_TENDRA_EMULATED MSGPACK_COMP_TENDRA_DETECTION +# else +# undef MSGPACK_COMP_TENDRA +# define MSGPACK_COMP_TENDRA MSGPACK_COMP_TENDRA_DETECTION +# endif +# define MSGPACK_COMP_TENDRA_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_TENDRA_NAME "TenDRA C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_TENDRA,MSGPACK_COMP_TENDRA_NAME) + +#ifdef MSGPACK_COMP_TENDRA_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_TENDRA_EMULATED,MSGPACK_COMP_TENDRA_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/visualc.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/visualc.h new file mode 100644 index 0000000000000000000000000000000000000000..9cc3255a9367578c0d1285c0c9b231cb3c07559f --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/visualc.h @@ -0,0 +1,105 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_VISUALC_H +#define MSGPACK_PREDEF_COMPILER_VISUALC_H + +/* Other compilers that emulate this one need to be detected first. */ + +#include + +#include +#include + +/*` +[heading `MSGPACK_COMP_MSVC`] + +[@http://en.wikipedia.org/wiki/Visual_studio Microsoft Visual C/C++] compiler. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`_MSC_VER`] [__predef_detection__]] + + [[`_MSC_FULL_VER`] [V.R.P]] + [[`_MSC_VER`] [V.R.0]] + ] + +[note Release of Visual Studio after 2015 will no longer be identified +by Boost Predef as the marketing version number. Instead we use the +compiler version number directly, i.e. the _MSC_VER number.] + */ + +#define MSGPACK_COMP_MSVC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(_MSC_VER) +# if !defined (_MSC_FULL_VER) +# define MSGPACK_COMP_MSVC_BUILD 0 +# else + /* how many digits does the build number have? */ +# if _MSC_FULL_VER / 10000 == _MSC_VER + /* four digits */ +# define MSGPACK_COMP_MSVC_BUILD (_MSC_FULL_VER % 10000) +# elif _MSC_FULL_VER / 100000 == _MSC_VER + /* five digits */ +# define MSGPACK_COMP_MSVC_BUILD (_MSC_FULL_VER % 100000) +# else +# error "Cannot determine build number from _MSC_FULL_VER" +# endif +# endif + /* + VS2014 was skipped in the release sequence for MS. Which + means that the compiler and VS product versions are no longer + in sync. Hence we need to use different formulas for + mapping from MSC version to VS product version. + + VS2017 is a total nightmare when it comes to version numbers. + Hence to avoid arguments relating to that both present and + future.. Any version after VS2015 will use solely the compiler + version, i.e. cl.exe, as the version number here. + */ +# if (_MSC_VER > 1900) +# define MSGPACK_COMP_MSVC_DETECTION MSGPACK_VERSION_NUMBER(\ + _MSC_VER/100,\ + _MSC_VER%100,\ + MSGPACK_COMP_MSVC_BUILD) +# elif (_MSC_VER >= 1900) +# define MSGPACK_COMP_MSVC_DETECTION MSGPACK_VERSION_NUMBER(\ + _MSC_VER/100-5,\ + _MSC_VER%100,\ + MSGPACK_COMP_MSVC_BUILD) +# else +# define MSGPACK_COMP_MSVC_DETECTION MSGPACK_VERSION_NUMBER(\ + _MSC_VER/100-6,\ + _MSC_VER%100,\ + MSGPACK_COMP_MSVC_BUILD) +# endif +#endif + +#ifdef MSGPACK_COMP_MSVC_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_MSVC_EMULATED MSGPACK_COMP_MSVC_DETECTION +# else +# undef MSGPACK_COMP_MSVC +# define MSGPACK_COMP_MSVC MSGPACK_COMP_MSVC_DETECTION +# endif +# define MSGPACK_COMP_MSVC_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_MSVC_NAME "Microsoft Visual C/C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MSVC,MSGPACK_COMP_MSVC_NAME) + +#ifdef MSGPACK_COMP_MSVC_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MSVC_EMULATED,MSGPACK_COMP_MSVC_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/compiler/watcom.h b/msgpackc/3.2.1/include/msgpack/predef/compiler/watcom.h new file mode 100644 index 0000000000000000000000000000000000000000..6e3022ac47b18e27ffb1543ee3ba26812ded5c04 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/compiler/watcom.h @@ -0,0 +1,56 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_COMPILER_WATCOM_H +#define MSGPACK_PREDEF_COMPILER_WATCOM_H + +#include +#include + +/*` +[heading `MSGPACK_COMP_WATCOM`] + +[@http://en.wikipedia.org/wiki/Watcom Watcom C++] compiler. +Version number available as major, and minor. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__WATCOMC__`] [__predef_detection__]] + + [[`__WATCOMC__`] [V.R.P]] + ] + */ + +#define MSGPACK_COMP_WATCOM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__WATCOMC__) +# define MSGPACK_COMP_WATCOM_DETECTION MSGPACK_PREDEF_MAKE_10_VVRR(__WATCOMC__) +#endif + +#ifdef MSGPACK_COMP_WATCOM_DETECTION +# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) +# define MSGPACK_COMP_WATCOM_EMULATED MSGPACK_COMP_WATCOM_DETECTION +# else +# undef MSGPACK_COMP_WATCOM +# define MSGPACK_COMP_WATCOM MSGPACK_COMP_WATCOM_DETECTION +# endif +# define MSGPACK_COMP_WATCOM_AVAILABLE +# include +#endif + +#define MSGPACK_COMP_WATCOM_NAME "Watcom C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_WATCOM,MSGPACK_COMP_WATCOM_NAME) + +#ifdef MSGPACK_COMP_WATCOM_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_WATCOM_EMULATED,MSGPACK_COMP_WATCOM_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/detail/_cassert.h b/msgpackc/3.2.1/include/msgpack/predef/detail/_cassert.h new file mode 100644 index 0000000000000000000000000000000000000000..155ebebdb9f916bc822e079939272fbab8a1b70b --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/detail/_cassert.h @@ -0,0 +1,17 @@ +/* +Copyright Rene Rivera 2011-2012 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_DETAIL__CASSERT_H +#define MSGPACK_PREDEF_DETAIL__CASSERT_H + +#if defined(__cplusplus) +#include +#else +#include +#endif + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/detail/_exception.h b/msgpackc/3.2.1/include/msgpack/predef/detail/_exception.h new file mode 100644 index 0000000000000000000000000000000000000000..ca157b953737d09c03b3610a28026b682292b5ed --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/detail/_exception.h @@ -0,0 +1,15 @@ +/* +Copyright Rene Rivera 2011-2012 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_DETAIL__EXCEPTION_H +#define MSGPACK_PREDEF_DETAIL__EXCEPTION_H + +#if defined(__cplusplus) +#include +#endif + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/detail/comp_detected.h b/msgpackc/3.2.1/include/msgpack/predef/detail/comp_detected.h new file mode 100644 index 0000000000000000000000000000000000000000..3996fd3979f1676dfdbc4d835c5d9c8f26cb6020 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/detail/comp_detected.h @@ -0,0 +1,10 @@ +/* +Copyright Rene Rivera 2014 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_DETAIL_COMP_DETECTED +#define MSGPACK_PREDEF_DETAIL_COMP_DETECTED 1 +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/detail/endian_compat.h b/msgpackc/3.2.1/include/msgpack/predef/detail/endian_compat.h new file mode 100644 index 0000000000000000000000000000000000000000..1b4a66581cdd74c0373ee3226f2d82a0c9d2112a --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/detail/endian_compat.h @@ -0,0 +1,26 @@ +/* +Copyright Rene Rivera 2013 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_DETAIL_ENDIAN_COMPAT_H +#define MSGPACK_PREDEF_DETAIL_ENDIAN_COMPAT_H + +#include + +#if MSGPACK_ENDIAN_BIG_BYTE +# define MSGPACK_BIG_ENDIAN +# define MSGPACK_BYTE_ORDER 4321 +#endif +#if MSGPACK_ENDIAN_LITTLE_BYTE +# define MSGPACK_LITTLE_ENDIAN +# define MSGPACK_BYTE_ORDER 1234 +#endif +#if MSGPACK_ENDIAN_LITTLE_WORD +# define MSGPACK_PDP_ENDIAN +# define MSGPACK_BYTE_ORDER 2134 +#endif + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/detail/os_detected.h b/msgpackc/3.2.1/include/msgpack/predef/detail/os_detected.h new file mode 100644 index 0000000000000000000000000000000000000000..f9f23b787e7a16dd30c449576eaafe05e5ec65d9 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/detail/os_detected.h @@ -0,0 +1,10 @@ +/* +Copyright Rene Rivera 2013 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_DETAIL_OS_DETECTED +#define MSGPACK_PREDEF_DETAIL_OS_DETECTED 1 +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/detail/platform_detected.h b/msgpackc/3.2.1/include/msgpack/predef/detail/platform_detected.h new file mode 100644 index 0000000000000000000000000000000000000000..782b3a291dcfcb5a5449fe9d9177bb7e9a2251b8 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/detail/platform_detected.h @@ -0,0 +1,10 @@ +/* +Copyright Rene Rivera 2014 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_DETAIL_PLAT_DETECTED +#define MSGPACK_PREDEF_DETAIL_PLAT_DETECTED 1 +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/detail/test.h b/msgpackc/3.2.1/include/msgpack/predef/detail/test.h new file mode 100644 index 0000000000000000000000000000000000000000..1414060350f7f8bdc11b93362be3aa2e842b9797 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/detail/test.h @@ -0,0 +1,17 @@ +/* +Copyright Rene Rivera 2011-2012 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_DETAIL_TEST_H +#define MSGPACK_PREDEF_DETAIL_TEST_H + +#if !defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS) + +#define MSGPACK_PREDEF_DECLARE_TEST(x,s) + +#endif + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/detail/test_def.h b/msgpackc/3.2.1/include/msgpack/predef/detail/test_def.h new file mode 100644 index 0000000000000000000000000000000000000000..924c1e5f2d1b008e66f92d5e0541d008d4760fe5 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/detail/test_def.h @@ -0,0 +1,71 @@ +/* +Copyright Rene Rivera 2011-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include + +#define MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS + +void * add_predef_entry(const char * name, const char * description, unsigned value) +#undef MSGPACK_PREDEF_DECLARE_TEST +#define MSGPACK_PREDEF_DECLARE_TEST(x,s) void predef_entry_##x() { add_predef_entry(#x, s, x) } +#include + +#undef MSGPACK_PREDEF_DECLARE_TEST +#define MSGPACK_PREDEF_DECLARE_TEST(x,s) predef_entry_##x() +void create_predef_entries() +{ +#include +} + +#ifdef __cplusplus +#include +#include +#include +using namespace std +#else +#include +#include +#include +#endif + +typedef struct predef_info +{ + const char * name + const char * description + unsigned value +} predef_info + +#ifdef __cplusplus +using namespace std +#endif + +unsigned generated_predef_info_count = 0 +predef_info* generated_predef_info = 0 +void * add_predef_entry(const char * name, const char * description, unsigned value) +{ + if (0 == generated_predef_info_count) + { + generated_predef_info_count = 1 + generated_predef_info = (predef_info*)malloc(sizeof(predef_info)) + } + else + { + generated_predef_info_count += 1 + generated_predef_info = (predef_info*)realloc(generated_predef_info, + generated_predef_info_count*sizeof(predef_info)) + } + generated_predef_info[generated_predef_info_count-1].name = name + generated_predef_info[generated_predef_info_count-1].description = description + generated_predef_info[generated_predef_info_count-1].value = value + return 0 +} + +int predef_info_compare(const void * a, const void * b) +{ + const predef_info * i = (const predef_info *)a + const predef_info * j = (const predef_info *)b + return strcmp(i->name,j->name) +} diff --git a/msgpackc/3.2.1/include/msgpack/predef/hardware.h b/msgpackc/3.2.1/include/msgpack/predef/hardware.h new file mode 100644 index 0000000000000000000000000000000000000000..328409839d8086388b3cf8bc9e1cba38d6b3f4c9 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/hardware.h @@ -0,0 +1,16 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#if !defined(MSGPACK_PREDEF_HARDWARE_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS) +#ifndef MSGPACK_PREDEF_HARDWARE_H +#define MSGPACK_PREDEF_HARDWARE_H +#endif + +#include + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/hardware/simd.h b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd.h new file mode 100644 index 0000000000000000000000000000000000000000..30489d22b949694431e2e33ca99991ac3d779d98 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd.h @@ -0,0 +1,119 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#include +#include +#include +#include + +#ifndef MSGPACK_PREDEF_HARDWARE_SIMD_H +#define MSGPACK_PREDEF_HARDWARE_SIMD_H + +#include + +/*` + [section Using the `MSGPACK_HW_SIMD_*` predefs] + [include ../doc/hardware_simd.qbk] + [endsect] + + [/ --------------------------- ] + + [section `MSGPACK_HW_SIMD_*`] + + [heading `MSGPACK_HW_SIMD`] + + The SIMD extension detected for a specific architectures. + Version number depends on the detected extension. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`MSGPACK_HW_SIMD_X86_AVAILABLE`] [__predef_detection__]] + [[`MSGPACK_HW_SIMD_X86_AMD_AVAILABLE`] [__predef_detection__]] + [[`MSGPACK_HW_SIMD_ARM_AVAILABLE`] [__predef_detection__]] + [[`MSGPACK_HW_SIMD_PPC_AVAILABLE`] [__predef_detection__]] + ] + + [include ../include/msgpack/predef/hardware/simd/x86.h] + [include ../include/msgpack/predef/hardware/simd/x86_amd.h] + [include ../include/msgpack/predef/hardware/simd/arm.h] + [include ../include/msgpack/predef/hardware/simd/ppc.h] + + [endsect] + + [/ --------------------------- ] + + [section `MSGPACK_HW_SIMD_X86_*_VERSION`] + [include ../include/msgpack/predef/hardware/simd/x86/versions.h] + [endsect] + + [section `MSGPACK_HW_SIMD_X86_AMD_*_VERSION`] + [include ../include/msgpack/predef/hardware/simd/x86_amd/versions.h] + [endsect] + + [section `MSGPACK_HW_SIMD_ARM_*_VERSION`] + [include ../include/msgpack/predef/hardware/simd/arm/versions.h] + [endsect] + + [section `MSGPACK_HW_SIMD_PPC_*_VERSION`] + [include ../include/msgpack/predef/hardware/simd/ppc/versions.h] + [endsect] + + */ + +// We check if SIMD extension of multiples architectures have been detected, +// if yes, then this is an error! +// +// NOTE: _X86_AMD implies _X86, so there is no need to check for it here! +// +#if defined(MSGPACK_HW_SIMD_ARM_AVAILABLE) && defined(MSGPACK_HW_SIMD_PPC_AVAILABLE) ||\ + defined(MSGPACK_HW_SIMD_ARM_AVAILABLE) && defined(MSGPACK_HW_SIMD_X86_AVAILABLE) ||\ + defined(MSGPACK_HW_SIMD_PPC_AVAILABLE) && defined(MSGPACK_HW_SIMD_X86_AVAILABLE) +# error "Multiple SIMD architectures detected, this cannot happen!" +#endif + +#if defined(MSGPACK_HW_SIMD_X86_AVAILABLE) && defined(MSGPACK_HW_SIMD_X86_AMD_AVAILABLE) + // If both standard _X86 and _X86_AMD are available, + // then take the biggest version of the two! +# if MSGPACK_HW_SIMD_X86 >= MSGPACK_HW_SIMD_X86_AMD +# define MSGPACK_HW_SIMD MSGPACK_HW_SIMD_X86 +# else +# define MSGPACK_HW_SIMD MSGPACK_HW_SIMD_X86_AMD +# endif +#endif + +#if !defined(MSGPACK_HW_SIMD) + // At this point, only one of these two is defined +# if defined(MSGPACK_HW_SIMD_X86_AVAILABLE) +# define MSGPACK_HW_SIMD MSGPACK_HW_SIMD_X86 +# endif +# if defined(MSGPACK_HW_SIMD_X86_AMD_AVAILABLE) +# define MSGPACK_HW_SIMD MSGPACK_HW_SIMD_X86_AMD +# endif +#endif + +#if defined(MSGPACK_HW_SIMD_ARM_AVAILABLE) +# define MSGPACK_HW_SIMD MSGPACK_HW_SIMD_ARM +#endif + +#if defined(MSGPACK_HW_SIMD_PPC_AVAILABLE) +# define MSGPACK_HW_SIMD MSGPACK_HW_SIMD_PPC +#endif + +#if defined(MSGPACK_HW_SIMD) +# define MSGPACK_HW_SIMD_AVAILABLE +#else +# define MSGPACK_HW_SIMD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#endif + +#define MSGPACK_HW_SIMD_NAME "Hardware SIMD" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_HW_SIMD, MSGPACK_HW_SIMD_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/arm.h b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/arm.h new file mode 100644 index 0000000000000000000000000000000000000000..50a38299a90378db16c86f4c43e33814e322d0fb --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/arm.h @@ -0,0 +1,59 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_HARDWARE_SIMD_ARM_H +#define MSGPACK_PREDEF_HARDWARE_SIMD_ARM_H + +#include +#include + +/*` + [heading `MSGPACK_HW_SIMD_ARM`] + + The SIMD extension for ARM (*if detected*). + Version number depends on the most recent detected extension. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__ARM_NEON__`] [__predef_detection__]] + [[`__aarch64__`] [__predef_detection__]] + [[`_M_ARM`] [__predef_detection__]] + [[`_M_ARM64`] [__predef_detection__]] + ] + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__ARM_NEON__`] [MSGPACK_HW_SIMD_ARM_NEON_VERSION]] + [[`__aarch64__`] [MSGPACK_HW_SIMD_ARM_NEON_VERSION]] + [[`_M_ARM`] [MSGPACK_HW_SIMD_ARM_NEON_VERSION]] + [[`_M_ARM64`] [MSGPACK_HW_SIMD_ARM_NEON_VERSION]] + ] + + */ + +#define MSGPACK_HW_SIMD_ARM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#undef MSGPACK_HW_SIMD_ARM +#if !defined(MSGPACK_HW_SIMD_ARM) && (defined(__ARM_NEON__) || defined(__aarch64__) || defined (_M_ARM) || defined (_M_ARM64)) +# define MSGPACK_HW_SIMD_ARM MSGPACK_HW_SIMD_ARM_NEON_VERSION +#endif + +#if !defined(MSGPACK_HW_SIMD_ARM) +# define MSGPACK_HW_SIMD_ARM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#else +# define MSGPACK_HW_SIMD_ARM_AVAILABLE +#endif + +#define MSGPACK_HW_SIMD_ARM_NAME "ARM SIMD" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_HW_SIMD_ARM, MSGPACK_HW_SIMD_ARM_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/arm/versions.h b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/arm/versions.h new file mode 100644 index 0000000000000000000000000000000000000000..6df71bd01011a8ad3636bf1bb38c4b9e7462adbe --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/arm/versions.h @@ -0,0 +1,32 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_HARDWARE_SIMD_ARM_VERSIONS_H +#define MSGPACK_PREDEF_HARDWARE_SIMD_ARM_VERSIONS_H + +#include + +/*` + Those defines represent ARM SIMD extensions versions. + + [note You *MUST* compare them with the predef `MSGPACK_HW_SIMD_ARM`.] + */ + +// --------------------------------- + +/*` + [heading `MSGPACK_HW_SIMD_ARM_NEON_VERSION`] + + The [@https://en.wikipedia.org/wiki/ARM_architecture#Advanced_SIMD_.28NEON.29 NEON] + ARM extension version number. + + Version number is: *1.0.0*. + */ +#define MSGPACK_HW_SIMD_ARM_NEON_VERSION MSGPACK_VERSION_NUMBER(1, 0, 0) + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/ppc.h b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/ppc.h new file mode 100644 index 0000000000000000000000000000000000000000..708cbbaffa8aabf04ac217b86c52e53f5329f372 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/ppc.h @@ -0,0 +1,69 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_HARDWARE_SIMD_PPC_H +#define MSGPACK_PREDEF_HARDWARE_SIMD_PPC_H + +#include +#include + +/*` + [heading `MSGPACK_HW_SIMD_PPC`] + + The SIMD extension for PowerPC (*if detected*). + Version number depends on the most recent detected extension. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__VECTOR4DOUBLE__`] [__predef_detection__]] + + [[`__ALTIVEC__`] [__predef_detection__]] + [[`__VEC__`] [__predef_detection__]] + + [[`__VSX__`] [__predef_detection__]] + ] + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__VECTOR4DOUBLE__`] [MSGPACK_HW_SIMD_PPC_QPX_VERSION]] + + [[`__ALTIVEC__`] [MSGPACK_HW_SIMD_PPC_VMX_VERSION]] + [[`__VEC__`] [MSGPACK_HW_SIMD_PPC_VMX_VERSION]] + + [[`__VSX__`] [MSGPACK_HW_SIMD_PPC_VSX_VERSION]] + ] + + */ + +#define MSGPACK_HW_SIMD_PPC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#undef MSGPACK_HW_SIMD_PPC +#if !defined(MSGPACK_HW_SIMD_PPC) && defined(__VECTOR4DOUBLE__) +# define MSGPACK_HW_SIMD_PPC MSGPACK_HW_SIMD_PPC_QPX_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_PPC) && defined(__VSX__) +# define MSGPACK_HW_SIMD_PPC MSGPACK_HW_SIMD_PPC_VSX_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_PPC) && (defined(__ALTIVEC__) || defined(__VEC__)) +# define MSGPACK_HW_SIMD_PPC MSGPACK_HW_SIMD_PPC_VMX_VERSION +#endif + +#if !defined(MSGPACK_HW_SIMD_PPC) +# define MSGPACK_HW_SIMD_PPC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#else +# define MSGPACK_HW_SIMD_PPC_AVAILABLE +#endif + +#define MSGPACK_HW_SIMD_PPC_NAME "PPC SIMD" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_HW_SIMD_PPC, MSGPACK_HW_SIMD_PPC_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/ppc/versions.h b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/ppc/versions.h new file mode 100644 index 0000000000000000000000000000000000000000..0ef40f9bcf95c9b55f414ac5602c623eb5de49e4 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/ppc/versions.h @@ -0,0 +1,51 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_HARDWARE_SIMD_PPC_VERSIONS_H +#define MSGPACK_PREDEF_HARDWARE_SIMD_PPC_VERSIONS_H + +#include + +/*` + Those defines represent Power PC SIMD extensions versions. + + [note You *MUST* compare them with the predef `MSGPACK_HW_SIMD_PPC`.] + */ + +// --------------------------------- + +/*` + [heading `MSGPACK_HW_SIMD_PPC_VMX_VERSION`] + + The [@https://en.wikipedia.org/wiki/AltiVec#VMX128 VMX] powerpc extension + version number. + + Version number is: *1.0.0*. + */ +#define MSGPACK_HW_SIMD_PPC_VMX_VERSION MSGPACK_VERSION_NUMBER(1, 0, 0) + +/*` + [heading `MSGPACK_HW_SIMD_PPC_VSX_VERSION`] + + The [@https://en.wikipedia.org/wiki/AltiVec#VSX VSX] powerpc extension version + number. + + Version number is: *1.1.0*. + */ +#define MSGPACK_HW_SIMD_PPC_VSX_VERSION MSGPACK_VERSION_NUMBER(1, 1, 0) + +/*` + [heading `MSGPACK_HW_SIMD_PPC_QPX_VERSION`] + + The QPX powerpc extension version number. + + Version number is: *2.0.0*. + */ +#define MSGPACK_HW_SIMD_PPC_QPX_VERSION MSGPACK_VERSION_NUMBER(2, 0, 0) + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/x86.h b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/x86.h new file mode 100644 index 0000000000000000000000000000000000000000..a3e56168c30c0385a1a210b173600925501ca224 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/x86.h @@ -0,0 +1,123 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_HARDWARE_SIMD_X86_H +#define MSGPACK_PREDEF_HARDWARE_SIMD_X86_H + +#include +#include + +/*` + [heading `MSGPACK_HW_SIMD_X86`] + + The SIMD extension for x86 (*if detected*). + Version number depends on the most recent detected extension. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSE__`] [__predef_detection__]] + [[`_M_X64`] [__predef_detection__]] + [[`_M_IX86_FP >= 1`] [__predef_detection__]] + + [[`__SSE2__`] [__predef_detection__]] + [[`_M_X64`] [__predef_detection__]] + [[`_M_IX86_FP >= 2`] [__predef_detection__]] + + [[`__SSE3__`] [__predef_detection__]] + + [[`__SSSE3__`] [__predef_detection__]] + + [[`__SSE4_1__`] [__predef_detection__]] + + [[`__SSE4_2__`] [__predef_detection__]] + + [[`__AVX__`] [__predef_detection__]] + + [[`__FMA__`] [__predef_detection__]] + + [[`__AVX2__`] [__predef_detection__]] + ] + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSE__`] [MSGPACK_HW_SIMD_X86_SSE_VERSION]] + [[`_M_X64`] [MSGPACK_HW_SIMD_X86_SSE_VERSION]] + [[`_M_IX86_FP >= 1`] [MSGPACK_HW_SIMD_X86_SSE_VERSION]] + + [[`__SSE2__`] [MSGPACK_HW_SIMD_X86_SSE2_VERSION]] + [[`_M_X64`] [MSGPACK_HW_SIMD_X86_SSE2_VERSION]] + [[`_M_IX86_FP >= 2`] [MSGPACK_HW_SIMD_X86_SSE2_VERSION]] + + [[`__SSE3__`] [MSGPACK_HW_SIMD_X86_SSE3_VERSION]] + + [[`__SSSE3__`] [MSGPACK_HW_SIMD_X86_SSSE3_VERSION]] + + [[`__SSE4_1__`] [MSGPACK_HW_SIMD_X86_SSE4_1_VERSION]] + + [[`__SSE4_2__`] [MSGPACK_HW_SIMD_X86_SSE4_2_VERSION]] + + [[`__AVX__`] [MSGPACK_HW_SIMD_X86_AVX_VERSION]] + + [[`__FMA__`] [MSGPACK_HW_SIMD_X86_FMA3_VERSION]] + + [[`__AVX2__`] [MSGPACK_HW_SIMD_X86_AVX2_VERSION]] + ] + + */ + +#define MSGPACK_HW_SIMD_X86 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#undef MSGPACK_HW_SIMD_X86 +#if !defined(MSGPACK_HW_SIMD_X86) && defined(__MIC__) +# define MSGPACK_HW_SIMD_X86 MSGPACK_HW_SIMD_X86_MIC_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_X86) && defined(__AVX2__) +# define MSGPACK_HW_SIMD_X86 MSGPACK_HW_SIMD_X86_AVX2_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_X86) && defined(__AVX__) +# define MSGPACK_HW_SIMD_X86 MSGPACK_HW_SIMD_X86_AVX_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_X86) && defined(__FMA__) +# define MSGPACK_HW_SIMD_X86 MSGPACK_HW_SIMD_X86_FMA_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_X86) && defined(__SSE4_2__) +# define MSGPACK_HW_SIMD_X86 MSGPACK_HW_SIMD_X86_SSE4_2_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_X86) && defined(__SSE4_1__) +# define MSGPACK_HW_SIMD_X86 MSGPACK_HW_SIMD_X86_SSE4_1_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_X86) && defined(__SSSE3__) +# define MSGPACK_HW_SIMD_X86 MSGPACK_HW_SIMD_X86_SSSE3_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_X86) && defined(__SSE3__) +# define MSGPACK_HW_SIMD_X86 MSGPACK_HW_SIMD_X86_SSE3_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_X86) && (defined(__SSE2__) || defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2)) +# define MSGPACK_HW_SIMD_X86 MSGPACK_HW_SIMD_X86_SSE2_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_X86) && (defined(__SSE__) || defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 1)) +# define MSGPACK_HW_SIMD_X86 MSGPACK_HW_SIMD_X86_SSE_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_X86) && defined(__MMX__) +# define MSGPACK_HW_SIMD_X86 MSGPACK_HW_SIMD_X86_MMX_VERSION +#endif + +#if !defined(MSGPACK_HW_SIMD_X86) +# define MSGPACK_HW_SIMD_X86 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#else +# define MSGPACK_HW_SIMD_X86_AVAILABLE +#endif + +#define MSGPACK_HW_SIMD_X86_NAME "x86 SIMD" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_HW_SIMD_X86, MSGPACK_HW_SIMD_X86_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/x86/versions.h b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/x86/versions.h new file mode 100644 index 0000000000000000000000000000000000000000..a9f965071af6153b00954594ea7659c5708e04cc --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/x86/versions.h @@ -0,0 +1,129 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_HARDWARE_SIMD_X86_VERSIONS_H +#define MSGPACK_PREDEF_HARDWARE_SIMD_X86_VERSIONS_H + +#include + +/*` + Those defines represent x86 SIMD extensions versions. + + [note You *MUST* compare them with the predef `MSGPACK_HW_SIMD_X86`.] + */ + +// --------------------------------- + +/*` + [heading `MSGPACK_HW_SIMD_X86_MMX_VERSION`] + + The [@https://en.wikipedia.org/wiki/MMX_(instruction_set) MMX] x86 extension + version number. + + Version number is: *0.99.0*. + */ +#define MSGPACK_HW_SIMD_X86_MMX_VERSION MSGPACK_VERSION_NUMBER(0, 99, 0) + +/*` + [heading `MSGPACK_HW_SIMD_X86_SSE_VERSION`] + + The [@https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions SSE] x86 extension + version number. + + Version number is: *1.0.0*. + */ +#define MSGPACK_HW_SIMD_X86_SSE_VERSION MSGPACK_VERSION_NUMBER(1, 0, 0) + +/*` + [heading `MSGPACK_HW_SIMD_X86_SSE2_VERSION`] + + The [@https://en.wikipedia.org/wiki/SSE2 SSE2] x86 extension version number. + + Version number is: *2.0.0*. + */ +#define MSGPACK_HW_SIMD_X86_SSE2_VERSION MSGPACK_VERSION_NUMBER(2, 0, 0) + +/*` + [heading `MSGPACK_HW_SIMD_X86_SSE3_VERSION`] + + The [@https://en.wikipedia.org/wiki/SSE3 SSE3] x86 extension version number. + + Version number is: *3.0.0*. + */ +#define MSGPACK_HW_SIMD_X86_SSE3_VERSION MSGPACK_VERSION_NUMBER(3, 0, 0) + +/*` + [heading `MSGPACK_HW_SIMD_X86_SSSE3_VERSION`] + + The [@https://en.wikipedia.org/wiki/SSSE3 SSSE3] x86 extension version number. + + Version number is: *3.1.0*. + */ +#define MSGPACK_HW_SIMD_X86_SSSE3_VERSION MSGPACK_VERSION_NUMBER(3, 1, 0) + +/*` + [heading `MSGPACK_HW_SIMD_X86_SSE4_1_VERSION`] + + The [@https://en.wikipedia.org/wiki/SSE4#SSE4.1 SSE4_1] x86 extension version + number. + + Version number is: *4.1.0*. + */ +#define MSGPACK_HW_SIMD_X86_SSE4_1_VERSION MSGPACK_VERSION_NUMBER(4, 1, 0) + +/*` + [heading `MSGPACK_HW_SIMD_X86_SSE4_2_VERSION`] + + The [@https://en.wikipedia.org/wiki/SSE4##SSE4.2 SSE4_2] x86 extension version + number. + + Version number is: *4.2.0*. + */ +#define MSGPACK_HW_SIMD_X86_SSE4_2_VERSION MSGPACK_VERSION_NUMBER(4, 2, 0) + +/*` + [heading `MSGPACK_HW_SIMD_X86_AVX_VERSION`] + + The [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions AVX] x86 + extension version number. + + Version number is: *5.0.0*. + */ +#define MSGPACK_HW_SIMD_X86_AVX_VERSION MSGPACK_VERSION_NUMBER(5, 0, 0) + +/*` + [heading `MSGPACK_HW_SIMD_X86_FMA3_VERSION`] + + The [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA3] x86 extension + version number. + + Version number is: *5.2.0*. + */ +#define MSGPACK_HW_SIMD_X86_FMA3_VERSION MSGPACK_VERSION_NUMBER(5, 2, 0) + +/*` + [heading `MSGPACK_HW_SIMD_X86_AVX2_VERSION`] + + The [@https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2 AVX2] + x86 extension version number. + + Version number is: *5.3.0*. + */ +#define MSGPACK_HW_SIMD_X86_AVX2_VERSION MSGPACK_VERSION_NUMBER(5, 3, 0) + +/*` + [heading `MSGPACK_HW_SIMD_X86_MIC_VERSION`] + + The [@https://en.wikipedia.org/wiki/Xeon_Phi MIC] (Xeon Phi) x86 extension + version number. + + Version number is: *9.0.0*. + */ +#define MSGPACK_HW_SIMD_X86_MIC_VERSION MSGPACK_VERSION_NUMBER(9, 0, 0) + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/x86_amd.h b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/x86_amd.h new file mode 100644 index 0000000000000000000000000000000000000000..6ea56714ea49be2d3c16ff35ea754dc4521c3b60 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/x86_amd.h @@ -0,0 +1,87 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_HARDWARE_SIMD_X86_AMD_H +#define MSGPACK_PREDEF_HARDWARE_SIMD_X86_AMD_H + +#include +#include + +/*` + [heading `MSGPACK_HW_SIMD_X86_AMD`] + + The SIMD extension for x86 (AMD) (*if detected*). + Version number depends on the most recent detected extension. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSE4A__`] [__predef_detection__]] + + [[`__FMA4__`] [__predef_detection__]] + + [[`__XOP__`] [__predef_detection__]] + + [[`MSGPACK_HW_SIMD_X86`] [__predef_detection__]] + ] + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__SSE4A__`] [MSGPACK_HW_SIMD_X86_SSE4A_VERSION]] + + [[`__FMA4__`] [MSGPACK_HW_SIMD_X86_FMA4_VERSION]] + + [[`__XOP__`] [MSGPACK_HW_SIMD_X86_XOP_VERSION]] + + [[`MSGPACK_HW_SIMD_X86`] [MSGPACK_HW_SIMD_X86]] + ] + + [note This predef includes every other x86 SIMD extensions and also has other + more specific extensions (FMA4, XOP, SSE4a). You should use this predef + instead of `MSGPACK_HW_SIMD_X86` to test if those specific extensions have + been detected.] + + */ + +#define MSGPACK_HW_SIMD_X86_AMD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +// AMD CPUs also use x86 architecture. We first try to detect if any AMD +// specific extension are detected, if yes, then try to detect more recent x86 +// common extensions. + +#undef MSGPACK_HW_SIMD_X86_AMD +#if !defined(MSGPACK_HW_SIMD_X86_AMD) && defined(__XOP__) +# define MSGPACK_HW_SIMD_X86_AMD MSGPACK_HW_SIMD_X86_AMD_XOP_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_X86_AMD) && defined(__FMA4__) +# define MSGPACK_HW_SIMD_X86_AMD MSGPACK_HW_SIMD_X86_AMD_FMA4_VERSION +#endif +#if !defined(MSGPACK_HW_SIMD_X86_AMD) && defined(__SSE4A__) +# define MSGPACK_HW_SIMD_X86_AMD MSGPACK_HW_SIMD_X86_AMD_SSE4A_VERSION +#endif + +#if !defined(MSGPACK_HW_SIMD_X86_AMD) +# define MSGPACK_HW_SIMD_X86_AMD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#else + // At this point, we know that we have an AMD CPU, we do need to check for + // other x86 extensions to determine the final version number. +# include +# if MSGPACK_HW_SIMD_X86 > MSGPACK_HW_SIMD_X86_AMD +# undef MSGPACK_HW_SIMD_X86_AMD +# define MSGPACK_HW_SIMD_X86_AMD MSGPACK_HW_SIMD_X86 +# endif +# define MSGPACK_HW_SIMD_X86_AMD_AVAILABLE +#endif + +#define MSGPACK_HW_SIMD_X86_AMD_NAME "x86 (AMD) SIMD" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_HW_SIMD_X86_AMD, MSGPACK_HW_SIMD_X86_AMD_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/x86_amd/versions.h b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/x86_amd/versions.h new file mode 100644 index 0000000000000000000000000000000000000000..4d33db56b1ffb7a599c586a37e340d050ee16f1c --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/hardware/simd/x86_amd/versions.h @@ -0,0 +1,51 @@ +/* +Copyright Charly Chevalier 2015 +Copyright Joel Falcou 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_HARDWARE_SIMD_X86_AMD_VERSIONS_H +#define MSGPACK_PREDEF_HARDWARE_SIMD_X86_AMD_VERSIONS_H + +#include + +/*` + Those defines represent x86 (AMD specific) SIMD extensions versions. + + [note You *MUST* compare them with the predef `MSGPACK_HW_SIMD_X86_AMD`.] + */ + + +// --------------------------------- + +/*` + [heading `MSGPACK_HW_SIMD_X86_AMD_SSE4A_VERSION`] + + [@https://en.wikipedia.org/wiki/SSE4##SSE4A SSE4A] x86 extension (AMD specific). + + Version number is: *4.0.0*. + */ +#define MSGPACK_HW_SIMD_X86_AMD_SSE4A_VERSION MSGPACK_VERSION_NUMBER(4, 0, 0) + +/*` + [heading `MSGPACK_HW_SIMD_X86_AMD_FMA4_VERSION`] + + [@https://en.wikipedia.org/wiki/FMA_instruction_set#FMA4_instruction_set FMA4] x86 extension (AMD specific). + + Version number is: *5.1.0*. + */ +#define MSGPACK_HW_SIMD_X86_AMD_FMA4_VERSION MSGPACK_VERSION_NUMBER(5, 1, 0) + +/*` + [heading `MSGPACK_HW_SIMD_X86_AMD_XOP_VERSION`] + + [@https://en.wikipedia.org/wiki/XOP_instruction_set XOP] x86 extension (AMD specific). + + Version number is: *5.1.1*. + */ +#define MSGPACK_HW_SIMD_X86_AMD_XOP_VERSION MSGPACK_VERSION_NUMBER(5, 1, 1) + + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/language.h b/msgpackc/3.2.1/include/msgpack/predef/language.h new file mode 100644 index 0000000000000000000000000000000000000000..83ea35316a63c15bc8ef5313fe3db5f1dfc99551 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/language.h @@ -0,0 +1,18 @@ +/* +Copyright Rene Rivera 2011-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#if !defined(MSGPACK_PREDEF_LANGUAGE_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS) +#ifndef MSGPACK_PREDEF_LANGUAGE_H +#define MSGPACK_PREDEF_LANGUAGE_H +#endif + +#include +#include +#include +#include + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/language/cuda.h b/msgpackc/3.2.1/include/msgpack/predef/language/cuda.h new file mode 100644 index 0000000000000000000000000000000000000000..c7f4ccdae58223cbc721c6a3f43e2dc37c040a72 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/language/cuda.h @@ -0,0 +1,52 @@ +/* +Copyright Benjamin Worpitz 2018 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LANGUAGE_CUDA_H +#define MSGPACK_PREDEF_LANGUAGE_CUDA_H + +#include +#include + +/*` +[heading `MSGPACK_LANG_CUDA`] + +[@https://en.wikipedia.org/wiki/CUDA CUDA C/C++] language. +If available, the version is detected as VV.RR.P. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__CUDACC__`] [__predef_detection__]] + [[`__CUDA__`] [__predef_detection__]] + + [[`CUDA_VERSION`] [VV.RR.P]] + ] + */ + +#define MSGPACK_LANG_CUDA MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__CUDACC__) || defined(__CUDA__) +# undef MSGPACK_LANG_CUDA +# include +# if defined(CUDA_VERSION) +# define MSGPACK_LANG_CUDA MSGPACK_PREDEF_MAKE_10_VVRRP(CUDA_VERSION) +# else +# define MSGPACK_LANG_CUDA MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_LANG_CUDA +# define MSGPACK_LANG_CUDA_AVAILABLE +#endif + +#define MSGPACK_LANG_CUDA_NAME "CUDA C/C++" + + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LANG_CUDA,MSGPACK_LANG_CUDA_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/language/objc.h b/msgpackc/3.2.1/include/msgpack/predef/language/objc.h new file mode 100644 index 0000000000000000000000000000000000000000..ee201debf46fcc5acb813843b3d43ebf6b5652af --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/language/objc.h @@ -0,0 +1,42 @@ +/* +Copyright Rene Rivera 2011-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LANGUAGE_OBJC_H +#define MSGPACK_PREDEF_LANGUAGE_OBJC_H + +#include +#include + +/*` +[heading `MSGPACK_LANG_OBJC`] + +[@http://en.wikipedia.org/wiki/Objective-C Objective-C] language. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__OBJC__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_LANG_OBJC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__OBJC__) +# undef MSGPACK_LANG_OBJC +# define MSGPACK_LANG_OBJC MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_LANG_OBJC +# define MSGPACK_LANG_OBJC_AVAILABLE +#endif + +#define MSGPACK_LANG_OBJC_NAME "Objective-C" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LANG_OBJC,MSGPACK_LANG_OBJC_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/language/stdc.h b/msgpackc/3.2.1/include/msgpack/predef/language/stdc.h new file mode 100644 index 0000000000000000000000000000000000000000..5c91650546864a81f4da2d907a0fb9095a07ffcc --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/language/stdc.h @@ -0,0 +1,53 @@ +/* +Copyright Rene Rivera 2011-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LANGUAGE_STDC_H +#define MSGPACK_PREDEF_LANGUAGE_STDC_H + +#include +#include + +/*` +[heading `MSGPACK_LANG_STDC`] + +[@http://en.wikipedia.org/wiki/C_(programming_language) Standard C] language. +If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__STDC__`] [__predef_detection__]] + + [[`__STDC_VERSION__`] [V.R.P]] + ] + */ + +#define MSGPACK_LANG_STDC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__STDC__) +# undef MSGPACK_LANG_STDC +# if defined(__STDC_VERSION__) +# if (__STDC_VERSION__ > 100) +# define MSGPACK_LANG_STDC MSGPACK_PREDEF_MAKE_YYYYMM(__STDC_VERSION__) +# else +# define MSGPACK_LANG_STDC MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +# else +# define MSGPACK_LANG_STDC MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_LANG_STDC +# define MSGPACK_LANG_STDC_AVAILABLE +#endif + +#define MSGPACK_LANG_STDC_NAME "Standard C" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LANG_STDC,MSGPACK_LANG_STDC_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/language/stdcpp.h b/msgpackc/3.2.1/include/msgpack/predef/language/stdcpp.h new file mode 100644 index 0000000000000000000000000000000000000000..07f1024d36c7948fd6dcff880f05c03c9feedcba --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/language/stdcpp.h @@ -0,0 +1,121 @@ +/* +Copyright Rene Rivera 2011-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LANGUAGE_STDCPP_H +#define MSGPACK_PREDEF_LANGUAGE_STDCPP_H + +#include +#include + +/*` +[heading `MSGPACK_LANG_STDCPP`] + +[@http://en.wikipedia.org/wiki/C%2B%2B Standard C++] language. +If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date. +Because of the way the C++ standardization process works the +defined version year will not be the commonly known year of the standard. +Specifically the defined versions are: + +[table Detected Version Number vs. C++ Standard Year + [[Detected Version Number] [Standard Year] [C++ Standard]] + [[27.11.1] [1998] [ISO/IEC 14882:1998]] + [[41.12.1] [2011] [ISO/IEC 14882:2011]] +] + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__cplusplus`] [__predef_detection__]] + + [[`__cplusplus`] [YYYY.MM.1]] + ] + */ + +#define MSGPACK_LANG_STDCPP MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__cplusplus) +# undef MSGPACK_LANG_STDCPP +# if (__cplusplus > 100) +# define MSGPACK_LANG_STDCPP MSGPACK_PREDEF_MAKE_YYYYMM(__cplusplus) +# else +# define MSGPACK_LANG_STDCPP MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_LANG_STDCPP +# define MSGPACK_LANG_STDCPP_AVAILABLE +#endif + +#define MSGPACK_LANG_STDCPP_NAME "Standard C++" + +/*` +[heading `MSGPACK_LANG_STDCPPCLI`] + +[@http://en.wikipedia.org/wiki/C%2B%2B/CLI Standard C++/CLI] language. +If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__cplusplus_cli`] [__predef_detection__]] + + [[`__cplusplus_cli`] [YYYY.MM.1]] + ] + */ + +#define MSGPACK_LANG_STDCPPCLI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__cplusplus_cli) +# undef MSGPACK_LANG_STDCPPCLI +# if (__cplusplus_cli > 100) +# define MSGPACK_LANG_STDCPPCLI MSGPACK_PREDEF_MAKE_YYYYMM(__cplusplus_cli) +# else +# define MSGPACK_LANG_STDCPPCLI MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_LANG_STDCPPCLI +# define MSGPACK_LANG_STDCPPCLI_AVAILABLE +#endif + +#define MSGPACK_LANG_STDCPPCLI_NAME "Standard C++/CLI" + +/*` +[heading `MSGPACK_LANG_STDECPP`] + +[@http://en.wikipedia.org/wiki/Embedded_C%2B%2B Standard Embedded C++] language. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__embedded_cplusplus`] [__predef_detection__]] + ] + */ + +#define MSGPACK_LANG_STDECPP MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__embedded_cplusplus) +# undef MSGPACK_LANG_STDECPP +# define MSGPACK_LANG_STDECPP MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_LANG_STDECPP +# define MSGPACK_LANG_STDECPP_AVAILABLE +#endif + +#define MSGPACK_LANG_STDECPP_NAME "Standard Embedded C++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LANG_STDCPP,MSGPACK_LANG_STDCPP_NAME) + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LANG_STDCPPCLI,MSGPACK_LANG_STDCPPCLI_NAME) + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LANG_STDECPP,MSGPACK_LANG_STDECPP_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library.h b/msgpackc/3.2.1/include/msgpack/predef/library.h new file mode 100644 index 0000000000000000000000000000000000000000..3c96c4b979e50054c374ceaf3cbb670f6b80f2b1 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library.h @@ -0,0 +1,16 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#if !defined(MSGPACK_PREDEF_LIBRARY_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS) +#ifndef MSGPACK_PREDEF_LIBRARY_H +#define MSGPACK_PREDEF_LIBRARY_H +#endif + +#include +#include + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/c.h b/msgpackc/3.2.1/include/msgpack/predef/library/c.h new file mode 100644 index 0000000000000000000000000000000000000000..33e710e1f76fa98eb98eae9fe9691c550c276291 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/c.h @@ -0,0 +1,21 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#if !defined(MSGPACK_PREDEF_LIBRARY_C_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS) +#ifndef MSGPACK_PREDEF_LIBRARY_C_H +#define MSGPACK_PREDEF_LIBRARY_C_H +#endif + +#include + +#include +#include +#include +#include +#include + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/c/_prefix.h b/msgpackc/3.2.1/include/msgpack/predef/library/c/_prefix.h new file mode 100644 index 0000000000000000000000000000000000000000..d16c373bcc1657ec7348c52eb5976d53e9377432 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/c/_prefix.h @@ -0,0 +1,13 @@ +/* +Copyright Rene Rivera 2008-2013 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_C__PREFIX_H +#define MSGPACK_PREDEF_LIBRARY_C__PREFIX_H + +#include + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/c/cloudabi.h b/msgpackc/3.2.1/include/msgpack/predef/library/c/cloudabi.h new file mode 100644 index 0000000000000000000000000000000000000000..2488cf40c8db36161abb2e8f9ca6228db2ac7025 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/c/cloudabi.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2017 James E. King III + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ + +#ifndef MSGPACK_PREDEF_LIBRARY_C_CLOUDABI_H +#define MSGPACK_PREDEF_LIBRARY_C_CLOUDABI_H + +#include +#include + +#include + +#if defined(__CloudABI__) +#include +#endif + +/*` +[heading `MSGPACK_LIB_C_CLOUDABI`] + +[@https://github.com/NuxiNL/cloudlibc cloudlibc] - CloudABI's standard C library. +Version number available as major, and minor. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__cloudlibc__`] [__predef_detection__]] + + [[`__cloudlibc_major__`, `__cloudlibc_minor__`] [V.R.0]] + ] + */ + +#define MSGPACK_LIB_C_CLOUDABI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__cloudlibc__) +# undef MSGPACK_LIB_C_CLOUDABI +# define MSGPACK_LIB_C_CLOUDABI \ + MSGPACK_VERSION_NUMBER(__cloudlibc_major__,__cloudlibc_minor__,0) +#endif + +#if MSGPACK_LIB_C_CLOUDABI +# define MSGPACK_LIB_C_CLOUDABI_AVAILABLE +#endif + +#define MSGPACK_LIB_C_CLOUDABI_NAME "cloudlibc" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_C_CLOUDABI,MSGPACK_LIB_C_CLOUDABI_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/c/gnu.h b/msgpackc/3.2.1/include/msgpack/predef/library/c/gnu.h new file mode 100644 index 0000000000000000000000000000000000000000..0d890320516911c4f0e479c39600eb36b1d0dacf --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/c/gnu.h @@ -0,0 +1,61 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_C_GNU_H +#define MSGPACK_PREDEF_LIBRARY_C_GNU_H + +#include +#include + +#include + +#if defined(__STDC__) +#include +#elif defined(__cplusplus) +#include +#endif + +/*` +[heading `MSGPACK_LIB_C_GNU`] + +[@http://en.wikipedia.org/wiki/Glibc GNU glibc] Standard C library. +Version number available as major, and minor. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__GLIBC__`] [__predef_detection__]] + [[`__GNU_LIBRARY__`] [__predef_detection__]] + + [[`__GLIBC__`, `__GLIBC_MINOR__`] [V.R.0]] + [[`__GNU_LIBRARY__`, `__GNU_LIBRARY_MINOR__`] [V.R.0]] + ] + */ + +#define MSGPACK_LIB_C_GNU MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__GLIBC__) || defined(__GNU_LIBRARY__) +# undef MSGPACK_LIB_C_GNU +# if defined(__GLIBC__) +# define MSGPACK_LIB_C_GNU \ + MSGPACK_VERSION_NUMBER(__GLIBC__,__GLIBC_MINOR__,0) +# else +# define MSGPACK_LIB_C_GNU \ + MSGPACK_VERSION_NUMBER(__GNU_LIBRARY__,__GNU_LIBRARY_MINOR__,0) +# endif +#endif + +#if MSGPACK_LIB_C_GNU +# define MSGPACK_LIB_C_GNU_AVAILABLE +#endif + +#define MSGPACK_LIB_C_GNU_NAME "GNU" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_C_GNU,MSGPACK_LIB_C_GNU_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/c/uc.h b/msgpackc/3.2.1/include/msgpack/predef/library/c/uc.h new file mode 100644 index 0000000000000000000000000000000000000000..39893d4d344b52912b7943930f9277e5e49d3281 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/c/uc.h @@ -0,0 +1,47 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_C_UC_H +#define MSGPACK_PREDEF_LIBRARY_C_UC_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_C_UC`] + +[@http://en.wikipedia.org/wiki/Uclibc uClibc] Standard C library. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__UCLIBC__`] [__predef_detection__]] + + [[`__UCLIBC_MAJOR__`, `__UCLIBC_MINOR__`, `__UCLIBC_SUBLEVEL__`] [V.R.P]] + ] + */ + +#define MSGPACK_LIB_C_UC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__UCLIBC__) +# undef MSGPACK_LIB_C_UC +# define MSGPACK_LIB_C_UC MSGPACK_VERSION_NUMBER(\ + __UCLIBC_MAJOR__,__UCLIBC_MINOR__,__UCLIBC_SUBLEVEL__) +#endif + +#if MSGPACK_LIB_C_UC +# define MSGPACK_LIB_C_UC_AVAILABLE +#endif + +#define MSGPACK_LIB_C_UC_NAME "uClibc" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_C_UC,MSGPACK_LIB_C_UC_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/c/vms.h b/msgpackc/3.2.1/include/msgpack/predef/library/c/vms.h new file mode 100644 index 0000000000000000000000000000000000000000..35253649ee2e293e3651ff4a13e32d0e9dd1e1c1 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/c/vms.h @@ -0,0 +1,47 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_C_VMS_H +#define MSGPACK_PREDEF_LIBRARY_C_VMS_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_C_VMS`] + +VMS libc Standard C library. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__CRTL_VER`] [__predef_detection__]] + + [[`__CRTL_VER`] [V.R.P]] + ] + */ + +#define MSGPACK_LIB_C_VMS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__CRTL_VER) +# undef MSGPACK_LIB_C_VMS +# define MSGPACK_LIB_C_VMS MSGPACK_PREDEF_MAKE_10_VVRR0PP00(__CRTL_VER) +#endif + +#if MSGPACK_LIB_C_VMS +# define MSGPACK_LIB_C_VMS_AVAILABLE +#endif + +#define MSGPACK_LIB_C_VMS_NAME "VMS" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_C_VMS,MSGPACK_LIB_C_VMS_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/c/zos.h b/msgpackc/3.2.1/include/msgpack/predef/library/c/zos.h new file mode 100644 index 0000000000000000000000000000000000000000..9bae6ef78aea53bf703118c9f0876999b87379fb --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/c/zos.h @@ -0,0 +1,56 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_C_ZOS_H +#define MSGPACK_PREDEF_LIBRARY_C_ZOS_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_C_ZOS`] + +z/OS libc Standard C library. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__LIBREL__`] [__predef_detection__]] + + [[`__LIBREL__`] [V.R.P]] + [[`__TARGET_LIB__`] [V.R.P]] + ] + */ + +#define MSGPACK_LIB_C_ZOS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__LIBREL__) +# undef MSGPACK_LIB_C_ZOS +# if !defined(MSGPACK_LIB_C_ZOS) && defined(__LIBREL__) +# define MSGPACK_LIB_C_ZOS MSGPACK_PREDEF_MAKE_0X_VRRPPPP(__LIBREL__) +# endif +# if !defined(MSGPACK_LIB_C_ZOS) && defined(__TARGET_LIB__) +# define MSGPACK_LIB_C_ZOS MSGPACK_PREDEF_MAKE_0X_VRRPPPP(__TARGET_LIB__) +# endif +# if !defined(MSGPACK_LIB_C_ZOS) +# define MSGPACK_LIB_C_ZOS MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_LIB_C_ZOS +# define MSGPACK_LIB_C_ZOS_AVAILABLE +#endif + +#define MSGPACK_LIB_C_ZOS_NAME "z/OS" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_C_ZOS,MSGPACK_LIB_C_ZOS_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/std.h b/msgpackc/3.2.1/include/msgpack/predef/library/std.h new file mode 100644 index 0000000000000000000000000000000000000000..14ff2bffa844641307e553074253ec0490e92a73 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/std.h @@ -0,0 +1,25 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#if !defined(MSGPACK_PREDEF_LIBRARY_STD_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS) +#ifndef MSGPACK_PREDEF_LIBRARY_STD_H +#define MSGPACK_PREDEF_LIBRARY_STD_H +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/std/_prefix.h b/msgpackc/3.2.1/include/msgpack/predef/library/std/_prefix.h new file mode 100644 index 0000000000000000000000000000000000000000..6f9f56649dd35d65ab51d96658c48635f464f002 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/std/_prefix.h @@ -0,0 +1,23 @@ +/* +Copyright Rene Rivera 2008-2013 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#ifndef MSGPACK_PREDEF_LIBRARY_STD__PREFIX_H +#define MSGPACK_PREDEF_LIBRARY_STD__PREFIX_H + +/* +We need to include an STD header to gives us the context +of which library we are using. The "smallest" code-wise header +seems to be . Boost uses but as far +as I can tell (RR) it's not a stand-alone header in most +implementations. Using also has the benefit of +being available in EC++, so we get a chance to make this work +for embedded users. And since it's not a header impacted by TR1 +there's no magic needed for inclusion in the face of the +Boost.TR1 library. +*/ +#include + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/std/cxx.h b/msgpackc/3.2.1/include/msgpack/predef/library/std/cxx.h new file mode 100644 index 0000000000000000000000000000000000000000..605184481ede68b9bc3f1e82330ee4f798a195a9 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/std/cxx.h @@ -0,0 +1,46 @@ +/* +Copyright Rene Rivera 2011-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_STD_CXX_H +#define MSGPACK_PREDEF_LIBRARY_STD_CXX_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_STD_CXX`] + +[@http://libcxx.llvm.org/ libc++] C++ Standard Library. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`_LIBCPP_VERSION`] [__predef_detection__]] + + [[`_LIBCPP_VERSION`] [V.0.P]] + ] + */ + +#define MSGPACK_LIB_STD_CXX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(_LIBCPP_VERSION) +# undef MSGPACK_LIB_STD_CXX +# define MSGPACK_LIB_STD_CXX MSGPACK_PREDEF_MAKE_10_VPPP(_LIBCPP_VERSION) +#endif + +#if MSGPACK_LIB_STD_CXX +# define MSGPACK_LIB_STD_CXX_AVAILABLE +#endif + +#define MSGPACK_LIB_STD_CXX_NAME "libc++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_CXX,MSGPACK_LIB_STD_CXX_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/std/dinkumware.h b/msgpackc/3.2.1/include/msgpack/predef/library/std/dinkumware.h new file mode 100644 index 0000000000000000000000000000000000000000..7e82bda1d6d9ee0f09f0aeff13f48c185f35c2b7 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/std/dinkumware.h @@ -0,0 +1,52 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_STD_DINKUMWARE_H +#define MSGPACK_PREDEF_LIBRARY_STD_DINKUMWARE_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_STD_DINKUMWARE`] + +[@http://en.wikipedia.org/wiki/Dinkumware Dinkumware] Standard C++ Library. +If available version number as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`_YVALS`, `__IBMCPP__`] [__predef_detection__]] + [[`_CPPLIB_VER`] [__predef_detection__]] + + [[`_CPPLIB_VER`] [V.R.0]] + ] + */ + +#define MSGPACK_LIB_STD_DINKUMWARE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) +# undef MSGPACK_LIB_STD_DINKUMWARE +# if defined(_CPPLIB_VER) +# define MSGPACK_LIB_STD_DINKUMWARE MSGPACK_PREDEF_MAKE_10_VVRR(_CPPLIB_VER) +# else +# define MSGPACK_LIB_STD_DINKUMWARE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_LIB_STD_DINKUMWARE +# define MSGPACK_LIB_STD_DINKUMWARE_AVAILABLE +#endif + +#define MSGPACK_LIB_STD_DINKUMWARE_NAME "Dinkumware" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_DINKUMWARE,MSGPACK_LIB_STD_DINKUMWARE_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/std/libcomo.h b/msgpackc/3.2.1/include/msgpack/predef/library/std/libcomo.h new file mode 100644 index 0000000000000000000000000000000000000000..54f58b5247cfae9e294faad50d65882d8ba500a8 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/std/libcomo.h @@ -0,0 +1,47 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_STD_LIBCOMO_H +#define MSGPACK_PREDEF_LIBRARY_STD_LIBCOMO_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_STD_COMO`] + +[@http://www.comeaucomputing.com/libcomo/ Comeau Computing] Standard C++ Library. +Version number available as major. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__LIBCOMO__`] [__predef_detection__]] + + [[`__LIBCOMO_VERSION__`] [V.0.0]] + ] + */ + +#define MSGPACK_LIB_STD_COMO MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__LIBCOMO__) +# undef MSGPACK_LIB_STD_COMO +# define MSGPACK_LIB_STD_COMO MSGPACK_VERSION_NUMBER(__LIBCOMO_VERSION__,0,0) +#endif + +#if MSGPACK_LIB_STD_COMO +# define MSGPACK_LIB_STD_COMO_AVAILABLE +#endif + +#define MSGPACK_LIB_STD_COMO_NAME "Comeau Computing" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_COMO,MSGPACK_LIB_STD_COMO_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/std/modena.h b/msgpackc/3.2.1/include/msgpack/predef/library/std/modena.h new file mode 100644 index 0000000000000000000000000000000000000000..a8f750178696b5f97c264411de2d2af939f2e3a2 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/std/modena.h @@ -0,0 +1,45 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_STD_MODENA_H +#define MSGPACK_PREDEF_LIBRARY_STD_MODENA_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_STD_MSIPL`] + +[@http://modena.us/ Modena Software Lib++] Standard C++ Library. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`MSIPL_COMPILE_H`] [__predef_detection__]] + [[`__MSIPL_COMPILE_H`] [__predef_detection__]] + ] + */ + +#define MSGPACK_LIB_STD_MSIPL MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(MSIPL_COMPILE_H) || defined(__MSIPL_COMPILE_H) +# undef MSGPACK_LIB_STD_MSIPL +# define MSGPACK_LIB_STD_MSIPL MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_LIB_STD_MSIPL +# define MSGPACK_LIB_STD_MSIPL_AVAILABLE +#endif + +#define MSGPACK_LIB_STD_MSIPL_NAME "Modena Software Lib++" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_MSIPL,MSGPACK_LIB_STD_MSIPL_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/std/msl.h b/msgpackc/3.2.1/include/msgpack/predef/library/std/msl.h new file mode 100644 index 0000000000000000000000000000000000000000..187a6e1d52ca023578e40ccf1c62e9376b0cec78 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/std/msl.h @@ -0,0 +1,53 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_STD_MSL_H +#define MSGPACK_PREDEF_LIBRARY_STD_MSL_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_STD_MSL`] + +[@http://www.freescale.com/ Metrowerks] Standard C++ Library. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MSL_CPP__`] [__predef_detection__]] + [[`__MSL__`] [__predef_detection__]] + + [[`__MSL_CPP__`] [V.R.P]] + [[`__MSL__`] [V.R.P]] + ] + */ + +#define MSGPACK_LIB_STD_MSL MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MSL_CPP__) || defined(__MSL__) +# undef MSGPACK_LIB_STD_MSL +# if defined(__MSL_CPP__) +# define MSGPACK_LIB_STD_MSL MSGPACK_PREDEF_MAKE_0X_VRPP(__MSL_CPP__) +# else +# define MSGPACK_LIB_STD_MSL MSGPACK_PREDEF_MAKE_0X_VRPP(__MSL__) +# endif +#endif + +#if MSGPACK_LIB_STD_MSL +# define MSGPACK_LIB_STD_MSL_AVAILABLE +#endif + +#define MSGPACK_LIB_STD_MSL_NAME "Metrowerks" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_MSL,MSGPACK_LIB_STD_MSL_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/std/roguewave.h b/msgpackc/3.2.1/include/msgpack/predef/library/std/roguewave.h new file mode 100644 index 0000000000000000000000000000000000000000..94ccaf9c2dfb29d941289c50329b30b43612f706 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/std/roguewave.h @@ -0,0 +1,56 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_STD_ROGUEWAVE_H +#define MSGPACK_PREDEF_LIBRARY_STD_ROGUEWAVE_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_STD_RW`] + +[@http://stdcxx.apache.org/ Roguewave] Standard C++ library. +If available version number as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__STD_RWCOMPILER_H__`] [__predef_detection__]] + [[`_RWSTD_VER`] [__predef_detection__]] + + [[`_RWSTD_VER`] [V.R.P]] + ] + */ + +#define MSGPACK_LIB_STD_RW MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER) +# undef MSGPACK_LIB_STD_RW +# if defined(_RWSTD_VER) +# if _RWSTD_VER < 0x010000 +# define MSGPACK_LIB_STD_RW MSGPACK_PREDEF_MAKE_0X_VVRRP(_RWSTD_VER) +# else +# define MSGPACK_LIB_STD_RW MSGPACK_PREDEF_MAKE_0X_VVRRPP(_RWSTD_VER) +# endif +# else +# define MSGPACK_LIB_STD_RW MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_LIB_STD_RW +# define MSGPACK_LIB_STD_RW_AVAILABLE +#endif + +#define MSGPACK_LIB_STD_RW_NAME "Roguewave" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_RW,MSGPACK_LIB_STD_RW_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/std/sgi.h b/msgpackc/3.2.1/include/msgpack/predef/library/std/sgi.h new file mode 100644 index 0000000000000000000000000000000000000000..b23b9ed37c95d4cc16403bfbe4fe5f916cf7598a --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/std/sgi.h @@ -0,0 +1,51 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_STD_SGI_H +#define MSGPACK_PREDEF_LIBRARY_STD_SGI_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_STD_SGI`] + +[@http://www.sgi.com/tech/stl/ SGI] Standard C++ library. +If available version number as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__STL_CONFIG_H`] [__predef_detection__]] + + [[`__SGI_STL`] [V.R.P]] + ] + */ + +#define MSGPACK_LIB_STD_SGI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__STL_CONFIG_H) +# undef MSGPACK_LIB_STD_SGI +# if defined(__SGI_STL) +# define MSGPACK_LIB_STD_SGI MSGPACK_PREDEF_MAKE_0X_VRP(__SGI_STL) +# else +# define MSGPACK_LIB_STD_SGI MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_LIB_STD_SGI +# define MSGPACK_LIB_STD_SGI_AVAILABLE +#endif + +#define MSGPACK_LIB_STD_SGI_NAME "SGI" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_SGI,MSGPACK_LIB_STD_SGI_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/std/stdcpp3.h b/msgpackc/3.2.1/include/msgpack/predef/library/std/stdcpp3.h new file mode 100644 index 0000000000000000000000000000000000000000..6a5de28ad2fe2a4e11186d2dfb0362be1912f7be --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/std/stdcpp3.h @@ -0,0 +1,53 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_STD_STDCPP3_H +#define MSGPACK_PREDEF_LIBRARY_STD_STDCPP3_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_STD_GNU`] + +[@http://gcc.gnu.org/libstdc++/ GNU libstdc++] Standard C++ library. +Version number available as year (from 1970), month, and day. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__GLIBCXX__`] [__predef_detection__]] + [[`__GLIBCPP__`] [__predef_detection__]] + + [[`__GLIBCXX__`] [V.R.P]] + [[`__GLIBCPP__`] [V.R.P]] + ] + */ + +#define MSGPACK_LIB_STD_GNU MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__GLIBCPP__) || defined(__GLIBCXX__) +# undef MSGPACK_LIB_STD_GNU +# if defined(__GLIBCXX__) +# define MSGPACK_LIB_STD_GNU MSGPACK_PREDEF_MAKE_YYYYMMDD(__GLIBCXX__) +# else +# define MSGPACK_LIB_STD_GNU MSGPACK_PREDEF_MAKE_YYYYMMDD(__GLIBCPP__) +# endif +#endif + +#if MSGPACK_LIB_STD_GNU +# define MSGPACK_LIB_STD_GNU_AVAILABLE +#endif + +#define MSGPACK_LIB_STD_GNU_NAME "GNU" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_GNU,MSGPACK_LIB_STD_GNU_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/std/stlport.h b/msgpackc/3.2.1/include/msgpack/predef/library/std/stlport.h new file mode 100644 index 0000000000000000000000000000000000000000..667ff04f165a3d84b47cf510967bff6bb0e92444 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/std/stlport.h @@ -0,0 +1,59 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_STD_STLPORT_H +#define MSGPACK_PREDEF_LIBRARY_STD_STLPORT_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_STD_STLPORT`] + +[@http://sourceforge.net/projects/stlport/ STLport Standard C++] library. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__SGI_STL_PORT`] [__predef_detection__]] + [[`_STLPORT_VERSION`] [__predef_detection__]] + + [[`_STLPORT_MAJOR`, `_STLPORT_MINOR`, `_STLPORT_PATCHLEVEL`] [V.R.P]] + [[`_STLPORT_VERSION`] [V.R.P]] + [[`__SGI_STL_PORT`] [V.R.P]] + ] + */ + +#define MSGPACK_LIB_STD_STLPORT MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) +# undef MSGPACK_LIB_STD_STLPORT +# if !defined(MSGPACK_LIB_STD_STLPORT) && defined(_STLPORT_MAJOR) +# define MSGPACK_LIB_STD_STLPORT \ + MSGPACK_VERSION_NUMBER(_STLPORT_MAJOR,_STLPORT_MINOR,_STLPORT_PATCHLEVEL) +# endif +# if !defined(MSGPACK_LIB_STD_STLPORT) && defined(_STLPORT_VERSION) +# define MSGPACK_LIB_STD_STLPORT MSGPACK_PREDEF_MAKE_0X_VRP(_STLPORT_VERSION) +# endif +# if !defined(MSGPACK_LIB_STD_STLPORT) +# define MSGPACK_LIB_STD_STLPORT MSGPACK_PREDEF_MAKE_0X_VRP(__SGI_STL_PORT) +# endif +#endif + +#if MSGPACK_LIB_STD_STLPORT +# define MSGPACK_LIB_STD_STLPORT_AVAILABLE +#endif + +#define MSGPACK_LIB_STD_STLPORT_NAME "STLport" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_STLPORT,MSGPACK_LIB_STD_STLPORT_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/library/std/vacpp.h b/msgpackc/3.2.1/include/msgpack/predef/library/std/vacpp.h new file mode 100644 index 0000000000000000000000000000000000000000..4b4adac908d13e44b963f0d87ab4ab66b35b518a --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/library/std/vacpp.h @@ -0,0 +1,44 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_LIBRARY_STD_VACPP_H +#define MSGPACK_PREDEF_LIBRARY_STD_VACPP_H + +#include + +#include +#include + +/*` +[heading `MSGPACK_LIB_STD_IBM`] + +[@http://www.ibm.com/software/awdtools/xlcpp/ IBM VACPP Standard C++] library. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__IBMCPP__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_LIB_STD_IBM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__IBMCPP__) +# undef MSGPACK_LIB_STD_IBM +# define MSGPACK_LIB_STD_IBM MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_LIB_STD_IBM +# define MSGPACK_LIB_STD_IBM_AVAILABLE +#endif + +#define MSGPACK_LIB_STD_IBM_NAME "IBM VACPP" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_IBM,MSGPACK_LIB_STD_IBM_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/make.h b/msgpackc/3.2.1/include/msgpack/predef/make.h new file mode 100644 index 0000000000000000000000000000000000000000..26356f8ed276ce64e11f3fad86cc0a617ba2dc57 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/make.h @@ -0,0 +1,97 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include + +#ifndef MSGPACK_PREDEF_MAKE_H +#define MSGPACK_PREDEF_MAKE_H + +/* +Shorthands for the common version number formats used by vendors... +*/ + +/*` +[heading `MSGPACK_PREDEF_MAKE_..` macros] + +These set of macros decompose common vendor version number +macros which are composed version, revision, and patch digits. +The naming convention indicates: + +* The base of the specified version number. "`MSGPACK_PREDEF_MAKE_0X`" for + hexadecimal digits, and "`MSGPACK_PREDEF_MAKE_10`" for decimal digits. +* The format of the vendor version number. Where "`V`" indicates the version digits, + "`R`" indicates the revision digits, "`P`" indicates the patch digits, and "`0`" + indicates an ignored digit. + +Macros are: +*/ +/*` `MSGPACK_PREDEF_MAKE_0X_VRP(V)` */ +#define MSGPACK_PREDEF_MAKE_0X_VRP(V) MSGPACK_VERSION_NUMBER((V&0xF00)>>8,(V&0xF0)>>4,(V&0xF)) +/*` `MSGPACK_PREDEF_MAKE_0X_VVRP(V)` */ +#define MSGPACK_PREDEF_MAKE_0X_VVRP(V) MSGPACK_VERSION_NUMBER((V&0xFF00)>>8,(V&0xF0)>>4,(V&0xF)) +/*` `MSGPACK_PREDEF_MAKE_0X_VRPP(V)` */ +#define MSGPACK_PREDEF_MAKE_0X_VRPP(V) MSGPACK_VERSION_NUMBER((V&0xF000)>>12,(V&0xF00)>>8,(V&0xFF)) +/*` `MSGPACK_PREDEF_MAKE_0X_VVRR(V)` */ +#define MSGPACK_PREDEF_MAKE_0X_VVRR(V) MSGPACK_VERSION_NUMBER((V&0xFF00)>>8,(V&0xFF),0) +/*` `MSGPACK_PREDEF_MAKE_0X_VRRPPPP(V)` */ +#define MSGPACK_PREDEF_MAKE_0X_VRRPPPP(V) MSGPACK_VERSION_NUMBER((V&0xF000000)>>24,(V&0xFF0000)>>16,(V&0xFFFF)) +/*` `MSGPACK_PREDEF_MAKE_0X_VVRRP(V)` */ +#define MSGPACK_PREDEF_MAKE_0X_VVRRP(V) MSGPACK_VERSION_NUMBER((V&0xFF000)>>12,(V&0xFF0)>>4,(V&0xF)) +/*` `MSGPACK_PREDEF_MAKE_0X_VRRPP000(V)` */ +#define MSGPACK_PREDEF_MAKE_0X_VRRPP000(V) MSGPACK_VERSION_NUMBER((V&0xF0000000)>>28,(V&0xFF00000)>>20,(V&0xFF000)>>12) +/*` `MSGPACK_PREDEF_MAKE_0X_VVRRPP(V)` */ +#define MSGPACK_PREDEF_MAKE_0X_VVRRPP(V) MSGPACK_VERSION_NUMBER((V&0xFF0000)>>16,(V&0xFF00)>>8,(V&0xFF)) +/*` `MSGPACK_PREDEF_MAKE_10_VPPP(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VPPP(V) MSGPACK_VERSION_NUMBER(((V)/1000)%10,0,(V)%1000) +/*` `MSGPACK_PREDEF_MAKE_10_VR0(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VR0(V) MSGPACK_VERSION_NUMBER(((V)/100)%10,((V)/10)%10,0) +/*` `MSGPACK_PREDEF_MAKE_10_VRP(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VRP(V) MSGPACK_VERSION_NUMBER(((V)/100)%10,((V)/10)%10,(V)%10) +/*` `MSGPACK_PREDEF_MAKE_10_VRP000(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VRP000(V) MSGPACK_VERSION_NUMBER(((V)/100000)%10,((V)/10000)%10,((V)/1000)%10) +/*` `MSGPACK_PREDEF_MAKE_10_VRPPPP(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VRPPPP(V) MSGPACK_VERSION_NUMBER(((V)/100000)%10,((V)/10000)%10,(V)%10000) +/*` `MSGPACK_PREDEF_MAKE_10_VRPP(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VRPP(V) MSGPACK_VERSION_NUMBER(((V)/1000)%10,((V)/100)%10,(V)%100) +/*` `MSGPACK_PREDEF_MAKE_10_VRR(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VRR(V) MSGPACK_VERSION_NUMBER(((V)/100)%10,(V)%100,0) +/*` `MSGPACK_PREDEF_MAKE_10_VRRPP(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VRRPP(V) MSGPACK_VERSION_NUMBER(((V)/10000)%10,((V)/100)%100,(V)%100) +/*` `MSGPACK_PREDEF_MAKE_10_VRR000(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VRR000(V) MSGPACK_VERSION_NUMBER(((V)/100000)%10,((V)/1000)%100,0) +/*` `MSGPACK_PREDEF_MAKE_10_VV00(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VV00(V) MSGPACK_VERSION_NUMBER(((V)/100)%100,0,0) +/*` `MSGPACK_PREDEF_MAKE_10_VVRR(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VVRR(V) MSGPACK_VERSION_NUMBER(((V)/100)%100,(V)%100,0) +/*` `MSGPACK_PREDEF_MAKE_10_VVRRP(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VVRRP(V) MSGPACK_VERSION_NUMBER(((V)/1000)%100,((V)/10)%100,(V)%10) +/*` `MSGPACK_PREDEF_MAKE_10_VVRRPP(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VVRRPP(V) MSGPACK_VERSION_NUMBER(((V)/10000)%100,((V)/100)%100,(V)%100) +/*` `MSGPACK_PREDEF_MAKE_10_VVRRPPP(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VVRRPPP(V) MSGPACK_VERSION_NUMBER(((V)/100000)%100,((V)/1000)%100,(V)%1000) +/*` `MSGPACK_PREDEF_MAKE_10_VVRR0PP00(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VVRR0PP00(V) MSGPACK_VERSION_NUMBER(((V)/10000000)%100,((V)/100000)%100,((V)/100)%100) +/*` `MSGPACK_PREDEF_MAKE_10_VVRR0PPPP(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VVRR0PPPP(V) MSGPACK_VERSION_NUMBER(((V)/10000000)%100,((V)/100000)%100,(V)%10000) +/*` `MSGPACK_PREDEF_MAKE_10_VVRR00PP00(V)` */ +#define MSGPACK_PREDEF_MAKE_10_VVRR00PP00(V) MSGPACK_VERSION_NUMBER(((V)/100000000)%100,((V)/1000000)%100,((V)/100)%100) +/*` +[heading `MSGPACK_PREDEF_MAKE_*..` date macros] + +Date decomposition macros return a date in the relative to the 1970 +Epoch date. If the month is not available, January 1st is used as the month and day. +If the day is not available, but the month is, the 1st of the month is used as the day. +*/ +/*` `MSGPACK_PREDEF_MAKE_DATE(Y,M,D)` */ +#define MSGPACK_PREDEF_MAKE_DATE(Y,M,D) MSGPACK_VERSION_NUMBER((Y)%10000-1970,(M)%100,(D)%100) +/*` `MSGPACK_PREDEF_MAKE_YYYYMMDD(V)` */ +#define MSGPACK_PREDEF_MAKE_YYYYMMDD(V) MSGPACK_PREDEF_MAKE_DATE(((V)/10000)%10000,((V)/100)%100,(V)%100) +/*` `MSGPACK_PREDEF_MAKE_YYYY(V)` */ +#define MSGPACK_PREDEF_MAKE_YYYY(V) MSGPACK_PREDEF_MAKE_DATE(V,1,1) +/*` `MSGPACK_PREDEF_MAKE_YYYYMM(V)` */ +#define MSGPACK_PREDEF_MAKE_YYYYMM(V) MSGPACK_PREDEF_MAKE_DATE((V)/100,(V)%100,1) + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/os.h b/msgpackc/3.2.1/include/msgpack/predef/os.h new file mode 100644 index 0000000000000000000000000000000000000000..e08842066ae533668e8843f89b5f519434343eb1 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os.h @@ -0,0 +1,33 @@ +/* +Copyright Rene Rivera 2008-2015 +Copyright Franz Detro 2014 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#if !defined(MSGPACK_PREDEF_OS_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS) +#ifndef MSGPACK_PREDEF_OS_H +#define MSGPACK_PREDEF_OS_H +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/aix.h b/msgpackc/3.2.1/include/msgpack/predef/os/aix.h new file mode 100644 index 0000000000000000000000000000000000000000..fa7f61c53fb2d622174636a00cfab9b61cf81fee --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/aix.h @@ -0,0 +1,66 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_AIX_H +#define MSGPACK_PREDEF_OS_AIX_H + +#include +#include + +/*` +[heading `MSGPACK_OS_AIX`] + +[@http://en.wikipedia.org/wiki/AIX_operating_system IBM AIX] operating system. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`_AIX`] [__predef_detection__]] + [[`__TOS_AIX__`] [__predef_detection__]] + + [[`_AIX43`] [4.3.0]] + [[`_AIX41`] [4.1.0]] + [[`_AIX32`] [3.2.0]] + [[`_AIX3`] [3.0.0]] + ] + */ + +#define MSGPACK_OS_AIX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(_AIX) || defined(__TOS_AIX__) \ + ) +# undef MSGPACK_OS_AIX +# if !defined(MSGPACK_OS_AIX) && defined(_AIX43) +# define MSGPACK_OS_AIX MSGPACK_VERSION_NUMBER(4,3,0) +# endif +# if !defined(MSGPACK_OS_AIX) && defined(_AIX41) +# define MSGPACK_OS_AIX MSGPACK_VERSION_NUMBER(4,1,0) +# endif +# if !defined(MSGPACK_OS_AIX) && defined(_AIX32) +# define MSGPACK_OS_AIX MSGPACK_VERSION_NUMBER(3,2,0) +# endif +# if !defined(MSGPACK_OS_AIX) && defined(_AIX3) +# define MSGPACK_OS_AIX MSGPACK_VERSION_NUMBER(3,0,0) +# endif +# if !defined(MSGPACK_OS_AIX) +# define MSGPACK_OS_AIX MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_OS_AIX +# define MSGPACK_OS_AIX_AVAILABLE +# include +#endif + +#define MSGPACK_OS_AIX_NAME "IBM AIX" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_AIX,MSGPACK_OS_AIX_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/amigaos.h b/msgpackc/3.2.1/include/msgpack/predef/os/amigaos.h new file mode 100644 index 0000000000000000000000000000000000000000..26493bca3e0b394bfd6aa3f18196c6e2e140789f --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/amigaos.h @@ -0,0 +1,46 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_AMIGAOS_H +#define MSGPACK_PREDEF_OS_AMIGAOS_H + +#include +#include + +/*` +[heading `MSGPACK_OS_AMIGAOS`] + +[@http://en.wikipedia.org/wiki/AmigaOS AmigaOS] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`AMIGA`] [__predef_detection__]] + [[`__amigaos__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_AMIGAOS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(AMIGA) || defined(__amigaos__) \ + ) +# undef MSGPACK_OS_AMIGAOS +# define MSGPACK_OS_AMIGAOS MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_AMIGAOS +# define MSGPACK_OS_AMIGAOS_AVAILABLE +# include +#endif + +#define MSGPACK_OS_AMIGAOS_NAME "AmigaOS" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_AMIGAOS,MSGPACK_OS_AMIGAOS_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/android.h b/msgpackc/3.2.1/include/msgpack/predef/os/android.h new file mode 100644 index 0000000000000000000000000000000000000000..40f580382710852f8187bf8ec478688c987cd1a9 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/android.h @@ -0,0 +1,45 @@ +/* +Copyright Rene Rivera 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_ANDROID_H +#define MSGPACK_PREDEF_OS_ANDROID_H + +#include +#include + +/*` +[heading `MSGPACK_OS_ANDROID`] + +[@http://en.wikipedia.org/wiki/Android_%28operating_system%29 Android] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__ANDROID__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_ANDROID MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(__ANDROID__) \ + ) +# undef MSGPACK_OS_ANDROID +# define MSGPACK_OS_ANDROID MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_ANDROID +# define MSGPACK_OS_ANDROID_AVAILABLE +# include +#endif + +#define MSGPACK_OS_ANDROID_NAME "Android" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_ANDROID,MSGPACK_OS_ANDROID_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/beos.h b/msgpackc/3.2.1/include/msgpack/predef/os/beos.h new file mode 100644 index 0000000000000000000000000000000000000000..35f143a50cf6ce39f1cb4499490908e174f04a52 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/beos.h @@ -0,0 +1,45 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_BEOS_H +#define MSGPACK_PREDEF_OS_BEOS_H + +#include +#include + +/*` +[heading `MSGPACK_OS_BEOS`] + +[@http://en.wikipedia.org/wiki/BeOS BeOS] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__BEOS__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_BEOS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(__BEOS__) \ + ) +# undef MSGPACK_OS_BEOS +# define MSGPACK_OS_BEOS MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_BEOS +# define MSGPACK_OS_BEOS_AVAILABLE +# include +#endif + +#define MSGPACK_OS_BEOS_NAME "BeOS" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BEOS,MSGPACK_OS_BEOS_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/bsd.h b/msgpackc/3.2.1/include/msgpack/predef/os/bsd.h new file mode 100644 index 0000000000000000000000000000000000000000..90b251333b3895735e859e79ae3540fed8dd09a5 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/bsd.h @@ -0,0 +1,103 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_BSD_H +#define MSGPACK_PREDEF_OS_BSD_H + +/* Special case: OSX will define BSD predefs if the sys/param.h + * header is included. We can guard against that, but only if we + * detect OSX first. Hence we will force include OSX detection + * before doing any BSD detection. + */ +#include + +#include +#include + +/*` +[heading `MSGPACK_OS_BSD`] + +[@http://en.wikipedia.org/wiki/Berkeley_Software_Distribution BSD] operating system. + +BSD has various branch operating systems possible and each detected +individually. This detects the following variations and sets a specific +version number macro to match: + +* `MSGPACK_OS_BSD_DRAGONFLY` [@http://en.wikipedia.org/wiki/DragonFly_BSD DragonFly BSD] +* `MSGPACK_OS_BSD_FREE` [@http://en.wikipedia.org/wiki/Freebsd FreeBSD] +* `MSGPACK_OS_BSD_BSDI` [@http://en.wikipedia.org/wiki/BSD/OS BSDi BSD/OS] +* `MSGPACK_OS_BSD_NET` [@http://en.wikipedia.org/wiki/Netbsd NetBSD] +* `MSGPACK_OS_BSD_OPEN` [@http://en.wikipedia.org/wiki/Openbsd OpenBSD] + +[note The general `MSGPACK_OS_BSD` is set in all cases to indicate some form +of BSD. If the above variants is detected the corresponding macro is also set.] + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`BSD`] [__predef_detection__]] + [[`_SYSTYPE_BSD`] [__predef_detection__]] + + [[`BSD4_2`] [4.2.0]] + [[`BSD4_3`] [4.3.0]] + [[`BSD4_4`] [4.4.0]] + [[`BSD`] [V.R.0]] + ] + */ + +#include +#include +#include +#include +#include + +#ifndef MSGPACK_OS_BSD +#define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#endif + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(BSD) || \ + defined(_SYSTYPE_BSD) \ + ) +# undef MSGPACK_OS_BSD +# include +# if !defined(MSGPACK_OS_BSD) && defined(BSD4_4) +# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER(4,4,0) +# endif +# if !defined(MSGPACK_OS_BSD) && defined(BSD4_3) +# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER(4,3,0) +# endif +# if !defined(MSGPACK_OS_BSD) && defined(BSD4_2) +# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER(4,2,0) +# endif +# if !defined(MSGPACK_OS_BSD) && defined(BSD) +# define MSGPACK_OS_BSD MSGPACK_PREDEF_MAKE_10_VVRR(BSD) +# endif +# if !defined(MSGPACK_OS_BSD) +# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_OS_BSD +# define MSGPACK_OS_BSD_AVAILABLE +# include +#endif + +#define MSGPACK_OS_BSD_NAME "BSD" + +#else + +#include +#include +#include +#include +#include + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BSD,MSGPACK_OS_BSD_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/bsd/bsdi.h b/msgpackc/3.2.1/include/msgpack/predef/os/bsd/bsdi.h new file mode 100644 index 0000000000000000000000000000000000000000..4718ee775ab9999cccd266a0b431adf12aea7881 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/bsd/bsdi.h @@ -0,0 +1,48 @@ +/* +Copyright Rene Rivera 2012-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_BSD_BSDI_H +#define MSGPACK_PREDEF_OS_BSD_BSDI_H + +#include + +/*` +[heading `MSGPACK_OS_BSD_BSDI`] + +[@http://en.wikipedia.org/wiki/BSD/OS BSDi BSD/OS] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__bsdi__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_BSD_BSDI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(__bsdi__) \ + ) +# ifndef MSGPACK_OS_BSD_AVAILABLE +# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_AVAILABLE +# define MSGPACK_OS_BSD_AVAILABLE +# endif +# undef MSGPACK_OS_BSD_BSDI +# define MSGPACK_OS_BSD_BSDI MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_BSD_BSDI +# define MSGPACK_OS_BSD_BSDI_AVAILABLE +# include +#endif + +#define MSGPACK_OS_BSD_BSDI_NAME "BSDi BSD/OS" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BSD_BSDI,MSGPACK_OS_BSD_BSDI_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/bsd/dragonfly.h b/msgpackc/3.2.1/include/msgpack/predef/os/bsd/dragonfly.h new file mode 100644 index 0000000000000000000000000000000000000000..fde6f24ec61c45881629c35479b993b56c5f707d --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/bsd/dragonfly.h @@ -0,0 +1,50 @@ +/* +Copyright Rene Rivera 2012-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_BSD_DRAGONFLY_H +#define MSGPACK_PREDEF_OS_BSD_DRAGONFLY_H + +#include + +/*` +[heading `MSGPACK_OS_BSD_DRAGONFLY`] + +[@http://en.wikipedia.org/wiki/DragonFly_BSD DragonFly BSD] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__DragonFly__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_BSD_DRAGONFLY MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(__DragonFly__) \ + ) +# ifndef MSGPACK_OS_BSD_AVAILABLE +# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_AVAILABLE +# define MSGPACK_OS_BSD_AVAILABLE +# endif +# undef MSGPACK_OS_BSD_DRAGONFLY +# if defined(__DragonFly__) +# define MSGPACK_OS_DRAGONFLY_BSD MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_OS_BSD_DRAGONFLY +# define MSGPACK_OS_BSD_DRAGONFLY_AVAILABLE +# include +#endif + +#define MSGPACK_OS_BSD_DRAGONFLY_NAME "DragonFly BSD" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BSD_DRAGONFLY,MSGPACK_OS_BSD_DRAGONFLY_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/bsd/free.h b/msgpackc/3.2.1/include/msgpack/predef/os/bsd/free.h new file mode 100644 index 0000000000000000000000000000000000000000..64862bdb44567adc590c14efc300e048458150e8 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/bsd/free.h @@ -0,0 +1,67 @@ +/* +Copyright Rene Rivera 2012-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_BSD_FREE_H +#define MSGPACK_PREDEF_OS_BSD_FREE_H + +#include + +/*` +[heading `MSGPACK_OS_BSD_FREE`] + +[@http://en.wikipedia.org/wiki/Freebsd FreeBSD] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__FreeBSD__`] [__predef_detection__]] + + [[`__FreeBSD_version`] [V.R.P]] + ] + */ + +#define MSGPACK_OS_BSD_FREE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(__FreeBSD__) \ + ) +# ifndef MSGPACK_OS_BSD_AVAILABLE +# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_AVAILABLE +# define MSGPACK_OS_BSD_AVAILABLE +# endif +# undef MSGPACK_OS_BSD_FREE +# include +# if defined(__FreeBSD_version) +# if __FreeBSD_version == 491000 +# define MSGPACK_OS_BSD_FREE \ + MSGPACK_VERSION_NUMBER(4, 10, 0) +# elif __FreeBSD_version == 492000 +# define MSGPACK_OS_BSD_FREE \ + MSGPACK_VERSION_NUMBER(4, 11, 0) +# elif __FreeBSD_version < 500000 +# define MSGPACK_OS_BSD_FREE \ + MSGPACK_PREDEF_MAKE_10_VRPPPP(__FreeBSD_version) +# else +# define MSGPACK_OS_BSD_FREE \ + MSGPACK_PREDEF_MAKE_10_VVRRPPP(__FreeBSD_version) +# endif +# else +# define MSGPACK_OS_BSD_FREE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_OS_BSD_FREE +# define MSGPACK_OS_BSD_FREE_AVAILABLE +# include +#endif + +#define MSGPACK_OS_BSD_FREE_NAME "Free BSD" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BSD_FREE,MSGPACK_OS_BSD_FREE_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/bsd/net.h b/msgpackc/3.2.1/include/msgpack/predef/os/bsd/net.h new file mode 100644 index 0000000000000000000000000000000000000000..2b21b18e6fd4ad3f3443cbf695aa2f695cdad187 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/bsd/net.h @@ -0,0 +1,84 @@ +/* +Copyright Rene Rivera 2012-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_BSD_NET_H +#define MSGPACK_PREDEF_OS_BSD_NET_H + +#include + +/*` +[heading `MSGPACK_OS_BSD_NET`] + +[@http://en.wikipedia.org/wiki/Netbsd NetBSD] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__NETBSD__`] [__predef_detection__]] + [[`__NetBSD__`] [__predef_detection__]] + + [[`__NETBSD_version`] [V.R.P]] + [[`NetBSD0_8`] [0.8.0]] + [[`NetBSD0_9`] [0.9.0]] + [[`NetBSD1_0`] [1.0.0]] + [[`__NetBSD_Version`] [V.R.P]] + ] + */ + +#define MSGPACK_OS_BSD_NET MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(__NETBSD__) || defined(__NetBSD__) \ + ) +# ifndef MSGPACK_OS_BSD_AVAILABLE +# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_AVAILABLE +# define MSGPACK_OS_BSD_AVAILABLE +# endif +# undef MSGPACK_OS_BSD_NET +# if defined(__NETBSD__) +# if defined(__NETBSD_version) +# if __NETBSD_version < 500000 +# define MSGPACK_OS_BSD_NET \ + MSGPACK_PREDEF_MAKE_10_VRP000(__NETBSD_version) +# else +# define MSGPACK_OS_BSD_NET \ + MSGPACK_PREDEF_MAKE_10_VRR000(__NETBSD_version) +# endif +# else +# define MSGPACK_OS_BSD_NET MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +# elif defined(__NetBSD__) +# if !defined(MSGPACK_OS_BSD_NET) && defined(NetBSD0_8) +# define MSGPACK_OS_BSD_NET MSGPACK_VERSION_NUMBER(0,8,0) +# endif +# if !defined(MSGPACK_OS_BSD_NET) && defined(NetBSD0_9) +# define MSGPACK_OS_BSD_NET MSGPACK_VERSION_NUMBER(0,9,0) +# endif +# if !defined(MSGPACK_OS_BSD_NET) && defined(NetBSD1_0) +# define MSGPACK_OS_BSD_NET MSGPACK_VERSION_NUMBER(1,0,0) +# endif +# if !defined(MSGPACK_OS_BSD_NET) && defined(__NetBSD_Version) +# define MSGPACK_OS_BSD_NET \ + MSGPACK_PREDEF_MAKE_10_VVRR00PP00(__NetBSD_Version) +# endif +# if !defined(MSGPACK_OS_BSD_NET) +# define MSGPACK_OS_BSD_NET MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +# endif +#endif + +#if MSGPACK_OS_BSD_NET +# define MSGPACK_OS_BSD_NET_AVAILABLE +# include +#endif + +#define MSGPACK_OS_BSD_NET_NAME "DragonFly BSD" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BSD_NET,MSGPACK_OS_BSD_NET_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/bsd/open.h b/msgpackc/3.2.1/include/msgpack/predef/os/bsd/open.h new file mode 100644 index 0000000000000000000000000000000000000000..2492847ee72edf7815d0065e81a2da246a098f4b --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/bsd/open.h @@ -0,0 +1,251 @@ +/* +Copyright Rene Rivera 2012-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_BSD_OPEN_H +#define MSGPACK_PREDEF_OS_BSD_OPEN_H + +#include + +/*` +[heading `MSGPACK_OS_BSD_OPEN`] + +[@http://en.wikipedia.org/wiki/Openbsd OpenBSD] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__OpenBSD__`] [__predef_detection__]] + + [[`OpenBSD2_0`] [2.0.0]] + [[`OpenBSD2_1`] [2.1.0]] + [[`OpenBSD2_2`] [2.2.0]] + [[`OpenBSD2_3`] [2.3.0]] + [[`OpenBSD2_4`] [2.4.0]] + [[`OpenBSD2_5`] [2.5.0]] + [[`OpenBSD2_6`] [2.6.0]] + [[`OpenBSD2_7`] [2.7.0]] + [[`OpenBSD2_8`] [2.8.0]] + [[`OpenBSD2_9`] [2.9.0]] + [[`OpenBSD3_0`] [3.0.0]] + [[`OpenBSD3_1`] [3.1.0]] + [[`OpenBSD3_2`] [3.2.0]] + [[`OpenBSD3_3`] [3.3.0]] + [[`OpenBSD3_4`] [3.4.0]] + [[`OpenBSD3_5`] [3.5.0]] + [[`OpenBSD3_6`] [3.6.0]] + [[`OpenBSD3_7`] [3.7.0]] + [[`OpenBSD3_8`] [3.8.0]] + [[`OpenBSD3_9`] [3.9.0]] + [[`OpenBSD4_0`] [4.0.0]] + [[`OpenBSD4_1`] [4.1.0]] + [[`OpenBSD4_2`] [4.2.0]] + [[`OpenBSD4_3`] [4.3.0]] + [[`OpenBSD4_4`] [4.4.0]] + [[`OpenBSD4_5`] [4.5.0]] + [[`OpenBSD4_6`] [4.6.0]] + [[`OpenBSD4_7`] [4.7.0]] + [[`OpenBSD4_8`] [4.8.0]] + [[`OpenBSD4_9`] [4.9.0]] + [[`OpenBSD5_0`] [5.0.0]] + [[`OpenBSD5_1`] [5.1.0]] + [[`OpenBSD5_2`] [5.2.0]] + [[`OpenBSD5_3`] [5.3.0]] + [[`OpenBSD5_4`] [5.4.0]] + [[`OpenBSD5_5`] [5.5.0]] + [[`OpenBSD5_6`] [5.6.0]] + [[`OpenBSD5_7`] [5.7.0]] + [[`OpenBSD5_8`] [5.8.0]] + [[`OpenBSD5_9`] [5.9.0]] + [[`OpenBSD6_0`] [6.0.0]] + [[`OpenBSD6_1`] [6.1.0]] + [[`OpenBSD6_2`] [6.2.0]] + [[`OpenBSD6_3`] [6.3.0]] + [[`OpenBSD6_4`] [6.4.0]] + [[`OpenBSD6_5`] [6.5.0]] + [[`OpenBSD6_6`] [6.6.0]] + [[`OpenBSD6_7`] [6.7.0]] + [[`OpenBSD6_8`] [6.8.0]] + [[`OpenBSD6_9`] [6.9.0]] + ] + */ + +#define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(__OpenBSD__) \ + ) +# ifndef MSGPACK_OS_BSD_AVAILABLE +# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_AVAILABLE +# define MSGPACK_OS_BSD_AVAILABLE +# endif +# undef MSGPACK_OS_BSD_OPEN +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_0) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,0,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_1) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,1,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_2) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,2,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_3) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,3,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_4) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,4,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_5) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,5,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_6) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,6,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_7) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,7,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_8) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,8,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_9) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,9,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_0) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,0,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_1) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,1,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_2) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,2,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_3) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,3,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_4) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,4,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_5) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,5,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_6) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,6,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_7) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,7,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_8) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,8,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_9) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,9,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_0) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,0,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_1) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,1,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_2) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,2,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_3) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,3,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_4) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,4,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_5) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,5,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_6) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,6,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_7) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,7,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_8) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,8,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_9) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,9,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_0) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,0,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_1) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,1,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_2) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,2,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_3) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,3,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_4) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,4,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_5) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,5,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_6) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,6,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_7) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,7,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_8) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,8,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD5_9) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(5,9,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_0) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,0,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_1) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,1,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_2) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,2,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_3) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,3,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_4) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,4,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_5) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,5,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_6) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,6,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_7) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,7,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_8) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,8,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD6_9) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(6,9,0) +# endif +# if !defined(MSGPACK_OS_BSD_OPEN) +# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_OS_BSD_OPEN +# define MSGPACK_OS_BSD_OPEN_AVAILABLE +# include +#endif + +#define MSGPACK_OS_BSD_OPEN_NAME "OpenBSD" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BSD_OPEN,MSGPACK_OS_BSD_OPEN_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/cygwin.h b/msgpackc/3.2.1/include/msgpack/predef/os/cygwin.h new file mode 100644 index 0000000000000000000000000000000000000000..20ec7618a5890963f7714b4c6416b54c9e87a055 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/cygwin.h @@ -0,0 +1,45 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_CYGWIN_H +#define MSGPACK_PREDEF_OS_CYGWIN_H + +#include +#include + +/*` +[heading `MSGPACK_OS_CYGWIN`] + +[@http://en.wikipedia.org/wiki/Cygwin Cygwin] evironment. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__CYGWIN__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_CYGWIN MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(__CYGWIN__) \ + ) +# undef MSGPACK_OS_CYGWIN +# define MSGPACK_OS_CYGWIN MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_CYGWIN +# define MSGPACK_OS_CYGWIN_AVAILABLE +# include +#endif + +#define MSGPACK_OS_CYGWIN_NAME "Cygwin" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_CYGWIN,MSGPACK_OS_CYGWIN_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/haiku.h b/msgpackc/3.2.1/include/msgpack/predef/os/haiku.h new file mode 100644 index 0000000000000000000000000000000000000000..53e9b517cd689c673cc6ea64d27b36b908a71093 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/haiku.h @@ -0,0 +1,46 @@ +/* +Copyright Jessica Hamilton 2014 +Copyright Rene Rivera 2014-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_HAIKU_H +#define MSGPACK_PREDEF_OS_HAIKU_H + +#include +#include + +/*` +[heading `MSGPACK_OS_HAIKU`] + +[@http://en.wikipedia.org/wiki/Haiku_(operating_system) Haiku] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__HAIKU__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_HAIKU MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(__HAIKU__) \ + ) +# undef MSGPACK_OS_HAIKU +# define MSGPACK_OS_HAIKU MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_HAIKU +# define MSGPACK_OS_HAIKU_AVAILABLE +# include +#endif + +#define MSGPACK_OS_HAIKU_NAME "Haiku" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_HAIKU,MSGPACK_OS_HAIKU_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/hpux.h b/msgpackc/3.2.1/include/msgpack/predef/os/hpux.h new file mode 100644 index 0000000000000000000000000000000000000000..c3359e7717d4036e55c2cc0b79742cef941469fe --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/hpux.h @@ -0,0 +1,47 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_HPUX_H +#define MSGPACK_PREDEF_OS_HPUX_H + +#include +#include + +/*` +[heading `MSGPACK_OS_HPUX`] + +[@http://en.wikipedia.org/wiki/HP-UX HP-UX] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`hpux`] [__predef_detection__]] + [[`_hpux`] [__predef_detection__]] + [[`__hpux`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_HPUX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(hpux) || defined(_hpux) || defined(__hpux) \ + ) +# undef MSGPACK_OS_HPUX +# define MSGPACK_OS_HPUX MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_HPUX +# define MSGPACK_OS_HPUX_AVAILABLE +# include +#endif + +#define MSGPACK_OS_HPUX_NAME "HP-UX" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_HPUX,MSGPACK_OS_HPUX_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/ios.h b/msgpackc/3.2.1/include/msgpack/predef/os/ios.h new file mode 100644 index 0000000000000000000000000000000000000000..cd14de7491bb76ee119aef8b859b368708c232bc --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/ios.h @@ -0,0 +1,51 @@ +/* +Copyright Franz Detro 2014 +Copyright Rene Rivera 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_IOS_H +#define MSGPACK_PREDEF_OS_IOS_H + +#include +#include + +/*` +[heading `MSGPACK_OS_IOS`] + +[@http://en.wikipedia.org/wiki/iOS iOS] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__APPLE__`] [__predef_detection__]] + [[`__MACH__`] [__predef_detection__]] + [[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__predef_detection__]] + + [[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000]] + ] + */ + +#define MSGPACK_OS_IOS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(__APPLE__) && defined(__MACH__) && \ + defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) \ + ) +# undef MSGPACK_OS_IOS +# define MSGPACK_OS_IOS (__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000) +#endif + +#if MSGPACK_OS_IOS +# define MSGPACK_OS_IOS_AVAILABLE +# include +#endif + +#define MSGPACK_OS_IOS_NAME "iOS" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_IOS,MSGPACK_OS_IOS_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/irix.h b/msgpackc/3.2.1/include/msgpack/predef/os/irix.h new file mode 100644 index 0000000000000000000000000000000000000000..b36e2a506aacb8cadd6253e48f56377308bae5a9 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/irix.h @@ -0,0 +1,46 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_IRIX_H +#define MSGPACK_PREDEF_OS_IRIX_H + +#include +#include + +/*` +[heading `MSGPACK_OS_IRIX`] + +[@http://en.wikipedia.org/wiki/Irix IRIX] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`sgi`] [__predef_detection__]] + [[`__sgi`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_IRIX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(sgi) || defined(__sgi) \ + ) +# undef MSGPACK_OS_IRIX +# define MSGPACK_OS_IRIX MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_IRIX +# define MSGPACK_OS_IRIX_AVAILABLE +# include +#endif + +#define MSGPACK_OS_IRIX_NAME "IRIX" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_IRIX,MSGPACK_OS_IRIX_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/linux.h b/msgpackc/3.2.1/include/msgpack/predef/os/linux.h new file mode 100644 index 0000000000000000000000000000000000000000..6c517c9d60760ed52eb479b02c739d0a2dd4d2db --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/linux.h @@ -0,0 +1,46 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_LINUX_H +#define MSGPACK_PREDEF_OS_LINUX_H + +#include +#include + +/*` +[heading `MSGPACK_OS_LINUX`] + +[@http://en.wikipedia.org/wiki/Linux Linux] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`linux`] [__predef_detection__]] + [[`__linux`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_LINUX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(linux) || defined(__linux) \ + ) +# undef MSGPACK_OS_LINUX +# define MSGPACK_OS_LINUX MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_LINUX +# define MSGPACK_OS_LINUX_AVAILABLE +# include +#endif + +#define MSGPACK_OS_LINUX_NAME "Linux" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_LINUX,MSGPACK_OS_LINUX_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/macos.h b/msgpackc/3.2.1/include/msgpack/predef/os/macos.h new file mode 100644 index 0000000000000000000000000000000000000000..20dc60d7497199fe51494e19b239e4581087a04d --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/macos.h @@ -0,0 +1,65 @@ +/* +Copyright Rene Rivera 2008-2015 +Copyright Franz Detro 2014 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_MACOS_H +#define MSGPACK_PREDEF_OS_MACOS_H + +/* Special case: iOS will define the same predefs as MacOS, and additionally + '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__'. We can guard against that, + but only if we detect iOS first. Hence we will force include iOS detection + * before doing any MacOS detection. + */ +#include + +#include +#include + +/*` +[heading `MSGPACK_OS_MACOS`] + +[@http://en.wikipedia.org/wiki/Mac_OS Mac OS] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`macintosh`] [__predef_detection__]] + [[`Macintosh`] [__predef_detection__]] + [[`__APPLE__`] [__predef_detection__]] + [[`__MACH__`] [__predef_detection__]] + + [[`__APPLE__`, `__MACH__`] [10.0.0]] + [[ /otherwise/ ] [9.0.0]] + ] + */ + +#define MSGPACK_OS_MACOS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(macintosh) || defined(Macintosh) || \ + (defined(__APPLE__) && defined(__MACH__)) \ + ) +# undef MSGPACK_OS_MACOS +# if !defined(MSGPACK_OS_MACOS) && defined(__APPLE__) && defined(__MACH__) +# define MSGPACK_OS_MACOS MSGPACK_VERSION_NUMBER(10,0,0) +# endif +# if !defined(MSGPACK_OS_MACOS) +# define MSGPACK_OS_MACOS MSGPACK_VERSION_NUMBER(9,0,0) +# endif +#endif + +#if MSGPACK_OS_MACOS +# define MSGPACK_OS_MACOS_AVAILABLE +# include +#endif + +#define MSGPACK_OS_MACOS_NAME "Mac OS" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_MACOS,MSGPACK_OS_MACOS_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/os400.h b/msgpackc/3.2.1/include/msgpack/predef/os/os400.h new file mode 100644 index 0000000000000000000000000000000000000000..53ef52f8dce35e16519ec0114dc754abe78f8520 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/os400.h @@ -0,0 +1,45 @@ +/* +Copyright Rene Rivera 2011-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_OS400_H +#define MSGPACK_PREDEF_OS_OS400_H + +#include +#include + +/*` +[heading `MSGPACK_OS_OS400`] + +[@http://en.wikipedia.org/wiki/IBM_i IBM OS/400] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__OS400__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_OS400 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(__OS400__) \ + ) +# undef MSGPACK_OS_OS400 +# define MSGPACK_OS_OS400 MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_OS400 +# define MSGPACK_OS_OS400_AVAILABLE +# include +#endif + +#define MSGPACK_OS_OS400_NAME "IBM OS/400" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_OS400,MSGPACK_OS_OS400_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/qnxnto.h b/msgpackc/3.2.1/include/msgpack/predef/os/qnxnto.h new file mode 100644 index 0000000000000000000000000000000000000000..80adaa2f3854b78855b5ef477191b95a5d642371 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/qnxnto.h @@ -0,0 +1,59 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_QNXNTO_H +#define MSGPACK_PREDEF_OS_QNXNTO_H + +#include +#include + +/*` +[heading `MSGPACK_OS_QNX`] + +[@http://en.wikipedia.org/wiki/QNX QNX] operating system. +Version number available as major, and minor if possible. And +version 4 is specifically detected. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__QNX__`] [__predef_detection__]] + [[`__QNXNTO__`] [__predef_detection__]] + + [[`_NTO_VERSION`] [V.R.0]] + [[`__QNX__`] [4.0.0]] + ] + */ + +#define MSGPACK_OS_QNX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(__QNX__) || defined(__QNXNTO__) \ + ) +# undef MSGPACK_OS_QNX +# if !defined(MSGPACK_OS_QNX) && defined(_NTO_VERSION) +# define MSGPACK_OS_QNX MSGPACK_PREDEF_MAKE_10_VVRR(_NTO_VERSION) +# endif +# if !defined(MSGPACK_OS_QNX) && defined(__QNX__) +# define MSGPACK_OS_QNX MSGPACK_VERSION_NUMBER(4,0,0) +# endif +# if !defined(MSGPACK_OS_QNX) +# define MSGPACK_OS_QNX MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_OS_QNX +# define MSGPACK_OS_QNX_AVAILABLE +# include +#endif + +#define MSGPACK_OS_QNX_NAME "QNX" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_QNX,MSGPACK_OS_QNX_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/solaris.h b/msgpackc/3.2.1/include/msgpack/predef/os/solaris.h new file mode 100644 index 0000000000000000000000000000000000000000..f7ccb9c7320caa6dc79007666b00503a05bbbce5 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/solaris.h @@ -0,0 +1,46 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_SOLARIS_H +#define MSGPACK_PREDEF_OS_SOLARIS_H + +#include +#include + +/*` +[heading `MSGPACK_OS_SOLARIS`] + +[@http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`sun`] [__predef_detection__]] + [[`__sun`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_SOLARIS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(sun) || defined(__sun) \ + ) +# undef MSGPACK_OS_SOLARIS +# define MSGPACK_OS_SOLARIS MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_SOLARIS +# define MSGPACK_OS_SOLARIS_AVAILABLE +# include +#endif + +#define MSGPACK_OS_SOLARIS_NAME "Solaris" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_SOLARIS,MSGPACK_OS_SOLARIS_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/unix.h b/msgpackc/3.2.1/include/msgpack/predef/os/unix.h new file mode 100644 index 0000000000000000000000000000000000000000..b55970d14e74f08802800b3822e38946399b3d64 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/unix.h @@ -0,0 +1,76 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_UNIX_H +#define MSGPACK_PREDEF_OS_UNIX_H + +#include +#include + +/*` +[heading `MSGPACK_OS_UNIX`] + +[@http://en.wikipedia.org/wiki/Unix Unix Environment] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`unix`] [__predef_detection__]] + [[`__unix`] [__predef_detection__]] + [[`_XOPEN_SOURCE`] [__predef_detection__]] + [[`_POSIX_SOURCE`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_UNIX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(unix) || defined(__unix) || \ + defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) +# undef MSGPACK_OS_UNIX +# define MSGPACK_OS_UNIX MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_UNIX +# define MSGPACK_OS_UNIX_AVAILABLE +#endif + +#define MSGPACK_OS_UNIX_NAME "Unix Environment" + +/*` +[heading `MSGPACK_OS_SVR4`] + +[@http://en.wikipedia.org/wiki/UNIX_System_V SVR4 Environment] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__sysv__`] [__predef_detection__]] + [[`__SVR4`] [__predef_detection__]] + [[`__svr4__`] [__predef_detection__]] + [[`_SYSTYPE_SVR4`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_SVR4 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__sysv__) || defined(__SVR4) || \ + defined(__svr4__) || defined(_SYSTYPE_SVR4) +# undef MSGPACK_OS_SVR4 +# define MSGPACK_OS_SVR4 MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_SVR4 +# define MSGPACK_OS_SVR4_AVAILABLE +#endif + +#define MSGPACK_OS_SVR4_NAME "SVR4 Environment" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_UNIX,MSGPACK_OS_UNIX_NAME) +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_SVR4,MSGPACK_OS_SVR4_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/vms.h b/msgpackc/3.2.1/include/msgpack/predef/os/vms.h new file mode 100644 index 0000000000000000000000000000000000000000..bf87684e9bfb4f04cf740c91d229c7e288a5cf82 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/vms.h @@ -0,0 +1,52 @@ +/* +Copyright Rene Rivera 2011-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_VMS_H +#define MSGPACK_PREDEF_OS_VMS_H + +#include +#include + +/*` +[heading `MSGPACK_OS_VMS`] + +[@http://en.wikipedia.org/wiki/Vms VMS] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`VMS`] [__predef_detection__]] + [[`__VMS`] [__predef_detection__]] + + [[`__VMS_VER`] [V.R.P]] + ] + */ + +#define MSGPACK_OS_VMS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(VMS) || defined(__VMS) \ + ) +# undef MSGPACK_OS_VMS +# if defined(__VMS_VER) +# define MSGPACK_OS_VMS MSGPACK_PREDEF_MAKE_10_VVRR00PP00(__VMS_VER) +# else +# define MSGPACK_OS_VMS MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_OS_VMS +# define MSGPACK_OS_VMS_AVAILABLE +# include +#endif + +#define MSGPACK_OS_VMS_NAME "VMS" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_VMS,MSGPACK_OS_VMS_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/os/windows.h b/msgpackc/3.2.1/include/msgpack/predef/os/windows.h new file mode 100644 index 0000000000000000000000000000000000000000..bf73943766cfa292e184bc97dcd5b501c6a508c8 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/os/windows.h @@ -0,0 +1,51 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_OS_WINDOWS_H +#define MSGPACK_PREDEF_OS_WINDOWS_H + +#include +#include + +/*` +[heading `MSGPACK_OS_WINDOWS`] + +[@http://en.wikipedia.org/wiki/Category:Microsoft_Windows Microsoft Windows] operating system. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`_WIN32`] [__predef_detection__]] + [[`_WIN64`] [__predef_detection__]] + [[`__WIN32__`] [__predef_detection__]] + [[`__TOS_WIN__`] [__predef_detection__]] + [[`__WINDOWS__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_OS_WINDOWS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \ + defined(_WIN32) || defined(_WIN64) || \ + defined(__WIN32__) || defined(__TOS_WIN__) || \ + defined(__WINDOWS__) \ + ) +# undef MSGPACK_OS_WINDOWS +# define MSGPACK_OS_WINDOWS MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_OS_WINDOWS +# define MSGPACK_OS_WINDOWS_AVAILABLE +# include +#endif + +#define MSGPACK_OS_WINDOWS_NAME "Microsoft Windows" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_WINDOWS,MSGPACK_OS_WINDOWS_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/other.h b/msgpackc/3.2.1/include/msgpack/predef/other.h new file mode 100644 index 0000000000000000000000000000000000000000..5434c5b5f09545f5bafcdd09d9876296777bbb80 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/other.h @@ -0,0 +1,16 @@ +/* +Copyright Rene Rivera 2013-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#if !defined(MSGPACK_PREDEF_OTHER_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS) +#ifndef MSGPACK_PREDEF_OTHER_H +#define MSGPACK_PREDEF_OTHER_H +#endif + +#include +/*#include */ + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/other/endian.h b/msgpackc/3.2.1/include/msgpack/predef/other/endian.h new file mode 100644 index 0000000000000000000000000000000000000000..afbda29329b26bad64b2deceb1af35f2378265e6 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/other/endian.h @@ -0,0 +1,203 @@ +/* +Copyright Rene Rivera 2013-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_ENDIAN_H +#define MSGPACK_PREDEF_ENDIAN_H + +#include +#include +#include +#include +#include +#include + +/*` +[heading `MSGPACK_ENDIAN_*`] + +Detection of endian memory ordering. There are four defined macros +in this header that define the various generally possible endian +memory orderings: + +* `MSGPACK_ENDIAN_BIG_BYTE`, byte-swapped big-endian. +* `MSGPACK_ENDIAN_BIG_WORD`, word-swapped big-endian. +* `MSGPACK_ENDIAN_LITTLE_BYTE`, byte-swapped little-endian. +* `MSGPACK_ENDIAN_LITTLE_WORD`, word-swapped little-endian. + +The detection is conservative in that it only identifies endianness +that it knows for certain. In particular bi-endianness is not +indicated as is it not practically possible to determine the +endianness from anything but an operating system provided +header. And the currently known headers do not define that +programatic bi-endianness is available. + +This implementation is a compilation of various publicly available +information and acquired knowledge: + +# The indispensable documentation of "Pre-defined Compiler Macros" + [@http://sourceforge.net/p/predef/wiki/Endianness Endianness]. +# The various endian specifications available in the + [@http://wikipedia.org/ Wikipedia] computer architecture pages. +# Generally available searches for headers that define endianness. + */ + +#define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#define MSGPACK_ENDIAN_BIG_WORD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#define MSGPACK_ENDIAN_LITTLE_WORD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +/* GNU libc provides a header defining __BYTE_ORDER, or _BYTE_ORDER. + * And some OSs provide some for of endian header also. + */ +#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \ + !MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD +# if MSGPACK_LIB_C_GNU || MSGPACK_OS_ANDROID +# include +# else +# if MSGPACK_OS_MACOS +# include +# else +# if MSGPACK_OS_BSD +# if MSGPACK_OS_BSD_OPEN +# include +# else +# include +# endif +# endif +# endif +# endif +# if defined(__BYTE_ORDER) +# if defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN) +# undef MSGPACK_ENDIAN_BIG_BYTE +# define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +# if defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN) +# undef MSGPACK_ENDIAN_LITTLE_BYTE +# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +# if defined(__PDP_ENDIAN) && (__BYTE_ORDER == __PDP_ENDIAN) +# undef MSGPACK_ENDIAN_LITTLE_WORD +# define MSGPACK_ENDIAN_LITTLE_WORD MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +# endif +# if !defined(__BYTE_ORDER) && defined(_BYTE_ORDER) +# if defined(_BIG_ENDIAN) && (_BYTE_ORDER == _BIG_ENDIAN) +# undef MSGPACK_ENDIAN_BIG_BYTE +# define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +# if defined(_LITTLE_ENDIAN) && (_BYTE_ORDER == _LITTLE_ENDIAN) +# undef MSGPACK_ENDIAN_LITTLE_BYTE +# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +# if defined(_PDP_ENDIAN) && (_BYTE_ORDER == _PDP_ENDIAN) +# undef MSGPACK_ENDIAN_LITTLE_WORD +# define MSGPACK_ENDIAN_LITTLE_WORD MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +# endif +#endif + +/* Built-in byte-swpped big-endian macros. + */ +#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \ + !MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD +# if (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) || \ + (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)) || \ + defined(__ARMEB__) || \ + defined(__THUMBEB__) || \ + defined(__AARCH64EB__) || \ + defined(_MIPSEB) || \ + defined(__MIPSEB) || \ + defined(__MIPSEB__) +# undef MSGPACK_ENDIAN_BIG_BYTE +# define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +/* Built-in byte-swpped little-endian macros. + */ +#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \ + !MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD +# if (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ + (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) || \ + defined(__ARMEL__) || \ + defined(__THUMBEL__) || \ + defined(__AARCH64EL__) || \ + defined(_MIPSEL) || \ + defined(__MIPSEL) || \ + defined(__MIPSEL__) +# undef MSGPACK_ENDIAN_LITTLE_BYTE +# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +/* Some architectures are strictly one endianess (as opposed + * the current common bi-endianess). + */ +#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \ + !MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD +# include +# if MSGPACK_ARCH_M68K || \ + MSGPACK_ARCH_PARISC || \ + MSGPACK_ARCH_SPARC || \ + MSGPACK_ARCH_SYS370 || \ + MSGPACK_ARCH_SYS390 || \ + MSGPACK_ARCH_Z +# undef MSGPACK_ENDIAN_BIG_BYTE +# define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +# if MSGPACK_ARCH_IA64 || \ + MSGPACK_ARCH_X86 || \ + MSGPACK_ARCH_BLACKFIN +# undef MSGPACK_ENDIAN_LITTLE_BYTE +# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +/* Windows on ARM, if not otherwise detected/specified, is always + * byte-swaped little-endian. + */ +#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \ + !MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD +# if MSGPACK_ARCH_ARM +# include +# if MSGPACK_OS_WINDOWS +# undef MSGPACK_ENDIAN_LITTLE_BYTE +# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +# endif +#endif + +#if MSGPACK_ENDIAN_BIG_BYTE +# define MSGPACK_ENDIAN_BIG_BYTE_AVAILABLE +#endif +#if MSGPACK_ENDIAN_BIG_WORD +# define MSGPACK_ENDIAN_BIG_WORD_BYTE_AVAILABLE +#endif +#if MSGPACK_ENDIAN_LITTLE_BYTE +# define MSGPACK_ENDIAN_LITTLE_BYTE_AVAILABLE +#endif +#if MSGPACK_ENDIAN_LITTLE_WORD +# define MSGPACK_ENDIAN_LITTLE_WORD_BYTE_AVAILABLE +#endif + +#define MSGPACK_ENDIAN_BIG_BYTE_NAME "Byte-Swapped Big-Endian" +#define MSGPACK_ENDIAN_BIG_WORD_NAME "Word-Swapped Big-Endian" +#define MSGPACK_ENDIAN_LITTLE_BYTE_NAME "Byte-Swapped Little-Endian" +#define MSGPACK_ENDIAN_LITTLE_WORD_NAME "Word-Swapped Little-Endian" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ENDIAN_BIG_BYTE,MSGPACK_ENDIAN_BIG_BYTE_NAME) + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ENDIAN_BIG_WORD,MSGPACK_ENDIAN_BIG_WORD_NAME) + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ENDIAN_LITTLE_BYTE,MSGPACK_ENDIAN_LITTLE_BYTE_NAME) + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ENDIAN_LITTLE_WORD,MSGPACK_ENDIAN_LITTLE_WORD_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/other/workaround.h b/msgpackc/3.2.1/include/msgpack/predef/other/workaround.h new file mode 100644 index 0000000000000000000000000000000000000000..998c4687d5fc6da833c2dbba9bc9da7c0eb1d69a --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/other/workaround.h @@ -0,0 +1,87 @@ +/* +Copyright Rene Rivera 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_WORKAROUND_H +#define MSGPACK_PREDEF_WORKAROUND_H + +/*` +[heading `MSGPACK_PREDEF_WORKAROUND`] + +`` +MSGPACK_PREDEF_WORKAROUND(symbol,comp,major,minor,patch) +`` + +Usage: + +`` +#if MSGPACK_PREDEF_WORKAROUND(MSGPACK_COMP_CLANG,<,3,0,0) + // Workaround for old clang compilers.. +#endif +`` + +Defines a comparison against two version numbers that depends on the definion +of `MSGPACK_STRICT_CONFIG`. When `MSGPACK_STRICT_CONFIG` is defined this will expand +to a value convertible to `false`. Which has the effect of disabling all code +conditionally guarded by `MSGPACK_PREDEF_WORKAROUND`. When `MSGPACK_STRICT_CONFIG` +is undefine this expand to test the given `symbol` version value with the +`comp` comparison against `MSGPACK_VERSION_NUMBER(major,minor,patch)`. +*/ +#ifdef MSGPACK_STRICT_CONFIG +# define MSGPACK_PREDEF_WORKAROUND(symbol, comp, major, minor, patch) (0) +#else +# include +# define MSGPACK_PREDEF_WORKAROUND(symbol, comp, major, minor, patch) \ + ( (symbol) != (0) ) && \ + ( (symbol) comp (MSGPACK_VERSION_NUMBER( (major) , (minor) , (patch) )) ) +#endif + +/*` +[heading `MSGPACK_PREDEF_TESTED_AT`] + +`` +MSGPACK_PREDEF_TESTED_AT(symbol,major,minor,patch) +`` + +Usage: + +`` +#if MSGPACK_PREDEF_TESTED_AT(MSGPACK_COMP_CLANG,3,5,0) + // Needed for clang, and last checked for 3.5.0. +#endif +`` + +Defines a comparison against two version numbers that depends on the definion +of `MSGPACK_STRICT_CONFIG` and `MSGPACK_DETECT_OUTDATED_WORKAROUNDS`. +When `MSGPACK_STRICT_CONFIG` is defined this will expand to a value convertible +to `false`. Which has the effect of disabling all code +conditionally guarded by `MSGPACK_PREDEF_TESTED_AT`. When `MSGPACK_STRICT_CONFIG` +is undefined this expand to either: + +* A value convertible to `true` when `MSGPACK_DETECT_OUTDATED_WORKAROUNDS` is not + defined. +* A value convertible `true` when the expansion of + `MSGPACK_PREDEF_WORKAROUND(symbol, <=, major, minor, patch)` is `true` and + `MSGPACK_DETECT_OUTDATED_WORKAROUNDS` is defined. +* A compile error when the expansion of + `MSGPACK_PREDEF_WORKAROUND(symbol, >, major, minor, patch)` is true and + `MSGPACK_DETECT_OUTDATED_WORKAROUNDS` is defined. +*/ +#ifdef MSGPACK_STRICT_CONFIG +# define MSGPACK_PREDEF_TESTED_AT(symbol, major, minor, patch) (0) +#else +# ifdef MSGPACK_DETECT_OUTDATED_WORKAROUNDS +# define MSGPACK_PREDEF_TESTED_AT(symbol, major, minor, patch) ( \ + MSGPACK_PREDEF_WORKAROUND(symbol, <=, major, minor, patch) \ + ? 1 \ + : (1%0) ) +# else +# define MSGPACK_PREDEF_TESTED_AT(symbol, major, minor, patch) \ + ( (symbol) >= MSGPACK_VERSION_NUMBER_AVAILABLE ) +# endif +#endif + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform.h b/msgpackc/3.2.1/include/msgpack/predef/platform.h new file mode 100644 index 0000000000000000000000000000000000000000..0176b4650279e72db35330ba5cdd1433bdd849fd --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform.h @@ -0,0 +1,28 @@ +/* +Copyright Rene Rivera 2013-2015 +Copyright (c) Microsoft Corporation 2014 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#if !defined(MSGPACK_PREDEF_PLATFORM_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS) +#ifndef MSGPACK_PREDEF_PLATFORM_H +#define MSGPACK_PREDEF_PLATFORM_H +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // deprecated +#include +/*#include */ + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform/cloudabi.h b/msgpackc/3.2.1/include/msgpack/predef/platform/cloudabi.h new file mode 100644 index 0000000000000000000000000000000000000000..66ece6e008b0fa826e813f3555c17154ac544316 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform/cloudabi.h @@ -0,0 +1,43 @@ +/* + Copyright 2017 James E. King, III + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_CLOUDABI_H +#define MSGPACK_PREDEF_PLAT_CLOUDABI_H + +#include +#include + +/*` +[heading `MSGPACK_PLAT_CLOUDABI`] + +[@https://github.com/NuxiNL/cloudabi CloudABI] platform. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__CloudABI__`] [__predef_detection__]] + ] + */ + +#define MSGPACK_PLAT_CLOUDABI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__CloudABI__) +# undef MSGPACK_PLAT_CLOUDABI +# define MSGPACK_PLAT_CLOUDABI MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_PLAT_CLOUDABI +# define MSGPACK_PLAT_CLOUDABI_AVAILABLE +# include +#endif + +#define MSGPACK_PLAT_CLOUDABI_NAME "CloudABI" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_CLOUDABI,MSGPACK_PLAT_CLOUDABI_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform/ios.h b/msgpackc/3.2.1/include/msgpack/predef/platform/ios.h new file mode 100644 index 0000000000000000000000000000000000000000..c3d27f83216b9fd40ab3c492ec79de847aa39ede --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform/ios.h @@ -0,0 +1,58 @@ +/* +Copyright Ruslan Baratov 2017 +Copyright Rene Rivera 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_IOS_H +#define MSGPACK_PREDEF_PLAT_IOS_H + +#include // MSGPACK_OS_IOS +#include // MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +/*` +[heading `MSGPACK_PLAT_IOS_DEVICE`] +[heading `MSGPACK_PLAT_IOS_SIMULATOR`] + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`TARGET_IPHONE_SIMULATOR`] [__predef_detection__]] + ] + */ + +#define MSGPACK_PLAT_IOS_DEVICE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#define MSGPACK_PLAT_IOS_SIMULATOR MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h +#if MSGPACK_OS_IOS +# include +# if TARGET_IPHONE_SIMULATOR == 1 +# undef MSGPACK_PLAT_IOS_SIMULATOR +# define MSGPACK_PLAT_IOS_SIMULATOR MSGPACK_VERSION_NUMBER_AVAILABLE +# else +# undef MSGPACK_PLAT_IOS_DEVICE +# define MSGPACK_PLAT_IOS_DEVICE MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if MSGPACK_PLAT_IOS_SIMULATOR +# define MSGPACK_PLAT_IOS_SIMULATOR_AVAILABLE +# include +#endif + +#if MSGPACK_PLAT_IOS_DEVICE +# define MSGPACK_PLAT_IOS_DEVICE_AVAILABLE +# include +#endif + +#define MSGPACK_PLAT_IOS_SIMULATOR_NAME "iOS Simulator" +#define MSGPACK_PLAT_IOS_DEVICE_NAME "iOS Device" + +#endif // MSGPACK_PREDEF_PLAT_IOS_H + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_IOS_SIMULATOR,MSGPACK_PLAT_IOS_SIMULATOR_NAME) +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_IOS_DEVICE,MSGPACK_PLAT_IOS_DEVICE_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform/mingw.h b/msgpackc/3.2.1/include/msgpack/predef/platform/mingw.h new file mode 100644 index 0000000000000000000000000000000000000000..74f1b548106aee5f423dac4230a44fa085295df4 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform/mingw.h @@ -0,0 +1,69 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_MINGW_H +#define MSGPACK_PREDEF_PLAT_MINGW_H + +#include +#include + +/*` +[heading `MSGPACK_PLAT_MINGW`] + +[@http://en.wikipedia.org/wiki/MinGW MinGW] platform, either variety. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MINGW32__`] [__predef_detection__]] + [[`__MINGW64__`] [__predef_detection__]] + + [[`__MINGW64_VERSION_MAJOR`, `__MINGW64_VERSION_MINOR`] [V.R.0]] + [[`__MINGW32_VERSION_MAJOR`, `__MINGW32_VERSION_MINOR`] [V.R.0]] + ] + */ + +#define MSGPACK_PLAT_MINGW MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MINGW32__) || defined(__MINGW64__) +# include <_mingw.h> +# if !defined(MSGPACK_PLAT_MINGW_DETECTION) && (defined(__MINGW64_VERSION_MAJOR) && defined(__MINGW64_VERSION_MINOR)) +# define MSGPACK_PLAT_MINGW_DETECTION \ + MSGPACK_VERSION_NUMBER(__MINGW64_VERSION_MAJOR,__MINGW64_VERSION_MINOR,0) +# endif +# if !defined(MSGPACK_PLAT_MINGW_DETECTION) && (defined(__MINGW32_VERSION_MAJOR) && defined(__MINGW32_VERSION_MINOR)) +# define MSGPACK_PLAT_MINGW_DETECTION \ + MSGPACK_VERSION_NUMBER(__MINGW32_MAJOR_VERSION,__MINGW32_MINOR_VERSION,0) +# endif +# if !defined(MSGPACK_PLAT_MINGW_DETECTION) +# define MSGPACK_PLAT_MINGW_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_PLAT_MINGW_DETECTION +# define MSGPACK_PLAT_MINGW_AVAILABLE +# if defined(MSGPACK_PREDEF_DETAIL_PLAT_DETECTED) +# define MSGPACK_PLAT_MINGW_EMULATED MSGPACK_PLAT_MINGW_DETECTION +# else +# undef MSGPACK_PLAT_MINGW +# define MSGPACK_PLAT_MINGW MSGPACK_PLAT_MINGW_DETECTION +# endif +# include +#endif + +#define MSGPACK_PLAT_MINGW_NAME "MinGW (any variety)" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_MINGW,MSGPACK_PLAT_MINGW_NAME) + +#ifdef MSGPACK_PLAT_MINGW_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_MINGW_EMULATED,MSGPACK_PLAT_MINGW_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform/mingw32.h b/msgpackc/3.2.1/include/msgpack/predef/platform/mingw32.h new file mode 100644 index 0000000000000000000000000000000000000000..5d28f8289190aa66b1061f16dab7d7b535901777 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform/mingw32.h @@ -0,0 +1,63 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_MINGW32_H +#define MSGPACK_PREDEF_PLAT_MINGW32_H + +#include +#include + +/*` +[heading `MSGPACK_PLAT_MINGW32`] + +[@http://www.mingw.org/ MinGW] platform. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MINGW32__`] [__predef_detection__]] + + [[`__MINGW32_VERSION_MAJOR`, `__MINGW32_VERSION_MINOR`] [V.R.0]] + ] + */ + +#define MSGPACK_PLAT_MINGW32 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MINGW32__) +# include <_mingw.h> +# if !defined(MSGPACK_PLAT_MINGW32_DETECTION) && (defined(__MINGW32_VERSION_MAJOR) && defined(__MINGW32_VERSION_MINOR)) +# define MSGPACK_PLAT_MINGW32_DETECTION \ + MSGPACK_VERSION_NUMBER(__MINGW32_VERSION_MAJOR,__MINGW32_VERSION_MINOR,0) +# endif +# if !defined(MSGPACK_PLAT_MINGW32_DETECTION) +# define MSGPACK_PLAT_MINGW32_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_PLAT_MINGW32_DETECTION +# define MSGPACK_PLAT_MINGW32_AVAILABLE +# if defined(MSGPACK_PREDEF_DETAIL_PLAT_DETECTED) +# define MSGPACK_PLAT_MINGW32_EMULATED MSGPACK_PLAT_MINGW32_DETECTION +# else +# undef MSGPACK_PLAT_MINGW32 +# define MSGPACK_PLAT_MINGW32 MSGPACK_PLAT_MINGW32_DETECTION +# endif +# include +#endif + +#define MSGPACK_PLAT_MINGW32_NAME "MinGW" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_MINGW32,MSGPACK_PLAT_MINGW32_NAME) + +#ifdef MSGPACK_PLAT_MINGW32_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_MINGW32_EMULATED,MSGPACK_PLAT_MINGW32_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform/mingw64.h b/msgpackc/3.2.1/include/msgpack/predef/platform/mingw64.h new file mode 100644 index 0000000000000000000000000000000000000000..544b27b39a0dfc545c2e3cb4d8e2be4abfc234c8 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform/mingw64.h @@ -0,0 +1,63 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_MINGW64_H +#define MSGPACK_PREDEF_PLAT_MINGW64_H + +#include +#include + +/*` +[heading `MSGPACK_PLAT_MINGW64`] + +[@https://mingw-w64.org/ MinGW-w64] platform. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MINGW64__`] [__predef_detection__]] + + [[`__MINGW64_VERSION_MAJOR`, `__MINGW64_VERSION_MINOR`] [V.R.0]] + ] + */ + +#define MSGPACK_PLAT_MINGW64 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MINGW64__) +# include <_mingw.h> +# if !defined(MSGPACK_PLAT_MINGW64_DETECTION) && (defined(__MINGW64_VERSION_MAJOR) && defined(__MINGW64_VERSION_MINOR)) +# define MSGPACK_PLAT_MINGW64_DETECTION \ + MSGPACK_VERSION_NUMBER(__MINGW64_VERSION_MAJOR,__MINGW64_VERSION_MINOR,0) +# endif +# if !defined(MSGPACK_PLAT_MINGW64_DETECTION) +# define MSGPACK_PLAT_MINGW64_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef MSGPACK_PLAT_MINGW64_DETECTION +# define MSGPACK_PLAT_MINGW64_AVAILABLE +# if defined(MSGPACK_PREDEF_DETAIL_PLAT_DETECTED) +# define MSGPACK_PLAT_MINGW64_EMULATED MSGPACK_PLAT_MINGW64_DETECTION +# else +# undef MSGPACK_PLAT_MINGW64 +# define MSGPACK_PLAT_MINGW64 MSGPACK_PLAT_MINGW64_DETECTION +# endif +# include +#endif + +#define MSGPACK_PLAT_MINGW64_NAME "MinGW-w64" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_MINGW64,MSGPACK_PLAT_MINGW64_NAME) + +#ifdef MSGPACK_PLAT_MINGW64_EMULATED +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_MINGW64_EMULATED,MSGPACK_PLAT_MINGW64_NAME) +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform/windows_desktop.h b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_desktop.h new file mode 100644 index 0000000000000000000000000000000000000000..8e69c77cd9f47cbdb0c2c60151d3b3c39bce7126 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_desktop.h @@ -0,0 +1,51 @@ +/* +Copyright (c) Microsoft Corporation 2014 +Copyright Rene Rivera 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_WINDOWS_DESKTOP_H +#define MSGPACK_PREDEF_PLAT_WINDOWS_DESKTOP_H + +#include +#include +#include +#include + +/*` +[heading `MSGPACK_PLAT_WINDOWS_DESKTOP`] + +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Desktop development. Also available if the Platform SDK is too +old to support UWP. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP`] [__predef_detection__]] + [[`!MSGPACK_PLAT_WINDOWS_UWP`] [__predef_detection__]] + ] + */ + +#define MSGPACK_PLAT_WINDOWS_DESKTOP MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if MSGPACK_OS_WINDOWS && \ + ((defined(WINAPI_FAMILY_DESKTOP_APP) && WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) || \ + !MSGPACK_PLAT_WINDOWS_UWP) +# undef MSGPACK_PLAT_WINDOWS_DESKTOP +# define MSGPACK_PLAT_WINDOWS_DESKTOP MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_PLAT_WINDOWS_DESKTOP +# define MSGPACK_PLAT_WINDOWS_DESKTOP_AVAILABLE +# include +#endif + +#define MSGPACK_PLAT_WINDOWS_DESKTOP_NAME "Windows Desktop" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_DESKTOP,MSGPACK_PLAT_WINDOWS_DESKTOP_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform/windows_phone.h b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_phone.h new file mode 100644 index 0000000000000000000000000000000000000000..8ac423fc34b1b3ad0341d5ad7da5ec648cb97da5 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_phone.h @@ -0,0 +1,48 @@ +/* +Copyright (c) Microsoft Corporation 2014 +Copyright Rene Rivera 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_WINDOWS_PHONE_H +#define MSGPACK_PREDEF_PLAT_WINDOWS_PHONE_H + +#include +#include +#include +#include + +/*` +[heading `MSGPACK_PLAT_WINDOWS_PHONE`] + +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Phone development. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP`] [__predef_detection__]] + ] + */ + +#define MSGPACK_PLAT_WINDOWS_PHONE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if MSGPACK_OS_WINDOWS && \ + defined(WINAPI_FAMILY_PHONE_APP) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +# undef MSGPACK_PLAT_WINDOWS_PHONE +# define MSGPACK_PLAT_WINDOWS_PHONE MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_PLAT_WINDOWS_PHONE +# define MSGPACK_PLAT_WINDOWS_PHONE_AVAILABLE +# include +#endif + +#define MSGPACK_PLAT_WINDOWS_PHONE_NAME "Windows Phone" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_PHONE,MSGPACK_PLAT_WINDOWS_PHONE_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform/windows_runtime.h b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_runtime.h new file mode 100644 index 0000000000000000000000000000000000000000..db7e76b4f70b10b7f5d031be59802be4094bb4d5 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_runtime.h @@ -0,0 +1,53 @@ +/* +Copyright (c) Microsoft Corporation 2014 +Copyright Rene Rivera 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_WINDOWS_RUNTIME_H +#define MSGPACK_PREDEF_PLAT_WINDOWS_RUNTIME_H + +#include +#include +#include +#include +#include + +/*` +[heading `MSGPACK_PLAT_WINDOWS_RUNTIME`] + +Deprecated. + +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Phone or Store development. This does not align to the existing development model for +UWP and is deprecated. Use one of the other `MSGPACK_PLAT_WINDOWS_*`definitions instead. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`MSGPACK_PLAT_WINDOWS_PHONE`] [__predef_detection__]] + [[`MSGPACK_PLAT_WINDOWS_STORE`] [__predef_detection__]] + ] + */ + +#define MSGPACK_PLAT_WINDOWS_RUNTIME MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if MSGPACK_OS_WINDOWS && \ + (MSGPACK_PLAT_WINDOWS_STORE || MSGPACK_PLAT_WINDOWS_PHONE) +# undef MSGPACK_PLAT_WINDOWS_RUNTIME +# define MSGPACK_PLAT_WINDOWS_RUNTIME MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_PLAT_WINDOWS_RUNTIME +# define MSGPACK_PLAT_WINDOWS_RUNTIME_AVAILABLE +# include +#endif + +#define MSGPACK_PLAT_WINDOWS_RUNTIME_NAME "Windows Runtime" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_RUNTIME,MSGPACK_PLAT_WINDOWS_RUNTIME_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform/windows_server.h b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_server.h new file mode 100644 index 0000000000000000000000000000000000000000..3506155ec32512eeb76f959ba44a0d284a36b4e6 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_server.h @@ -0,0 +1,47 @@ +/* +Copyright James E. King III, 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_WINDOWS_SERVER_H +#define MSGPACK_PREDEF_PLAT_WINDOWS_SERVER_H + +#include +#include +#include +#include + +/*` +[heading `MSGPACK_PLAT_WINDOWS_SERVER`] + +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Server development. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`WINAPI_FAMILY == WINAPI_FAMILY_SERVER`] [__predef_detection__]] + ] + */ + +#define MSGPACK_PLAT_WINDOWS_SERVER MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if MSGPACK_OS_WINDOWS && \ + defined(WINAPI_FAMILY_SERVER) && WINAPI_FAMILY == WINAPI_FAMILY_SERVER +# undef MSGPACK_PLAT_WINDOWS_SERVER +# define MSGPACK_PLAT_WINDOWS_SERVER MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_PLAT_WINDOWS_SERVER +# define MSGPACK_PLAT_WINDOWS_SERVER_AVAILABLE +# include +#endif + +#define MSGPACK_PLAT_WINDOWS_SERVER_NAME "Windows Server" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_SERVER,MSGPACK_PLAT_WINDOWS_SERVER_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform/windows_store.h b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_store.h new file mode 100644 index 0000000000000000000000000000000000000000..d9faf1a59fa6345950f1a001bf5d672214f1243a --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_store.h @@ -0,0 +1,50 @@ +/* +Copyright (c) Microsoft Corporation 2014 +Copyright Rene Rivera 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_WINDOWS_STORE_H +#define MSGPACK_PREDEF_PLAT_WINDOWS_STORE_H + +#include +#include +#include +#include + +/*` +[heading `MSGPACK_PLAT_WINDOWS_STORE`] + +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Store development. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`WINAPI_FAMILY == WINAPI_FAMILY_PC_APP`] [__predef_detection__]] + [[`WINAPI_FAMILY == WINAPI_FAMILY_APP` (deprecated)] [__predef_detection__]] +] + */ + +#define MSGPACK_PLAT_WINDOWS_STORE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if MSGPACK_OS_WINDOWS && \ + ((defined(WINAPI_FAMILY_PC_APP) && WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) || \ + (defined(WINAPI_FAMILY_APP) && WINAPI_FAMILY == WINAPI_FAMILY_APP)) +# undef MSGPACK_PLAT_WINDOWS_STORE +# define MSGPACK_PLAT_WINDOWS_STORE MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_PLAT_WINDOWS_STORE +# define MSGPACK_PLAT_WINDOWS_STORE_AVAILABLE +# include +#endif + +#define MSGPACK_PLAT_WINDOWS_STORE_NAME "Windows Store" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_STORE,MSGPACK_PLAT_WINDOWS_STORE_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform/windows_system.h b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_system.h new file mode 100644 index 0000000000000000000000000000000000000000..c97b0e26883cbd4a02abcbd151a22b06fff237ff --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_system.h @@ -0,0 +1,47 @@ +/* +Copyright James E. King III, 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_WINDOWS_SYSTEM_H +#define MSGPACK_PREDEF_PLAT_WINDOWS_SYSTEM_H + +#include +#include +#include +#include + +/*` +[heading `MSGPACK_PLAT_WINDOWS_SYSTEM`] + +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows System development. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM`] [__predef_detection__]] + ] + */ + +#define MSGPACK_PLAT_WINDOWS_SYSTEM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if MSGPACK_OS_WINDOWS && \ + defined(WINAPI_FAMILY_SYSTEM) && WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM +# undef MSGPACK_PLAT_WINDOWS_SYSTEM +# define MSGPACK_PLAT_WINDOWS_SYSTEM MSGPACK_VERSION_NUMBER_AVAILABLE +#endif + +#if MSGPACK_PLAT_WINDOWS_SYSTEM +# define MSGPACK_PLAT_WINDOWS_SYSTEM_AVAILABLE +# include +#endif + +#define MSGPACK_PLAT_WINDOWS_SYSTEM_NAME "Windows Drivers and Tools" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_SYSTEM,MSGPACK_PLAT_WINDOWS_SYSTEM_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/platform/windows_uwp.h b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_uwp.h new file mode 100644 index 0000000000000000000000000000000000000000..abf1916afdd437779c4086e3ca10ec58e4e45186 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/platform/windows_uwp.h @@ -0,0 +1,60 @@ +/* +Copyright James E. King III, 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_PLAT_WINDOWS_UWP_H +#define MSGPACK_PREDEF_PLAT_WINDOWS_UWP_H + +#include +#include +#include + +/*` +[heading `MSGPACK_PLAT_WINDOWS_UWP`] + +[@http://docs.microsoft.com/windows/uwp/ Universal Windows Platform] +is available if the current development environment is capable of targeting +UWP development. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MINGW64_VERSION_MAJOR` from `_mingw.h`] [`>= 3`]] + [[`VER_PRODUCTBUILD` from `ntverp.h`] [`>= 9200`]] +] +*/ + +#define MSGPACK_PLAT_WINDOWS_UWP MSGPACK_VERSION_NUMBER_NOT_AVAILABLE +#define MSGPACK_PLAT_WINDOWS_SDK_VERSION MSGPACK_VERSION_NUMBER_NOT_AVAILABLE + +#if MSGPACK_OS_WINDOWS +// MinGW (32-bit) has no ntverp.h header +#if !defined(__MINGW32__) +# include +# undef MSGPACK_PLAT_WINDOWS_SDK_VERSION +# define MSGPACK_PLAT_WINDOWS_SDK_VERSION MSGPACK_VERSION_NUMBER(0, 0, VER_PRODUCTBUILD) +#endif + +// 9200 is Windows SDK 8.0 from ntverp.h which introduced family support +#if ((MSGPACK_PLAT_WINDOWS_SDK_VERSION >= MSGPACK_VERSION_NUMBER(0, 0, 9200)) || \ + (defined(__MINGW64__) && __MINGW64_VERSION_MAJOR >= 3)) +# undef MSGPACK_PLAT_WINDOWS_UWP +# define MSGPACK_PLAT_WINDOWS_UWP MSGPACK_VERSION_NUMBER_AVAILABLE +#endif +#endif + +#if MSGPACK_PLAT_WINDOWS_UWP +# define MSGPACK_PLAT_WINDOWS_UWP_AVAILABLE +# include +# include // Windows SDK +#endif + +#define MSGPACK_PLAT_WINDOWS_UWP_NAME "Universal Windows Platform" + +#endif + +#include +MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_UWP, MSGPACK_PLAT_WINDOWS_UWP_NAME) diff --git a/msgpackc/3.2.1/include/msgpack/predef/version.h b/msgpackc/3.2.1/include/msgpack/predef/version.h new file mode 100644 index 0000000000000000000000000000000000000000..adacf28f14c711661678658e1b8d81bd58924796 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/version.h @@ -0,0 +1,15 @@ +/* +Copyright Rene Rivera 2015-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_VERSION_H +#define MSGPACK_PREDEF_VERSION_H + +#include + +#define MSGPACK_PREDEF_VERSION MSGPACK_VERSION_NUMBER(1,8,0) + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/predef/version_number.h b/msgpackc/3.2.1/include/msgpack/predef/version_number.h new file mode 100644 index 0000000000000000000000000000000000000000..593afab0d7c9026003242b76e4eb53dac0064216 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/predef/version_number.h @@ -0,0 +1,72 @@ +/* +Copyright Rene Rivera 2005-2016 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef MSGPACK_PREDEF_VERSION_NUMBER_H +#define MSGPACK_PREDEF_VERSION_NUMBER_H + +/*` +[heading `MSGPACK_VERSION_NUMBER`] + +`` +MSGPACK_VERSION_NUMBER(major,minor,patch) +`` + +Defines standard version numbers, with these properties: + +* Decimal base whole numbers in the range \[0,1000000000). + The number range is designed to allow for a (2,2,5) triplet. + Which fits within a 32 bit value. +* The `major` number can be in the \[0,99\] range. +* The `minor` number can be in the \[0,99\] range. +* The `patch` number can be in the \[0,99999\] range. +* Values can be specified in any base. As the defined value + is an constant expression. +* Value can be directly used in both preprocessor and compiler + expressions for comparison to other similarly defined values. +* The implementation enforces the individual ranges for the + major, minor, and patch numbers. And values over the ranges + are truncated (modulo). + +*/ +#define MSGPACK_VERSION_NUMBER(major,minor,patch) \ + ( (((major)%100)*10000000) + (((minor)%100)*100000) + ((patch)%100000) ) + +#define MSGPACK_VERSION_NUMBER_MAX \ + MSGPACK_VERSION_NUMBER(99,99,99999) + +#define MSGPACK_VERSION_NUMBER_ZERO \ + MSGPACK_VERSION_NUMBER(0,0,0) + +#define MSGPACK_VERSION_NUMBER_MIN \ + MSGPACK_VERSION_NUMBER(0,0,1) + +#define MSGPACK_VERSION_NUMBER_AVAILABLE \ + MSGPACK_VERSION_NUMBER_MIN + +#define MSGPACK_VERSION_NUMBER_NOT_AVAILABLE \ + MSGPACK_VERSION_NUMBER_ZERO + +/*` +`` +MSGPACK_VERSION_NUMBER_MAJOR(N), MSGPACK_VERSION_NUMBER_MINOR(N), MSGPACK_VERSION_NUMBER_PATCH(N) +`` + +The macros extract the major, minor, and patch portion from a well formed +version number resulting in a preprocessor expression in the range of +\[0,99\] or \[0,99999\] for the major and minor, or patch numbers +respectively. +*/ +#define MSGPACK_VERSION_NUMBER_MAJOR(N) \ + ( ((N)/10000000)%100 ) + +#define MSGPACK_VERSION_NUMBER_MINOR(N) \ + ( ((N)/100000)%100 ) + +#define MSGPACK_VERSION_NUMBER_PATCH(N) \ + ( (N)%100000 ) + +#endif diff --git a/msgpackc/3.2.1/include/msgpack/sbuffer.h b/msgpackc/3.2.1/include/msgpack/sbuffer.h new file mode 100644 index 0000000000000000000000000000000000000000..c494bae77a5e13225fb5f020e6eee0fd268397d9 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/sbuffer.h @@ -0,0 +1,110 @@ +/* + * MessagePack for C simple buffer implementation + * + * Copyright (C) 2008-2009 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_SBUFFER_H +#define MSGPACK_SBUFFER_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @defgroup msgpack_sbuffer Simple buffer + * @ingroup msgpack_buffer + * @{ + */ + +typedef struct msgpack_sbuffer { + size_t size; + char* data; + size_t alloc; +} msgpack_sbuffer; + +static inline void msgpack_sbuffer_init(msgpack_sbuffer* sbuf) +{ + memset(sbuf, 0, sizeof(msgpack_sbuffer)); +} + +static inline void msgpack_sbuffer_destroy(msgpack_sbuffer* sbuf) +{ + free(sbuf->data); +} + +static inline msgpack_sbuffer* msgpack_sbuffer_new(void) +{ + return (msgpack_sbuffer*)calloc(1, sizeof(msgpack_sbuffer)); +} + +static inline void msgpack_sbuffer_free(msgpack_sbuffer* sbuf) +{ + if(sbuf == NULL) { return; } + msgpack_sbuffer_destroy(sbuf); + free(sbuf); +} + +#ifndef MSGPACK_SBUFFER_INIT_SIZE +#define MSGPACK_SBUFFER_INIT_SIZE 8192 +#endif + +static inline int msgpack_sbuffer_write(void* data, const char* buf, size_t len) +{ + msgpack_sbuffer* sbuf = (msgpack_sbuffer*)data; + + if(sbuf->alloc - sbuf->size < len) { + void* tmp; + size_t nsize = (sbuf->alloc) ? + sbuf->alloc * 2 : MSGPACK_SBUFFER_INIT_SIZE; + + while(nsize < sbuf->size + len) { + size_t tmp_nsize = nsize * 2; + if (tmp_nsize <= nsize) { + nsize = sbuf->size + len; + break; + } + nsize = tmp_nsize; + } + + tmp = realloc(sbuf->data, nsize); + if(!tmp) { return -1; } + + sbuf->data = (char*)tmp; + sbuf->alloc = nsize; + } + + memcpy(sbuf->data + sbuf->size, buf, len); + sbuf->size += len; + return 0; +} + +static inline char* msgpack_sbuffer_release(msgpack_sbuffer* sbuf) +{ + char* tmp = sbuf->data; + sbuf->size = 0; + sbuf->data = NULL; + sbuf->alloc = 0; + return tmp; +} + +static inline void msgpack_sbuffer_clear(msgpack_sbuffer* sbuf) +{ + sbuf->size = 0; +} + +/** @} */ + + +#ifdef __cplusplus +} +#endif + +#endif /* msgpack/sbuffer.h */ diff --git a/msgpackc/3.2.1/include/msgpack/sysdep.h b/msgpackc/3.2.1/include/msgpack/sysdep.h new file mode 100644 index 0000000000000000000000000000000000000000..a1967338d7ea9c85808ff0161c2680069df89fad --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/sysdep.h @@ -0,0 +1,214 @@ +/* + * MessagePack system dependencies + * + * Copyright (C) 2008-2010 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_SYSDEP_H +#define MSGPACK_SYSDEP_H + +#include +#include + +#if defined(_MSC_VER) && _MSC_VER <= 1800 +# define snprintf(buf, len, format,...) _snprintf_s(buf, len, _TRUNCATE, format, __VA_ARGS__) +#endif + +#if defined(_MSC_VER) && _MSC_VER < 1600 + typedef signed __int8 int8_t; + typedef unsigned __int8 uint8_t; + typedef signed __int16 int16_t; + typedef unsigned __int16 uint16_t; + typedef signed __int32 int32_t; + typedef unsigned __int32 uint32_t; + typedef signed __int64 int64_t; + typedef unsigned __int64 uint64_t; +#elif defined(_MSC_VER) // && _MSC_VER >= 1600 +# include +#else +# include +# include +#endif + +#if !defined(MSGPACK_DLLEXPORT) +#if defined(_MSC_VER) +# define MSGPACK_DLLEXPORT __declspec(dllexport) +#else /* _MSC_VER */ +# define MSGPACK_DLLEXPORT +#endif /* _MSC_VER */ +#endif + +#ifdef _WIN32 +# if defined(_KERNEL_MODE) +# define _msgpack_atomic_counter_header +# else +# define _msgpack_atomic_counter_header +# if !defined(WIN32_LEAN_AND_MEAN) +# define WIN32_LEAN_AND_MEAN +# endif /* WIN32_LEAN_AND_MEAN */ +# endif + typedef long _msgpack_atomic_counter_t; +#if defined(_AMD64_) || defined(_M_X64) || defined(_M_ARM64) +# define _msgpack_sync_decr_and_fetch(ptr) _InterlockedDecrement(ptr) +# define _msgpack_sync_incr_and_fetch(ptr) _InterlockedIncrement(ptr) +#else +# define _msgpack_sync_decr_and_fetch(ptr) InterlockedDecrement(ptr) +# define _msgpack_sync_incr_and_fetch(ptr) InterlockedIncrement(ptr) +#endif +#elif defined(__GNUC__) && ((__GNUC__*10 + __GNUC_MINOR__) < 41) + +# if defined(__cplusplus) +# define _msgpack_atomic_counter_header "msgpack/gcc_atomic.hpp" +# else +# define _msgpack_atomic_counter_header "msgpack/gcc_atomic.h" +# endif + +#else + typedef unsigned int _msgpack_atomic_counter_t; +# define _msgpack_sync_decr_and_fetch(ptr) __sync_sub_and_fetch(ptr, 1) +# define _msgpack_sync_incr_and_fetch(ptr) __sync_add_and_fetch(ptr, 1) +#endif + +#ifdef _WIN32 + +# ifdef __cplusplus + /* numeric_limits::min,max */ +# ifdef max +# undef max +# endif +# ifdef min +# undef min +# endif +# endif + +#elif defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__) + +#include /* __BYTE_ORDER */ +# if defined(linux) +# include +# endif + +#endif + +#if !defined(MSGPACK_ENDIAN_LITTLE_BYTE) && !defined(MSGPACK_ENDIAN_BIG_BYTE) +#include +#endif // !defined(MSGPACK_ENDIAN_LITTLE_BYTE) && !defined(MSGPACK_ENDIAN_BIG_BYTE) + +#if MSGPACK_ENDIAN_LITTLE_BYTE + +# if defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__) +# define _msgpack_be16(x) ntohs((uint16_t)x) +# else +# if defined(ntohs) +# define _msgpack_be16(x) ntohs(x) +# elif defined(_byteswap_ushort) || (defined(_MSC_VER) && _MSC_VER >= 1400) +# define _msgpack_be16(x) ((uint16_t)_byteswap_ushort((unsigned short)x)) +# else +# define _msgpack_be16(x) ( \ + ((((uint16_t)x) << 8) ) | \ + ((((uint16_t)x) >> 8) ) ) +# endif +# endif + +# if defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__) +# define _msgpack_be32(x) ntohl((uint32_t)x) +# else +# if defined(ntohl) +# define _msgpack_be32(x) ntohl(x) +# elif defined(_byteswap_ulong) || (defined(_MSC_VER) && _MSC_VER >= 1400) +# define _msgpack_be32(x) ((uint32_t)_byteswap_ulong((unsigned long)x)) +# else +# define _msgpack_be32(x) \ + ( ((((uint32_t)x) << 24) ) | \ + ((((uint32_t)x) << 8) & 0x00ff0000U ) | \ + ((((uint32_t)x) >> 8) & 0x0000ff00U ) | \ + ((((uint32_t)x) >> 24) ) ) +# endif +# endif + +# if defined(_byteswap_uint64) || (defined(_MSC_VER) && _MSC_VER >= 1400) +# define _msgpack_be64(x) (_byteswap_uint64(x)) +# elif defined(bswap_64) +# define _msgpack_be64(x) bswap_64(x) +# elif defined(__DARWIN_OSSwapInt64) +# define _msgpack_be64(x) __DARWIN_OSSwapInt64(x) +# else +# define _msgpack_be64(x) \ + ( ((((uint64_t)x) << 56) ) | \ + ((((uint64_t)x) << 40) & 0x00ff000000000000ULL ) | \ + ((((uint64_t)x) << 24) & 0x0000ff0000000000ULL ) | \ + ((((uint64_t)x) << 8) & 0x000000ff00000000ULL ) | \ + ((((uint64_t)x) >> 8) & 0x00000000ff000000ULL ) | \ + ((((uint64_t)x) >> 24) & 0x0000000000ff0000ULL ) | \ + ((((uint64_t)x) >> 40) & 0x000000000000ff00ULL ) | \ + ((((uint64_t)x) >> 56) ) ) +# endif + +#elif MSGPACK_ENDIAN_BIG_BYTE + +# define _msgpack_be16(x) (x) +# define _msgpack_be32(x) (x) +# define _msgpack_be64(x) (x) + +#else +# error msgpack-c supports only big endian and little endian +#endif /* MSGPACK_ENDIAN_LITTLE_BYTE */ + +#define _msgpack_load16(cast, from, to) do { \ + memcpy((cast*)(to), (from), sizeof(cast)); \ + *(to) = (cast)_msgpack_be16(*(to)); \ + } while (0); + +#define _msgpack_load32(cast, from, to) do { \ + memcpy((cast*)(to), (from), sizeof(cast)); \ + *(to) = (cast)_msgpack_be32(*(to)); \ + } while (0); +#define _msgpack_load64(cast, from, to) do { \ + memcpy((cast*)(to), (from), sizeof(cast)); \ + *(to) = (cast)_msgpack_be64(*(to)); \ + } while (0); + +#define _msgpack_store16(to, num) \ + do { uint16_t val = _msgpack_be16(num); memcpy(to, &val, 2); } while(0) +#define _msgpack_store32(to, num) \ + do { uint32_t val = _msgpack_be32(num); memcpy(to, &val, 4); } while(0) +#define _msgpack_store64(to, num) \ + do { uint64_t val = _msgpack_be64(num); memcpy(to, &val, 8); } while(0) + +/* +#define _msgpack_load16(cast, from) \ + ({ cast val; memcpy(&val, (char*)from, 2); _msgpack_be16(val); }) +#define _msgpack_load32(cast, from) \ + ({ cast val; memcpy(&val, (char*)from, 4); _msgpack_be32(val); }) +#define _msgpack_load64(cast, from) \ + ({ cast val; memcpy(&val, (char*)from, 8); _msgpack_be64(val); }) +*/ + + +#if !defined(__cplusplus) && defined(_MSC_VER) +# if !defined(_KERNEL_MODE) +# if !defined(FALSE) +# define FALSE (0) +# endif +# if !defined(TRUE) +# define TRUE (!FALSE) +# endif +# endif +# if _MSC_VER >= 1800 +# include +# else +# define bool int +# define true TRUE +# define false FALSE +# endif +# define inline __inline +#endif + +#ifdef __APPLE__ +# include +#endif + +#endif /* msgpack/sysdep.h */ diff --git a/msgpackc/3.2.1/include/msgpack/timestamp.h b/msgpackc/3.2.1/include/msgpack/timestamp.h new file mode 100644 index 0000000000000000000000000000000000000000..7613931257f6f077b6734b64defd5bb078cc45d8 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/timestamp.h @@ -0,0 +1,58 @@ +/* + * MessagePack for C TimeStamp + * + * Copyright (C) 2018 KONDO Takatoshi + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_TIMESTAMP_H +#define MSGPACK_TIMESTAMP_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef struct msgpack_timestamp { + int64_t tv_sec; + uint32_t tv_nsec; +} msgpack_timestamp; + +static inline bool msgpack_object_to_timestamp(const msgpack_object* obj, msgpack_timestamp* ts) { + if (obj->type != MSGPACK_OBJECT_EXT) return false; + if (obj->via.ext.type != -1) return false; + switch (obj->via.ext.size) { + case 4: + ts->tv_nsec = 0; + { + uint32_t v; + _msgpack_load32(uint32_t, obj->via.ext.ptr, &v); + ts->tv_sec = v; + } + return true; + case 8: { + uint64_t value; + _msgpack_load64(uint64_t, obj->via.ext.ptr, &value); + ts->tv_nsec = (uint32_t)(value >> 34); + ts->tv_sec = value & 0x00000003ffffffffLL; + return true; + } + case 12: + _msgpack_load32(uint32_t, obj->via.ext.ptr, &ts->tv_nsec); + _msgpack_load64(int64_t, obj->via.ext.ptr + 4, &ts->tv_sec); + return true; + default: + return false; + } +} + + +#ifdef __cplusplus +} +#endif + +#endif /* msgpack/timestamp.h */ diff --git a/msgpackc/3.2.1/include/msgpack/unpack.h b/msgpackc/3.2.1/include/msgpack/unpack.h new file mode 100644 index 0000000000000000000000000000000000000000..036d575ebadec896105aa15f00cd4ebc5faaa3a3 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/unpack.h @@ -0,0 +1,281 @@ +/* + * MessagePack for C unpacking routine + * + * Copyright (C) 2008-2009 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_UNPACKER_H +#define MSGPACK_UNPACKER_H + +#include "zone.h" +#include "object.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @defgroup msgpack_unpack Deserializer + * @ingroup msgpack + * @{ + */ + +typedef struct msgpack_unpacked { + msgpack_zone* zone; + msgpack_object data; +} msgpack_unpacked; + +typedef enum { + MSGPACK_UNPACK_SUCCESS = 2, + MSGPACK_UNPACK_EXTRA_BYTES = 1, + MSGPACK_UNPACK_CONTINUE = 0, + MSGPACK_UNPACK_PARSE_ERROR = -1, + MSGPACK_UNPACK_NOMEM_ERROR = -2 +} msgpack_unpack_return; + + +MSGPACK_DLLEXPORT +msgpack_unpack_return +msgpack_unpack_next(msgpack_unpacked* result, + const char* data, size_t len, size_t* off); + +/** @} */ + + +/** + * @defgroup msgpack_unpacker Streaming deserializer + * @ingroup msgpack + * @{ + */ + +typedef struct msgpack_unpacker { + char* buffer; + size_t used; + size_t free; + size_t off; + size_t parsed; + msgpack_zone* z; + size_t initial_buffer_size; + void* ctx; +} msgpack_unpacker; + + +#ifndef MSGPACK_UNPACKER_INIT_BUFFER_SIZE +#define MSGPACK_UNPACKER_INIT_BUFFER_SIZE (64*1024) +#endif + +/** + * Initializes a streaming deserializer. + * The initialized deserializer must be destroyed by msgpack_unpacker_destroy(msgpack_unpacker*). + */ +MSGPACK_DLLEXPORT +bool msgpack_unpacker_init(msgpack_unpacker* mpac, size_t initial_buffer_size); + +/** + * Destroys a streaming deserializer initialized by msgpack_unpacker_init(msgpack_unpacker*, size_t). + */ +MSGPACK_DLLEXPORT +void msgpack_unpacker_destroy(msgpack_unpacker* mpac); + + +/** + * Creates a streaming deserializer. + * The created deserializer must be destroyed by msgpack_unpacker_free(msgpack_unpacker*). + */ +MSGPACK_DLLEXPORT +msgpack_unpacker* msgpack_unpacker_new(size_t initial_buffer_size); + +/** + * Frees a streaming deserializer created by msgpack_unpacker_new(size_t). + */ +MSGPACK_DLLEXPORT +void msgpack_unpacker_free(msgpack_unpacker* mpac); + + +#ifndef MSGPACK_UNPACKER_RESERVE_SIZE +#define MSGPACK_UNPACKER_RESERVE_SIZE (32*1024) +#endif + +/** + * Reserves free space of the internal buffer. + * Use this function to fill the internal buffer with + * msgpack_unpacker_buffer(msgpack_unpacker*), + * msgpack_unpacker_buffer_capacity(const msgpack_unpacker*) and + * msgpack_unpacker_buffer_consumed(msgpack_unpacker*). + */ +static inline bool msgpack_unpacker_reserve_buffer(msgpack_unpacker* mpac, size_t size); + +/** + * Gets pointer to the free space of the internal buffer. + * Use this function to fill the internal buffer with + * msgpack_unpacker_reserve_buffer(msgpack_unpacker*, size_t), + * msgpack_unpacker_buffer_capacity(const msgpack_unpacker*) and + * msgpack_unpacker_buffer_consumed(msgpack_unpacker*). + */ +static inline char* msgpack_unpacker_buffer(msgpack_unpacker* mpac); + +/** + * Gets size of the free space of the internal buffer. + * Use this function to fill the internal buffer with + * msgpack_unpacker_reserve_buffer(msgpack_unpacker*, size_t), + * msgpack_unpacker_buffer(const msgpack_unpacker*) and + * msgpack_unpacker_buffer_consumed(msgpack_unpacker*). + */ +static inline size_t msgpack_unpacker_buffer_capacity(const msgpack_unpacker* mpac); + +/** + * Notifies the deserializer that the internal buffer filled. + * Use this function to fill the internal buffer with + * msgpack_unpacker_reserve_buffer(msgpack_unpacker*, size_t), + * msgpack_unpacker_buffer(msgpack_unpacker*) and + * msgpack_unpacker_buffer_capacity(const msgpack_unpacker*). + */ +static inline void msgpack_unpacker_buffer_consumed(msgpack_unpacker* mpac, size_t size); + + +/** + * Deserializes one object. + * Returns true if it successes. Otherwise false is returned. + * @param pac pointer to an initialized msgpack_unpacked object. + */ +MSGPACK_DLLEXPORT +msgpack_unpack_return msgpack_unpacker_next(msgpack_unpacker* mpac, msgpack_unpacked* pac); + +/** + * Deserializes one object and set the number of parsed bytes involved. + * Returns true if it successes. Otherwise false is returned. + * @param mpac pointer to an initialized msgpack_unpacker object. + * @param result pointer to an initialized msgpack_unpacked object. + * @param p_bytes pointer to variable that will be set with the number of parsed bytes. + */ +MSGPACK_DLLEXPORT +msgpack_unpack_return msgpack_unpacker_next_with_size(msgpack_unpacker* mpac, + msgpack_unpacked* result, + size_t *p_bytes); + +/** + * Initializes a msgpack_unpacked object. + * The initialized object must be destroyed by msgpack_unpacked_destroy(msgpack_unpacker*). + * Use the object with msgpack_unpacker_next(msgpack_unpacker*, msgpack_unpacked*) or + * msgpack_unpack_next(msgpack_unpacked*, const char*, size_t, size_t*). + */ +static inline void msgpack_unpacked_init(msgpack_unpacked* result); + +/** + * Destroys a streaming deserializer initialized by msgpack_unpacked(). + */ +static inline void msgpack_unpacked_destroy(msgpack_unpacked* result); + +/** + * Releases the memory zone from msgpack_unpacked object. + * The released zone must be freed by msgpack_zone_free(msgpack_zone*). + */ +static inline msgpack_zone* msgpack_unpacked_release_zone(msgpack_unpacked* result); + + +MSGPACK_DLLEXPORT +int msgpack_unpacker_execute(msgpack_unpacker* mpac); + +MSGPACK_DLLEXPORT +msgpack_object msgpack_unpacker_data(msgpack_unpacker* mpac); + +MSGPACK_DLLEXPORT +msgpack_zone* msgpack_unpacker_release_zone(msgpack_unpacker* mpac); + +MSGPACK_DLLEXPORT +void msgpack_unpacker_reset_zone(msgpack_unpacker* mpac); + +MSGPACK_DLLEXPORT +void msgpack_unpacker_reset(msgpack_unpacker* mpac); + +static inline size_t msgpack_unpacker_message_size(const msgpack_unpacker* mpac); + + +/** @} */ + + +// obsolete +MSGPACK_DLLEXPORT +msgpack_unpack_return +msgpack_unpack(const char* data, size_t len, size_t* off, + msgpack_zone* result_zone, msgpack_object* result); + + + + +static inline size_t msgpack_unpacker_parsed_size(const msgpack_unpacker* mpac); + +MSGPACK_DLLEXPORT +bool msgpack_unpacker_flush_zone(msgpack_unpacker* mpac); + +MSGPACK_DLLEXPORT +bool msgpack_unpacker_expand_buffer(msgpack_unpacker* mpac, size_t size); + +static inline bool msgpack_unpacker_reserve_buffer(msgpack_unpacker* mpac, size_t size) +{ + if(mpac->free >= size) { return true; } + return msgpack_unpacker_expand_buffer(mpac, size); +} + +static inline char* msgpack_unpacker_buffer(msgpack_unpacker* mpac) +{ + return mpac->buffer + mpac->used; +} + +static inline size_t msgpack_unpacker_buffer_capacity(const msgpack_unpacker* mpac) +{ + return mpac->free; +} + +static inline void msgpack_unpacker_buffer_consumed(msgpack_unpacker* mpac, size_t size) +{ + mpac->used += size; + mpac->free -= size; +} + +static inline size_t msgpack_unpacker_message_size(const msgpack_unpacker* mpac) +{ + return mpac->parsed - mpac->off + mpac->used; +} + +static inline size_t msgpack_unpacker_parsed_size(const msgpack_unpacker* mpac) +{ + return mpac->parsed; +} + + +static inline void msgpack_unpacked_init(msgpack_unpacked* result) +{ + memset(result, 0, sizeof(msgpack_unpacked)); +} + +static inline void msgpack_unpacked_destroy(msgpack_unpacked* result) +{ + if(result->zone != NULL) { + msgpack_zone_free(result->zone); + result->zone = NULL; + memset(&result->data, 0, sizeof(msgpack_object)); + } +} + +static inline msgpack_zone* msgpack_unpacked_release_zone(msgpack_unpacked* result) +{ + if(result->zone != NULL) { + msgpack_zone* z = result->zone; + result->zone = NULL; + return z; + } + return NULL; +} + + +#ifdef __cplusplus +} +#endif + +#endif /* msgpack/unpack.h */ diff --git a/msgpackc/3.2.1/include/msgpack/unpack_define.h b/msgpackc/3.2.1/include/msgpack/unpack_define.h new file mode 100644 index 0000000000000000000000000000000000000000..c7decf65994aa73b42c2312417d5357567f70e90 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/unpack_define.h @@ -0,0 +1,89 @@ +/* + * MessagePack unpacking routine template + * + * Copyright (C) 2008-2010 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_UNPACK_DEFINE_H +#define MSGPACK_UNPACK_DEFINE_H + +#include "msgpack/sysdep.h" +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifndef MSGPACK_EMBED_STACK_SIZE +#define MSGPACK_EMBED_STACK_SIZE 32 +#endif + + +typedef enum { + MSGPACK_CS_HEADER = 0x00, // nil + + //MSGPACK_CS_ = 0x01, + //MSGPACK_CS_ = 0x02, // false + //MSGPACK_CS_ = 0x03, // true + + MSGPACK_CS_BIN_8 = 0x04, + MSGPACK_CS_BIN_16 = 0x05, + MSGPACK_CS_BIN_32 = 0x06, + + MSGPACK_CS_EXT_8 = 0x07, + MSGPACK_CS_EXT_16 = 0x08, + MSGPACK_CS_EXT_32 = 0x09, + + MSGPACK_CS_FLOAT = 0x0a, + MSGPACK_CS_DOUBLE = 0x0b, + MSGPACK_CS_UINT_8 = 0x0c, + MSGPACK_CS_UINT_16 = 0x0d, + MSGPACK_CS_UINT_32 = 0x0e, + MSGPACK_CS_UINT_64 = 0x0f, + MSGPACK_CS_INT_8 = 0x10, + MSGPACK_CS_INT_16 = 0x11, + MSGPACK_CS_INT_32 = 0x12, + MSGPACK_CS_INT_64 = 0x13, + + MSGPACK_CS_FIXEXT_1 = 0x14, + MSGPACK_CS_FIXEXT_2 = 0x15, + MSGPACK_CS_FIXEXT_4 = 0x16, + MSGPACK_CS_FIXEXT_8 = 0x17, + MSGPACK_CS_FIXEXT_16 = 0x18, + + MSGPACK_CS_STR_8 = 0x19, // str8 + MSGPACK_CS_STR_16 = 0x1a, // str16 + MSGPACK_CS_STR_32 = 0x1b, // str32 + MSGPACK_CS_ARRAY_16 = 0x1c, + MSGPACK_CS_ARRAY_32 = 0x1d, + MSGPACK_CS_MAP_16 = 0x1e, + MSGPACK_CS_MAP_32 = 0x1f, + + //MSGPACK_ACS_BIG_INT_VALUE, + //MSGPACK_ACS_BIG_FLOAT_VALUE, + MSGPACK_ACS_STR_VALUE, + MSGPACK_ACS_BIN_VALUE, + MSGPACK_ACS_EXT_VALUE +} msgpack_unpack_state; + + +typedef enum { + MSGPACK_CT_ARRAY_ITEM, + MSGPACK_CT_MAP_KEY, + MSGPACK_CT_MAP_VALUE +} msgpack_container_type; + + +#ifdef __cplusplus +} +#endif + +#endif /* msgpack/unpack_define.h */ + diff --git a/msgpackc/3.2.1/include/msgpack/unpack_template.h b/msgpackc/3.2.1/include/msgpack/unpack_template.h new file mode 100644 index 0000000000000000000000000000000000000000..de30f3cf09f9f85252acaf5b47d0534216c64cd9 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/unpack_template.h @@ -0,0 +1,471 @@ +/* + * MessagePack unpacking routine template + * + * Copyright (C) 2008-2010 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ + +#ifndef msgpack_unpack_func +#error msgpack_unpack_func template is not defined +#endif + +#ifndef msgpack_unpack_callback +#error msgpack_unpack_callback template is not defined +#endif + +#ifndef msgpack_unpack_struct +#error msgpack_unpack_struct template is not defined +#endif + +#ifndef msgpack_unpack_struct_decl +#define msgpack_unpack_struct_decl(name) msgpack_unpack_struct(name) +#endif + +#ifndef msgpack_unpack_object +#error msgpack_unpack_object type is not defined +#endif + +#ifndef msgpack_unpack_user +#error msgpack_unpack_user type is not defined +#endif + +#ifndef USE_CASE_RANGE +#if !defined(_MSC_VER) +#define USE_CASE_RANGE +#endif +#endif + +#if defined(_KERNEL_MODE) +#undef assert +#define assert NT_ASSERT +#endif + +msgpack_unpack_struct_decl(_stack) { + msgpack_unpack_object obj; + size_t count; + unsigned int ct; + msgpack_unpack_object map_key; +}; + +msgpack_unpack_struct_decl(_context) { + msgpack_unpack_user user; + unsigned int cs; + unsigned int trail; + unsigned int top; + /* + msgpack_unpack_struct(_stack)* stack; + unsigned int stack_size; + msgpack_unpack_struct(_stack) embed_stack[MSGPACK_EMBED_STACK_SIZE]; + */ + msgpack_unpack_struct(_stack) stack[MSGPACK_EMBED_STACK_SIZE]; +}; + + +msgpack_unpack_func(void, _init)(msgpack_unpack_struct(_context)* ctx) +{ + ctx->cs = MSGPACK_CS_HEADER; + ctx->trail = 0; + ctx->top = 0; + /* + ctx->stack = ctx->embed_stack; + ctx->stack_size = MSGPACK_EMBED_STACK_SIZE; + */ + ctx->stack[0].obj = msgpack_unpack_callback(_root)(&ctx->user); +} + +/* +msgpack_unpack_func(void, _destroy)(msgpack_unpack_struct(_context)* ctx) +{ + if(ctx->stack_size != MSGPACK_EMBED_STACK_SIZE) { + free(ctx->stack); + } +} +*/ + +msgpack_unpack_func(msgpack_unpack_object, _data)(msgpack_unpack_struct(_context)* ctx) +{ + return (ctx)->stack[0].obj; +} + + +msgpack_unpack_func(int, _execute)(msgpack_unpack_struct(_context)* ctx, const char* data, size_t len, size_t* off) +{ + assert(len >= *off); + { + const unsigned char* p = (unsigned char*)data + *off; + const unsigned char* const pe = (unsigned char*)data + len; + const void* n = NULL; + + unsigned int trail = ctx->trail; + unsigned int cs = ctx->cs; + unsigned int top = ctx->top; + msgpack_unpack_struct(_stack)* stack = ctx->stack; + /* + unsigned int stack_size = ctx->stack_size; + */ + msgpack_unpack_user* user = &ctx->user; + + msgpack_unpack_object obj; + msgpack_unpack_struct(_stack)* c = NULL; + + int ret; + +#define push_simple_value(func) \ + ret = msgpack_unpack_callback(func)(user, &obj); \ + if(ret < 0) { goto _failed; } \ + goto _push +#define push_fixed_value(func, arg) \ + ret = msgpack_unpack_callback(func)(user, arg, &obj); \ + if(ret < 0) { goto _failed; } \ + goto _push +#define push_variable_value(func, base, pos, len) \ + ret = msgpack_unpack_callback(func)(user, \ + (const char*)base, (const char*)pos, len, &obj); \ + if(ret < 0) { goto _failed; } \ + goto _push + +#define again_fixed_trail(_cs, trail_len) \ + trail = trail_len; \ + cs = _cs; \ + goto _fixed_trail_again +#define again_fixed_trail_if_zero(_cs, trail_len, ifzero) \ + trail = trail_len; \ + if(trail == 0) { goto ifzero; } \ + cs = _cs; \ + goto _fixed_trail_again + +#define start_container(func, count_, ct_) \ + if(top >= MSGPACK_EMBED_STACK_SIZE) { \ + ret = MSGPACK_UNPACK_NOMEM_ERROR; \ + goto _failed; \ + } /* FIXME */ \ + ret = msgpack_unpack_callback(func)(user, count_, &stack[top].obj); \ + if(ret < 0) { goto _failed; } \ + if((count_) == 0) { obj = stack[top].obj; goto _push; } \ + stack[top].ct = ct_; \ + stack[top].count = count_; \ + ++top; \ + goto _header_again + +#define NEXT_CS(p) \ + ((unsigned int)*p & 0x1f) + +#ifdef USE_CASE_RANGE +#define SWITCH_RANGE_BEGIN switch(*p) { +#define SWITCH_RANGE(FROM, TO) case FROM ... TO: +#define SWITCH_RANGE_DEFAULT default: +#define SWITCH_RANGE_END } +#else +#define SWITCH_RANGE_BEGIN { if(0) { +#define SWITCH_RANGE(FROM, TO) } else if(FROM <= *p && *p <= TO) { +#define SWITCH_RANGE_DEFAULT } else { +#define SWITCH_RANGE_END } } +#endif + + if(p == pe) { goto _out; } + do { + switch(cs) { + case MSGPACK_CS_HEADER: + SWITCH_RANGE_BEGIN + SWITCH_RANGE(0x00, 0x7f) // Positive Fixnum + push_fixed_value(_uint8, *(uint8_t*)p); + SWITCH_RANGE(0xe0, 0xff) // Negative Fixnum + push_fixed_value(_int8, *(int8_t*)p); + SWITCH_RANGE(0xc0, 0xdf) // Variable + switch(*p) { + case 0xc0: // nil + push_simple_value(_nil); + //case 0xc1: // string + // again_terminal_trail(NEXT_CS(p), p+1); + case 0xc2: // false + push_simple_value(_false); + case 0xc3: // true + push_simple_value(_true); + case 0xc4: // bin 8 + case 0xc5: // bin 16 + case 0xc6: // bin 32 + again_fixed_trail(NEXT_CS(p), 1 << (((unsigned int)*p) & 0x03)); + case 0xc7: // ext 8 + case 0xc8: // ext 16 + case 0xc9: // ext 32 + again_fixed_trail(NEXT_CS(p), 1 << ((((unsigned int)*p) + 1) & 0x03)); + case 0xca: // float + case 0xcb: // double + case 0xcc: // unsigned int 8 + case 0xcd: // unsigned int 16 + case 0xce: // unsigned int 32 + case 0xcf: // unsigned int 64 + case 0xd0: // signed int 8 + case 0xd1: // signed int 16 + case 0xd2: // signed int 32 + case 0xd3: // signed int 64 + again_fixed_trail(NEXT_CS(p), 1 << (((unsigned int)*p) & 0x03)); + case 0xd4: // fixext 1 + case 0xd5: // fixext 2 + case 0xd6: // fixext 4 + case 0xd7: // fixext 8 + again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, + (1 << (((unsigned int)*p) & 0x03)) + 1, _ext_zero); + case 0xd8: // fixext 16 + again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, 16+1, _ext_zero); + + case 0xd9: // str 8 + case 0xda: // str 16 + case 0xdb: // str 32 + again_fixed_trail(NEXT_CS(p), 1 << ((((unsigned int)*p) & 0x03) - 1)); + case 0xdc: // array 16 + case 0xdd: // array 32 + case 0xde: // map 16 + case 0xdf: // map 32 + again_fixed_trail(NEXT_CS(p), 2u << (((unsigned int)*p) & 0x01)); + default: + ret = MSGPACK_UNPACK_PARSE_ERROR; + goto _failed; + } + SWITCH_RANGE(0xa0, 0xbf) // FixStr + again_fixed_trail_if_zero(MSGPACK_ACS_STR_VALUE, ((unsigned int)*p & 0x1f), _str_zero); + SWITCH_RANGE(0x90, 0x9f) // FixArray + start_container(_array, ((unsigned int)*p) & 0x0f, MSGPACK_CT_ARRAY_ITEM); + SWITCH_RANGE(0x80, 0x8f) // FixMap + start_container(_map, ((unsigned int)*p) & 0x0f, MSGPACK_CT_MAP_KEY); + + SWITCH_RANGE_DEFAULT + ret = MSGPACK_UNPACK_PARSE_ERROR; + goto _failed; + SWITCH_RANGE_END + // end MSGPACK_CS_HEADER + + + _fixed_trail_again: + ++p; + // fallthrough + + default: + if((size_t)(pe - p) < trail) { goto _out; } + n = p; p += trail - 1; + switch(cs) { + //case MSGPACK_CS_ + //case MSGPACK_CS_ + case MSGPACK_CS_FLOAT: { + union { uint32_t i; float f; } mem; + _msgpack_load32(uint32_t, n, &mem.i); + push_fixed_value(_float, mem.f); } + case MSGPACK_CS_DOUBLE: { + union { uint64_t i; double f; } mem; + _msgpack_load64(uint64_t, n, &mem.i); +#if defined(TARGET_OS_IPHONE) + // ok +#elif defined(__arm__) && !(__ARM_EABI__) // arm-oabi + // https://github.com/msgpack/msgpack-perl/pull/1 + mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL); +#endif + push_fixed_value(_double, mem.f); } + case MSGPACK_CS_UINT_8: + push_fixed_value(_uint8, *(uint8_t*)n); + case MSGPACK_CS_UINT_16:{ + uint16_t tmp; + _msgpack_load16(uint16_t,n,&tmp); + push_fixed_value(_uint16, tmp); + } + case MSGPACK_CS_UINT_32:{ + uint32_t tmp; + _msgpack_load32(uint32_t,n,&tmp); + push_fixed_value(_uint32, tmp); + } + case MSGPACK_CS_UINT_64:{ + uint64_t tmp; + _msgpack_load64(uint64_t,n,&tmp); + push_fixed_value(_uint64, tmp); + } + case MSGPACK_CS_INT_8: + push_fixed_value(_int8, *(int8_t*)n); + case MSGPACK_CS_INT_16:{ + int16_t tmp; + _msgpack_load16(int16_t,n,&tmp); + push_fixed_value(_int16, tmp); + } + case MSGPACK_CS_INT_32:{ + int32_t tmp; + _msgpack_load32(int32_t,n,&tmp); + push_fixed_value(_int32, tmp); + } + case MSGPACK_CS_INT_64:{ + int64_t tmp; + _msgpack_load64(int64_t,n,&tmp); + push_fixed_value(_int64, tmp); + } + case MSGPACK_CS_FIXEXT_1: + again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, 1+1, _ext_zero); + case MSGPACK_CS_FIXEXT_2: + again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, 2+1, _ext_zero); + case MSGPACK_CS_FIXEXT_4: + again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, 4+1, _ext_zero); + case MSGPACK_CS_FIXEXT_8: + again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, 8+1, _ext_zero); + case MSGPACK_CS_FIXEXT_16: + again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, 16+1, _ext_zero); + case MSGPACK_CS_STR_8: + again_fixed_trail_if_zero(MSGPACK_ACS_STR_VALUE, *(uint8_t*)n, _str_zero); + case MSGPACK_CS_BIN_8: + again_fixed_trail_if_zero(MSGPACK_ACS_BIN_VALUE, *(uint8_t*)n, _bin_zero); + case MSGPACK_CS_EXT_8: + again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, (*(uint8_t*)n) + 1, _ext_zero); + case MSGPACK_CS_STR_16:{ + uint16_t tmp; + _msgpack_load16(uint16_t,n,&tmp); + again_fixed_trail_if_zero(MSGPACK_ACS_STR_VALUE, tmp, _str_zero); + } + case MSGPACK_CS_BIN_16:{ + uint16_t tmp; + _msgpack_load16(uint16_t,n,&tmp); + again_fixed_trail_if_zero(MSGPACK_ACS_BIN_VALUE, tmp, _bin_zero); + } + case MSGPACK_CS_EXT_16:{ + uint16_t tmp; + _msgpack_load16(uint16_t,n,&tmp); + again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, tmp + 1, _ext_zero); + } + case MSGPACK_CS_STR_32:{ + uint32_t tmp; + _msgpack_load32(uint32_t,n,&tmp); + again_fixed_trail_if_zero(MSGPACK_ACS_STR_VALUE, tmp, _str_zero); + } + case MSGPACK_CS_BIN_32:{ + uint32_t tmp; + _msgpack_load32(uint32_t,n,&tmp); + again_fixed_trail_if_zero(MSGPACK_ACS_BIN_VALUE, tmp, _bin_zero); + } + case MSGPACK_CS_EXT_32:{ + uint32_t tmp; + _msgpack_load32(uint32_t,n,&tmp); + again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, tmp + 1, _ext_zero); + } + case MSGPACK_ACS_STR_VALUE: + _str_zero: + push_variable_value(_str, data, n, trail); + case MSGPACK_ACS_BIN_VALUE: + _bin_zero: + push_variable_value(_bin, data, n, trail); + case MSGPACK_ACS_EXT_VALUE: + _ext_zero: + push_variable_value(_ext, data, n, trail); + + case MSGPACK_CS_ARRAY_16:{ + uint16_t tmp; + _msgpack_load16(uint16_t,n,&tmp); + start_container(_array, tmp, MSGPACK_CT_ARRAY_ITEM); + } + case MSGPACK_CS_ARRAY_32:{ + /* FIXME security guard */ + uint32_t tmp; + _msgpack_load32(uint32_t,n,&tmp); + start_container(_array, tmp, MSGPACK_CT_ARRAY_ITEM); + } + + case MSGPACK_CS_MAP_16:{ + uint16_t tmp; + _msgpack_load16(uint16_t,n,&tmp); + start_container(_map, tmp, MSGPACK_CT_MAP_KEY); + } + case MSGPACK_CS_MAP_32:{ + /* FIXME security guard */ + uint32_t tmp; + _msgpack_load32(uint32_t,n,&tmp); + start_container(_map, tmp, MSGPACK_CT_MAP_KEY); + } + + default: + ret = MSGPACK_UNPACK_PARSE_ERROR; + goto _failed; + } + } + + _push: + if(top == 0) { goto _finish; } + c = &stack[top-1]; + switch(c->ct) { + case MSGPACK_CT_ARRAY_ITEM: + ret = msgpack_unpack_callback(_array_item)(user, &c->obj, obj); \ + if(ret < 0) { goto _failed; } + if(--c->count == 0) { + obj = c->obj; + --top; + /*printf("stack pop %d\n", top);*/ + goto _push; + } + goto _header_again; + case MSGPACK_CT_MAP_KEY: + c->map_key = obj; + c->ct = MSGPACK_CT_MAP_VALUE; + goto _header_again; + case MSGPACK_CT_MAP_VALUE: + ret = msgpack_unpack_callback(_map_item)(user, &c->obj, c->map_key, obj); \ + if(ret < 0) { goto _failed; } + if(--c->count == 0) { + obj = c->obj; + --top; + /*printf("stack pop %d\n", top);*/ + goto _push; + } + c->ct = MSGPACK_CT_MAP_KEY; + goto _header_again; + + default: + ret = MSGPACK_UNPACK_PARSE_ERROR; + goto _failed; + } + + _header_again: + cs = MSGPACK_CS_HEADER; + ++p; + } while(p != pe); + goto _out; + + + _finish: + stack[0].obj = obj; + ++p; + ret = 1; + /*printf("-- finish --\n"); */ + goto _end; + + _failed: + /*printf("** FAILED **\n"); */ + goto _end; + + _out: + ret = 0; + goto _end; + + _end: + ctx->cs = cs; + ctx->trail = trail; + ctx->top = top; + *off = (size_t)(p - (const unsigned char*)data); + + return ret; + } +} + +#undef msgpack_unpack_func +#undef msgpack_unpack_callback +#undef msgpack_unpack_struct +#undef msgpack_unpack_object +#undef msgpack_unpack_user + +#undef push_simple_value +#undef push_fixed_value +#undef push_variable_value +#undef again_fixed_trail +#undef again_fixed_trail_if_zero +#undef start_container + +#undef NEXT_CS + +#undef SWITCH_RANGE_BEGIN +#undef SWITCH_RANGE +#undef SWITCH_RANGE_DEFAULT +#undef SWITCH_RANGE_END diff --git a/msgpackc/3.2.1/include/msgpack/util.h b/msgpackc/3.2.1/include/msgpack/util.h new file mode 100644 index 0000000000000000000000000000000000000000..959b56bec04c3b236facb9830653915222c27ec8 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/util.h @@ -0,0 +1,15 @@ +/* + * MessagePack for C utilities + * + * Copyright (C) 2014 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_UTIL_H +#define MSGPACK_UTIL_H + +#define MSGPACK_UNUSED(a) (void)(a) + +#endif /* MSGPACK_UTIL_H */ diff --git a/msgpackc/3.2.1/include/msgpack/version.h b/msgpackc/3.2.1/include/msgpack/version.h new file mode 100644 index 0000000000000000000000000000000000000000..bd6605b8c453a420dd504c2f9d7b56ca04cc6b35 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/version.h @@ -0,0 +1,38 @@ +/* + * MessagePack for C version information + * + * Copyright (C) 2008-2009 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_VERSION_H +#define MSGPACK_VERSION_H + +#ifdef __cplusplus +extern "C" { +#endif + +MSGPACK_DLLEXPORT +const char* msgpack_version(void); +MSGPACK_DLLEXPORT +int msgpack_version_major(void); +MSGPACK_DLLEXPORT +int msgpack_version_minor(void); +MSGPACK_DLLEXPORT +int msgpack_version_revision(void); + +#include "version_master.h" + +#define MSGPACK_STR(v) #v +#define MSGPACK_VERSION_I(maj, min, rev) MSGPACK_STR(maj) "." MSGPACK_STR(min) "." MSGPACK_STR(rev) + +#define MSGPACK_VERSION MSGPACK_VERSION_I(MSGPACK_VERSION_MAJOR, MSGPACK_VERSION_MINOR, MSGPACK_VERSION_REVISION) + +#ifdef __cplusplus +} +#endif + +#endif /* msgpack/version.h */ + diff --git a/msgpackc/3.2.1/include/msgpack/version_master.h b/msgpackc/3.2.1/include/msgpack/version_master.h new file mode 100644 index 0000000000000000000000000000000000000000..2c02e603a895b5165a2545b3c623cf720addc99e --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/version_master.h @@ -0,0 +1,3 @@ +#define MSGPACK_VERSION_MAJOR 3 +#define MSGPACK_VERSION_MINOR 2 +#define MSGPACK_VERSION_REVISION 1 diff --git a/msgpackc/3.2.1/include/msgpack/vrefbuffer.h b/msgpackc/3.2.1/include/msgpack/vrefbuffer.h new file mode 100644 index 0000000000000000000000000000000000000000..ab51aefa38140699edcf0b454d30cff40a23894a --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/vrefbuffer.h @@ -0,0 +1,140 @@ +/* + * MessagePack for C zero-copy buffer implementation + * + * Copyright (C) 2008-2009 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_VREFBUFFER_H +#define MSGPACK_VREFBUFFER_H + +#include "zone.h" +#include + +#if defined(unix) || defined(__unix) || defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__QNX__) || defined(__QNXTO__) || defined(__HAIKU__) +#include +#else +struct iovec { + void *iov_base; + size_t iov_len; +}; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @defgroup msgpack_vrefbuffer Vectored Referencing buffer + * @ingroup msgpack_buffer + * @{ + */ + +struct msgpack_vrefbuffer_chunk; +typedef struct msgpack_vrefbuffer_chunk msgpack_vrefbuffer_chunk; + +typedef struct msgpack_vrefbuffer_inner_buffer { + size_t free; + char* ptr; + msgpack_vrefbuffer_chunk* head; +} msgpack_vrefbuffer_inner_buffer; + +typedef struct msgpack_vrefbuffer { + struct iovec* tail; + struct iovec* end; + struct iovec* array; + + size_t chunk_size; + size_t ref_size; + + msgpack_vrefbuffer_inner_buffer inner_buffer; +} msgpack_vrefbuffer; + + +#ifndef MSGPACK_VREFBUFFER_REF_SIZE +#define MSGPACK_VREFBUFFER_REF_SIZE 32 +#endif + +#ifndef MSGPACK_VREFBUFFER_CHUNK_SIZE +#define MSGPACK_VREFBUFFER_CHUNK_SIZE 8192 +#endif + +MSGPACK_DLLEXPORT +bool msgpack_vrefbuffer_init(msgpack_vrefbuffer* vbuf, + size_t ref_size, size_t chunk_size); +MSGPACK_DLLEXPORT +void msgpack_vrefbuffer_destroy(msgpack_vrefbuffer* vbuf); + +static inline msgpack_vrefbuffer* msgpack_vrefbuffer_new(size_t ref_size, size_t chunk_size); +static inline void msgpack_vrefbuffer_free(msgpack_vrefbuffer* vbuf); + +static inline int msgpack_vrefbuffer_write(void* data, const char* buf, size_t len); + +static inline const struct iovec* msgpack_vrefbuffer_vec(const msgpack_vrefbuffer* vref); +static inline size_t msgpack_vrefbuffer_veclen(const msgpack_vrefbuffer* vref); + +MSGPACK_DLLEXPORT +int msgpack_vrefbuffer_append_copy(msgpack_vrefbuffer* vbuf, + const char* buf, size_t len); + +MSGPACK_DLLEXPORT +int msgpack_vrefbuffer_append_ref(msgpack_vrefbuffer* vbuf, + const char* buf, size_t len); + +MSGPACK_DLLEXPORT +int msgpack_vrefbuffer_migrate(msgpack_vrefbuffer* vbuf, msgpack_vrefbuffer* to); + +MSGPACK_DLLEXPORT +void msgpack_vrefbuffer_clear(msgpack_vrefbuffer* vref); + +/** @} */ + + +static inline msgpack_vrefbuffer* msgpack_vrefbuffer_new(size_t ref_size, size_t chunk_size) +{ + msgpack_vrefbuffer* vbuf = (msgpack_vrefbuffer*)malloc(sizeof(msgpack_vrefbuffer)); + if (vbuf == NULL) return NULL; + if(!msgpack_vrefbuffer_init(vbuf, ref_size, chunk_size)) { + free(vbuf); + return NULL; + } + return vbuf; +} + +static inline void msgpack_vrefbuffer_free(msgpack_vrefbuffer* vbuf) +{ + if(vbuf == NULL) { return; } + msgpack_vrefbuffer_destroy(vbuf); + free(vbuf); +} + +static inline int msgpack_vrefbuffer_write(void* data, const char* buf, size_t len) +{ + msgpack_vrefbuffer* vbuf = (msgpack_vrefbuffer*)data; + + if(len < vbuf->ref_size) { + return msgpack_vrefbuffer_append_copy(vbuf, buf, len); + } else { + return msgpack_vrefbuffer_append_ref(vbuf, buf, len); + } +} + +static inline const struct iovec* msgpack_vrefbuffer_vec(const msgpack_vrefbuffer* vref) +{ + return vref->array; +} + +static inline size_t msgpack_vrefbuffer_veclen(const msgpack_vrefbuffer* vref) +{ + return (size_t)(vref->tail - vref->array); +} + + +#ifdef __cplusplus +} +#endif + +#endif /* msgpack/vrefbuffer.h */ diff --git a/msgpackc/3.2.1/include/msgpack/zbuffer.h b/msgpackc/3.2.1/include/msgpack/zbuffer.h new file mode 100644 index 0000000000000000000000000000000000000000..524906fab145bffe3b52e02c51f9b42d58e96f6c --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/zbuffer.h @@ -0,0 +1,201 @@ +/* + * MessagePack for C deflate buffer implementation + * + * Copyright (C) 2010 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_ZBUFFER_H +#define MSGPACK_ZBUFFER_H + +#include "sysdep.h" +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @defgroup msgpack_zbuffer Compressed buffer + * @ingroup msgpack_buffer + * @{ + */ + +typedef struct msgpack_zbuffer { + z_stream stream; + char* data; + size_t init_size; +} msgpack_zbuffer; + +#ifndef MSGPACK_ZBUFFER_INIT_SIZE +#define MSGPACK_ZBUFFER_INIT_SIZE 8192 +#endif + +static inline bool msgpack_zbuffer_init( + msgpack_zbuffer* zbuf, int level, size_t init_size); +static inline void msgpack_zbuffer_destroy(msgpack_zbuffer* zbuf); + +static inline msgpack_zbuffer* msgpack_zbuffer_new(int level, size_t init_size); +static inline void msgpack_zbuffer_free(msgpack_zbuffer* zbuf); + +static inline char* msgpack_zbuffer_flush(msgpack_zbuffer* zbuf); + +static inline const char* msgpack_zbuffer_data(const msgpack_zbuffer* zbuf); +static inline size_t msgpack_zbuffer_size(const msgpack_zbuffer* zbuf); + +static inline bool msgpack_zbuffer_reset(msgpack_zbuffer* zbuf); +static inline void msgpack_zbuffer_reset_buffer(msgpack_zbuffer* zbuf); +static inline char* msgpack_zbuffer_release_buffer(msgpack_zbuffer* zbuf); + + +#ifndef MSGPACK_ZBUFFER_RESERVE_SIZE +#define MSGPACK_ZBUFFER_RESERVE_SIZE 512 +#endif + +static inline int msgpack_zbuffer_write(void* data, const char* buf, size_t len); + +static inline bool msgpack_zbuffer_expand(msgpack_zbuffer* zbuf); + + +static inline bool msgpack_zbuffer_init(msgpack_zbuffer* zbuf, + int level, size_t init_size) +{ + memset(zbuf, 0, sizeof(msgpack_zbuffer)); + zbuf->init_size = init_size; + if(deflateInit(&zbuf->stream, level) != Z_OK) { + free(zbuf->data); + return false; + } + return true; +} + +static inline void msgpack_zbuffer_destroy(msgpack_zbuffer* zbuf) +{ + deflateEnd(&zbuf->stream); + free(zbuf->data); +} + +static inline msgpack_zbuffer* msgpack_zbuffer_new(int level, size_t init_size) +{ + msgpack_zbuffer* zbuf = (msgpack_zbuffer*)malloc(sizeof(msgpack_zbuffer)); + if (zbuf == NULL) return NULL; + if(!msgpack_zbuffer_init(zbuf, level, init_size)) { + free(zbuf); + return NULL; + } + return zbuf; +} + +static inline void msgpack_zbuffer_free(msgpack_zbuffer* zbuf) +{ + if(zbuf == NULL) { return; } + msgpack_zbuffer_destroy(zbuf); + free(zbuf); +} + +static inline bool msgpack_zbuffer_expand(msgpack_zbuffer* zbuf) +{ + size_t used = (size_t)((char *)(zbuf->stream.next_out) - zbuf->data); + size_t csize = used + zbuf->stream.avail_out; + + size_t nsize = (csize == 0) ? zbuf->init_size : csize * 2; + + char* tmp = (char*)realloc(zbuf->data, nsize); + if(tmp == NULL) { + return false; + } + + zbuf->data = tmp; + zbuf->stream.next_out = (Bytef*)(tmp + used); + zbuf->stream.avail_out = (uInt)(nsize - used); + + return true; +} + +static inline int msgpack_zbuffer_write(void* data, const char* buf, size_t len) +{ + msgpack_zbuffer* zbuf = (msgpack_zbuffer*)data; + + zbuf->stream.next_in = (Bytef*)buf; + zbuf->stream.avail_in = (uInt)len; + + while(zbuf->stream.avail_in > 0) { + if(zbuf->stream.avail_out < MSGPACK_ZBUFFER_RESERVE_SIZE) { + if(!msgpack_zbuffer_expand(zbuf)) { + return -1; + } + } + + if(deflate(&zbuf->stream, Z_NO_FLUSH) != Z_OK) { + return -1; + } + } + + return 0; +} + +static inline char* msgpack_zbuffer_flush(msgpack_zbuffer* zbuf) +{ + while(true) { + switch(deflate(&zbuf->stream, Z_FINISH)) { + case Z_STREAM_END: + return zbuf->data; + case Z_OK: + case Z_BUF_ERROR: + if(!msgpack_zbuffer_expand(zbuf)) { + return NULL; + } + break; + default: + return NULL; + } + } +} + +static inline const char* msgpack_zbuffer_data(const msgpack_zbuffer* zbuf) +{ + return zbuf->data; +} + +static inline size_t msgpack_zbuffer_size(const msgpack_zbuffer* zbuf) +{ + return (size_t)((char *)(zbuf->stream.next_out) - zbuf->data); +} + +static inline void msgpack_zbuffer_reset_buffer(msgpack_zbuffer* zbuf) +{ + zbuf->stream.avail_out += (uInt)((char*)zbuf->stream.next_out - zbuf->data); + zbuf->stream.next_out = (Bytef*)zbuf->data; +} + +static inline bool msgpack_zbuffer_reset(msgpack_zbuffer* zbuf) +{ + if(deflateReset(&zbuf->stream) != Z_OK) { + return false; + } + msgpack_zbuffer_reset_buffer(zbuf); + return true; +} + +static inline char* msgpack_zbuffer_release_buffer(msgpack_zbuffer* zbuf) +{ + char* tmp = zbuf->data; + zbuf->data = NULL; + zbuf->stream.next_out = NULL; + zbuf->stream.avail_out = 0; + return tmp; +} + +/** @} */ + + +#ifdef __cplusplus +} +#endif + +#endif /* msgpack/zbuffer.h */ diff --git a/msgpackc/3.2.1/include/msgpack/zone.h b/msgpackc/3.2.1/include/msgpack/zone.h new file mode 100644 index 0000000000000000000000000000000000000000..9005be7937399df8b9ccbf44904f3e3a8c5033e3 --- /dev/null +++ b/msgpackc/3.2.1/include/msgpack/zone.h @@ -0,0 +1,163 @@ +/* + * MessagePack for C memory pool implementation + * + * Copyright (C) 2008-2010 FURUHASHI Sadayuki + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef MSGPACK_ZONE_H +#define MSGPACK_ZONE_H + +#include "sysdep.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @defgroup msgpack_zone Memory zone + * @ingroup msgpack + * @{ + */ + +typedef struct msgpack_zone_finalizer { + void (*func)(void* data); + void* data; +} msgpack_zone_finalizer; + +typedef struct msgpack_zone_finalizer_array { + msgpack_zone_finalizer* tail; + msgpack_zone_finalizer* end; + msgpack_zone_finalizer* array; +} msgpack_zone_finalizer_array; + +struct msgpack_zone_chunk; +typedef struct msgpack_zone_chunk msgpack_zone_chunk; + +typedef struct msgpack_zone_chunk_list { + size_t free; + char* ptr; + msgpack_zone_chunk* head; +} msgpack_zone_chunk_list; + +typedef struct msgpack_zone { + msgpack_zone_chunk_list chunk_list; + msgpack_zone_finalizer_array finalizer_array; + size_t chunk_size; +} msgpack_zone; + +#ifndef MSGPACK_ZONE_CHUNK_SIZE +#define MSGPACK_ZONE_CHUNK_SIZE 8192 +#endif + +MSGPACK_DLLEXPORT +bool msgpack_zone_init(msgpack_zone* zone, size_t chunk_size); +MSGPACK_DLLEXPORT +void msgpack_zone_destroy(msgpack_zone* zone); + +MSGPACK_DLLEXPORT +msgpack_zone* msgpack_zone_new(size_t chunk_size); +MSGPACK_DLLEXPORT +void msgpack_zone_free(msgpack_zone* zone); + +static inline void* msgpack_zone_malloc(msgpack_zone* zone, size_t size); +static inline void* msgpack_zone_malloc_no_align(msgpack_zone* zone, size_t size); + +static inline bool msgpack_zone_push_finalizer(msgpack_zone* zone, + void (*func)(void* data), void* data); + +static inline void msgpack_zone_swap(msgpack_zone* a, msgpack_zone* b); + +MSGPACK_DLLEXPORT +bool msgpack_zone_is_empty(msgpack_zone* zone); + +MSGPACK_DLLEXPORT +void msgpack_zone_clear(msgpack_zone* zone); + +/** @} */ + + +#ifndef MSGPACK_ZONE_ALIGN +#define MSGPACK_ZONE_ALIGN sizeof(void*) +#endif + +MSGPACK_DLLEXPORT +void* msgpack_zone_malloc_expand(msgpack_zone* zone, size_t size); + +static inline void* msgpack_zone_malloc_no_align(msgpack_zone* zone, size_t size) +{ + char* ptr; + msgpack_zone_chunk_list* cl = &zone->chunk_list; + + if(zone->chunk_list.free < size) { + return msgpack_zone_malloc_expand(zone, size); + } + + ptr = cl->ptr; + cl->free -= size; + cl->ptr += size; + + return ptr; +} + +static inline void* msgpack_zone_malloc(msgpack_zone* zone, size_t size) +{ + char* aligned = + (char*)( + (size_t)( + zone->chunk_list.ptr + (MSGPACK_ZONE_ALIGN - 1) + ) / MSGPACK_ZONE_ALIGN * MSGPACK_ZONE_ALIGN + ); + size_t adjusted_size = size + (size_t)(aligned - zone->chunk_list.ptr); + if(zone->chunk_list.free >= adjusted_size) { + zone->chunk_list.free -= adjusted_size; + zone->chunk_list.ptr += adjusted_size; + return aligned; + } + { + void* ptr = msgpack_zone_malloc_expand(zone, size + (MSGPACK_ZONE_ALIGN - 1)); + if (ptr) { + return (char*)((size_t)(ptr) / MSGPACK_ZONE_ALIGN * MSGPACK_ZONE_ALIGN); + } + } + return NULL; +} + + +bool msgpack_zone_push_finalizer_expand(msgpack_zone* zone, + void (*func)(void* data), void* data); + +static inline bool msgpack_zone_push_finalizer(msgpack_zone* zone, + void (*func)(void* data), void* data) +{ + msgpack_zone_finalizer_array* const fa = &zone->finalizer_array; + msgpack_zone_finalizer* fin = fa->tail; + + if(fin == fa->end) { + return msgpack_zone_push_finalizer_expand(zone, func, data); + } + + fin->func = func; + fin->data = data; + + ++fa->tail; + + return true; +} + +static inline void msgpack_zone_swap(msgpack_zone* a, msgpack_zone* b) +{ + msgpack_zone tmp = *a; + *a = *b; + *b = tmp; +} + + +#ifdef __cplusplus +} +#endif + +#endif /* msgpack/zone.h */ diff --git a/ocilib/4.6.4/AIX-00FB437F4C00/AIX-00FB437F4C00.tar b/ocilib/4.6.4/AIX-00FB437F4C00/AIX-00FB437F4C00.tar new file mode 100644 index 0000000000000000000000000000000000000000..85a9b120fa60b084f3f42b325f79c6efcdfddbdb Binary files /dev/null and b/ocilib/4.6.4/AIX-00FB437F4C00/AIX-00FB437F4C00.tar differ diff --git a/ocilib/4.6.4/AIX-00FB437F4C00/libocilib.a b/ocilib/4.6.4/AIX-00FB437F4C00/libocilib.a new file mode 100644 index 0000000000000000000000000000000000000000..dadeee50be6f86de017187503897c7383b50c511 Binary files /dev/null and b/ocilib/4.6.4/AIX-00FB437F4C00/libocilib.a differ diff --git a/ocilib/4.6.4/AIX-00FB90154C00/AIX-00FB90154C00.tar b/ocilib/4.6.4/AIX-00FB90154C00/AIX-00FB90154C00.tar new file mode 100644 index 0000000000000000000000000000000000000000..85a9b120fa60b084f3f42b325f79c6efcdfddbdb Binary files /dev/null and b/ocilib/4.6.4/AIX-00FB90154C00/AIX-00FB90154C00.tar differ diff --git a/ocilib/4.6.4/AIX-00FB90154C00/libocilib.a b/ocilib/4.6.4/AIX-00FB90154C00/libocilib.a new file mode 100644 index 0000000000000000000000000000000000000000..dadeee50be6f86de017187503897c7383b50c511 Binary files /dev/null and b/ocilib/4.6.4/AIX-00FB90154C00/libocilib.a differ diff --git a/ocilib/4.6.4/HP-UX-ia64/HP-UX-ia64.tar b/ocilib/4.6.4/HP-UX-ia64/HP-UX-ia64.tar new file mode 100644 index 0000000000000000000000000000000000000000..974f4707d79d77ad024b64a8bea74e4b5d872300 Binary files /dev/null and b/ocilib/4.6.4/HP-UX-ia64/HP-UX-ia64.tar differ diff --git a/ocilib/4.6.4/HP-UX-ia64/libocilib.so b/ocilib/4.6.4/HP-UX-ia64/libocilib.so new file mode 120000 index 0000000000000000000000000000000000000000..dd4bcb2cdcb6915220d95b7ca83f3c12ccd3f5e6 --- /dev/null +++ b/ocilib/4.6.4/HP-UX-ia64/libocilib.so @@ -0,0 +1 @@ +libocilib.so.10 \ No newline at end of file diff --git a/ocilib/4.6.4/HP-UX-ia64/libocilib.so.10 b/ocilib/4.6.4/HP-UX-ia64/libocilib.so.10 new file mode 100755 index 0000000000000000000000000000000000000000..43d58bc65dd5e39939ad3768fffc323494ea9abd Binary files /dev/null and b/ocilib/4.6.4/HP-UX-ia64/libocilib.so.10 differ diff --git a/ocilib/4.6.4/Linux-x86_64/Linux-x86_64.tar b/ocilib/4.6.4/Linux-x86_64/Linux-x86_64.tar new file mode 100644 index 0000000000000000000000000000000000000000..faf78b171a64d514c11c0bd36a0648832ee6f2f3 Binary files /dev/null and b/ocilib/4.6.4/Linux-x86_64/Linux-x86_64.tar differ diff --git a/ocilib/4.6.4/Linux-x86_64/libocilib.so b/ocilib/4.6.4/Linux-x86_64/libocilib.so new file mode 120000 index 0000000000000000000000000000000000000000..db133c01c12d68084fa8fd97a34355224e0d16f9 --- /dev/null +++ b/ocilib/4.6.4/Linux-x86_64/libocilib.so @@ -0,0 +1 @@ +libocilib.so.4.6.4 \ No newline at end of file diff --git a/ocilib/4.6.4/Linux-x86_64/libocilib.so.4 b/ocilib/4.6.4/Linux-x86_64/libocilib.so.4 new file mode 120000 index 0000000000000000000000000000000000000000..db133c01c12d68084fa8fd97a34355224e0d16f9 --- /dev/null +++ b/ocilib/4.6.4/Linux-x86_64/libocilib.so.4 @@ -0,0 +1 @@ +libocilib.so.4.6.4 \ No newline at end of file diff --git a/ocilib/4.6.4/Linux-x86_64/libocilib.so.4.6.4 b/ocilib/4.6.4/Linux-x86_64/libocilib.so.4.6.4 new file mode 100755 index 0000000000000000000000000000000000000000..3ca037aca7cf491ccd2acf6365c5210cdaed356b Binary files /dev/null and b/ocilib/4.6.4/Linux-x86_64/libocilib.so.4.6.4 differ diff --git a/ocilib/4.6.4/Linux-x86_64_5/Linux-x86_64_5.tar b/ocilib/4.6.4/Linux-x86_64_5/Linux-x86_64_5.tar new file mode 100644 index 0000000000000000000000000000000000000000..bb852ea14ae614b72398100a2250bf584a5be393 Binary files /dev/null and b/ocilib/4.6.4/Linux-x86_64_5/Linux-x86_64_5.tar differ diff --git a/ocilib/4.6.4/Linux-x86_64_5/libocilib.so b/ocilib/4.6.4/Linux-x86_64_5/libocilib.so new file mode 120000 index 0000000000000000000000000000000000000000..db133c01c12d68084fa8fd97a34355224e0d16f9 --- /dev/null +++ b/ocilib/4.6.4/Linux-x86_64_5/libocilib.so @@ -0,0 +1 @@ +libocilib.so.4.6.4 \ No newline at end of file diff --git a/ocilib/4.6.4/Linux-x86_64_5/libocilib.so.4 b/ocilib/4.6.4/Linux-x86_64_5/libocilib.so.4 new file mode 120000 index 0000000000000000000000000000000000000000..db133c01c12d68084fa8fd97a34355224e0d16f9 --- /dev/null +++ b/ocilib/4.6.4/Linux-x86_64_5/libocilib.so.4 @@ -0,0 +1 @@ +libocilib.so.4.6.4 \ No newline at end of file diff --git a/ocilib/4.6.4/Linux-x86_64_5/libocilib.so.4.6.4 b/ocilib/4.6.4/Linux-x86_64_5/libocilib.so.4.6.4 new file mode 100755 index 0000000000000000000000000000000000000000..d17b4fabd17c7d325e1c9bfa1f564168278d7783 Binary files /dev/null and b/ocilib/4.6.4/Linux-x86_64_5/libocilib.so.4.6.4 differ diff --git a/ocilib/4.6.4/Linux-x86_64_6/Linux-x86_64_6.tar b/ocilib/4.6.4/Linux-x86_64_6/Linux-x86_64_6.tar new file mode 100644 index 0000000000000000000000000000000000000000..48934a54ccf9e04846688b6850e4c258073ee9b6 Binary files /dev/null and b/ocilib/4.6.4/Linux-x86_64_6/Linux-x86_64_6.tar differ diff --git a/ocilib/4.6.4/Linux-x86_64_6/libocilib.so b/ocilib/4.6.4/Linux-x86_64_6/libocilib.so new file mode 120000 index 0000000000000000000000000000000000000000..db133c01c12d68084fa8fd97a34355224e0d16f9 --- /dev/null +++ b/ocilib/4.6.4/Linux-x86_64_6/libocilib.so @@ -0,0 +1 @@ +libocilib.so.4.6.4 \ No newline at end of file diff --git a/ocilib/4.6.4/Linux-x86_64_6/libocilib.so.4 b/ocilib/4.6.4/Linux-x86_64_6/libocilib.so.4 new file mode 120000 index 0000000000000000000000000000000000000000..db133c01c12d68084fa8fd97a34355224e0d16f9 --- /dev/null +++ b/ocilib/4.6.4/Linux-x86_64_6/libocilib.so.4 @@ -0,0 +1 @@ +libocilib.so.4.6.4 \ No newline at end of file diff --git a/ocilib/4.6.4/Linux-x86_64_6/libocilib.so.4.6.4 b/ocilib/4.6.4/Linux-x86_64_6/libocilib.so.4.6.4 new file mode 100755 index 0000000000000000000000000000000000000000..d17b4fabd17c7d325e1c9bfa1f564168278d7783 Binary files /dev/null and b/ocilib/4.6.4/Linux-x86_64_6/libocilib.so.4.6.4 differ diff --git a/ocilib/4.6.4/SunOS-5.10/SunOS-5.10.tar b/ocilib/4.6.4/SunOS-5.10/SunOS-5.10.tar new file mode 100644 index 0000000000000000000000000000000000000000..0fce29bc2c0ff9ef46c85621b887bb88508242ee Binary files /dev/null and b/ocilib/4.6.4/SunOS-5.10/SunOS-5.10.tar differ diff --git a/ocilib/4.6.4/SunOS-5.10/libocilib.so b/ocilib/4.6.4/SunOS-5.10/libocilib.so new file mode 120000 index 0000000000000000000000000000000000000000..db133c01c12d68084fa8fd97a34355224e0d16f9 --- /dev/null +++ b/ocilib/4.6.4/SunOS-5.10/libocilib.so @@ -0,0 +1 @@ +libocilib.so.4.6.4 \ No newline at end of file diff --git a/ocilib/4.6.4/SunOS-5.10/libocilib.so.4 b/ocilib/4.6.4/SunOS-5.10/libocilib.so.4 new file mode 120000 index 0000000000000000000000000000000000000000..db133c01c12d68084fa8fd97a34355224e0d16f9 --- /dev/null +++ b/ocilib/4.6.4/SunOS-5.10/libocilib.so.4 @@ -0,0 +1 @@ +libocilib.so.4.6.4 \ No newline at end of file diff --git a/ocilib/4.6.4/SunOS-5.10/libocilib.so.4.6.4 b/ocilib/4.6.4/SunOS-5.10/libocilib.so.4.6.4 new file mode 100755 index 0000000000000000000000000000000000000000..44f89e7c45fb90f3c583067be174fdcdf1b1c55f Binary files /dev/null and b/ocilib/4.6.4/SunOS-5.10/libocilib.so.4.6.4 differ diff --git a/ocilib/4.6.4/SunOS-sun4v/SunOS-sun4v.tar b/ocilib/4.6.4/SunOS-sun4v/SunOS-sun4v.tar new file mode 100644 index 0000000000000000000000000000000000000000..ac0bf1f357a994c5982efd6d5496601b8fff0bd4 Binary files /dev/null and b/ocilib/4.6.4/SunOS-sun4v/SunOS-sun4v.tar differ diff --git a/ocilib/4.6.4/SunOS-sun4v/libocilib.so b/ocilib/4.6.4/SunOS-sun4v/libocilib.so new file mode 120000 index 0000000000000000000000000000000000000000..db133c01c12d68084fa8fd97a34355224e0d16f9 --- /dev/null +++ b/ocilib/4.6.4/SunOS-sun4v/libocilib.so @@ -0,0 +1 @@ +libocilib.so.4.6.4 \ No newline at end of file diff --git a/ocilib/4.6.4/SunOS-sun4v/libocilib.so.4 b/ocilib/4.6.4/SunOS-sun4v/libocilib.so.4 new file mode 120000 index 0000000000000000000000000000000000000000..db133c01c12d68084fa8fd97a34355224e0d16f9 --- /dev/null +++ b/ocilib/4.6.4/SunOS-sun4v/libocilib.so.4 @@ -0,0 +1 @@ +libocilib.so.4.6.4 \ No newline at end of file diff --git a/ocilib/4.6.4/SunOS-sun4v/libocilib.so.4.6.4 b/ocilib/4.6.4/SunOS-sun4v/libocilib.so.4.6.4 new file mode 100755 index 0000000000000000000000000000000000000000..44f89e7c45fb90f3c583067be174fdcdf1b1c55f Binary files /dev/null and b/ocilib/4.6.4/SunOS-sun4v/libocilib.so.4.6.4 differ diff --git a/ocilib/4.6.4/include.tar b/ocilib/4.6.4/include.tar new file mode 100644 index 0000000000000000000000000000000000000000..849d93bb95a7fe2892dd6c2cce9c564bf5979fb1 Binary files /dev/null and b/ocilib/4.6.4/include.tar differ diff --git a/ocilib/4.6.4/include/ocilib.h b/ocilib/4.6.4/include/ocilib.h new file mode 100644 index 0000000000000000000000000000000000000000..4d63fd1b6337d257d6d939a78489df1acbb04ad5 --- /dev/null +++ b/ocilib/4.6.4/include/ocilib.h @@ -0,0 +1,19409 @@ +/* + * OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI) + * + * Website: http://www.ocilib.net + * + * Copyright (c) 2007-2020 Vincent ROGIER + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* IMPORTANT NOTICE + * + * This file contains explanations about Oracle and OCI technologies. + * OCILIB is a wrapper around OCI and thus exposes OCI features. + * The OCILIB documentation intends to explain Oracle / OCI concepts + * and is naturally based on the official Oracle OCI documentation. + * + * Some parts of OCILIB documentation may include some information + * taken and adapted from the following Oracle documentations : + * - Oracle Call Interface Programmer's Guide + * - Oracle Streams - Advanced Queuing User's Guide + */ + +#ifndef OCILIB_H_INCLUDED +#define OCILIB_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +/** + * @defgroup OcilibCApi C API + * @{ + * + */ + +/* --------------------------------------------------------------------------------------------- * + * Platform configuration + * --------------------------------------------------------------------------------------------- */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +/* --------------------------------------------------------------------------------------------- * + * C headers + * --------------------------------------------------------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* --------------------------------------------------------------------------------------------- * + * MS Windows platform detection + * --------------------------------------------------------------------------------------------- */ + +#ifndef _WINDOWS + #if defined(_WIN32)|| defined(WIN32) || defined(_WIN64) || defined(WIN64) || defined(_WIN32_WINNT) + #define _WINDOWS + #endif +#endif + +#ifdef _WINDOWS + #ifdef boolean + #undef boolean + #endif + #include + #ifdef boolean + #undef boolean + #endif +#endif + +/* --------------------------------------------------------------------------------------------- * + * OCILIB version information + * --------------------------------------------------------------------------------------------- */ + +#define OCILIB_MAJOR_VERSION 4 +#define OCILIB_MINOR_VERSION 6 +#define OCILIB_REVISION_VERSION 4 + +/* Import mode */ + +#define OCI_IMPORT_MODE_LINKAGE 1 +#define OCI_IMPORT_MODE_RUNTIME 2 + +#ifdef OCI_IMPORT_RUNTIME + #undef OCI_IMPORT_LINKAGE +#endif + +#ifdef OCI_IMPORT_LINKAGE + #undef OCI_IMPORT_RUNTIME +#endif + +#if !defined(OCI_IMPORT_RUNTIME) && !defined(OCI_IMPORT_LINKAGE) + #define OCI_IMPORT_LINKAGE +#endif + +#ifdef OCI_IMPORT_RUNTIME + #define OCI_IMPORT_MODE OCI_IMPORT_MODE_RUNTIME +#else + #define OCI_IMPORT_MODE OCI_IMPORT_MODE_LINKAGE +#endif + +/* Charset modes */ + +#ifdef OCI_CHARSET_UNICODE + #define OCI_CHARSET_WIDE +#endif + +#ifdef OCI_CHARSET_WIDE + #undef OCI_CHARSET_ANSI +#endif + +#ifdef OCI_CHARSET_ANSI + #undef OCI_CHARSET_ANSI +#endif + +#if !defined(OCI_CHARSET_ANSI) && !defined(OCI_CHARSET_WIDE) + #define OCI_CHARSET_ANSI +#endif + +/* Calling convention */ + +#ifndef OCI_API + #ifdef _MSC_VER + #define OCI_API __stdcall + #else + #define OCI_API + #endif +#endif + +/* Build mode */ + +#ifndef OCI_EXPORT + #define OCI_EXPORT +#endif + +/** + * @defgroup OcilibCApiSupportedCharsets Character sets + * @{ + * + * OCILIB supports both ANSI and Unicode. + * + * Oracle started a real Unicode support with Oracle8i but only for bind and fetch data. + * All SQL and PL/SQ/ statements, database objects names were still only supported in ANSI. + * + * With Oracle 9i, Oracle provides a full Unicode support. + * + * So depending on the compile time Oracle library or the runtime loaded library, Unicode support differs. + * + * OCILIB supports: + * + * - ANSI (char) + * - Unicode (wchar_t) + * - UTF8 strings + * + * OCILIB uses the character type 'otext' that is a define around char and wchar_t depending on the charset mode. + * + * @par Option OCI_CHARSET_ANSI + * + * - otext --> char + * - OTEXT(x) --> x + * + * @par Option OCI_CHARSET_WIDE + * + * - otext --> wchar_t + * - OTEXT(x) --> L ## x + * + * @par Unicode and ISO C + * + * Well, ISO C: + * - does not know anything about Unicode. + * - makes wide characters support tricky because wide character size is not defined and is freely adaptable by implementations. + * + * OCILIB uses char/wchar_t strings for both public interface and internal storage. + * + * Unicode builds of OCILIB initialize OCI in UTF16 Unicode mode. + * Oracle implements this mode with a 2 bytes (fixed length) UTF16 encoding. + * + * @warning + * When using Unicode builds of OCILIB, make sure that the target + * Database charset is also using an Unicode charset or is a superset of UTF16. + * If not, strings may be converted with substitution characters by the Oracle client ! + * + * So, on systems implementing wchar_t as 2 bytes based UTF16 (e.g. Ms Windows), + * strings are directly passed to Oracle and taken back from it. + * + * On other systems (most of the Unix systems) that use UTF32 as encoding, (4 bytes based wchar_t), OCILIB uses: + * - temporary buffers for statements and object names + * - buffer expansion from UTF16 to UTF32 for fetch and bind string: + * - allocation based on sizeof(wchar_t) + * - data filling based on sizeof(short) -> (UTF16 2 bytes) + * - data expansion to sizeof(wchar_t). + * + * Buffer expansion is done in place and has the advantage of not requiring extra buffer. + * That reduces the cost of the Unicode/ISO C handling overhead on Unix systems. + * + * @par UTF8 strings + * + * OCILIB fully supports UTF8 strings : + * - Within OCI_CHARSET_ANSI builds + * - NLS_LANG environment variable must be set to any valid UTF8 Oracle charset string + * + * @par Charset mapping macros + * + * OCILIB main header file provides macro around most common string functions of + * the C standard library. + * + * these macros are based on the model: ostr[libc function name]() + * + * xxx is the standard C library string function name without the character type prefix (str/wcs). + * + * List of available macros: + * - ostrdup + * - ostrcpy + * - ostrncpy + * - ostrcat + * - ostrncat + * - ostrlen + * - ostrcmp + * - ostrcasecmp + * - osprintf + * - ostol + * +**/ + +#if defined(__cplusplus) && defined(_MSC_VER) && (_MSC_VER < 1300) +extern "C++" { +#endif + +#include + +#if defined(__cplusplus) && defined(_MSC_VER) && (_MSC_VER < 1300) +} +#endif + +/* Charset macros */ + +#define OCI_CHAR_ANSI 1 +#define OCI_CHAR_WIDE 2 + +#ifdef OCI_CHARSET_ANSI + typedef char otext; + #define OTEXT(x) x + #define OCI_CHAR_TEXT OCI_CHAR_ANSI +#else + typedef wchar_t otext; + #define OTEXT(x) L ## x + #define OCI_CHAR_TEXT OCI_CHAR_WIDE +#endif + +/* + For ISO conformance, strdup/wcsdup/stricmp/strncasecmp are not used. + All wide char routines are part of the 1995 Normative Addendum 1 to the ISO C90 standard. + OCILIB also needs an ANSI equivalent to swprintf => ocisprintf + Thus OCILIB exports the following helper functions + +*/ + +OCI_EXPORT int ocisprintf +( + char *str, + int size, + const char *format, + ... +); + +OCI_EXPORT char * ocistrdup +( + const char * src +); + +OCI_EXPORT int ocistrcasecmp +( + const char *str1, + const char *str2 +); + +OCI_EXPORT wchar_t * ociwcsdup +( + const wchar_t * src +); + +OCI_EXPORT int ociwcscasecmp +( + const wchar_t *str1, + const wchar_t *str2 +); + +/* special defines for Microsoft C runtime that is not C ISO compliant */ + +#ifdef _WINDOWS + + #define vsnprintf _vsnprintf + #define swprintf _snwprintf + +#endif + +/* helpers mapping macros */ + +#ifdef OCI_CHARSET_ANSI + #define ostrdup ocistrdup + #define ostrcpy strcpy + #define ostrncpy strncpy + #define ostrcat strcat + #define ostrncat strncat + #define ostrlen strlen + #define ostrcmp strcmp + #define ostrcasecmp ocistrcasecmp + #define osprintf ocisprintf + #define ostrtol strtol + #define osscanf sscanf + #define otoupper toupper + #define oisdigit isdigit +#else + #define ostrdup ociwcsdup + #define ostrcpy wcscpy + #define ostrncpy wcsncpy + #define ostrcat wcscat + #define ostrncat wcsncat + #define ostrlen wcslen + #define ostrcmp wcscmp + #define ostrcasecmp ociwcscasecmp + #define osprintf swprintf + #define ostrtol wcstol + #define osscanf swscanf + #define otoupper towupper + #define oisdigit iswdigit + +#endif + +/* string size macros */ + +#define otextsize(s) (ostrlen(s) * sizeof(otext)) + +/** + * @} + */ + +/** + * @defgroup OcilibCApiDatatypes Data types + * @{ + * + * OCILIB implements: + * + * - Oracle Scalar data types through scalar C data types + * - Oracle opaque/complex objects though opaque library handles + * - Library objects for manipulating the database: connections, transactions, statements... + * + * @par Supported Oracle data types + * + * - All Database types are supported excluding REFs. + * + * Here is a summary of the supported data types: + * + * - Scalar types CHAR/NCHAR, VARCHAR2/NVARCHAR2, NUMBER, FLOAT, REAL, RAW, ... + * - Binary types: RAW, LONG RAW, VARRAW, .. + * - Larges Objects (Lobs and Files) : BLOB, CLOB, NCLOB, BFILE + * - LONG types: LONG, VAR LONG + * - Date, Timestamps et Intervals: DATE, TIMESTAMP, INTERVAL + * - PL/SQL types: Ref cursors, PL/SQL Tables + * - Named Types (by value): Built-in system objects and User defined objects + * - VARRAYs and Nested Tables + * - ROWIDs + * + * @par OCILIB library objects + * + * The public OCILIB library interface implements encapsulation for + * representing database objects (such as connections, statements ...) through + * opaque structures (pointers to structures whose definition is kept private) + * + * Instead of directly manipulating the structures and their members, the library + * has functions to access the underlying members. + * + * It's designed to make the user code as more independent as possible of + * the library details. + * +**/ + +/** + * @typedef OCI_Pool + * + * @brief + * Pool object (session or connection) + * + * A pool is a set of pooled objects + * + */ + +typedef struct OCI_Pool OCI_Pool; + +/** + * @typedef OCI_Connection + * + * @brief + * Oracle physical connection. + * + * It holds all information about a connection such as error handling, associated statements, ... + * Error handling and transactions are embedded within a connection object. + * + * @warning + * Multi threaded applications that use multiple connections should use one connection per thread + * as all statements associated with a connection share the same context. + * + */ + +typedef struct OCI_Connection OCI_Connection; + +/** + * @typedef OCI_Statement + * + * @brief + * Oracle SQL or PL/SQL statement. + * + * A Statement object allows users to prepare, execute SQL orders or PL/SQL blocks + * + */ + +typedef struct OCI_Statement OCI_Statement; + +/** + * @typedef OCI_Bind + * + * @brief + * Internal bind representation. + * + * A bind object is an object that holds all information about an Oracle statement binding operation + * + */ + +typedef struct OCI_Bind OCI_Bind; + +/** + * @typedef OCI_Resultset + * + * @brief + * Collection of output columns from a select statement. + * + * A resultset object is the result of 'select' SQL Statement. + * + * It's a set of data (ordered in columns) that can be fetched row by row + * to get data returned by the SQL statement + * + */ + +typedef struct OCI_Resultset OCI_Resultset; + +/** + * @typedef OCI_Column + * + * @brief + * Oracle SQL Column and Type member representation. + * + * A column object represents an output column from a select statement + * + */ + +typedef struct OCI_Column OCI_Column; + +/** + * @typedef OCI_Lob + * + * @brief + * Oracle Internal Large objects: + * + * The following internal Larges Objects are supported: + * + * - BLOBs : Binary large objects + * - CLOBs / NCLOBs : Character large objects + * + * LOBs were introduced by OCI8 to replace Long data types. + * + * It's designed to store really larges objects (buffer, files) inside the database + * + * Oracle encourages programmers to use those objects instead of LONG, LONG RAW, ... + * + * OCILIB supports both LOBs and LONGs + * + */ + +typedef struct OCI_Lob OCI_Lob; + +/** + * @typedef OCI_File + * + * @brief + * Oracle External Large objects: + * + * The following external Larges Objects are supported: + * + * - BFILEs : Binary files + * - CFILEs : Character files + * + * FILEs were introduced by OCI8 in order to store references to files located outside the database. + * + * @warning + * Only Read-only access is allowed on BFILEs + * + * Two way to use FILEs : + * + * - within statement context (query, binding) + * - without statement context (server files reading) through OCI_File properties functions + * + */ + +typedef struct OCI_File OCI_File; + +/** + * @typedef OCI_Transaction + * + * @brief + * Oracle Transaction. + * + * A transaction can be: + * + * - Local: it's implicitly created by OCILIB + * - Global: it's explicitly created by the program + * + */ + +typedef struct OCI_Transaction OCI_Transaction; + +/** + * @typedef OCI_Long + * + * @brief Oracle Long data type. + * + * The following long Objects are supported: + * + * - LONG RAW : Binary long objects + * - LONG : Character long objects + * + * Those types were used in older versions of Oracle (before Oracle8i) to store + * large chunks of data in the database. + * + * It's now depreciated by Oracle that recommends using LOBs + * + * Many databases and applications are still designed to use LONGs that's why + * OCILIB supports Long Objects and piecewise operations + * + */ + +typedef struct OCI_Long OCI_Long; + +/** +* @typedef OCI_Number +* +* @brief +* Oracle NUMBER representation. +* +*/ +typedef struct OCI_Number OCI_Number; + +/** + * @typedef OCI_Date + * + * @brief + * Oracle internal date representation. + * + */ + +typedef struct OCI_Date OCI_Date; + +/** + * @typedef OCI_Timestamp + * + * @brief + * Oracle internal timestamp representation. + * + */ + +typedef struct OCI_Timestamp OCI_Timestamp; + +/** + * @typedef OCI_Interval + * + * @brief + * Oracle internal interval representation. + * + */ + +typedef struct OCI_Interval OCI_Interval; + +/** + * @typedef OCI_Object + * + * @brief + * Oracle Named types representation. + * + */ + +typedef struct OCI_Object OCI_Object; + +/** + * @typedef OCI_Coll + * + * @brief + * Oracle Collections (VARRAYs and Nested Tables) representation. + * + */ + +typedef struct OCI_Coll OCI_Coll; + +/** + * @typedef OCI_Elem + * + * @brief + * Oracle Collection item representation. + * + */ + +typedef struct OCI_Elem OCI_Elem; + +/** + * @typedef OCI_Iter + * + * @brief + * Oracle Collection iterator representation. + * + */ +typedef struct OCI_Iter OCI_Iter; + +/** + * @typedef OCI_TypeInfo + * + * @brief + * Type info metadata handle. + * + */ + +/** + * @typedef OCI_Ref + * + * @brief + * Oracle REF type representation. + * + */ + +typedef struct OCI_Ref OCI_Ref; + +/** + * @typedef OCI_TypeInfo + * + * @brief + * Type info meta data handle. + * + */ + +typedef struct OCI_TypeInfo OCI_TypeInfo; + +/** + * @typedef OCI_HashTable + * + * @brief + * OCILIB implementation of hash tables. + * + */ + +typedef struct OCI_HashTable OCI_HashTable; + +/** + * @typedef OCI_Error + * + * @brief + * Encapsulates an Oracle or OCILIB exception. + * + * The error object is used to raise internal or oracle errors. + * When an error occurs, if the application has provided an error handler, an + * error object is constructed and passed to the handler + * + */ + +typedef struct OCI_Error OCI_Error; + +/** + * @typedef OCI_Mutex + * + * @brief + * OCILIB encapsulation of OCI mutexes. + * + */ + +typedef struct OCI_Mutex OCI_Mutex; + +/** + * @typedef OCI_Thread + * + * @brief + * OCILIB encapsulation of OCI Threads. + * + */ + +typedef struct OCI_Thread OCI_Thread; + +/** + * @typedef OCI_DirPath + * + * @brief + * OCILIB encapsulation of OCI Direct Path handle. + * + */ + +typedef struct OCI_DirPath OCI_DirPath; + +/** + * @typedef OCI_Subscription + * + * @brief + * OCILIB encapsulation of Oracle DCN notification + * + */ + +typedef struct OCI_Subscription OCI_Subscription; + +/** + * @typedef OCI_Event + * + * @brief + * OCILIB encapsulation of Oracle DCN event + * + */ + +typedef struct OCI_Event OCI_Event; + +/** + * @typedef OCI_Msg + * + * @brief + * OCILIB encapsulation of A/Q message + * + */ + +typedef struct OCI_Msg OCI_Msg; + +/** + * @typedef OCI_Agent + * + * @brief + * OCILIB encapsulation of A/Q Agent + * + */ + +typedef struct OCI_Agent OCI_Agent; + +/** + * @typedef OCI_Dequeue + * + * @brief + * OCILIB encapsulation of A/Q dequeuing operations + * + */ + +typedef struct OCI_Dequeue OCI_Dequeue; + +/** + * @typedef OCI_Enqueue + * + * @brief + * OCILIB encapsulation of A/Q enqueuing operations + * + */ + +typedef struct OCI_Enqueue OCI_Enqueue; + +/** + * @var POCI_ERROR + * + * @brief + * Error procedure prototype + * + * @param err - Error handle + * + */ + +typedef void (*POCI_ERROR) +( + OCI_Error *err +); + +/** + * @var POCI_THREAD + * + * @brief + * Thread procedure prototype + * + * @param thread - Thread handle + * @param arg - Pointer passed to OCI_ThreadRun() + * + */ + +typedef void (*POCI_THREAD) +( + OCI_Thread *thread, + void *arg +); + +/** + * @var POCI_THREADKEYDEST + * + * @brief + * Thread key destructor prototype. + * + * @param data - Thread Key current pointer value + * + */ + +typedef void (*POCI_THREADKEYDEST) +( + void *data +); + +/** + * @var POCI_NOTIFY + * + * @brief + * Database Change Notification User callback prototype. + * + * @param event - Event handle + * + */ + +typedef void (*POCI_NOTIFY) +( + OCI_Event *event +); + +/** + * @var POCI_NOTIFY_AQ + * + * @brief + * AQ notification callback prototype. + * + * @param dequeue - dequeue handle + * + */ + +typedef void (*POCI_NOTIFY_AQ) +( + OCI_Dequeue *dequeue +); + +/** + * @var POCI_TAF_HANDLER + * + * @brief + * Failover Notification User callback prototype. + * + * @param con - Connection handle related to the event + * @param type - Event type + * @param event - Event code + * + * @note + * Possible values for parameter 'type' : + * - OCI_FOT_NONE + * - OCI_FOT_SESSION + * - OCI_FOT_SELECT + * + * @note + * Possible values for parameter 'event' : + * - OCI_FOE_END + * - OCI_FOE_ABORT + * - OCI_FOE_REAUTH + * - OCI_FOE_BEGIN + * - OCI_FOE_ERROR + * + * @return + * User callback should return one of the following value : + * - OCI_FOC_OK + * - OCI_FOC_RETRY + * + */ + +typedef unsigned int (*POCI_TAF_HANDLER) +( + OCI_Connection *con, + unsigned int type, + unsigned int event +); + +/** + * @var POCI_HA_HANDLER + * + * @brief + * HA (High Availability) events Notification User callback prototype. + * + * @param con - Connection handle related to the event + * @param source - source of the event + * @param event - type of the event + * @param time - Timestamp of the event + * + * @note + * Currently, Oracle only send HA down events + * + * @note + * Possible values for parameter 'source' : + * - OCI_HES_INSTANCE + * - OCI_HES_DATABASE + * - OCI_HES_NODE + * - OCI_HES_SERVICE + * - OCI_HES_SERVICE_MEMBER + * - OCI_HES_ASM_INSTANCE + * - OCI_HES_PRECONNECT + * + * @note + * Possible values for parameter 'event' : + * - OCI_HET_DOWN : HA event type down + * - OCI_HET_UP : HA event type up + * + */ + +typedef void (*POCI_HA_HANDLER) +( + OCI_Connection *con, + unsigned int source, + unsigned int event, + OCI_Timestamp *time +); + +/* public structures */ + +/** + * @typedef OCI_XID + * + * @brief + * Global transaction identifier + * + */ + +typedef struct OCI_XID { + long formatID; + long gtrid_length; + long bqual_length; + char data[128]; +} OCI_XID; + +/** + * @typedef OCI_Variant + * + * @brief + * Internal Variant type based on union C type. + * + * @note + * Helpful for generic buffer, it reduces the amount of casts + * + */ + +typedef union OCI_Variant { + /* integers */ + int num; + + /* raw data */ + unsigned char *p_bytes; + + /* pointer to c natives types */ + void *p_void; + int *p_int; + float *p_float; + double *p_double; + otext *p_text; + + /* ocilib object types */ + OCI_Date *p_date; + OCI_Interval *p_interval; + OCI_Timestamp *p_timestamp; + OCI_Long *p_long; + OCI_Lob *p_lob; + OCI_File *p_file; + OCI_Statement *p_stmt; + OCI_Column *p_col; + OCI_Object *p_obj; + OCI_Coll *p_coll; + OCI_Iter *p_iter; + OCI_Elem *p_elem; +} OCI_Variant; + +/** +* @typedef OCI_HashValue +* +* @brief +* Hash table entry value +* +* OCILIB implementation of hash tables uses chaining method for dealing with collisions +* +*/ + +typedef struct OCI_HashValue { + OCI_Variant value; + struct OCI_HashValue *next; +} OCI_HashValue; + +/** + * @typedef OCI_HashEntry + * + * @brief + * Hash table entry + * + */ + +typedef struct OCI_HashEntry { + otext *key; + struct OCI_HashValue *values; + struct OCI_HashEntry *next; +} OCI_HashEntry; + +/** + * @typedef big_int + * + * @brief + * big_int is a C scalar integer (32 or 64 bits) depending on compiler support for 64bits integers. + * big_uint is an unsigned big_int + * + */ + +/* check for long long support */ + +#if defined(_LONGLONG) || defined(LONG_LONG_MAX) || defined(LLONG_MAX) || defined(__LONG_LONG_MAX__) + +/* C99 long long supported */ + +typedef long long big_int; +typedef unsigned long long big_uint; + + #define OCI_BIG_UINT_ENABLED + +#elif defined(_WINDOWS) + +/* Microsoft extension supported */ + +typedef __int64 big_int; +typedef unsigned __int64 big_uint; + + #define OCI_BIG_UINT_ENABLED + +#else + +typedef int big_int; +typedef unsigned int big_uint; + +#endif + +/** + * @} + */ + +/* boolean values */ + +#ifndef TRUE + #define TRUE 1 + #define FALSE 0 +#endif + +#ifndef boolean + #define boolean int +#endif + +/* versions extract macros */ + +#define OCI_VER_MAJ(v) (unsigned int) ((v)/100) +#define OCI_VER_MIN(v) (unsigned int) (((v)/10) - (((v)/100)*10)) +#define OCI_VER_REV(v) (unsigned int) ((v) - (((v)/10)*10)) + +#define OCI_VER_MAKE(x, y, z) ((x)*100 + (y)*10 + (z)) + +/* oracle OCI key versions*/ + +#define OCI_8_0 OCI_VER_MAKE( 8, 0, 0) +#define OCI_8_1 OCI_VER_MAKE( 8, 1, 0) +#define OCI_9_0 OCI_VER_MAKE( 9, 0, 0) +#define OCI_9_2 OCI_VER_MAKE( 9, 2, 0) +#define OCI_10_1 OCI_VER_MAKE(10, 1, 0) +#define OCI_10_2 OCI_VER_MAKE(10, 2, 0) +#define OCI_11_1 OCI_VER_MAKE(11, 1, 0) +#define OCI_11_2 OCI_VER_MAKE(11, 2, 0) +#define OCI_12_1 OCI_VER_MAKE(12, 1, 0) +#define OCI_12_2 OCI_VER_MAKE(12, 2, 0) +#define OCI_18_1 OCI_VER_MAKE(18, 1, 0) +#define OCI_18_2 OCI_VER_MAKE(18, 2, 0) +#define OCI_18_3 OCI_VER_MAKE(18, 3, 0) +#define OCI_18_4 OCI_VER_MAKE(18, 4, 0) +#define OCI_18_5 OCI_VER_MAKE(18, 5, 0) +#define OCI_19_3 OCI_VER_MAKE(19, 3, 0) + +/* OCILIB Error types */ + +#define OCI_ERR_ORACLE 1 +#define OCI_ERR_OCILIB 2 +#define OCI_ERR_WARNING 3 + +/* OCILIB Error codes */ + +#define OCI_ERR_NONE 0 +#define OCI_ERR_NOT_INITIALIZED 1 +#define OCI_ERR_LOADING_SHARED_LIB 2 +#define OCI_ERR_LOADING_SYMBOLS 3 +#define OCI_ERR_MULTITHREADED 4 +#define OCI_ERR_MEMORY 5 +#define OCI_ERR_NOT_AVAILABLE 6 +#define OCI_ERR_NULL_POINTER 7 +#define OCI_ERR_DATATYPE_NOT_SUPPORTED 8 +#define OCI_ERR_PARSE_TOKEN 9 +#define OCI_ERR_MAP_ARGUMENT 10 +#define OCI_ERR_OUT_OF_BOUNDS 11 +#define OCI_ERR_UNFREED_DATA 12 +#define OCI_ERR_MAX_BIND 13 +#define OCI_ERR_ATTR_NOT_FOUND 14 +#define OCI_ERR_MIN_VALUE 15 +#define OCI_ERR_NOT_COMPATIBLE 16 +#define OCI_ERR_STMT_STATE 17 +#define OCI_ERR_STMT_NOT_SCROLLABLE 18 +#define OCI_ERR_BIND_ALREADY_USED 19 +#define OCI_ERR_BIND_ARRAY_SIZE 20 +#define OCI_ERR_COLUMN_NOT_FOUND 21 +#define OCI_ERR_DIRPATH_STATE 22 +#define OCI_ERR_CREATE_OCI_ENVIRONMENT 23 +#define OCI_ERR_REBIND_BAD_DATATYPE 24 +#define OCI_ERR_TYPEINFO_DATATYPE 25 +#define OCI_ERR_ITEM_NOT_FOUND 26 +#define OCI_ERR_ARG_INVALID_VALUE 27 +#define OCI_ERR_XA_ENV_FROM_STRING 28 +#define OCI_ERR_XA_CONN_FROM_STRING 29 +#define OCI_ERR_BIND_EXTERNAL_NOT_ALLOWED 30 + +#define OCI_ERR_COUNT 31 + + +/* allocated bytes types */ + +#define OCI_MEM_ORACLE 1 +#define OCI_MEM_OCILIB 2 +#define OCI_MEM_ALL (OCI_MEM_ORACLE | OCI_MEM_OCILIB) + +/* binding */ + +#define OCI_BIND_BY_POS 0 +#define OCI_BIND_BY_NAME 1 +#define OCI_BIND_SIZE 6 +#define OCI_BIND_MAX 65535 + +/* fetching */ + +#define OCI_FETCH_SIZE 20 +#define OCI_PREFETCH_SIZE 20 +#define OCI_LONG_EXPLICIT 1 +#define OCI_LONG_IMPLICIT 2 + +/* unknown value */ + +#define OCI_UNKNOWN 0 + +/* C Data Type mapping */ + +#define OCI_CDT_NUMERIC 1 +#define OCI_CDT_DATETIME 3 +#define OCI_CDT_TEXT 4 +#define OCI_CDT_LONG 5 +#define OCI_CDT_CURSOR 6 +#define OCI_CDT_LOB 7 +#define OCI_CDT_FILE 8 +#define OCI_CDT_TIMESTAMP 9 +#define OCI_CDT_INTERVAL 10 +#define OCI_CDT_RAW 11 +#define OCI_CDT_OBJECT 12 +#define OCI_CDT_COLLECTION 13 +#define OCI_CDT_REF 14 +#define OCI_CDT_BOOLEAN 15 + +/* Data Type codes for OCI_ImmediateXXX() calls */ + +#define OCI_ARG_SHORT 1 +#define OCI_ARG_USHORT 2 +#define OCI_ARG_INT 3 +#define OCI_ARG_UINT 4 +#define OCI_ARG_BIGINT 5 +#define OCI_ARG_BIGUINT 6 +#define OCI_ARG_DOUBLE 7 +#define OCI_ARG_DATETIME 8 +#define OCI_ARG_TEXT 9 +#define OCI_ARG_LOB 10 +#define OCI_ARG_FILE 11 +#define OCI_ARG_TIMESTAMP 12 +#define OCI_ARG_INTERVAL 13 +#define OCI_ARG_RAW 14 +#define OCI_ARG_OBJECT 15 +#define OCI_ARG_COLLECTION 16 +#define OCI_ARG_REF 17 +#define OCI_ARG_FLOAT 18 +#define OCI_ARG_NUMBER 19 + +/* statement types */ + +#define OCI_CST_SELECT 1 +#define OCI_CST_UPDATE 2 +#define OCI_CST_DELETE 3 +#define OCI_CST_INSERT 4 +#define OCI_CST_CREATE 5 +#define OCI_CST_DROP 6 +#define OCI_CST_ALTER 7 +#define OCI_CST_BEGIN 8 +#define OCI_CST_DECLARE 9 +#define OCI_CST_CALL 10 +#define OCI_CST_MERGE 16 + +/* environment modes */ + +#define OCI_ENV_DEFAULT 0 +#define OCI_ENV_THREADED 1 +#define OCI_ENV_CONTEXT 2 +#define OCI_ENV_EVENTS 4 + +/* sessions modes */ + +#define OCI_SESSION_DEFAULT 0x00000000 /* any version */ +#define OCI_SESSION_SYSDBA 0x00000002 /* any version */ +#define OCI_SESSION_SYSOPER 0x00000004 /* any version */ +#define OCI_SESSION_SYSASM 0x00008000 /* From 11gR1 */ +#define OCI_SESSION_SYSBKP 0x00020000 /* From 12cR1 */ +#define OCI_SESSION_SYSDGD 0x00040000 /* From 12cR1 */ +#define OCI_SESSION_SYSKMT 0x00080000 /* From 12cR1 */ +#define OCI_SESSION_SYSRAC 0x00100000 /* From 12cR2 */ + +#define OCI_SESSION_XA 0x00000001 +#define OCI_SESSION_PRELIM_AUTH 0x00000008 + +/* change notification types */ + +#define OCI_CNT_OBJECTS 1 +#define OCI_CNT_ROWS 2 +#define OCI_CNT_DATABASES 4 +#define OCI_CNT_ALL (OCI_CNT_OBJECTS | OCI_CNT_ROWS | OCI_CNT_DATABASES) + +/* event notification types */ + +#define OCI_ENT_STARTUP 1 +#define OCI_ENT_SHUTDOWN 2 +#define OCI_ENT_SHUTDOWN_ANY 3 +#define OCI_ENT_DROP_DATABASE 4 +#define OCI_ENT_DEREGISTER 5 +#define OCI_ENT_OBJECT_CHANGED 6 + +/* event object notification types */ + +#define OCI_ONT_INSERT 0x2 +#define OCI_ONT_UPDATE 0x4 +#define OCI_ONT_DELETE 0x8 +#define OCI_ONT_ALTER 0x10 +#define OCI_ONT_DROP 0x20 +#define OCI_ONT_GENERIC 0x40 + +/* database startup modes */ + +#define OCI_DB_SPM_START 1 +#define OCI_DB_SPM_MOUNT 2 +#define OCI_DB_SPM_OPEN 4 +#define OCI_DB_SPM_FULL (OCI_DB_SPM_START | OCI_DB_SPM_MOUNT | OCI_DB_SPM_OPEN) + +/* database startup flags */ + +#define OCI_DB_SPF_DEFAULT 0 +#define OCI_DB_SPF_FORCE 1 +#define OCI_DB_SPF_RESTRICT 2 + +/* database shutdown modes */ + +#define OCI_DB_SDM_SHUTDOWN 1 +#define OCI_DB_SDM_CLOSE 2 +#define OCI_DB_SDM_DISMOUNT 4 +#define OCI_DB_SDM_FULL (OCI_DB_SDM_SHUTDOWN | OCI_DB_SDM_CLOSE | OCI_DB_SDM_DISMOUNT) + +/* database shutdown flags */ + +#define OCI_DB_SDF_DEFAULT 0 +#define OCI_DB_SDF_TRANS 1 +#define OCI_DB_SDF_TRANS_LOCAL 2 +#define OCI_DB_SDF_IMMEDIATE 3 +#define OCI_DB_SDF_ABORT 4 + +/* charset form types */ + +#define OCI_CSF_NONE 0 +#define OCI_CSF_DEFAULT 1 +#define OCI_CSF_NATIONAL 2 + +/* statement fetch mode */ + +#define OCI_SFM_DEFAULT 0 +#define OCI_SFM_SCROLLABLE 0x08 + +/* statement fetch direction */ + +#define OCI_SFD_ABSOLUTE 0x20 +#define OCI_SFD_RELATIVE 0x40 + +/* bind allocation mode */ + +#define OCI_BAM_EXTERNAL 1 +#define OCI_BAM_INTERNAL 2 + +/* bind direction mode */ + +#define OCI_BDM_IN 1 +#define OCI_BDM_OUT 2 +#define OCI_BDM_IN_OUT (OCI_BDM_IN | OCI_BDM_OUT) + +/* Column property flags */ + +#define OCI_CPF_NONE 0 +#define OCI_CPF_IS_IDENTITY 1 +#define OCI_CPF_IS_GEN_ALWAYS 2 +#define OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL 4 +#define OCI_CPF_IS_LPART 8 +#define OCI_CPF_IS_CONID 16 + +/* Column collation IDs */ + +#define OCI_CCI_NONE 0x00000000 +#define OCI_CCI_NLS_COMP 0x00003FFE +#define OCI_CCI_NLS_SORT 0x00003FFD +#define OCI_CCI_NLS_SORT_CI 0x00003FFC +#define OCI_CCI_NLS_SORT_AI 0x00003FFB +#define OCI_CCI_NLS_SORT_CS 0x00003FFA +#define OCI_CCI_NLS_SORT_VAR1 0x00003FF9 +#define OCI_CCI_NLS_SORT_VAR1_CI 0x00003FF8 +#define OCI_CCI_NLS_SORT_VAR1_AI 0x00003FF7 +#define OCI_CCI_NLS_SORT_VAR1_CS 0x00003FF6 +#define OCI_CCI_BINARY 0x00003FFF +#define OCI_CCI_BINARY_CI 0x00023FFF +#define OCI_CCI_BINARY_AI 0x00013FFF + + +/* Integer sign flag */ + +#define OCI_NUM_UNSIGNED 2 + +/* External Integer types */ + +#define OCI_NUM_SHORT 4 +#define OCI_NUM_INT 8 +#define OCI_NUM_BIGINT 16 +#define OCI_NUM_FLOAT 32 +#define OCI_NUM_DOUBLE 64 +#define OCI_NUM_NUMBER 128 + +#define OCI_NUM_USHORT (OCI_NUM_SHORT | OCI_NUM_UNSIGNED) +#define OCI_NUM_UINT (OCI_NUM_INT | OCI_NUM_UNSIGNED) +#define OCI_NUM_BIGUINT (OCI_NUM_BIGINT | OCI_NUM_UNSIGNED) + +/* timestamp types */ + +#define OCI_TIMESTAMP 1 +#define OCI_TIMESTAMP_TZ 2 +#define OCI_TIMESTAMP_LTZ 3 + +/* interval types */ + +#define OCI_INTERVAL_YM 1 +#define OCI_INTERVAL_DS 2 + +/* long types */ + +#define OCI_BLONG 1 +#define OCI_CLONG 2 + +/* lob types */ + +#define OCI_BLOB 1 +#define OCI_CLOB 2 +#define OCI_NCLOB 3 + +/* lob opening mode */ + +#define OCI_LOB_READONLY 1 +#define OCI_LOB_READWRITE 2 + +/* file types */ + +#define OCI_BFILE 1 +#define OCI_CFILE 2 + +/* lob browsing mode */ + +#define OCI_SEEK_SET 1 +#define OCI_SEEK_END 2 +#define OCI_SEEK_CUR 3 + +/* type info types */ + +#define OCI_TIF_TABLE 1 +#define OCI_TIF_VIEW 2 +#define OCI_TIF_TYPE 3 + +/* object type */ + +#define OCI_OBJ_PERSISTENT 1 +#define OCI_OBJ_TRANSIENT 2 +#define OCI_OBJ_VALUE 3 + +/* collection types */ + +#define OCI_COLL_VARRAY 1 +#define OCI_COLL_NESTED_TABLE 2 +#define OCI_COLL_INDEXED_TABLE 3 + +/* pool types */ + +#define OCI_POOL_CONNECTION 1 +#define OCI_POOL_SESSION 2 + +/* AQ message state */ + +#define OCI_AMS_READY 1 +#define OCI_AMS_WAITING 2 +#define OCI_AMS_PROCESSED 3 +#define OCI_AMS_EXPIRED 4 + +/* AQ sequence deviation */ + +#define OCI_ASD_BEFORE 2 +#define OCI_ASD_TOP 3 + +/* AQ message visibility */ + +#define OCI_AMV_IMMEDIATE 1 +#define OCI_AMV_ON_COMMIT 2 + +/* AQ dequeue mode */ + +#define OCI_ADM_BROWSE 1 +#define OCI_ADM_LOCKED 2 +#define OCI_ADM_REMOVE 3 +#define OCI_ADM_REMOVE_NODATA 4 + +/* AQ dequeue navigation */ + +#define OCI_ADN_FIRST_MSG 1 +#define OCI_ADN_NEXT_TRANSACTION 2 +#define OCI_ADN_NEXT_MSG 3 + +/* AQ queue table purge mode */ + +#define OCI_APM_BUFFERED 1 +#define OCI_APM_PERSISTENT 2 +#define OCI_APM_ALL (OCI_APM_BUFFERED | OCI_APM_PERSISTENT) + +/* AQ queue table grouping mode */ + +#define OCI_AGM_NONE 0 +#define OCI_AGM_TRANSACTIONNAL 1 + +/* AQ queue table type */ + +#define OCI_AQT_NORMAL 0 +#define OCI_AQT_EXCEPTION 1 +#define OCI_AQT_NON_PERSISTENT 2 + +/* direct path processing return status */ + +#define OCI_DPR_COMPLETE 1 +#define OCI_DPR_ERROR 2 +#define OCI_DPR_FULL 3 +#define OCI_DPR_PARTIAL 4 +#define OCI_DPR_EMPTY 5 + +/* direct path conversion modes */ + +#define OCI_DCM_DEFAULT 1 +#define OCI_DCM_FORCE 2 + +/* trace size constants */ + +#define OCI_SIZE_TRACE_ID 64 +#define OCI_SIZE_TRACE_MODULE 48 +#define OCI_SIZE_TRACE_ACTION 32 +#define OCI_SIZE_TRACE_INFO 64 +#define OCI_SIZE_TRACE_OPERATION 32 + +/* trace types */ + +#define OCI_TRC_IDENTITY 1 +#define OCI_TRC_MODULE 2 +#define OCI_TRC_ACTION 3 +#define OCI_TRC_DETAIL 4 +#define OCI_TRC_OPERATION 5 + +/* Network timeout type */ + +#define OCI_NTO_SEND 1 +#define OCI_NTO_RECEIVE 2 +#define OCI_NTO_CALL 3 + +/* HA event type */ + +#define OCI_HET_DOWN 0 +#define OCI_HET_UP 1 + +/* HA event source */ +#define OCI_HES_INSTANCE 0 +#define OCI_HES_DATABASE 1 +#define OCI_HES_NODE 2 +#define OCI_HES_SERVICE 3 +#define OCI_HES_SERVICE_MEMBER 4 +#define OCI_HES_ASM_INSTANCE 5 +#define OCI_HES_PRECONNECT 6 + +/* Fail over types */ + +#define OCI_FOT_NONE 1 +#define OCI_FOT_SESSION 2 +#define OCI_FOT_SELECT 4 + +/* fail over notifications */ + +#define OCI_FOE_END 1 +#define OCI_FOE_ABORT 2 +#define OCI_FOE_REAUTH 4 +#define OCI_FOE_BEGIN 8 +#define OCI_FOE_ERROR 16 + +/* fail over callback return code */ + +#define OCI_FOC_OK 0 +#define OCI_FOC_RETRY 25410 + +/* hash tables support */ + +#define OCI_HASH_STRING 1 +#define OCI_HASH_INTEGER 2 +#define OCI_HASH_POINTER 3 + +/* transaction types */ + +#define OCI_TRS_NEW 0x00000001 +#define OCI_TRS_READONLY 0x00000100 +#define OCI_TRS_READWRITE 0x00000200 +#define OCI_TRS_SERIALIZABLE 0x00000400 +#define OCI_TRS_LOOSE 0x00010000 +#define OCI_TRS_TIGHT 0x00020000 + +/* format types */ + +#define OCI_FMT_DATE 1 +#define OCI_FMT_TIMESTAMP 2 +#define OCI_FMT_NUMERIC 3 +#define OCI_FMT_BINARY_DOUBLE 4 +#define OCI_FMT_BINARY_FLOAT 5 +#define OCI_FMT_TIMESTAMP_TZ 6 + +/* sql function codes */ + +#define OCI_SFC_CREATE_TABLE 1 +#define OCI_SFC_INSERT 2 +#define OCI_SFC_SELECT 3 +#define OCI_SFC_CREATE_CLUSTER 4 +#define OCI_SFC_ALTER_CLUSTER 5 +#define OCI_SFC_UPDATE 6 +#define OCI_SFC_DELETE 7 +#define OCI_SFC_DROP_CLUSTER 8 +#define OCI_SFC_CREATE_INDEX 9 +#define OCI_SFC_DROP_INDEX 10 +#define OCI_SFC_ALTER_INDEX 11 +#define OCI_SFC_DROP_TABLE 12 +#define OCI_SFC_CREATE_SEQUENCE 13 +#define OCI_SFC_ALTER_SEQUENCE 14 +#define OCI_SFC_ALTER_TABLE 15 +#define OCI_SFC_DROP_SEQUENCE 16 +#define OCI_SFC_GRANT_OBJECT 17 +#define OCI_SFC_REVOKE_OBJECT 18 +#define OCI_SFC_CREATE_SYNONYM 19 +#define OCI_SFC_DROP_SYNONYM 20 +#define OCI_SFC_CREATE_VIEW 21 +#define OCI_SFC_DROP_VIEW 22 +#define OCI_SFC_VALIDATE_INDEX 23 +#define OCI_SFC_CREATE_PROCEDURE 24 +#define OCI_SFC_ALTER_PROCEDURE 25 +#define OCI_SFC_LOCK 26 +#define OCI_SFC_NO_OP 27 +#define OCI_SFC_RENAME 28 +#define OCI_SFC_COMMENT 29 +#define OCI_SFC_AUDIT_OBJECT 30 +#define OCI_SFC_NOAUDIT_OBJECT 31 +#define OCI_SFC_CREATE_DATABASE_LINK 32 +#define OCI_SFC_DROP_DATABASE_LINK 33 +#define OCI_SFC_CREATE_DATABASE 34 +#define OCI_SFC_ALTER_DATABASE 35 +#define OCI_SFC_CREATE_ROLLBACK_SEG 36 +#define OCI_SFC_ALTER_ROLLBACK_SEG 37 +#define OCI_SFC_DROP_ROLLBACK_SEG 38 +#define OCI_SFC_CREATE_TABLESPACE 39 +#define OCI_SFC_ALTER_TABLESPACE 40 +#define OCI_SFC_DROP_TABLESPACE 41 +#define OCI_SFC_ALTER_SESSION 42 +#define OCI_SFC_ALTER_USER 43 +#define OCI_SFC_COMMIT 44 +#define OCI_SFC_ROLLBACK 45 +#define OCI_SFC_SAVEPOINT 46 +#define OCI_SFC_PL_SQL_EXECUTE 47 +#define OCI_SFC_SET_TRANSACTION 48 +#define OCI_SFC_ALTER_SYSTEM 49 +#define OCI_SFC_EXPLAIN 50 +#define OCI_SFC_CREATE_USER 51 +#define OCI_SFC_CREATE_ROLE 52 +#define OCI_SFC_DROP_USER 53 +#define OCI_SFC_DROP_ROLE 54 +#define OCI_SFC_SET_ROLE 55 +#define OCI_SFC_CREATE_SCHEMA 56 +#define OCI_SFC_CREATE_CONTROL_FILE 57 +#define OCI_SFC_ALTER_TRACING 58 +#define OCI_SFC_CREATE_TRIGGER 59 +#define OCI_SFC_ALTER_TRIGGER 60 +#define OCI_SFC_DROP_TRIGGER 61 +#define OCI_SFC_ANALYZE_TABLE 62 +#define OCI_SFC_ANALYZE_INDEX 63 +#define OCI_SFC_ANALYZE_CLUSTER 64 +#define OCI_SFC_CREATE_PROFILE 65 +#define OCI_SFC_DROP_PROFILE 66 +#define OCI_SFC_ALTER_PROFILE 67 +#define OCI_SFC_DROP_PROCEDURE 68 +#define OCI_SFC_ALTER_RESOURCE_COST 70 +#define OCI_SFC_CREATE_MATERIALIZED_VIEW_LOG 71 +#define OCI_SFC_ALTER_MATERIALIZED_VIEW_LOG 72 +#define OCI_SFC_DROP_MATERIALIZED_VIEW_LOG 73 +#define OCI_SFC_CREATE_MATERIALIZED_VIEW 74 +#define OCI_SFC_ALTER_MATERIALIZED_VIEW 75 +#define OCI_SFC_DROP_MATERIALIZED_VIEW 76 +#define OCI_SFC_CREATE_TYPE 77 +#define OCI_SFC_DROP_TYPE 78 +#define OCI_SFC_ALTER_ROLE 79 +#define OCI_SFC_ALTER_TYPE 80 +#define OCI_SFC_CREATE_TYPE_BODY 81 +#define OCI_SFC_ALTER_TYPE_BODY 82 +#define OCI_SFC_DROP_TYPE_BODY 83 +#define OCI_SFC_DROP_LIBRARY 84 +#define OCI_SFC_TRUNCATE_TABLE 85 +#define OCI_SFC_TRUNCATE_CLUSTER 86 +#define OCI_SFC_ALTER_VIEW 88 +#define OCI_SFC_SET_CONSTRAINTS 90 +#define OCI_SFC_CREATE_FUNCTION 91 +#define OCI_SFC_ALTER_FUNCTION 92 +#define OCI_SFC_DROP_FUNCTION 93 +#define OCI_SFC_CREATE_PACKAGE 94 +#define OCI_SFC_ALTER_PACKAGE 95 +#define OCI_SFC_DROP_PACKAGE 96 +#define OCI_SFC_CREATE_PACKAGE_BODY 97 +#define OCI_SFC_ALTER_PACKAGE_BODY 98 +#define OCI_SFC_DROP_PACKAGE_BODY 99 +#define OCI_SFC_LOGON 100 +#define OCI_SFC_LOGOFF 101 +#define OCI_SFC_LOGOFF_BY_CLEANUP 102 +#define OCI_SFC_SESSION_REC 103 +#define OCI_SFC_SYSTEM_AUDIT 104 +#define OCI_SFC_SYSTEM_NOAUDIT 105 +#define OCI_SFC_AUDIT_DEFAULT 106 +#define OCI_SFC_NOAUDIT_DEFAULT 107 +#define OCI_SFC_SYSTEM_GRANT 108 +#define OCI_SFC_SYSTEM_REVOKE 109 +#define OCI_SFC_CREATE_PUBLIC_SYNONYM 110 +#define OCI_SFC_DROP_PUBLIC_SYNONYM 111 +#define OCI_SFC_CREATE_PUBLIC_DATABASE_LINK 112 +#define OCI_SFC_DROP_PUBLIC_DATABASE_LINK 113 +#define OCI_SFC_GRANT_ROLE 114 +#define OCI_SFC_REVOKE_ROLE 115 +#define OCI_SFC_EXECUTE_PROCEDURE 116 +#define OCI_SFC_USER_COMMENT 117 +#define OCI_SFC_ENABLE_TRIGGER 118 +#define OCI_SFC_DISABLE_TRIGGER 119 +#define OCI_SFC_ENABLE_ALL_TRIGGERS 120 +#define OCI_SFC_DISABLE_ALL_TRIGGERS 121 +#define OCI_SFC_NETWORK_ERROR 122 +#define OCI_SFC_EXECUTE_TYPE 123 +#define OCI_SFC_READ_DIRECTORY 125 +#define OCI_SFC_WRITE_DIRECTORY 126 +#define OCI_SFC_FLASHBACK 128 +#define OCI_SFC_BECOME_USER 129 +#define OCI_SFC_ALTER_MINING_MODEL 130 +#define OCI_SFC_SELECT_MINING_MODEL 131 +#define OCI_SFC_CREATE_MINING_MODEL 133 +#define OCI_SFC_ALTER_PUBLIC_SYNONYM 134 +#define OCI_SFC_EXECUTE_DIRECTORY 135 +#define OCI_SFC_SQL_LOADER_DIRECT_PATH_LOAD 136 +#define OCI_SFC_DATAPUMP_DIRECT_PATH_UNLOAD 137 +#define OCI_SFC_DATABASE_STARTUP 138 +#define OCI_SFC_DATABASE_SHUTDOWN 139 +#define OCI_SFC_CREATE_SQL_TXLN_PROFILE 140 +#define OCI_SFC_ALTER_SQL_TXLN_PROFILE 141 +#define OCI_SFC_USE_SQL_TXLN_PROFILE 142 +#define OCI_SFC_DROP_SQL_TXLN_PROFILE 143 +#define OCI_SFC_CREATE_MEASURE_FOLDER 144 +#define OCI_SFC_ALTER_MEASURE_FOLDER 145 +#define OCI_SFC_DROP_MEASURE_FOLDER 146 +#define OCI_SFC_CREATE_CUBE_BUILD_PROCESS 147 +#define OCI_SFC_ALTER_CUBE_BUILD_PROCESS 148 +#define OCI_SFC_DROP_CUBE_BUILD_PROCESS 149 +#define OCI_SFC_CREATE_CUBE 150 +#define OCI_SFC_ALTER_CUBE 151 +#define OCI_SFC_DROP_CUBE 152 +#define OCI_SFC_CREATE_CUBE_DIMENSION 153 +#define OCI_SFC_ALTER_CUBE_DIMENSION 154 +#define OCI_SFC_DROP_CUBE_DIMENSION 155 +#define OCI_SFC_CREATE_DIRECTORY 157 +#define OCI_SFC_DROP_DIRECTORY 158 +#define OCI_SFC_CREATE_LIBRARY 159 +#define OCI_SFC_CREATE_JAVA 160 +#define OCI_SFC_ALTER_JAVA 161 +#define OCI_SFC_DROP_JAVA 162 +#define OCI_SFC_CREATE_OPERATOR 163 +#define OCI_SFC_CREATE_INDEXTYPE 164 +#define OCI_SFC_DROP_INDEXTYPE 165 +#define OCI_SFC_ALTER_INDEXTYPE 166 +#define OCI_SFC_DROP_OPERATOR 167 +#define OCI_SFC_ASSOCIATE_STATISTICS 168 +#define OCI_SFC_DISASSOCIATE_STATISTICS 169 +#define OCI_SFC_CALL_METHOD 170 +#define OCI_SFC_CREATE_SUMMARY 171 +#define OCI_SFC_ALTER_SUMMARY 172 +#define OCI_SFC_DROP_SUMMARY 173 +#define OCI_SFC_CREATE_DIMENSION 174 +#define OCI_SFC_ALTER_DIMENSION 175 +#define OCI_SFC_DROP_DIMENSION 176 +#define OCI_SFC_CREATE_CONTEXT 177 +#define OCI_SFC_DROP_CONTEXT 178 +#define OCI_SFC_ALTER_OUTLINE 179 +#define OCI_SFC_CREATE_OUTLINE 180 +#define OCI_SFC_DROP_OUTLINE 181 +#define OCI_SFC_UPDATE_INDEXES 182 +#define OCI_SFC_ALTER_OPERATOR 183 +#define OCI_SFC_CREATE_SPFILE 187 +#define OCI_SFC_CREATE_PFILE 188 +#define OCI_SFC_MERGE 189 +#define OCI_SFC_PASSWORD_CHANGE 190 +#define OCI_SFC_ALTER_SYNONYM 192 +#define OCI_SFC_ALTER_DISKGROUP 193 +#define OCI_SFC_CREATE_DISKGROUP 194 +#define OCI_SFC_DROP_DISKGROUP 195 +#define OCI_SFC_PURGE_RECYCLEBIN 197 +#define OCI_SFC_PURGE_DBA_RECYCLEBIN 198 +#define OCI_SFC_PURGE_TABLESPACE 199 +#define OCI_SFC_PURGE_TABLE 200 +#define OCI_SFC_PURGE_INDEX 201 +#define OCI_SFC_UNDROP_OBJECT 202 +#define OCI_SFC_DROP_DATABASE 203 +#define OCI_SFC_FLASHBACK_DATABASE 204 +#define OCI_SFC_FLASHBACK_TABLE 205 +#define OCI_SFC_CREATE_RESTORE_POINT 206 +#define OCI_SFC_DROP_RESTORE_POINT 207 +#define OCI_SFC_PROXY_AUTHENTICATION_ONLY 208 +#define OCI_SFC_DECLARE_REWRITE_EQUIVALENCE 209 +#define OCI_SFC_ALTER_REWRITE_EQUIVALENCE 210 +#define OCI_SFC_DROP_REWRITE_EQUIVALENCE 211 +#define OCI_SFC_CREATE_EDITION 212 +#define OCI_SFC_ALTER_EDITION 213 +#define OCI_SFC_DROP_EDITION 214 +#define OCI_SFC_DROP_ASSEMBLY 215 +#define OCI_SFC_CREATE_ASSEMBLY 216 +#define OCI_SFC_ALTER_ASSEMBLY 217 +#define OCI_SFC_CREATE_FLASHBACK_ARCHIVE 218 +#define OCI_SFC_ALTER_FLASHBACK_ARCHIVE 219 +#define OCI_SFC_DROP_FLASHBACK_ARCHIVE 220 +#define OCI_SFC_DEBUG_CONNECT 221 +#define OCI_SFC_DEBUG_PROCEDURE 223 +#define OCI_SFC_ALTER_DATABASE_LINK 225 +#define OCI_SFC_CREATE_PLUGGABLE_DATABASE 226 +#define OCI_SFC_ALTER_PLUGGABLE_DATABASE 227 +#define OCI_SFC_DROP_PLUGGABLE_DATABASE 228 +#define OCI_SFC_CREATE_AUDIT_POLICY 229 +#define OCI_SFC_ALTER_AUDIT_POLICY 230 +#define OCI_SFC_DROP_AUDIT_POLICY 231 +#define OCI_SFC_CODE_BASED_GRANT 232 +#define OCI_SFC_CODE_BASED_REVOKE 233 +#define OCI_SFC_CREATE_LOCKDOWN_PROFILE 234 +#define OCI_SFC_DROP_LOCKDOWN_PROFILE 235 +#define OCI_SFC_ALTER_LOCKDOWN_PROFILE 236 +#define OCI_SFC_TRANSLATE_SQL 237 +#define OCI_SFC_ADMINISTER_KEY_MANAGEMENT 238 +#define OCI_SFC_CREATE_MATERIALIZED_ZONEMAP 239 +#define OCI_SFC_ALTER_MATERIALIZED_ZONEMAP 240 +#define OCI_SFC_DROP_MATERIALIZED_ZONEMAP 241 +#define OCI_SFC_DROP_MINING_MODEL 242 +#define OCI_SFC_CREATE_ATTRIBUTE_DIMENSION 243 +#define OCI_SFC_ALTER_ATTRIBUTE_DIMENSION 244 +#define OCI_SFC_DROP_ATTRIBUTE_DIMENSION 245 +#define OCI_SFC_CREATE_HIERARCHY 246 +#define OCI_SFC_ALTER_HIERARCHY 247 +#define OCI_SFC_DROP_HIERARCHY 248 +#define OCI_SFC_CREATE_ANALYTIC_VIEW 249 +#define OCI_SFC_ALTER_ANALYTIC_VIEW 250 +#define OCI_SFC_DROP_ANALYTIC_VIEW 251 +#define OCI_SFC_ALTER_PUBLIC_DATABASE_LINK 305 + + + +/* size constants */ + +#define OCI_SIZE_FORMAT 64 +#define OCI_SIZE_BUFFER 512 +#define OCI_SIZE_LARGE_BUFFER ((64*1024)-1) +#define OCI_SIZE_LONG ((64*1024)-1) +#define OCI_SIZE_DATE 45 +#define OCI_SIZE_TIMESTAMP 54 +#define OCI_SIZE_FORMAT_TODATE 14 +#define OCI_SIZE_NULL 4 +#define OCI_SIZE_PRECISION 10 +#define OCI_SIZE_ROWID 23 +#define OCI_SIZE_DIRECTORY 30 +#define OCI_SIZE_FILENAME 255 +#define OCI_SIZE_FORMAT_NUMS 40 +#define OCI_SIZE_FORMAT_NUML 65 +#define OCI_SIZE_OBJ_NAME 128 + +#define OCI_HASH_DEFAULT_SIZE 256 + +/* string constants */ + +#define OCILIB_DRIVER_NAME OTEXT("OCILIB") +#define OCI_STRING_NULL OTEXT("NULL") +#define OCI_STRING_EMPTY OTEXT("") +#define OCI_STRING_FORMAT_DATE OTEXT("YYYY-MM-DD") +#define OCI_STRING_FORMAT_TIME OTEXT("HH24:MI:SS") +#define OCI_STRING_FORMAT_DATETIME OTEXT("YYYY-MM-DD HH24:MI:SS") +#define OCI_STRING_FORMAT_TIMESTAMP OTEXT("YYYY-MM-DD HH24:MI:SS.FF") +#define OCI_STRING_FORMAT_TIMESTAMP_TZ OTEXT("YYYY-MM-DD HH24:MI:SS.FF TZR") +#define OCI_STRING_DEFAULT_PREC 3 +#define OCI_STRING_FORMAT_NUM \ + OTEXT("FM99999999999999999999999999999999999990.999999999999999999999999") +#define OCI_STRING_FORMAT_NUM_BDOUBLE OTEXT("%lf") +#define OCI_STRING_FORMAT_NUM_BFLOAT OTEXT("%f") +#define OCI_STRING_FORMAT_NUM_SHORT OTEXT("%hd") +#define OCI_STRING_FORMAT_NUM_INT OTEXT("%d") +#define OCI_STRING_TRUE OTEXT("TRUE") +#define OCI_STRING_FALSE OTEXT("FALSE") +#define OCI_STRING_TRUE_SIZE 4 +#define OCI_STRING_FALSE_SIZE 5 +#define OCI_STRING_NULL_SIZE 4 + +#ifdef _WINDOWS + #define OCI_CHAR_SLASH '\\' +#else + #define OCI_CHAR_SLASH '/' +#endif + +/** + * @defgroup OcilibCApiInitialization Initializing the library + * @{ + * + * To use OCILIB, it first needs to be initialized through a call to OCI_Initialize(). + * + * Then, the application connects to server, executes queries... + * + * Finally, OCILIB resources must be released by OCI_Cleanup() + * + * @note + * + * The following objects are automatically freed by the library: + * - Connections + * - pools + * - Statements + * - Type info objects + * - Thread keys + * + * @warning + * + * All other standalone object instances (mutexes, threads, dates, lobs, ...) ARE NOT freed. + * + */ + +/** + * @brief + * Initialize the library + * + * @param err_handler - Pointer to error handler procedure (optional) + * @param lib_path - Oracle shared library path (optional) + * @param mode - Environment mode + * + * Possible values for parameter mode: + * - OCI_ENV_DEFAULT : default mode + * - OCI_ENV_THREADED : multi-threading support + * - OCI_ENV_CONTEXT : thread contextual error handling + * - OCI_ENV_EVENTS : enables events for subscription, HA Events, AQ notifications + * + * @note + * This function must be called before any OCILIB library function. + * + * @warning + * - The parameter 'libpath' is only used if OCILIB has been built with the option OCI_IMPORT_RUNTIME + * - If the parameter 'lib_path' is NULL, the Oracle library is loaded from system environment variables + * + * @warning + * OCI_Initialize() should be called ONCE per application + * + * @return + * TRUE on success otherwise FALSE. + * Possible reasons for failures: + * - when OCI_ErrorGetType() return OCI_ERR_ORACLE, OCI_ErrorGetOCICode() returns: + * - any ORA-XXXXXX error code. Refer to Oracle documentation + * - when OCI_ErrorGetType() return OCI_ERR_OCILIB, possible error code returned by OCI_ErrorGetInternalCode() + * - OCI_ERR_LOADING_SHARED_LIB : OCILIB could not load oracle shared libraries at runtime (32/64bits mismatch, wrong \p lib_path, missing MSVC runtime required by oci.dll (MS Windows) + * - OCI_ERR_LOADING_SYMBOLS : the loaded shared library does not contain OCI symbols + * - OCI_ERR_NOT_AVAILABLE : OCILIb was built with OCI_CHARSET_WIDE and the oracle shared library dos not supports UTF16 (Oracle 8i) + * - OCI_ERR_CREATE_OCI_ENVIRONMENT: Oracle OCI environment initialization failed (in such cases, it is impossible to get the reason) + * + */ + +OCI_EXPORT boolean OCI_API OCI_Initialize +( + POCI_ERROR err_handler, + const otext *lib_path, + unsigned int mode +); + +/** + * @brief + * Clean up all resources allocated by the library + * + * @note + * * This function must be the last OCILIB library function call. + * - It deallocates objects not explicitly freed by the program (connections, statements, ...) + * - It unloads the Oracle shared library if it has been dynamically loaded + * + * @warning + * OCI_Cleanup() should be called ONCE per application + * + * @return TRUE + */ + +OCI_EXPORT boolean OCI_API OCI_Cleanup +( + void +); + +/** + * @brief + * Return the version of OCI used for compilation + * + * @note + * - with linkage build option, the version is determined from the oci.h header through different ways + * - with runtime loading build option, the version is set to the highest version + * of OCI needed by OCILIB, not necessarily the real OCI version + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetOCICompileVersion +( + void +); + +/** + * @brief + * Return the version of OCI used at runtime + * + * @note + * - with linkage build option, the version is determined from the oci.h header + * through different ways + * - with runtime loading build option, the version determined from the symbols + * dynamically loaded. + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetOCIRuntimeVersion +( + void +); + +/** + * @brief + * Return the Oracle shared library import mode + * + * @note + * Possible values are: + * - OCI_IMPORT_MODE_LINKAGE + * - OCI_IMPORT_MODE_RUNTIME + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetImportMode +( + void +); + +/** + * @brief + * Return the OCILIB charset type + * + * @note + * Possible values are: + * - OCI_CHAR_ANSI + * - OCI_CHAR_WIDE + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetCharset +( + void +); + +/** +* @brief +* Return the current number of bytes allocated internally in the library +* +* @param mem_type : type of memory to request +* +* @note +* Possible values are: +* - OCI_MEM_ORACLE : bytes allocated by Oracle client library +* - OCI_MEM_OCILIB : bytes allocated by OCILIB library +* - OCI_MEM_ORACLE : bytes allocated by all libraries +* +*/ + +OCI_EXPORT big_uint OCI_API OCI_GetAllocatedBytes +( + unsigned int mem_type +); + +/** + * @brief + * Enable or disable Oracle warning notifications + * + * @param value - enable/disable warnings + * + * @note + * Default value is FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_EnableWarnings +( + boolean value +); + +/** + * @brief + * Set the global error user handler + * + * @param handler - Pointer to error handler procedure + * + * @note + * Use this call to change or remove the user callback error handler installed by OCI_Initialize() + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetErrorHandler +( + POCI_ERROR handler +); + +/** + * @brief + * Set the High availability (HA) user handler + * + * @param handler - Pointer to HA handler procedure + * + * @note + * See POCI_HA_HANDLER documentation for more details + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * HA events + * + * @warning + * This call is supported from Oracle 10gR2. + * For previous versions, it returns FALSE without throwing any exception. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetHAHandler +( + POCI_HA_HANDLER handler +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiErrorHandling Error handling + * @{ + * + * OCILIB provides two mechanisms for error handling: + * + * - Global error handling through callbacks. + * - Contextual thread error handling + * + * Exceptions are raised: + * + * - On Oracle OCI API call error + * - On Oracle SQL statement error + * - On Internal OCILIB error (type checking, memory allocations ...) + * - On Oracle warnings (OCI API or SQL) + * + * If an error handler was provided to OCI_Initialize(), when an error occurs, the + * library generates an OCI_Error handle and pass it to the error handler. + * + * In order to use the thread contextual error handling, you must call + * OCI_Initialize() with the flag OCI_ENV_CONTEXT for the mode parameter. When + * activated, error handles are stored per thread and the last error within a + * thread can be retrieved with OCI_GetLastError() + * + * Exception properties are accessible through a set of functions + * + * @note + * The two ways to handle errors are not exclusive and can be mixed. + * + * @note + * Thread contextual error is also available for single thread based applications + * + * @par Oracle Warnings + * + * Oracle warnings are raised through OCI_Error API. + * Such error handles have their error type property (OCI_ErrorGetType()) set to OCI_ERR_WARNING. + * Warning handing is disabled by default. To activate/deactivate it, use OCI_EnableWarnings() + * + * @par Example with callbacks + * @include err.c + * + * @par Example with thread context + * @include err_ctx.c + * + * @par Example of warning handling + * @include err_warning.c + * + */ + +/** + * @brief + * Retrieve the last error or warning occurred within the last OCILIB call + * + * @note + * OCI_GetLastError() is based on thread context and thus OCILIB must be + * initialized with the flag OCI_ENV_CONTEXT + * + * @warning + * OCILIB functions that returns a boolean value to indicate their success : + * - return TRUE if no error occurred OR if a warning occurred + * - return FALSE if an error occurred + * + */ + +OCI_EXPORT OCI_Error * OCI_API OCI_GetLastError +( + void +); + +/** + * @brief + * Retrieve error message from error handle + * + * @param err - Error handle + * + */ + +OCI_EXPORT const otext * OCI_API OCI_ErrorGetString +( + OCI_Error *err +); + +/** + * @brief + * Retrieve the type of error from error handle + * + * @param err - Error handle + * + * @note + * Returns one of the following values: + * + * - OCI_ERR_ORACLE + * - OCI_ERR_OCILIB + * - OCI_ERR_WARNING + * + * @return + * Object type or OCI_UNKNOWN the input handle is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_ErrorGetType +( + OCI_Error *err +); + +/** + * @brief + * Retrieve Oracle Error code from error handle + * + * @param err - Error handle + * + */ + +OCI_EXPORT int OCI_API OCI_ErrorGetOCICode +( + OCI_Error *err +); + +/** + * @brief + * Retrieve Internal Error code from error handle + * + * @param err - Error handle + * + */ + +OCI_EXPORT int OCI_API OCI_ErrorGetInternalCode +( + OCI_Error *err +); + +/** + * @brief + * Retrieve connection handle within the error occurred + * + * @param err - Error handle + * + */ + +OCI_EXPORT OCI_Connection * OCI_API OCI_ErrorGetConnection +( + OCI_Error *err +); + +/** + * @brief + * Retrieve statement handle within the error occurred + * + * @param err - Error handle + * + * @note + * If the error occurred outside of a statement context, it returns NULL + * + */ + +OCI_EXPORT OCI_Statement * OCI_API OCI_ErrorGetStatement +( + OCI_Error *err +); + +/** + * @brief + * Return the row index which caused an error during statement execution + * + * @param err - Error handle + * + * @warning + * Row index start at 1. + * + * @return + * 0 is the error is not related to array DML otherwise the index of the given + * row which caused the error + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_ErrorGetRow +( + OCI_Error *err +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiConnections Connecting to Database + * @{ + * + * Connecting to a database server is done with one call to OCI_ConnectionCreate(). + * + * OCI_ConnectionFree() closes the established connection. + * + * Connection properties are accessible through a set of functions + * + * @par Example + * @include conn.c + * + */ + +/** + * @brief + * Create a physical connection to an Oracle database server + * + * @param db - Oracle Service Name + * @param user - Oracle User name + * @param pwd - Oracle User password + * @param mode - Session mode + * + * Possible values for parameter mode : + * - OCI_SESSION_DEFAULT + * - OCI_SESSION_SYSDBA + * - OCI_SESSION_SYSOPER + * - OCI_SESSION_XA + * + * @note + * External credentials are supported by supplying a null value for the + * 'user' and 'pwd' parameters. + * If the param 'db' is NULL then a connection to the default local DB is done + * + * @note + * For parameter 'mode', the possible values are exclusive and cannot be combined + * + * @par Oracle XA support + * + * OCILIB supports Oracle XA connectivity. In order to get a connection using + * the XA interface : + * - For parameter 'db' : pass the value of the 'DB' parameter of the given + * XA connection string passed to the Transaction Processing Monitor (TPM) + * - Pass NULL to the 'user' and 'pwd' parameters + * - Pass the value OCI_SESSION_XA to parameter 'mode' + * + * @par Oracle XA Connection String + * + * The XA connection string used in a transaction monitor to connect to Oracle must + * be compatible with OCILIB : + * + * - the XA parameter 'Objects' MUST be set to 'true' + * - If OCI_ENV_THREADED is passed to OCI_Initialize(), the XA parameter 'Threads' must + * be set to 'true', otherwise to 'false' + * - If OCI_ENV_EVENTS is passed to OCI_Initialize(), the XA parameter 'Events' must + * be set to 'true', otherwise to 'false' + * - As Oracle does not support Unicode UTF16 character set through the XA interface, + * Only OCI_CHARSET_ANSI builds of OCILIB can be used + * - You still can use UTF8 if the NLS_LANG environment variable is set with a valid + * UTF8 NLS value + * - DO NOT USE OCI_CHARSET_WIDE OCILIB builds with XA connections + * + * @note + * On success, a local transaction is automatically created and started ONLY for regular + * standalone connections and connections retrieved from connection pools. + * No transaction is created for a XA connection or q connection retrieved from session pools. + * + * @return + * Connection handle on success or NULL on failure + * + */ + +OCI_EXPORT OCI_Connection * OCI_API OCI_ConnectionCreate +( + const otext *db, + const otext *user, + const otext *pwd, + unsigned int mode +); + +/** + * @brief + * Close a physical connection to an Oracle database server + * + * @param con - Connection handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ConnectionFree +( + OCI_Connection *con +); + +/** + * @brief + * Returns TRUE is the given connection is still connected otherwise FALSE + * + * @param con - Connection handle + * + */ + +OCI_EXPORT boolean OCI_API OCI_IsConnected +( + OCI_Connection *con +); + +/** + * @brief + * Return the pointer to user data previously associated with the connection + * + * @param con - Connection handle + * + * @note + * Value NULL for parameter \p con is a valid value. + * It returns then previously stored data with global scope (program wide) + * + */ + +OCI_EXPORT void * OCI_API OCI_GetUserData +( + OCI_Connection *con +); + +/** + * @brief + * Associate a pointer to user data to the given connection + * + * @param con - Connection handle + * @param data - User data pointer + * + * @note + * Value NULL for parameter \p con is a valid value. + * It allows users to associate a pointer to user data with global scope (program wide) + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetUserData +( + OCI_Connection *con, + void *data +); + +/** + * @brief + * Associate a tag to the given connection/session + * + * @param con - Connection handle + * @param tag - user tag string + * + * @note + * Use this call only for connections retrieved from a session pool + * See OCI_PoolGetConnection() for more details + * + * @note + * To untag a session, call OCI_SetSessionTag() with 'tag' parameter set to NULL + * + * @warning + * No error is raised if the connection is a standalone connection or retrieved from a connection + * pool + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetSessionTag +( + OCI_Connection *con, + const otext *tag +); + +/** + * @brief + * Return the tag associated the given connection + * + * @param con - Connection handle + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetSessionTag +( + OCI_Connection *con +); + +/** + * @brief + * Return the name of the connected database/service name + * + * @param con - Connection handle + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetDatabase +( + OCI_Connection *con +); + +/** + * @brief + * Return the current logged user name + * + * @param con - Connection handle + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetUserName +( + OCI_Connection *con +); + +/** + * @brief + * Return the current logged user password + * + * @param con - Connection handle + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetPassword +( + OCI_Connection *con +); + +/** + * @brief + * Change the password of the logged user + * + * @param con - Connection handle + * @param password - New password + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetPassword +( + OCI_Connection *con, + const otext *password +); + +/** + * @brief + * Change the password of the given user on the given database + * + * @param db - Oracle Service Name + * @param user - Oracle User name + * @param pwd - Oracle User password + * @param new_pwd - Oracle User New password + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetUserPassword +( + const otext *db, + const otext *user, + const otext *pwd, + const otext *new_pwd +); + +/** + * @brief + * Return the current session mode + * + * @param con - Connection handle + * + * @note + * See OCI_ConnectionCreate() for possible values + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetSessionMode +( + OCI_Connection *con +); + +/** + * @brief + * Return the connected database server version + * + * @param con - Connection handle + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetVersionServer +( + OCI_Connection *con +); + +/** + * @brief + * Return the major version number of the connected database server + * + * @param con - Connection handle + * + * @return + * Version number or 0 on failure + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetServerMajorVersion +( + OCI_Connection *con +); + +/** + * @brief + * Return the minor version number of the connected database server + * + * @param con - Connection handle + * + * @return + * Version number or 0 on failure + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetServerMinorVersion +( + OCI_Connection *con +); + +/** + * @brief + * Return the revision version number of the connected database server + * + * @param con - Connection handle + * + * @return + * Version number or 0 on failure + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetServerRevisionVersion +( + OCI_Connection *con +); + +/** + * @brief + * Set the format string for implicit string conversions of the given type + * + * @param con - Connection handle (optional) + * @param type - Type of format + * @param format - Format string + * + * Formats can set at 2 levels: + * - Library level: by passing a NULL Connection handle + * - Connection level: by passing a valid Connection handle + * + * When the library needs to perform a string conversion, it search for a valid format using the + * following order: + * - Connection format + * - Library format + * - Default format + * + * @note + * Possible values of parameter 'type' : + * + * - OCI_FMT_DATE : format used to convert DATE to string + * - OCI_FMT_TIMESTAMP : format used to convert TIMESTAMP and TIMESTAMP WITH LOCAL TIMEZONE to string + * - OCI_FMT_TIMESTAMP_TZ : format used to convert TIMESTAMP WITH TIME ZONE to string + * - OCI_FMT_NUMERIC : format used to convert numeric types to string + * - OCI_FMT_BINARY_DOUBLE : format used to convert BINARY_DOUBLE to string + * - OCI_FMT_BINARY FLOAT : format used to convert BINARY_FLOAT to string + * + * @note + * Default format values are : + * - OCI_FMT_DATE : constant OCI_STRING_FORMAT_DATE + * - OCI_FMT_TIMESTAMP : constant OCI_STRING_FORMAT_TIMESTAMP + * - OCI_FMT_TIMESTAMP_TZ : constant OCI_STRING_FORMAT_TIMESTAMP_TZ + * - OCI_FMT_NUMERIC : constant OCI_STRING_FORMAT_NUMERIC + * - OCI_FMT_BINARY_DOUBLE : constant OCI_STRING_FORMAT_BINARY_DOUBLE + * - OCI_FMT_BINARY FLOAT : constant OCI_STRING_FORMAT_BINARY_FLOAT + * + * @note + * Conversions are performed by Oracle built-in functions whenever possible. + * For DATE, TIMESTAMP and numeric types, see documentation of Oracle SQL to_char() function for more details + * For BINARY_DOUBLE and BINARY_FLOAT, refer to the C Standard Library printf() family documentation + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetFormat +( + OCI_Connection *con, + unsigned int type, + const otext *format +); + +/** + * @brief + * Return the format string for implicit string conversions of the given type + * + * @param con - Connection handle + * @param type - Type of format + * + * @note + * See OCI_SetFormat() for possible values + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetFormat +( + OCI_Connection *con, + unsigned int type +); + +/** + * @brief + * Return the current transaction of the connection + * + * @param con - Connection handle + * + * @note + * From v3.9.4, no more default transaction object is created for a new connection + * + */ + +OCI_EXPORT OCI_Transaction * OCI_API OCI_GetTransaction +( + OCI_Connection *con +); + +/** + * @brief + * Set a transaction to a connection + * + * @param con - Connection handle + * @param trans - Transaction handle to assign + * + * @note + * The current transaction (if any) is automatically stopped but the newly assigned is not + * started or resumed + * + * @warning + * Do not set transaction object to XA connection or connection retrieved from a session pool + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetTransaction +( + OCI_Connection *con, + OCI_Transaction *trans +); + +/** + * @brief + * Return the highest Oracle version is supported by the connection + * + * @param con - connection handle + * + * @note + * The highest supported version is the lower version between client and server: + * + * @note + * Returns one of the following values: + * + * - OCI_UNKNOWN + * - OCI_8_0 + * - OCI_8_1 + * - OCI_9_0 + * - OCI_9_2 + * - OCI_10_1 + * - OCI_10_2 + * - OCI_11_1 + * - OCI_11_2 + * - OCI_12_1 + * - OCI_18_3 + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetVersionConnection +( + OCI_Connection *con +); + +/** + * @brief + * Set tracing information to the session of the given connection + * + * @param con - connection handle + * @param trace - trace type + * @param value - trace content + * + * Store current trace information to the given connection handle. + * These information: + * + * - is stored in system view V$SESSION and/or V$SQL_MONITOR + * - can be retrieved from the connection property of an OCI_Error handle + * + * @note + * Possible values of parameter 'trace' : + * + * - OCI_TRC_IDENTITY : Specifies the user defined identifier in the session. + * It's recorded in the column CLIENT_IDENTIFIER of the + * system view V$SESSION + * - OCI_TRC_MODULE : name of the current module in the client application. + * It's recorded in the column MODULE of the + * system view V$SESSION + * - OCI_TRC_ACTION : name of the current action within the current module. + * It's recorded in the column ACTION of the + * system view V$SESSION + * - OCI_TRC_DETAIL : Client application additional information. + * It's recorded in the column CLIENT_INFO of the + * system view V$SESSION + * - OCI_TRC_OPERATION: Client application database operation. + * It's recorded in the column DBOP_NAME of the + * system view V$SQL_MONITOR + * @warning + * The system view V$SESSION is updated on Oracle versions >= 10gR1 + * The system view V$SQL_MONITOR is updated on Oracle versions >= 12cR1 + * + * @warning + * Oracle limits the size of these traces content: + * + * - OCI_TRC_IDENTITY : 64 bytes + * - OCI_TRC_MODULE : 48 bytes + * - OCI_TRC_ACTION : 32 bytes + * - OCI_TRC_DETAIL : 64 bytes + * - OCI_TRC_OPERATION: 32 bytes + * + * OCILIB truncates input values to match theses limits + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetTrace +( + OCI_Connection *con, + unsigned int trace, + const otext *value +); + +/** + * @brief + * Get the current trace for the trace type from the given connection. + * + * @param con - connection handle + * @param trace - trace type + * + * @note + * See OCI_SetTrace() for more details. + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetTrace +( + OCI_Connection *con, + unsigned int trace +); + +/** + * @brief + * Makes a round trip call to the server to confirm that the connection and the server are active. + * + * @param con - Connection handle + * + * @note + * Returns TRUE is the connection is still alive otherwise FALSE + * + * @warning + * This call is supported from Oracle 10g. + * For previous versions, it returns FALSE without throwing any exception. + * + */ + +OCI_EXPORT boolean OCI_API OCI_Ping +( + OCI_Connection *con +); + +/** + * @brief + * Set a given timeout for OCI calls that require server round-trips to the given database + * + * @param con - Connection handle + * @param type - Type of timeout to set + * @param value - Timeout in milliseconds + * + * Possible values for parameter 'type': + * - OCI_NTO_SEND + * - Time to wait for send operations completion to the database server + * - Requires Oracle 12cR1 client + * - OCI_NTO_RECEIVE + * - Time to wait for read operations completion from the database server + * - Requires Oracle 12cR1 client + * - OCI_NTO_CALL + * - Time to wait for a database round-trip to complete ( Client processing is not taken into account) + * - Requires Oracle 18c client + * + * OCI client raises an timeout type related error when a given timeout is reached. + * + * @note + * To disable a given timeout, pass the value 0 + * + * @warning + * OCI client is using the following precedence rules when applying timeouts: + * - 1 - Timeout set using OCI_NTO_CALL (all other timeouts are discarded) + * - 2 - Timeouts set using OCI_NTO_SEND and/or OCI_NTO_RECEIVE + * - 3 - Timeouts set in sqlnet.ora file + * + * Here is a summary: + * + * FLAG | Min. Version | OCI Error raised | OCI Error description | sqlnet.ora equivalent | + * --------------- | ------------ | ---------------- | ------------------------------ | --------------------- | + * OCI_NTO_SEND | OCI_12_1 | ORA-12608 | TNS: Send timeout occurred | SQLNET.SEND_TIMEOUT | + * OCI_NTO_RECEIVE | OCI_12_1 | ORA-12609 | TNS: Receive timeout occurred | SQLNET.RECV_TIMEOUT | + * OCI_NTO_CALL | OCI_18_1 | ORA-03136 | inbound connection timed out | --- | + * + * @warning + * Returns FALSE without throwing any exception if the Oracle client does not support the given flag + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetTimeout +( + OCI_Connection *con, + unsigned int type, + unsigned int value +); + +/** + * @brief + * Returns the requested timeout value for OCI calls that require server round-trips to the given database + * + * @param con - Connection handle + * @param type - Type of timeout + * + * @note: + * See OCI_SetTimeout() for more information + * + * @return + * The given timeout value if supported, otherwise 0 + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetTimeout +( + OCI_Connection *con, + unsigned int type +); + +/** + * @brief + * Return the Oracle server database name of the connected database/service name + * + * @param con - Connection handle + * + * @warning + * This call is supported from Oracle 10gR2. + * For previous versions, it returns NULL without throwing any exception. + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetDBName +( + OCI_Connection *con +); + +/** + * @brief + * Return the Oracle server Instance name of the connected database/service name + * + * @param con - Connection handle + * + * @warning + * This call is supported from Oracle 10gR2. + * For previous versions, it returns NULL without throwing any exception. + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetInstanceName +( + OCI_Connection *con +); + + +/** + * @brief + * Return the Oracle server service name of the connected database/service name + * + * @param con - Connection handle + * + * @warning + * This call is supported from Oracle 10gR2. + * For previous versions, it returns NULL without throwing any exception. + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetServiceName +( + OCI_Connection *con +); + + +/** + * @brief + * Return the Oracle server machine name of the connected database/service name + * + * @param con - Connection handle + * + * @warning + * This call is supported from Oracle 10gR2. + * For previous versions, it returns NULL without throwing any exception. + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetServerName +( + OCI_Connection *con +); + + +/** + * @brief + * Return the Oracle server domain name of the connected database/service name + * + * @param con - Connection handle + * + * @warning + * This call is supported from Oracle 10gR2. + * For previous versions, it returns NULL without throwing any exception. + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetDomainName +( + OCI_Connection *con +); + + +/** + * @brief + * Return the date and time (Timestamp) server instance start of the + * connected database/service name + * + * @param con - Connection handle + * + * @warning + * This call is supported from Oracle 10gR2. + * For previous versions, it returns NULL without throwing any exception. + * + */ + +OCI_EXPORT OCI_Timestamp * OCI_API OCI_GetInstanceStartTime +( + OCI_Connection *con +); + +/** + * @brief + * Verify if the given connection support TAF events + * + * @param con - Connection handle + * + * @note + * Returns TRUE is the connection supports TAF event otherwise FALSE + * + * @warning + * This call is supported from Oracle 10gR2. + * For previous versions, it returns FALSE without throwing any exception. + * + */ + +OCI_EXPORT boolean OCI_API OCI_IsTAFCapable +( + OCI_Connection *con +); + +/** + * @brief + * Set the Transparent Application Failover (TAF) user handler + * + * @param con - Connection handle + * @param handler - Pointer to TAF handler procedure + * + * @note + * See POCI_TAF_HANDLER documentation for more details + * +* @warning + * This call is supported from Oracle 10gR2. + * For previous versions, it returns FALSE without throwing any exception. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetTAFHandler +( + OCI_Connection *con, + POCI_TAF_HANDLER handler +); + +/** + * @brief + * Return the maximum number of statements to keep in the statement cache + * + * @param con - Connection handle + * + * @note + * Default value is 20 (value from Oracle Documentation) + * + * @warning + * Requires Oracle Client 9.2 or above + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetStatementCacheSize +( + OCI_Connection *con +); + +/** + * @brief + * Set the maximum number of statements to keep in the statement cache + * + * @param con - Connection handle + * @param value - maximum number of statements in the cache + * + * @warning + * Requires Oracle Client 9.2 or above + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetStatementCacheSize +( + OCI_Connection *con, + unsigned int value +); + +/** + * @brief + * Return the default LOB prefetch buffer size for the connection + * + * @param con - Connection handle + * + * @warning + * Requires Oracle Client AND Server 11gR1 or above + * + * @note + * Prefetch size is: + * - number of bytes for BLOBs and BFILEs + * - number of characters for CLOBs. + * + * @note + * Default is 0 (prefetching disabled) + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetDefaultLobPrefetchSize +( + OCI_Connection *con +); + +/** + * @brief + * Enable or disable prefetching for all LOBs fetched in the connection + * + * @param con - Connection handle + * @param value - default prefetch buffer size + * + * @note + * If parameter 'value': + * - is == 0, it disables prefetching for all LOBs fetched in the connection. + * - is > 0, it enables prefetching for all LOBs fetched in the connection + * and the given buffer size is used for prefetching LOBs + * + * @note + * LOBs prefetching is disabled by default + * + * @warning + * Requires Oracle Client AND Server 11gR1 or above. + * + * @note + * Prefetch size is: + * - number of bytes for BLOBs and BFILEs + * - number of characters for CLOBs. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetDefaultLobPrefetchSize +( + OCI_Connection *con, + unsigned int value +); + + +/** +* @brief +* Return the maximum number of SQL statements that can be opened in one session +* +* @param con - Connection handle +* +* @warning +* Requires Oracle Client AND Server 12cR1 or above +* +* @note +* the returned value is the same as the db parameter 'open_cursors' from server's parameter file +* +* @note +* Return 0 if the client and server version are < 12cR1 +* +*/ + +OCI_EXPORT unsigned int OCI_API OCI_GetMaxCursors +( + OCI_Connection *con +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiPools Oracle Pools + * @{ + * + * OCILIB support the connections and sessions pooling features introduced + * in Oracle 9i. + * + * Let's Oracle talk about this features ! + * + * @par Connection pools (from Oracle Call Interface Programmer's Guide) + * + * Connection pooling is the use of a group (the pool) of reusable physical connections + * by several sessions, in order to balance loads. The management of the pool is done + * by OCI, not the application. Applications that can use connection pooling include + * middle-tier applications for Web application servers and e-mail servers. + * + * @par Session Pools (from Oracle Call Interface Programmer's Guide) + * + * Session pooling means that the application will create and maintain a group of stateless + * sessions to the database. These sessions will be handed over to thin clients as requested. + * If no sessions are available, a new one may be created. When the client is done with + * the session, the client will release it to the pool. Thus, the number of sessions in + * the pool can increase dynamically. + * + * @note + * OCILIB implements homogeneous session pools only. + * + * @par When using Pools (from Oracle Call Interface Programmer's Guide) + * + * If database sessions are not reusable by mid-tier threads (that is, they are stateful) + * and the number of back-end server processes may cause scaling problems on the database, + * use OCI connection pooling. + * + * If database sessions are reusable by mid-tier threads (that is, they are stateless) + * and the number of back-end server processes may cause scaling problems on the database, + * use OCI session pooling. + * + * If database sessions are not reusable by mid-tier threads (that is, they are stateful) + * and the number of back-end server processes will never be large enough to potentially + * cause any scaling issue on the database, there is no need to use any pooling mechanism. + * + * @par Example + * @include pool.c + * + */ + +/** + * @brief + * Create an Oracle pool of connections or sessions + * + * @param db - Oracle Service Name + * @param user - Oracle User name + * @param pwd - Oracle User password + * @param type - Type of pool + * @param mode - Session mode + * @param min_con - minimum number of connections/sessions that can be opened. + * @param max_con - maximum number of connections/sessions that can be opened. + * @param incr_con - next increment for connections/sessions to be opened + * + * Possible values for parameter 'type': + * - OCI_POOL_CONNECTION + * - OCI_POOL_SESSION + * + * Possible values for parameter 'mode': + * - OCI_SESSION_DEFAULT + * - OCI_SESSION_SYSDBA (session pools only) + * + * @note + * External credentials are supported by supplying a null value for the 'user' + * and 'pwd' parameters + * If the param 'db' is NULL then a connection to the default local DB is done + * + * @return + * Connection or session pool handle on success or NULL on failure + * + */ + +OCI_EXPORT OCI_Pool * OCI_API OCI_PoolCreate +( + const otext *db, + const otext *user, + const otext *pwd, + unsigned int type, + unsigned int mode, + unsigned int min_con, + unsigned int max_con, + unsigned int incr_con +); + +/** + * @brief + * Destroy a pool object + * + * @param pool - Pool handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_PoolFree +( + OCI_Pool *pool +); + +/** + * @brief + * Get a connection from the pool + * + * @param pool - Pool handle + * @param tag - user tag string + * + * @par Session tagging + * + * Session pools have a nice feature that is 'session tagging' + * It's possible to tag a session with a string identifier + * when the session is returned to the pool, it keeps its tags. + * When requesting a connection from the session pool, it's + * possible to request a session that has the given 'tag' parameter + * If one exists, it is returned. If not and if an untagged session + * is available, it is then returned. So check the connection tag + * property with OCI_GetSessionTag() to find out if the returned + * connection is tagged or not. + * + * This features is described in the OCI developer guide as the following : + * + * "The tags provide a way for users to customize sessions in the pool. + * A client may get a default or untagged session from a pool, set certain + * attributes on the session (such as NLS settings), and return the session + * to the pool, labeling it with an appropriate tag. + * The user may request a session with the same tags in order to have a + * session with the same attributes" + * + * @return + * Connection handle otherwise NULL on failure + */ + +OCI_EXPORT OCI_Connection * OCI_API OCI_PoolGetConnection +( + OCI_Pool *pool, + const otext *tag +); + +/** + * @brief + * Get the idle timeout for connections/sessions in the pool + * + * @param pool - Pool handle + * + * @note + * Connections/sessions idle for more than this time value (in seconds) is terminated + * + * @note + * Timeout is not available for internal pooling implementation (client < 9i) + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_PoolGetTimeout +( + OCI_Pool *pool +); + +/** + * @brief + * Set the connections/sessions idle timeout + * + * @param pool - Pool handle + * @param value - Timeout value + * + * @note + * connections/sessions idle for more than this time value (in seconds) is terminated + * + * @note + * This call has no effect if pooling is internally implemented (client < 9i) + * + */ + +OCI_EXPORT boolean OCI_API OCI_PoolSetTimeout +( + OCI_Pool *pool, + unsigned int value +); + +/** + * @brief + * Get the waiting mode used when no more connections/sessions are available + * from the pool + * + * @param pool - Pool handle + * + * @return + * - FALSE to wait for an available object if the pool is saturated + * - TRUE to not wait for an available object + * + */ + +OCI_EXPORT boolean OCI_API OCI_PoolGetNoWait +( + OCI_Pool *pool +); + +/** + * @brief + * Set the waiting mode used when no more connections/sessions are available + * from the pool + * + * @param pool - Pool handle + * @param value - wait for object + * + * @note + * Pass : + * - FALSE to wait for an available object if the pool is saturated + * - TRUE to not wait for an available object + * + */ + +OCI_EXPORT boolean OCI_API OCI_PoolSetNoWait +( + OCI_Pool *pool, + boolean value +); + +/** + * @brief + * Return the current number of busy connections/sessions + * + * @param pool - Pool handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_PoolGetBusyCount +( + OCI_Pool *pool +); + +/** + * @brief + * Return the current number of opened connections/sessions + * + * @param pool - Pool handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_PoolGetOpenedCount +( + OCI_Pool *pool +); + +/** + * @brief + * Return the minimum number of connections/sessions that can be opened to the database + * + * @param pool - Pool handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_PoolGetMin +( + OCI_Pool *pool +); + +/** + * @brief + * Return the maximum number of connections/sessions that can be opened to the database + * + * @param pool - Pool handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_PoolGetMax +( + OCI_Pool *pool +); + +/** + * @brief + * Return the increment for connections/sessions to be opened to the database when the pool is + * not full + * + * @param pool - Pool handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_PoolGetIncrement +( + OCI_Pool *pool +); + +/** + * @brief + * Return the maximum number of statements to keep in the pool statement cache + * + * @param pool - Pool handle + * + * @note + * Default value is 20 (value from Oracle Documentation) + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_PoolGetStatementCacheSize +( + OCI_Pool *pool +); + +/** + * @brief + * Set the maximum number of statements to keep in the pool statement cache + * + * @param pool - Pool handle + * @param value - maximum number of statements in the cache + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_PoolSetStatementCacheSize +( + OCI_Pool *pool, + unsigned int value +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiTransactions Managing transactions + * @{ + * + * OCILIB supports local and global transactions. + * + * Local transactions are implicit within connection objects and there is no + * specific call or programming step for using it. + * + * In order to control changes made in the database: + * + * - OCI_Commit() validates current pending modifications + * - OCI_Rollback() discards current pending modifications + * + * OCILIB supports a feature called 'Auto Commit' that performs an implicit and + * automatic commit call after every execute call + * + * @note + * Those actions are executed within a connection context and not directly to a transaction. + * + * @warning + * Global transactions are optional and are designed for distributed or global + * transaction environments. + * + * OCILIB supports them by : + * + * - Creating/Destroying explicitly a transaction object + * - Starting/Stopping/Resuming explicitly the transaction + * - Preparing the transaction for specific calls + * + */ + +/** + * @brief + * Commit current pending changes + * + * @param con - Connection handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_Commit +( + OCI_Connection *con +); + +/** + * @brief + * Cancel current pending changes + * + * @param con - Connection handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_Rollback +( + OCI_Connection *con +); + +/** + * @brief + * Enable / disable auto commit mode + * + * The auto commit mode allows commit changes after every executed SQL order + * + * @param con - Connection handle + * @param enable - Enable (TRUE) or disable (FALSE) + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetAutoCommit +( + OCI_Connection *con, + boolean enable +); + +/** + * @brief + * Get current auto commit mode status + * + * @param con - Connection handle + * + * @return + * TRUE if auto commit mode is activated otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_GetAutoCommit +( + OCI_Connection *con +); + +/** + * @brief + * Create a new global transaction or a serializable/read-only local transaction + * + * @param con - Connection handle + * @param timeout - Time that a transaction stays inactive after being stopped + * @param mode - Transaction mode + * @param pxid - pointer to a global transaction identifier structure + * + * + * @note + * The parameter 'mode' can be one of the following values : + * + * - Global transactions: + * - OCI_TRS_NEW : By default starts a new, tightly coupled and + * migratable branch. + * - OCI_TRS_TIGHT : explicitly specifies a tightly coupled branch + * - OCI_TRS_LOOSE : specifies a loosely coupled branch + * + * - Global and local transactions : + * - OCI_TRS_READONLY - start a read-only transaction + * - OCI_TRS_READWRITE - start a read-write transaction + * - OCI_TRS_SERIALIZABLE : start a serializable transaction + * + * @note + * For local transaction: + * - pass a NULL value for pxid + * + */ + +OCI_EXPORT OCI_Transaction * OCI_API OCI_TransactionCreate +( + OCI_Connection *con, + unsigned int timeout, + unsigned int mode, + OCI_XID *pxid +); + +/** + * @brief + * Free current transaction + * + * @param trans - Connection handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TransactionFree +( + OCI_Transaction *trans +); + +/** + * @brief + * Start global transaction + * + * @param trans - Connection handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TransactionStart +( + OCI_Transaction *trans +); + +/** + * @brief + * Stop current global transaction + * + * @param trans - Connection handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TransactionStop +( + OCI_Transaction *trans +); + +/** + * @brief + * Resume a stopped global transaction + * + * @param trans - Global transaction handle + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_TransactionResume +( + OCI_Transaction *trans +); + +/** + * @brief + * Prepare a global transaction validation + * + * @param trans - Global transaction handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TransactionPrepare +( + OCI_Transaction *trans +); + +/** + * @brief + * Cancel the prepared global transaction validation + * + * @param trans - Global transaction handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TransactionForget +( + OCI_Transaction *trans +); + +/** + * @brief + * Return global transaction mode. + * + * @note: + * see OCI_TransactionCreate() for possible values + * + * @param trans - Global transaction handle + * + * @return + * Transaction mode or OCI_UNKNOW if trans is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_TransactionGetMode +( + OCI_Transaction *trans +); + +/** + * @brief + * Return global transaction Timeout + * + * @param trans - Global transaction handle + * + * @return + * Transaction timeout or 0 if trans is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_TransactionGetTimeout +( + OCI_Transaction *trans +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiStatements Executing statements + * @{ + * + * Executing SQL statements or PL/SQL blocks is really simple with OCILIB. + * + * First, call OCI_StatementCreate() to allocate a statement handle. Then : + * + * - Prepare the SQL with OCI_Prepare() + * - Parse and execute it with OCI_Execute() + * + * These two steps can be done together by calling OCI_ExecuteStmt() that + * prepares and executes in one go. + * + * To find out if the statement has affected any rows, call OCI_GetAffectedRows() + * + * Finally, release the statement and its resources with OCI_StatementFree() + * + * @note + * A statement can be prepared once and executed as many times as needed (see + * Binding variables section) + * + * @note + * An OCI_Statement can be used to prepare and/or execute different SQL and PL/SQL + * statements as many times as needed. + * For example, if the SQL processing of an application is sequential, only + * one statement handle is required + * + * @note + * OCILIB supports nested levels of SQL statement processing. + * An application can loop through the resultset of the statement handle A, + * executing statement B and fetching statement C at every loop, and so on ... + * + * @par Example + * @include exec.c + * + */ + +/** + * @brief + * Create a statement object and return its handle + * + * @param con - Connection handle + * + * @return + * A statement handle on success otherwise NULL + * + */ + +OCI_EXPORT OCI_Statement * OCI_API OCI_StatementCreate +( + OCI_Connection *con +); + +/** + * @brief + * Free a statement and all resources associated to it (resultsets ...) + * + * @param stmt - Connection handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_StatementFree +( + OCI_Statement *stmt +); + +/** + * @brief + * Prepare a SQL statement or PL/SQL block. + * + * @param stmt - Statement handle + * @param sql - SQL order or PL/SQL block + * + * @note + * Do not call this function for fetched statements (REF cursors) + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_Prepare +( + OCI_Statement *stmt, + const otext *sql +); + +/** + * @brief + * Execute a prepared SQL statement or PL/SQL block. + * + * @param stmt - Statement handle + * + * @return + * TRUE on success otherwise FALSE + * + * @warning + * If a SQL warning occurs: + * - the function returns TRUE + * - the SQL warning triggers the global error handler with an OCI_Error having its OCI_ErrorGetType() + * attribute set to OCI_ERR_WARNING + * - If OCILIB is initialized with the OCI_ENV_CONTEXT mode, OCI_GetLastError() will return the OCI_Error + * object corresponding to the warning + * + */ + +OCI_EXPORT boolean OCI_API OCI_Execute +( + OCI_Statement *stmt +); + +/** + * @brief + * Prepare and Execute a SQL statement or PL/SQL block. + * + * @param stmt - Statement handle + * @param sql - SQL order - PL/SQL block + * + * @return + * TRUE on success otherwise FALSE + * + * @warning + * If a SQL warning occurs: + * - the function returns TRUE + * - the SQL warning triggers the global error handler with an OCI_Error having its OCI_ErrorGetType() + * attribute set to OCI_ERR_WARNING + * - If OCILIB is initialized with the OCI_ENV_CONTEXT mode, OCI_GetLastError() will return the OCI_Error + * object corresponding to the warning + * + */ + +OCI_EXPORT boolean OCI_API OCI_ExecuteStmt +( + OCI_Statement *stmt, + const otext *sql +); + +/** + * @brief + * Parse a SQL statement or PL/SQL block. + * + * @param stmt - Statement handle + * @param sql - SQL order - PL/SQL block + * + * @note + * This call sends the SQL or PL/SQL command to the server for parsing only. + * The command is not executed. + * This call is only useful to check is a command is valid or not. + * + * @note + * This call prepares the statement (internal call to OCI_Prepare()) and ask + * the Oracle server to parse its SQL or PL/SQL command. + * OCI_Execute() can be call after OCI_Parse() in order to execute the + * statement, which means that the server will re-parse again the command. + * + * @warning + * Do not use OCI_Parse() unless you're only interested in the parsing result + * because the statement will be parsed again when executed and thus leading to + * unnecessary server round-trips and less performance + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_Parse +( + OCI_Statement *stmt, + const otext *sql +); + +/** + * @brief + * Describe the select list of a SQL select statement. + * + * @param stmt - Statement handle + * @param sql - SELECT sql statement + * + * @note + * This call sends the SELECT SQL order to the server for retrieving the + * description of the select order only. + * The command is not executed. + * This call is only useful to retrieve information on the associated resultset + * Call OCI_GetResultet() after OCI_Describe() to access to SELECT list + * information + * + * @note + * This call prepares the statement (internal call to OCI_Prepare()) and ask + * the Oracle server to describe the output SELECT list. + * OCI_Execute() can be called after OCI_Describe() in order to execute the + * statement, which means that the server will parse, and describe again the SQL + * order. + * + * @warning + * Do not use OCI_Describe() unless you're only interested in the resultset + * information because the statement will be parsed again when executed and thus + * leading to unnecessary server round-trips and less performance + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_Describe +( + OCI_Statement *stmt, + const otext *sql +); + +/** + * @brief + * Return the last SQL or PL/SQL statement prepared or executed by the statement + * + * @param stmt - Statement handle + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetSql +( + OCI_Statement *stmt +); + +/** +* @brief +* Returns the statement SQL_ID from the server +* +* @param stmt - Statement handle +* +* @note +* The statement must be executed first +* +* @warning +* Requires Oracle 12cR2 (both client and server side), otherwise it returns NULL +* +*/ + +OCI_EXPORT const otext* OCI_API OCI_GetSqlIdentifier +( + OCI_Statement *stmt +); + +/** + * @brief + * Return the error position (in terms of characters) in the SQL statement + * where the error occurred in case of SQL parsing error + * + * @param stmt - Statement handle + * + * @note + * Positions start at 1. + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetSqlErrorPos +( + OCI_Statement *stmt +); + +/** + * @brief + * Return the number of rows affected by the SQL statement + * + * @param stmt - Statement handle + * + * The returned value is : + * - For UPDATEs : number of rows updated + * - For INSERTs : number of rows inserted + * - For DELETEs : number of rows deleted + * + * @note + * For SELECTs statements, use OCI_GetRowCount() instead + * + * @note + * For PL/SQL blocks performing "select into :": + * - it returns the number of rows selected from PL/SQL + * - Up to version 4.3.0, OCI_Execute() returned FALSE and generated an error ORA-01403 - "No Data Found" + * - From version 4.3.1, OCI_Execute() returns 0 if no data found, otherwise the number of selected rows + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetAffectedRows +( + OCI_Statement *stmt +); + +/** + * @brief + * Return the Oracle SQL code the command held by the statement handle + * + * @param stmt - Statement handle + * + * @warning + * OCI_GetSQLCommand() must be called after the statement has be executed + * because that's the server engine that computes the SQL command code + * + * @return + * The SQL command code of the statement otherwise OCI_UNKOWN + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetSQLCommand +( + OCI_Statement *stmt +); + +/** + * @brief + * Return the verb of the SQL command held by the statement handle + * + * @param stmt - Statement handle + * + * @warning + * OCI_GetSQLVerb() must be called after the statement has been executed + * because that's the server engine that computes the SQL verb + * + * @note + * The SQL verb list is available in Oracle documentations and guides + * + * @return + * The SQL command verb of the statement otherwise NULL + */ + +OCI_EXPORT const otext * OCI_API OCI_GetSQLVerb +( + OCI_Statement *stmt +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiBinding Binding variables and arrays + * @{ + * + * OCILIB supports OCI data binding APIs + * + * Programs variables can be binded to an Oracle SQL PL/SQL statement in order to : + * + * - Provide input data for SQL statement + * - Provide input/output data for PL/SQL blocks + * + * OCILIB provides a set of binding functions to use with: + * + * - Basic data types: string (char/wchar_t *), int, float, double, raw + * - Object data types: lobs, files,longs, dates, cursors, statements, + * timestamps, intervals, objects + * + * To use binding: + * + * - Prepare a statement with OCI_Prepare() (see Executing statements) + * - Bind variables by calling one if the OCI_Bindxxxxx() function for every + * input variable referenced by the SQL statement + * - Setup up values of the program variables + * - Call OCI_Execute() as many times as needed + * - Each OCI_Execute() call may be preceded by an update of the program + * variables (for INSERTs for example) + * + * Bindings can be: + * - IN (host variable are not used anymore after statement execution) + * - OUT (host variable are set during statement execution) + * - IN/OUT (default) + * Use OCI_BindSetDirectionTo() to change a host variable bind direction mode after the binding call but before statement execution. + * Note that each direction mode may have a little overhead depending on the SQL type as OCILIB may have to do checks/conversions/mappings between host variable and buffers. + * Thus, to maximize performances: + * - set direction mode to OCI_BDM_IN if host variable is not updated by statement execution + * - set direction mode to OCI_BDM_OUT if host variable value does not matter prior to statement execution + * - set direction mode to OCI_BDM_IN_OUT when host variable value is used for execution and updated by statement execution + * + * OCILIB supports the OCI array Interface by binding arrays of C scalar types + * and OCILIB object types. + * + * - all types supported the library can be used for array binding except + * OCI_Statement and OCI_Long + * - Array binding is really fast for massive DML operations + * - For string/RAW arrays, the input array MUST BE a contiguous block of data + * and not an array of pointers. So to bind an array of 10 elements for a + * varchar2(30) column, binded variable must be a like array[10][31] + * + * OCILIB does not pre-parse statements (like other frameworks such as JDBC, ...) + * and lets Oracle recognize input variables embedded within the SQL statements. + * + * Bind variables must be preceded in the SQL code by the character ':'. + * + * Oracle and OCILIB supports two ways of binding: + * + * - by name (default mode in OCILIB): Oracle looks for variables in the SQL + * statement by searching their names provided to the binding function. + * So a variable can be binded once and used many times in the statement + * - by position: Oracle binds variables by position, so every variable is + * binded with a position number + * + * OCILIB Default binding mode is OCI_BIND_BY_NAME. + * + * When using binding by position, provide the position to OCI_BindXXXX() call + * through the name parameter. Within this mode the bind name must be the + * position preceded by a semicolon like ':1', ':2', .... + * + * @par Internal Bind allocation mode + * + * Bind variables or arrays can be internally allocated by OCILIB. + * That means that instead of allocating variables or arrays on the stack/heap + * in the user program, bind contents can be allocated internally and thus : + * - minimize the amount of program variables + * - optimize internal memory management for arrays + * + * To do so : + * - Call OCI_SetBindAllocation() with the mode OCI_BAM_INTERNAL + * - pass a NULL variable or array to OCI_BindXXX() calls + * - Retrieve the bind content allocated by OCILIB with OCI_BindGetData() + * + * Internal Bind allocation mode IS compatible with ALL array binding OCI_BindArrayOfxxx() methods. + * + * Internal Bind allocation mode IS NOT compatible with some single variable bind calls : + * - OCI_BindTimestamp() + * - OCI_BindInterval() + * - OCI_BindLob() + * - OCI_BindFile() + * - OCI_BindObject() + * - OCI_BindColl() + * - OCI_BindRef() + * - OCI_BindStatement() + * - OCI_BindLong() + * + * These methods need to know the data sub type (like OCI_CLOB/OCI_BLOB for lobs) in order + * to internally create variables. As these methods prototypes are not passing the sub type, + * calling them with the statement bind mode set to OCI_BAM_INTERNAL will raise + * an OCILIB error of type OCI_ERR_NULL_POINTER + * + * @note + * Rebinding is disabled by default (see OCI_AllowRebinding()) + * When using rebinding feature, host variable re-binded to a previously allocated + * bind MUST be of the SAME data type ! + * + * @par Basic input bind Example + * @include bind.c + * + * @par Array interface Example + * @include array.c + * + * @par Internal Array interface Example + * @include array_internal.c + * + * */ + +/** + * @brief + * Set the input array size for bulk operations + * + * @param stmt - Statement handle + * @param size - Array size + * + * @warning + * Do not use OCI_BindArraySetSize() for PL/SQL tables binding + * + * @note + * OCI_BindArraySetSize() is used to set the size of input bind array when using + * arrays for DML statements. + * OCI_BindArraySetSize() MUST be called to set the maximum size of the arrays + * to bind to the statement before any of its execution. This initial call must + * be bone AFTER OCI_Prepare() and BEFORE any OCI_BindArrayOfxxx() call. + * + * @note + * OCI_BindArraySetSize() can optionally be called before any later OCI_Execute() + * call in order to notify the statement of the exact number of elements + * populating the input arrays for the next execution. The array size passed to + * later OCI_BindArraySetSize() calls cannot be greater than the initial size + * otherwise an exception will be thrown. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_BindArraySetSize +( + OCI_Statement *stmt, + unsigned int size +); + +/** + * @brief + * Return the current input array size for bulk operations + * + * @param stmt - Statement handle + * + * @return + * Array size value or 0 if OCI_BindArraySetSize() has not been called + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_BindArrayGetSize +( + OCI_Statement *stmt +); + +/** + * @brief + * Allow different host variables to be binded using the same bind name or + * position between executions of a prepared statement + * + * @param stmt - Statement handle + * @param value - Rebinding mode allowed + * + * @note + * Default value is FALSE + * + * @warning + * When using rebinding feature, host variable re-binded to a previously allocated + * bind MUST be of the same data type ! + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_AllowRebinding +( + OCI_Statement *stmt, + boolean value +); + +/** + * @brief + * Indicate if rebinding is allowed on the given statement + * + * @param stmt - Statement handle + * + * @note + * See OCI_AllowRebinding() for more details + * + * @return + * TRUE if allowed otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_IsRebindingAllowed +( + OCI_Statement *stmt +); + +/** +* @brief +* Bind a boolean variable (PL/SQL ONLY) +* +* @param stmt - Statement handle +* @param name - Variable name +* @param data - Pointer to boolean variable +* +* @note +* parameter 'data' can NULL if the statement bind allocation mode +* has been set to OCI_BAM_INTERNAL +* +* @warning +* - OCI_BindBoolean() CAN ONLY BE USED for PL/SQL boolean type when calling PL/SQL procedures/function +* - ONLY supported by Oracle 12c and above ! +* +* @return +* TRUE on success otherwise FALSE +*/ +OCI_EXPORT boolean OCI_API OCI_BindBoolean +( + OCI_Statement *stmt, + const otext *name, + boolean *data +); + +/** +* @brief +* Bind an Number variable +* +* @param stmt - Statement handle +* @param name - Variable name +* @param data - Pointer to short variable +* +* @note +* parameter 'data' can NULL if the statement bind allocation mode +* has been set to OCI_BAM_INTERNAL +* +* @return +* TRUE on success otherwise FALSE +*/ + +OCI_EXPORT boolean OCI_API OCI_BindNumber +( + OCI_Statement *stmt, + const otext *name, + OCI_Number *data +); + +/** +* @brief +* Bind an array of Number +* +* @param stmt - Statement handle +* @param name - Variable name +* @param data - Array of numbers +* @param nbelem - Number of element in the array (PL/SQL table only) +* +* @warning +* Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. +* For regular DML array operations, pass the value 0. +* +* @note +* parameter 'data' can NULL if the statement bind allocation mode +* has been set to OCI_BAM_INTERNAL +* +* @return +* TRUE on success otherwise FALSE +*/ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfNumbers +( + OCI_Statement *stmt, + const otext *name, + OCI_Number **data, + unsigned int nbelem +); + +/** + * @brief + * Bind an short variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Pointer to short variable + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindShort +( + OCI_Statement *stmt, + const otext *name, + short *data +); + +/** + * @brief + * Bind an array of shorts + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of shorts + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfShorts +( + OCI_Statement *stmt, + const otext *name, + short *data, + unsigned int nbelem +); + +/** + * @brief + * Bind an unsigned short variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Pointer to unsigned short variable + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindUnsignedShort +( + OCI_Statement *stmt, + const otext *name, + unsigned short *data +); + +/** + * @brief + * Bind an array of unsigned shorts + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of unsigned shorts + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedShorts +( + OCI_Statement *stmt, + const otext *name, + unsigned short *data, + unsigned int nbelem +); + +/** + * @brief + * Bind an integer variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Pointer to int variable + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindInt +( + OCI_Statement *stmt, + const otext *name, + int *data +); + +/** + * @brief + * Bind an array of integers + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of int + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfInts +( + OCI_Statement *stmt, + const otext *name, + int *data, + unsigned int nbelem +); + +/** + * @brief + * Bind an unsigned integer variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Pointer to unsigned int variable + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindUnsignedInt +( + OCI_Statement *stmt, + const otext *name, + unsigned int *data +); + +/** + * @brief + * Bind an array of unsigned integers + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of unsigned int + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedInts +( + OCI_Statement *stmt, + const otext *name, + unsigned int *data, + unsigned int nbelem +); + +/** + * @brief + * Bind a big integer variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Pointer to big int variable + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindBigInt +( + OCI_Statement *stmt, + const otext *name, + big_int *data +); + +/** + * @brief + * Bind an array of big integers + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of big int + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfBigInts +( + OCI_Statement *stmt, + const otext *name, + big_int *data, + unsigned int nbelem +); + +/** + * @brief + * Bind an unsigned big integer variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Pointer to unsigned big int variable + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindUnsignedBigInt +( + OCI_Statement *stmt, + const otext *name, + big_uint *data +); + +/** + * @brief + * Bind an array of unsigned big integers + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of unsigned big int + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedBigInts +( + OCI_Statement *stmt, + const otext *name, + big_uint *data, + unsigned int nbelem +); + +/** + * @brief + * Bind a string variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - String to bind + * @param len - Max length of the string (in character without + * the zero null terminal character) + * + * @note + * if len == 0, len is set to the string size + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindString +( + OCI_Statement *stmt, + const otext *name, + otext *data, + unsigned int len +); + +/** + * @brief + * Bind an array of strings + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of string + * @param len - Max length of a single string element (in character without + * the zero null terminal character) + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @warning + * if len <= 0, it returns FALSE + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfStrings +( + OCI_Statement *stmt, + const otext *name, + otext *data, + unsigned int len, + unsigned int nbelem +); + +/** + * @brief + * Bind a raw buffer + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - buffer to bind + * @param len - Max length of the buffer + * + * @note + * if len <= 0, it returns false + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindRaw +( + OCI_Statement *stmt, + const otext *name, + void *data, + unsigned int len +); + +/** + * @brief + * Bind an array of raw buffers + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of buffers + * @param len - Size in bytes on a single RAW array element + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * The buffer must be a contiguous block of data elements + * + * @note + * If len <= 0, it returns FALSE + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfRaws +( + OCI_Statement *stmt, + const otext *name, + void *data, + unsigned int len, + unsigned int nbelem +); + +/** + * @brief + * Bind a double variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Pointer to double variable + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindDouble +( + OCI_Statement *stmt, + const otext *name, + double *data +); + +/** + * @brief + * Bind an array of doubles + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of double + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfDoubles +( + OCI_Statement *stmt, + const otext *name, + double *data, + unsigned int nbelem +); + + +/** + * @brief + * Bind a float variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Pointer to float variable + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindFloat +( + OCI_Statement *stmt, + const otext *name, + float *data +); + +/** + * @brief + * Bind an array of floats + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of float + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfFloats +( + OCI_Statement *stmt, + const otext *name, + float *data, + unsigned int nbelem +); + +/** + * @brief + * Bind a date variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Date handle + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindDate +( + OCI_Statement *stmt, + const otext *name, + OCI_Date *data +); + +/** + * @brief + * Bind an array of dates + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of date handle + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfDates +( + OCI_Statement *stmt, + const otext *name, + OCI_Date **data, + unsigned int nbelem +); + +/** + * @brief + * Bind a timestamp variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Timestamp handle + * + * @note + * parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindTimestamp +( + OCI_Statement *stmt, + const otext *name, + OCI_Timestamp *data +); + +/** + * @brief + * Bind an array of timestamp handles + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of Timestamp handle + * @param type - Timestamp type + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * See OCI_TimestampCreate() for possible values of parameter 'type' + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfTimestamps +( + OCI_Statement *stmt, + const otext *name, + OCI_Timestamp **data, + unsigned int type, + unsigned int nbelem +); + +/** + * @brief + * Bind an interval variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Interval handle + * + * @note + * parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_BindInterval +( + OCI_Statement *stmt, + const otext *name, + OCI_Interval *data +); + +/** + * @brief + * Bind an array of interval handles + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of Interval handle + * @param type - Interval type + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * See OCI_IntervalCreate() for possible values of parameter 'type' + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfIntervals +( + OCI_Statement *stmt, + const otext *name, + OCI_Interval **data, + unsigned int type, + unsigned int nbelem +); + +/** + * @brief + * Bind a Lob variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Lob handle + * + * @note + * parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindLob +( + OCI_Statement *stmt, + const otext *name, + OCI_Lob *data +); + +/** + * @brief + * Bind an array of Lob handles + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of Lob handle + * @param type - Lob type + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * See OCI_LobCreate() for possible values of parameter 'type' + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfLobs +( + OCI_Statement *stmt, + const otext *name, + OCI_Lob **data, + unsigned int type, + unsigned int nbelem +); + +/** + * @brief + * Bind a File variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - File handle + * + * @note + * parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindFile +( + OCI_Statement *stmt, + const otext *name, + OCI_File *data +); + +/** + * @brief + * Bind an array of File handles + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of File handle + * @param type - File type + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * See OCI_FileCreate() for possible values of parameter 'type' + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfFiles +( + OCI_Statement *stmt, + const otext *name, + OCI_File **data, + unsigned int type, + unsigned int nbelem +); + +/** + * @brief + * Bind an object (named type) variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Object handle + * + * @note + * parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_BindObject +( + OCI_Statement *stmt, + const otext *name, + OCI_Object *data +); + +/** + * @brief + * Bind an array of object handles + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of object handle + * @param typinf - type info handle + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfObjects +( + OCI_Statement *stmt, + const otext *name, + OCI_Object **data, + OCI_TypeInfo *typinf, + unsigned int nbelem +); + +/** + * @brief + * Bind a Collection variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Collection handle to bind + * + * @note + * parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindColl +( + OCI_Statement *stmt, + const otext *name, + OCI_Coll *data +); + +/** + * @brief + * Bind an array of Collection handles + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of Collection handle + * @param typinf - Type info handle + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * See OCI_CollCreate() for possible values of parameter 'type' + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfColls +( + OCI_Statement *stmt, + const otext *name, + OCI_Coll **data, + OCI_TypeInfo *typinf, + unsigned int nbelem +); + +/** + * @brief + * Bind a Ref variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Ref handle to bind + * + * @note + * parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindRef +( + OCI_Statement *stmt, + const otext *name, + OCI_Ref *data +); + +/** + * @brief + * Bind an array of Ref handles + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Array of Ref handle + * @param typinf - type info handle + * @param nbelem - Number of element in the array (PL/SQL table only) + * + * @warning + * Parameter 'nbelem' SHOULD ONLY be USED for PL/SQL tables. + * For regular DML array operations, pass the value 0. + * + * @note + * parameter 'data' can NULL if the statement bind allocation mode + * has been set to OCI_BAM_INTERNAL + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_BindArrayOfRefs +( + OCI_Statement *stmt, + const otext *name, + OCI_Ref **data, + OCI_TypeInfo *typinf, + unsigned int nbelem +); + +/** + * @brief + * Bind a Statement variable (PL/SQL Ref Cursor) + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Statement handle to bind + * + * @note + * parameter 'data' CANNOT be NULL resulting OCI_BAM_INTERNAL bind allocation mode being NOT supported + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindStatement +( + OCI_Statement *stmt, + const otext *name, + OCI_Statement *data +); + +/** + * @brief + * Bind a Long variable + * + * @param stmt - Statement handle + * @param name - Variable name + * @param data - Long handle + * @param size - Size of the long buffer in bytes or characters + * + * @note + * Size is expressed in: + * - Bytes for BLONGs + * - Characters for CLONGs + * + * @note + * parameter 'data' CANNOT be NULL whatever the statement bind allocation mode + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindLong +( + OCI_Statement *stmt, + const otext *name, + OCI_Long *data, + unsigned int size +); + +/** + * @brief + * Returns the first or next error that occurred within a DML array statement execution + * + * @param stmt - Statement handle + * + * @return + * The first or next error handle otherwise NULL + */ + +OCI_EXPORT OCI_Error * OCI_API OCI_GetBatchError +( + OCI_Statement *stmt +); + +/** + * @brief + * Returns the number of errors that occurred within the last DML array statement + * + * @param stmt - Statement handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetBatchErrorCount +( + OCI_Statement *stmt +); + +/** + * @brief + * Return the number of binds currently associated to a statement + * + * @param stmt - Statement handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetBindCount +( + OCI_Statement *stmt +); + +/** + * @brief + * Return the bind handle at the given index in the internal array of bind + * handle + * + * @param stmt - Statement handle + * @param index - Bind position + * + * @note + * Index starts at 1. + * + * @note + * Bind handle are created sequentially. For example, the third call to a + * OCI_BindXXX() generates a bind handle of index 3. + * + * @return + * The bind handle or NULL if index is out of bounds + * + */ + +OCI_EXPORT OCI_Bind * OCI_API OCI_GetBind +( + OCI_Statement *stmt, + unsigned int index +); + +/** + * @brief + * Return a bind handle from its name + * + * @param stmt - Statement handle + * @param name - Bind variable name + * + * @note + * Bind names must include a semicolon at the beginning. + * + * @return + * The bind handle or NULL if not found + * + */ + +OCI_EXPORT OCI_Bind * OCI_API OCI_GetBind2 +( + OCI_Statement *stmt, + const otext *name +); + +/** +* @brief +* Return the index of the bind from its name belonging to the given statement +* +* @param stmt - Statement handle +* @param name - Bind variable name +* +* @warning +* The bind name is case insensitive +* +* @note +* Bind indexes start with 1 in OCILIB +* +* @return +* Bind index on success or zero if the bind does not exists or if statement is NULL +* +*/ + +OCI_EXPORT unsigned int OCI_API OCI_GetBindIndex +( + OCI_Statement *stmt, + const otext *name +); + +/** + * @brief + * Return the name of the given bind + * + * @param bnd - Bind handle + * + */ + +OCI_EXPORT const otext * OCI_API OCI_BindGetName +( + OCI_Bind *bnd +); + + +/** + * @brief + * Set the direction mode of a bind handle + * + * @param bnd - Bind handle + * @param direction - direction mode + * + * @note + * Possible values for parameter 'direction' : + * - OCI_BDM_IN : input values (not modified by the server) + * - OCI_BDM_OUT : output values (modified by the server) + * - OCI_BDM_IN_OUT : input and output values + * + * @note + * Default value is OCI_BDM_IN_OUT + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_BindSetDirection +( + OCI_Bind *bnd, + unsigned int direction +); + +/** + * @brief + * Get the direction mode of a bind handle + * + * @param bnd - Bind handle + * + * @note + * see OCI_BindSetDirection() for more details + * + * return the bind direction mode on success otherwise OCI_UNKNWON + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_BindGetDirection +( + OCI_Bind *bnd +); + +/** + * @brief + * Return the OCILIB type of the given bind + * + * @param bnd - Bind handle + * + * @note + * Possible values are : + * + * - OCI_CDT_NUMERIC : short, int, long long, float, double + * - OCI_CDT_DATETIME : OCI_Date * + * - OCI_CDT_TEXT : otext * + * - OCI_CDT_LONG : OCI_Long * + * - OCI_CDT_CURSOR : OCI_Statement * + * - OCI_CDT_LOB : OCI_Lob * + * - OCI_CDT_FILE : OCI_File * + * - OCI_CDT_TIMESTAMP : OCI_Timestamp * + * - OCI_CDT_INTERVAL : OCI_Interval * + * - OCI_CDT_RAW : void * + * - OCI_CDT_OBJECT : OCI_Object * + * - OCI_CDT_COLLECTION : OCI_Coll * + * - OCI_CDT_REF : OCI_Ref * + * - OCI_CDT_BOOLEAN : boolean + * + * @return + * The column type or OCI_CDT_UNKNOWN on error + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_BindGetType +( + OCI_Bind *bnd +); + +/** + * @brief + * Return the OCILIB object subtype of the given bind + * + * @param bnd - Bind handle + * + * @note + * * This call is valid for the following OCILIB types: + * - OCI_CDT_NUMERIC + * - OCI_CDT_LONG + * - OCI_CDT_LOB + * - OCI_CDT_FILE + * - OCI_CDT_TIMESTAMP + * - OCI_CDT_INTERVAL + * + * For numeric binds the possible values are: + * - OCI_NUM_SHORT + * - OCI_NUM_INT + * - OCI_NUM_BIGINT + * - OCI_NUM_USHORT + * - OCI_NUM_UINT + * - OCI_NUM_BIGUINT + * - OCI_NUM_DOUBLE + * - OCI_NUM_FLOAT + * - OCI_NUM_NUMBER + * + * For OCI_Long type the possible values are: + * - OCI_BLONG + * - OCI_CLONG + * + * For OCI_Lob type the possible values are: + * - OCI_BLOB + * - OCI_CLOB + * - OCI_NCLOB + * + * For OCI_File type the possible values are: + * - OCI_BFILE + * - OCI_CFILE + * + * For OCI_Timestamp type the possible values are: + * - OCI_TIMESTAMP + * - OCI_TIMESTAMP_TZ + * - OCI_TIMESTAMP_LTZ + * + * For OCI_Interval type the possible values are: + * - OCI_INTERVAL_YM + * - OCI_INTERVAL_DS + * + * @note + * For all other OCILIB types, it returns OCI_UNKNOWN + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_BindGetSubtype +( + OCI_Bind *bnd +); + +/** + * @brief + * Return the number of elements of the bind handle + * + * @param bnd - Bind handle + * + * @return + * - For single binds, it returns 1 + * - For array binds, it returns the number of element in the array + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_BindGetDataCount +( + OCI_Bind *bnd +); + +/** + * @brief + * Return the user defined data associated with a bind handle + * + * @param bnd - Bind handle + * + * @return + * - The pointer to variable/array passed to an OCI_BindXXX() or + * OCI_BindArrayOfXXX() call + * + */ + +OCI_EXPORT void * OCI_API OCI_BindGetData +( + OCI_Bind *bnd +); + +/** + * @brief + * Return the statement handle associated with a bind handle + * + * @param bnd - bind handle + * + */ + +OCI_EXPORT OCI_Statement * OCI_API OCI_BindGetStatement +( + OCI_Bind *bnd +); + +/** + * @brief + * Set the actual size of the element held by the given bind handle + * + * @param bnd - bind handle + * @param size - data size + * + * @note + * This call is not mandatory and should ONLY be called for RAWs binds to set + * the real size of the given data if different from the expected column or + * parameter size + * + * @note + * It works as well with string based PL/SQL tables (in or in/out but NOT out) + * even if it's not necessary. + * + * @warning + * For binds of type OCI_CDT_TEXT (strings), the parameter 'size' is expressed in + * number of characters. + * + * @return + * Data size if the bind type is listed above otherwise 0. + * + */ + +OCI_EXPORT boolean OCI_API OCI_BindSetDataSize +( + OCI_Bind *bnd, + unsigned int size +); + +/** + * @brief + * Set the size of the element at the given position in + * the bind input array + * + * @param bnd - bind handle + * @param position - Position in the array + * @param size - data size + * + * @note + * See OCI_BindSetDataSize() for supported data types + * + * @warning + * Before execution, it returns the max default size for the bind and not the real + * data size, unless a custom size has been set with OCI_BindSetDataSizeXXX() + * After execution, it returns the real data size. + * + * @warning + * For binds of type OCI_CDT_TEXT (strings), the parameter 'size' is expressed in + * number of characters. + * + * @return + * Data size if the bind type is listed above otherwise 0. + * + */ + +OCI_EXPORT boolean OCI_API OCI_BindSetDataSizeAtPos +( + OCI_Bind *bnd, + unsigned int position, + unsigned int size +); + +/** + * @brief + * Return the actual size of the element held by the given bind handle + * + * @param bnd - bind handle + * + * @note + * See OCI_BindSetDataSize() for supported data types + * + * @warning + * For binds of type OCI_CDT_TEXT (strings), the returned value is expressed in + * number of characters. + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_BindGetDataSize +( + OCI_Bind *bnd +); + +/** + * @brief + * Return the actual size of the element at the given position in + * the bind input array + * + * @param bnd - bind handle + * @param position - Position in the array + * + * @note + * See OCI_BindSetDataSize() for supported data types + * + * @warning + * For binds of type OCI_CDT_TEXT (strings), the returned value is expressed in + * number of characters. + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_BindGetDataSizeAtPos +( + OCI_Bind *bnd, + unsigned int position +); + +/** + * @brief + * Set the bind variable to null + * + * @param bnd - Bind handle + * + * @note + * There is no notion of null value in C. + * It's necessary to explicitly tell Oracle that the bind has a null value. + * It must be done before an OCI_Execute() call + * + * @note + * For handled based data types (non scalar types), OCILIB performs an extra + * check on handles and set the bind status to null is the handle is null + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindSetNull +( + OCI_Bind *bnd +); + +/** + * @brief + * Set to null the entry in the bind variable input array + * + * @param bnd - Bind handle + * @param position - Position in the array + * + * @note + * There is no notion of null value in C. + * It's necessary to explicitly tell Oracle that the bind has a null value. + * It must be done before an OCI_Execute() call + * + * @warning + * Position starts with 1 + * + * @note + * For handled based data types (non scalar types), OCILIB performs an extra + * check on handles and set the bind status to null is the handle is null + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindSetNullAtPos +( + OCI_Bind *bnd, + unsigned int position +); + +/** + * @brief + * Set the bind variable to NOT null + * + * @param bnd - Bind handle + * + * @note + * There is no notion of null value in C. + * It's necessary to explicitly tell Oracle that the bind has a null value. + * It must be done before an OCI_Execute() call + * + * @note + * For handled based data types (non scalar types), OCILIB performs an extra + * check on handles and set the bind status to null is the handle is null + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindSetNotNull +( + OCI_Bind *bnd +); + +/** + * @brief + * Set to NOT null the entry in the bind variable input array + * + * @param bnd - Bind handle + * @param position - Position in the array + * + * @note + * There is no notion of null value in C. + * It's necessary to explicitly tell Oracle that the bind has a null value. + * It must be done before an OCI_Execute() call + * + * @warning + * Position starts with 1 + * + * @note + * For handled based data types (non scalar types), OCILIB performs an extra + * check on handles and set the bind status to null is the handle is null + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_BindSetNotNullAtPos +( + OCI_Bind *bnd, + unsigned int position +); + +/** + * @brief + * Check if the current value of the binded variable is marked as NULL + * + * @param bnd - Bind handle + * + * @return + * TRUE if it's null otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_BindIsNull +( + OCI_Bind *bnd +); + +/** + * @brief + * Check if the current entry value at the given index of the binded array + * is marked as NULL + * + * @param bnd - Bind handle + * @param position - Position in the array + * + * @warning + * Position starts with 1 + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_BindIsNullAtPos +( + OCI_Bind *bnd, + unsigned int position +); + +/** + * @brief + * Set the charset form of the given character based bind variable + * + * @param bnd - Bind handle + * @param csfrm - charset form + * + * @note + * Possible values are : + * + * - OCI_CSF_DEFAULT : the column has default charset + * - OCI_CSF_NATIONAL: the column has national charset + * + * @note + * This call has to be made after OCI_Prepare() but before OCI_Execute() + * + * @warning + * This call does nothing : + * - if the csform is out of range + * - if the bind type is not OCI_CFT_TEXT or OCI_CDT_LONG + * + * @return + * TRUE on success otherwise FALSE + * + */ + +boolean OCI_API OCI_BindSetCharsetForm +( + OCI_Bind *bnd, + unsigned int csfrm +); + +/** + * @brief + * Get the allocation mode of a bind handle + * + * @param bnd - Bind handle + * + * @note + * Possible values are : + * - OCI_BAM_EXTERNAL : bind variable is allocated by user code + * - OCI_BAM_INTERNAL : bind variable is allocated internally + * + * return the allocation mode on success otherwise OCI_UNKNOWN + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_BindGetAllocationMode +( + OCI_Bind *bnd +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiFetching Fetching data + * @{ + * + * OCILIB offers a really easy and smart mechanism to fetch data from a SQL Statement. + * It looks like what's found in JDBC and other object oriented databases frameworks. + * + * ONLY the following statements can return resultsets that can be fetched by host programs: + * - Statements executing SQL SELECT + * - Statements executing SQL INSERT/UPDATE/DELETE using a RETURNING INTO clause + * - Statements binded to PL/SQL OPEN FOR argument + * - Statements binded to PL/SQL procedure OUT variables + * - Statements implicitly returned from PL/SQL procedure or blocks (new feature in Oracle 12cR1) using + * DBMS_SQL.RETURN_RESULT() + * + * These resultsets are encapsulated in OCILIB by OCI_Resultset objects. + * + * Thus, after any successful call to an OCI_Executexxx() function that executed + * a fetchable statement or filled output bind variables, the resultset can be + * retrieved by calling OCI_GetResultset() + * + * The creation of a OCI_Resultset object consists in : + * + * - Describing the output columns of the resultset + * - Allocating memory to hold the content data + * + * OCILIB supports multi-row fetching for increasing performances. Instead of + * fetching data row by row from the server (that induces lots of round-trips + * between the client and the server), the library prefetches data chunk by + * chunks (default is 20 rows). + * So, less network traffic and better performances. + * These mechanisms are completely hidden from the application which fetches the + * resultset row by row. + * + * Once the Resultset handle is retrieved : + * + * - It can be fetched by calling OCI_FetchNext() as long as it returns TRUE. + * - To retrieve the value of a column, call OCI_GetXXXX() where XXXX is the + * type of data you want to fetch. + * + * @note + * In case of a statement that has executed PL/SQL calls or blocks returning implicit resultsets: + * - OCI_GetResultset() return the first available resultset + * - OCI_GetNextResultset() return the next available resultset until no more resultset available + * + * @par Scrollable Resultsets + * + * Oracle 9i introduced scrollable cursors (resultsets in OCILIB) that can be + * fetched: + * + * - Sequentially in both directions: OCI_FetchPrev() and OCI_FetchNext() + * - To a relative position in the resultset: OCI_FetchSeek() with OCI_SFD_RELATIVE + * - To an absolute position in the resultset: OCI_FetchSeek() with OCI_SFD_ABOSLUTE + * - To the first or last row in the resultset: OCI_FetchFirst() and OCI_FetchLast() + * + * Scrollable statements uses more server and client resources and should only + * be used when necessary. + * + * Resultsets are 'forward only' by default. Call OCI_SetFetchMode() with + * OCI_SFM_SCROLLABLE to enable scrollable resultsets for a given statement. + * + * @warning + * Any use of scrollable fetching functions with a resultset that depends on a + * statement with fetch mode set to OCI_SFM_DEFAULT will fail ! + * + * @warning + * If you intend to use OCI_FetchSeek() on a scrollable statement and if any of the + * selected columns is a ref cursor or a nested table, OCILIB will internally set the + * resultset internal array size to 1 and thus ignore any values set using OCI_SetFetchSize() + * This is performed due to an Oracle bug. + * + * @note + * If the column internal data does not match the requested type, OCILIB tries + * to convert the data when it's possible and throws an error if not. + * + * The properties (columns names, types ...) of the resultset are accessible + * through a set of APIs. + * + * @par Implicit conversion to string types + * + * OCI_GetString() performs an implicit conversion from ANY Oracle types: + * + * - Numerics (based on the current connection handle numeric format) + * - Binary doubles and floats (using the standard C Library functions) + * - OCI_Date : uses OCI_DateToText() with current connection date format + * - OCI_Timestamp : uses OCI_TimestampToText() with current connection date format + * - OCI_Interval : uses OCI_IntervalToText() with Oracle default format + * - OCI_Coll : uses OCI_CollToText() + * - OCI_Object : uses OCI_ObjectToText() + * - OCI_Ref : uses OCI_RefToText() + * - OCI_File : returns "$(folder)/$(filename)" - no content returned + * - OCI_Lob : see note above for binary types + * - OCI_Long : see note above for binary types + * - RAWs : see note above for binary types + * + * @note + * For RAWs and BLOBs attributes, their binary values are converted to hexadecimal strings + * For LONG and CLOBs/NCLOBSs attributes, the whole string content is returned + * + * @note + * The following OCILIB types are not supported for implicit conversion: + * - OCI_Statement + * + * @warning + * For Dates and numerics types, OCILIB uses OCI client calls to perform + * the conversion. + * For binary double and binary floats data types, OCI client functions cannot + * handle the full double range of values. Thus, OCILIB is using the + * standard C library to convert theses data types to string + * + * @par Fetching rows into user structures + * + * It is possible to fetch a complete row into a user defined structure. + * Each column of the resultset is mapped to a structure member. + * The mapping rules are : + * - LOBs (CLOB, NCLOB, BLOB) : OCI_Lob * + * - DATE : OCI_Date * + * - TIMESTAMPS : OCI_Timestamp * + * - INTERVALS : OCI_Interval * + * - LONG, LONG RAW : OCI_Long * + * - REFs : OCI_Ref * + * - CURSOR, RESULSET : OCI_Statement * + * - OBJECTS, UDT : OCI_Object * + * - Character columns (CHAR,VARCHAR, etc..) : otext * + * - All NUMERIC types : + * - default : big_int + * - user defined (see OCI_SetStructNumericType()) + * + * See OCI_GetStruct() and OCI_SetStructNumericType() for more details + * + * @par Fetch Example + * @include fetch.c + * + * @par Fetch Rows into user structures Example + * @include fetch_struct.c + * + * @par Meta data Example + * @include meta.c + * + * @par Ref cursor Example + * @include cursor.c + * + * @par Implicit resultset Example + * @include implicit_resultset.c + * + * @par Scrollable resultset Example + * @include scroll.c + * + */ + +/** + * @brief + * Retrieve the resultset handle from an executed statement + * + * @param stmt - Statement handle + * + * @note + * See @ref OcilibCApiFetching for more details about what statements can return resultsets + * + * @warning + * If the statement has not been prepared and executed, no resultset will be returned + * + * @return + * A resultset handle on success otherwise NULL + * + */ + +OCI_EXPORT OCI_Resultset * OCI_API OCI_GetResultset +( + OCI_Statement *stmt +); + +/** + * @brief + * Free the statement resultsets + * + * @param stmt - Statement handle + * + * @note + * This call is optional. Resultsets are automatically freed when the + * statement is destroyed or when it's reused. + * + * @note + * This function has been introduced for releasing big resultsets when the + * application wants to keep the statement alive and does not know when it + * will be destroyed. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ReleaseResultsets +( + OCI_Statement *stmt +); + +/** + * @brief + * Fetch the next row of the resultset + * + * @param rs - Resultset handle + * + * @note + * OCI_FetchNext() works for normal and scrollable resultsets + * + * @return + * TRUE on success otherwise FALSE if : + * - Empty resultset + * - Last row already fetched + * - An error occurred + * + */ + +OCI_EXPORT boolean OCI_API OCI_FetchNext +( + OCI_Resultset *rs +); + +/** + * @brief + * Fetch the previous row of the resultset + * + * @param rs - Resultset handle + * + * @note + * OCI_FetchPrev() works ONLY for scrollable resultsets + * + * @return + * TRUE on success otherwise FALSE if : + * - Empty resultset + * - First row already fetched + * - An error occurred + * + */ + +OCI_EXPORT boolean OCI_API OCI_FetchPrev +( + OCI_Resultset *rs +); + +/** + * @brief + * Fetch the first row of the resultset + * + * @param rs - Resultset handle + * + * @note + * OCI_FetchFirst() works ONLY for scrollable resultsets + * + * @return + * TRUE on success otherwise FALSE if : + * - Empty resultset + * - An error occurred + *f + */ + +OCI_EXPORT boolean OCI_API OCI_FetchFirst +( + OCI_Resultset *rs +); + +/** + * @brief + * Fetch the last row of the resultset + * + * @param rs - Resultset handle + * + * @note + * OCI_FetchLast() works ONLY for scrollable resultsets + * + * @return + * TRUE on success otherwise FALSE if: + * - Empty resultset + * - An error occurred + * + */ + +OCI_EXPORT boolean OCI_API OCI_FetchLast +( + OCI_Resultset *rs +); + +/** + * @brief + * Custom Fetch of the resultset + * + * @param rs - Resultset handle + * @param mode - Fetch direction + * @param offset - Fetch offset + * + * @note + * Possible values for 'direction' parameter are: + * - OCI_SFD_ABSOLUTE + * - OCI_SFD_RELATIVE + * + * @note + * OCI_FetchSeek() works ONLY for scrollable resultsets + * + * @warning + * If you intend to use OCI_FetchSeek() on a scrollable statement and if any of the + * selected columns is a ref cursor or a nested table, you must set the fetching size + * to 1 using OCI_SetFetchSize() before calling OCI_GetResultset() + * Otherwise OCI_FetchSeek() will fails with a OCI-10002 error + * + * @return + * TRUE on success otherwise FALSE if: + * - Empty resultset + * - An error occurred + * - OCI_SetFetchMode() has not been called with OCI_SFM_SCROLLABLE + * + */ + +OCI_EXPORT boolean OCI_API OCI_FetchSeek +( + OCI_Resultset *rs, + unsigned int mode, + int offset +); + +/** + * @brief + * Retrieve the number of rows fetched so far + * + * @param rs - Resultset handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetRowCount +( + OCI_Resultset *rs +); + +/** + * @brief + * Retrieve the current row number + * + * @param rs - Resultset handle + * + * @note + * - OCI_GetCurrentRow() returns the current row number starting from 1 + * - If the resultset has not been fetched or if the resultset is empty, it returns 0 + * - If the resultset has been fully fetched, it returns the last fetched row number + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetCurrentRow +( + OCI_Resultset *rs +); + +/** + * @brief + * Return the number of columns in the resultset + * + * @param rs - Resultset handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetColumnCount +( + OCI_Resultset *rs +); + +/** + * @brief + * Return the column object handle at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @return + * - Column handle on success + * - NULL if index is out of bounds or on error + * + */ + +OCI_EXPORT OCI_Column * OCI_API OCI_GetColumn +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the column object handle from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @note + * The column name is case insensitive + * + * @return + * - Column handle on success or + * - NULL if no column found with the given name or on error + * + */ + +OCI_EXPORT OCI_Column * OCI_API OCI_GetColumn2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the index of the column in the result from its name + * + * @param rs - Resultset handle + * @param name - Column name + * + * @note + * The column name is case insensitive + * + * @note + * Column indexes start with 1 in OCILIB + * + * @return + * Column index on success or zero on error + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetColumnIndex +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the name of the given column + * + * @param col - Column handle + * + */ + +OCI_EXPORT const otext * OCI_API OCI_ColumnGetName +( + OCI_Column *col +); + +/** + * @brief + * Return the type of the given column + * + * @param col - Column handle + * + * @note + * Possible values are : + * + * - OCI_CDT_NUMERIC : short, int, long long, float, double + * - OCI_CDT_DATETIME : OCI_Date * + * - OCI_CDT_TEXT : otext * + * - OCI_CDT_LONG : OCI_Long * + * - OCI_CDT_CURSOR : OCI_Statement * + * - OCI_CDT_LOB : OCI_Lob * + * - OCI_CDT_FILE : OCI_File * + * - OCI_CDT_TIMESTAMP : OCI_Timestamp * + * - OCI_CDT_INTERVAL : OCI_Interval * + * - OCI_CDT_RAW : void * + * - OCI_CDT_OBJECT : OCI_Object * + * - OCI_CDT_COLLECTION : OCI_Coll * + * - OCI_CDT_REF : OCI_Ref * + * - OCI_CDT_BOOLEAN : boolean + * + * @return + * The column type or OCI_CDT_UNKNOWN if index is out of bounds + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_ColumnGetType +( + OCI_Column *col +); + +/** + * @brief + * Return the charset form of the given column + * + * @param col - Column handle + * + * @note + * Possible values are : + * - OCI_CSF_NONE : the column is not an character or lob column + * - OCI_CSF_DEFAULT : the column has server default charset + * - OCI_CSF_NATIONAL : the column has national server charset + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_ColumnGetCharsetForm +( + OCI_Column *col +); + +/** + * @brief + * Return the Oracle SQL type name of the column data type + * + * @param col - Column handle + * + * @note + * For possible values, consults Oracle Documentation + * + */ + +OCI_EXPORT const otext * OCI_API OCI_ColumnGetSQLType +( + OCI_Column *col +); + +/** + * @brief + * Return the Oracle SQL Full name including precision and size of the + * column data type + * + * @param col - Column handle + * @param buffer - buffer to store the full column type name and size + * @param len - max size of the buffer in characters + * + * @note + * This function returns a description that matches the one given by SQL*Plus + * + * @note + * Return the number of characters written into the buffer + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_ColumnGetFullSQLType +( + OCI_Column *col, + otext *buffer, + unsigned int len +); + +/** + * @brief + * Return the size of the column + * + * @note + * For all types, the size is expressed is bytes, excepted for character + * based columns that were created with a character based size or of type NCHAR/NVARCHAR + * + * @param col - Column handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSize +( + OCI_Column *col +); + +/** + * @brief + * Return the scale of the column for numeric columns + * + * @param col - Column handle + * + */ + +OCI_EXPORT int OCI_API OCI_ColumnGetScale +( + OCI_Column *col +); + +/** + * @brief + * Return the precision of the column for numeric columns + * + * @param col - Column handle + * + */ + +OCI_EXPORT int OCI_API OCI_ColumnGetPrecision +( + OCI_Column *col +); + +/** + * @brief + * Return the fractional precision of the column for timestamp and interval columns + * + * @param col - Column handle + * + */ + +OCI_EXPORT int OCI_API OCI_ColumnGetFractionalPrecision +( + OCI_Column *col +); + +/** + * @brief + * Return the leading precision of the column for interval columns + * + * @param col - Column handle + * + */ + +OCI_EXPORT int OCI_API OCI_ColumnGetLeadingPrecision +( + OCI_Column *col +); + +/** + * @brief + * Return the nullable attribute of the column + * + * @param col - Column handle + * + * @return + * Return TRUE if the column is nullable otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ColumnGetNullable +( + OCI_Column *col +); + +/** + * @brief + * Return TRUE if the length of the column is character-length or FALSE if + * it is byte-length + * + * @param col - Column handle + * + * @note + * This was introduced in Oracle 9i. So for version that are not supporting this + * property, it always return FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ColumnGetCharUsed +( + OCI_Column *col +); + +/** + * @brief + * Return the column property flags + * + * @param col - Column handle + * + * For flags are: + * - OCI_CPF_NONE : The column has no flags or the OCI client does not support this call + * - OCI_CPF_IS_IDENTITY: + * - If Set, the column is an IDENTITY column + * - Otherwise, it is not an IDENTITY column + * - OCI_CPF_IS_GEN_ALWAYS: + * - If set, means that the value is "ALWAYS GENERATED" + * - Otherwise means that the value is "GENERATED BY" + * - OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL: + * - If set, means that the value is generated by default on NULL + * - OCI_CPF_IS_LPART: + * - If set, Column is an implicitly generated logical partitioning column for container_map enabled object + * - OCI_CPF_IS_CONID: + * - If set, Column is a CON_ID column implicitly generated by CONTAINERS() or is an ORIGIN_CON_ID column implicitly generated for Extended Data Link + * + * @note + * This was introduced in Oracle 12cR1. + * For earlier versions, it always return OCI_CPF_NONE + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_ColumnGetPropertyFlags +( + OCI_Column *col +); + +/** +* @brief +* Return the column collation ID +* +* @param col - Column handle +* +* Possible values: +* - OCI_CCI_NONE +* - OCI_CCI_NLS_COMP +* - OCI_CCI_NLS_SORT +* - OCI_CCI_NLS_SORT_CI +* - OCI_CCI_NLS_SORT_AI +* - OCI_CCI_NLS_SORT_CS +* - OCI_CCI_NLS_SORT_VAR1 +* - OCI_CCI_NLS_SORT_VAR1_CI +* - OCI_CCI_NLS_SORT_VAR1_AI +* - OCI_CCI_NLS_SORT_VAR1_CS +* - OCI_CCI_BINARY +* - OCI_CCI_BINARY_CI +* - OCI_CCI_BINARY_AI +* +* @note +* This was introduced in Oracle 12cR2. +* For earlier versions, it always return OCI_CCI_NONE +* +*/ + +OCI_EXPORT unsigned int OCI_API OCI_ColumnGetCollationID +( + OCI_Column *col +); + +/** + * @brief + * Return the type information object associated to the column + * + * @param col - Column handle + * + * @note + * This call is used only for Named Object typed and collection columns. + * It returns NULL if the column is not a Named Object or a collection. + * + */ + +OCI_EXPORT OCI_TypeInfo * OCI_API OCI_ColumnGetTypeInfo +( + OCI_Column *col +); + +/** + * @brief + * Return the OCILIB object subtype of a column + * + * @param col - Column handle + * + * @note + * This call is valid for the following OCILIB types: + * + * - OCI_CDT_LONG + * - OCI_CDT_LOB + * - OCI_CDT_FILE + * - OCI_CDT_TIMESTAMP + * - OCI_CDT_INTERVAL + * - OCI_CDT_NUMERIC + * + * For OCI_Long type the possible values are: + * - OCI_BLONG + * - OCI_CLONG + * + * For OCI_Lob type the possible values are: + * - OCI_BLOB + * - OCI_CLOB + * - OCI_NCLOB + * + * For OCI_File type the possible values are: + * - OCI_BFILE + * - OCI_CFILE + * + * For OCI_Timestamp type the possible values are: + * - OCI_TIMESTAMP + * - OCI_TIMESTAMP_TZ + * - OCI_TIMESTAMP_LTZ + * + * For OCI_Interval type the possible values are: + * - OCI_INTERVAL_YM + * - OCI_INTERVAL_DS + * + * For numeric columns the possible values are: + * - OCI_NUM_SHORT + * - OCI_NUM_INT + * - OCI_NUM_BIGINT + * - OCI_NUM_USHORT + * - OCI_NUM_UINT + * - OCI_NUM_BIGUINT + * - OCI_NUM_DOUBLE + * - OCI_NUM_FLOAT + * - OCI_NUM_NUMBER + * + * @warning + * For numeric columns, the value may be not accurate at all! + * OCI does not allow to find out the real SQL precise type of an numeric column (int, real, ...). + * OCI based libraries can only 'guess' some types in some situations : float, binary_float, binary_float, number. + * For example: + * - with the statement 'select 101 from dual', OCI would report numeric type NUMBER. + * - if a column is declared as "INT", OCI would report also NUMBER. + * + * + * @note + * For all other OCILIB types, it returns OCI_UNKNOWN + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSubType +( + OCI_Column *col +); + +/** + * @brief + * set the numeric data type of the given structure member (identified from position in the + * resultset) to retrieve when calling OCI_GetStruct() + * + * @param rs - Resultset handle + * @param index - Column position + * @param type - Numeric type + * + * @note + * Possible values for parameter 'type' : + * - OCI_NUM_SHORT + * - OCI_NUM_USHORT + * - OCI_NUM_INT + * - OCI_NUM_UINT + * - OCI_NUM_BIGINT + * - OCI_NUM_BIGUINT + * - OCI_NUM_DOUBLE + * - OCI_NUM_FLOAT + * - OCI_NUM_NUMBER + * + * @return + * Return TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetStructNumericType +( + OCI_Resultset *rs, + unsigned int index, + unsigned int type +); + +/** + * @brief + * set the numeric data type of the given structure member (identified from column name in the + * resultset) to retrieve when calling OCI_GetStruct() + * + * @param rs - Resultset handle + * @param name - Column name + * @param type - Numeric type + * + * @note + * Possible values for parameter 'type' : + * - OCI_NUM_SHORT + * - OCI_NUM_USHORT + * - OCI_NUM_INT + * - OCI_NUM_UINT + * - OCI_NUM_BIGINT + * - OCI_NUM_BIGUINT + * - OCI_NUM_DOUBLE + * - OCI_NUM_FLOAT + * - OCI_NUM_NUMBER + * + * @return + * Return TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetStructNumericType2 +( + OCI_Resultset *rs, + const otext *name, + unsigned int type +); + +/** + * @brief + * Return the row columns values into a single structure + * + * @param rs - Resultset handle + * @param row_struct - pointer to user row structure + * @param row_struct_ind - pointer to user indicator structure + * + * @note + * Structure members values are contextual to the current row. + * The returned values can get out of scope when the current row + * changes when calling any OCI_FecthXXX() calls + * + * @par User row structure + * + * The user structure must have the same members than the resultset. + * Each column in the resultset must have its equivalent in the structure. + * Fields must be in the same order. + * + * The mapping rules are : + * + * - LOBs (CLOB, NCLOB, BLOB) : OCI_Lob * + * - DATE : OCI_Date * + * - TIMESTAMPS : OCI_Timestamp * + * - INTERVALS : OCI_Interval * + * - LONG, LONG RAW : OCI_Long * + * - REFs : OCI_Ref * + * - CURSOR, RESULSET : OCI_Statement * + * - OBJECTS, UDT : OCI_Object * + * - Character columns (CHAR,VARCHAR, etc..) : otext * + * - All NUMERIC types : + * - default : big_int + * - user defined (see OCI_SetStructNumericType()) + * + * The user structure pointer is not mandatory + * + * @par User row indicator structure + + * This structure must have one boolean field per column in + * the resultset and respect in the same member order. + * + * If the value of the given member is TRUE, it means the value in + * the user row structure is NOT NULL, otherwise its NULL + * + * The user indicator structure pointer is mandatory + * + * @return + * Return TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_GetStruct +( + OCI_Resultset *rs, + void *row_struct, + void *row_struct_ind +); + +/** +* @brief +* Return the current Number value of the column at the given index in the resultset +* +* @param rs - Resultset handle +* @param index - Column position +* +* @note +* Column position starts at 1. +* +* @return +* The column current row value or 0 if index is out of bounds +* +*/ +OCI_EXPORT OCI_Number * OCI_API OCI_GetNumber +( + OCI_Resultset *rs, + unsigned int index +); + +/** +* @brief +* Return the current number value of the column from its name in the resultset +* +* @param rs - Resultset handle +* @param name - Column name +* +* @note +* The column name is case insensitive +* +* @return +* The column current row value or 0 if no column found with the given name +* +*/ + +OCI_EXPORT OCI_Number * OCI_API OCI_GetNumber2 +( + OCI_Resultset *rs, + const otext *name +); + + +/** + * @brief + * Return the current short value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or 0 if index is out of bounds + * + */ + +OCI_EXPORT short OCI_API OCI_GetShort +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current short value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @note + * The column name is case insensitive + * + * @return + * The column current row value or 0 if no column found with the given name + * + */ + +OCI_EXPORT short OCI_API OCI_GetShort2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current unsigned short value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or 0 if index is out of bounds + * + */ + +OCI_EXPORT unsigned short OCI_API OCI_GetUnsignedShort +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current unsigned short value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @note + * The column name is case insensitive + * + * @return + * The column current row value or 0 if no column found with the given name + * + */ + +OCI_EXPORT unsigned short OCI_API OCI_GetUnsignedShort2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current integer value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or 0 if index is out of bounds + * + */ + +OCI_EXPORT int OCI_API OCI_GetInt +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current integer value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @note + * The column name is case insensitive + * + * @return + * The column current row value or 0 if no column found with the given name + * + */ + +OCI_EXPORT int OCI_API OCI_GetInt2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current unsigned integer value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or 0 if index is out of bounds + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetUnsignedInt +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current unsigned integer value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @note + * The column name is case insensitive + * + * @return + * The column current row value or 0 if no column found with the given name + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetUnsignedInt2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current big integer value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or 0 if index is out of bounds + * + */ + +OCI_EXPORT big_int OCI_API OCI_GetBigInt +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current big integer value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @note + * The column name is case insensitive + * + * @return + * The column current row value or 0 if no column found with the given name + * + */ + +OCI_EXPORT big_int OCI_API OCI_GetBigInt2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current unsigned big integer value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or 0 if index is out of bounds + * + */ + +OCI_EXPORT big_uint OCI_API OCI_GetUnsignedBigInt +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current unsigned big integer value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @note + * The column name is case insensitive + * + * @return + * The column current row value or 0 if no column found with the given name + * + */ + +OCI_EXPORT big_uint OCI_API OCI_GetUnsignedBigInt2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current string value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @note + * OCI_GetString() performs an implicit conversion from the + * following data types: + * + * - Numerics (based on the current connection handle numeric format) + * - Binary doubles and floats (using the standard C Library functions) + * - OCI_Number (based on the current connection handle numeric format) + * - OCI_Date (based on the current connection handle date format) + * - OCI_Timestamp (based on the current connection handle date format) + * - OCI_Interval (based on Oracle default conversion) + * - OCI_Lob (for BLOBs, output is expressed in hexadecimal) + * - OCI_Long (for BLONGs, output is expressed in hexadecimal) + * - OCI_File ("[directory]/[name]" will be output) + * - OCI_Object (Textual SQL string representation) + * - OCI_Coll (Textual SQL string representation) + * - RAW buffer (expressed in hexadecimal) + * - OCI_Statement (SQL statement string or cursor name) + * + * @return + * The column current row value or NULL if index is out of bounds + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetString +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current string value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @note + * The column name is case insensitive + * + * @return + * The column current row value or NULL if no column found with the given name + * + */ + +OCI_EXPORT const otext * OCI_API OCI_GetString2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Copy the current raw value of the column at the given index into the specified buffer + * + * @param rs - Resultset handle + * @param index - Column position + * @param buffer - Buffer that receive the raw value + * @param len - Max size of the input buffer in bytes + * + * @note + * Column position starts at 1. + * + * @return + * Number of bytes copied into the buffer on SUCCESS otherwise 0 + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetRaw +( + OCI_Resultset *rs, + unsigned int index, + void *buffer, + unsigned int len +); + +/** + * @brief + * Copy the current raw value of the column from its name into the specified buffer + * + * @param rs - Resultset handle + * @param name - Column name + * @param buffer - Buffer that receive the raw value + * @param len - Max size of the input buffer + * + * @note + * The column name is case insensitive + * + * @return + * Number of bytes copied into the buffer on SUCCESS otherwise 0 + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetRaw2 +( + OCI_Resultset *rs, + const otext *name, + void *buffer, + unsigned int len +); + +/** + * @brief + * Return the current double value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or 0.O if index is out of bounds + * + */ + +OCI_EXPORT double OCI_API OCI_GetDouble +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current double value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @note + * The column name is case insensitive + * + * @return + * The column current row value or 0.0 if no column found with the given name + * + */ + +OCI_EXPORT double OCI_API OCI_GetDouble2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current float value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or 0.O if index is out of bounds + * + */ + +OCI_EXPORT float OCI_API OCI_GetFloat +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current float value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @note + * The column name is case insensitive + * + * @return + * The column current row value or 0.0 if no column found with the given name + * + */ + +OCI_EXPORT float OCI_API OCI_GetFloat2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current date value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or NULL if index is out of bounds + * + */ + +OCI_EXPORT OCI_Date * OCI_API OCI_GetDate +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current date value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @return + * The column current row value or NULL if no column found with the given name + * + */ + +OCI_EXPORT OCI_Date * OCI_API OCI_GetDate2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current timestamp value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or NULL if index is out of bounds + * + */ + +OCI_EXPORT OCI_Timestamp * OCI_API OCI_GetTimestamp +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current timestamp value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @return + * The column current row value or NULL if no column found with the given name + * + */ + +OCI_EXPORT OCI_Timestamp * OCI_API OCI_GetTimestamp2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current interval value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or NULL if index is out of bounds + * + */ + +OCI_EXPORT OCI_Interval * OCI_API OCI_GetInterval +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current interval value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @return + * The column current row value or NULL if no column found with the given name + * + */ + +OCI_EXPORT OCI_Interval * OCI_API OCI_GetInterval2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current cursor value (Nested table) of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or NULL if index is out of bounds + * + */ + +OCI_EXPORT OCI_Statement * OCI_API OCI_GetStatement +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current cursor value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @return + * The column current row value or NULL if no column found with the given name + * + */ + +OCI_EXPORT OCI_Statement * OCI_API OCI_GetStatement2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current lob value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or NULL if index is out of bounds + * + */ + +OCI_EXPORT OCI_Lob * OCI_API OCI_GetLob +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current lob value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @return + * The column current row value or NULL if no column found with the given name + * + */ + +OCI_EXPORT OCI_Lob * OCI_API OCI_GetLob2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current File value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or NULL if index is out of bounds + * + */ + +OCI_EXPORT OCI_File * OCI_API OCI_GetFile +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current File value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @return + * The column current row value or NULL if no column found with the given name + * + */ + +OCI_EXPORT OCI_File * OCI_API OCI_GetFile2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current Object value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or NULL if index is out of bounds + * + */ + +OCI_EXPORT OCI_Object * OCI_API OCI_GetObject +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current Object value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @return + * The column current row value or NULL if no column found with the given name + * + */ + +OCI_EXPORT OCI_Object * OCI_API OCI_GetObject2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current Collection value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or NULL if index is out of bounds + * + */ + +OCI_EXPORT OCI_Coll * OCI_API OCI_GetColl +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current Collection value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @return + * The column current row value or NULL if no column found with the given name + * + */ + +OCI_EXPORT OCI_Coll * OCI_API OCI_GetColl2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current Ref value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or NULL if index is out of bounds + * + */ + +OCI_EXPORT OCI_Ref * OCI_API OCI_GetRef +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current Ref value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @return + * The column current row value or NULL if no column found with the given name + * + */ + +OCI_EXPORT OCI_Ref * OCI_API OCI_GetRef2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the current Long value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row value or NULL if index is out of bounds + * + */ + +OCI_EXPORT OCI_Long * OCI_API OCI_GetLong +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the current Long value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @return + * The column current row value or NULL if no column found with the given name + * + */ + +OCI_EXPORT OCI_Long * OCI_API OCI_GetLong2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Check if the current row value is null for the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * TRUE if it's null otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IsNull +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the size of the value of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @warning + * For binds of type OCI_CDT_TEXT (strings), the returned value is expressed in + * number of characters. + * + * @return value size of 0 if the value is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetDataSize +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @brief + * Return the size of the value of the column from its name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @warning + * For binds of type OCI_CDT_TEXT (strings), the returned value is expressed in + * number of characters. + * + * @return value size of 0 if the value is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetDataSize2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Check if the current row value is null for the column of the given name in the resultset + * + * @param rs - Resultset handle + * @param name - Column name + * + * @return + * TRUE if it's null otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IsNull2 +( + OCI_Resultset *rs, + const otext *name +); + +/** + * @brief + * Return the statement handle associated with a resultset handle + * + * @param rs - resultset handle + * + */ + +OCI_EXPORT OCI_Statement * OCI_API OCI_ResultsetGetStatement +( + OCI_Resultset *rs +); + +/** + * @brief + * Return the current row data length of the column at the given index in the resultset + * + * @param rs - Resultset handle + * @param index - Column position + * + * @note + * Column position starts at 1. + * + * @return + * The column current row data length or 0 if index is out of bounds + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetDataLength +( + OCI_Resultset *rs, + unsigned int index +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiPlSql PL/SQL Support + * @{ + * + * OCILIB has a strong PL/SQL support : + * + * - Blocks, procedures and function can be used with OCILIB statements. + * - Ref cursors + * - Nested tables + * - Tables (indexed by integer types) + * - Access to the server side output generated by the DBMS_OUTPUT package + * + * Stored procedures/functions calls, blocks declarations are done like regular + * SQL calls using OCI_Prepare(), OCI_Execute(), OCI_ExecuteStmt() and + * OCI_ExecuteStmtFmt() functions. + * + * All PL/SQL statements must: + * + * - start with a 'begin' or 'declare' keyword + * - end with a 'end;' keyword + * + * Binding Host arrays to PL/SQL tables is done with OCI_BindArrayXXX() calls + * + * @par Using a PL/SQL block with OCILIB + * @include plsql_block.c + * + * @par Binding host arrays to PL/SQL tables parameters of a stored procedure + * @include plsql_table.c + * + * @par Retrieve the output generated by the dbms_output package on the server + * @include output.c + * + */ + +/** + * @brief + * Enable the server output + * + * @param con - Connection handle + * @param bufsize - server buffer max size (server side) + * @param arrsize - number of lines to retrieve per server round-trip + * @param lnsize - maximum size of one line + * + * @note + * This call is equivalent to the command 'set serveroutput on' in SQL*PLUS + * + * @note + * 'bufsize' minimum value is 2000, maximum 1000000 with Oracle < 10.2g and can be unlimited above + * + * @note + * 'lnsize' maximum value is 255 with Oracle < 10g R2 and 32767 above + * + * @warning + * If OCI_ServerEnableOutput() is not called, OCI_ServerGetOutput() will return NULL + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ServerEnableOutput +( + OCI_Connection *con, + unsigned int bufsize, + unsigned int arrsize, + unsigned int lnsize +); + +/** + * @brief + * Disable the server output + * + * @param con - Connection handle + * + * @note + * After this call, OCI_ServerGetOutput() will return NULL. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ServerDisableOutput +( + OCI_Connection *con +); + +/** + * @brief + * Retrieve one line of the server buffer + * + * @param con - Connection handle + * + * @note + * Internally, OCILIB gets the server buffer through an array of lines in + * order to minimize round-trips with the server + * + * @return + * return a server output buffer line or NULL if the server buffer is empty + * + */ + +OCI_EXPORT const otext * OCI_API OCI_ServerGetOutput +( + OCI_Connection *con +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiCollections Oracle collections (VARRAYS and Nested Tables) + * @{ + * + * OCILIB supports all Oracle collections: + * + * - PL/SQL Tables: only available in PL/SQL, unbounded, sparse arrays of + homogeneous elements. + * - VARRAYS : available in SQL and PL/SQL, they are bounded arrays of + * homogeneous elements + * - Nested Tables: available in SQL and PL/SQL, they are unbounded arrays of + * homogeneous elements and can become sparse through deletions + * + * PL/SQL tables are implemented by binding regular C arrays with the array + * interface (using OCI_BindArrayOfXXX() calls) + * + * VARRAYS and Nested tables are implemented in OCILIB with the type OCI_Coll. + * It's possible to bind and fetch VARRAYS and Nested tables using OCI_Coll handle. + * + * It's also possible to declare local collections based on some database type without using queries + * + * OCI (and thus OCILIB) offers the possibility to access collection elements : + * + * - directly by index (OCI_CollGetElem() and OCI_CollSetElem()) + * - using an iterator (OCI_Iter) to iterate through the collection + * (OCI_IterGetNext(), OCI_IterGetPrev()) + * + * Collection Items are implemented through the type OCI_Elem and use the series + * of calls OCI_ElemGetXXX() and OCI_ElemSetXXX() to manipulate elements + * content values + * + * @par Example + * @include coll.c + * + */ + +/** + * @brief + * Create a local collection instance + * + * @param typinf - Type info handle of the collection type descriptor + * + * @return + * Return the collection object handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Coll * OCI_API OCI_CollCreate +( + OCI_TypeInfo *typinf +); + +/** + * @brief + * Free a local collection + * + * @param coll - Collection handle + * + * @warning + * Only collection created with OCI_CollCreate() should be freed + * by OCI_CollFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_CollFree +( + OCI_Coll *coll +); + +/** + * @brief + * Create an array of Collection object + * + * @param con - Connection handle + * @param typinf - Object type (type info handle) + * @param nbelem - number of elements in the array + * + * @note + * see OCI_ObjectCreate() for more details + * + * @return + * Return the Collection handle array on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Coll ** OCI_API OCI_CollArrayCreate +( + OCI_Connection *con, + OCI_TypeInfo *typinf, + unsigned int nbelem +); + +/** + * @brief + * Free an array of Collection objects + * + * @param colls - Array of Collection objects + * + * @warning + * Only arrays of Collection created with OCI_CollArrayCreate() + * should be freed by OCI_CollArrayFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_CollArrayFree +( + OCI_Coll **colls +); + +/** + * @brief + * Assign a collection to another one + * + * @param coll - Destination Collection handle + * @param coll_src - Source Collection handle + * + * @note + * Oracle proceeds to a deep copy of the collection content + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_CollAssign +( + OCI_Coll *coll, + OCI_Coll *coll_src +); + +/** + * @brief + * Return the type info object associated to the collection + * + * @param coll - Collection handle + * + */ + +OCI_EXPORT OCI_TypeInfo * OCI_API OCI_CollGetTypeInfo +( + OCI_Coll *coll +); + +/** + * @brief + * Return the collection type + * + * @param coll - Collection handle + * + * @note + * Current collection types are: + * + * - OCI_COLL_VARRAY: Oracle VARRAY + * - OCI_COLL_NESTED_TABLE: Oracle Nested Table + * + * @return + * Collection type or OCI_UNKNOWN if the collection handle is null + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_CollGetType +( + OCI_Coll *coll +); + +/** + * @brief + * Returns the maximum number of elements of the given collection. + * + * @param coll - Collection handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_CollGetMax +( + OCI_Coll *coll +); + +/** + * @brief + * Returns the total number of elements of the given collection. + * + * @param coll - Collection handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_CollGetSize +( + OCI_Coll *coll +); + +/** + * @brief + * Returns the current number of elements of the given collection. + * + * @note + * - For VARRAYs, it returns the same value than OCI_CollGetSize() as VARRAYs cannot contains holes + * - For Nested Tables that are spare collections that can have holes, it returns the total number + * of elements minus the total of deleted elements + * + * @param coll - Collection handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_CollGetCount +( + OCI_Coll *coll +); + +/** + * @brief + * Trims the given number of elements from the end of the collection + * + * @param coll - Collection handle + * @param nb_elem - Number of elements to trim + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_CollTrim +( + OCI_Coll *coll, + unsigned int nb_elem +); + +/** + * @brief + * clear all items of the given collection + * + * @param coll - Collection handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_CollClear +( + OCI_Coll *coll +); + +/** + * @brief + * Return the element at the given position in the collection + * + * @param coll - Collection handle + * @param index - Index of the destination element + * + * @note + * Collection indexes start at position 1. + * + * @return + * Element handle on success otherwise FALSE + * + */ + +OCI_EXPORT OCI_Elem * OCI_API OCI_CollGetElem +( + OCI_Coll *coll, + unsigned int index +); + +/** + * @brief + * Return the element at the given position in the collection + * + * @param coll - Collection handle + * @param index - Index of the destination element + * @param elem - Element handle to hold the collection item data + * + * @note + * Collection indexes start at position 1. + * + * @return + * Element handle on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_CollGetElem2 +( + OCI_Coll *coll, + unsigned int index, + OCI_Elem *elem +); + +/** + * @brief + * Assign the given element value to the element at the given position in + * the collection + * + * @param coll - Collection handle + * @param index - Index of the destination element + * @param elem - Source element handle to assign + * + * @note + * Collection indexes start at position 1. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_CollSetElem +( + OCI_Coll *coll, + unsigned int index, + OCI_Elem *elem +); + +/** + * @brief + * Append the given element at the end of the collection + * + * @param coll - Collection handle + * @param elem - Element handle to add + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_CollAppend +( + OCI_Coll *coll, + OCI_Elem *elem +); + +/** + * @brief + * Convert a collection handle value to a string + * + * @param coll - Collection handle + * @param size - Destination string length pointer in characters + * @param str - Destination string + * + * @note + * In order to compute the needed string length, call the method with a NULL string + * Then call the method again with a valid buffer + * + * @note + * The resulting string is similar to the SQL*PLUS output for collections + * For RAWs and BLOBs attributes, their binary values are converted to hexadecimal strings + * + * @warning + * This convenient method shall not be used when performance matters. It is usually called twice (buffer length + * computation) and must also care about quotes within strings. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_CollToText +( + OCI_Coll *coll, + unsigned int *size, + otext *str +); + +/** + * @brief + * Delete the element at the given position in the Nested Table Collection + * + * @param coll - Collection handle + * @param index - Index of the element to delete + * + * @note + * Collection indexes start at position 1. + * + * @warning + * OCI_CollDeleteElem() is only valid for nested tables. + * + * @return + * - if the input collection is a nested table, it returns TRUE if the element + * is successfully deleted otherwise FALSE on error + * - if the input collection is a VARRAY, it always returns FALSE without spawning an exception + * + */ + +OCI_EXPORT boolean OCI_API OCI_CollDeleteElem +( + OCI_Coll *coll, + unsigned int index +); + +/** + * @brief + * Create an iterator handle to iterate through a collection + * + * @param coll - Collection handle + * + * @return + * Return the iterator handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Iter * OCI_API OCI_IterCreate +( + OCI_Coll *coll +); + +/** + * @brief + * Free an iterator handle + * + * @param iter - Iterator handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IterFree +( + OCI_Iter *iter +); + +/** + * @brief + * Get the next element in the collection + * + * @param iter - Iterator handle + * + * @return + * Element handle on success otherwise NULL if: + * - Empty collection + * - Iterator already positioned on the last collection element + * - An error occurred + * + */ + +OCI_EXPORT OCI_Elem * OCI_API OCI_IterGetNext +( + OCI_Iter *iter +); + +/** + * @brief + * Get the previous element in the collection + * + * @param iter - Iterator handle + * + * @return + * Element handle on success otherwise NULL if: + * - Empty collection + * - Iterator already positioned on the last collection element + * - An error occurred + * + */ + +OCI_EXPORT OCI_Elem * OCI_API OCI_IterGetPrev +( + OCI_Iter *iter +); + +/** + * @brief + * Get the current element in the collection + * + * @param iter - Iterator handle + * + * @return + * Element handle on success otherwise NULL if: + * - Empty collection + * - Iterator already positioned on the last collection element + * - An error occurred + * + */ + +OCI_EXPORT OCI_Elem * OCI_API OCI_IterGetCurrent +( + OCI_Iter *iter +); + +/** + * @brief + * Create a local collection element instance based on a collection type + * descriptor + * + * @param typinf - Type info handle + * + * @return + * Return the collection element handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Elem * OCI_API OCI_ElemCreate +( + OCI_TypeInfo *typinf +); + +/** + * @brief + * Free a local collection element + * + * @param elem - Element handle + * + * @warning + * Only element created with OCI_ElemCreate() should be freed + * by OCI_ElemFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemFree +( + OCI_Elem *elem +); + +/** +* @brief +* Return the boolean value of the given collection element +* +* @param elem - Element handle +* +* @warning +* OCI_ElemGetBoolean() returns a valid value only for collection elements of PL/SQL boolean type +* +* @return +* boolean value or FALSE on failure +* +*/ + +OCI_EXPORT boolean OCI_API OCI_ElemGetBoolean +( + OCI_Elem *elem +); + +/** +* @brief +* Return the number value of the given collection element +* +* @param elem - Element handle +* +* @return +* number handle or NULL on failure +* +*/ + +OCI_EXPORT OCI_Number* OCI_API OCI_ElemGetNumber +( + OCI_Elem *elem +); + +/** + * @brief + * Return the short value of the given collection element + * + * @param elem - Element handle + * + * @return + * Short value or 0 on failure + * + */ + +OCI_EXPORT short OCI_API OCI_ElemGetShort +( + OCI_Elem *elem +); + +/** + * @brief + * Return the unsigned short value of the given collection element + * + * @param elem - Element handle + * + * @return + * Unsigned short value or 0 on failure + * + */ + +OCI_EXPORT unsigned short OCI_API OCI_ElemGetUnsignedShort +( + OCI_Elem *elem +); + +/** + * @brief + * Return the int value of the given collection element + * + * @param elem - Element handle + * + * @return + * Int value or 0 on failure + * + */ + +OCI_EXPORT int OCI_API OCI_ElemGetInt +( + OCI_Elem *elem +); + +/** + * @brief + * Return the unsigned int value of the given collection element + * + * @param elem - Element handle + * + * @return + * Unsigned int value or 0 on failure + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_ElemGetUnsignedInt +( + OCI_Elem *elem +); + +/** + * @brief + * Return the big int value of the given collection element + * + * @param elem - Element handle + * + * @return + * Big int value or 0 on failure + * + */ + +OCI_EXPORT big_int OCI_API OCI_ElemGetBigInt +( + OCI_Elem *elem +); + +/** + * @brief + * Return the unsigned big int value of the given collection element + * + * @param elem - Element handle + * + * @return + * Unsigned big int value or 0 on failure + * + */ + +OCI_EXPORT big_uint OCI_API OCI_ElemGetUnsignedBigInt +( + OCI_Elem *elem +); + +/** + * @brief + * Return the Double value of the given collection element + * + * @param elem - Element handle + * + * @return + * Double value or 0 on failure + * + */ + +OCI_EXPORT double OCI_API OCI_ElemGetDouble +( + OCI_Elem *elem +); + +/** + * @brief + * Return the float value of the given collection element + * + * @param elem - Element handle + * + * @return + * Double value or 0 on failure + * + */ + +OCI_EXPORT float OCI_API OCI_ElemGetFloat +( + OCI_Elem *elem +); + +/** + * @brief + * Return the String value of the given collection element + * + * @param elem - Element handle + * + * @return + * String value or NULL on failure + * + */ + +OCI_EXPORT const otext * OCI_API OCI_ElemGetString +( + OCI_Elem *elem +); + +/** + * @brief + * Read the RAW value of the collection element into the given buffer + * + * @param elem - Element handle + * @param value - Buffer to store the RAW value + * @param len - Size of the buffer + * + * @return + * Number of bytes read from the RAW value or 0 on failure + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_ElemGetRaw +( + OCI_Elem *elem, + void *value, + unsigned int len +); + +/** +* @brief +* Return the raw attribute value size of the given element handle +* +* @param elem - Element handle +* +* @return +* size in bytes of the RAW value or 0 on failure or wrong attribute type +* +*/ + +OCI_EXPORT unsigned int OCI_API OCI_ElemGetRawSize +( + OCI_Elem *elem +); + +/** + * @brief + * Return the Date value of the given collection element + * + * @param elem - Element handle + * + * @return + * Date handle or NULL on failure + * + */ + +OCI_EXPORT OCI_Date * OCI_API OCI_ElemGetDate +( + OCI_Elem *elem +); + +/** + * @brief + * Return the Timestamp value of the given collection element + * + * @param elem - Element handle + * + * @return + * Timestamp handle or NULL on failure + * + */ + +OCI_EXPORT OCI_Timestamp * OCI_API OCI_ElemGetTimestamp +( + OCI_Elem *elem +); + +/** + * @brief + * Return the Interval value of the given collection element + * + * @param elem - Element handle + * + * @return + * Interval handle or NULL on failure + * + */ + +OCI_EXPORT OCI_Interval * OCI_API OCI_ElemGetInterval +( + OCI_Elem *elem +); + +/** + * @brief + * Return the Lob value of the given collection element + * + * @param elem - Element handle + * + * @return + * Lob handle or NULL on failure + * + */ + +OCI_EXPORT OCI_Lob * OCI_API OCI_ElemGetLob +( + OCI_Elem *elem +); + +/** + * @brief + * Return the File value of the given collection element + * + * @param elem - Element handle + * + * @return + * File handle or NULL on failure + * + */ + +OCI_EXPORT OCI_File * OCI_API OCI_ElemGetFile +( + OCI_Elem *elem +); + +/** + * @brief + * Return the object value of the given collection element + * + * @param elem - Element handle + * + * @return + * Object handle or NULL on failure + * + */ + +OCI_EXPORT OCI_Object * OCI_API OCI_ElemGetObject +( + OCI_Elem *elem +); + +/** + * @brief + * Return the collection value of the given collection element + * + * @param elem - Element handle + * + * @return + * Collection handle or NULL on failure + * + */ + +OCI_EXPORT OCI_Coll * OCI_API OCI_ElemGetColl +( + OCI_Elem *elem +); + +/** + * @brief + * Return the Ref value of the given collection element + * + * @param elem - Element handle + * + * @return + * Ref handle or NULL on failure + * + */ + +OCI_EXPORT OCI_Ref * OCI_API OCI_ElemGetRef +( + OCI_Elem *elem +); + +/** +* @brief +* Set a boolean value to a collection element +* +* @param elem - Element handle +* @param value - Short value +* +* @warning +* OCI_ElemSetBoolean() is only valid value only for collection elements of PL / SQL boolean type +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_ElemSetBoolean +( + OCI_Elem *elem, + boolean value +); + +/** +* @brief +* Set a number value to a collection element +* +* @param elem - Element handle +* @param value - number value +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_ElemSetNumber +( + OCI_Elem *elem, + OCI_Number *value +); + +/** + * @brief + * Set a short value to a collection element + * + * @param elem - Element handle + * @param value - Short value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetShort +( + OCI_Elem *elem, + short value +); + +/** + * @brief + * Set a unsigned short value to a collection element + * + * @param elem - Element handle + * @param value - Unsigned short value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedShort +( + OCI_Elem *elem, + unsigned short value +); + +/** + * @brief + * Set a int value to a collection element + * + * @param elem - Element handle + * @param value - Int value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetInt +( + OCI_Elem *elem, + int value +); + +/** + * @brief + * Set a unsigned int value to a collection element + * + * @param elem - Element handle + * @param value - Unsigned int value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedInt +( + OCI_Elem *elem, + unsigned int value +); + +/** + * @brief + * Set a big int value to a collection element + * + * @param elem - Element handle + * @param value - big int value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetBigInt +( + OCI_Elem *elem, + big_int value +); + +/** + * @brief + * Set a unsigned big_int value to a collection element + * + * @param elem - Element handle + * @param value - Unsigned big int value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedBigInt +( + OCI_Elem *elem, + big_uint value +); + +/** + * @brief + * Set a double value to a collection element + * + * @param elem - Element handle + * @param value - Double value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetDouble +( + OCI_Elem *elem, + double value +); + +/** + * @brief + * Set a float value to a collection element + * + * @param elem - Element handle + * @param value - float value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetFloat +( + OCI_Elem *elem, + float value +); + +/** + * @brief + * Set a string value to a collection element + * + * @param elem - Element handle + * @param value - String value + * + * @note + * passing a null pointer for value calls OCI_ElemSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetString +( + OCI_Elem *elem, + const otext *value +); + +/** + * @brief + * Set a RAW value to a collection element + * + * @param elem - Element handle + * @param value - Raw value + * @param len - Size of the raw value + * + * @note + * passing a null pointer for value calls OCI_ElemSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetRaw +( + OCI_Elem *elem, + void *value, + unsigned int len +); + +/** + * @brief + * Assign a Date handle to a collection element + * + * @param elem - Element handle + * @param value - Date Handle + * + * @note + * passing a null pointer for value calls OCI_ElemSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetDate +( + OCI_Elem *elem, + OCI_Date *value +); + +/** + * @brief + * Assign a Timestamp handle to a collection element + * + * @param elem - Element handle + * @param value - Timestamp Handle + * + * @note + * passing a null pointer for value calls OCI_ElemSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetTimestamp +( + OCI_Elem *elem, + OCI_Timestamp *value +); + +/** + * @brief + * Assign an Interval handle to a collection element + * + * @param elem - Element handle + * @param value - Interval Handle + * + * @note + * passing a null pointer for value calls OCI_ElemSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetInterval +( + OCI_Elem *elem, + OCI_Interval *value +); + +/** + * @brief + * Assign a Collection handle to a collection element + * + * @param elem - Element handle + * @param value - Collection Handle + * + * @note + * passing a null pointer for value calls OCI_ElemSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetColl +( + OCI_Elem *elem, + OCI_Coll *value +); + +/** + * @brief + * Assign an Object handle to a collection element + * + * @param elem - Element handle + * @param value - Object Handle + * + * @warning + * This function assigns a copy of the object to the given attribute. + * Any further modifications of the object passed as the parameter 'value' + * will not be reflected to object 's attribute set with this call + * + * @note + * passing a null pointer for value calls OCI_ElemSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetObject +( + OCI_Elem *elem, + OCI_Object *value +); + +/** + * @brief + * Assign a Lob handle to a collection element + * + * @param elem - Element handle + * @param value - Lob Handle + * + * @note + * passing a null pointer for value calls OCI_ElemSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetLob +( + OCI_Elem *elem, + OCI_Lob *value +); + +/** + * @brief + * Assign a File handle to a collection element + * + * @param elem - Element handle + * @param value - File Handle + * + * @note + * passing a null pointer for value calls OCI_ElemSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetFile +( + OCI_Elem *elem, + OCI_File *value +); + +/** + * @brief + * Assign a Ref handle to a collection element + * + * @param elem - Element handle + * @param value - Ref Handle + * + * @note + * passing a null pointer for value calls OCI_ElemSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetRef +( + OCI_Elem *elem, + OCI_Ref *value +); + +/** + * @brief + * Check if the collection element value is null + * + * @param elem - Element handle + * + * @return + * TRUE if it's null otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemIsNull +( + OCI_Elem *elem +); + +/** + * @brief + * Set a collection element value to null + * + * @param elem - Element handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ElemSetNull +( + OCI_Elem *elem +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiFeatureReturningInto Oracle Returning feature + * @{ + * + * OCILIB supports the Oracle feature 'Returning into' for DML statements. + * + * Let's Oracle talk about this features: + * + * @par + * 'Using the RETURNING clause with a DML statement allows you to essentially + * combine two SQL statements into one, possibly saving you a server round-trip. + * This is accomplished by adding an extra clause to the traditional UPDATE, + * INSERT, and DELETE statements. The extra clause effectively adds a query to + * the DML statement. In the OCI, the values are returned to the application + * through the use of OUT bind variables.' + * + * OCILIB implements this features by providing a set of functions that allows + * to register output placeholders for the returned values. + * Once the DML is executed with OCI_Execute(), the output returned data is + * available through a regular resultset object that can be fetched. + * + * @note + * Array binding interface is also supported with 'returning into' DML statement. + * Every iteration (or row of given arrays) generates an resultset object. + * Once a resultset is fetched, the next on can be retrieved with OCI_GetNextResultset() + * + * @par + * + * @note + * OCI_Long are not supported for 'returning into' clause .This is a limitation imposed by Oracle. + * + * @note + * OCI_Column objects retrieved from output OCI_Resultset have the following + * particularities: + * + * - their names are the provided bind names to the DML statement + * (by example, ':out1'). So any call to the functions OCI_GetXXX2() + * should be aware of it + * - The columns detailed SQL attributes might be not all set or accurate. By + * example, the scale and precision are not set, the SQL type is the one + * chosen by OCILIB regarding the OCILIB object data type and might be + * slightly different from the real one. + * + * @par Example + * @include returning.c + * + */ + +/** + * @brief + * Retrieve the next available resultset + * + * @param stmt - Statement handle + * + * @note + * it is only valid for the following statements: + * - Statements executing SQL UPDATE/DELETE using a RETURNING INTO clause + * - Statements implicitly returned from PL/SQL procedure or blocks (new feature in Oracle 12cR1) using + * DBMS_SQL.RETURN_RESULT() + * + * @note + * SQL statements with a 'returning' clause can return multiple resultsets. + * When arrays of program variables are binded to the statement, Oracle will + * execute the statement for every row (iteration). + * Each iteration generates a resultset that can be fetched like regular ones. + * + * @note + * Starting withOracle 12cR1, PL/SQ procedure and blocks ca return multiple implicit resultsets + * Refer to Oracle documentation for more information. + * + * @return + * A resultset handle on success otherwise NULL + * + */ + +OCI_EXPORT OCI_Resultset * OCI_API OCI_GetNextResultset +( + OCI_Statement *stmt +); + +/** +* @brief +* Register a register output bind placeholder +* +* @param stmt - Statement handle +* @param name - Output bind name +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_RegisterNumber +( + OCI_Statement *stmt, + const otext *name +); + +/** + * @brief + * Register a short output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterShort +( + OCI_Statement *stmt, + const otext *name +); + +/** + * @brief + * Register an unsigned short output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterUnsignedShort +( + OCI_Statement *stmt, + const otext *name +); + +/** + * @brief + * Register an integer output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterInt +( + OCI_Statement *stmt, + const otext *name +); + +/** + * @brief + * Register an unsigned integer output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterUnsignedInt +( + OCI_Statement *stmt, + const otext *name +); + +/** + * @brief + * Register a big integer output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterBigInt +( + OCI_Statement *stmt, + const otext *name +); + +/** + * @brief + * Register an unsigned big integer output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterUnsignedBigInt +( + OCI_Statement *stmt, + const otext *name +); + +/** + * @brief + * Register a string output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * @param len - Max length of single string (in characters) + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterString +( + OCI_Statement *stmt, + const otext *name, + unsigned int len +); + +/** + * @brief + * Register an raw output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * @param len - Max length of the buffer (in bytes) + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterRaw +( + OCI_Statement *stmt, + const otext *name, + unsigned int len +); + +/** + * @brief + * Register a double output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterDouble +( + OCI_Statement *stmt, + const otext *name +); + +/** + * @brief + * Register a float output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterFloat +( + OCI_Statement *stmt, + const otext *name +); + +/** + * @brief + * Register a date output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterDate +( + OCI_Statement *stmt, + const otext *name +); + +/** + * @brief + * Register a timestamp output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * @param type - Timestamp type + * + * @note + * See OCI_TimestampCreate() for possible values of parameter 'type' + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterTimestamp +( + OCI_Statement *stmt, + const otext *name, + unsigned int type +); + +/** + * @brief + * Register an interval output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * @param type - Interval type + * + * @note + * See OCI_IntervalCreate() for possible values of parameter 'type' + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterInterval +( + OCI_Statement *stmt, + const otext *name, + unsigned int type +); + +/** + * @brief + * Register an object output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * @param typinf - Type info handle + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterObject +( + OCI_Statement *stmt, + const otext *name, + OCI_TypeInfo *typinf +); + +/** + * @brief + * Register a lob output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * @param type - Lob type + * + * @note + * See OCI_LobCreate() for possible values of parameter 'type' + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterLob +( + OCI_Statement *stmt, + const otext *name, + unsigned int type +); + +/** + * @brief + * Register a file output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * @param type - File type + * + * @note + * See OCI_FileCreate() for possible values of parameter 'type' + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterFile +( + OCI_Statement *stmt, + const otext *name, + unsigned int type +); + +/** + * @brief + * Register a Ref output bind placeholder + * + * @param stmt - Statement handle + * @param name - Output bind name + * @param typinf - Type info handle + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_RegisterRef +( + OCI_Statement *stmt, + const otext *name, + OCI_TypeInfo *typinf +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiRowIds Oracle Rowids + * @{ + * + * OCILIB supports the Oracle ROWID type through C scalar string types (otext). + * + * - ROWIDs can be retrieved from resultset with OCI_GetString() + * - ROWIDs can be binded to statements with OCI_BindString() + * + * The maximum size of an ROWID buffer is defined by the constant OCI_SIZE_ROWID + * + * @par Example + * @include rowid.c + * + * @} + */ + +/** + * @defgroup OcilibCApiStatementControl Statements control + * @{ + * + * Those functions give extra information about OCILIB statements and can modify their behavior. + * + */ + +/** + * @brief + * Return the type of a SQL statement + * + * @param stmt - Statement handle + * + * @note + * Possible values are : + * + * - OCI_CST_SELECT : select statement + * - OCI_CST_UPDATE : update statement + * - OCI_CST_DELETE : delete statement + * - OCI_CST_INSERT : insert statement + * - OCI_CST_CREATE : create statement + * - OCI_CST_DROP : drop statement + * - OCI_CST_ALTER : alter statement + * - OCI_CST_BEGIN : begin (pl/sql) statement + * - OCI_CST_DECLARE : declare (pl/sql) statement + * - OCI_CST_CALL : kpu call + * - OCI_CST_MERGE : merge statement + * + * @return + * The statement type on success or OCI_UNKOWN on error + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetStatementType +( + OCI_Statement *stmt +); + +/** + * @brief + * Set the fetch mode of a SQL statement + * + * @param stmt - Statement handle + * @param mode - fetch mode value + * + * @warning + * OCI_SetFetchMode() MUST be called before any OCI_ExecuteXXX() call + * + * @note + * Possible values are : + * - OCI_SFM_DEFAULT + * - OCI_SFM_SCROLLABLE + * + * @warning + * if Oracle Client is 9iR1: + * - when setting OCI_SFM_SCROLLABLE, OCI_SetPrefetch() is internally called with value 0 + * to disable prefetching (to avoid an oracle bug). + * - when re-setting OCI_SFM_DEFAULT after having set OCI_SFM_SCROLLABLE, OCI_SetPrefetch() + * is internally called with value OCI_PREFETCH_SIZE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetFetchMode +( + OCI_Statement *stmt, + unsigned int mode +); + +/** + * @brief + * Return the fetch mode of a SQL statement + * + * @param stmt - Statement handle + * + * @note + * See OCI_SetFetchMode() for possible values + * Default value is OCI_SFM_DEFAULT + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetFetchMode +( + OCI_Statement *stmt +); + +/** + * @brief + * Set the binding mode of a SQL statement + * + * @param stmt - Statement handle + * @param mode - binding mode value + * + * @note + * Possible values are : + * - OCI_BIND_BY_POS : position binding + * - OCI_BIND_BY_NAME : name binding + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetBindMode +( + OCI_Statement *stmt, + unsigned int mode +); + +/** + * @brief + * Return the binding mode of a SQL statement + * + * @param stmt - Statement handle + * + * @note + * See OCI_SetBindMode() for possible values + * Default value is OCI_BIND_BY_NAME + * + * @note + * if stmt is NULL, the return value is OCI_UNKNOWN + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetBindMode +( + OCI_Statement *stmt +); + +/** + * @brief + * Set the current bind allocation mode that will be used for subsequent binding calls + * + * @param stmt - Statement handle + * @param mode - bind allocation mode value + * + * @note + * Possible values are : + * - OCI_BAM_EXTERNAL : bind variable are allocated by user code + * - OCI_BAM_INTERNAL : bind variable are allocated internally + * + * @warning + * This call has to be made after preparing a statement as OCI_Prepare() reset it by default to OCI_BAM_EXTERNAL. + * When calling an OCI_BindXXXX() call, this value is used and stored in the OCI_Bind object created during the bind call. + * Each bind can have is own allocation mode that is returned by OCI_BindGetAllocationMode() + * OCI_SetBindAllocation() can be called before each binding call if needed, resulting having some bind allocated externally and other ones internally. + * + * @note + * Refer to the section "Binding variables and arrays" of the documentation about allocation mode as OCI_BAM_INTERNAL is not compatible with all bind calls + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetBindAllocation +( + OCI_Statement *stmt, + unsigned int mode +); + +/** + * @brief + * Return the current bind allocation mode used for subsequent binding calls + * + * @param stmt - Statement handle + * + * @note + * See OCI_SetBindAllocation() for possible values + * Default value is OCI_BAM_EXTERNAL + * + * @warning + * Each OCI_Bind object has its own allocation mode that may differ from the one returned by OCI_GetBindAllocation() + * The return value of OCI_GetBindAllocation() is the mode that will be used for any subsequent OCI_BindXXXX() calls + * + * @note + * if stmt is NULL, the return value is OCI_UNKNOWN + * + */ +OCI_EXPORT unsigned int OCI_API OCI_GetBindAllocation +( + OCI_Statement *stmt +); + +/** + * @brief + * Set the number of rows fetched per internal server fetch call + * + * @param stmt - Statement handle + * @param size - number of rows to fetch + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetFetchSize +( + OCI_Statement *stmt, + unsigned int size +); + +/** + * @brief + * Return the number of rows fetched per internal server fetch call + * + * @param stmt - Statement handle + * + * @note + * Default value is set to constant OCI_FETCH_SIZE + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetFetchSize +( + OCI_Statement *stmt +); + +/** + * @brief + * Set the number of rows pre-fetched by OCI Client + * + * @param stmt - Statement handle + * @param size - number of rows to pre-fetch + * + * @note + * To turn off pre-fetching, set both attributes (size and memory) to 0. + * + * @warning + * Prefetch is not working with scrollable cursors in Oracle 9iR1 + * In that case, argument 'size' is not used and replace by 0. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetPrefetchSize +( + OCI_Statement *stmt, + unsigned int size +); + +/** + * @brief + * Return the number of rows pre-fetched by OCI Client + * + * @param stmt - Statement handle + * + * @note + * Default value is set to constant OCI_PREFETCH_SIZE + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetPrefetchSize +( + OCI_Statement *stmt +); + +/** + * @brief + * Set the amount of memory pre-fetched by OCI Client + * + * @param stmt - Statement handle + * @param size - amount of memory to fetch + * + * @note + * Default value is 0 and the pre-fetch size attribute is used instead. + * When both attributes are set (pre-fetch size and memory) and pre-fetch memory + * value can hold more rows than specified by pre-fetch size, OCI uses pre-fetch + * size instead. + * + * @note + * OCILIB set pre-fetch attribute to OCI_PREFETCH_SIZE when a statement is created. + * To setup a big value for OCI_SetPrefetchMemory(), you must call + * OCI_SetPrefetchSize() to 0 to make OCI consider this attribute. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetPrefetchMemory +( + OCI_Statement *stmt, + unsigned int size +); + +/** + * @brief + * Return the amount of memory used to retrieve rows pre-fetched by OCI Client + * + * @param stmt - Statement handle + * + * @note + * Default value is 0 + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetPrefetchMemory +( + OCI_Statement *stmt +); + +/** + * @brief + * Set the LONG data type piece buffer size + * + * @param stmt - Statement handle + * @param size - maximum size for long buffer + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SetLongMaxSize +( + OCI_Statement *stmt, + unsigned int size +); + +/** + * @brief + * Return the LONG data type piece buffer size + * + * @param stmt - Statement handle + * + * @note + * Default value is set to constant OCI_SIZE_LONG + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetLongMaxSize +( + OCI_Statement *stmt +); + +/** + * @brief + * Set the long data type handling mode of a SQL statement + * + * @param stmt - Statement handle + * @param mode - long mode value + * + * @note + * Possible values are : + * + * - OCI_LONG_EXPLICIT : LONGs are explicitly handled by OCI_Long type + * - OCI_LONG_IMPLICIT : LONGs are implicitly mapped to string type in the + * limits of VARCHAR2 size capacity + * + * LONG RAWs cannot be handled with OCI_LONG_IMPLICIT + */ + +OCI_EXPORT boolean OCI_API OCI_SetLongMode +( + OCI_Statement *stmt, + unsigned int mode +); + +/** + * @brief + * Return the long data type handling mode of a SQL statement + * + * @param stmt - Statement handle + * + * @note + * See OCI_SetLongMode() for possible values + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_GetLongMode +( + OCI_Statement *stmt +); + +/** + * @brief + * Return the connection handle associated with a statement handle + * + * @param stmt - Statement handle + * + */ + +OCI_EXPORT OCI_Connection * OCI_API OCI_StatementGetConnection +( + OCI_Statement *stmt +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiLobs Internal Large Objects (LOBs) + * @{ + * + * Large Objects (LOBs) were introduced with Oracle 8i to replace LONGs + * + * Oracle OCI supplies a set APIs to manipulate this data type. + * + * OCILIB encapsulates this API by supplying: + * + * - An OCI_Lob C type + * - A set of really easy APIs to manipulate OCI_Lob objects + * + * OCILIB currently supports 3 types of Lobs : + * + * - BLOB : Binary LOBs (replacement for LONG RAW data type) + * - CLOB : Character LOBs (replacement for LONG data type) + * - NCLOB : National Character LOBs + * + * OCI_Lob objects can be : + * + * - Created as standalone instances + * - Used for in/out binding + * - Retrieved from select statements + * - Manipulated (copy, append, ...) + * + * @par Lobs > 4 Go + * + * Oracle 10g extended lobs by increasing maximum size from 4Go to 128 To. + * + * OCILIB, with version 2.1.0, supports now this new limit. + * For handling sizes and offsets up to 128 To, 64 bit integers are requested. + * + * So, A new scalar integer type has been introduced: big_uint (elderly lobsize_t). + * This type can be a 32 bits or 64 bits integer depending on : + * - Compiler support for 64 bits integers (C99 compiler, MS compilers) + * - Oracle client version + * + * big_uint will be a 64 bits integer : + * - if the compiler supports it + * - if OCILIB is build with option OCI_IMPORT_LINKAGE and the Oracle version is >= 10.1 + * - or OCILIB is build with option OCI_IMPORT_RUNTIME (oracle version is not known at + * compilation stage) + * + * @par Example + * @include lob.c + * + */ + +/** + * @brief + * Create a local temporary Lob instance + * + * @param con - Connection handle + * @param type - Lob type + * + * Supported lob types : + * + * - OCI_BLOB : Binary Lob + * - OCI_CLOB : Character Lob + * - OCI_NCLOB ! National Character Lob + * + * @return + * Return the lob handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Lob * OCI_API OCI_LobCreate +( + OCI_Connection *con, + unsigned int type +); + +/** + * @brief + * Free a local temporary lob + * + * @param lob - Lob handle + * + * @warning + * Only lobs created with OCI_LobCreate() should be freed by OCI_LobFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobFree +( + OCI_Lob *lob +); + +/** + * @brief + * Create an array of lob object + * + * @param con - Connection handle + * @param type - Lob type + * @param nbelem - number of elements in the array + * + * @note + * see OCI_LobCreate() for more details + * + * @return + * Return the lob handle array on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Lob ** OCI_API OCI_LobArrayCreate +( + OCI_Connection *con, + unsigned int type, + unsigned int nbelem +); + +/** +* @brief +* Free an array of lob objects +* +* @param lobs - Array of lob objects +* +* @warning +* Only arrays of lobs created with OCI_LobArrayCreate() should be freed +* by OCI_LobArrayFree() +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_LobArrayFree +( + OCI_Lob **lobs +); + +/** + * @brief + * Return the type of the given Lob object + * + * @param lob - Lob handle + * + * @note + * For possible values, see OCI_LobCreate() + * + * @return + * Object type or OCI_UNKNOWN the input handle is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_LobGetType +( + OCI_Lob *lob +); + +/** + * @brief + * Perform a seek operation on the OCI_lob content buffer + * + * @param lob - Lob handle + * @param offset - Offset from current position (bytes or characters) + * @param mode - Seek mode + * + * Parameter 'mode' can be one of the following value : + * + * - OCI_SEEK_SET : set the lob current offset to the given absolute offset + * - OCI_SEEK_END : set the lob current offset to the end of the lob + * - OCI_SEEK_CUR : move the lob current offset to the number of bytes or + * characters given by parameter 'offset' + * + * @note + * - For CLOB and CLOB, offset in characters + * - For BLOB and BFILE, offset is in bytes + * + * @note + * Position in the Lob buffer starts at 0. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobSeek +( + OCI_Lob *lob, + big_uint offset, + unsigned int mode +); + +/** + * @brief + * Return the current position in the Lob content buffer + * + * @param lob - Lob handle + * + * @return + * Lob position (starting with 0) or 0 on failure + */ + +OCI_EXPORT big_uint OCI_API OCI_LobGetOffset +( + OCI_Lob *lob +); + +/** + * @brief + * [OBSOLETE] Read a portion of a lob into the given buffer + * + * @param lob - Lob handle + * @param buffer - Pointer to a buffer + * @param len - Length of the buffer (in bytes or characters) + * + * @note + * Length is expressed in : + * - Bytes for BLOBs + * - Characters for CLOBs/NCLOBS + * + * @warning + * This call is obsolete ! Use OCI_LobRead2() instead. + * + * @return + * Number of bytes/characters read on success otherwise 0 on failure + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_LobRead +( + OCI_Lob *lob, + void *buffer, + unsigned int len +); + +/** + * @brief + * Read a portion of a lob into the given buffer + * + * @param lob - Lob handle + * @param buffer - Pointer to a buffer + * @param char_count - [in/out] Pointer to maximum number of characters + * @param byte_count - [in/out] Pointer to maximum number of bytes + * + * @note + * In input, 'char_count' and 'byte_count' are values to read into the buffer + * In output, 'char_count' and 'byte_count' are values read into the buffer + * + * @note + * For BLOBs, only the parameter 'byte_count' is used + * For CLOBs, both parameters can be used : + * In input : + * - if 'byte_count' is set to zero, it is computed from 'char_count' + * - if 'char_count' is set to zero, it is computed from 'byte_count' + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobRead2 +( + OCI_Lob *lob, + void *buffer, + unsigned int *char_count, + unsigned int *byte_count +); + +/** + * @brief + * [OBSOLETE] Write a buffer into a LOB + * + * @param lob - Lob handle + * @param buffer - Pointer to a buffer + * @param len - Length of the buffer (in bytes or characters) + * + * @note + * Length is expressed in : + * - Bytes for BLOBs + * - Characters for CLOBs/NCLOBs + * + * @warning + * This call is obsolete ! Use OCI_LobWrite2() instead. + * + * @return + * Number of bytes / characters written on success otherwise 0 on failure + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_LobWrite +( + OCI_Lob *lob, + void *buffer, + unsigned int len +); + +/** + * @brief + * Write a buffer into a LOB + * + * @param lob - Lob handle + * @param buffer - Pointer to a buffer + * @param char_count - [in/out] Pointer to maximum number of characters + * @param byte_count - [in/out] Pointer to maximum number of bytes + * + * @note + * In input, 'char_count' and 'byte_count' are values to write from the buffer + * In output, 'char_count' and 'byte_count' are values written from the buffer + * + * @note + * For BLOBs, only the parameter 'byte_count' is used + * For CLOBs, both parameters can be used : + * In input : + * - if 'byte_count' is set to zero, it is computed from 'char_count' + * - if 'char_count' is set to zero, it is computed from 'byte_count' + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobWrite2 +( + OCI_Lob *lob, + void *buffer, + unsigned int *char_count, + unsigned int *byte_count +); + +/** + * @brief + * Truncate the given lob to a shorter length + * + * @param lob - Lob handle + * @param size - New length (in bytes or characters) + * + * @note + * Length is expressed in : + * - Bytes for BLOBs + * - Characters for CLOBs/NCLOBs + * + * @note + * If current offset was beyond the new size, it is then updated to an eof position in order for further write calls to append data + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobTruncate +( + OCI_Lob *lob, + big_uint size +); + +/** + * @brief + * Return the actual length of a lob + * + * @param lob - Lob handle + * + * @note + * The returned value is in bytes for BLOBS and characters for CLOBS/NCLOBs + * + */ + +OCI_EXPORT big_uint OCI_API OCI_LobGetLength +( + OCI_Lob *lob +); + +/** + * @brief + * Returns the chunk size of a LOB + * + * @param lob - Lob handle + * + * @note + * This chunk size corresponds to the chunk size used by the LOB data layer + * when accessing and modifying the LOB value. According to Oracle + * documentation, performance will be improved if the application issues + * read or write requests using a multiple of this chunk size + * + * @note + * The returned value is in bytes for BLOBS and characters for CLOBS/NCLOBs + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_LobGetChunkSize +( + OCI_Lob *lob +); + +/** + * @brief + * Erase a portion of the lob at a given position + * + * @param lob - Lob handle + * @param offset - Absolute position in source lob + * @param len - Number of bytes or characters to erase + * + * @note + * Absolute position starts at 0. + * Erasing means "overwriting" the range of values at the given offset with: + * - spaces for CLOB/NCLOB + * - 'zero' bytes for BLOB + * + * @return + * Number of bytes (BLOB) or characters (CLOB/NCLOB) erased on success + * otherwise 0 on failure + * + */ + +OCI_EXPORT big_uint OCI_API OCI_LobErase +( + OCI_Lob *lob, + big_uint offset, + big_uint len +); + +/** + * @brief + * Append a buffer at the end of a LOB + * + * @param lob - Lob handle + * @param buffer - Pointer to a buffer + * @param len - Length of the buffer (in bytes or characters) + * + * @note + * Length is expressed in : + * - Bytes for BLOBs + * - Characters for CLOBs + * + * @return + * Number of bytes / characters written on success otherwise 0 on failure + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_LobAppend +( + OCI_Lob *lob, + void *buffer, + unsigned int len +); + +/** + * @brief + * Append a buffer at the end of a LOB + * + * @param lob - Lob handle + * @param buffer - Pointer to a buffer + * @param char_count - [in/out] Pointer to maximum number of characters + * @param byte_count - [in/out] Pointer to maximum number of bytes + * + * @note + * In input, 'char_count' and 'byte_count' are values to write from the buffer + * In output, 'char_count' and 'byte_count' are values written from the buffer + * + * @note + * For BLOBs, only the parameter 'byte_count' is used + * For CLOBs, both parameters can be used : + * In input : + * - if 'byte_count' is set to zero, it is computed from 'char_count' + * - if 'char_count' is set to zero, it is computed from 'byte_count' + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobAppend2 +( + OCI_Lob *lob, + void *buffer, + unsigned int *char_count, + unsigned int *byte_count +); + +/** + * @brief + * Append a source LOB at the end of a destination LOB + * + * @param lob - Destination Lob handle + * @param lob_src - Source Lob handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobAppendLob +( + OCI_Lob *lob, + OCI_Lob *lob_src +); + +/** + * @brief + * Check if the given lob is a temporary lob + * + * @param lob - Lob handle + * + * @return + * TRUE if it's a temporary lob otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobIsTemporary +( + OCI_Lob *lob +); + +/** + * @brief + * Copy a portion of a source LOB into a destination LOB + * + * @param lob - Destination Lob handle + * @param lob_src - Source Lob handle + * @param offset_dst - Absolute position in destination lob + * @param offset_src - Absolute position in source lob + * @param count - Number of bytes or character to copy + * + * @note + * For character LOB (CLOB/NCLOBS) the parameters count, offset_dst and + * offset_src are expressed in characters and not in bytes. + * + * @note + * Absolute position starts at 0. + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobCopy +( + OCI_Lob *lob, + OCI_Lob *lob_src, + big_uint offset_dst, + big_uint offset_src, + big_uint count +); + +/** + * @brief + * Copy a portion of a source FILE into a destination LOB + * + * @param lob - Destination Lob handle + * @param file - Source File handle + * @param offset_dst - Absolute position in destination lob + * @param offset_src - Absolute position in source file + * @param count - Number of bytes to copy + * + * @note + * - For character LOB (CLOB/NCLOB) the parameter offset_src are expressed in + * characters and not in bytes. + * - Offset_src is always in bytes + * + * @note + * Absolute position starts at 0. + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobCopyFromFile +( + OCI_Lob *lob, + OCI_File *file, + big_uint offset_dst, + big_uint offset_src, + big_uint count +); + +/** + * @brief + * Open explicitly a Lob + * + * @param lob - Lob handle + * @param mode - open mode + * + * Possible values for mode are : + * + * - OCI_LOB_READONLY : read only access + * - OCI_LOB_READWRITE : read/write access + * + * @note + * - A call to OCI_LobOpen is not necessary to manipulate a Lob. + * - If a lob has not been opened explicitly, triggers are fired and + * indexes updated at every read/write/append operation + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobOpen +( + OCI_Lob *lob, + unsigned int mode +); + +/** + * @brief + * Close explicitly a Lob + * + * @param lob - Lob handle + * + * @note + * - A call to OCI_LobClose is not necessary to manipulate a Lob. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobClose +( + OCI_Lob *lob +); + +/** + * @brief + * Compare two lob handles for equality + * + * @param lob - Lob handle + * @param lob2 - Lob2 handle + * + * @return + * TRUE is the lobs are not null and equal otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobIsEqual +( + OCI_Lob *lob, + OCI_Lob *lob2 +); + +/** + * @brief + * Assign a lob to another one + * + * @param lob - Destination Lob handle + * @param lob_src - Source Lob handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobAssign +( + OCI_Lob *lob, + OCI_Lob *lob_src +); + +/** + * @brief + * Return the maximum size that the lob can contain + * + * @param lob - Lob handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT big_uint OCI_API OCI_LobGetMaxSize +( + OCI_Lob *lob +); + +/** + * @brief + * Flush Lob content to the server + * + * @param lob - Lob handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobFlush +( + OCI_Lob *lob +); + +/** + * @brief + * Enable / disable buffering mode on the given lob handle + * + * @param lob - Lob handle + * @param value - Enable/disable buffering mode + * + * @note + * Oracle "LOB Buffering Subsystem" allows client applications + * to speedup read/write of small buffers on Lobs Objects. + * Check Oracle Documentation for more details on "LOB Buffering Subsystem". + * This reduces the number of network round trips and LOB versions, thereby + * improving LOB performance significantly. + * + * @warning + * According to Oracle documentation the following operations are not permitted + * on Lobs when buffering is on : OCI_LobCopy(), OCI_LobAppend, OCI_LobErase(), + * OCI_LobGetLength(), OCI_LobTruncate() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LobEnableBuffering +( + OCI_Lob *lob, + boolean value +); + +/** +* @brief +* Retrieve connection handle from the lob handle +* +* @param lob - lob handle +* +*/ + +OCI_EXPORT OCI_Connection * OCI_API OCI_LobGetConnection +( + OCI_Lob *lob +); + +/** +* @brief +* Indicates if the given lob belongs to a local or remote database table +* +* @param lob - lob handle +* +* @warning +* Requires Oracle 12cR2 (both client and server side), otherwise it returns FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_LobIsRemote +( + OCI_Lob *lob +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiFiles External Large Objects (FILEs) + * @{ + * + * External Large Objects (FILEs) were introduced with Oracle 8i + * + * Oracle OCI supplies a set APIs to manipulate this data type. + * + * OCILIB encapsulates this API by supplying: + * + * - An OCI_File C type + * - A set of really easy APIs to manipulate OCI_File objects + * + * OCILIB currently supports 2 types of Lobs : + * + * - BFILE : Binary files + * - CFILE : Character files + * + * @warning + * FILEs are read-only. + * + * OCI_Lob objects can be : + * + * - Created as standalone instances + * - Used for in/out binding + * - Retrieved from select statements + * - Used for reading server files content + * + * @par Files > 4 Go + * + * - New maximum file size limit (128 To) applies to OCI_Files objects. + * - See Internal Large Objects (LOBs) section for Files > 4 Go information + * + * @par Example + * @include file.c + * + */ + +/** + * @brief + * Create a file object instance + * + * @param con - Connection handle + * @param type - File type + * + * Supported file types : + * + * - OCI_BFILE : Binary file + * - OCI_CFILE : Character file + * + * @return + * Return the lob handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_File * OCI_API OCI_FileCreate +( + OCI_Connection *con, + unsigned int type +); + +/** + * @brief + * Free a local File object + * + * @param file - File handle + * + * @warning + * Only Files created with OCI_FileCreate() should be freed by OCI_FileFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_FileFree +( + OCI_File *file +); + +/** + * @brief + * Create an array of file object + * + * @param con - Connection handle + * @param type - File type + * @param nbelem - number of elements in the array + * + * @note + * see OCI_FileCreate() for more details + * + * @return + * Return the file handle array on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_File ** OCI_API OCI_FileArrayCreate +( + OCI_Connection *con, + unsigned int type, + unsigned int nbelem +); + +/** +* @brief +* Free an array of file objects +* +* @param files - Array of file objects +* +* @warning +* Only arrays of lobs created with OCI_FileArrayCreate() should be freed by OCI_FileArrayFree() +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_FileArrayFree +( + OCI_File **files +); + +/** + * @brief + * Return the type of the given File object + * + * @param file - File handle + * + * @note + * For possible values, see OCI_FileCreate() + * + * @return + * Object type or OCI_UNKNOWN the input handle is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_FileGetType +( + OCI_File *file +); + +/** + * @brief + * Perform a seek operation on the OCI_File content buffer + * + * @param file - File handle + * @param offset - Offset from current position + * @param mode - Seek mode + * + * Mode parameter can be one of the following value : + * + * - OCI_SEEK_SET : set the file current offset to the given absolute offset + * - OCI_SEEK_END : set the file current offset to the end of the lob + * - OCI_SEEK_CUR : move the file current offset to the number of bytes given by + * parameter 'offset' + * + * @note + * Position in the File buffer starts at 0. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_FileSeek +( + OCI_File *file, + big_uint offset, + unsigned int mode +); + +/** + * @brief + * Return the current position in the file + * + * @param file - File handle + * + * @return + * File position (starting with 0) or 0 on failure + */ + +OCI_EXPORT big_uint OCI_API OCI_FileGetOffset +( + OCI_File *file +); + +/** + * @brief + * Read a portion of a file into the given buffer + * + * @param file - File handle + * @param buffer - Pointer to a buffer + * @param len - Length of the buffer in bytes + * + * @return + * Number of bytes read on success otherwise 0 on failure + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_FileRead +( + OCI_File *file, + void *buffer, + unsigned int len +); + +/** + * @brief + * Return the size in bytes of a file + * + * @param file - File handle + * + */ + +OCI_EXPORT big_uint OCI_API OCI_FileGetSize +( + OCI_File *file +); + +/** + * @brief + * Check if the given file exists on server + * + * @param file - File handle + * + * @note + * For local FILEs object, OCI_LobFileSetName() must be called before to set the filename to check + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_FileExists +( + OCI_File *file +); + +/** + * @brief + * Set the directory and file name of FILE handle + * + * @param file - File handle + * @param dir - File directory + * @param name - File name + *in + * @note + * - For local FILEs only + * - Files fetched from resultset cannot be assigned a new directory and name + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_FileSetName +( + OCI_File *file, + const otext *dir, + const otext *name +); + +/** + * @brief + * Return the directory of the given file + * + * @param file - File handle + * + */ + +OCI_EXPORT const otext * OCI_API OCI_FileGetDirectory +( + OCI_File *file +); + +/** + * @brief + * Return the name of the given file + * + * @param file - File handle + * + */ + +OCI_EXPORT const otext * OCI_API OCI_FileGetName +( + OCI_File *file +); + +/** + * @brief + * Open a file for reading + * + * @param file - File handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_FileOpen +( + OCI_File *file +); + +/** + * @brief + * Check if the specified file is opened within the file handle + * + * @param file - File handle + * + * @return + * TRUE if the file was opened with this handle otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_FileIsOpen +( + OCI_File *file +); + +/** + * @brief + * Close a file + * + * @param file - File handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_FileClose +( + OCI_File *file +); + +/** + * @brief + * Compare two file handle for equality + * + * @param file - File handle + * @param file2 - File2 handle + * + * @return + * TRUE is the lobs are not null and equal otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_FileIsEqual +( + OCI_File *file, + OCI_File *file2 +); + +/** + * @brief + * Assign a file to another one + * + * @param file - Destination File handle + * @param file_src - Source File handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_FileAssign +( + OCI_File *file, + OCI_File *file_src +); + +/** +* @brief +* Retrieve connection handle from the file handle +* +* @param file - file handle +* +*/ + +OCI_EXPORT OCI_Connection * OCI_API OCI_FileGetConnection +( + OCI_File *file +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiLongs Long objects + * @{ + * + * Long Objects encapsulate Oracle LONGs data types and were used to store large + * buffers in Oracle database. + * + * They're still supported but are depreciated. Oracle now provides a + * newer and better way to deal with data that needs large storage : LOBs + * + * OCILIB supports this data type because it was and still is widely used + * + * OCILIB provides a set of API for manipulating LONGs that is really close to + * the one provided for LOBs. + * + * OCILIB currently supports 3 types of Long Objects: + * + * - OCI_BLONG : LONG RAW columns + * - OCI_CLONG : LONG columns + * + * OCI_Lob objects can be : + * + * - Created as standalone instances + * - Used for in/out binding + * - Retrieved from select statement + * + * @par Example + * @include long.c + * + */ + +/** + * @brief + * Create a local temporary Long instance + * + * @param stmt - Statement handle + * @param type - Long type + * + * Supported lob types : + * + * - OCI_BLONG : Binary Long + * - OCI_CLONG : Character Long + * + * @return + * Return the long handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Long * OCI_API OCI_LongCreate +( + OCI_Statement *stmt, + unsigned int type +); + +/** + * @brief + * Free a local temporary long + * + * @param lg - Long handle + * + * @warning + * Only lobs created with OCI_LongCreate() should be freed by OCI_LongFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_LongFree +( + OCI_Long *lg +); + +/** + * @brief + * Return the type of the given Long object + * + * @param lg - Long handle + * + * @note + * For possible values, see OCI_LobCreate() + * + * @return + * Object type or OCI_UNKNOWN the input handle is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_LongGetType +( + OCI_Long *lg +); + +/** + * @brief + * Read a portion of a long into the given buffer [Obsolete] + * + * @param lg - Long handle + * @param buffer - Pointer to a buffer + * @param len - Length of the buffer in bytes / characters + * + * @note + * - From version 2.0.0, this function is obsolete because OCILIB fetches now + * all data during OCIFetchNext() call + * - So, this call reads now the internal OCI_Long object allocated buffer + * - The internal buffer can be directly accessed with OCI_LongGetBuffer() + * + * @note + * - For OCI_CLONG, parameter 'len' and returned value are expressed in characters + * - For OCI_BLONG, parameter 'len' and returned value are expressed in bytes + * + * @return + * - Number of bytes/characters read on success + * - 0 if there is nothing more to read + * - 0 on failure + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_LongRead +( + OCI_Long *lg, + void *buffer, + unsigned int len +); + +/** + * @brief + * Write a buffer into a Long + * + * @param lg - Long handle + * @param buffer - the pointer to a buffer + * @param len - the length of the buffer in bytes (OCI_BLONG) or + * character (OCI_CLONG) + * + * @return + * Number of bytes (OCI_BLONG) / character (OCI_CLONG) written on success otherwise 0 on failure + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_LongWrite +( + OCI_Long *lg, + void *buffer, + unsigned int len +); + +/** + * @brief + * Return the buffer size of a long object in bytes (OCI_BLONG) or character (OCI_CLONG) + * + * @param lg - Long handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_LongGetSize +( + OCI_Long *lg +); + +/** + * @brief + * Return the internal buffer of an OCI_Long object read from a fetch sequence + * + * @param lg - Long handle + * + */ + +OCI_EXPORT void * OCI_API OCI_LongGetBuffer +( + OCI_Long *lg +); + +/** +* @} +*/ + +/** +* @defgroup OcilibCApiOracleNumber Oracle NUMBER manipulation (optional) +* @{ +* +* OCILIB encapsulates Oracle SQL all Numeric types using C native data types. +* But it also provides an optional OCI_Number handle for manipulating and accessing Oracle NUMBER type. +* OCI_Number provides management for some special value that cannot be addressed in C such as positive +* and negative infinity. +* +* @par Example +* @include number.c +* +*/ + +/** +* @brief +* Create a local number object +* +* @param con - Connection handle +* +* @note +* Parameter 'con' can be NULL in order to manipulate numbers +* independently from database connections +* +* @return +* Return the number handle on success otherwise NULL on failure +* +*/ + +OCI_EXPORT OCI_Number * OCI_API OCI_NumberCreate +( + OCI_Connection *con +); + +/** +* @brief +* Free a number object +* +* @param number - Number handle +* +* @warning +* Only Numbers created with OCI_NumberCreate() should be freed by OCI_NumberFree() +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_NumberFree +( + OCI_Number *number +); + +/** +* @brief +* Create an array of number object +* +* @param con - Connection handle +* @param nbelem - number of elements in the array +* +* @note +* see OCI_NumberCreate() for more details +* +* @return +* Return the number handle array on success otherwise NULL on failure +* +*/ + +OCI_EXPORT OCI_Number ** OCI_API OCI_NumberArrayCreate +( + OCI_Connection *con, + unsigned int nbelem +); + +/** +* @brief +* Free an array of number objects +* +* @param numbers - Array of number objects +* +* @warning +* Only arrays of numbers created with OCI_NumberArrayCreate() should be freed by OCI_NumberArrayFree() +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_NumberArrayFree +( + OCI_Number **numbers +); + +/** +* @brief +* Assign the value of a number handle to another one +* +* @param number - Destination number handle +* @param number_src - Source number handle +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT int OCI_API OCI_NumberAssign +( + OCI_Number *number, + OCI_Number *number_src +); + +/** +* @brief +* Convert a number value from the given number handle to a string +* +* @param number - source number handle +* @param fmt - Number format +* @param size - Destination string size in characters +* @param str - Destination date string +* +* @note +* Output string can be one the following 'magic strings': +* - '~' for positive infinity +* - '-~' for negative infinity +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_NumberToText +( + OCI_Number *number, + const otext *fmt, + int size, + otext *str +); + +/** +* @brief +* Convert a string to a number and store it in the given number handle +* +* @param number - Destination number handle +* @param str - Source number string +* @param fmt - Number format +* +* @note +* Input string can be one the following 'magic strings': +* - '~' for positive infinity +* - '-~' for negative infinity +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_NumberFromText +( + OCI_Number *number, + const otext *str, + const otext *fmt +); + +/** +* @brief +* Return the number value content +* +* @param number - number handle +* +* @note +* Returned content is a buffer of 22 bytes corresponding to Oracle C native +* representation of NUMBER values +* See oracle Documentation of its layout +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT unsigned char * OCI_API OCI_NumberGetContent +( + OCI_Number *number +); + +/** +* @brief +* Assign the number value content +* +* @param number - number handle +* @param content - raw number content +* +* @note +* See OCI_NumberSetContent() for more information +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_NumberSetContent +( + OCI_Number *number, + unsigned char *content +); + +/** +* @brief +* Assign the number value with the value of a native C numeric type +* +* @param number - number handle +* @param type - native C type to assign +* @param value - pointer to value to set +* +* @note +* Argument \p param type can be : +* +* - OCI_NUM_SHORT : value is a pointer to a signed short +* - OCI_NUM_USHORT : value is a pointer to an unsigned short +* - OCI_NUM_INT : value is a pointer to a signed int +* - OCI_NUM_UINT : value is a pointer to an unsigned short +* - OCI_NUM_BIGINT : value is a pointer to a signed big_int +* - OCI_NUM_BIGUINT : value is a pointer to an unsigned big_uint +* - OCI_NUM_FLOAT : value is a pointer to an float +* - OCI_NUM_DOUBLE : value is a pointer to a double +* - OCI_NUM_NUMBER : value is a pointer to the return value of OCI_NumberGetContent() +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_NumberSetValue +( + OCI_Number *number, + unsigned int type, + void *value +); + +/** +* @brief +* Assign the number value to a native C numeric type +* +* @param number - number handle +* @param type - native C type to assign +* @param value - pointer to a native C variable +* +* @note +* See OCI_NumberSetValue() for more information +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_NumberGetValue +( + OCI_Number *number, + unsigned int type, + void *value +); + +/** +* @brief +* Add the value of a native C numeric type to the given number +* +* @param number - number handle +* @param type - native C type of the variable +* @param value - pointer to a native C variable to add +* +* @note +* See OCI_NumberSetValue() for more information +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_NumberAdd +( + OCI_Number *number, + unsigned int type, + void *value +); + +/** +* @brief +* Subtract the value of a native C numeric type to the given number +* +* @param number - number handle +* @param type - native C type of the variable +* @param value - pointer to a native C variable to subtract +* +* @note +* See OCI_NumberSetValue() for more information +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_NumberSub +( + OCI_Number *number, + unsigned int type, + void *value +); + +/** +* @brief +* Multiply the given number with the value of a native C numeric +* +* @param number - number handle +* @param type - native C type of the variable +* @param value - pointer to a native C variable to multiply by +* +* @note +* See OCI_NumberSetValue() for more information +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_NumberMultiply +( + OCI_Number *number, + unsigned int type, + void *value +); + +/** +* @brief +* Divide the given number with the value of a native C numeric +* +* @param number - number handle +* @param type - native C type of the variable +* @param value - pointer to a native C variable to divide by +* +* @note +* See OCI_NumberSetValue() for more information +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_NumberDivide +( + OCI_Number *number, + unsigned int type, + void *value +); + +/** + * @brief + * Compares two number handles + * + * @param number1 - number1 handle + * @param number2 - number2 handle + * + * @return + * - -1 if number1 is smaller than number2, + * - 0 if they are equal + * - 1 if number1 is greater than number2. + * + */ + +OCI_EXPORT int OCI_API OCI_NumberCompare +( + OCI_Number *number1, + OCI_Number *number2 +); + +/** +* @} +*/ + +/** + * @} + */ + +/** + * @defgroup OcilibCApiDatetimes Date/time manipulation + * @{ + * + * OCILIB encapsulates Oracle SQL Date data type within OCI_Date structure + * + * Basically, the OCI_Date routines are wrappers around the Oracle OCIDate APIs + * + * @par Example + * @include date.c + * + */ + +/** + * @brief + * Create a local date object + * + * @param con - Connection handle + * + * @note + * From version 2.5.0, parameter 'con' can be NULL in order to manipulate dates + * independently from database connections + * + * @return + * Return the date handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Date * OCI_API OCI_DateCreate +( + OCI_Connection *con +); + +/** + * @brief + * Free a date object + * + * @param date - Date handle + * + * @warning + * Only dates created with OCI_DateCreate() should be freed by OCI_DateFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateFree +( + OCI_Date *date +); + +/** + * @brief + * Create an array of date object + * + * @param con - Connection handle + * @param nbelem - number of elements in the array + * + * @note + * see OCI_DateCreate() for more details + * + * @return + * Return the date handle array on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Date ** OCI_API OCI_DateArrayCreate +( + OCI_Connection *con, + unsigned int nbelem +); + +/** + * @brief + * Free an array of date objects + * + * @param dates - Array of date objects + * + * @warning + * Only arrays of dates created with OCI_DateArrayCreate() should be freed by OCI_DateArrayFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateArrayFree +( + OCI_Date **dates +); + +/** + * @brief + * Add or subtract days to a date handle + * + * @param date - Date handle + * @param nb - Number of days to add/remove + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateAddDays +( + OCI_Date *date, + int nb +); + +/** + * @brief + * Add or subtract months to a date handle + * + * @param date - Date handle + * @param nb - Number of months to add/remove + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateAddMonths +( + OCI_Date *date, + int nb +); + +/** + * @brief + * Assign the value of a date handle to another one + * + * @param date - Destination Date handle + * @param date_src - Source Date handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT int OCI_API OCI_DateAssign +( + OCI_Date *date, + OCI_Date *date_src +); + +/** + * @brief + * Check if the given date is valid + * + * @param date - Date handle + * + * @return + * - Zero if date is valid + * - Any other value means the date is invalid + * + */ + +OCI_EXPORT int OCI_API OCI_DateCheck +( + OCI_Date *date +); + +/** + * @brief + * Compares two date handles + * + * @param date - Date1 handle + * @param date2 - Date2 handle + * + * @return + * - -1 if date1 is smaller than date2, + * - 0 if they are equal + * - 1 if date1 is greater than date2. + * + */ + +OCI_EXPORT int OCI_API OCI_DateCompare +( + OCI_Date *date, + OCI_Date *date2 +); + +/** + * @brief + * Return the number of days betWeen two dates + * + * @param date - Date1 handle + * @param date2 - Date2 handle + * + * The number of days is the difference of (date2 - date) + * + * @return + * Number of days on success otherwise OCI_ERROR on failure + * + */ + +OCI_EXPORT int OCI_API OCI_DateDaysBetween +( + OCI_Date *date, + OCI_Date *date2 +); + +/** + * @brief + * Convert a string to a date and store it in the given date handle + * + * @param date - Destination Date handle + * @param str - Source date string + * @param fmt - Date format + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateFromText +( + OCI_Date *date, + const otext *str, + const otext *fmt +); + +/** + * @brief + * Convert a Date value from the given date handle to a string + * + * @param date - source Date handle + * @param fmt - Date format + * @param size - Destination string size in characters + * @param str - Destination date string + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateToText +( + OCI_Date *date, + const otext *fmt, + int size, + otext *str +); + +/** + * @brief + * Extract the date part from a date handle + * + * @param date - Date handle + * @param year - Place holder for year value + * @param month - Place holder for month value + * @param day - Place holder for day value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateGetDate +( + OCI_Date *date, + int *year, + int *month, + int *day +); + +/** + * @brief + * Extract the time part from a date handle + * + * @param date - Date handle + * @param hour - Place holder for hour value + * @param min - Place holder for minute value + * @param sec - Place holder for second value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateGetTime +( + OCI_Date *date, + int *hour, + int *min, + int *sec +); + +/** + * @brief + * Extract the date and time parts from a date handle + * + * @param date - Date handle + * @param year - Place holder for year value + * @param month - Place holder for month value + * @param day - Place holder for day value + * @param hour - Place holder for hour value + * @param min - Place holder for minute value + * @param sec - Place holder for second value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateGetDateTime +( + OCI_Date *date, + int *year, + int *month, + int *day, + int *hour, + int *min, + int *sec +); + +/** + * @brief + * Set the date portion if the given date handle + * + * @param date - Date handle + * @param year - Year value + * @param month - Month value + * @param day - Day value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateSetDate +( + OCI_Date *date, + int year, + int month, + int day +); + +/** + * @brief + * Set the time portion if the given date handle + * + * @param date - Date handle + * @param hour - Hour value + * @param min - Minute value + * @param sec - Second value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateSetTime +( + OCI_Date *date, + int hour, + int min, + int sec +); + +/** + * @brief + * Set the date and time portions if the given date handle + * + * @param date - Date handle + * @param year - Year value + * @param month - Month value + * @param day - Day value + * @param hour - Hour value + * @param min - Minute value + * @param sec - Second value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateSetDateTime +( + OCI_Date *date, + int year, + int month, + int day, + int hour, + int min, + int sec +); + +/** + * @brief + * Place the last day of month (from the given date) into the given date + * + * @param date - Date handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateLastDay +( + OCI_Date *date +); + +/** + * @brief + * Gets the date of next day of the week, after a given date + * + * @param date - Date handle + * @param day - Day of the week + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateNextDay +( + OCI_Date *date, + const otext *day +); + +/** + * @brief + * Return the current system date/time into the date handle + * + * @param date - Date handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateSysDate +( + OCI_Date *date +); + +/** + * @brief + * Convert a date from one zone to another zone + * + * @param date - Date handle + * @param zone1 - Source zone + * @param zone2 - Destination zone + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateZoneToZone +( + OCI_Date *date, + const otext *zone1, + const otext *zone2 +); + +/** + * @brief + * Affect an OCI_Date handle value to ISO C time data types + * + * @param date - Date handle + * @param ptm - Pointer to a structure tm to receive date/time values + * @param pt - Pointer to a time_t to hold the date/time in the time_t format + * + * @note + * Both parameters 'ptm' and 'p' are optional but one of them has to be provided. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateToCTime +( + OCI_Date *date, + struct tm *ptm, + time_t *pt +); + +/** + * @brief + * Affect ISO C time data types values to an OCI_Date handle + * + * @param date - Date handle + * @param ptm - Pointer to a structure tm that hold the date/time value + * @param t - Value (time_t) that hold the date/time in the time_t format + * + * @note + * Both parameters 'ptm' and 'p' are optional but one of them has to be provided. + * If 'ptm' is not null, its value is affected to the OCI_Timestamp handle, + * otherwise the value of 't' is used. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DateFromCTime +( + OCI_Date *date, + struct tm *ptm, + time_t t +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiTimestamps Timestamps and intervals manipulation + * @{ + * + * OCILIB encapsulates Oracle : + * + * - SQL timestamp data type within OCI_Timestamp structure + * - SQL interval data type within OCI_Interval structure + * + * Basically, the OCI_Timestamp and OCI_Interval routines are wrappers around + * the Oracle OCIDatetime and OCIInterval APIs + * + * @par Examples + * @include timestamp.c + * + */ + +/** + * @brief + * Create a local Timestamp instance + * + * @param con - Connection handle + * @param type - Timestamp type + * + * @note + * From version 2.5.0, parameter 'con' can be NULL in order to manipulate + * timestamps independently from database connections + * + * @note + * Timestamp type can be : + * + * - OCI_TIMESTAMP : timestamp + * - OCI_TIMESTAMP_TZ : timestamp with time zone + * - OCI_TIMESTAMP_LTZ : timestamp with local time zone + * + * @return + * Return the Timestamp handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Timestamp * OCI_API OCI_TimestampCreate +( + OCI_Connection *con, + unsigned int type +); + +/** + * @brief + * Free an OCI_Timestamp handle + * + * @param tmsp - Timestamp handle + * + * @warning + * Only Timestamp created with OCI_TimestampCreate() should be freed by OCI_IntervalFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampFree +( + OCI_Timestamp *tmsp +); + +/** + * @brief + * Create an array of timestamp object + * + * @param con - Connection handle + * @param type - Timestamp type + * @param nbelem - number of elements in the array + * + * @note + * see OCI_TimestampCreate() for more details + * + * @return + * Return the timestamp handle array on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Timestamp ** OCI_API OCI_TimestampArrayCreate +( + OCI_Connection *con, + unsigned int type, + unsigned int nbelem +); + +/** + * @brief + * Free an array of timestamp objects + * + * @param tmsps - Array of timestamp objects + * + * @warning + * Only arrays of timestamp created with OCI_TimestampArrayCreate() + * should be freed by OCI_TimestampArrayFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampArrayFree +( + OCI_Timestamp **tmsps +); + +/** + * @brief + * Return the type of the given Timestamp object + * + * @param tmsp - Timestamp handle + * + * @note + * For possible values, see OCI_TimestampCreate() + * + * @return + * Object type or OCI_UNKNOWN the input handle is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_TimestampGetType +( + OCI_Timestamp *tmsp +); + +/** + * @brief + * Assign the value of a timestamp handle to another one + * + * @param tmsp - Destination Timestamp handle + * @param tmsp_src - Source Timestamp handle + * + * @note + * Both timestamp handles must be of the same type + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampAssign +( + OCI_Timestamp *tmsp, + OCI_Timestamp *tmsp_src +); + +/** + * @brief + * Check if the given timestamp is valid + * + * @param tmsp - Timestamp handle + * + * @return + * - Zero if the timestamp value is valid + * - Any other value means the timestamp value is invalid + * + */ + +OCI_EXPORT int OCI_API OCI_TimestampCheck +( + OCI_Timestamp *tmsp +); + +/** + * @brief + * Compares two timestamp handles + * + * @param tmsp - Timestamp1 handle + * @param tmsp2 - Timestamp2 handle + * + * @return + * - -1 if Timestamp1 is smaller than Timestamp2, + * - 0 if they are equal + * - 1 if Timestamp1 is greater than Timestamp2. + * + */ + +OCI_EXPORT int OCI_API OCI_TimestampCompare +( + OCI_Timestamp *tmsp, + OCI_Timestamp *tmsp2 +); + +/** + * @brief + * Set a timestamp handle value + * + * @param tmsp - Timestamp handle + * @param year - Year value + * @param month - Month value + * @param day - Day value + * @param hour - hour value + * @param min - minutes value + * @param sec - seconds value + * @param fsec - fractional part of seconds value + * @param time_zone - name of a time zone to use [optional] + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampConstruct +( + OCI_Timestamp *tmsp, + int year, + int month, + int day, + int hour, + int min, + int sec, + int fsec, + const otext *time_zone +); + +/** + * @brief + * Convert one timestamp value from one type to another. + * + * @param tmsp - Timestamp handle to convert + * @param tmsp_src - Timestamp handle to use for the type conversion + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampConvert +( + OCI_Timestamp *tmsp, + OCI_Timestamp *tmsp_src +); + +/** + * @brief + * Convert a string to a timestamp and store it in the given timestamp handle + * + * @param tmsp - Destination Timestamp handle + * @param str - Source date string + * @param fmt - Date format + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampFromText +( + OCI_Timestamp *tmsp, + const otext *str, + const otext *fmt +); + +/** + * @brief + * Convert a timestamp value from the given timestamp handle to a string + * + * @param tmsp - source Timestamp handle + * @param fmt - Timestamp format + * @param size - Destination string size in characters + * @param str - Destination date string + * @param precision - Precision for fractional part of the seconds + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampToText +( + OCI_Timestamp *tmsp, + const otext *fmt, + int size, + otext *str, + int precision +); + +/** + * @brief + * Extract the date part from a timestamp handle + * + * @param tmsp - Timestamp handle + * @param year - Place holder for year value + * @param month - Place holder for month value + * @param day - Place holder for day value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampGetDate +( + OCI_Timestamp *tmsp, + int *year, + int *month, + int *day +); + +/** + * @brief + * Extract the time portion from a timestamp handle + * + * @param tmsp - Timestamp handle + * @param hour - Place holder for hour value + * @param min - Place holder for minute value + * @param sec - Place holder for second value + * @param fsec - Place holder for fractional part of second value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampGetTime +( + OCI_Timestamp *tmsp, + int *hour, + int *min, + int *sec, + int *fsec +); + +/** + * @brief + * Extract the date and time parts from a date handle + * + * @param tmsp - Date handle + * @param year - Place holder for year value + * @param month - Place holder for month value + * @param day - Place holder for day value + * @param hour - Place holder for hour value + * @param min - Place holder for minute value + * @param sec - Place holder for second value + * @param fsec - Place holder for fractional part of seconds value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampGetDateTime +( + OCI_Timestamp *tmsp, + int *year, + int *month, + int *day, + int *hour, + int *min, + int *sec, + int *fsec +); + +/** + * @brief + * Return the time zone name of a timestamp handle + * + * @param tmsp - Timestamp handle + * @param size - Destination string size in characters + * @param str - Destination zone name string + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampGetTimeZoneName +( + OCI_Timestamp *tmsp, + int size, + otext *str +); + +/** + * @brief + * Return the time zone (hour, minute) portion of a timestamp handle + * + * @param tmsp - Timestamp handle + * @param hour - Place holder for hour value + * @param min - Place holder for min value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampGetTimeZoneOffset +( + OCI_Timestamp *tmsp, + int *hour, + int *min +); + +/** + * @brief + * Add an interval value to a timestamp value of a timestamp handle + * + * @param tmsp - Timestamp handle + * @param itv - Interval handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampIntervalAdd +( + OCI_Timestamp *tmsp, + OCI_Interval *itv +); + +/** + * @brief + * Subtract an interval value from a timestamp value of a timestamp handle + * + * @param tmsp - Timestamp handle + * @param itv - Interval handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampIntervalSub +( + OCI_Timestamp *tmsp, + OCI_Interval *itv +); + +/** + * @brief + * Store the difference of two timestamp handles into an interval handle + * + * @param tmsp - Timestamp handle (subtrahend) + * @param tmsp2 - Timestamp2 handle (minuend) + * @param itv - Interval handle + * + * @note + * The function acts like tmsp - tmsp2 = itv + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampSubtract +( + OCI_Timestamp *tmsp, + OCI_Timestamp *tmsp2, + OCI_Interval *itv +); + +/** + * @brief + * Stores the system current date and time as a timestamp value with time zone + * into the timestamp handle. + * + * @param tmsp - Timestamp handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampSysTimestamp +( + OCI_Timestamp *tmsp +); + +/** + * @brief + * Affect an OCI_Timestamp handle value to ISO C time data types + * + * @param tmsp - Timestamp handle + * @param ptm - Pointer to a structure tm to receive date/time values + * @param pt - Pointer to a time_t to hold the date/time in the time_t format + * + * @note + * Both parameters 'ptm' and 'p' are optional but one of them has to be provided. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampToCTime +( + OCI_Timestamp *tmsp, + struct tm *ptm, + time_t *pt +); + +/** + * @brief + * Affect ISO C time data types values to an OCI_Timestamp handle + * + * @param tmsp - Timestamp handle + * @param ptm - Pointer to a structure tm that hold the date/time value + * @param t - Value (time_t) that hold the date/time in the time_t format + * + * @note + * Both parameters 'ptm' and 'p' are optional but one of them has to be provided. + * If 'ptm' is not null, its value is affected to the OCI_Timestamp handle, + * otherwise the value of 't' is used. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TimestampFromCTime +( + OCI_Timestamp *tmsp, + struct tm *ptm, + time_t t +); + +/** + * @brief + * Create a local interval object + * + * @param con - Connection handle + * @param type - Type of Interval + * + * @note + * From version 2.5.0, parameter 'con' can be NULL in order to manipulate + * intervals independently from database connections + * + * @note + * Interval type can be : + * - OCI_INTERVAL_YM : year / month interval + * - OCI_INTERVAL_DS : date/ time interval + * + * @return + * Return the Interval handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Interval * OCI_API OCI_IntervalCreate +( + OCI_Connection *con, + unsigned int type +); + +/** + * @brief + * Free an OCI_Interval handle + * + * @param itv - Interval handle + * + * @warning + * Only Intervals created with OCI_IntervalCreate() should be freed by + * OCI_IntervalFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IntervalFree +( + OCI_Interval *itv +); + +/** + * @brief + * Create an array of Interval object + * + * @param con - Connection handle + * @param type - Type of Interval + * @param nbelem - number of elements in the array + * + * @note + * see OCI_IntervalCreate() for more details + * + * @return + * Return the Interval handle array on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Interval ** OCI_API OCI_IntervalArrayCreate +( + OCI_Connection *con, + unsigned int type, + unsigned int nbelem +); + +/** + * @brief + * Free an array of Interval objects + * + * @param itvs - Array of Interval objects + * + * @warning + * Only arrays of Interval created with OCI_IntervalArrayCreate() should be freed by + * OCI_IntervalArrayFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IntervalArrayFree +( + OCI_Interval **itvs +); + +/** + * @brief + * Return the type of the given Interval object + * + * @param itv - Interval handle + * + * @note + * For possible values, see OCI_IntervalCreate() + * + * @return + * Object type or OCI_UNKNOWN the input handle is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_IntervalGetType +( + OCI_Interval *itv +); + +/** + * @brief + * Assign the value of a interval handle to another one + * + * @param itv - Destination interval handle + * @param itv_src - Source interval handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IntervalAssign +( + OCI_Interval *itv, + OCI_Interval *itv_src +); + +/** + * @brief + * Check if the given interval is valid + * + * @param itv - Interval handle + * + * @return + * - Zero if the interval value is valid + * - Any other value means the interval value is invalid + * + */ + +OCI_EXPORT int OCI_API OCI_IntervalCheck +( + OCI_Interval *itv +); + +/** + * @brief + * Compares two interval handles + * + * @param itv - Interval1 handle + * @param itv2 - Interval2 handle + * + * @return + * - -1 if interval1 is smaller than interval2, + * - 0 if they are equal + * - 1 if interval1 is greater than interval2. + * + */ + +OCI_EXPORT int OCI_API OCI_IntervalCompare +( + OCI_Interval *itv, + OCI_Interval *itv2 +); + +/** + * @brief + * Convert a string to an interval and store it in the given interval handle + * + * @param itv - Destination interval handle + * @param str - Source date string + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IntervalFromText +( + OCI_Interval *itv, + const otext *str +); + +/** + * @brief + * Convert an interval value from the given interval handle to a string + * + * @param itv - source Interval handle + * @param leading_prec - Precision of the leading part + * @param fraction_prec - Precision of the fractional part + * @param size - Destination string size in characters + * @param str - Destination date string + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IntervalToText +( + OCI_Interval *itv, + int leading_prec, + int fraction_prec, + int size, + otext *str +); + +/** + * @brief + * Correct an interval handle value with the given time zone + * + * @param itv - Interval handle + * @param str - Time zone name + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IntervalFromTimeZone +( + OCI_Interval *itv, + const otext *str +); + +/** + * @brief + * Return the day / time portion of an interval handle + * + * @param itv - Interval handle + * @param day - Place holder for day value + * @param hour - Place holder for hours value + * @param min - Place holder for minutes value + * @param sec - Place holder for seconds value + * @param fsec - Place holder for fractional part of seconds value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IntervalGetDaySecond +( + OCI_Interval *itv, + int *day, + int *hour, + int *min, + int *sec, + int *fsec +); + +/** + * @brief + * Return the year / month portion of an interval handle + * + * @param itv - Interval handle + * @param year - Place holder for year value + * @param month - Place holder for month value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IntervalGetYearMonth +( + OCI_Interval *itv, + int *year, + int *month +); + +/** + * @brief + * Set the day / time portion if the given interval handle + * + * @param itv - Interval handle + * @param day - day value + * @param hour - Hour value + * @param min - Minute value + * @param sec - Second value + * @param fsec - Fractional part of the seconds + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IntervalSetDaySecond +( + OCI_Interval *itv, + int day, + int hour, + int min, + int sec, + int fsec +); + +/** + * @brief + * Set the year / month portion if the given Interval handle + * + * @param itv - Interval handle + * @param year - Year value + * @param month - Month value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IntervalSetYearMonth +( + OCI_Interval *itv, + int year, + int month +); + +/** + * @brief + * Adds an interval handle value to another + * + * @param itv - Interval handle from witch to add + * @param itv2 - Interval handle to add + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IntervalAdd +( + OCI_Interval *itv, + OCI_Interval *itv2 +); + +/** + * @brief + * Subtract an interval handle value from another + * + * @param itv - Interval handle from witch to remove + * @param itv2 - Interval handle to remove + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_IntervalSubtract +( + OCI_Interval *itv, + OCI_Interval *itv2 +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiUserTypes Oracle Named Types (Oracle OBJECTs) + * @{ + * + * OCILIB implements Oracle Named types (user types and built-in types) through + * the OCI_Object type. + * + * OTT and C structures are not required to use objects in OCILIB. + * + * In order to manipulate objects attributes, OCILIB proposes a set of functions + * to get/set properties for various supported types. + * + * Objects can be: + * - Created as standalone instances (transient objects) + * - Used for binding (persistent / transient objects) + * - Retrieved from select statements (persistent / embedded objects) + * + * References (Oracle type REF) are identifiers (smart pointers) to objects and + * are implemented in OCILIB with the type OCI_Ref. + * + * OCILIB implements Oracle REFs as strong typed Reference (underlying OCI REFs + * are weaker in terms of typing). + * It means it's mandatory to provide type information to: + * - create a local OCI_Ref handle. + * - register an OCI_Ref handle for a 'returning into' clause. + * + * @note + * See Oracle Database SQL Language Reference for more details about REF data type + * + * @warning + * Prior to v3.5.0, OCILIB relied on some OCI routines to set/get objects + * attributes. these OCI calls had known bugs in Unicode mode that has been fixed in Oracle 11gR2. + * From v3.5.0, OCILIB directly sets objects attributes and thus OCILIB objects + * can now be used in Unicode mode. + * + * @par Example : Inserting a local object into a table + * @include object.c + * + * @par Example : Using Object References + * @include ref.c + * + */ + +/** + * @brief + * Create a local object instance + * + * @param con - Connection handle + * @param typinf - Object type (type info handle) + * + * @return + * Return the object handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Object * OCI_API OCI_ObjectCreate +( + OCI_Connection *con, + OCI_TypeInfo *typinf +); + +/** + * @brief + * Free a local object + * + * @param obj - Object handle + * + * @warning + * Only object created with OCI_ObjectCreate() should be freed + * by OCI_ObjectFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectFree +( + OCI_Object *obj +); + +/** + * @brief + * Create an array of Object objects + * + * @param con - Connection handle + * @param typinf - Object type (type info handle) + * @param nbelem - number of elements in the array + * + * @note + * see OCI_ObjectCreate() for more details + * + * @return + * Return the Object handle array on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Object ** OCI_API OCI_ObjectArrayCreate +( + OCI_Connection *con, + OCI_TypeInfo *typinf, + unsigned int nbelem +); + +/** + * @brief + * Free an array of Object objects + * + * @param objs - Array of Object objects + * + * @warning + * Only arrays of Object created with OCI_ObjectArrayCreate() + * should be freed by OCI_ObjectArrayFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectArrayFree +( + OCI_Object **objs +); + +/** + * @brief + * Assign an object to another one + * + * @param obj - Destination Object handle + * @param obj_src - Source Object handle + * + * @note + * Oracle proceeds to a deep copy of the object content + * + * @note + * The two object handles must have the same type otherwise an exception is thrown + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectAssign +( + OCI_Object *obj, + OCI_Object *obj_src +); + +/** + * @brief + * Return the type of an object instance + * + * @param obj - Object handle + * + * @note + * Possibles values are : + * + * - OCI_OBJ_PERSISTENT: persistent object from the DB + * - OCI_OBJ_TRANSIENT : local temporary object + * - OCI_OBJ_VALUE : embedded object + * + * @return + * Instance type or OCI_UNKNOWN the input handle is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_ObjectGetType +( + OCI_Object *obj +); + +/** + * @brief + * Retrieve an Oracle Ref handle from an object and assign it to the given + * OCILIB OCI_Ref handle + * + * @param obj - Object handle + * @param ref - Ref handle + * + * @note + * The type information of the object and the ref must be the same, otherwise + * an exception is thrown + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectGetSelfRef +( + OCI_Object *obj, + OCI_Ref *ref +); + +/** + * @brief + * Return the type info object associated to the object + * + * @param obj - Object handle + * + */ + +OCI_EXPORT OCI_TypeInfo * OCI_API OCI_ObjectGetTypeInfo +( + OCI_Object *obj +); + +/** + * @brief + * Return the boolean value of the given object attribute (ONLY for PL/SQL records) + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetBoolean() returns a valid value only for PL/SQL boolean based attributes + * + * @warning + * - ONLY supported by Oracle 12c and above ! + * + * @return + * Attribute value or 0 on failure or wrong attribute type + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectGetBoolean +( + OCI_Object *obj, + const otext *attr +); + +/** +* @brief +* Return the number value of the given object attribute +* +* @param obj - Object handle +* @param attr - Attribute name +* +* @note +* If the attribute is found in the object descriptor attributes list, then a +* data type check is performed for integrity. +* OCI_ObjectGetNumber() returns a valid value only for number based attributes +* +* @return +* Attribute value or NULL on failure or wrong attribute type +* +*/ + +OCI_EXPORT OCI_Number* OCI_API OCI_ObjectGetNumber +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the short value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetShort() returns a valid value only for integer and number based attributes + * + * @return + * Attribute value or 0 on failure or wrong attribute type + * + */ + +OCI_EXPORT short OCI_API OCI_ObjectGetShort +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the unsigned short value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetUnsignedShort() returns a valid value only for integer and number based attributes + * + * @return + * Attribute value or 0 on failure or wrong attribute type + * + */ + +OCI_EXPORT unsigned short OCI_API OCI_ObjectGetUnsignedShort +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the integer value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetInt() returns a valid value only for integer and number based attributes + * + * @return + * Attribute value or 0 on failure or wrong attribute type + * + */ + +OCI_EXPORT int OCI_API OCI_ObjectGetInt +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the unsigned integer value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetUnsignedInt() returns a valid value only for integer and number based attributes + * + * @return + * Attribute value or 0 on failure or wrong attribute type + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_ObjectGetUnsignedInt +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the big integer value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetBigInt() returns a valid value only for integer and number based attributes + * + * @return + * Attribute value or 0 on failure or wrong attribute type + * + */ + +OCI_EXPORT big_int OCI_API OCI_ObjectGetBigInt +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the unsigned big integer value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetUnsignedBigInt() returns a valid value only for integer and number based attributes + * + * @return + * Attribute value or 0 on failure or wrong attribute type + * + */ + +OCI_EXPORT big_uint OCI_API OCI_ObjectGetUnsignedBigInt +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the double value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetDouble() returns a valid value only for integer and number based attributes + * + * @return + * Attribute value or 0.0 on failure or wrong attribute type + * + */ + +OCI_EXPORT double OCI_API OCI_ObjectGetDouble +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the float value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetFloat() returns a valid value only for integer and number based attributes + * + * @return + * Attribute value or 0.0 on failure or wrong attribute type + * + */ + +OCI_EXPORT float OCI_API OCI_ObjectGetFloat +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the string value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * The method can return a string value for any attributes types. + * It performs implicit string conversions using the same + * mechanisms than OCI_GetString(). See its documentation for more details. + * + * @return + * Attribute value or NULL on failure + * + */ + +OCI_EXPORT const otext * OCI_API OCI_ObjectGetString +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the raw attribute value of the given object attribute into the + * given buffer + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Destination buffer + * @param len - Max size to write into buffer + + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetRaw() copies data into the buffer only for raw based attributes + * + * @return + * Number of bytes written to the buffer or 0 on failure or wrong attribute type + * + */ + +OCI_EXPORT int OCI_API OCI_ObjectGetRaw +( + OCI_Object *obj, + const otext *attr, + void *value, + unsigned int len +); + +/** +* @brief +* Return the raw attribute value size of the given object attribute into the +* given buffer +* +* @param obj - Object handle +* @param attr - Attribute name +* +* @note +* If the attribute is found in the object descriptor attributes list, then a +* data type check is performed for integrity. +* +* @return +* size in bytes of the RAW value or 0 on failure or wrong attribute type +* +*/ + +OCI_EXPORT unsigned int OCI_API OCI_ObjectGetRawSize +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the date value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetDate() returns a valid value only for date based attributes + * + * @return + * Attribute value or NULL on failure or wrong attribute type + * + */ + +OCI_EXPORT OCI_Date * OCI_API OCI_ObjectGetDate +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the timestamp value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetTimestamp() returns a valid value only for timestamps based attributes + * + * @return + * Attribute value or NULL on failure or wrong attribute type + * + */ + +OCI_EXPORT OCI_Timestamp * OCI_API OCI_ObjectGetTimestamp +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the interval value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetInterval() returns a valid value only for intervals based attributes + * + * @return + * Attribute value or NULL on failure or wrong attribute type + * + */ + +OCI_EXPORT OCI_Interval * OCI_API OCI_ObjectGetInterval +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the collection value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetColl() returns a valid value only for intervals based attributes + * + * @return + * Attribute value or NULL on failure or wrong attribute type + * + */ + +OCI_EXPORT OCI_Coll * OCI_API OCI_ObjectGetColl +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the Ref value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetRef() returns a valid value only for Refs based attributes + * + * @return + * Attribute value or NULL on failure or wrong attribute type + * + */ + +OCI_EXPORT OCI_Ref * OCI_API OCI_ObjectGetRef +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the object value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetObject() returns a valid value only for object based attributes + * + * @return + * Attribute value or NULL on failure or wrong attribute type + * + */ + +OCI_EXPORT OCI_Object * OCI_API OCI_ObjectGetObject +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the lob value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetLob() returns a valid value only for lobs based attributes + * + * @return + * Attribute value or NULL on failure or wrong attribute type + * + */ + +OCI_EXPORT OCI_Lob * OCI_API OCI_ObjectGetLob +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Return the file value of the given object attribute + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @note + * If the attribute is found in the object descriptor attributes list, then a + * data type check is performed for integrity. + * OCI_ObjectGetFile() returns a valid value only for files based attributes + * + * @return + * Attribute value or NULL on failure or wrong attribute type + * + */ + +OCI_EXPORT OCI_File * OCI_API OCI_ObjectGetFile +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Set an object attribute of type boolean (ONLY for PL/SQL records) + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - boolean value + * + * @warning + * - ONLY supported by Oracle 12c and above ! + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetBoolean +( + OCI_Object *obj, + const otext *attr, + boolean value +); + +/** +* @brief +* Set an object attribute of type number +* +* @param obj - Object handle +* @param attr - Attribute name +* @param value - number value +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetNumber +( + OCI_Object *obj, + const otext *attr, + OCI_Number *value +); + +/** + * @brief + * Set an object attribute of type short + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Short value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetShort +( + OCI_Object *obj, + const otext *attr, + short value +); + +/** + * @brief + * Set an object attribute of type unsigned short + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Unsigned short value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetUnsignedShort +( + OCI_Object *obj, + const otext *attr, + unsigned short value +); + +/** + * @brief + * Set an object attribute of type int + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Int value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetInt +( + OCI_Object *obj, + const otext *attr, + int value +); + +/** + * @brief + * Set an object attribute of type unsigned int + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Unsigned int value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetUnsignedInt +( + OCI_Object *obj, + const otext *attr, + unsigned int value +); + +/** + * @brief + * Set an object attribute of type big int + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Big int value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetBigInt +( + OCI_Object *obj, + const otext *attr, + big_int value +); + +/** + * @brief + * Set an object attribute of type unsigned big int + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Unsigned big int value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetUnsignedBigInt +( + OCI_Object *obj, + const otext *attr, + big_uint value +); + +/** + * @brief + * Set an object attribute of type double + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Double value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetDouble +( + OCI_Object *obj, + const otext *attr, + double value +); + +/** + * @brief + * Set an object attribute of type float + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Float value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetFloat +( + OCI_Object *obj, + const otext *attr, + float value +); + +/** + * @brief + * Set an object attribute of type string + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - String value + * + * @note + * passing a null pointer for value calls OCI_ObjectSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetString +( + OCI_Object *obj, + const otext *attr, + const otext *value +); + +/** + * @brief + * Set an object attribute of type RAW + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Raw value + * @param len - Size of the raw value + * + * @note + * passing a null pointer for value calls OCI_ObjectSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetRaw +( + OCI_Object *obj, + const otext *attr, + void *value, + unsigned int len +); + +/** + * @brief + * Set an object attribute of type Date + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Date Handle + * + * @note + * passing a null pointer for value calls OCI_ObjectSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetDate +( + OCI_Object *obj, + const otext *attr, + OCI_Date *value +); + +/** + * @brief + * Set an object attribute of type Timestamp + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Timestamp Handle + * + * @note + * passing a null pointer for value calls OCI_ObjectSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetTimestamp +( + OCI_Object *obj, + const otext *attr, + OCI_Timestamp *value +); + +/** + * @brief + * Set an object attribute of type Interval + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Interval Handle + * + * @note + * passing a null pointer for value calls OCI_ObjectSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetInterval +( + OCI_Object *obj, + const otext *attr, + OCI_Interval *value +); + +/** + * @brief + * Set an object attribute of type Collection + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Collection Handle + * + * @note + * passing a null pointer for value calls OCI_ObjectSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetColl +( + OCI_Object *obj, + const otext *attr, + OCI_Coll *value +); + +/** + * @brief + * Set an object attribute of type Object + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Object Handle + * + * @warning + * This function assigns a copy of the object to the given attribute. + * Any further modifications of the object passed as the parameter 'value' + * will not be reflected to object 's attribute set with this call + * + * @note + * passing a null pointer for value calls OCI_ObjectSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetObject +( + OCI_Object *obj, + const otext *attr, + OCI_Object *value +); + +/** + * @brief + * Set an object attribute of type Lob + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Lob Handle + * + * @note + * passing a null pointer for value calls OCI_ObjectSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetLob +( + OCI_Object *obj, + const otext *attr, + OCI_Lob *value +); + +/** + * @brief + * Set an object attribute of type File + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - File Handle + * + * @note + * passing a null pointer for value calls OCI_ObjectSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetFile +( + OCI_Object *obj, + const otext *attr, + OCI_File *value +); + +/** + * @brief + * Set an object attribute of type Ref + * + * @param obj - Object handle + * @param attr - Attribute name + * @param value - Ref Handle + * + * @note + * passing a null pointer for value calls OCI_ObjectSetNull() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetRef +( + OCI_Object *obj, + const otext *attr, + OCI_Ref *value +); + +/** + * @brief + * Check if an object attribute is null + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @return + * FALSE if the attribute is not null otherwise TRUE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectIsNull +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Set an object attribute to null + * + * @param obj - Object handle + * @param attr - Attribute name + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectSetNull +( + OCI_Object *obj, + const otext *attr +); + +/** + * @brief + * Retrieve the underlying C (OTT/OCI style) structure of an OCI_Object handle + * + * @param obj - Object handle + * @param pp_struct - Address of a pointer that retrieve the C structure of data + * @param pp_ind - Address of a pointer that retrieve the C structure of indicators + * + * @note + * See Oracle OCI programming guide for more details about OTT structures. + * The members of these structures are OCI data types like OCINumber, OCIString + * that requires mixing OCILIB code and raw OCI code. + * OCI Object API headers have to be included to handle this data types using OCI object functions + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectGetStruct +( + OCI_Object *obj, + void **pp_struct, + void **pp_ind +); + +/** + * @brief + * Convert an object handle value to a string + * + * @param obj - Object handle + * @param size - Destination string length pointer in characters + * @param str - Destination string + * + * @note + * In order to compute the needed string length, call the method with a NULL string + * Then call the method again with a valid buffer + * + * @note + * The resulting string is similar to the SQL*PLUS output for UDTs (user types and objects) + * For RAWs and BLOBs attributes, their binary values are converted to hexadecimal strings + * + * @warning + * This convenient method shall not be used when performance matters. It is usually called twice (buffer length + * computation) and must also care about quotes within strings. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ObjectToText +( + OCI_Object *obj, + unsigned int *size, + otext *str +); + +/** + * @brief + * Create a local Ref instance + * + * @param con - Connection handle + * @param typinf - Ref type + * + * @return + * Return the Ref handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Ref * OCI_API OCI_RefCreate +( + OCI_Connection *con, + OCI_TypeInfo *typinf +); + +/** + * @brief + * Free a local Ref + * + * @param ref - Ref handle + * + * @warning + * Only Refs created with OCI_RefCreate() should be freed + * by OCI_RefFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_RefFree +( + OCI_Ref *ref +); + +/** + * @brief + * Create an array of Ref object + * + * @param con - Connection handle + * @param typinf - Object type (type info handle) + * @param nbelem - number of elements in the array + * + * @note + * see OCI_RefCreate() for more details + * + * @return + * Return the Ref handle array on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Ref ** OCI_API OCI_RefArrayCreate +( + OCI_Connection *con, + OCI_TypeInfo *typinf, + unsigned int nbelem +); + +/** + * @brief + * Free an array of Ref objects + * + * @param refs - Array of Ref objects + * + * @warning + * Only arrays of Ref created with OCI_RefArrayCreate() + * should be freed by OCI_RefArrayFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_RefArrayFree +( + OCI_Ref **refs +); + +/** + * @brief + * Assign a Ref to another one + * + * @param ref - Destination Ref handle + * @param ref_src - Source Ref handle + * + * @note + * The two Ref handles must have the same type otherwise an exception is thrown + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_RefAssign +( + OCI_Ref *ref, + OCI_Ref *ref_src +); + +/** + * @brief + * Return the type info object associated to the Ref + * + * @param ref - Ref handle + * + */ + +OCI_EXPORT OCI_TypeInfo * OCI_API OCI_RefGetTypeInfo +( + OCI_Ref *ref +); + +/** + * @brief + * Returns the object pointed by the Ref handle. + * + * @param ref - Ref handle + * + * @return + * The object handle is the ref is not null otherwise NULL + * + */ + +OCI_EXPORT OCI_Object * OCI_API OCI_RefGetObject +( + OCI_Ref *ref +); + +/** + * @brief + * Check if the Ref points to an object or not. + * + * @param ref - Ref handle + * + * @return + * TRUE if it does not point to a valid object otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_RefIsNull +( + OCI_Ref *ref +); + +/** + * @brief + * Nullify the given Ref handle + * + * @param ref - Ref handle + * + * @note + * this call clears the reference to object pointed by the Ref handle. + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_RefSetNull +( + OCI_Ref *ref +); + +/** + * @brief + * Returns the size of the hex representation of the given Ref handle + * + * @param ref - Ref handle + * + * @note + * the returned size is the number of character needed to store the + * hex representation of the Ref that can be retrieved with OCI_RefToText() + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_RefGetHexSize +( + OCI_Ref *ref +); + +/** + * @brief + * Converts a Ref handle value to a hexadecimal string. + * + * @param ref - Ref handle + * @param size - Destination string size in characters + * @param str - Destination string + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_RefToText +( + OCI_Ref *ref, + unsigned int size, + otext *str +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiAbort Aborting long operations + * @{ + * + * The Oracle OCI provides the ability to establish a server connection in : + * + * - blocking mode: each call to an OCI function returns control to the + * application when the call completes + * - non-blocking mode (based on polling paradigm) : the application have to + * call each function until its has completed its job + * + * OCILIB implements OCI in blocking mode. The application has to wait for OCI + * calls to complete to continue. + * + * Some operations can be long to be processed by the server. + * + * In order to cancel the current pending call, OCILIB provides OCI_Break() that + * cancel the last internal OCI Call and then raise an OCI abortion error code. + * + * @note + * Any call to OCI_Break() has to be done from a separate thread because the + * thread that has executed a long OCI call is waiting for its OCI call to complete. + * + * @par Example + * @include abort.c + * + */ + +/** + * @brief + * Perform an immediate abort of any currently Oracle OCI call + * + * @param con - connection handle + * + * @note + * The current call will abort and generate an error + * + * @return + * Returns FALSE if connection handle is NULL otherwise TRUE + */ + +OCI_EXPORT boolean OCI_API OCI_Break +( + OCI_Connection *con +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiMetadata Describing Schema Meta data and Objects + * @{ + * + * + * @par Example + * @include desc.c + * + */ + +/** + * @brief + * Retrieve the available type info information + * + * @param con - Connection handle + * @param name - Table/view name to query for + * @param type - Type of object + * + * @note + * Possible values for parameter type are : + * + * - OCI_UNKNOWN + * - OCI_TIF_TABLE + * - OCI_TIF_VIEW + * - OCI_TIF_TYPE + * + * @return + * - Type info handle on success + = - NULL if the object does not exist + * - NULL on failure + * + */ + +OCI_EXPORT OCI_TypeInfo * OCI_API OCI_TypeInfoGet +( + OCI_Connection *con, + const otext *name, + unsigned int type +); + +/** + * @brief + * Return the type of the type info object + * + * @param typinf - Type info handle + * + * @note + * Possible values for parameter type are : + * + * - OCI_UNKNOWN + * - OCI_TIF_TABLE + * - OCI_TIF_VIEW + * - OCI_TIF_TYPE + * + * @return + * Object type or OCI_UNKNOWN the input handle is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_TypeInfoGetType +( + OCI_TypeInfo *typinf +); + +/** + * @brief + * Retrieve connection handle from the type info handle + * + * @param typinf - Type info handle + * + */ + +OCI_EXPORT OCI_Connection * OCI_API OCI_TypeInfoGetConnection +( + OCI_TypeInfo *typinf +); + +/** + * @brief + * Free a type info object + * + * @param typinf - Type info handle + * + * @note + * this call is optional. + * OCI_TypeInfo object are internally tracked and + * automatically freed when their related connection is freed + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_TypeInfoFree +( + OCI_TypeInfo *typinf +); + +/** + * @brief + * Return the number of columns of a table/view/object + * + * @param typinf - Type info handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_TypeInfoGetColumnCount +( + OCI_TypeInfo *typinf +); + +/** + * @brief + * Return the column object handle at the given index in the table + * + * @param typinf - Type info handle + * @param index - Column position + * + * @return + * - Column handle on success + * - NULL if index is out of bounds or on error + * + */ + +OCI_EXPORT OCI_Column * OCI_API OCI_TypeInfoGetColumn +( + OCI_TypeInfo *typinf, + unsigned int index +); + +/** + * @brief + * Return the name described by the type info object + * + * @param typinf - Type info handle + * + */ + +OCI_EXPORT const otext * OCI_API OCI_TypeInfoGetName +( + OCI_TypeInfo *typinf +); + +/** +* @brief +* Indicate if the given UDT type if final +* +* @note +* Non-final types are virtual UDT type that can be inherited +* +* @param typinf - Type info handle +* +* @note +* This property is only valid for UDTs (OCI_TIF_TYPE) +* +* @return +* - when OCI_TypeInfoGetType() returns OCI_UNKNOWN, OCI_TIF_TABLE, OCI_TIF_VIEW: returns TRUE +* - when OCI_TypeInfoGetType() returns OCI_TIF_TYPE: returns TRUE if the type is final and FALSE if it is virtual +* +*/ + +OCI_EXPORT boolean OCI_API OCI_TypeInfoIsFinalType +( + OCI_TypeInfo *typinf +); + +/** +* @brief +* Return the super type of the given type (e.g. parent type for a derived ORACLE UDT type) +* +* @param typinf - Type info handle +* +* @note +* This property is only valid for UDTs (OCI_TIF_TYPE) +* +* @return +* - when OCI_TypeInfoGetType() returns OCI_UNKNOWN, OCI_TIF_TABLE, OCI_TIF_VIEW: +* - returns NULL +* - when OCI_TypeInfoGetType() returns OCI_TIF_TYPE: +* - returns the TypeInfo handle wrapping the parent super type +* - returns NULL if the given type is NOT deriving from a base type +* +*/ + +OCI_EXPORT OCI_TypeInfo* OCI_API OCI_TypeInfoGetSuperType +( + OCI_TypeInfo *typinf +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiFormatting Formatted functions + * @{ + * + * OCILIB offers some smart routines that takes a variable number of arguments + * in order to minimize OCILIB function calls and reduce the amount of code lines + * + * On Windows platforms, the target programming language must support the __cdecl + * calling convention + * + * @note + * OCI_Immediate() and OCI_ImmediateFmt() support all OCILIB supported types + * for output result, except : + * - OCI_Long + * - OCI_Statement + * If a query output result contains one of these unsupported types, the function returns FALSE + * + * @note + * In the parameter list, every output placeholder MUST be preceded by + * an integer parameter that indicates the type of the placeholder + * in order to handle correctly the given pointer. + * + * Possible values for indicating placeholders type : + * + * - OCI_ARG_SHORT ------> short * + * - OCI_ARG_USHORT -----> unsigned short * + * - OCI_ARG_INT --------> int * + * - OCI_ARG_UINT -------> unsigned int* + * - OCI_ARG_BIGINT -----> big_int * + * - OCI_ARG_BIGUINT ----> unsigned big_int * + * - OCI_ARG_DOUBLE ----> double * + * - OCI_ARG_FLOAT ------> float * + * - OCI_ARG_NUMBER -----> OCI_Number * + * - OCI_ARG_TEXT -------> otext * + * - OCI_ARG_RAW --------> void * + * - OCI_ARG_DATETIME ---> OCI_Date * + * - OCI_ARG_LOB --------> OCI_Lob * + * - OCI_ARG_FILE -------> OCI_File * + * - OCI_ARG_TIMESTAMP --> OCI_Timestamp * + * - OCI_ARG_INTERVAL ---> OCI_Interval * + * - OCI_ARG_OBJECT -----> OCI_Object * + * - OCI_ARG_COLLECTION -> OCI_Coll * + * - OCI_ARG_REF --------> OCI_Ref * + * + * @note + * For output strings and Raws, returned data is copied to the given buffer + * instead of returning a pointer the real data. + * So these buffers must be big enough to hold the column content. No size check is performed. + * + * - For strings, only the real string is copied. + * - For Raws, the number of bytes copied is the column size + * + * @warning + * Input parameters for formatted function only support a restricted set of data types ! + * + * Supported input identifiers : + * + * - '%s' : (otext *) ----------> input string (quotes are added) + * - '%m' : (otext *) ----------> meta data string (no quotes added) + * - '%t' : (OCI_Date *) -------> Date + * - '%p' : (OCI_Timestamp *) --> timestamp + * - '%v' : (OCI_Interval *) ---> Interval + * - '%i' : (int) --------------> signed 32 bits integer + * - '%u' : (unsigned int) -----> unsigned 32 bits integer + * - '%li' : (big_int) ----------> signed 64 bits integer + * - '%lu' : (big_uint) ---------> unsigned 64 bits integer + * - '%hi' : (short) ------------> signed 16 bits integer + * - '%hu' : (unsigned short) ---> unsigned 16 bits integer + * - '%g' : (double, float ) ---> Numerics + * - '%n' : (OCI_Number *) -----> Number + * - '%r' : (OCI_Ref *) --------> Reference + * - '%o' : (OCI_Object *) -----> Object (not implemented yet) + * - '%c' : (OCI_Coll *) -------> collection (not implemented yet) + * + * @par Example + * @include format.c + * + */ + +/** + * @brief + * Perform 3 calls (prepare+execute+fetch) in 1 call + * + * @param con - Connection handle + * @param sql - SQL statement + * @param ... - List of program variables address to store the result of fetch operation + * + * @note + * Every output parameter MUST be preceded by an integer parameter that indicates the type + * of the placeholder in order to handle correctly the given pointer. + * + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_Immediate +( + OCI_Connection *con, + const otext *sql, + ... +); + +/** + * @brief + * Performs 4 call (prepare+bind+execute+fetch) in 1 call + * + * @param con - Connection handle + * @param sql - SQL statement + * @param ... - List of program values to format the SQL followed by the + * output variables addresses for the fetch operation + * + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_ImmediateFmt +( + OCI_Connection *con, + const otext *sql, + ... +); + +/** + * @brief + * Prepare a formatted SQL statement or PL/SQL block. + * + * @param stmt - Statement handle + * @param sql - SQL statement + * @param ... - List of program values to format the SQL + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_PrepareFmt +( + OCI_Statement *stmt, + const otext *sql, + ... +); + +/** + * @brief + * Execute a formatted SQL statement or PL/SQL block. + * + * @param stmt - Statement handle + * @param sql - SQL statement + * @param ... - List of program values to format the SQL + * + * @return + * TRUE on success otherwise FALSE + * + * @warning + * If a SQL warning occurs: + * - the function returns TRUE + * - the SQL warning triggers the global error handler with an OCI_Error having its OCI_ErrorGetType() + * attribute set to OCI_ERR_WARNING + * - If OCILIB is initialized with the OCI_ENV_CONTEXT mode, OCI_GetLastError() will return the OCI_Error + * object corresponding to the warning + * + */ + +OCI_EXPORT boolean OCI_ExecuteStmtFmt +( + OCI_Statement *stmt, + const otext *sql, + ... +); + +/** + * @brief + * Parse a formatted SQL statement or PL/SQL block. + * + * @param stmt - Statement handle + * @param sql - SQL statement + * @param ... - List of program values to format the SQL + * + * @note + * This call sends the SQL or PL/SQL command to the server for parsing only. + * The command is not executed. + * This call is only useful to check is a command is valid or not. + * + * @note + * This call prepares the statement (internal call to OCI_Prepare()) and ask + * the Oracle server to parse its SQL or PL/SQL command. + * OCI_Execute() can be call after OCI_ParseFmt() in order to execute the + * statement, which means that the server will re-parse again the command. + * + * @warning + * Do not use OCI_ParseFmt() unless you're only interested in the parsing result + * because the statement will be parsed again when executed and thus leading to + * unnecessary server round-trips and less performance + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_ParseFmt +( + OCI_Statement *stmt, + const otext *sql, + ... +); + +/** + * @brief + * Describe the select list of a formatted SQL select statement. + * + * @param stmt - Statement handle + * @param sql - SQL statement + * @param ... - List of program values to format the SQL + * + * @note + * This call sends the SELECT SQL order to the server for retrieving the + * description of the select order only. + * The command is not executed. + * This call is only useful to retrieve information on the associated resultset + * Call OCI_GetResultset() after OCI_Describe() to access to SELECT list + * information + * + * @note + * This call prepares the statement (internal call to OCI_Prepare()) and ask + * the Oracle server to describe the output SELECT list. + * OCI_Execute() can be call after OCI_Describe() in order to execute the + * statement, which means that the server will parse, and describe again the SQL + * order. + * + * @warning + * Do not use OCI_Describe() unless you're only interested in the resultset + * information because the statement will be parsed again when executed and thus + * leading to unnecessary server round-trips and less performance + * + * @return + * TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_DescribeFmt +( + OCI_Statement *stmt, + const otext *sql, + ... +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiHashTables Hash tables + * @{ + * + * OCILIB uses hash tables internally for index/name columns mapping. + * + * OCILIB makes public its hash table’s implementation public for general purpose + * uses. + * + * OCI_HashTable objects manage string keys / values that can be : + * + * - integers + * - strings + * - pointers + * + * This hash table implementation : + * + * - handle collisions + * - allows multiple values per key + * + * @par Internal conception + * + * - The hash table is composed of an array of slots. + * - Each slot can hold a linked list of entries (one per key) + * - Each entry can hold a linked list of values + * + * @note + * - The internal hash function computes the index in the array where the entry + * has to be inserted/looked up. + * + * + * @note + * Collisions are handled by chaining method. + * + * @include hash.c + * + */ + +/** + * @brief + * Create a hash table + * + * @param size - size of the hash table + * @param type - type of the hash table + * + * @note + * Parameter can be one of the following values : + * + * - OCI_HASH_STRING : string values + * - OCI_HASH_INTEGER : integer values + * - OCI_HASH_POINTER : pointer values + * + * @return + * Hash handle on success or NULL on failure + * + */ + +OCI_EXPORT OCI_HashTable * OCI_API OCI_HashCreate +( + unsigned int size, + unsigned int type +); + +/** + * @brief + * Destroy a hash table + * + * @param table - Table handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_HashFree +( + OCI_HashTable *table +); + +/** + * @brief + * Return the size of the hash table + * + * @param table - Table handle + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_HashGetSize +( + OCI_HashTable *table +); + +/** + * @brief + * Return the type of the hash table + * + * @param table - Table handle + * + * @note + * the return value can be one of the following values : + * + * - OCI_HASH_STRING : string values + * - OCI_HASH_INTEGER : integer values + * - OCI_HASH_POINTER : pointer values + * + * @return + * Hash table data type or OCI_UNKNOWN the input handle is NULL + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_HashGetType +( + OCI_HashTable *table +); + +/** + * @brief + * Add a pair string key / string value to the hash table + * + * @param table - Table handle + * @param key - String key + * @param value - string value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_HashAddString +( + OCI_HashTable *table, + const otext *key, + const otext *value +); + +/** + * @brief + * Return the string value associated to the given key + * + * @param table - Table handle + * @param key - String key + * + * @return + * Stored string associated with the key otherwise NULL + * + */ + +OCI_EXPORT const otext * OCI_API OCI_HashGetString +( + OCI_HashTable *table, + const otext *key +); + +/** + * @brief + * Adds a pair string key / integer value to the hash table + * + * @param table - Table handle + * @param key - String key + * @param value - Integer value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_HashAddInt +( + OCI_HashTable *table, + const otext *key, + int value +); + +/** + * @brief + * Return the integer value associated to the given key + * + * @param table - Table handle + * @param key - String key + * + * @return + * Stored integer associated with the key otherwise 0 + * + */ + +OCI_EXPORT int OCI_API OCI_HashGetInt +( + OCI_HashTable *table, + const otext *key +); + +/** + * @brief + * Adds a pair string key / pointer value to the hash table + * + * @param table - Table handle + * @param key - String key + * @param value - Pointer value + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_HashAddPointer +( + OCI_HashTable *table, + const otext *key, + void *value +); + +/** + * @brief + * Return a pointer associated with the given key + * + * @param table - Table handle + * @param key - String key + * + * @return + * Stored pointer associated with the key otherwise NULL + * + */ + +OCI_EXPORT void * OCI_API OCI_HashGetPointer +( + OCI_HashTable *table, + const otext *key +); + +/** + * @brief + * Lookup for an entry matching the key in the table + * + * @param table - Table handle + * @param key - String key + * @param create - Do create the entry if not exists + * + * @return + * Entry handle if key found/added otherwise NULL + * + */ + +OCI_EXPORT OCI_HashEntry * OCI_API OCI_HashLookup +( + OCI_HashTable *table, + const otext *key, + boolean create +); + +/** + * @brief + * Return the first hash slot that matches the key + * + * @param table - Table handle + * @param key - String key + * + * @return + * Slot handle if key found otherwise NULL + * + */ + +OCI_EXPORT OCI_HashValue * OCI_API OCI_HashGetValue +( + OCI_HashTable *table, + const otext *key +); + +/** + * @brief + * Return the entry slot of the hash table internal list at the given position + * + * @param table - Table handle + * @param index - index + * + * @warning + * Index start at at + * + * @return + * Slot handle otherwise NULL + * + */ + +OCI_EXPORT OCI_HashEntry * OCI_API OCI_HashGetEntry +( + OCI_HashTable *table, + unsigned int index +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiThreading Threads and mutexes + * @{ + * + * Oracle proposes a portable implementation of Mutex and Thread objects + * + * OCILIB implements these OCI features for portable multi-threading support. + * + * Mutexes are designed for mutual exclusion between thread in order to lock resources temporarily + * + * Thread keys can be seen as process-wide variables that have a thread-specific + * values. It allows to create a unique key identified by a name (string) that + * can store values specific to each thread. + * + * OCILIB exposes the types OCI_Mutex, OCI_Thread + * + * @warning + * OCILIB MUST be initialized with OCI_ENV_THREADED to enable threads support + * + * @warning + * OCI_Thread relies on Oracle API which uses natives threading capabilities of + * the supported platform + * + * @warning + * Using OCI_Mutex : + * - On Microsoft Windows, a thread can call OCI_MutexAcquire() more than once + * without any blocking. Just be sure that there is an OCI_MutexRelease() for + * every OCI_MutexAcquire() call + * - On Unix systems, a thread MUST call OCI_MutexRelease() after every call to + * OCI_MutexAcquire() in order to be able to call OCI_MutexAcquire() again. If + * not, it will be blocked... + * + * @par Example + * @include thread.c + * + */ + +/** + * @brief + * Create a Mutex object + * + * @return + * Mutex handle on success or NULL on failure + * + */ + +OCI_EXPORT OCI_Mutex * OCI_API OCI_MutexCreate +( + void +); + +/** + * @brief + * Destroy a mutex object + * + * @param mutex - Mutex handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MutexFree +( + OCI_Mutex *mutex +); + +/** + * @brief + * Acquire a mutex lock + * + * @param mutex - Mutex handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MutexAcquire +( + OCI_Mutex *mutex +); + +/** + * @brief + * Release a mutex lock + * + * @param mutex - Mutex handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MutexRelease +( + OCI_Mutex *mutex +); + +/** + * @brief + * Create a Thread object + * + * @return + * Thread handle on success or NULL on failure + * + */ + +OCI_EXPORT OCI_Thread * OCI_API OCI_ThreadCreate +( + void +); + +/** + * @brief + * Destroy a thread object + * + * @param thread - Thread handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ThreadFree +( + OCI_Thread *thread +); + +/** + * @brief + * Execute the given routine within the given thread object + * + * @param thread - Thread handle + * @param proc - routine to execute + * @param arg - parameter to pass to the routine + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ThreadRun +( + OCI_Thread *thread, + POCI_THREAD proc, + void *arg +); + +/** + * @brief + * Join the given thread + * + * @param thread - Thread handle + * + * @note + * This function waits for the given thread to finish + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ThreadJoin +( + OCI_Thread *thread +); + +/** + * @brief + * Create a thread key object + * + * @param name - Thread key name + * @param destfunc - Thread key value destructor function + * + * @note + * Parameter proc is optional. It's called when the thread terminates to allow + * the program to deal with the thread specific value of the key + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ThreadKeyCreate +( + const otext *name, + POCI_THREADKEYDEST destfunc +); + +/** + * @brief + * Set a thread key value + * + * @param name - Thread key name + * @param value - user value to set + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_ThreadKeySetValue +( + const otext *name, + void *value +); + +/** + * @brief + * Get a thread key value + * + * @param name - Thread key name + * + * @return + * Thread key value on success otherwise FALSE + * + */ + +OCI_EXPORT void * OCI_API OCI_ThreadKeyGetValue +( + const otext *name +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiDirectPath Direct Path loading + * @{ + * + * OCILIB (from version 3.2.0) support the OCI direct Path API. + * + * Actual implementation of direct path API does not support the following + * elements : + * - Objects data types (User Defined Types and Object References) + * - Object tables + * - Nested tables + * - SQL String functions + * + * All scalar data types (numerics, characters and date/time), including LOBs + * and LONG types are supported + * + * @par Oracle direct API features (from Oracle Documentation) + * + * The direct path load interface allows an application to access the direct path + * load engine of the Oracle database server to perform the functions of the + * Oracle SQL*Loader utility. + * This functionality provides the ability to load data from external files + * into Oracle database objects, either a table or a partition of a partitioned + * table. + * The OCI direct path load interface has the ability to load multiple rows by + * loading a direct path stream which contains data for multiple rows. + * + * @par Oracle direct API limitation (from Oracle Documentation) + * The direct path load interface has the following limitations which are the + * same as SQL*Loader: + * - triggers are not supported + * - check constraints are not supported + * - referential integrity constraints are not supported + * - clustered tables are not supported + * - loading of remote objects is not supported + * - user-defined types are not supported + * - LOBs must be specified after all scalar columns + * - LONGs must be specified last + * + * @warning + * + * Its recommended to use direct path interface with an Oracle client that is + * the same version than the database. With version < 10g, it is mandatory + * regarding that it causes segmentation faults and it's known from Oracle that + * advices to use the same version for client and server (see metalink KB) + * + * @par How to use direct path + * + * - 1 : Create a direct path handle with OCI_DirPathCreate() + * - 2 : Set (optional) some direct path load attributes + * - 3 : Describe the columns to load with OCI_DirPathSetColumn() + * - 4 : Populate data with OCI_DirPathSetEntry() + * - 5 : Convert the data with OCI_DirPathConvert() + * - 6 : Load the data into the database with OCI_DirPathLoad() + * - 7 : Repeat step 4,5,6 + reset the stream with OCI_DirPathReset() until all + * rows has been loaded + * - 8 : Commit the load with OCI_DirPathFinish() + * - 9 : Free the direct path handle with OCI_DirPathFree() + * + * @par Example + * @include dirpath.c + * + */ + +/** + * @brief + * Create a direct path object + * + * @param typinf - Table type info handle + * @param partition - Partition name + * @param nb_cols - Number of columns to load + * @param nb_rows - Maximum of rows to handle per load operation + * + * @note + * Retrieve the table type info handle with OCI_TypeInfoGet(). + * The partition name is not mandatory + * + * @note + * Parameter 'nb_rows' is ignored for Oracle 8i. Prior to Oracle 9i, it's the + * OCI client that decides of the number of rows to process per convert/load calls. + * From Oracle 9i, OCI allows application to specify this value. Note that, the + * OCI client might not accept the input value. After OCI_DirPathPrepare() has + * been successfully called, OCI_DirPathGetMaxRows() returns the final number + * of rows used for the given direct path operation. + * + * @return + * Return the direct path handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_DirPath * OCI_API OCI_DirPathCreate +( + OCI_TypeInfo *typinf, + const otext *partition, + unsigned int nb_cols, + unsigned int nb_rows +); + +/** + * @brief + * Free an OCI_DirPath handle + * + * @param dp - Direct path Handle + * + * @return + * TRUE on success otherwise FALSE + * + */ +OCI_EXPORT boolean OCI_API OCI_DirPathFree +( + OCI_DirPath *dp +); + +/** + * @brief + * Describe a column to load into the given table + * + * @param dp - Direct path Handle + * @param index - Column index + * @param name - Column name + * @param maxsize - Maximum input value size for a column entry + * @param format - Date or numeric format to use + * + * @note + * An error is thrown if : + * - If the column specified by the 'name' parameter is not found in the table + * referenced by the type info handle passed to OCI_DirPathCreate() + * - the index is out of bounds (= 0 or >= number of columns) + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathSetColumn +( + OCI_DirPath *dp, + unsigned int index, + const otext *name, + unsigned int maxsize, + const otext *format +); + +/** + * @brief + * Prepares the OCI direct path load interface before any rows can be converted + * or loaded + * + * @param dp - Direct path Handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathPrepare +( + OCI_DirPath *dp +); + +/** + * @brief + * Set the value of the given row/column array entry + * + * @param dp - Direct path Handle + * @param row - Row index + * @param index - Column index + * @param value - Value to set + * @param size - Size of the input value + * @param complete - Is the entry content fully provided ? + * + * @note + * Rows and columns indexes start at 1. + * + * @note + * The 'size' parameter is expressed in number of : + * - bytes for binary columns + * - characters for other columns + * + * @note + * Direct path support piece loading for LONGs and LOBs columns. When filling + * these columns, it's possible to provide input buffer piece by piece. In order + * to do so : + * - set the 'complete' parameter to FALSE + * - set the 'size' parameter to the piece size + * - Repeat calls to OCI_DirPathSetEntry() until the data is totally provided + * - The last call that set the last piece or an entry must specify the value + * TRUE for the 'complete' parameter + * + * @warning + * Current Direct Path OCILIB implementation DOES NOT support setting entry + * content piece by piece as mentioned above. It was planned in the original design + * but not supported yet. So, always set the complete parameter to TRUE. + * Setting entries content piece by piece may be supported in future releases + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathSetEntry +( + OCI_DirPath *dp, + unsigned int row, + unsigned int index, + void *value, + unsigned size, + boolean complete +); + +/** + * @brief + * Convert provided user data to the direct path stream format + * + * @param dp - Direct path Handle + * + * @return + * Possible return values : + * - OCI_DPR_COMPLETE : load has been successful + * - OCI_DPR_ERROR : an error happened while loading data + * - OCI_DPR_FULL : the internal stream is full + * - OCI_DPR_PARTIAL : a column has not been fully filled yet + * - OCI_DPR_EMPTY : no data was found to convert + * + * @note + * - When using conversion mode OCI_DCM_DEFAULT, OCI_DirPathConvert() stops when + * any error is encountered and returns OCI_DPR_ERROR + * - When using conversion mode OCI_DCM_FORCE, OCI_DirPathConvert() does not stop + * on errors. Instead it discards any erred rows and returns OCI_DPR_COMPLETE once + * all rows are processed. + * + * @note + * List of faulted rows and columns can be retrieved using OCI_DirPathGetErrorRow() and + * OCI_DirPathGetErrorColumn() + * + * @note + * OCI_DirPathGetAffectedRows() returns the number of rows converted in the last call. + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_DirPathConvert +( + OCI_DirPath *dp +); + +/** + * @brief + * Loads the data converted to direct path stream format + * + * @param dp - Direct path Handle + * + * @return + * Possible return values : + * - OCI_DPR_COMPLETE : conversion has been successful + * - OCI_DPR_ERROR : an error happened while converting data + * - OCI_DPR_FULL : the internal stream is full + * - OCI_DPR_PARTIAL : a column has not been fully filled yet + * - OCI_DPR_EMPTY : no data was found to load + * + * @note + * List of faulted rows can be retrieved using OCI_DirPathGetErrorRow() + * + * @note + * OCI_DirPathGetAffectedRows() returns the number of rows successfully loaded in the last call. + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_DirPathLoad +( + OCI_DirPath *dp +); + +/** + * @brief + * Reset internal arrays and streams to prepare another load + * + * @param dp - Direct path Handle + * + * @note + * Once some data have been converted or loaded, OCI_DirPathReset() resets + * internal OCI structures in order to prepare another load operation + * (set entries, convert and load) + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathReset +( + OCI_DirPath *dp +); + +/** + * @brief + * Terminate a direct path operation and commit changes into the database + * + * @param dp - Direct path Handle + * + * @warning + * The direct path handle cannot be used anymore after this call for any more + * loading operations and must be freed with OCI_DirPathFree(). + * + * @note + * Some properties functions of the direct path handle, such as + * OCI_DirPathGetRowCount() can be called on a terminated direct path handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathFinish +( + OCI_DirPath *dp +); + +/** + * @brief + * Terminate a direct path operation without committing changes + * + * @param dp - Direct path Handle + * + * @note + * Any pending loaded data are canceled. + * Any load completion operations, such as index maintenance operations, are not performed. + * + * @warning + * The direct path handle cannot be used anymore after this call for any more + * loading operations and must be freed with OCI_DirPathFree(). + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathAbort +( + OCI_DirPath *dp +); + +/** + * @brief + * Execute a data save-point (server side) + * + * @param dp - Direct path Handle + * + * @note + * Executing a data save-point is not allowed for LOBs + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathSave +( + OCI_DirPath *dp +); + +/** + * @brief + * Flushes a partially loaded row from server + * + * @param dp - Direct path Handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathFlushRow +( + OCI_DirPath *dp +); + +/** + * @brief + * Set the current number of rows to convert and load + * + * @param dp - Direct path Handle + * @param nb_rows - Number of row to process + * + * @warning + * An OCILIB error will be thrown if the value exceeds the maximum number of + * rows in the internals arrays + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathSetCurrentRows +( + OCI_DirPath *dp, + unsigned int nb_rows +); + +/** + * @brief + * Return the current number of rows used in the OCILIB internal + * arrays of rows + * + * @param dp - Direct path Handle + * + * @return + * Internal current array size on SUCCESS otherwise 0 + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_DirPathGetCurrentRows +( + OCI_DirPath *dp +); + +/** + * @brief + * Return the maximum number of rows allocated in the OCI and OCILIB + * internal arrays of rows + * + * @param dp - Direct path Handle + * + * @return + * Internal maximum array size on SUCCESS otherwise 0 + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_DirPathGetMaxRows +( + OCI_DirPath *dp +); + +/** + * @brief + * Set the default date format string for input conversion + * + * @param dp - Direct path Handle + * @param format - date format + * + * @note + * For string to date conversion, Oracle uses : + * - Column date format + * - Default date format (modified by this call) + * - Default global support environment setting + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathSetDateFormat +( + OCI_DirPath *dp, + const otext *format +); + +/** + * @brief + * Set the parallel loading mode + * + * @param dp - Direct path Handle + * @param value - enable/disable parallel mode + * + * @note + * Default value is FALSE. + * + * @note + * Setting the value to TRUE allows multiple load sessions to load the same + * segment concurrently + * + * @par Parallel loading mode (From Oracle documentation) + * + * A direct load operation requires that the object being loaded is locked to + * prevent DML on the object. + * Note that queries are lock-free and are allowed while the object is being loaded. + * - For a table load, if the option is set to: + * - FALSE, then the table DML X-Lock is acquired. + * - TRUE, then the table DML S-Lock is acquired. + * - For a partition load, if the option is set to: + * - FALSE, then the table DML SX-Lock and partition DML X-Lock is acquired. + * - TRUE, then the table DML SS-Lock and partition DML S-Lock is acquired. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathSetParallel +( + OCI_DirPath *dp, + boolean value +); + +/** + * @brief + * Set the logging mode for the loading operation + * + * @param dp - Direct path Handle + * @param value - enable/disable logging + * + * @par Logging mode (from Oracle Documentation) + * + * The NOLOG attribute of each segment determines whether image redo or + * invalidation redo is generated: + * - FALSE : Use the attribute of the segment being loaded. + * - TRUE : No logging. Overrides DDL statement, if necessary. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathSetNoLog +( + OCI_DirPath *dp, + boolean value +); + +/** + * @brief + * Set number of elements in the date cache + * + * @param dp - Direct path Handle + * @param size - Buffer size + * + * @note + * Default value is 0. + * + * @note + * Setting the value to 0 disables the cache + * + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathSetCacheSize +( + OCI_DirPath *dp, + unsigned int size +); + +/** + * @brief + * Set the size of the internal stream transfer buffer + * + * @param dp - Direct path Handle + * @param size - Buffer size + * + * @note + * Default value is 64KB. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathSetBufferSize +( + OCI_DirPath *dp, + unsigned int size +); + +/** + * @brief + * Set the direct path conversion mode + * + * @param dp - Direct path Handle + * @param mode - Conversion mode + * + * @note + * Possible values for parameter 'mode' : + * - OCI_DCM_DEFAULT : conversion fails on error + * - OCI_DCM_FORCE : conversion does not fail on error + * + * @note + * See OCI_DirPathConvert() for conversion mode details + * + * @note + * Default value is OCI_DCM_DEFAULT + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DirPathSetConvertMode +( + OCI_DirPath *dp, + unsigned int mode +); + +/** + * @brief + * Return the number of rows successfully loaded into the database so far + * + * @param dp - Direct path Handle + * + * @note + * Insertions are committed with OCI_DirPathFinish() + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_DirPathGetRowCount +( + OCI_DirPath *dp +); + +/** + * @brief + * return the number of rows successfully processed during in the last + * conversion or loading call + * + * @param dp - Direct path Handle + * + * @note + * This function called after : + * + * - OCI_DirPathConvert(), returns the number of converted rows + * - OCI_DirPathLoad(), returns the number of loaded rows + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_DirPathGetAffectedRows +( + OCI_DirPath *dp +); + +/** + * @brief + * Return the index of a column which caused an error during data conversion + * + * @param dp - Direct path Handle + * + * @warning + * Direct path column indexes start at 1. + * + * @note + * Errors may happen while data is converted to direct path stream format + * using OCI_DirPathConvert(). + * When using conversion mode OCI_DCM_DEFAULT, OCI_DirPathConvert() returns + * OCI_DPR_ERROR on error. OCI_DirPathGetErrorColumn() returns the column index + * that caused the error + * When using conversion mode OCI_DCM_FORCE, OCI_DirPathConvert() returns + * OCI_DPR_COMPLETE even on errors. In order to retrieve the list of all column + * indexes that have erred, the application can call OCI_DirPathGetErrorColumn() + * repeatedly until it returns 0. + * + * @note + * The internal value is reset to 0 when calling OCI_DirPathConvert() + * + * @return + * 0 is no error occurs otherwise the index of the given column which caused an + * error + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_DirPathGetErrorColumn +( + OCI_DirPath *dp +); + +/** + * @brief + * Return the index of a row which caused an error during data conversion + * + * @param dp - Direct path Handle + * + * @warning + * Direct path row indexes start at 1. + * + * @note + * Errors may happen : + * - while data is converted to direct path stream format using OCI_DirPathConvert() + * - while data is loaded to database using OCI_DirPathLoad() + * + * @note + * When using conversion mode OCI_DCM_DEFAULT, OCI_DirPathConvert() returns + * OCI_DPR_ERROR on error. OCI_DirPathGetErrorRow() returns the row index that + * caused the error. + * When using conversion mode OCI_DCM_FORCE, OCI_DirPathConvert() returns + * OCI_DPR_COMPLETE even on errors. In order to retrieve the list of all row + * indexes that have erred, the application can call OCI_DirPathGetErrorRow() + * repeatedly until it returns 0. + * + * @note + * After a call to OCI_DirPathLoad(), in order to retrieve the list of all faulted rows + * indexes, the application can call OCI_DirPathGetErrorRow() repeatedly until it returns 0. + * + * @note + * The internal value is reset to 0 when calling OCI_DirPathConvert(), + * OCI_DirPathReset() or OCI_DirPathLoad() + * + * @return + * 0 is no error occurs otherwise the index of the given row which caused an + * error + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_DirPathGetErrorRow +( + OCI_DirPath *dp +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiAdvancedQueuing Oracle Advanced Queuing (A/Q) + * @{ + * + * OCILIB supports Oracle Advanced Queues features + * + * Let's Oracle talk about this features ! + * + * @par Oracle Queues (from Oracle Streams - Advanced Queuing User's Guide) + * + * Oracle Streams AQ provides database-integrated message queuing functionality. + * It is built on top of Oracle Streams and leverages the functions of Oracle + * Database so that messages can be stored persistently, propagated between + * queues on different computers and databases, and transmitted using Oracle + * Net Services and HTTP(S). + * Because Oracle Streams AQ is implemented in database tables, all operational + * benefits of high availability, scalability, and reliability are also + * applicable to queue data. Standard database features such as recovery, + * restart, and security are supported by Oracle Streams AQ. You can use + * database development and management tools such as Oracle Enterprise Manager + * to monitor queues. Like other database tables, queue tables can be imported + * and exported. + * + * @par OCILIB implementation + * + * OCILIB provides a (nearly) full C implementation of Advanced Queues available in + * Oracle OCI and proposes the following data types : + * - OCI_Msg : Implementation of message to enqueue/dequeue from/to queues + * - OCI_Enqueue : Implementation of enqueuing process + * - OCI_Dequeue : Implementation of dequeuing process + * - OCI_Agent : Implementation of Advanced queues Agents + * + * OCILIB support AQ messages notification with Oracle Client 10gR2 or above + * + * Note that the only AQ features not supported yet by OCILIB are : + * - Payloads of type AnyData + * - Enqueuing/dequeuing arrays of messages + * - Optional delivery mode introduced in 10gR2 + * + * OCILIB provides as well a C API to administrate queues and queue tables initially + * reserved to PL/SQL and Java (wrappers around PL/SQL calls). + * This API, based on internal PL/SQL calls wrapping the DBMS_AQADM packages procedures, allow the + * following actions : + * - create, alter, drop and purge queue tables (OCI_QueueTableXXX calls) + * - create, alter, drop, start, stop queues (OCI_QueueXXX calls) + * + * Note that the user connected to the database needs particular privileges to manipulate or + * administrate queues (See Oracle Streams - Advanced Queuing User's Guide for more information + * on these privileges) + * + * @par Example + * @include queue.c + * + */ + +/** + * @brief + * Create a message object based on the given payload type + * + * @param typinf - Type info handle + * + * @note + * OCILIB supports 2 type of message payload : + * - Oracle types (UDT) + * - RAW data + * + * @note + * Oracle Type AnyData is not supported in the current version of OCILIB + * + * @note + * the parameter 'typinf' indicates the type of payload : + * - For object payload, retrieve the object type information handle with + * OCI_TypeInfoGet() using the object type name + * - For RAW payload, you MUST pass the object type information retrieved with + * OCI_TypeInfoGet() using "SYS.RAW" as object type name + * + * @warning + * Newly created Message handles have NULL payloads. + * For Message handling Objects payloads, OCI_MsgGetObject() returns NULL until an object handle is + * assigned to the message. + * + * @note + * When a local OCI_Msg handle is enqueued, it keeps its attributes. If it's enqueued again, another + * identical message is posted into the queue. + * To reset a message and empty all its properties, call OCI_MsgReset() + * Note that OCI_MsgReset() clears the message payload. + * + * @return + * Return the message handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Msg * OCI_API OCI_MsgCreate +( + OCI_TypeInfo *typinf +); + +/** + * @brief + * Free a message object + * + * @param msg - Message handle + * + * @warning + * Only message handles created with OCI_MsgCreate() should be freed by OCI_MsgFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgFree +( + OCI_Msg *msg +); + +/** + * @brief + * Reset all attributes of a message object + * + * @param msg - Message handle + * + * @note + * This function calls OCI_MsgSetxxx() with default or NULL attributes + * + * @warning + * OCI_MsgReset() clears the message payload and set it to NULL + * For messages handling objects payloads, OCI_MsgSetObject() must be called again to assign a + * payload. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgReset +( + OCI_Msg *msg +); + +/** + * @brief + * Get the object payload of the given message + * + * @param msg - Message handle + * + * @return + * Return the object handle on success otherwise NULL on failure or if payload is NULL + * + */ + +OCI_EXPORT OCI_Object * OCI_API OCI_MsgGetObject +( + OCI_Msg *msg +); + +/** + * @brief + * Set the object payload of the given message + * + * @param msg - Message handle + * @param obj - Object handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgSetObject +( + OCI_Msg *msg, + OCI_Object *obj +); + +/** + * @brief + * Get the RAW payload of the given message + * + * @param msg - Message handle + * @param raw - Input buffer + * @param size - Input buffer maximum size + * + * @note + * On output, parameter 'size' holds the number of bytes copied into the given buffer + * + * @return + * TRUE on success otherwise FALSE on failure or if payload is object based. + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgGetRaw +( + OCI_Msg *msg, + void *raw, + unsigned int *size +); + +/** + * @brief + * Set the RAW payload of the given message + * + * @param msg - Message handle + * @param raw - Raw data + * @param size - Raw data size + * + * @return + * TRUE on success otherwise FALSE on failure or if payload is object based. + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgSetRaw +( + OCI_Msg *msg, + const void *raw, + unsigned int size +); + +/** + * @brief + * Return the number of attempts that have been made to dequeue the message + * + * @param msg - Message handle + * + */ + +OCI_EXPORT int OCI_API OCI_MsgGetAttemptCount +( + OCI_Msg *msg +); + +/** + * @brief + * Return the number of seconds that a message is delayed for dequeuing + * + * @param msg - Message handle + * + * @note + * see OCI_MsgSetEnqueueDelay() for more details + * + */ + +OCI_EXPORT int OCI_API OCI_MsgGetEnqueueDelay +( + OCI_Msg *msg +); + +/** + * @brief + * set the number of seconds to delay the enqueued message + * + * @param msg - Message handle + * @param value - Delay in seconds + * + * @note + * The delay represents the number of seconds after which a message is available for dequeuing. + * When the message is enqueued, its state is set to OCI_AMS_WAITING. + * When the delay expires, its state is set to OCI_AMS_READY. + * + * @note + * If parameter 'value' is set to zero (default value), the message will be immediately available + * for dequeuing + * + * @warning + * Dequeuing by Message ID overrides the delay specification. + * + * @warning + * Delaying processing requires the queue monitor to be started. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgSetEnqueueDelay +( + OCI_Msg *msg, + int value +); + +/** + * @brief + * return the time the message was enqueued + * + * @param msg - Message handle + * + * @note + * Only use this function for message dequeued from queues + * + */ + +OCI_EXPORT OCI_Date * OCI_API OCI_MsgGetEnqueueTime +( + OCI_Msg *msg +); + +/** + * @brief + * Return the duration that the message is available for dequeuing + * + * @param msg - Message handle + * + * @note + * see OCI_MsgSetExpiration() for more details + * + */ + +OCI_EXPORT int OCI_API OCI_MsgGetExpiration +( + OCI_Msg *msg +); + +/** + * @brief + * set the duration that the message is available for dequeuing + * + * @param msg - Message handle + * @param value - duration in seconds + * + * @note + * This parameter is an offset from the delay (see OCI_MsgSetEnqueueDelay()) + * While waiting for expiration, the message state is set to OCI_AMS_READY. + * If the message is not dequeued before it expires, it will be moved to the exception queue + * with the state OCI_AMS_EXPIRED. + * + * @note + * If parameter 'value' is set to -1 (default value), the message will not expire + * + * @warning + * Expiration processing requires the queue monitor to be started. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgSetExpiration +( + OCI_Msg *msg, + int value +); + +/** + * @brief + * Return the state of the message at the time of the dequeue + * + * @param msg - Message handle + * + * @return + * - OCI_UNKNOWN : the function has failed to get the message state + * - OCI_AMS_READY : the message is ready to be processed + * - OCI_AMS_WAITING : the message delay has not yet completed + * - OCI_AMS_PROCESSED : the message has been processed + * - OCI_AMS_EXPIRED : the message has moved to exception queue + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_MsgGetState +( + OCI_Msg *msg +); + +/** + * @brief + * Return the priority of the message + * + * @param msg - Message handle + * + * @note + * see OCI_MsgSetPriority() for more details + * + */ + +OCI_EXPORT int OCI_API OCI_MsgGetPriority +( + OCI_Msg *msg +); + +/** + * @brief + * Set the priority of the message + * + * @param msg - Message handle + * @param value - Message priority + * + * @note + * - The priority can be any number, including negative numbers. + * - A smaller number indicates higher priority. + * - Default value is zero. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgSetPriority +( + OCI_Msg *msg, + int value +); + +/** + * @brief + * Return the ID of the message + * + * @param msg - Message handle + * @param id - Input buffer + * @param len - Input buffer maximum size + * + * @note + * The message ID is : + * - generated when the message is enqueued in the queue + * - retrieved when the message is dequeued from the queue + * + * @note + * On output, parameter 'len' holds the number of bytes copied into the given buffer + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgGetID +( + OCI_Msg *msg, + void *id, + unsigned int *len +); + +/** + * @brief + * Return the original ID of the message in the last queue that generated this message + * + * @param msg - Message handle + * @param id - Input buffer + * @param len - Input buffer maximum size + * + * @warning + * When a message is propagated from/to different queues, this ID is the one generated for the + * message in the previous queue. + * + * @note + * On output, parameter 'len' holds the number of bytes copied into the given buffer + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgGetOriginalID +( + OCI_Msg *msg, + void *id, + unsigned int *len +); + +/** + * @brief + * Set the original ID of the message in the last queue that generated this message + * + * @param msg - Message handle + * @param id - Message ID + * @param len - Message ID size + * + * @warning + * When a message is propagated from/to different queues, this ID is the one generated for the + * message in the previous queue. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgSetOriginalID +( + OCI_Msg *msg, + const void *id, + unsigned int len +); + +/** + * @brief + * Return the original sender of a message + * + * @param msg - Message handle + * + * @return + * Sender Handle (OCI_Agent *) on success (if set at enqueue time) otherwise NULL + * + */ + +OCI_EXPORT OCI_Agent * OCI_API OCI_MsgGetSender +( + OCI_Msg *msg +); + +/** + * @brief + * Set the original sender of a message + * + * @param msg - Message handle + * @param sender - Message sender + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgSetSender +( + OCI_Msg *msg, + OCI_Agent *sender +); + +/** + * @brief + * Set the recipient list of a message to enqueue + * + * @param msg - Message handle + * @param consumers - Recipients list (array of agent handles) + * @param count - Number of recipients + * + * @warning + * This function should only be used for queues which allow multiple consumers. + * The default recipients are the queue subscribers. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgSetConsumers +( + OCI_Msg *msg, + OCI_Agent **consumers, + unsigned int count +); + +/** + * @brief + * Get the correlation identifier of the message + * + * @param msg - Message handle + * + * @note + * see OCI_MsgSetCorrelation() for more details + * + */ + +OCI_EXPORT const otext * OCI_API OCI_MsgGetCorrelation +( + OCI_Msg *msg +); + +/** + * @brief + * set the correlation identifier of the message + * + * @param msg - Message handle + * @param correlation - Message correlation text + * + * @note + * see OCI_DequeueSetCorrelation() for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgSetCorrelation +( + OCI_Msg *msg, + const otext *correlation +); + +/** + * @brief + * Get the Exception queue name of the message + * + * @param msg - Message handle + * + * @warning + * When calling this function on a message retrieved with OCI_DequeueGet(), the returned value is + * NULL if the default exception queue associated with the current queue is used (e.g. no user + * defined specified at enqueue time for the message) + * + * @note + * see OCI_MsgSetExceptionQueue() for more details + * + */ +OCI_EXPORT const otext * OCI_API OCI_MsgGetExceptionQueue +( + OCI_Msg *msg +); + +/** + * @brief + * Set the name of the queue to which the message is moved to if it cannot be + * processed successfully + * + * @param msg - Message handle + * @param queue - Exception queue name + * + * @warning + * From Oracle Documentation : + * + * "Messages are moved into exception queues in two cases : + * - If the number of unsuccessful dequeue attempts has exceeded the attribute 'max_retries' of + * given queue + * - if the message has expired. + * + * All messages in the exception queue are in the EXPIRED state. + * + * The default is the exception queue associated with the queue table. + * + * If the exception queue specified does not exist at the time of the move the message will be + * moved to the default exception queue associated with the queue table and a warning will be + * logged in the alert file. + * + * This attribute must refer to a valid queue name." + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_MsgSetExceptionQueue +( + OCI_Msg *msg, + const otext *queue +); + +/** + * @brief + * Create a Enqueue object for the given queue + * + * @param typinf - Type info handle + * @param name - Queue name + * + * @note + * OCILIB supports 2 type of message payload : + * - Oracle types (UDT) + * - RAW data + * + * @note + * Oracle Type AnyData is not supported in the current version of OCILIB + * + * @note + * the parameter 'typinf' indicates the type of payload to enqueue to the given queue : + * - For object payload, retrieve the object type information handle with + * OCI_TypeInfoGet() using the object type name + * - For RAW payload, you MUST pass the object type information retrieved with + * OCI_TypeInfoGet() using "SYS.RAW" as object type name + * + * @return + * Return the Enqueue handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Enqueue * OCI_API OCI_EnqueueCreate +( + OCI_TypeInfo *typinf, + const otext *name +); + +/** + * @brief + * Free a Enqueue object + * + * @param enqueue - Enqueue handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_EnqueueFree +( + OCI_Enqueue *enqueue +); + +/** + * @brief + * Enqueue a message on the queue associated to the Enqueue object + * + * @param enqueue - Enqueue handle + * @param msg - Message handle to enqueue + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_EnqueuePut +( + OCI_Enqueue *enqueue, + OCI_Msg *msg +); + +/** +* @brief +* Set the enqueuing sequence of messages to put in the queue +* +* @param enqueue - Enqueue handle +* @param sequence - enqueuing sequence +* +* @note +* Possible values for parameter 'sequence' : +* - OCI_ASD_BEFORE : enqueue message before another message +* - OCI_ASD_TOP : enqueue message before all messages +* +* @note +* Default value is OCI_ASD_TOP +* +* @note +* if the parameter 'sequence' is set to OCI_ASD_BEFORE, the application must +* call OCI_EnqueueSetRelativeMsgID() before enqueuing the next message in the queue. +* +* @note +* In order to stop enqueuing message using a sequence deviation, call +* OCI_EnqueueSetSequenceDeviation() with the value OCI_ASD_TOP +* +* @return +* TRUE on success otherwise FALSE +* +*/ + +OCI_EXPORT boolean OCI_API OCI_EnqueueSetSequenceDeviation +( + OCI_Enqueue *enqueue, + unsigned int sequence +); + +/** + * @brief + * Return the sequence deviation of messages to enqueue to the queue + * + * @param enqueue - Enqueue handle + * + * @note + * see OCI_EnqueueSetSequenceDeviation() for more details + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_EnqueueGetSequenceDeviation +( + OCI_Enqueue *enqueue +); + +/** + * @brief + * Set whether the new message is enqueued as part of the current transaction + * + * @param enqueue - Enqueue handle + * @param visibility - Enqueuing visibility + * + * @note + * Possible values for parameter 'visibility' : + * - OCI_AMV_IMMEDIATE : enqueue is an independent transaction + * - OCI_AMV_ON_COMMIT : enqueue is part of current transaction + * + * @note + * Default value is OCI_AMV_ON_COMMIT + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_EnqueueSetVisibility +( + OCI_Enqueue *enqueue, + unsigned int visibility +); + +/** + * @brief + * Get the enqueuing/locking behavior + * + * @param enqueue - Enqueue handle + * + * @note + * see OCI_EnqueueSetVisibility() for more details + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_EnqueueGetVisibility +( + OCI_Enqueue *enqueue +); + +/** + * @brief + * Set a message identifier to use for enqueuing messages using a sequence deviation + * + * @param enqueue - Enqueue handle + * @param id - message identifier + * @param len - pointer to message identifier length + * + * @note + * This call is only valid if OCI_EnqueueSetSequenceDeviation() has been called + * with the value OCI_ASD_BEFORE + * + * @warning + * if the function cannot assign the message id, the content of the parameter 'len' is set to zero. + * + * @note + * see OCI_EnqueueSetSequenceDeviation() for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_EnqueueSetRelativeMsgID +( + OCI_Enqueue *enqueue, + const void *id, + unsigned int len +); + +/** + * @brief + * Get the current associated message identifier used for enqueuing messages + * using a sequence deviation + * + * @param enqueue - Enqueue handle + * @param id - buffer to receive the message identifier + * @param len - pointer to buffer max length + * + * @warning + * When the function returns, parameter 'len' hold the number of bytes assigned to parameter 'id' + * + * @note + * see OCI_EnqueueGetRelativeMsgID() for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_EnqueueGetRelativeMsgID +( + OCI_Enqueue *enqueue, + void *id, + unsigned int *len +); + +/** + * @brief + * Create a Dequeue object for the given queue + * + * @param typinf - Type info handle + * @param name - Queue name + * + * @note + * OCILIB supports 2 type of message payload : + * - Oracle types (UDT) + * - RAW data + * + * @note + * Oracle Type AnyData is not supported in the current version of OCILIB + * + * @note + * the parameter 'typinf' indicates the type of payload to dequeue from the given queue : + * - For object payload, retrieve the object type information handle with + * OCI_TypeInfoGet() using the object type name + * - For RAW payload, you MUST pass the object type information retrieved with + * OCI_TypeInfoGet() using "SYS.RAW" as object type name + * + * @return + * Return the Dequeue handle on success otherwise NULL on failure + * + */ + +OCI_EXPORT OCI_Dequeue * OCI_API OCI_DequeueCreate +( + OCI_TypeInfo *typinf, + const otext *name +); + +/** + * @brief + * Free a Dequeue object + * + * @param dequeue - Dequeue handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DequeueFree +( + OCI_Dequeue *dequeue +); + +/** + * @brief + * Dequeue messages from the given queue + * + * @param dequeue - Dequeue handle + * + * @warning + * The returned message is handled by the dequeue object. + * Do not release it with OCI_MsgFree() + * + * @warning + * When dequeuing from a multiple consumer queue, you need + * to set the navigation mode to OCI_ADN_FIRST_MSG using + * OCI_DequeueSetNavigation() + * + * @return + * Message handle on success otherwise NULL on failure or on timeout + * + */ + +OCI_EXPORT OCI_Msg * OCI_API OCI_DequeueGet +( + OCI_Dequeue *dequeue +); + +/** + * @brief + * Subscribe for asynchronous messages notifications + * + * @param dequeue - Dequeue handle + * @param port - Port to use for notifications + * @param timeout - notification timeout + * @param callback - User handler callback fired when messages are ready to be dequeued + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * asynchronous messages notifications + * + * @note + * Requires Oracle Client 10gR2 or above + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DequeueSubscribe +( + OCI_Dequeue *dequeue, + unsigned int port, + unsigned int timeout, + POCI_NOTIFY_AQ callback +); + +/** + * @brief + * Unsubscribe for asynchronous messages notifications + * + * @param dequeue - Dequeue handle + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DequeueUnsubscribe +( + OCI_Dequeue *dequeue +); + +/** + * @brief + * Set the current consumer name to retrieve message for. + * + * @param dequeue - Dequeue handle + * @param consumer - consumer name + * + * @warning + * If a queue is not set up for multiple consumers, OCI_DequeueSetConsumer() + * should not be called or called with parameter 'consumer' set to NULL + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DequeueSetConsumer +( + OCI_Dequeue *dequeue, + const otext *consumer +); + +/** + * @brief + * Get the current consumer name associated with the dequeuing process. + * + * @param dequeue - Dequeue handle + * + * @note + * see OCI_DequeueSetConsumer() for more details + * + */ + +OCI_EXPORT const otext * OCI_API OCI_DequeueGetConsumer +( + OCI_Dequeue *dequeue +); + +/** + * @brief + * set the correlation identifier of the message to be dequeued + * + * @param dequeue - Dequeue handle + * @param pattern - correlation identifier + * + * @note + * Special pattern matching characters, such as "%" or "_" can be used. + * If more than one message satisfies the pattern, the order of dequeuing is undetermined. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DequeueSetCorrelation +( + OCI_Dequeue *dequeue, + const otext *pattern +); + +/** + * @brief + * Get the correlation identifier of the message to be dequeued + * + * @param dequeue - Dequeue handle + * + * @note + * see OCI_DequeueSetCorrelation() for more details + * + */ + +OCI_EXPORT const otext * OCI_API OCI_DequeueGetCorrelation +( + OCI_Dequeue *dequeue +); + +/** + * @brief + * Set the message identifier of the message to be dequeued + * + * @param dequeue - Dequeue handle + * @param id - message identifier + * @param len - size of the message identifier + * + * @warning + * if the function cannot assign the message id, the content of the parameter 'len' is set to zero. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DequeueSetRelativeMsgID +( + OCI_Dequeue *dequeue, + const void *id, + unsigned int len +); + +/** + * @brief + * Get the message identifier of the message to be dequeued + * + * @param dequeue - Dequeue handle + * @param id - message identifier + * @param len - size of the message identifier + * + * @warning + * When the function returns, parameter 'len' hold the number of bytes assigned to parameter 'id' + * + * @note + * see OCI_DequeueSetRelativeMsgID() for more details + * + */ + +OCI_EXPORT boolean OCI_API OCI_DequeueGetRelativeMsgID +( + OCI_Dequeue *dequeue, + void *id, + unsigned int *len +); + +/** + * @brief + * Set whether the new message is dequeued as part of the current transaction + * + * @param dequeue - Dequeue handle + * @param visibility - dequeuing mode + * + * @warning + * The visibility parameter is ignored when using the OCI_ADM_BROWSE dequeuing + * mode (see OCI_DequeueSetMode()) + * + * @note + * Possible values for parameter 'mode' : + * - OCI_AMV_IMMEDIATE : dequeue is an independent transaction + * - OCI_AMV_ON_COMMIT : dequeue is part of current transaction + * + * @note + * Default value is OCI_AMV_ON_COMMIT + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DequeueSetVisibility +( + OCI_Dequeue *dequeue, + unsigned int visibility +); + +/** + * @brief + * Get the dequeuing/locking behavior + * + * @param dequeue - Dequeue handle + * + * @note + * see OCI_DequeueSetVisibility() for more details + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_DequeueGetVisibility +( + OCI_Dequeue *dequeue +); + +/** + * @brief + * Set the dequeuing/locking behavior + * + * @param dequeue - Dequeue handle + * @param mode - dequeuing mode + * + * @note + * Possible values for parameter 'mode' : + * - OCI_ADM_BROWSE : read message without acquiring a lock + * - OCI_ADM_LOCKED : read and obtain write lock on message + * - OCI_ADM_REMOVE : read the message and delete it + * - OCI_ADM_REMOVE_NODATA : confirm receipt of the message, but do not + * deliver the actual message content + * + * @note + * Default value is OCI_ADM_REMOVE + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DequeueSetMode +( + OCI_Dequeue *dequeue, + unsigned int mode +); + +/** + * @brief + * Get the dequeuing/locking behavior + * + * @param dequeue - Dequeue handle + * + * @note + * see OCI_DequeueSetMode() for more details + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_DequeueGetMode +( + OCI_Dequeue *dequeue +); + +/** + * @brief + * Set the position of messages to be retrieved. + * + * @param dequeue - Dequeue handle + * @param position - navigation position + * + * @note + * The dequeuing uses the following sequence : + * - find messages using the navigation position + * - apply search criteria (message correlation) + * - get message + * + * @note + * Possible values for parameter 'position' : + * - OCI_ADN_FIRST_MSG : retrieves the first message which is available + * - OCI_ADN_NEXT_MSG : retrieves the next message which is available + * - OCI_ADN_NEXT_TRANSACTION : skips the remainder of the current transaction + * group (if any) and retrieves the first message + * of the next transaction group. + * + * @note + * Default value is OCI_ADN_NEXT_MSG + * + * @warning + * OCI_ADN_NEXT_TRANSACTION can only be used if message grouping is enabled for the given queue. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DequeueSetNavigation +( + OCI_Dequeue *dequeue, + unsigned int position +); + +/** + * @brief + * Return the navigation position of messages to retrieve from the queue + * + * @param dequeue - Dequeue handle + * + * @note + * see OCI_DequeueSetNavigation() for more details + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_DequeueGetNavigation +( + OCI_Dequeue *dequeue +); + +/** + * @brief + * set the time that OCIDequeueGet() waits for messages if no messages are + * currently available + * + * @param dequeue - Dequeue handle + * @param timeout - timeout in seconds + * + * @note + * - Any positive values in seconds are valid. + * - The value 0 is accepted and means OCIDequeueGet() does not wait for + * messages and returns immediately if no messages are available + * - The value -1 is accepted and means OCIDequeueGet() waits for ever (until + * a message is available in the queue) + * + * @note + * Default value is -1 (wait for ever) + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DequeueSetWaitTime +( + OCI_Dequeue *dequeue, + int timeout +); + +/** + * @brief + * Return the time that OCIDequeueGet() waits for messages if no messages are currently available + * + * @param dequeue - Dequeue handle + * + * @note + * see OCI_DequeueSetWaitTime() for more details + * + */ + +OCI_EXPORT int OCI_API OCI_DequeueGetWaitTime +( + OCI_Dequeue *dequeue +); + +/** + * @brief + * Set the Agent list to listen to message for + * + * @param dequeue - Dequeue handle + * @param consumers - Agent handle array + * @param count - Number of agents the array + * + * @return + * return TRUE on success otherwise FALSE + */ + +OCI_EXPORT boolean OCI_API OCI_DequeueSetAgentList +( + OCI_Dequeue *dequeue, + OCI_Agent **consumers, + unsigned int count +); + +/** + * @brief + * Listen for messages that match any recipient of the associated Agent list + * + * @param dequeue - Dequeue handle + * @param timeout - Timeout in second + * + * @note + * If an Agent handle is returned, messages are available for this agent. + * In order to retrieve its messages : + * - call OCI_DequeueSetConsumer() with the name of agent using OCI_AgentGetName() + * - call OCI_DequeueGet() to dequeue it's pending messages + * + * @warning + * The return value is valid only until: + * - OCIDequeueListen() is called again + * - OCI_DequeueFree(à is called to free the Dequeue object + * So Do not store the handle value across calls to OCIDequeueListen() + * + * @return + * An Agent handle for who messages are available on success otherwise NULL + */ + +OCI_EXPORT OCI_Agent * OCI_API OCI_DequeueListen +( + OCI_Dequeue *dequeue, + int timeout +); + +/** + * @brief + * Create an AQ agent object + * + * @param con - Connection handle + * @param name - Agent name + * @param address - Agent address + * + * @note + * An AQ agent object is : + * - used as recipient information when enqueuing a message + * - used as sender information when dequeuing a message + * - used for listening message only from identified senders + * + * @note + * the AQ agent address can be any Oracle identifier, up to 128 bytes. + * the AQ agent name can be any Oracle identifier, up to 30 bytes. + * + * @return + * AQ agent handle on success otherwise NULL + * + */ + +OCI_EXPORT OCI_Agent * OCI_API OCI_AgentCreate +( + OCI_Connection *con, + const otext *name, + const otext *address +); + +/** + * @brief + * Free an AQ agent object + * + * @param agent - AQ agent handle + * + * @warning + * Only AQ agent handle created with OCI_AgentCreate() should be freed by OCI_AgentFree() + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_AgentFree +( + OCI_Agent *agent +); + +/** + * @brief + * Set the given AQ agent name + * + * @param agent - AQ agent handle + * @param name - AQ agent name + * + * @note + * the AQ agent name is used to identified an message send or recipient when enqueuing/dequeuing + * a message + * + * @note + * the AQ agent name can be any Oracle identifier, up to 30 bytes. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_AgentSetName +( + OCI_Agent *agent, + const otext *name +); + +/** + * @brief + * Get the given AQ agent name + * + * @param agent - AQ agent handle + * + * @return + * AQ agent name on success otherwise NULL on failure + * + */ + +OCI_EXPORT const otext * OCI_API OCI_AgentGetName +( + OCI_Agent *agent +); + +/** + * @brief + * Set the given AQ agent address + * + * @param agent - AQ agent handle + * @param address - AQ agent address + * + * @note + * the parameter 'address' must be of the form : [schema.]queue_name[\@dblink] + * + * @note + * the AQ agent address can be any Oracle identifier, up to 128 bytes. + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_AgentSetAddress +( + OCI_Agent *agent, + const otext *address +); + +/** + * @brief + * Get the given AQ agent address + * + * @param agent - AQ agent handle + * + * @note + * See OCI_AgentSetAddress() + * + * @return + * AQ agent address on success otherwise NULL on failure + * + */ + +OCI_EXPORT const otext * OCI_API OCI_AgentGetAddress +( + OCI_Agent *agent +); + +/** + * @brief + * Create a queue + * + * @param con - Connection handle + * @param queue_name - Queue name + * @param queue_table - Queue table name + * @param queue_type - Queue type + * @param max_retries - Maximum number of attempts to dequeue a message + * @param retry_delay - Number of seconds between attempts to dequeue a message + * @param retention_time - number of seconds a message is retained in the queue table after + * being dequeued from the queue + * @param dependency_tracking - Parameter reserved for future use by Oracle (MUST be set to FALSE) + * @param comment - Description of the queue + * + * @note + * Parameter 'queue_name' can specify the schema where to create to queue ([schema.]queue_name) + * Queue names cannot be longer than 24 characters (Oracle limit for user queues) + * + * @note + * Possible values for parameter 'queue_type' : + * - OCI_AQT_NORMAL : Normal queue + * - OCI_AQT_EXCEPTION : Exception queue + * - OCI_AQT_NON_PERSISTENT : Non persistent queue + * + * To set default values, pass : + * - queue_type : OCI_AQT_NORMAL + * - max_retries : 0 + * - retry_delay : 0 + * - retention_time : 0 + * - comment : NULL + * + * @note + * this call wraps the PL/SQL procedure DBMS_AQADM.CREATE_QUEUE(). + * Refer to Oracle Streams - Advanced Queuing User's Guide for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_QueueCreate +( + OCI_Connection *con, + const otext *queue_name, + const otext *queue_table, + unsigned int queue_type, + unsigned int max_retries, + unsigned int retry_delay, + unsigned int retention_time, + boolean dependency_tracking, + const otext *comment +); + +/** + * @brief + * Alter the given queue + * + * @param con - Connection handle + * @param queue_name - Queue name + * @param max_retries - Maximum number of attempts to dequeue a message + * @param retry_delay - Number of seconds between attempts to dequeue a message + * @param retention_time - number of seconds a message is retained in the queue table after + * being dequeued from the queue + * @param comment - Description of the queue + * + * @note + * See OCI_QueueCreate() for more details + * + * @warning + * This function updates all attributes handled in the parameter list ! + * + * @note + * this call wraps the PL/SQL procedure DBMS_AQADM.ALTER_QUEUE(). + * Refer to Oracle Streams - Advanced Queuing User's Guide for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_QueueAlter +( + OCI_Connection *con, + const otext *queue_name, + unsigned int max_retries, + unsigned int retry_delay, + unsigned int retention_time, + const otext *comment +); + +/** + * @brief + * Drop the given queue + * + * @param con - Connection handle + * @param queue_name - Queue name + * + * @warning + * A queue can be dropped only if it has been stopped before. + * + * @note + * this call wraps the PL/SQL procedure DBMS_AQADM.DROP_QUEUE(). + * Refer to Oracle Streams - Advanced Queuing User's Guide for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_QueueDrop +( + OCI_Connection *con, + const otext *queue_name +); + +/** + * @brief + * Start the given queue + * + * @param con - Connection handle + * @param queue_name - Queue name + * @param enqueue - Enable enqueue + * @param dequeue - Enable dequeue + * + * @warning + * For exception queues, only enqueuing is allowed + * + * @note + * this call wraps the PL/SQL procedure DBMS_AQADM.START_QUEUE(). + * Refer to Oracle Streams - Advanced Queuing User's Guide for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_QueueStart +( + OCI_Connection *con, + const otext *queue_name, + boolean enqueue, + boolean dequeue +); + +/** + * @brief + * Stop enqueuing or dequeuing or both on the given queue + * + * @param con - Connection handle + * @param queue_name - Queue name + * @param enqueue - Disable enqueue + * @param dequeue - Disable dequeue + * @param wait - Wait for current pending enqueues/dequeues + * + * @warning + * A queue cannot be stopped if there are pending transactions against the queue. + * + * @note + * this call wraps the PL/SQL procedure DBMS_AQADM.STOP_QUEUE(). + * Refer to Oracle Streams - Advanced Queuing User's Guide for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_QueueStop +( + OCI_Connection *con, + const otext *queue_name, + boolean enqueue, + boolean dequeue, + boolean wait +); + +/** + * @brief + * Create a queue table for messages of the given type + * + * @param con - Connection handle + * @param queue_table - Queue table name + * @param queue_payload_type - Message type name + * @param storage_clause - Additional clauses for the table storage + * @param sort_list - Additional columns name to use for sorting + * @param multiple_consumers - Enable multiple consumers for each messages + * @param message_grouping - Specifies if messages are grouped within a transaction + * @param comment - Description of the queue table + * @param primary_instance - primary owner (instance) of the queue table + * @param secondary_instance - Owner of the queue table if the primary instance is not available + * @param compatible - lowest database version with which the queue table is compatible + * + * @note + * Parameter 'queue_table' can specify the schema where to create to queue table ([schema.]queue_table) + * Queue table names cannot be longer than 24 characters (Oracle limit for user queue tables) + * + * @note + * Possible values for parameter 'queue_payload_type' : + * - For Oracle types (UDT) : use the type name ([schema.].type_name) + * - For RAW data : use "SYS.RAW" or "RAW" + * + * @note + * Possible values for parameter 'message_grouping' : + * - OCI_AGM_NONE : each message is treated individually + * - OCI_AGM_TRANSACTIONNAL : all messages enqueued in one transaction are considered part of + * the same group and can be dequeued as a group of related messages. + * + * @note + * Possible values for parameter 'compatible' : + * - "8.0", "8.1", "10.0" + * + * To set default values, pass : + * - storage_clause : NULL + * - sort_list : NULL + * - message_grouping : OCI_AGM_NONE + * - comment : NULL + * - primary_instance : 0 + * - primary_instance : 0 + * - compatible : NULL + * + * @note + * this call wraps the PL/SQL procedure DBMS_AQADM.CREATE_QUEUE_TABLE(). + * Refer to Oracle Streams - Advanced Queuing User's Guide for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_QueueTableCreate +( + OCI_Connection *con, + const otext *queue_table, + const otext *queue_payload_type, + const otext *storage_clause, + const otext *sort_list, + boolean multiple_consumers, + unsigned int message_grouping, + const otext *comment, + unsigned int primary_instance, + unsigned int secondary_instance, + const otext *compatible +); + +/** + * @brief + * Alter the given queue table + * + * @param con - Connection handle + * @param queue_table - Queue table name + * @param comment - Description of the queue table + * @param primary_instance - primary owner (instance) of the queue table + * @param secondary_instance - Owner of the queue table if the primary instance is not available + * + * @note + * See OCI_QueueTableCreate() from more details + * + * @note + * this call wraps the PL/SQL procedure DBMS_AQADM.ALTER_QUEUE_TABLE(). + * Refer to Oracle Streams - Advanced Queuing User's Guide for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_QueueTableAlter +( + OCI_Connection *con, + const otext *queue_table, + const otext *comment, + unsigned int primary_instance, + unsigned int secondary_instance +); + +/** + * @brief + * Drop the given queue table + * + * @param con - Connection handle + * @param queue_table - Queue table name + * @param force - Force the deletion of objects related to the queue table + * + * @note + * Possible values for 'force' : + * - TRUE : all queues using the queue table and their associated propagation schedules are + * dropped automatically + * - FALSE : All the queues using the given queue table must be stopped and dropped before the + * queue table can be dropped. + * + * @note + * this call wraps the PL/SQL procedure DBMS_AQADM.DROP_QUEUE_TABLE(). + * Refer to Oracle Streams - Advanced Queuing User's Guide for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_QueueTableDrop +( + OCI_Connection *con, + const otext *queue_table, + boolean force +); + +/** + * @brief + * Purge messages from the given queue table + * + * @param con - Connection handle + * @param queue_table - Queue table name + * @param purge_condition - Optional SQL based conditions (see notes) + * @param block - Lock all queues using the queue table while doing the purge + * @param delivery_mode - Type of message to purge + * + * @note + * Possible values for parameter 'delivery_mode' : + * - OCI_APM_BUFFERED : purge only buffered messages + * - OCI_APM_PERSISTENT : purge only persistent messages + * - OCI_APM_ALL : purge all messages + * + * @note + * For more information about the SQL purge conditions, refer to + * Oracle Streams - Advanced Queuing User's Guide for more details + * + * @warning + * This feature is only available from Oracle 10gR2. + * This function does nothing and returns TRUE is the server version is < Oracle 10gR2 + * + * @note + * this call wraps the PL/SQL procedure DBMS_AQADM.PURGE_QUEUE_TABLE(). + * Refer to Oracle Streams - Advanced Queuing User's Guide for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_QueueTablePurge +( + OCI_Connection *con, + const otext *queue_table, + const otext *purge_condition, + boolean block, + unsigned int delivery_mode +); + +/** + * @brief + * Migrate a queue table from one version to another + * + * @param con - Connection handle + * @param queue_table - Queue table name + * @param compatible - Database version with witch the queue table has to migrate + * + * @note + * Possible values for parameter 'compatible' : + * - "8.0", "8.1", "10.0" + * + * @note + * this call wraps the PL/SQL procedure DBMS_AQADM.MIGRATE_QUEUE_TABLE(). + * Refer to Oracle Streams - Advanced Queuing User's Guide for more details + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_QueueTableMigrate +( + OCI_Connection *con, + const otext *queue_table, + const otext *compatible +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiSubscriptions Database Change notifications (DCN or CQN) + * @{ + * + * OCILIB supports Oracle 10gR2 feature Database Change Notifications (DCN) + * also named Continuous Query Notifications (CQN) + * + * This features allows a client application to register notifications + * when some changes are made in a database : + * - Database status changes : startup and shutdown + * - Database objects changes : + * - DDL changes : alter or drop actions + * - DML changes : insert, delete, update actions + * + * This feature can be really useful in applications that hold + * a cache of data. Instead of refreshing data periodically by + * connecting to the server, the application could only refresh + * modified data when necessary or perform specific tasks depending on + * the events. It saves application time, network traffic and can help + * the design of the application logic. + * + * The database status change notification is also interesting to be + * informed of instance startup / shutdown + * + * Check Oracle documentation for more details about this feature + * + * @note + * No active database connection is required to receive the + * notifications as they are handled by the Oracle client using a + * dedicated socket connection to the server + * + * @par Database changes + * + * The client application can be notified of any database status + * change (single DB or multiple DB in a RAC environment). + * + * @par Object changes + * + * The notifications of object changes are based on the registration + * of a query ('select' SQL statement). + * + * Oracle server will notify of any changes of any object that is + * part of the statement result set. + * + * Registering a statement will notify about any changes on its + * result set rows performed after the registration of the query. + * + * The query can be a simple 'select * from table' or a complex + * query involving many tables and/or criteria in the where clause. + * + * For Object changes, the notification can be at : + * - At Object level : only the object name (schema + object) is given + * - At row level : same that object level + RowID of the altered row + * + * @warning + * Trying to use this features with a client/server version < 10gR2 will raise an error + * + * @par Example + * @include notification.c + * + */ + +/** + * @brief + * Register a notification against the given database + * + * @param con - Connection handle + * @param name - Notification name + * @param type - Subscription type + * @param handler - User handler callback + * @param port - Port to use for notifications + * @param timeout - notification timeout + * + * @note + * Parameter 'type' can be one of the following values : + * + * - OCI_CNT_OBJECTS : request for changes at objects (e.g. tables) level (DDL / DML) + * - OCI_CNT_ROWS : request for changes at rows level (DML) + * - OCI_CNT_DATABASES : request for changes at database level (startup, shutdown) + * - OCI_CNT_ALL : request for all changes + * + * @note + * Parameter 'port' and 'timeout' are optional (use value 0 a optional value) + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * subscriptions + * + * @ @warning Port usage + * All notifications are using the same port. + * Port number can be either: + * - determined automatically by Oracle client once the first subscription had been created and can be retrieved using OCI_SubscriptionGetPort() + * - Set by the parameter 'port' during the first call to OCI_SubscriptionRegister(). In this case later calls can provide same port number or 0 + * + * @note + * Requires Oracle Client 10gR2 or above + * + * @note + * Subscription handles are automatically managed by the library + * + * @return + * Subscription handle on success or NULL on failure + * + */ + +OCI_EXPORT OCI_Subscription * OCI_API OCI_SubscriptionRegister +( + OCI_Connection *con, + const otext *name, + unsigned int type, + POCI_NOTIFY handler, + unsigned int port, + unsigned int timeout +); + +/** + * @brief + * Unregister a previously registered notification + * + * @param sub - Subscription handle + * + * @note + * OCI_Cleanup() will automatically unregister any registered subscriptions + * + * @note + * If the database connection passed to OCI_SubscriptionRegister() + * has been closed by the time that the application calls + * OCI_SubscriptionUnregister, the library internally reconnects + * to the given database, performs the unregistration and then disconnects + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * subscriptions + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SubscriptionUnregister +( + OCI_Subscription *sub +); + +/** + * @brief + * Add a statement to the notification to monitor + * + * @param sub - Subscription handle + * @param stmt - Statement handle + * + * @note + * The given statement must be prepared but not executed before being passed to this function. + * OCI_SubscriptionAddStatement() executes the statement and register it for notifications + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * subscriptions + * + * @note + * The given statement must hold a 'SELECT' SQL statement + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_SubscriptionAddStatement +( + OCI_Subscription *sub, + OCI_Statement *stmt +); + +/** + * @brief + * Return the name of the given registered subscription + * + * @param sub - Subscription handle + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * subscriptions + * + */ + +OCI_EXPORT const otext * OCI_API OCI_SubscriptionGetName +( + OCI_Subscription *sub +); + +/** + * @brief + * Return the port used by the notification + * + * @param sub - Subscription handle + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * subscriptions + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_SubscriptionGetPort +( + OCI_Subscription *sub +); + +/** + * @brief + * Return the timeout of the given registered subscription + * + * @param sub - Subscription handle + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * subscriptions + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_SubscriptionGetTimeout +( + OCI_Subscription *sub +); + +/** + * @brief + * Return the connection handle associated with a subscription handle + * + * @param sub - Subscription handle + * + * @note + * It may return a NULL handle if the connection used in OCI_SubscriptionRegister has been closed. + * + */ + +OCI_EXPORT OCI_Connection * OCI_API OCI_SubscriptionGetConnection +( +OCI_Subscription *sub +); + +/** + * @brief + * Return the type of event reported by a notification + * + * @param event - Event handle + * + * @note + * The returned value can be one of the following values : + * + * - OCI_ENT_STARTUP : a database has been started up + * - OCI_ENT_SHUTDOWN : a database has been shut down + * - OCI_ENT_SHUTDOWN_ANY : a database has been shut down (RAC) + * - OCI_ENT_DROP_DATABASE : a database has been dropped + * - OCI_ENT_DEREGISTER : the notification is timed out + * - OCI_ENT_OBJECT_CHANGED : a database object has been modified + * + * @note + * OCI_EventGetDatabase() returns the affected database + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * subscriptions + * + * @note + * OCI_EventGetObject() returns the affected object + * ('schema_name'.'object_name') + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_EventGetType +( + OCI_Event *event +); + +/** + * @brief + * Return the type of operation reported by a notification + * + * @param event - Event handle + * + * @note + * This call is only valid when OCI_EventGetType() reports the + * event type OCI_ENT_OBJECT_CHANGED + * + * @note + * The returned value can be one of the following values : + * + * - OCI_ONT_INSERT : an insert has been performed + * - OCI_ONT_UPDATE : an update has been performed + * - OCI_ONT_DELETE : a delete has been performed + * - OCI_ONT_ALTER : an alter has been performed + * - OCI_ONT_DROP : a drop has been performed + * - OCI_ONT_GENERIC : generic undefined action + * + * @note + * OCI_EventGetDatabase() returns the affected database + * + * @note + * OCI_EventGetObject() returns the affected object ('schema_name'.'object_name') + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * subscriptions + * + * @note + * if OCI_CNT_ROWS is passed to OCI_SubscriptionRegister(), + * the rowid of the altered row can be retrieved with OCI_EventGetRowid() + * + */ + +OCI_EXPORT unsigned int OCI_API OCI_EventGetOperation +( + OCI_Event *event +); + +/** + * @brief + * Return the name of the database that generated the event + * + * @param event - Event handle + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * subscriptions + * + */ + +OCI_EXPORT const otext * OCI_API OCI_EventGetDatabase +( + OCI_Event *event +); + +/** + * @brief + * Return the name of the object that generated the event + * + * @param event - Event handle + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * subscriptions + * + */ + +OCI_EXPORT const otext * OCI_API OCI_EventGetObject +( + OCI_Event *event +); + +/** + * @brief + * Return the rowid of the altered database object row + * + * @param event - Event handle + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * subscriptions + * + */ + +OCI_EXPORT const otext * OCI_API OCI_EventGetRowid +( + OCI_Event *event +); + +/** + * @brief + * Return the subscription handle that generated this event + * + * @param event - Event handle + * + * @note + * OCI_ENV_EVENTS flag must be passed to OCI_Initialize() to be able to use + * subscriptions + * + */ + +OCI_EXPORT OCI_Subscription * OCI_API OCI_EventGetSubscription +( + OCI_Event *event +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiInstancesManagement Remote Instance startup/shutdown + * @{ + * + * OCILIB supports Oracle 11g client features for manipulating remote Oracle instances. + * + * Oracle instances (on the same computer or on a remote server) can be : + * + * - started with OCI_DatabaseStartup() + * - shutdown with OCI_DatabaseShutdown() + * + * Several options are handled for this actions + * + * @par Example + * @include instance.c + * + */ + +/** + * @brief + * Start a database instance + * + * @param db - Oracle Service Name + * @param user - Oracle User name + * @param pwd - Oracle User password + * @param sess_mode - Session mode + * @param start_mode - Start mode + * @param start_flag - Start flags + * @param spfile - Client-side spfile to start up the database (optional) + * + * Possible values for parameter session mode : + * - OCI_SESSION_SYSDBA + * - OCI_SESSION_SYSOPER + * + * @note + * External credentials are supported by supplying a null value for the 'user' and 'pwd' parameters + * If the param 'db' is NULL then a connection to the default local DB is done + * + * Possible (combined) values for parameter start_mode : + * - OCI_DB_SPM_START : start the instance + * - OCI_DB_SPM_MOUNT : mount the instance + * - OCI_DB_SPM_OPEN : open the instance + * - OCI_DB_SPM_FULL : start, mount and open the instance + * + * Possible (combined) values for parameter start_flag : + * - OCI_DB_SPF_DEFAULT : default startup + * - OCI_DB_SPF_FORCE : shuts down a running instance (if needed) using + * ABORT command and starts a new instance + * - OCI_DB_SPF_RESTRICT : allows database access only to users with both + * CREATE SESSION and RESTRICTED SESSION privileges + * + * @note + * If the client side spfile is not provided, the database is started with its server-side spfile + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DatabaseStartup +( + const otext *db, + const otext *user, + const otext *pwd, + unsigned int sess_mode, + unsigned int start_mode, + unsigned int start_flag, + const otext *spfile +); + +/** + * @brief + * Shutdown a database instance + * + * @param db - Oracle Service Name + * @param user - Oracle User name + * @param pwd - Oracle User password + * @param sess_mode - Session mode + * @param shut_mode - Shutdown mode + * @param shut_flag - Shutdown flag + * + * + * @warning + * Possible values for parameter session mode : + * - OCI_SESSION_SYSDBA + * - OCI_SESSION_SYSOPER + * + * @note + * External credentials are supported by supplying a null value for the 'user' and 'pwd' parameters + * If the param 'db' is NULL then a connection to the default local DB is done + * + * Possible (combined) values for parameter shut_mode : + * - OCI_DB_SDM_SHUTDOWN : shutdown the instance + * - OCI_DB_SDM_CLOSE : close the instance + * - OCI_DB_SDM_DISMOUNT : dismount the instance + * - OCI_DB_SDM_FULL : shutdown, close and dismount the instance + * + * Possible (exclusive) value for parameter shut_flag (from Oracle documentation) : + * - OCI_DB_SDF_DEFAULT : + * - Further connects are prohibited. + * - Waits for users to disconnect from the database + * - OCI_DB_SDF_TRANS : + * - Further connects are prohibited + * - No new transactions are allowed. + * - Waits for active transactions to complete + * - OCI_DB_SDF_TRANS_LOCAL : + * - Further connects are prohibited + * - No new transactions are allowed. + * - Waits only for local transactions to complete + * - OCI_DB_SDF_IMMEDIATE : + * - Does not wait for current calls to complete or users to disconnect from the database. + * - All uncommitted transactions are terminated and rolled back + * - OCI_DB_SDF_ABORT : + * - Does not wait for current calls to complete or users to disconnect from the database. + * - All uncommitted transactions are terminated and are not rolled back. + * - This is the fastest possible way to shut down the database, but the next + * database startup may require instance recovery. + * - Therefore, this option should be used only in unusual circumstances + * + * @return + * TRUE on success otherwise FALSE + * + */ + +OCI_EXPORT boolean OCI_API OCI_DatabaseShutdown +( + const otext *db, + const otext *user, + const otext *pwd, + unsigned int sess_mode, + unsigned int shut_mode, + unsigned int shut_flag +); + +/** + * @} + */ + +/** + * @defgroup OcilibCApiRawHandles Using OCI Handles directly + * @{ + * + * OCILIB conception was focused on a full but closed encapsulation of OCI. + * + * All OCI headers, data types, prototypes are imported internally + * (linkage or runtime import). + * + * OCILIB public interface exposes only ISO C scalar types and OCILIB objects + * + * OCI is a wide and rich API that can deals with hundreds of options ! + * + * OCILIB tries to implements most of it. But, sometimes in really specific + * contexts, it might be necessary to directly call OCI APIs in order to use + * uncovered OCI functionalities or options + * + * OCILIB proposes now a set of functions to retrieve its internal OCI handles + * + * @warning + * + * The OCILIB author strongly advises against the use of internal handles, + * unless there is no other way to accomplish the task + * + * @warning + * + * Using these handles for direct application calls to OCI might lead + * to OCILIB instability or crash if handles are incorrectly used ! + * + */ + +/** + * @brief + * Return the OCI Environment Handle (OCIEnv *) of OCILIB library + * + * @return + * OCI Environment handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetEnvironment +( + void +); + +/** + * @brief + * Return the OCI Context Handle (OCISvcCtx *) of an OCILIB OCI_Connection object + * + * @param con - Connection handle + * + * @return + * OCI Context handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetContext +( + OCI_Connection *con +); + +/** + * @brief + * Return the OCI Server Handle (OCIServer *) of an OCILIB OCI_Connection object + * + * @param con - Connection handle + * + * @return + * OCI Server handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetServer +( + OCI_Connection *con +); + +/** + * @brief + * Return the OCI Error Handle (OCIError *) of an OCILIB OCI_Connection object + * + * @param con - Connection handle + * + * @return + * OCI Error handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetError +( + OCI_Connection *con +); + +/** + * @brief + * Return the OCI Session Handle (OCISession *) of an OCILIB OCI_Connection object + * + * @param con - Connection handle + * + * @return + * OCI Session handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetSession +( + OCI_Connection *con +); + +/** + * @brief + * Return the OCI Transaction Handle (OCITrans *) of an OCILIB OCI_Transaction object + * + * @param trans - Transaction handle + * + * @return + * OCI Transaction handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetTransaction +( + OCI_Transaction *trans +); + +/** + * @brief + * Return the OCI Statement Handle (OCIStmt *) of an OCILIB OCI_Statement object + * + * @param stmt - Statement handle + * + * @return + * OCI Statement handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetStatement +( + OCI_Statement *stmt +); + +/** + * @brief + * Return the OCI LobLocator Handle (OCILobLocator *) of an OCILIB OCI_Lob object + * + * @param lob - Lob handle + * + * @return + * OCI LobLocator handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetLob +( + OCI_Lob *lob +); + +/** + * @brief + * Return the OCI LobLocator Handle (OCILobLocator *) of an OCILIB OCI_File object + * + * @param file - File handle + * + * @return + * OCI LobLocator handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetFile +( + OCI_File *file +); + +/** + * @brief + * Return the OCI Date Handle (OCIDate *) of an OCILIB OCI_Date object + * + * @param date - Date handle + * + * @return + * OCI Date handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetDate +( + OCI_Date *date +); + +/** + * @brief + * Return the OCI Date time Handle (OCIDatetime *) of an OCILIB OCI_Timestamp object + * + * @param tmsp - Timestamp handle + * + * @return + * OCI Date time handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetTimestamp +( + OCI_Timestamp *tmsp +); + +/** + * @brief + * Return OCI Interval Handle (OCIInterval *) of an OCILIB OCI_Interval object + * + * @param itv - Interval handle + * + * @return + * OCI Interval handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetInterval +( + OCI_Interval *itv +); + +/** + * @brief + * Return OCI Object Handle (void *) of an OCILIB OCI_Object object + * + * @param obj - Object handle + * + * @return + * OCI Object handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetObject +( + OCI_Object *obj +); + +/** + * @brief + * Return OCI Collection Handle (OCIColl *) of an OCILIB OCI_Coll object + * + * @param coll - Collection handle + * + * @return + * OCI Collection handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetColl +( + OCI_Coll *coll +); + +/** + * @brief + * Return OCI Ref Handle (OCIRef *) of an OCILIB OCI_Ref object + * + * @param ref - Ref handle + * + * @return + * OCI Ref handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetRef +( + OCI_Ref *ref +); + +/** + * @brief + * Return OCI Mutex handle (OCIThreadMutex *) of an OCILIB OCI_Mutex object + * + * @param mutex - Mutex handle + * + * @return + * OCI Mutex handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetMutex +( + OCI_Mutex *mutex +); + +/** + * @brief + * Return OCI Thread ID (OCIThreadId *) of an OCILIB OCI_Thread object + * + * @param thread - Thread handle + * + * @return + * OCI Thread ID otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetThreadID +( + OCI_Thread *thread +); + +/** + * @brief + * Return OCI Thread handle (OCIThreadHandle *) of an OCILIB OCI_Thread object + * + * @param thread - Thread handle + * + * @return + * OCI Thread handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetThread +( + OCI_Thread *thread +); + +/** + * @brief + * Return OCI DirectPath Context handle (OCIDirPathCtx *) of an OCILIB OCI_DirPath object + * + * @param dp - DirectPath handle + * + * @return + * OCI DirectPath Context handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetDirPathCtx +( + OCI_DirPath *dp +); + +/** + * @brief + * Return OCI DirectPath Column array handle (OCIDirPathColArray *) of an OCILIB OCI_DirPath object + * + * @param dp - DirectPath handle + * + * @return + * OCI DirectPath Column array handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetDirPathColArray +( + OCI_DirPath *dp +); + +/** + * @brief + * Return OCI DirectPath Stream handle (OCIDirPathStream *) of an OCILIB OCI_DirPath object + * + * @param dp - DirectPath handle + * + * @return + * OCI DirectPath Stream handle otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetDirPathStream +( + OCI_DirPath *dp +); + +/** + * @brief + * Return OCI Subscription handle (OCISubscription *) of an OCILIB OCI_Subscription object + * + * @param sub - Subscription handle + * + * @return + * OCI Subscription otherwise NULL + * + */ + +OCI_EXPORT const void * OCI_API OCI_HandleGetSubscription +( + OCI_Subscription *sub +); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +/** +* @defgroup OcilibCApiEnvironmentVariables Environment Variables +* @{ +* +* Some environment variables can be defined in order to activate specific features +* They must have one of the following values (case insensitive) for being enabled : "TRUE", "1" +* +* - "OCILIB_WORKAROUND_UTF16_COLUMN_NAME": This variable enables an experimental workaround for the Oracle bug 9838993: +* - When calling OCI_GetResultset(), OCILIB queries column names against the Oracle Client +* - Unicode builds of OCILIB initialize Oracle client into UTF16 mode +* - In such environments, a memory leak occurs when statements are re-executed multiple times followed by OCI_GetResultset() +* - This workaround retrieves column names using direct access to undocumented Oracle structures instead of using buggy Oracle calls +* - As Oracle undocumented structures may change upon versions, this workaround is provided as-is in case the Oracle bug represents an real issue for applications +* - This workaround has been tested with 32bit and 64bit Oracle 12g clients and Unicode OCILIB builds +*/ + +#define VAR_OCILIB_WORKAROUND_UTF16_COLUMN_NAME "OCILIB_WORKAROUND_UTF16_COLUMN_NAME" + +/** +* @} +*/ + +/** + * @defgroup OcilibCApiDemoApplication OCILIB main demo application code + * @{ + * + * Portable Main demo application header + * @include ocilib_demo.h + * + * Portable Main demo application source + * @include ocilib_demo.c + * + * @} + */ + +/* Compatibility with sources built with older versions of OCILIB */ + +/* macros added in version 2.3.0 */ + +#define OCI_CreateConnection OCI_ConnectionCreate +#define OCI_FreeConnection OCI_ConnectionFree +#define OCI_CreateStatement OCI_StatementCreate +#define OCI_FreeStatement OCI_StatementFree + +/* macros added in version 2.4.0 */ + +#define OCI_CreateTransaction OCI_TransactionCreate +#define OCI_FreeTransaction OCI_TransactionFree +#define OCI_CreateHashTable OCI_HashCreate +#define OCI_FreeHashTable OCI_HashFree + +/* macros added in version 3.0.0 */ + +#define OCI_GetColumnName OCI_ColumnGetName +#define OCI_GetColumnType OCI_ColumnGetType +#define OCI_GetColumnCharsetForm OCI_ColumnGetCharsetForm +#define OCI_GetColumnSQLType OCI_ColumnGetSQLType +#define OCI_GetColumnFullSQLType OCI_ColumnGetFullSQLType +#define OCI_GetColumnSize OCI_ColumnGetSize +#define OCI_GetColumnScale OCI_ColumnGetScale +#define OCI_GetColumnPrecision OCI_ColumnGetPrecision +#define OCI_GetColumnFractionnalPrecision OCI_ColumnGetFractionnalPrecision +#define OCI_GetColumnLeadingPrecision OCI_ColumnGetLeadingPrecision +#define OCI_GetColumnNullable OCI_ColumnGetNullable +#define OCI_GetColumnCharUsed OCI_ColumnGetCharUsed + +#define OCI_GetFormatDate(s) OCI_GetDefaultFormatDate(OCI_StatementGetConnection(s)) +#define OCI_SetFormatDate(s, f) OCI_SetDefaultFormatDate(OCI_StatementGetConnection(s), f) + +#define OCI_ERR_API OCI_ERR_ORACLE + +/* macros added in version 3.2.0 */ + +#define OCI_ERR_NOT_SUPPORTED OCI_ERR_DATATYPE_NOT_SUPPORTED +#define OCI_SCHEMA_TABLE OCI_TIF_TABLE +#define OCI_SCHEMA_VIEW OCI_TIF_VIEW +#define OCI_SCHEMA_TYPE OCI_TIF_TYPE + +#define OCI_Schema OCI_TypeInfo + +#define OCI_SchemaGet OCI_TypeInfoGet +#define OCI_SchemaFree OCI_TypeInfoFree +#define OCI_SchemaGetColumnCount OCI_TypeInfoGetColumnCount +#define OCI_SchemaGetColumn OCI_TypeInfoGetColumn +#define OCI_SchemaGetName OCI_TypeInfoGetName + +#define OCI_ColumnGetFractionnalPrecision OCI_ColumnGetFractionalPrecision + +/* macro added in version 3.3.0 */ + +#define OCI_SetNull(stmt, index) \ + OCI_BindSetNull(OCI_GetBind(stmt, index)) + +#define OCI_SetNull2(stmt, name) \ + OCI_BindSetNull(OCI_GetBind2(stmt, name)) + +#define OCI_SetNullAtPos(stmt, index, position) \ + OCI_BindSetNullAtPos(OCI_GetBind(stmt, index), position) + +#define OCI_SetNullAtPos2(stmt, name, position) \ + OCI_BindSetNullAtPos(OCI_GetBind2(stmt, name), position) + +/* macro added in version 3.4.0 */ + +#define OCI_8 OCI_8_1 +#define OCI_9 OCI_9_0 +#define OCI_10 OCI_10_1 +#define OCI_11 OCI_11_1 + +/* macro added in version 3.6.0 */ + +#define OCI_CHAR_UNICODE OCI_CHAR_WIDE +#define OCI_CSF_CHARSET OCI_CSF_DEFAULT + +/* macro added in version 3.7.0 */ + +#define OCI_ConnPool OCI_Pool + +#define OCI_ConnPoolCreate(db, us, pw, mo, mi, ma, in) \ + OCI_PoolCreate(db, us, pw, OCI_POOL_CONNECTION, mo, mi, ma, in) + +#define OCI_ConnPoolGetConnection(p) \ + OCI_PoolGetConnection(p, NULL) + +#define OCI_ConnPoolFree OCI_PoolFree +#define OCI_ConnPoolGetTimeout OCI_PoolGetConnection +#define OCI_ConnPoolSetTimeout OCI_PoolSetTimeout +#define OCI_ConnPoolGetNoWait OCI_PoolGetNoWait +#define OCI_ConnPoolSetNoWait OCI_PoolSetNoWait +#define OCI_ConnPoolGetBusyCount OCI_PoolGetBusyCount +#define OCI_ConnPoolGetOpenedCount OCI_PoolGetOpenedCount +#define OCI_ConnPoolGetMin OCI_PoolGetMin +#define OCI_ConnPoolGetMax OCI_PoolGetMax +#define OCI_ConnPoolGetIncrement OCI_PoolGetIncrement + +/* macro added in version 3.8.0 */ + +#define OCI_ObjectGetTimeStamp OCI_ObjectGetTimestamp +#define OCI_ElemGetTimeStamp OCI_ElemGetTimestamp +#define OCI_TimestampSysTimeStamp OCI_TimestampSysTimestamp + +/* macro added in version 4.0.0 */ + +#define OCI_CollSetAt OCI_CollSetElem +#define OCI_CollGetAt OCI_CollGetElem +#define OCI_CollGetAt2 OCI_CollGetElem2 + +#define OCI_GetCharsetMetaData OCI_GetCharset +#define OCI_GetCharsetUserData OCI_GetCharset +#define OCI_SIZE_TRACE_INF0 OCI_SIZE_TRACE_INFO + +#define MT(x) OTEXT(x) +#define mtext otext +#define DT(x) OTEXT(x) +#define dtext otext + +#define mtsdup ostrdup +#define mtscpy ostrcpy +#define mtsncpy ostrncpy +#define mtscat ostrcat +#define mtsncat ostrncat +#define mtslen ostrlen +#define mtscmp ostrcmp +#define mtscasecmp ostrcasecmp +#define mtsprintf osprintf +#define mtstol ostrtol +#define mtsscanf osscanf + +#define dtsdup ostrdup +#define dtscpy ostrcpy +#define dtsncpy ostrncpy +#define dtscat ostrcat +#define dtsncat ostrncat +#define dtslen ostrlen +#define dtscmp ostrcmp +#define dtscasecmp ostrcasecmp +#define dtsprintf osprintf +#define dtstol ostrtol +#define dtsscanf osscanf + +/* macro added in version 4.1.0 */ + +#define OCI_SetDefaultFormatDate(con, fmt) OCI_SetFormat(con, OCI_FMT_DATE, fmt) +#define OCI_SetDefaultFormatNumeric(con, fmt) OCI_SetFormat(con, OCI_FMT_NUMERIC, fmt) + +#define OCI_GetDefaultFormatDate(con) OCI_GetFormat(con, OCI_FMT_DATE) +#define OCI_GetDefaultFormatNumeric(con) OCI_GetFormat(con, OCI_FMT_NUMERIC) + +#define OCI_STRING_FORMAT_NUM_BIN OCI_STRING_FORMAT_NUM_BDOUBLE + +/** + * @} + */ + +#endif /* OCILIB_H_INCLUDED */ + diff --git a/zmq/4.3.2/AIX-00FB437F4C00/AIX-00FB437F4C00.tar b/zmq/4.3.2/AIX-00FB437F4C00/AIX-00FB437F4C00.tar new file mode 100644 index 0000000000000000000000000000000000000000..9cd2da4f8ce414df323fc5b4ab22c2ce86dc929c Binary files /dev/null and b/zmq/4.3.2/AIX-00FB437F4C00/AIX-00FB437F4C00.tar differ diff --git a/zmq/4.3.2/AIX-00FB437F4C00/libstdc++.a b/zmq/4.3.2/AIX-00FB437F4C00/libstdc++.a new file mode 100644 index 0000000000000000000000000000000000000000..c0ee9f17c9676db513c5b1e1248b300c4aedfc26 Binary files /dev/null and b/zmq/4.3.2/AIX-00FB437F4C00/libstdc++.a differ diff --git a/zmq/4.3.2/AIX-00FB437F4C00/libzmq.a b/zmq/4.3.2/AIX-00FB437F4C00/libzmq.a new file mode 100644 index 0000000000000000000000000000000000000000..1ddbe702ac5ba77cee8c8a20384d26b76c187ad4 Binary files /dev/null and b/zmq/4.3.2/AIX-00FB437F4C00/libzmq.a differ diff --git a/zmq/4.3.2/AIX-00FB90154C00/AIX-00FB90154C00.tar b/zmq/4.3.2/AIX-00FB90154C00/AIX-00FB90154C00.tar new file mode 100644 index 0000000000000000000000000000000000000000..9cd2da4f8ce414df323fc5b4ab22c2ce86dc929c Binary files /dev/null and b/zmq/4.3.2/AIX-00FB90154C00/AIX-00FB90154C00.tar differ diff --git a/zmq/4.3.2/AIX-00FB90154C00/libstdc++.a b/zmq/4.3.2/AIX-00FB90154C00/libstdc++.a new file mode 100644 index 0000000000000000000000000000000000000000..c0ee9f17c9676db513c5b1e1248b300c4aedfc26 Binary files /dev/null and b/zmq/4.3.2/AIX-00FB90154C00/libstdc++.a differ diff --git a/zmq/4.3.2/AIX-00FB90154C00/libzmq.a b/zmq/4.3.2/AIX-00FB90154C00/libzmq.a new file mode 100644 index 0000000000000000000000000000000000000000..1ddbe702ac5ba77cee8c8a20384d26b76c187ad4 Binary files /dev/null and b/zmq/4.3.2/AIX-00FB90154C00/libzmq.a differ diff --git a/zmq/4.3.2/HP-UX-ia64/HP-UX-ia64.tar b/zmq/4.3.2/HP-UX-ia64/HP-UX-ia64.tar new file mode 100644 index 0000000000000000000000000000000000000000..977b1df99b565565349c7814df0bf7a4bc8f823e Binary files /dev/null and b/zmq/4.3.2/HP-UX-ia64/HP-UX-ia64.tar differ diff --git a/zmq/4.3.2/HP-UX-ia64/libstdc++.so b/zmq/4.3.2/HP-UX-ia64/libstdc++.so new file mode 100755 index 0000000000000000000000000000000000000000..ec1ff4f16e8b9dd7042800a6a2936dca7d4fa857 Binary files /dev/null and b/zmq/4.3.2/HP-UX-ia64/libstdc++.so differ diff --git a/zmq/4.3.2/HP-UX-ia64/libzmq.so b/zmq/4.3.2/HP-UX-ia64/libzmq.so new file mode 120000 index 0000000000000000000000000000000000000000..421fc29923c3e4b55ef1e984f133351cbcfa1f25 --- /dev/null +++ b/zmq/4.3.2/HP-UX-ia64/libzmq.so @@ -0,0 +1 @@ +libzmq.so.4.3.2 \ No newline at end of file diff --git a/zmq/4.3.2/HP-UX-ia64/libzmq.so.4.3.2 b/zmq/4.3.2/HP-UX-ia64/libzmq.so.4.3.2 new file mode 100755 index 0000000000000000000000000000000000000000..5a1094a9f38e2b739cbc73f219f5bea44db40a46 Binary files /dev/null and b/zmq/4.3.2/HP-UX-ia64/libzmq.so.4.3.2 differ diff --git a/zmq/4.3.2/Linux-x86_64/Linux-x86_64.tar b/zmq/4.3.2/Linux-x86_64/Linux-x86_64.tar new file mode 100644 index 0000000000000000000000000000000000000000..8f58d72e547cf1fd318036aefa5f83a3e43bf917 Binary files /dev/null and b/zmq/4.3.2/Linux-x86_64/Linux-x86_64.tar differ diff --git a/zmq/4.3.2/Linux-x86_64/libzmq.so b/zmq/4.3.2/Linux-x86_64/libzmq.so new file mode 120000 index 0000000000000000000000000000000000000000..de44247364cf1f6055f8bf06809b95591daab3ba --- /dev/null +++ b/zmq/4.3.2/Linux-x86_64/libzmq.so @@ -0,0 +1 @@ +libzmq.so.5.2.2 \ No newline at end of file diff --git a/zmq/4.3.2/Linux-x86_64/libzmq.so.5 b/zmq/4.3.2/Linux-x86_64/libzmq.so.5 new file mode 120000 index 0000000000000000000000000000000000000000..de44247364cf1f6055f8bf06809b95591daab3ba --- /dev/null +++ b/zmq/4.3.2/Linux-x86_64/libzmq.so.5 @@ -0,0 +1 @@ +libzmq.so.5.2.2 \ No newline at end of file diff --git a/zmq/4.3.2/Linux-x86_64/libzmq.so.5.2.2 b/zmq/4.3.2/Linux-x86_64/libzmq.so.5.2.2 new file mode 100755 index 0000000000000000000000000000000000000000..83ff881300f040aa994d64b5c71627677a7451e7 Binary files /dev/null and b/zmq/4.3.2/Linux-x86_64/libzmq.so.5.2.2 differ diff --git a/zmq/4.3.2/Linux-x86_64_5/Linux-x86_64_5.tar b/zmq/4.3.2/Linux-x86_64_5/Linux-x86_64_5.tar new file mode 100644 index 0000000000000000000000000000000000000000..18a0e34ce225ad4bd9224b6d0f7aff805fd9d040 Binary files /dev/null and b/zmq/4.3.2/Linux-x86_64_5/Linux-x86_64_5.tar differ diff --git a/zmq/4.3.2/Linux-x86_64_5/libzmq.so b/zmq/4.3.2/Linux-x86_64_5/libzmq.so new file mode 120000 index 0000000000000000000000000000000000000000..de44247364cf1f6055f8bf06809b95591daab3ba --- /dev/null +++ b/zmq/4.3.2/Linux-x86_64_5/libzmq.so @@ -0,0 +1 @@ +libzmq.so.5.2.2 \ No newline at end of file diff --git a/zmq/4.3.2/Linux-x86_64_5/libzmq.so.5 b/zmq/4.3.2/Linux-x86_64_5/libzmq.so.5 new file mode 120000 index 0000000000000000000000000000000000000000..de44247364cf1f6055f8bf06809b95591daab3ba --- /dev/null +++ b/zmq/4.3.2/Linux-x86_64_5/libzmq.so.5 @@ -0,0 +1 @@ +libzmq.so.5.2.2 \ No newline at end of file diff --git a/zmq/4.3.2/Linux-x86_64_5/libzmq.so.5.2.2 b/zmq/4.3.2/Linux-x86_64_5/libzmq.so.5.2.2 new file mode 100755 index 0000000000000000000000000000000000000000..55d6ffea20fbcef0226a716c8bfb026a621bda3a Binary files /dev/null and b/zmq/4.3.2/Linux-x86_64_5/libzmq.so.5.2.2 differ diff --git a/zmq/4.3.2/Linux-x86_64_6/Linux-x86_64_6.tar b/zmq/4.3.2/Linux-x86_64_6/Linux-x86_64_6.tar new file mode 100644 index 0000000000000000000000000000000000000000..a1ae69f407754de3073d5e84176fa892d57b9c5a Binary files /dev/null and b/zmq/4.3.2/Linux-x86_64_6/Linux-x86_64_6.tar differ diff --git a/zmq/4.3.2/Linux-x86_64_6/libzmq.so b/zmq/4.3.2/Linux-x86_64_6/libzmq.so new file mode 120000 index 0000000000000000000000000000000000000000..de44247364cf1f6055f8bf06809b95591daab3ba --- /dev/null +++ b/zmq/4.3.2/Linux-x86_64_6/libzmq.so @@ -0,0 +1 @@ +libzmq.so.5.2.2 \ No newline at end of file diff --git a/zmq/4.3.2/Linux-x86_64_6/libzmq.so.5 b/zmq/4.3.2/Linux-x86_64_6/libzmq.so.5 new file mode 120000 index 0000000000000000000000000000000000000000..de44247364cf1f6055f8bf06809b95591daab3ba --- /dev/null +++ b/zmq/4.3.2/Linux-x86_64_6/libzmq.so.5 @@ -0,0 +1 @@ +libzmq.so.5.2.2 \ No newline at end of file diff --git a/zmq/4.3.2/Linux-x86_64_6/libzmq.so.5.2.2 b/zmq/4.3.2/Linux-x86_64_6/libzmq.so.5.2.2 new file mode 100755 index 0000000000000000000000000000000000000000..55d6ffea20fbcef0226a716c8bfb026a621bda3a Binary files /dev/null and b/zmq/4.3.2/Linux-x86_64_6/libzmq.so.5.2.2 differ diff --git a/zmq/4.3.2/SunOS-5.10/SunOS-5.10.tar b/zmq/4.3.2/SunOS-5.10/SunOS-5.10.tar new file mode 100644 index 0000000000000000000000000000000000000000..5f7786dfbaa1fcba07cb355d1b68e833c82745c3 Binary files /dev/null and b/zmq/4.3.2/SunOS-5.10/SunOS-5.10.tar differ diff --git a/zmq/4.3.2/SunOS-5.10/libzmq.so b/zmq/4.3.2/SunOS-5.10/libzmq.so new file mode 120000 index 0000000000000000000000000000000000000000..973c25c985ca63735fe3be2f081bb1b6de5e12a2 --- /dev/null +++ b/zmq/4.3.2/SunOS-5.10/libzmq.so @@ -0,0 +1 @@ +libzmq.so.5.1.3 \ No newline at end of file diff --git a/zmq/4.3.2/SunOS-5.10/libzmq.so.5 b/zmq/4.3.2/SunOS-5.10/libzmq.so.5 new file mode 120000 index 0000000000000000000000000000000000000000..973c25c985ca63735fe3be2f081bb1b6de5e12a2 --- /dev/null +++ b/zmq/4.3.2/SunOS-5.10/libzmq.so.5 @@ -0,0 +1 @@ +libzmq.so.5.1.3 \ No newline at end of file diff --git a/zmq/4.3.5/SunOS-5.10/libzmq.so.5.1.3 b/zmq/4.3.2/SunOS-5.10/libzmq.so.5.1.3 similarity index 100% rename from zmq/4.3.5/SunOS-5.10/libzmq.so.5.1.3 rename to zmq/4.3.2/SunOS-5.10/libzmq.so.5.1.3 diff --git a/zmq/4.3.2/SunOS-sun4v/SunOS-sun4v.tar b/zmq/4.3.2/SunOS-sun4v/SunOS-sun4v.tar new file mode 100644 index 0000000000000000000000000000000000000000..6f3853db1afb38065c9373b4945bb7843d0c0fdf Binary files /dev/null and b/zmq/4.3.2/SunOS-sun4v/SunOS-sun4v.tar differ diff --git a/zmq/4.3.2/SunOS-sun4v/libzmq.so b/zmq/4.3.2/SunOS-sun4v/libzmq.so new file mode 120000 index 0000000000000000000000000000000000000000..bf1f7f858670e622b41891d0f780fec94ad3d5fb --- /dev/null +++ b/zmq/4.3.2/SunOS-sun4v/libzmq.so @@ -0,0 +1 @@ +libzmq.so.5 \ No newline at end of file diff --git a/zmq/4.3.5/SunOS-sun4v/libzmq.so.4.3.5 b/zmq/4.3.2/SunOS-sun4v/libzmq.so.4.3.5 similarity index 100% rename from zmq/4.3.5/SunOS-sun4v/libzmq.so.4.3.5 rename to zmq/4.3.2/SunOS-sun4v/libzmq.so.4.3.5 diff --git a/zmq/4.3.2/SunOS-sun4v/libzmq.so.5 b/zmq/4.3.2/SunOS-sun4v/libzmq.so.5 new file mode 120000 index 0000000000000000000000000000000000000000..b3d4b4e77df62679121c72b7785afce1fb4e5e38 --- /dev/null +++ b/zmq/4.3.2/SunOS-sun4v/libzmq.so.5 @@ -0,0 +1 @@ +libzmq.so.4.3.5 \ No newline at end of file diff --git a/zmq/4.3.2/include.tar b/zmq/4.3.2/include.tar new file mode 100644 index 0000000000000000000000000000000000000000..b13763ccbec57b1ca32f66192a2de4ad882eb215 Binary files /dev/null and b/zmq/4.3.2/include.tar differ diff --git a/zmq/4.3.2/include/zmq.h b/zmq/4.3.2/include/zmq.h new file mode 100644 index 0000000000000000000000000000000000000000..f5713f808f6fad961e216ecafb16ad01d1fb936d --- /dev/null +++ b/zmq/4.3.2/include/zmq.h @@ -0,0 +1,752 @@ +/* + Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file + + This file is part of libzmq, the ZeroMQ core engine in C++. + + libzmq is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License (LGPL) as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + As a special exception, the Contributors give you permission to link + this library with independent modules to produce an executable, + regardless of the license terms of these independent modules, and to + copy and distribute the resulting executable under terms of your choice, + provided that you also meet, for each linked independent module, the + terms and conditions of the license of that module. An independent + module is a module which is not derived from or based on this library. + If you modify this library, you must extend this exception to your + version of the library. + + libzmq 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + + ************************************************************************* + NOTE to contributors. This file comprises the principal public contract + for ZeroMQ API users. Any change to this file supplied in a stable + release SHOULD not break existing applications. + In practice this means that the value of constants must not change, and + that old values may not be reused for new constants. + ************************************************************************* +*/ + +#ifndef __ZMQ_H_INCLUDED__ +#define __ZMQ_H_INCLUDED__ + +/* Version macros for compile-time API version detection */ +#define ZMQ_VERSION_MAJOR 4 +#define ZMQ_VERSION_MINOR 3 +#define ZMQ_VERSION_PATCH 2 + +#define ZMQ_MAKE_VERSION(major, minor, patch) \ + ((major) *10000 + (minor) *100 + (patch)) +#define ZMQ_VERSION \ + ZMQ_MAKE_VERSION (ZMQ_VERSION_MAJOR, ZMQ_VERSION_MINOR, ZMQ_VERSION_PATCH) + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined _WIN32_WCE +#include +#endif +#include +#include +#if defined _WIN32 +// Set target version to Windows Server 2008, Windows Vista or higher. +// Windows XP (0x0501) is supported but without client & server socket types. +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0600 +#endif + +#ifdef __MINGW32__ +// Require Windows XP or higher with MinGW for getaddrinfo(). +#if (_WIN32_WINNT >= 0x0501) +#else +#error You need at least Windows XP target +#endif +#endif +#include +#endif + +/* Handle DSO symbol visibility */ +#if defined _WIN32 +#if defined ZMQ_STATIC +#define ZMQ_EXPORT +#elif defined DLL_EXPORT +#define ZMQ_EXPORT __declspec(dllexport) +#else +#define ZMQ_EXPORT __declspec(dllimport) +#endif +#else +#if defined __SUNPRO_C || defined __SUNPRO_CC +#define ZMQ_EXPORT __global +#elif (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER +#define ZMQ_EXPORT __attribute__ ((visibility ("default"))) +#else +#define ZMQ_EXPORT +#endif +#endif + +/* Define integer types needed for event interface */ +#define ZMQ_DEFINED_STDINT 1 +#if defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_OPENVMS +#include +#elif defined _MSC_VER && _MSC_VER < 1600 +#ifndef uint64_t +typedef unsigned __int64 uint64_t; +#endif +#ifndef int32_t +typedef __int32 int32_t; +#endif +#ifndef uint32_t +typedef unsigned __int32 uint32_t; +#endif +#ifndef uint16_t +typedef unsigned __int16 uint16_t; +#endif +#ifndef uint8_t +typedef unsigned __int8 uint8_t; +#endif +#else +#include +#endif + +// 32-bit AIX's pollfd struct members are called reqevents and rtnevents so it +// defines compatibility macros for them. Need to include that header first to +// stop build failures since zmq_pollset_t defines them as events and revents. +#ifdef ZMQ_HAVE_AIX +#include +#endif + + +/******************************************************************************/ +/* 0MQ errors. */ +/******************************************************************************/ + +/* A number random enough not to collide with different errno ranges on */ +/* different OSes. The assumption is that error_t is at least 32-bit type. */ +#define ZMQ_HAUSNUMERO 156384712 + +/* On Windows platform some of the standard POSIX errnos are not defined. */ +#ifndef ENOTSUP +#define ENOTSUP (ZMQ_HAUSNUMERO + 1) +#endif +#ifndef EPROTONOSUPPORT +#define EPROTONOSUPPORT (ZMQ_HAUSNUMERO + 2) +#endif +#ifndef ENOBUFS +#define ENOBUFS (ZMQ_HAUSNUMERO + 3) +#endif +#ifndef ENETDOWN +#define ENETDOWN (ZMQ_HAUSNUMERO + 4) +#endif +#ifndef EADDRINUSE +#define EADDRINUSE (ZMQ_HAUSNUMERO + 5) +#endif +#ifndef EADDRNOTAVAIL +#define EADDRNOTAVAIL (ZMQ_HAUSNUMERO + 6) +#endif +#ifndef ECONNREFUSED +#define ECONNREFUSED (ZMQ_HAUSNUMERO + 7) +#endif +#ifndef EINPROGRESS +#define EINPROGRESS (ZMQ_HAUSNUMERO + 8) +#endif +#ifndef ENOTSOCK +#define ENOTSOCK (ZMQ_HAUSNUMERO + 9) +#endif +#ifndef EMSGSIZE +#define EMSGSIZE (ZMQ_HAUSNUMERO + 10) +#endif +#ifndef EAFNOSUPPORT +#define EAFNOSUPPORT (ZMQ_HAUSNUMERO + 11) +#endif +#ifndef ENETUNREACH +#define ENETUNREACH (ZMQ_HAUSNUMERO + 12) +#endif +#ifndef ECONNABORTED +#define ECONNABORTED (ZMQ_HAUSNUMERO + 13) +#endif +#ifndef ECONNRESET +#define ECONNRESET (ZMQ_HAUSNUMERO + 14) +#endif +#ifndef ENOTCONN +#define ENOTCONN (ZMQ_HAUSNUMERO + 15) +#endif +#ifndef ETIMEDOUT +#define ETIMEDOUT (ZMQ_HAUSNUMERO + 16) +#endif +#ifndef EHOSTUNREACH +#define EHOSTUNREACH (ZMQ_HAUSNUMERO + 17) +#endif +#ifndef ENETRESET +#define ENETRESET (ZMQ_HAUSNUMERO + 18) +#endif + +/* Native 0MQ error codes. */ +#define EFSM (ZMQ_HAUSNUMERO + 51) +#define ENOCOMPATPROTO (ZMQ_HAUSNUMERO + 52) +#define ETERM (ZMQ_HAUSNUMERO + 53) +#define EMTHREAD (ZMQ_HAUSNUMERO + 54) + +/* This function retrieves the errno as it is known to 0MQ library. The goal */ +/* of this function is to make the code 100% portable, including where 0MQ */ +/* compiled with certain CRT library (on Windows) is linked to an */ +/* application that uses different CRT library. */ +ZMQ_EXPORT int zmq_errno (void); + +/* Resolves system errors and 0MQ errors to human-readable string. */ +ZMQ_EXPORT const char *zmq_strerror (int errnum_); + +/* Run-time API version detection */ +ZMQ_EXPORT void zmq_version (int *major_, int *minor_, int *patch_); + +/******************************************************************************/ +/* 0MQ infrastructure (a.k.a. context) initialisation & termination. */ +/******************************************************************************/ + +/* Context options */ +#define ZMQ_IO_THREADS 1 +#define ZMQ_MAX_SOCKETS 2 +#define ZMQ_SOCKET_LIMIT 3 +#define ZMQ_THREAD_PRIORITY 3 +#define ZMQ_THREAD_SCHED_POLICY 4 +#define ZMQ_MAX_MSGSZ 5 +#define ZMQ_MSG_T_SIZE 6 +#define ZMQ_THREAD_AFFINITY_CPU_ADD 7 +#define ZMQ_THREAD_AFFINITY_CPU_REMOVE 8 +#define ZMQ_THREAD_NAME_PREFIX 9 + +/* Default for new contexts */ +#define ZMQ_IO_THREADS_DFLT 1 +#define ZMQ_MAX_SOCKETS_DFLT 1023 +#define ZMQ_THREAD_PRIORITY_DFLT -1 +#define ZMQ_THREAD_SCHED_POLICY_DFLT -1 + +ZMQ_EXPORT void *zmq_ctx_new (void); +ZMQ_EXPORT int zmq_ctx_term (void *context_); +ZMQ_EXPORT int zmq_ctx_shutdown (void *context_); +ZMQ_EXPORT int zmq_ctx_set (void *context_, int option_, int optval_); +ZMQ_EXPORT int zmq_ctx_get (void *context_, int option_); + +/* Old (legacy) API */ +ZMQ_EXPORT void *zmq_init (int io_threads_); +ZMQ_EXPORT int zmq_term (void *context_); +ZMQ_EXPORT int zmq_ctx_destroy (void *context_); + + +/******************************************************************************/ +/* 0MQ message definition. */ +/******************************************************************************/ + +/* Some architectures, like sparc64 and some variants of aarch64, enforce pointer + * alignment and raise sigbus on violations. Make sure applications allocate + * zmq_msg_t on addresses aligned on a pointer-size boundary to avoid this issue. + */ +typedef struct zmq_msg_t +{ +#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64)) + __declspec(align (8)) unsigned char _[64]; +#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_ARM_ARMV7VE)) + __declspec(align (4)) unsigned char _[64]; +#elif defined(__GNUC__) || defined(__INTEL_COMPILER) \ + || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x590) \ + || (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x590) + unsigned char _[64] __attribute__ ((aligned (sizeof (void *)))); +#else + unsigned char _[64]; +#endif +} zmq_msg_t; + +typedef void(zmq_free_fn) (void *data_, void *hint_); + +ZMQ_EXPORT int zmq_msg_init (zmq_msg_t *msg_); +ZMQ_EXPORT int zmq_msg_init_size (zmq_msg_t *msg_, size_t size_); +ZMQ_EXPORT int zmq_msg_init_data ( + zmq_msg_t *msg_, void *data_, size_t size_, zmq_free_fn *ffn_, void *hint_); +ZMQ_EXPORT int zmq_msg_send (zmq_msg_t *msg_, void *s_, int flags_); +ZMQ_EXPORT int zmq_msg_recv (zmq_msg_t *msg_, void *s_, int flags_); +ZMQ_EXPORT int zmq_msg_close (zmq_msg_t *msg_); +ZMQ_EXPORT int zmq_msg_move (zmq_msg_t *dest_, zmq_msg_t *src_); +ZMQ_EXPORT int zmq_msg_copy (zmq_msg_t *dest_, zmq_msg_t *src_); +ZMQ_EXPORT void *zmq_msg_data (zmq_msg_t *msg_); +ZMQ_EXPORT size_t zmq_msg_size (const zmq_msg_t *msg_); +ZMQ_EXPORT int zmq_msg_more (const zmq_msg_t *msg_); +ZMQ_EXPORT int zmq_msg_get (const zmq_msg_t *msg_, int property_); +ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg_, int property_, int optval_); +ZMQ_EXPORT const char *zmq_msg_gets (const zmq_msg_t *msg_, + const char *property_); + +/******************************************************************************/ +/* 0MQ socket definition. */ +/******************************************************************************/ + +/* Socket types. */ +#define ZMQ_PAIR 0 +#define ZMQ_PUB 1 +#define ZMQ_SUB 2 +#define ZMQ_REQ 3 +#define ZMQ_REP 4 +#define ZMQ_DEALER 5 +#define ZMQ_ROUTER 6 +#define ZMQ_PULL 7 +#define ZMQ_PUSH 8 +#define ZMQ_XPUB 9 +#define ZMQ_XSUB 10 +#define ZMQ_STREAM 11 + +/* Deprecated aliases */ +#define ZMQ_XREQ ZMQ_DEALER +#define ZMQ_XREP ZMQ_ROUTER + +/* Socket options. */ +#define ZMQ_AFFINITY 4 +#define ZMQ_ROUTING_ID 5 +#define ZMQ_SUBSCRIBE 6 +#define ZMQ_UNSUBSCRIBE 7 +#define ZMQ_RATE 8 +#define ZMQ_RECOVERY_IVL 9 +#define ZMQ_SNDBUF 11 +#define ZMQ_RCVBUF 12 +#define ZMQ_RCVMORE 13 +#define ZMQ_FD 14 +#define ZMQ_EVENTS 15 +#define ZMQ_TYPE 16 +#define ZMQ_LINGER 17 +#define ZMQ_RECONNECT_IVL 18 +#define ZMQ_BACKLOG 19 +#define ZMQ_RECONNECT_IVL_MAX 21 +#define ZMQ_MAXMSGSIZE 22 +#define ZMQ_SNDHWM 23 +#define ZMQ_RCVHWM 24 +#define ZMQ_MULTICAST_HOPS 25 +#define ZMQ_RCVTIMEO 27 +#define ZMQ_SNDTIMEO 28 +#define ZMQ_LAST_ENDPOINT 32 +#define ZMQ_ROUTER_MANDATORY 33 +#define ZMQ_TCP_KEEPALIVE 34 +#define ZMQ_TCP_KEEPALIVE_CNT 35 +#define ZMQ_TCP_KEEPALIVE_IDLE 36 +#define ZMQ_TCP_KEEPALIVE_INTVL 37 +#define ZMQ_IMMEDIATE 39 +#define ZMQ_XPUB_VERBOSE 40 +#define ZMQ_ROUTER_RAW 41 +#define ZMQ_IPV6 42 +#define ZMQ_MECHANISM 43 +#define ZMQ_PLAIN_SERVER 44 +#define ZMQ_PLAIN_USERNAME 45 +#define ZMQ_PLAIN_PASSWORD 46 +#define ZMQ_CURVE_SERVER 47 +#define ZMQ_CURVE_PUBLICKEY 48 +#define ZMQ_CURVE_SECRETKEY 49 +#define ZMQ_CURVE_SERVERKEY 50 +#define ZMQ_PROBE_ROUTER 51 +#define ZMQ_REQ_CORRELATE 52 +#define ZMQ_REQ_RELAXED 53 +#define ZMQ_CONFLATE 54 +#define ZMQ_ZAP_DOMAIN 55 +#define ZMQ_ROUTER_HANDOVER 56 +#define ZMQ_TOS 57 +#define ZMQ_CONNECT_ROUTING_ID 61 +#define ZMQ_GSSAPI_SERVER 62 +#define ZMQ_GSSAPI_PRINCIPAL 63 +#define ZMQ_GSSAPI_SERVICE_PRINCIPAL 64 +#define ZMQ_GSSAPI_PLAINTEXT 65 +#define ZMQ_HANDSHAKE_IVL 66 +#define ZMQ_SOCKS_PROXY 68 +#define ZMQ_XPUB_NODROP 69 +#define ZMQ_BLOCKY 70 +#define ZMQ_XPUB_MANUAL 71 +#define ZMQ_XPUB_WELCOME_MSG 72 +#define ZMQ_STREAM_NOTIFY 73 +#define ZMQ_INVERT_MATCHING 74 +#define ZMQ_HEARTBEAT_IVL 75 +#define ZMQ_HEARTBEAT_TTL 76 +#define ZMQ_HEARTBEAT_TIMEOUT 77 +#define ZMQ_XPUB_VERBOSER 78 +#define ZMQ_CONNECT_TIMEOUT 79 +#define ZMQ_TCP_MAXRT 80 +#define ZMQ_THREAD_SAFE 81 +#define ZMQ_MULTICAST_MAXTPDU 84 +#define ZMQ_VMCI_BUFFER_SIZE 85 +#define ZMQ_VMCI_BUFFER_MIN_SIZE 86 +#define ZMQ_VMCI_BUFFER_MAX_SIZE 87 +#define ZMQ_VMCI_CONNECT_TIMEOUT 88 +#define ZMQ_USE_FD 89 +#define ZMQ_GSSAPI_PRINCIPAL_NAMETYPE 90 +#define ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE 91 +#define ZMQ_BINDTODEVICE 92 + +/* Message options */ +#define ZMQ_MORE 1 +#define ZMQ_SHARED 3 + +/* Send/recv options. */ +#define ZMQ_DONTWAIT 1 +#define ZMQ_SNDMORE 2 + +/* Security mechanisms */ +#define ZMQ_NULL 0 +#define ZMQ_PLAIN 1 +#define ZMQ_CURVE 2 +#define ZMQ_GSSAPI 3 + +/* RADIO-DISH protocol */ +#define ZMQ_GROUP_MAX_LENGTH 15 + +/* Deprecated options and aliases */ +#define ZMQ_IDENTITY ZMQ_ROUTING_ID +#define ZMQ_CONNECT_RID ZMQ_CONNECT_ROUTING_ID +#define ZMQ_TCP_ACCEPT_FILTER 38 +#define ZMQ_IPC_FILTER_PID 58 +#define ZMQ_IPC_FILTER_UID 59 +#define ZMQ_IPC_FILTER_GID 60 +#define ZMQ_IPV4ONLY 31 +#define ZMQ_DELAY_ATTACH_ON_CONNECT ZMQ_IMMEDIATE +#define ZMQ_NOBLOCK ZMQ_DONTWAIT +#define ZMQ_FAIL_UNROUTABLE ZMQ_ROUTER_MANDATORY +#define ZMQ_ROUTER_BEHAVIOR ZMQ_ROUTER_MANDATORY + +/* Deprecated Message options */ +#define ZMQ_SRCFD 2 + +/******************************************************************************/ +/* GSSAPI definitions */ +/******************************************************************************/ + +/* GSSAPI principal name types */ +#define ZMQ_GSSAPI_NT_HOSTBASED 0 +#define ZMQ_GSSAPI_NT_USER_NAME 1 +#define ZMQ_GSSAPI_NT_KRB5_PRINCIPAL 2 + +/******************************************************************************/ +/* 0MQ socket events and monitoring */ +/******************************************************************************/ + +/* Socket transport events (TCP, IPC and TIPC only) */ + +#define ZMQ_EVENT_CONNECTED 0x0001 +#define ZMQ_EVENT_CONNECT_DELAYED 0x0002 +#define ZMQ_EVENT_CONNECT_RETRIED 0x0004 +#define ZMQ_EVENT_LISTENING 0x0008 +#define ZMQ_EVENT_BIND_FAILED 0x0010 +#define ZMQ_EVENT_ACCEPTED 0x0020 +#define ZMQ_EVENT_ACCEPT_FAILED 0x0040 +#define ZMQ_EVENT_CLOSED 0x0080 +#define ZMQ_EVENT_CLOSE_FAILED 0x0100 +#define ZMQ_EVENT_DISCONNECTED 0x0200 +#define ZMQ_EVENT_MONITOR_STOPPED 0x0400 +#define ZMQ_EVENT_ALL 0xFFFF +/* Unspecified system errors during handshake. Event value is an errno. */ +#define ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL 0x0800 +/* Handshake complete successfully with successful authentication (if * + * enabled). Event value is unused. */ +#define ZMQ_EVENT_HANDSHAKE_SUCCEEDED 0x1000 +/* Protocol errors between ZMTP peers or between server and ZAP handler. * + * Event value is one of ZMQ_PROTOCOL_ERROR_* */ +#define ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL 0x2000 +/* Failed authentication requests. Event value is the numeric ZAP status * + * code, i.e. 300, 400 or 500. */ +#define ZMQ_EVENT_HANDSHAKE_FAILED_AUTH 0x4000 +#define ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED 0x10000000 +#define ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND 0x10000001 +#define ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE 0x10000002 +#define ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE 0x10000003 +#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED 0x10000011 +#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE 0x10000012 +#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO 0x10000013 +#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE 0x10000014 +#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR 0x10000015 +#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY 0x10000016 +#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME 0x10000017 +#define ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA 0x10000018 +// the following two may be due to erroneous configuration of a peer +#define ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC 0x11000001 +#define ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH 0x11000002 +#define ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED 0x20000000 +#define ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY 0x20000001 +#define ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID 0x20000002 +#define ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION 0x20000003 +#define ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE 0x20000004 +#define ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA 0x20000005 + +ZMQ_EXPORT void *zmq_socket (void *, int type_); +ZMQ_EXPORT int zmq_close (void *s_); +ZMQ_EXPORT int +zmq_setsockopt (void *s_, int option_, const void *optval_, size_t optvallen_); +ZMQ_EXPORT int +zmq_getsockopt (void *s_, int option_, void *optval_, size_t *optvallen_); +ZMQ_EXPORT int zmq_bind (void *s_, const char *addr_); +ZMQ_EXPORT int zmq_connect (void *s_, const char *addr_); +ZMQ_EXPORT int zmq_unbind (void *s_, const char *addr_); +ZMQ_EXPORT int zmq_disconnect (void *s_, const char *addr_); +ZMQ_EXPORT int zmq_send (void *s_, const void *buf_, size_t len_, int flags_); +ZMQ_EXPORT int +zmq_send_const (void *s_, const void *buf_, size_t len_, int flags_); +ZMQ_EXPORT int zmq_recv (void *s_, void *buf_, size_t len_, int flags_); +ZMQ_EXPORT int zmq_socket_monitor (void *s_, const char *addr_, int events_); + + +/******************************************************************************/ +/* Deprecated I/O multiplexing. Prefer using zmq_poller API */ +/******************************************************************************/ + +#define ZMQ_POLLIN 1 +#define ZMQ_POLLOUT 2 +#define ZMQ_POLLERR 4 +#define ZMQ_POLLPRI 8 + +typedef struct zmq_pollitem_t +{ + void *socket; +#if defined _WIN32 + SOCKET fd; +#else + int fd; +#endif + short events; + short revents; +} zmq_pollitem_t; + +#define ZMQ_POLLITEMS_DFLT 16 + +ZMQ_EXPORT int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_); + +/******************************************************************************/ +/* Message proxying */ +/******************************************************************************/ + +ZMQ_EXPORT int zmq_proxy (void *frontend_, void *backend_, void *capture_); +ZMQ_EXPORT int zmq_proxy_steerable (void *frontend_, + void *backend_, + void *capture_, + void *control_); + +/******************************************************************************/ +/* Probe library capabilities */ +/******************************************************************************/ + +#define ZMQ_HAS_CAPABILITIES 1 +ZMQ_EXPORT int zmq_has (const char *capability_); + +/* Deprecated aliases */ +#define ZMQ_STREAMER 1 +#define ZMQ_FORWARDER 2 +#define ZMQ_QUEUE 3 + +/* Deprecated methods */ +ZMQ_EXPORT int zmq_device (int type_, void *frontend_, void *backend_); +ZMQ_EXPORT int zmq_sendmsg (void *s_, zmq_msg_t *msg_, int flags_); +ZMQ_EXPORT int zmq_recvmsg (void *s_, zmq_msg_t *msg_, int flags_); +struct iovec; +ZMQ_EXPORT int +zmq_sendiov (void *s_, struct iovec *iov_, size_t count_, int flags_); +ZMQ_EXPORT int +zmq_recviov (void *s_, struct iovec *iov_, size_t *count_, int flags_); + +/******************************************************************************/ +/* Encryption functions */ +/******************************************************************************/ + +/* Encode data with Z85 encoding. Returns encoded data */ +ZMQ_EXPORT char * +zmq_z85_encode (char *dest_, const uint8_t *data_, size_t size_); + +/* Decode data with Z85 encoding. Returns decoded data */ +ZMQ_EXPORT uint8_t *zmq_z85_decode (uint8_t *dest_, const char *string_); + +/* Generate z85-encoded public and private keypair with tweetnacl/libsodium. */ +/* Returns 0 on success. */ +ZMQ_EXPORT int zmq_curve_keypair (char *z85_public_key_, char *z85_secret_key_); + +/* Derive the z85-encoded public key from the z85-encoded secret key. */ +/* Returns 0 on success. */ +ZMQ_EXPORT int zmq_curve_public (char *z85_public_key_, + const char *z85_secret_key_); + +/******************************************************************************/ +/* Atomic utility methods */ +/******************************************************************************/ + +ZMQ_EXPORT void *zmq_atomic_counter_new (void); +ZMQ_EXPORT void zmq_atomic_counter_set (void *counter_, int value_); +ZMQ_EXPORT int zmq_atomic_counter_inc (void *counter_); +ZMQ_EXPORT int zmq_atomic_counter_dec (void *counter_); +ZMQ_EXPORT int zmq_atomic_counter_value (void *counter_); +ZMQ_EXPORT void zmq_atomic_counter_destroy (void **counter_p_); + +/******************************************************************************/ +/* Scheduling timers */ +/******************************************************************************/ + +#define ZMQ_HAVE_TIMERS + +typedef void(zmq_timer_fn) (int timer_id, void *arg); + +ZMQ_EXPORT void *zmq_timers_new (void); +ZMQ_EXPORT int zmq_timers_destroy (void **timers_p); +ZMQ_EXPORT int +zmq_timers_add (void *timers, size_t interval, zmq_timer_fn handler, void *arg); +ZMQ_EXPORT int zmq_timers_cancel (void *timers, int timer_id); +ZMQ_EXPORT int +zmq_timers_set_interval (void *timers, int timer_id, size_t interval); +ZMQ_EXPORT int zmq_timers_reset (void *timers, int timer_id); +ZMQ_EXPORT long zmq_timers_timeout (void *timers); +ZMQ_EXPORT int zmq_timers_execute (void *timers); + + +/******************************************************************************/ +/* These functions are not documented by man pages -- use at your own risk. */ +/* If you need these to be part of the formal ZMQ API, then (a) write a man */ +/* page, and (b) write a test case in tests. */ +/******************************************************************************/ + +/* Helper functions are used by perf tests so that they don't have to care */ +/* about minutiae of time-related functions on different OS platforms. */ + +/* Starts the stopwatch. Returns the handle to the watch. */ +ZMQ_EXPORT void *zmq_stopwatch_start (void); + +/* Returns the number of microseconds elapsed since the stopwatch was */ +/* started, but does not stop or deallocate the stopwatch. */ +ZMQ_EXPORT unsigned long zmq_stopwatch_intermediate (void *watch_); + +/* Stops the stopwatch. Returns the number of microseconds elapsed since */ +/* the stopwatch was started, and deallocates that watch. */ +ZMQ_EXPORT unsigned long zmq_stopwatch_stop (void *watch_); + +/* Sleeps for specified number of seconds. */ +ZMQ_EXPORT void zmq_sleep (int seconds_); + +typedef void(zmq_thread_fn) (void *); + +/* Start a thread. Returns a handle to the thread. */ +ZMQ_EXPORT void *zmq_threadstart (zmq_thread_fn *func_, void *arg_); + +/* Wait for thread to complete then free up resources. */ +ZMQ_EXPORT void zmq_threadclose (void *thread_); + + +/******************************************************************************/ +/* These functions are DRAFT and disabled in stable releases, and subject to */ +/* change at ANY time until declared stable. */ +/******************************************************************************/ + +#ifdef ZMQ_BUILD_DRAFT_API + +/* DRAFT Socket types. */ +#define ZMQ_SERVER 12 +#define ZMQ_CLIENT 13 +#define ZMQ_RADIO 14 +#define ZMQ_DISH 15 +#define ZMQ_GATHER 16 +#define ZMQ_SCATTER 17 +#define ZMQ_DGRAM 18 + +/* DRAFT Socket options. */ +#define ZMQ_ZAP_ENFORCE_DOMAIN 93 +#define ZMQ_LOOPBACK_FASTPATH 94 +#define ZMQ_METADATA 95 +#define ZMQ_MULTICAST_LOOP 96 +#define ZMQ_ROUTER_NOTIFY 97 +#define ZMQ_XPUB_MANUAL_LAST_VALUE 98 +#define ZMQ_SOCKS_USERNAME 99 +#define ZMQ_SOCKS_PASSWORD 100 +#define ZMQ_IN_BATCH_SIZE 101 +#define ZMQ_OUT_BATCH_SIZE 102 + +/* DRAFT Context options */ +#define ZMQ_ZERO_COPY_RECV 10 + +/* DRAFT Socket methods. */ +ZMQ_EXPORT int zmq_join (void *s, const char *group); +ZMQ_EXPORT int zmq_leave (void *s, const char *group); + +/* DRAFT Msg methods. */ +ZMQ_EXPORT int zmq_msg_set_routing_id (zmq_msg_t *msg, uint32_t routing_id); +ZMQ_EXPORT uint32_t zmq_msg_routing_id (zmq_msg_t *msg); +ZMQ_EXPORT int zmq_msg_set_group (zmq_msg_t *msg, const char *group); +ZMQ_EXPORT const char *zmq_msg_group (zmq_msg_t *msg); + +/* DRAFT Msg property names. */ +#define ZMQ_MSG_PROPERTY_ROUTING_ID "Routing-Id" +#define ZMQ_MSG_PROPERTY_SOCKET_TYPE "Socket-Type" +#define ZMQ_MSG_PROPERTY_USER_ID "User-Id" +#define ZMQ_MSG_PROPERTY_PEER_ADDRESS "Peer-Address" + +/* Router notify options */ +#define ZMQ_NOTIFY_CONNECT 1 +#define ZMQ_NOTIFY_DISCONNECT 2 + +/******************************************************************************/ +/* Poller polling on sockets,fd and thread-safe sockets */ +/******************************************************************************/ + +#define ZMQ_HAVE_POLLER + +#if defined _WIN32 +typedef SOCKET zmq_fd_t; +#else +typedef int zmq_fd_t; +#endif + +typedef struct zmq_poller_event_t +{ + void *socket; + zmq_fd_t fd; + void *user_data; + short events; +} zmq_poller_event_t; + +ZMQ_EXPORT void *zmq_poller_new (void); +ZMQ_EXPORT int zmq_poller_destroy (void **poller_p); +ZMQ_EXPORT int +zmq_poller_add (void *poller, void *socket, void *user_data, short events); +ZMQ_EXPORT int zmq_poller_modify (void *poller, void *socket, short events); +ZMQ_EXPORT int zmq_poller_remove (void *poller, void *socket); +ZMQ_EXPORT int +zmq_poller_wait (void *poller, zmq_poller_event_t *event, long timeout); +ZMQ_EXPORT int zmq_poller_wait_all (void *poller, + zmq_poller_event_t *events, + int n_events, + long timeout); +ZMQ_EXPORT int zmq_poller_fd (void *poller, zmq_fd_t *fd); + +ZMQ_EXPORT int +zmq_poller_add_fd (void *poller, zmq_fd_t fd, void *user_data, short events); +ZMQ_EXPORT int zmq_poller_modify_fd (void *poller, zmq_fd_t fd, short events); +ZMQ_EXPORT int zmq_poller_remove_fd (void *poller, zmq_fd_t fd); + +ZMQ_EXPORT int zmq_socket_get_peer_state (void *socket, + const void *routing_id, + size_t routing_id_size); + +/* DRAFT Socket monitoring events */ +#define ZMQ_EVENT_PIPES_STATS 0x10000 + +#define ZMQ_CURRENT_EVENT_VERSION 1 +#define ZMQ_CURRENT_EVENT_VERSION_DRAFT 2 + +#define ZMQ_EVENT_ALL_V1 ZMQ_EVENT_ALL +#define ZMQ_EVENT_ALL_V2 ZMQ_EVENT_ALL_V1 | ZMQ_EVENT_PIPES_STATS + +ZMQ_EXPORT int zmq_socket_monitor_versioned ( + void *s_, const char *addr_, uint64_t events_, int event_version_, int type_); +ZMQ_EXPORT int zmq_socket_monitor_pipes_stats (void *s); + +#endif // ZMQ_BUILD_DRAFT_API + + +#undef ZMQ_EXPORT + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/zmq/4.3.2/include/zmq_utils.h b/zmq/4.3.2/include/zmq_utils.h new file mode 100644 index 0000000000000000000000000000000000000000..b9398d57e1e1c8e8a82d8bbfe13d940f1c22de57 --- /dev/null +++ b/zmq/4.3.2/include/zmq_utils.h @@ -0,0 +1,50 @@ +/* + Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file + + This file is part of libzmq, the ZeroMQ core engine in C++. + + libzmq is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License (LGPL) as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + As a special exception, the Contributors give you permission to link + this library with independent modules to produce an executable, + regardless of the license terms of these independent modules, and to + copy and distribute the resulting executable under terms of your choice, + provided that you also meet, for each linked independent module, the + terms and conditions of the license of that module. An independent + module is a module which is not derived from or based on this library. + If you modify this library, you must extend this exception to your + version of the library. + + libzmq 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . +*/ + +/* This file is deprecated, and all its functionality provided by zmq.h */ +/* Note that -Wpedantic compilation requires GCC to avoid using its custom + extensions such as #warning, hence the trick below. Also, pragmas for + warnings or other messages are not standard, not portable, and not all + compilers even have an equivalent concept. + So in the worst case, this include file is treated as silently empty. */ + +#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) \ + || defined(_MSC_VER) +#if defined(__GNUC__) || defined(__GNUG__) +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wcpp" +#pragma GCC diagnostic ignored "-Werror" +#pragma GCC diagnostic ignored "-Wall" +#endif +#pragma message( \ + "Warning: zmq_utils.h is deprecated. All its functionality is provided by zmq.h.") +#if defined(__GNUC__) || defined(__GNUG__) +#pragma GCC diagnostic pop +#endif +#endif diff --git a/zmq/4.3.5/SunOS-5.10/SunOS-5.10.tar b/zmq/4.3.5/SunOS-5.10/SunOS-5.10.tar index 5f7786dfbaa1fcba07cb355d1b68e833c82745c3..7600eedaa67b457fd364e654d0be97b12cf61c6e 100644 Binary files a/zmq/4.3.5/SunOS-5.10/SunOS-5.10.tar and b/zmq/4.3.5/SunOS-5.10/SunOS-5.10.tar differ diff --git a/zmq/4.3.5/SunOS-5.10/libzmq.so b/zmq/4.3.5/SunOS-5.10/libzmq.so index 973c25c985ca63735fe3be2f081bb1b6de5e12a2..de44247364cf1f6055f8bf06809b95591daab3ba 120000 --- a/zmq/4.3.5/SunOS-5.10/libzmq.so +++ b/zmq/4.3.5/SunOS-5.10/libzmq.so @@ -1 +1 @@ -libzmq.so.5.1.3 \ No newline at end of file +libzmq.so.5.2.2 \ No newline at end of file diff --git a/zmq/4.3.5/SunOS-5.10/libzmq.so.5 b/zmq/4.3.5/SunOS-5.10/libzmq.so.5 index 973c25c985ca63735fe3be2f081bb1b6de5e12a2..de44247364cf1f6055f8bf06809b95591daab3ba 120000 --- a/zmq/4.3.5/SunOS-5.10/libzmq.so.5 +++ b/zmq/4.3.5/SunOS-5.10/libzmq.so.5 @@ -1 +1 @@ -libzmq.so.5.1.3 \ No newline at end of file +libzmq.so.5.2.2 \ No newline at end of file diff --git a/zmq/4.3.5/SunOS-5.10/libzmq.so.5.2.2 b/zmq/4.3.5/SunOS-5.10/libzmq.so.5.2.2 new file mode 100755 index 0000000000000000000000000000000000000000..b94a7c84be11f22fc0534f97e415d0fb62e83aae Binary files /dev/null and b/zmq/4.3.5/SunOS-5.10/libzmq.so.5.2.2 differ diff --git a/zmq/4.3.5/SunOS-sun4v/SunOS-sun4v.tar b/zmq/4.3.5/SunOS-sun4v/SunOS-sun4v.tar index 6f3853db1afb38065c9373b4945bb7843d0c0fdf..139521ff0c4d9dd8a318e110b9575a38e445cd0d 100644 Binary files a/zmq/4.3.5/SunOS-sun4v/SunOS-sun4v.tar and b/zmq/4.3.5/SunOS-sun4v/SunOS-sun4v.tar differ diff --git a/zmq/4.3.5/SunOS-sun4v/libzmq.so b/zmq/4.3.5/SunOS-sun4v/libzmq.so index bf1f7f858670e622b41891d0f780fec94ad3d5fb..de44247364cf1f6055f8bf06809b95591daab3ba 120000 --- a/zmq/4.3.5/SunOS-sun4v/libzmq.so +++ b/zmq/4.3.5/SunOS-sun4v/libzmq.so @@ -1 +1 @@ -libzmq.so.5 \ No newline at end of file +libzmq.so.5.2.2 \ No newline at end of file diff --git a/zmq/4.3.5/SunOS-sun4v/libzmq.so.5 b/zmq/4.3.5/SunOS-sun4v/libzmq.so.5 index b3d4b4e77df62679121c72b7785afce1fb4e5e38..de44247364cf1f6055f8bf06809b95591daab3ba 120000 --- a/zmq/4.3.5/SunOS-sun4v/libzmq.so.5 +++ b/zmq/4.3.5/SunOS-sun4v/libzmq.so.5 @@ -1 +1 @@ -libzmq.so.4.3.5 \ No newline at end of file +libzmq.so.5.2.2 \ No newline at end of file diff --git a/zmq/4.3.5/SunOS-sun4v/libzmq.so.5.2.2 b/zmq/4.3.5/SunOS-sun4v/libzmq.so.5.2.2 new file mode 100755 index 0000000000000000000000000000000000000000..b94a7c84be11f22fc0534f97e415d0fb62e83aae Binary files /dev/null and b/zmq/4.3.5/SunOS-sun4v/libzmq.so.5.2.2 differ