Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit

  • Loading branch information...
commit 54a4304f0b37d0314086a8b8c68a41b60818234b 0 parents
@mscdex authored
Showing with 34,514 additions and 0 deletions.
  1. +19 −0 LICENSE
  2. +40 −0 binding.gyp
  3. +56 −0 deps/libmysql-maria/include/mysql/auth_dialog_client.h
  4. +186 −0 deps/libmysql-maria/include/mysql/client_plugin.h
  5. +116 −0 deps/libmysql-maria/include/mysql/decimal.h
  6. +108 −0 deps/libmysql-maria/include/mysql/errmsg.h
  7. +207 −0 deps/libmysql-maria/include/mysql/keycache.h
  8. +661 −0 deps/libmysql-maria/include/mysql/m_ctype.h
  9. +235 −0 deps/libmysql-maria/include/mysql/m_string.h
  10. +147 −0 deps/libmysql-maria/include/mysql/ma_dyncol.h
  11. +60 −0 deps/libmysql-maria/include/mysql/my_alloc.h
  12. +74 −0 deps/libmysql-maria/include/mysql/my_attribute.h
  13. +153 −0 deps/libmysql-maria/include/mysql/my_compiler.h
  14. +633 −0 deps/libmysql-maria/include/mysql/my_config.h
  15. +187 −0 deps/libmysql-maria/include/mysql/my_dbug.h
  16. +45 −0 deps/libmysql-maria/include/mysql/my_decimal_limits.h
  17. +109 −0 deps/libmysql-maria/include/mysql/my_dir.h
  18. +126 −0 deps/libmysql-maria/include/mysql/my_getopt.h
  19. +1,543 −0 deps/libmysql-maria/include/mysql/my_global.h
  20. +45 −0 deps/libmysql-maria/include/mysql/my_list.h
  21. +78 −0 deps/libmysql-maria/include/mysql/my_net.h
  22. +923 −0 deps/libmysql-maria/include/mysql/my_pthread.h
  23. +1,005 −0 deps/libmysql-maria/include/mysql/my_sys.h
  24. +47 −0 deps/libmysql-maria/include/mysql/my_valgrind.h
  25. +89 −0 deps/libmysql-maria/include/mysql/my_xml.h
  26. +870 −0 deps/libmysql-maria/include/mysql/mysql.h
  27. +592 −0 deps/libmysql-maria/include/mysql/mysql_com.h
  28. +31 −0 deps/libmysql-maria/include/mysql/mysql_embed.h
  29. +55 −0 deps/libmysql-maria/include/mysql/mysql_time.h
  30. +31 −0 deps/libmysql-maria/include/mysql/mysql_version.h
  31. +763 −0 deps/libmysql-maria/include/mysql/mysqld_ername.h
  32. +768 −0 deps/libmysql-maria/include/mysql/mysqld_error.h
  33. +708 −0 deps/libmysql-maria/include/mysql/plugin.h
  34. +128 −0 deps/libmysql-maria/include/mysql/plugin_audit.h
  35. +126 −0 deps/libmysql-maria/include/mysql/plugin_auth.h
  36. +110 −0 deps/libmysql-maria/include/mysql/plugin_auth_common.h
  37. +212 −0 deps/libmysql-maria/include/mysql/plugin_ftparser.h
  38. +42 −0 deps/libmysql-maria/include/mysql/private/atomic/gcc_builtins.h
  39. +135 −0 deps/libmysql-maria/include/mysql/private/atomic/generic-msvc.h
  40. +69 −0 deps/libmysql-maria/include/mysql/private/atomic/nolock.h
  41. +101 −0 deps/libmysql-maria/include/mysql/private/atomic/rwlock.h
  42. +72 −0 deps/libmysql-maria/include/mysql/private/atomic/solaris.h
  43. +145 −0 deps/libmysql-maria/include/mysql/private/atomic/x86-gcc.h
  44. +164 −0 deps/libmysql-maria/include/mysql/private/authors.h
  45. +48 −0 deps/libmysql-maria/include/mysql/private/base64.h
  46. +52 −0 deps/libmysql-maria/include/mysql/private/client_settings.h
  47. +45 −0 deps/libmysql-maria/include/mysql/private/contributors.h
  48. +93 −0 deps/libmysql-maria/include/mysql/private/create_options.h
  49. +27 −0 deps/libmysql-maria/include/mysql/private/custom_conf.h
  50. +41 −0 deps/libmysql-maria/include/mysql/private/datadict.h
  51. +47 −0 deps/libmysql-maria/include/mysql/private/debug_sync.h
  52. +25 −0 deps/libmysql-maria/include/mysql/private/derror.h
  53. +40 −0 deps/libmysql-maria/include/mysql/private/des_key_file.h
  54. +24 −0 deps/libmysql-maria/include/mysql/private/discover.h
  55. +195 −0 deps/libmysql-maria/include/mysql/private/event_data_objects.h
  56. +127 −0 deps/libmysql-maria/include/mysql/private/event_db_repository.h
  57. +132 −0 deps/libmysql-maria/include/mysql/private/event_parse_data.h
  58. +135 −0 deps/libmysql-maria/include/mysql/private/event_queue.h
  59. +157 −0 deps/libmysql-maria/include/mysql/private/event_scheduler.h
  60. +150 −0 deps/libmysql-maria/include/mysql/private/events.h
  61. +2,377 −0 deps/libmysql-maria/include/mysql/private/field.h
  62. +38 −0 deps/libmysql-maria/include/mysql/private/filesort.h
  63. +23 −0 deps/libmysql-maria/include/mysql/private/frm_crypt.h
  64. +90 −0 deps/libmysql-maria/include/mysql/private/ft_global.h
  65. +600 −0 deps/libmysql-maria/include/mysql/private/gcalc_slicescan.h
  66. +348 −0 deps/libmysql-maria/include/mysql/private/gcalc_tools.h
  67. +93 −0 deps/libmysql-maria/include/mysql/private/gstream.h
  68. +599 −0 deps/libmysql-maria/include/mysql/private/ha_ndbcluster.h
  69. +239 −0 deps/libmysql-maria/include/mysql/private/ha_ndbcluster_binlog.h
  70. +500 −0 deps/libmysql-maria/include/mysql/private/ha_ndbcluster_cond.h
  71. +28 −0 deps/libmysql-maria/include/mysql/private/ha_ndbcluster_tables.h
  72. +1,170 −0 deps/libmysql-maria/include/mysql/private/ha_partition.h
  73. +3,023 −0 deps/libmysql-maria/include/mysql/private/handler.h
  74. +105 −0 deps/libmysql-maria/include/mysql/private/hash.h
  75. +137 −0 deps/libmysql-maria/include/mysql/private/hash_filo.h
  76. +269 −0 deps/libmysql-maria/include/mysql/private/heap.h
  77. +30 −0 deps/libmysql-maria/include/mysql/private/hostname.h
  78. +24 −0 deps/libmysql-maria/include/mysql/private/init.h
  79. +36 −0 deps/libmysql-maria/include/mysql/private/innodb_priv.h
  80. +4,219 −0 deps/libmysql-maria/include/mysql/private/item.h
  81. +1,913 −0 deps/libmysql-maria/include/mysql/private/item_cmpfunc.h
  82. +184 −0 deps/libmysql-maria/include/mysql/private/item_create.h
  83. +2,017 −0 deps/libmysql-maria/include/mysql/private/item_func.h
  84. +506 −0 deps/libmysql-maria/include/mysql/private/item_geofunc.h
  85. +91 −0 deps/libmysql-maria/include/mysql/private/item_row.h
  86. +1,069 −0 deps/libmysql-maria/include/mysql/private/item_strfunc.h
  87. +1,434 −0 deps/libmysql-maria/include/mysql/private/item_subselect.h
Sorry, we could not display the entire diff because it was too big.
19 LICENSE
@@ -0,0 +1,19 @@
+Copyright Brian White. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
40 binding.gyp
@@ -0,0 +1,40 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'sqlclient',
+ 'sources': [
+ 'src/client.cc',
+ ],
+ 'include_dirs': [
+ 'deps/libmysql-maria/include',
+ ],
+ 'cflags': [ '-O3' ],
+ 'conditions': [
+ [ 'OS=="win"', {
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'IgnoreDefaultLibraryNames': ['libcmt.lib'],
+ }
+ },
+ #'link_settings': {
+ 'conditions': [
+ [ 'target_arch=="ia32"', {
+ 'libraries': [
+ '<(PRODUCT_DIR)/../../deps/libmysql-maria/win-x86/mysqlclient.lib',
+ ],
+ }, {
+ 'libraries': [
+ 'deps/libmysql-maria/win-x86_64/clientlib.lib',
+ ],
+ }]
+ ]
+ #}
+ }, {
+ 'libraries': [
+ 'libmysqlclient.a',
+ ],
+ }],
+ ]
+ },
+ ],
+}
56 deps/libmysql-maria/include/mysql/auth_dialog_client.h
@@ -0,0 +1,56 @@
+#ifndef MYSQL_AUTH_DIALOG_CLIENT_INCLUDED
+/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/**
+ @file
+
+ Definitions needed to use Dialog client authentication plugin
+*/
+
+struct st_mysql;
+
+#define MYSQL_AUTH_DIALOG_CLIENT_INCLUDED
+
+/**
+ type of the mysql_authentication_dialog_ask function
+
+ @param mysql mysql
+ @param type type of the input
+ 1 - ordinary string input
+ 2 - password string
+ @param prompt prompt
+ @param buf a buffer to store the use input
+ @param buf_len the length of the buffer
+
+ @retval a pointer to the user input string.
+ It may be equal to 'buf' or to 'mysql->password'.
+ In all other cases it is assumed to be an allocated
+ string, and the "dialog" plugin will free() it.
+*/
+typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql,
+ int type, const char *prompt, char *buf, int buf_len);
+
+/**
+ first byte of the question string is the question "type".
+ It can be an "ordinary" or a "password" question.
+ The last bit set marks a last question in the authentication exchange.
+*/
+#define ORDINARY_QUESTION "\2"
+#define LAST_QUESTION "\3"
+#define PASSWORD_QUESTION "\4"
+#define LAST_PASSWORD "\5"
+
+#endif
186 deps/libmysql-maria/include/mysql/client_plugin.h
@@ -0,0 +1,186 @@
+#ifndef MYSQL_CLIENT_PLUGIN_INCLUDED
+/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
+ Copyright (c) 2010, 2011, Oracle and/or its affiliates.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/**
+ @file
+
+ MySQL Client Plugin API
+
+ This file defines the API for plugins that work on the client side
+*/
+#define MYSQL_CLIENT_PLUGIN_INCLUDED
+
+/*
+ On Windows, exports from DLL need to be declared
+ Also, plugin needs to be declared as extern "C" because MSVC
+ unlike other compilers, uses C++ mangling for variables not only
+ for functions.
+*/
+#undef MYSQL_PLUGIN_EXPORT
+#if defined(_MSC_VER)
+ #ifdef __cplusplus
+ #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
+ #else
+ #define MYSQL_PLUGIN_EXPORT __declspec(dllexport)
+ #endif
+#else /*_MSC_VER */
+ #ifdef __cplusplus
+ #define MYSQL_PLUGIN_EXPORT extern "C"
+ #else
+ #define MYSQL_PLUGIN_EXPORT
+ #endif
+#endif
+
+#ifndef MYSQL_ABI_CHECK
+#include <stdarg.h>
+#include <stdlib.h>
+#endif
+
+/* known plugin types */
+#define MYSQL_CLIENT_reserved1 0
+#define MYSQL_CLIENT_reserved2 1
+#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN 2
+
+#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION 0x0100
+
+#define MYSQL_CLIENT_MAX_PLUGINS 3
+
+#define mysql_declare_client_plugin(X) \
+ MYSQL_PLUGIN_EXPORT struct st_mysql_client_plugin_ ## X \
+ _mysql_client_plugin_declaration_ = { \
+ MYSQL_CLIENT_ ## X ## _PLUGIN, \
+ MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION,
+#define mysql_end_client_plugin }
+
+/* generic plugin header structure */
+#define MYSQL_CLIENT_PLUGIN_HEADER \
+ int type; \
+ unsigned int interface_version; \
+ const char *name; \
+ const char *author; \
+ const char *desc; \
+ unsigned int version[3]; \
+ const char *license; \
+ void *mysql_api; \
+ int (*init)(char *, size_t, int, va_list); \
+ int (*deinit)(); \
+ int (*options)(const char *option, const void *);
+
+struct st_mysql_client_plugin
+{
+ MYSQL_CLIENT_PLUGIN_HEADER
+};
+
+struct st_mysql;
+
+/******** authentication plugin specific declarations *********/
+#include <mysql/plugin_auth_common.h>
+
+struct st_mysql_client_plugin_AUTHENTICATION
+{
+ MYSQL_CLIENT_PLUGIN_HEADER
+ int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
+};
+
+#include <mysql/auth_dialog_client.h>
+
+/******** using plugins ************/
+
+/**
+ loads a plugin and initializes it
+
+ @param mysql MYSQL structure.
+ @param name a name of the plugin to load
+ @param type type of plugin that should be loaded, -1 to disable type check
+ @param argc number of arguments to pass to the plugin initialization
+ function
+ @param ... arguments for the plugin initialization function
+
+ @retval
+ a pointer to the loaded plugin, or NULL in case of a failure
+*/
+struct st_mysql_client_plugin *
+mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
+ int argc, ...);
+
+/**
+ loads a plugin and initializes it, taking va_list as an argument
+
+ This is the same as mysql_load_plugin, but take va_list instead of
+ a list of arguments.
+
+ @param mysql MYSQL structure.
+ @param name a name of the plugin to load
+ @param type type of plugin that should be loaded, -1 to disable type check
+ @param argc number of arguments to pass to the plugin initialization
+ function
+ @param args arguments for the plugin initialization function
+
+ @retval
+ a pointer to the loaded plugin, or NULL in case of a failure
+*/
+struct st_mysql_client_plugin *
+mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
+ int argc, va_list args);
+
+/**
+ finds an already loaded plugin by name, or loads it, if necessary
+
+ @param mysql MYSQL structure.
+ @param name a name of the plugin to load
+ @param type type of plugin that should be loaded
+
+ @retval
+ a pointer to the plugin, or NULL in case of a failure
+*/
+struct st_mysql_client_plugin *
+mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);
+
+/**
+ adds a plugin structure to the list of loaded plugins
+
+ This is useful if an application has the necessary functionality
+ (for example, a special load data handler) statically linked into
+ the application binary. It can use this function to register the plugin
+ directly, avoiding the need to factor it out into a shared object.
+
+ @param mysql MYSQL structure. It is only used for error reporting
+ @param plugin an st_mysql_client_plugin structure to register
+
+ @retval
+ a pointer to the plugin, or NULL in case of a failure
+*/
+struct st_mysql_client_plugin *
+mysql_client_register_plugin(struct st_mysql *mysql,
+ struct st_mysql_client_plugin *plugin);
+
+/**
+ set plugin options
+
+ Can be used to set extra options and affect behavior for a plugin.
+ This function may be called multiple times to set several options
+
+ @param plugin an st_mysql_client_plugin structure
+ @param option a string which specifies the option to set
+ @param value value for the option.
+
+ @retval 0 on success, 1 in case of failure
+**/
+int mysql_plugin_options(struct st_mysql_client_plugin *plugin,
+ const char *option, const void *value);
+#endif
+
116 deps/libmysql-maria/include/mysql/decimal.h
@@ -0,0 +1,116 @@
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+#ifndef _decimal_h
+#define _decimal_h
+
+typedef enum
+{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR}
+ decimal_round_mode;
+typedef int32 decimal_digit_t;
+
+/**
+ intg is the number of *decimal* digits (NOT number of decimal_digit_t's !)
+ before the point
+ frac is the number of decimal digits after the point
+ len is the length of buf (length of allocated space) in decimal_digit_t's,
+ not in bytes
+ sign false means positive, true means negative
+ buf is an array of decimal_digit_t's
+ */
+typedef struct st_decimal_t {
+ int intg, frac, len;
+ my_bool sign;
+ decimal_digit_t *buf;
+} decimal_t;
+
+int internal_str2dec(const char *from, decimal_t *to, char **end,
+ my_bool fixed);
+int decimal2string(const decimal_t *from, char *to, int *to_len,
+ int fixed_precision, int fixed_decimals,
+ char filler);
+int decimal2ulonglong(const decimal_t *from, ulonglong *to);
+int ulonglong2decimal(ulonglong from, decimal_t *to);
+int decimal2longlong(const decimal_t *from, longlong *to);
+int longlong2decimal(longlong from, decimal_t *to);
+int decimal2double(const decimal_t *from, double *to);
+int double2decimal(double from, decimal_t *to);
+int decimal_actual_fraction(decimal_t *from);
+int decimal2bin(const decimal_t *from, uchar *to, int precision, int scale);
+int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale);
+
+int decimal_size(int precision, int scale);
+int decimal_bin_size(int precision, int scale);
+int decimal_result_size(decimal_t *from1, decimal_t *from2, char op,
+ int param);
+
+int decimal_intg(const decimal_t *from);
+int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
+int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
+int decimal_cmp(const decimal_t *from1, const decimal_t *from2);
+int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
+int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to,
+ int scale_incr);
+int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
+int decimal_round(const decimal_t *from, decimal_t *to, int new_scale,
+ decimal_round_mode mode);
+int decimal_is_zero(const decimal_t *from);
+void max_decimal(int precision, int frac, decimal_t *to);
+
+#define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0)
+#define string2decimal_fixed(A,B,C) internal_str2dec((A), (B), (C), 1)
+
+/* set a decimal_t to zero */
+
+#define decimal_make_zero(dec) do { \
+ (dec)->buf[0]=0; \
+ (dec)->intg=1; \
+ (dec)->frac=0; \
+ (dec)->sign=0; \
+ } while(0)
+
+/*
+ returns the length of the buffer to hold string representation
+ of the decimal (including decimal dot, possible sign and \0)
+*/
+
+#define decimal_string_size(dec) (((dec)->intg ? (dec)->intg : 1) + \
+ (dec)->frac + ((dec)->frac > 0) + 2)
+
+/* negate a decimal */
+#define decimal_neg(dec) do { (dec)->sign^=1; } while(0)
+
+/*
+ conventions:
+
+ decimal_smth() == 0 -- everything's ok
+ decimal_smth() <= 1 -- result is usable, but precision loss is possible
+ decimal_smth() <= 2 -- result can be unusable, most significant digits
+ could've been lost
+ decimal_smth() > 2 -- no result was generated
+*/
+
+#define E_DEC_OK 0
+#define E_DEC_TRUNCATED 1
+#define E_DEC_OVERFLOW 2
+#define E_DEC_DIV_ZERO 4
+#define E_DEC_BAD_NUM 8
+#define E_DEC_OOM 16
+
+#define E_DEC_ERROR 31
+#define E_DEC_FATAL_ERROR 30
+
+#endif
+
108 deps/libmysql-maria/include/mysql/errmsg.h
@@ -0,0 +1,108 @@
+#ifndef ERRMSG_INCLUDED
+#define ERRMSG_INCLUDED
+
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/* Error messages for MySQL clients */
+/* (Error messages for the daemon are in sql/share/errmsg.txt) */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+void init_client_errs(void);
+void finish_client_errs(void);
+extern const char *client_errors[]; /* Error messages */
+#ifdef __cplusplus
+}
+#endif
+
+#define CR_MIN_ERROR 2000 /* For easier client code */
+#define CR_MAX_ERROR 2999
+#if !defined(ER)
+#define ER(X) client_errors[(X)-CR_MIN_ERROR]
+#endif
+#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
+
+/* Do not add error numbers before CR_ERROR_FIRST. */
+/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
+#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/
+#define CR_UNKNOWN_ERROR 2000
+#define CR_SOCKET_CREATE_ERROR 2001
+#define CR_CONNECTION_ERROR 2002
+#define CR_CONN_HOST_ERROR 2003
+#define CR_IPSOCK_ERROR 2004
+#define CR_UNKNOWN_HOST 2005
+#define CR_SERVER_GONE_ERROR 2006
+#define CR_VERSION_ERROR 2007
+#define CR_OUT_OF_MEMORY 2008
+#define CR_WRONG_HOST_INFO 2009
+#define CR_LOCALHOST_CONNECTION 2010
+#define CR_TCP_CONNECTION 2011
+#define CR_SERVER_HANDSHAKE_ERR 2012
+#define CR_SERVER_LOST 2013
+#define CR_COMMANDS_OUT_OF_SYNC 2014
+#define CR_NAMEDPIPE_CONNECTION 2015
+#define CR_NAMEDPIPEWAIT_ERROR 2016
+#define CR_NAMEDPIPEOPEN_ERROR 2017
+#define CR_NAMEDPIPESETSTATE_ERROR 2018
+#define CR_CANT_READ_CHARSET 2019
+#define CR_NET_PACKET_TOO_LARGE 2020
+#define CR_EMBEDDED_CONNECTION 2021
+#define CR_PROBE_SLAVE_STATUS 2022
+#define CR_PROBE_SLAVE_HOSTS 2023
+#define CR_PROBE_SLAVE_CONNECT 2024
+#define CR_PROBE_MASTER_CONNECT 2025
+#define CR_SSL_CONNECTION_ERROR 2026
+#define CR_MALFORMED_PACKET 2027
+#define CR_WRONG_LICENSE 2028
+
+/* new 4.1 error codes */
+#define CR_NULL_POINTER 2029
+#define CR_NO_PREPARE_STMT 2030
+#define CR_PARAMS_NOT_BOUND 2031
+#define CR_DATA_TRUNCATED 2032
+#define CR_NO_PARAMETERS_EXISTS 2033
+#define CR_INVALID_PARAMETER_NO 2034
+#define CR_INVALID_BUFFER_USE 2035
+#define CR_UNSUPPORTED_PARAM_TYPE 2036
+
+#define CR_SHARED_MEMORY_CONNECTION 2037
+#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038
+#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039
+#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
+#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041
+#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042
+#define CR_SHARED_MEMORY_MAP_ERROR 2043
+#define CR_SHARED_MEMORY_EVENT_ERROR 2044
+#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
+#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
+#define CR_CONN_UNKNOW_PROTOCOL 2047
+#define CR_INVALID_CONN_HANDLE 2048
+#define CR_SECURE_AUTH 2049
+#define CR_FETCH_CANCELED 2050
+#define CR_NO_DATA 2051
+#define CR_NO_STMT_METADATA 2052
+#define CR_NO_RESULT_SET 2053
+#define CR_NOT_IMPLEMENTED 2054
+#define CR_SERVER_LOST_EXTENDED 2055
+#define CR_STMT_CLOSED 2056
+#define CR_NEW_STMT_METADATA 2057
+#define CR_ALREADY_CONNECTED 2058
+#define CR_AUTH_PLUGIN_CANNOT_LOAD 2059
+#define CR_ERROR_LAST /*Copy last error nr:*/ 2059
+/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
+
+#endif /* ERRMSG_INCLUDED */
207 deps/libmysql-maria/include/mysql/keycache.h
@@ -0,0 +1,207 @@
+/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/* Key cache variable structures */
+
+#ifndef _keycache_h
+#define _keycache_h
+
+#include "my_sys.h" /* flush_type */
+
+C_MODE_START
+
+/*
+ Currently the default key cache is created as non-partitioned at
+ the start of the server unless the server is started with the parameter
+ --key-cache-partitions that is greater than 0
+*/
+
+#define DEFAULT_KEY_CACHE_PARTITIONS 0
+
+/*
+ MAX_KEY_CACHE_PARTITIONS cannot be greater than
+ sizeof(MYISAM_SHARE::dirty_part_map)
+ Currently sizeof(MYISAM_SHARE::dirty_part_map)=sizeof(ulonglong)
+*/
+
+#define MAX_KEY_CACHE_PARTITIONS 64
+
+/* The structure to get statistical data about a key cache */
+
+typedef struct st_key_cache_statistics
+{
+ ulonglong mem_size; /* memory for cache buffers/auxiliary structures */
+ ulonglong block_size; /* size of the each buffers in the key cache */
+ ulonglong blocks_used; /* maximum number of used blocks/buffers */
+ ulonglong blocks_unused; /* number of currently unused blocks */
+ ulonglong blocks_changed; /* number of currently dirty blocks */
+ ulonglong blocks_warm; /* number of blocks in warm sub-chain */
+ ulonglong read_requests; /* number of read requests (read hits) */
+ ulonglong reads; /* number of actual reads from files into buffers */
+ ulonglong write_requests; /* number of write requests (write hits) */
+ ulonglong writes; /* number of actual writes from buffers into files */
+} KEY_CACHE_STATISTICS;
+
+#define NUM_LONG_KEY_CACHE_STAT_VARIABLES 3
+
+/* The type of a key cache object */
+typedef enum key_cache_type
+{
+ SIMPLE_KEY_CACHE,
+ PARTITIONED_KEY_CACHE
+} KEY_CACHE_TYPE;
+
+
+typedef
+ int (*INIT_KEY_CACHE)
+ (void *, uint key_cache_block_size,
+ size_t use_mem, uint division_limit, uint age_threshold);
+typedef
+ int (*RESIZE_KEY_CACHE)
+ (void *, uint key_cache_block_size,
+ size_t use_mem, uint division_limit, uint age_threshold);
+typedef
+ void (*CHANGE_KEY_CACHE_PARAM)
+ (void *keycache_cb,
+ uint division_limit, uint age_threshold);
+typedef
+ uchar* (*KEY_CACHE_READ)
+ (void *keycache_cb,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length, int return_buffer);
+typedef
+ int (*KEY_CACHE_INSERT)
+ (void *keycache_cb,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length);
+typedef
+ int (*KEY_CACHE_WRITE)
+ (void *keycache_cb,
+ File file, void *file_extra,
+ my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length, int force_write);
+typedef
+ int (*FLUSH_KEY_BLOCKS)
+ (void *keycache_cb,
+ int file, void *file_extra,
+ enum flush_type type);
+typedef
+ int (*RESET_KEY_CACHE_COUNTERS)
+ (const char *name, void *keycache_cb);
+typedef
+ void (*END_KEY_CACHE)
+ (void *keycache_cb, my_bool cleanup);
+typedef
+ void (*GET_KEY_CACHE_STATISTICS)
+ (void *keycache_cb, uint partition_no,
+ KEY_CACHE_STATISTICS *key_cache_stats);
+
+/*
+ An object of the type KEY_CACHE_FUNCS contains pointers to all functions
+ from the key cache interface.
+ Currently a key cache can be of two types: simple and partitioned.
+ For each of them its own static structure of the type KEY_CACHE_FUNCS is
+ defined . The structures contain the pointers to the implementations of
+ the interface functions used by simple key caches and partitioned key
+ caches respectively. Pointers to these structures are assigned to key cache
+ objects at the time of their creation.
+*/
+
+typedef struct st_key_cache_funcs
+{
+ INIT_KEY_CACHE init;
+ RESIZE_KEY_CACHE resize;
+ CHANGE_KEY_CACHE_PARAM change_param;
+ KEY_CACHE_READ read;
+ KEY_CACHE_INSERT insert;
+ KEY_CACHE_WRITE write;
+ FLUSH_KEY_BLOCKS flush;
+ RESET_KEY_CACHE_COUNTERS reset_counters;
+ END_KEY_CACHE end;
+ GET_KEY_CACHE_STATISTICS get_stats;
+} KEY_CACHE_FUNCS;
+
+
+typedef struct st_key_cache
+{
+ KEY_CACHE_TYPE key_cache_type; /* type of the key cache used for debugging */
+ void *keycache_cb; /* control block of the used key cache */
+ KEY_CACHE_FUNCS *interface_funcs; /* interface functions of the key cache */
+ ulonglong param_buff_size; /* size the memory allocated for the cache */
+ ulonglong param_block_size; /* size of the blocks in the key cache */
+ ulonglong param_division_limit;/* min. percentage of warm blocks */
+ ulonglong param_age_threshold; /* determines when hot block is downgraded */
+ ulonglong param_partitions; /* number of the key cache partitions */
+ my_bool key_cache_inited; /* <=> key cache has been created */
+ my_bool can_be_used; /* usage of cache for read/write is allowed */
+ my_bool in_init; /* set to 1 in MySQL during init/resize */
+ uint partitions; /* actual number of partitions */
+ size_t key_cache_mem_size; /* specified size of the cache memory */
+ pthread_mutex_t op_lock; /* to serialize operations like 'resize' */
+} KEY_CACHE;
+
+
+/* The default key cache */
+extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
+
+extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
+ size_t use_mem, uint division_limit,
+ uint age_threshold, uint partitions);
+extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
+ size_t use_mem, uint division_limit,
+ uint age_threshold);
+extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit,
+ uint age_threshold);
+extern uchar *key_cache_read(KEY_CACHE *keycache,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length,int return_buffer);
+extern int key_cache_insert(KEY_CACHE *keycache,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length);
+extern int key_cache_write(KEY_CACHE *keycache,
+ File file, void *file_extra,
+ my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length, int force_write);
+extern int flush_key_blocks(KEY_CACHE *keycache,
+ int file, void *file_extra,
+ enum flush_type type);
+extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup);
+extern void get_key_cache_statistics(KEY_CACHE *keycache,
+ uint partition_no,
+ KEY_CACHE_STATISTICS *key_cache_stats);
+
+/* Functions to handle multiple key caches */
+extern my_bool multi_keycache_init(void);
+extern void multi_keycache_free(void);
+extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length,
+ KEY_CACHE *def);
+extern my_bool multi_key_cache_set(const uchar *key, uint length,
+ KEY_CACHE *key_cache);
+extern void multi_key_cache_change(KEY_CACHE *old_data,
+ KEY_CACHE *new_data);
+extern int reset_key_cache_counters(const char *name,
+ KEY_CACHE *key_cache, void *);
+extern int repartition_key_cache(KEY_CACHE *keycache,
+ uint key_cache_block_size,
+ size_t use_mem,
+ uint division_limit,
+ uint age_threshold,
+ uint partitions);
+C_MODE_END
+#endif /* _keycache_h */
661 deps/libmysql-maria/include/mysql/m_ctype.h
@@ -0,0 +1,661 @@
+/*
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/*
+ A better inplementation of the UNIX ctype(3) library.
+*/
+
+#ifndef _m_ctype_h
+#define _m_ctype_h
+
+#include <my_attribute.h>
+#include "my_global.h" /* uint16, uchar */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MY_CS_NAME_SIZE 32
+#define MY_CS_CTYPE_TABLE_SIZE 257
+#define MY_CS_TO_LOWER_TABLE_SIZE 256
+#define MY_CS_TO_UPPER_TABLE_SIZE 256
+#define MY_CS_SORT_ORDER_TABLE_SIZE 256
+#define MY_CS_TO_UNI_TABLE_SIZE 256
+
+#define CHARSET_DIR "charsets/"
+
+#define my_wc_t ulong
+
+#define MY_CS_REPLACEMENT_CHARACTER 0xFFFD
+
+/*
+ On i386 we store Unicode->CS conversion tables for
+ some character sets using Big-endian order,
+ to copy two bytes at onces.
+ This gives some performance improvement.
+*/
+#ifdef __i386__
+#define MB2(x) (((x) >> 8) + (((x) & 0xFF) << 8))
+#define MY_PUT_MB2(s, code) { *((uint16*)(s))= (code); }
+#else
+#define MB2(x) (x)
+#define MY_PUT_MB2(s, code) { (s)[0]= code >> 8; (s)[1]= code & 0xFF; }
+#endif
+
+typedef const struct my_charset_handler_st MY_CHARSET_HANDLER;
+typedef const struct my_collation_handler_st MY_COLLATION_HANDLER;
+
+typedef const struct unicase_info_st MY_UNICASE_INFO;
+typedef const struct uni_ctype_st MY_UNI_CTYPE;
+typedef const struct my_uni_idx_st MY_UNI_IDX;
+
+struct unicase_info_st
+{
+ uint32 toupper;
+ uint32 tolower;
+ uint32 sort;
+};
+
+extern MY_UNICASE_INFO *const my_unicase_default[256];
+extern MY_UNICASE_INFO *const my_unicase_turkish[256];
+extern MY_UNICASE_INFO *const my_unicase_mysql500[256];
+
+#define MY_UCA_MAX_CONTRACTION 4
+#define MY_UCA_MAX_WEIGHT_SIZE 8
+
+typedef struct my_contraction_t
+{
+ my_wc_t ch[MY_UCA_MAX_CONTRACTION]; /* Character sequence */
+ uint16 weight[MY_UCA_MAX_WEIGHT_SIZE];/* Its weight string, 0-terminated */
+} MY_CONTRACTION;
+
+
+typedef struct my_contraction_list_t
+{
+ size_t nitems; /* Number of items in the list */
+ MY_CONTRACTION *item; /* List of contractions */
+ char *flags; /* Character flags, e.g. "is contraction head") */
+} MY_CONTRACTIONS;
+
+
+struct uni_ctype_st
+{
+ uchar pctype;
+ const uchar *ctype;
+};
+
+extern MY_UNI_CTYPE my_uni_ctype[256];
+
+/* wm_wc and wc_mb return codes */
+#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */
+#define MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */
+#define MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */
+#define MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */
+#define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */
+/* These following three are currently not really used */
+#define MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */
+#define MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */
+#define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */
+/* A helper macros for "need at least n bytes" */
+#define MY_CS_TOOSMALLN(n) (-100-(n))
+
+#define MY_SEQ_INTTAIL 1
+#define MY_SEQ_SPACES 2
+
+ /* My charsets_list flags */
+#define MY_CS_COMPILED 1 /* compiled-in sets */
+#define MY_CS_CONFIG 2 /* sets that have a *.conf file */
+#define MY_CS_INDEX 4 /* sets listed in the Index file */
+#define MY_CS_LOADED 8 /* sets that are currently loaded */
+#define MY_CS_BINSORT 16 /* if binary sort order */
+#define MY_CS_PRIMARY 32 /* if primary collation */
+#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */
+#define MY_CS_UNICODE 128 /* is a charset is full unicode */
+#define MY_CS_READY 256 /* if a charset is initialized */
+#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/
+#define MY_CS_CSSORT 1024 /* if case sensitive sort order */
+#define MY_CS_HIDDEN 2048 /* don't display in SHOW */
+#define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */
+#define MY_CS_NONASCII 8192 /* if not ASCII-compatible */
+#define MY_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */
+#define MY_CHARSET_UNDEFINED 0
+
+/* Character repertoire flags */
+#define MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F */
+#define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */
+#define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */
+
+struct my_uni_idx_st
+{
+ uint16 from;
+ uint16 to;
+ const uchar *tab;
+};
+
+typedef struct
+{
+ uint beg;
+ uint end;
+ uint mb_len;
+} my_match_t;
+
+enum my_lex_states
+{
+ MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT,
+ MY_LEX_IDENT_SEP, MY_LEX_IDENT_START,
+ MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER,
+ MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END,
+ MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL,
+ MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE,
+ MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON,
+ MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP,
+ MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR,
+ MY_LEX_IDENT_OR_KEYWORD,
+ MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR,
+ MY_LEX_STRING_OR_DELIMITER, MY_LEX_MINUS_OR_COMMENT, MY_LEX_PLACEHOLDER,
+ MY_LEX_COMMA
+};
+
+struct charset_info_st;
+
+
+/* See strings/CHARSET_INFO.txt for information about this structure */
+struct my_collation_handler_st
+{
+ my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t));
+ /* Collation routines */
+ int (*strnncoll)(CHARSET_INFO *,
+ const uchar *, size_t, const uchar *, size_t, my_bool);
+ int (*strnncollsp)(CHARSET_INFO *,
+ const uchar *, size_t, const uchar *, size_t,
+ my_bool diff_if_only_endspace_difference);
+ size_t (*strnxfrm)(CHARSET_INFO *,
+ uchar *, size_t, const uchar *, size_t);
+ size_t (*strnxfrmlen)(CHARSET_INFO *, size_t);
+ my_bool (*like_range)(CHARSET_INFO *,
+ const char *s, size_t s_length,
+ pchar w_prefix, pchar w_one, pchar w_many,
+ size_t res_length,
+ char *min_str, char *max_str,
+ size_t *min_len, size_t *max_len);
+ int (*wildcmp)(CHARSET_INFO *,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape,int w_one, int w_many);
+
+ int (*strcasecmp)(CHARSET_INFO *, const char *, const char *);
+
+ uint (*instr)(CHARSET_INFO *,
+ const char *b, size_t b_length,
+ const char *s, size_t s_length,
+ my_match_t *match, uint nmatch);
+
+ /* Hash calculation */
+ void (*hash_sort)(CHARSET_INFO *cs, const uchar *key, size_t len,
+ ulong *nr1, ulong *nr2);
+ my_bool (*propagate)(CHARSET_INFO *cs, const uchar *str, size_t len);
+};
+
+extern MY_COLLATION_HANDLER my_collation_mb_bin_handler;
+extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
+extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
+extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
+
+/* Some typedef to make it easy for C++ to make function pointers */
+typedef int (*my_charset_conv_mb_wc)(CHARSET_INFO *, my_wc_t *,
+ const uchar *, const uchar *);
+typedef int (*my_charset_conv_wc_mb)(CHARSET_INFO *, my_wc_t,
+ uchar *, uchar *);
+typedef size_t (*my_charset_conv_case)(CHARSET_INFO *,
+ char *, size_t, char *, size_t);
+
+
+/* See strings/CHARSET_INFO.txt about information on this structure */
+struct my_charset_handler_st
+{
+ my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t));
+ /* Multibyte routines */
+ uint (*ismbchar)(CHARSET_INFO *, const char *, const char *);
+ uint (*mbcharlen)(CHARSET_INFO *, uint c);
+ size_t (*numchars)(CHARSET_INFO *, const char *b, const char *e);
+ size_t (*charpos)(CHARSET_INFO *, const char *b, const char *e,
+ size_t pos);
+ size_t (*well_formed_len)(CHARSET_INFO *,
+ const char *b,const char *e,
+ size_t nchars, int *error);
+ size_t (*lengthsp)(CHARSET_INFO *, const char *ptr, size_t length);
+ size_t (*numcells)(CHARSET_INFO *, const char *b, const char *e);
+
+ /* Unicode conversion */
+ my_charset_conv_mb_wc mb_wc;
+ my_charset_conv_wc_mb wc_mb;
+
+ /* CTYPE scanner */
+ int (*ctype)(CHARSET_INFO *cs, int *ctype,
+ const uchar *s, const uchar *e);
+
+ /* Functions for case and sort conversion */
+ size_t (*caseup_str)(CHARSET_INFO *, char *);
+ size_t (*casedn_str)(CHARSET_INFO *, char *);
+
+ my_charset_conv_case caseup;
+ my_charset_conv_case casedn;
+
+ /* Charset dependant snprintf() */
+ size_t (*snprintf)(CHARSET_INFO *, char *to, size_t n,
+ const char *fmt,
+ ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5);
+ size_t (*long10_to_str)(CHARSET_INFO *, char *to, size_t n,
+ int radix, long int val);
+ size_t (*longlong10_to_str)(CHARSET_INFO *, char *to, size_t n,
+ int radix, longlong val);
+
+ void (*fill)(CHARSET_INFO *, char *to, size_t len, int fill);
+
+ /* String-to-number conversion routines */
+ long (*strntol)(CHARSET_INFO *, const char *s, size_t l,
+ int base, char **e, int *err);
+ ulong (*strntoul)(CHARSET_INFO *, const char *s, size_t l,
+ int base, char **e, int *err);
+ longlong (*strntoll)(CHARSET_INFO *, const char *s, size_t l,
+ int base, char **e, int *err);
+ ulonglong (*strntoull)(CHARSET_INFO *, const char *s, size_t l,
+ int base, char **e, int *err);
+ double (*strntod)(CHARSET_INFO *, char *s, size_t l, char **e,
+ int *err);
+ longlong (*strtoll10)(CHARSET_INFO *cs,
+ const char *nptr, char **endptr, int *error);
+ ulonglong (*strntoull10rnd)(CHARSET_INFO *cs,
+ const char *str, size_t length,
+ int unsigned_fl,
+ char **endptr, int *error);
+ size_t (*scan)(CHARSET_INFO *, const char *b, const char *e,
+ int sq);
+};
+
+extern MY_CHARSET_HANDLER my_charset_8bit_handler;
+extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
+
+/* See strings/CHARSET_INFO.txt about information on this structure */
+struct charset_info_st
+{
+ uint number;
+ uint primary_number;
+ uint binary_number;
+ uint state;
+ const char *csname;
+ const char *name;
+ const char *comment;
+ const char *tailoring;
+ const uchar *ctype;
+ const uchar *to_lower;
+ const uchar *to_upper;
+ const uchar *sort_order;
+ const MY_CONTRACTIONS *contractions;
+ const uint16 *const *sort_order_big;
+ const uint16 *tab_to_uni;
+ MY_UNI_IDX *tab_from_uni;
+ MY_UNICASE_INFO *const *caseinfo;
+ const uchar *state_map;
+ const uchar *ident_map;
+ uint strxfrm_multiply;
+ uchar caseup_multiply;
+ uchar casedn_multiply;
+ uint mbminlen;
+ uint mbmaxlen;
+ uint16 min_sort_char;
+ uint16 max_sort_char; /* For LIKE optimization */
+ uchar pad_char;
+ my_bool escape_with_backslash_is_dangerous;
+
+ MY_CHARSET_HANDLER *cset;
+ MY_COLLATION_HANDLER *coll;
+
+};
+#define ILLEGAL_CHARSET_INFO_NUMBER (~0U)
+
+extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_bin;
+extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_latin1;
+extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_filename;
+extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_utf8_general_ci;
+
+extern struct charset_info_st my_charset_big5_bin;
+extern struct charset_info_st my_charset_big5_chinese_ci;
+extern struct charset_info_st my_charset_cp1250_czech_ci;
+extern struct charset_info_st my_charset_cp932_bin;
+extern struct charset_info_st my_charset_cp932_japanese_ci;
+extern struct charset_info_st my_charset_eucjpms_bin;
+extern struct charset_info_st my_charset_eucjpms_japanese_ci;
+extern struct charset_info_st my_charset_euckr_bin;
+extern struct charset_info_st my_charset_euckr_korean_ci;
+extern struct charset_info_st my_charset_gb2312_bin;
+extern struct charset_info_st my_charset_gb2312_chinese_ci;
+extern struct charset_info_st my_charset_gbk_bin;
+extern struct charset_info_st my_charset_gbk_chinese_ci;
+extern struct charset_info_st my_charset_latin1_bin;
+extern struct charset_info_st my_charset_latin1_german2_ci;
+extern struct charset_info_st my_charset_latin2_czech_ci;
+extern struct charset_info_st my_charset_sjis_bin;
+extern struct charset_info_st my_charset_sjis_japanese_ci;
+extern struct charset_info_st my_charset_tis620_bin;
+extern struct charset_info_st my_charset_tis620_thai_ci;
+extern struct charset_info_st my_charset_ucs2_bin;
+extern struct charset_info_st my_charset_ucs2_general_ci;
+extern struct charset_info_st my_charset_ucs2_general_mysql500_ci;
+extern struct charset_info_st my_charset_ucs2_unicode_ci;
+extern struct charset_info_st my_charset_ucs2_general_mysql500_ci;
+extern struct charset_info_st my_charset_ujis_bin;
+extern struct charset_info_st my_charset_ujis_japanese_ci;
+extern struct charset_info_st my_charset_utf16_bin;
+extern struct charset_info_st my_charset_utf16_general_ci;
+extern struct charset_info_st my_charset_utf16_unicode_ci;
+extern struct charset_info_st my_charset_utf32_bin;
+extern struct charset_info_st my_charset_utf32_general_ci;
+extern struct charset_info_st my_charset_utf32_unicode_ci;
+extern struct charset_info_st my_charset_utf8_bin;
+extern struct charset_info_st my_charset_utf8_general_mysql500_ci;
+extern struct charset_info_st my_charset_utf8_unicode_ci;
+extern struct charset_info_st my_charset_utf8mb4_bin;
+extern struct charset_info_st my_charset_utf8mb4_general_ci;
+extern struct charset_info_st my_charset_utf8mb4_unicode_ci;
+
+#define MY_UTF8MB3 "utf8"
+#define MY_UTF8MB4 "utf8mb4"
+
+my_bool my_cs_have_contractions(CHARSET_INFO *cs);
+my_bool my_cs_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc);
+my_bool my_cs_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc);
+const uint16 *my_cs_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1,
+ my_wc_t wc2);
+
+/* declarations for simple charsets */
+extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t,
+ const uchar *, size_t);
+size_t my_strnxfrmlen_simple(CHARSET_INFO *, size_t);
+extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, size_t,
+ const uchar *, size_t, my_bool);
+
+extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, size_t,
+ const uchar *, size_t,
+ my_bool diff_if_only_endspace_difference);
+
+extern void my_hash_sort_simple(CHARSET_INFO *cs,
+ const uchar *key, size_t len,
+ ulong *nr1, ulong *nr2);
+extern void my_hash_sort_bin(CHARSET_INFO *cs,
+ const uchar *key, size_t len, ulong *nr1,
+ ulong *nr2);
+
+extern size_t my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, size_t length);
+
+extern uint my_instr_simple(CHARSET_INFO *,
+ const char *b, size_t b_length,
+ const char *s, size_t s_length,
+ my_match_t *match, uint nmatch);
+
+
+/* Functions for 8bit */
+extern size_t my_caseup_str_8bit(CHARSET_INFO *, char *);
+extern size_t my_casedn_str_8bit(CHARSET_INFO *, char *);
+extern size_t my_caseup_8bit(CHARSET_INFO *, char *src, size_t srclen,
+ char *dst, size_t dstlen);
+extern size_t my_casedn_8bit(CHARSET_INFO *, char *src, size_t srclen,
+ char *dst, size_t dstlen);
+
+extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
+
+int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
+int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
+
+int my_mb_ctype_8bit(CHARSET_INFO *,int *, const uchar *,const uchar *);
+int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *);
+
+size_t my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
+
+size_t my_snprintf_8bit(CHARSET_INFO *, char *to, size_t n,
+ const char *fmt, ...)
+ ATTRIBUTE_FORMAT(printf, 4, 5);
+
+long my_strntol_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
+ char **e, int *err);
+ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
+ char **e, int *err);
+longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
+ char **e, int *err);
+ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, size_t l, int base,
+ char **e, int *err);
+double my_strntod_8bit(CHARSET_INFO *, char *s, size_t l,char **e,
+ int *err);
+size_t my_long10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix,
+ long int val);
+size_t my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix,
+ longlong val);
+
+longlong my_strtoll10_8bit(CHARSET_INFO *cs,
+ const char *nptr, char **endptr, int *error);
+longlong my_strtoll10_ucs2(CHARSET_INFO *cs,
+ const char *nptr, char **endptr, int *error);
+
+ulonglong my_strntoull10rnd_8bit(CHARSET_INFO *cs,
+ const char *str, size_t length, int
+ unsigned_fl, char **endptr, int *error);
+ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs,
+ const char *str, size_t length,
+ int unsigned_fl, char **endptr, int *error);
+
+void my_fill_8bit(CHARSET_INFO *cs, char* to, size_t l, int fill);
+
+/* For 8-bit character set */
+my_bool my_like_range_simple(CHARSET_INFO *cs,
+ const char *ptr, size_t ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ size_t res_length,
+ char *min_str, char *max_str,
+ size_t *min_length, size_t *max_length);
+
+/* For ASCII-based multi-byte character sets with mbminlen=1 */
+my_bool my_like_range_mb(CHARSET_INFO *cs,
+ const char *ptr, size_t ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ size_t res_length,
+ char *min_str, char *max_str,
+ size_t *min_length, size_t *max_length);
+
+/* For other character sets, with arbitrary mbminlen and mbmaxlen numbers */
+my_bool my_like_range_generic(CHARSET_INFO *cs,
+ const char *ptr, size_t ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ size_t res_length,
+ char *min_str, char *max_str,
+ size_t *min_length, size_t *max_length);
+
+int my_wildcmp_8bit(CHARSET_INFO *,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many);
+
+int my_wildcmp_bin(CHARSET_INFO *,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many);
+
+size_t my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
+size_t my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
+size_t my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, size_t pos);
+size_t my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e,
+ size_t pos, int *error);
+uint my_mbcharlen_8bit(CHARSET_INFO *, uint c);
+
+
+/* Functions for multibyte charsets */
+extern size_t my_caseup_str_mb(CHARSET_INFO *, char *);
+extern size_t my_casedn_str_mb(CHARSET_INFO *, char *);
+extern size_t my_caseup_mb(CHARSET_INFO *, char *src, size_t srclen,
+ char *dst, size_t dstlen);
+extern size_t my_casedn_mb(CHARSET_INFO *, char *src, size_t srclen,
+ char *dst, size_t dstlen);
+extern size_t my_caseup_mb_varlen(CHARSET_INFO *, char *src, size_t srclen,
+ char *dst, size_t dstlen);
+extern size_t my_casedn_mb_varlen(CHARSET_INFO *, char *src, size_t srclen,
+ char *dst, size_t dstlen);
+extern size_t my_caseup_ujis(CHARSET_INFO *, char *src, size_t srclen,
+ char *dst, size_t dstlen);
+extern size_t my_casedn_ujis(CHARSET_INFO *, char *src, size_t srclen,
+ char *dst, size_t dstlen);
+extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
+
+int my_wildcmp_mb(CHARSET_INFO *,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many);
+size_t my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
+size_t my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
+size_t my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, size_t pos);
+size_t my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
+ size_t pos, int *error);
+uint my_instr_mb(CHARSET_INFO *,
+ const char *b, size_t b_length,
+ const char *s, size_t s_length,
+ my_match_t *match, uint nmatch);
+
+int my_strnncoll_mb_bin(CHARSET_INFO * cs,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
+ my_bool t_is_prefix);
+
+int my_strnncollsp_mb_bin(CHARSET_INFO *cs,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
+ my_bool diff_if_only_endspace_difference);
+
+int my_wildcmp_mb_bin(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many);
+
+int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
+ const char *s, const char *t);
+
+void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar *key, size_t len,ulong *nr1, ulong *nr2);
+
+size_t my_strnxfrm_unicode(CHARSET_INFO *,
+ uchar *dst, size_t dstlen,
+ const uchar *src, size_t srclen);
+
+size_t my_strnxfrm_unicode_full_bin(CHARSET_INFO *,
+ uchar *dst, size_t dstlen,
+ const uchar *src, size_t srclen);
+size_t my_strnxfrmlen_unicode_full_bin(CHARSET_INFO *, size_t);
+
+int my_wildcmp_unicode(CHARSET_INFO *cs,
+ const char *str, const char *str_end,
+ const char *wildstr, const char *wildend,
+ int escape, int w_one, int w_many,
+ MY_UNICASE_INFO *const *weights);
+
+extern my_bool my_parse_charset_xml(const char *bug, size_t len,
+ int (*add)(struct charset_info_st *cs));
+extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
+ pchar c);
+extern size_t my_strcspn(CHARSET_INFO *cs, const char *str, const char *end,
+ const char *accept);
+
+my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len);
+my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);
+
+
+uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len);
+my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
+my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs);
+uint my_charset_repertoire(CHARSET_INFO *cs);
+
+my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs);
+
+extern size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
+ const char* fmt, va_list ap);
+
+#define _MY_U 01 /* Upper case */
+#define _MY_L 02 /* Lower case */
+#define _MY_NMR 04 /* Numeral (digit) */
+#define _MY_SPC 010 /* Spacing character */
+#define _MY_PNT 020 /* Punctuation */
+#define _MY_CTR 040 /* Control character */
+#define _MY_B 0100 /* Blank */
+#define _MY_X 0200 /* heXadecimal digit */
+
+
+#define my_isascii(c) (!((c) & ~0177))
+#define my_toascii(c) ((c) & 0177)
+#define my_tocntrl(c) ((c) & 31)
+#define my_toprint(c) ((c) | 64)
+#define my_toupper(s,c) (char) ((s)->to_upper[(uchar) (c)])
+#define my_tolower(s,c) (char) ((s)->to_lower[(uchar) (c)])
+#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L))
+#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_U)
+#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_L)
+#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_NMR)
+#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_X)
+#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L | _MY_NMR))
+#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_SPC)
+#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_PNT)
+#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B))
+#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR))
+#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_CTR)
+
+/* Some macros that should be cleaned up a little */
+#define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_')
+#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_')
+
+#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
+#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
+#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d)))
+#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0))
+#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
+ ((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
+#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
+#define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b)))
+#define my_charpos(cs, b, e, num) (cs)->cset->charpos((cs), (const char*) (b), (const char *)(e), (num))
+
+#define use_mb(s) ((s)->cset->ismbchar != NULL)
+#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
+#ifdef USE_MB
+#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
+#else
+#define my_mbcharlen(s, a) 1
+#endif
+
+#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a)))
+#define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a)))
+#define my_strntol(s, a, b, c, d, e) ((s)->cset->strntol((s),(a),(b),(c),(d),(e)))
+#define my_strntoul(s, a, b, c, d, e) ((s)->cset->strntoul((s),(a),(b),(c),(d),(e)))
+#define my_strntoll(s, a, b, c, d, e) ((s)->cset->strntoll((s),(a),(b),(c),(d),(e)))
+#define my_strntoull(s, a, b, c,d, e) ((s)->cset->strntoull((s),(a),(b),(c),(d),(e)))
+#define my_strntod(s, a, b, c, d) ((s)->cset->strntod((s),(a),(b),(c),(d)))
+
+
+/* XXX: still need to take care of this one */
+#ifdef MY_CHARSET_TIS620
+#error The TIS620 charset is broken at the moment. Tell tim to fix it.
+#define USE_TIS620
+#include "t_ctype.h"
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _m_ctype_h */
235 deps/libmysql-maria/include/mysql/m_string.h
@@ -0,0 +1,235 @@
+/*
+ Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/* There may be prolems include all of theese. Try to test in
+ configure with ones are needed? */
+
+/* This is needed for the definitions of strchr... on solaris */
+
+#ifndef _m_string_h
+#define _m_string_h
+
+#include "my_global.h" /* HAVE_* */
+
+#ifndef __USE_GNU
+#define __USE_GNU /* We want to use stpcpy */
+#endif
+#if defined(HAVE_STRINGS_H)
+#include <strings.h>
+#endif
+#if defined(HAVE_STRING_H)
+#include <string.h>
+#endif
+
+/* need by my_vsnprintf */
+#include <stdarg.h>
+
+/* This is needed for the definitions of bzero... on solaris */
+#if defined(HAVE_STRINGS_H)
+#include <strings.h>
+#endif
+
+/* This is needed for the definitions of memcpy... on solaris */
+#if defined(HAVE_MEMORY_H) && !defined(__cplusplus)
+#include <memory.h>
+#endif
+
+#if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE)
+# define memcpy(d, s, n) bcopy ((s), (d), (n))
+# define memset(A,C,B) bfill((A),(B),(C))
+# define memmove(d, s, n) bmove ((d), (s), (n))
+#elif defined(HAVE_MEMMOVE)
+# define bmove(d, s, n) memmove((d), (s), (n))
+#endif
+
+/* Unixware 7 */
+#if !defined(HAVE_BFILL)
+# define bfill(A,B,C) memset((A),(C),(B))
+#endif
+
+# define bmove_align(A,B,C) memcpy((A),(B),(C))
+
+#if !defined(HAVE_BCMP)
+# define bcmp(A,B,C) memcmp((A),(B),(C))
+#endif
+
+#if !defined(bzero) && (!defined(HAVE_BZERO) || !HAVE_DECL_BZERO || defined(_AIX))
+/* See autoconf doku: "HAVE_DECL_symbol" will be defined after configure, to 0 or 1 */
+/* AIX has bzero() as a function, but the declaration prototype is strangely hidden */
+# define bzero(A,B) memset((A),0,(B))
+#endif
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*
+ my_str_malloc() and my_str_free() are assigned to implementations in
+ strings/alloc.c, but can be overridden in the calling program.
+ */
+extern void *(*my_str_malloc)(size_t);
+extern void (*my_str_free)(void *);
+
+#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER)
+#define strmov(A,B) __builtin_stpcpy((A),(B))
+#elif defined(HAVE_STPCPY)
+#define strmov(A,B) stpcpy((A),(B))
+#endif
+
+/* Declared in int2str() */
+extern const char _dig_vec_upper[];
+extern const char _dig_vec_lower[];
+
+extern char *strmov_overlapp(char *dest, const char *src);
+
+#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
+#define LINT_INIT_STRUCT(var) bzero(&var, sizeof(var)) /* No uninitialize-warning */
+#else
+#define LINT_INIT_STRUCT(var)
+#endif
+
+/* Prototypes for string functions */
+
+extern void bmove_upp(uchar *dst,const uchar *src,size_t len);
+extern void bchange(uchar *dst,size_t old_len,const uchar *src,
+ size_t new_len,size_t tot_len);
+extern void strappend(char *s,size_t len,pchar fill);
+extern char *strend(const char *s);
+extern char *strcend(const char *, pchar);
+extern char *strfill(char * s,size_t len,pchar fill);
+extern char *strmake(char *dst,const char *src,size_t length);
+
+#ifndef strmov
+extern char *strmov(char *dst,const char *src);
+#endif
+extern char *strnmov(char *dst, const char *src, size_t n);
+extern char *strcont(const char *src, const char *set);
+extern char *strxmov(char *dst, const char *src, ...);
+extern char *strxnmov(char *dst, size_t len, const char *src, ...);
+
+/* Prototypes of normal stringfunctions (with may ours) */
+#ifndef HAVE_STRNLEN
+extern size_t strnlen(const char *s, size_t n);
+#endif
+
+extern int is_prefix(const char *, const char *);
+
+/* Conversion routines */
+typedef enum {
+ MY_GCVT_ARG_FLOAT,
+ MY_GCVT_ARG_DOUBLE
+} my_gcvt_arg_type;
+
+double my_strtod(const char *str, char **end, int *error);
+double my_atof(const char *nptr);
+size_t my_fcvt(double x, int precision, char *to, my_bool *error);
+size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
+ my_bool *error);
+
+#define NOT_FIXED_DEC 31
+
+/*
+ The longest string my_fcvt can return is 311 + "precision" bytes.
+ Here we assume that we never cal my_fcvt() with precision >= NOT_FIXED_DEC
+ (+ 1 byte for the terminating '\0').
+*/
+#define FLOATING_POINT_BUFFER (311 + NOT_FIXED_DEC)
+
+/*
+ We want to use the 'e' format in some cases even if we have enough space
+ for the 'f' one just to mimic sprintf("%.15g") behavior for large integers,
+ and to improve it for numbers < 10^(-4).
+ That is, for |x| < 1 we require |x| >= 10^(-15), and for |x| > 1 we require
+ it to be integer and be <= 10^DBL_DIG for the 'f' format to be used.
+ We don't lose precision, but make cases like "1e200" or "0.00001" look nicer.
+*/
+#define MAX_DECPT_FOR_F_FORMAT DBL_DIG
+
+/*
+ The maximum possible field width for my_gcvt() conversion.
+ (DBL_DIG + 2) significant digits + sign + "." + ("e-NNN" or
+ MAX_DECPT_FOR_F_FORMAT zeros for cases when |x|<1 and the 'f' format is used).
+*/
+#define MY_GCVT_MAX_FIELD_WIDTH (DBL_DIG + 4 + max(5, MAX_DECPT_FOR_F_FORMAT)) \
+
+extern char *llstr(longlong value,char *buff);
+extern char *ullstr(longlong value,char *buff);
+#ifndef HAVE_STRTOUL
+extern long strtol(const char *str, char **ptr, int base);
+extern ulong strtoul(const char *str, char **ptr, int base);
+#endif
+
+extern char *int2str(long val, char *dst, int radix, int upcase);
+extern char *int10_to_str(long val,char *dst,int radix);
+extern char *str2int(const char *src,int radix,long lower,long upper,
+ long *val);
+longlong my_strtoll10(const char *nptr, char **endptr, int *error);
+#if SIZEOF_LONG == SIZEOF_LONG_LONG
+#define ll2str(A,B,C,D) int2str((A),(B),(C),(D))
+#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C))
+#undef strtoll
+#define strtoll(A,B,C) strtol((A),(B),(C))
+#define strtoull(A,B,C) strtoul((A),(B),(C))
+#ifndef HAVE_STRTOULL
+#define HAVE_STRTOULL
+#endif
+#ifndef HAVE_STRTOLL
+#define HAVE_STRTOLL
+#endif
+#else
+#ifdef HAVE_LONG_LONG
+extern char *ll2str(longlong val,char *dst,int radix, int upcase);
+extern char *longlong10_to_str(longlong val,char *dst,int radix);
+#if (!defined(HAVE_STRTOULL) || defined(NO_STRTOLL_PROTO))
+extern longlong strtoll(const char *str, char **ptr, int base);
+extern ulonglong strtoull(const char *str, char **ptr, int base);
+#endif
+#endif
+#endif
+#define longlong2str(A,B,C) ll2str((A),(B),(C),1)
+
+#if defined(__cplusplus)
+}
+#endif
+
+#include <mysql/plugin.h>
+
+#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
+#define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1))
+#define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1))
+
+struct st_mysql_const_lex_string
+{
+ const char *str;
+ size_t length;
+};
+typedef struct st_mysql_const_lex_string LEX_CSTRING;
+
+/* A variant with const and unsigned */
+struct st_mysql_const_unsigned_lex_string
+{
+ const uchar *str;
+ size_t length;
+};
+typedef struct st_mysql_const_unsigned_lex_string LEX_CUSTRING;
+
+static inline void lex_string_set(LEX_STRING *lex_str, const char *c_str)
+{
+ lex_str->str= (char *) c_str;
+ lex_str->length= strlen(c_str);
+}
+
+#endif
147 deps/libmysql-maria/include/mysql/ma_dyncol.h
@@ -0,0 +1,147 @@
+/* Copyright (c) 2011, Monty Program Ab
+ Copyright (c) 2011, Oleksandr Byelkin
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+*/
+
+#ifndef ma_dyncol_h
+#define ma_dyncol_h
+
+#include <decimal.h>
+#include <my_decimal_limits.h>
+#include <mysql_time.h>
+
+/*
+ Max length for data in a dynamic colums. This comes from how the
+ how the offset are stored.
+*/
+#define MAX_DYNAMIC_COLUMN_LENGTH 0X1FFFFFFFL
+
+/* NO and OK is the same used just to show semantics */
+#define ER_DYNCOL_NO ER_DYNCOL_OK
+
+enum enum_dyncol_func_result
+{
+ ER_DYNCOL_OK= 0,
+ ER_DYNCOL_YES= 1, /* For functions returning 0/1 */
+ ER_DYNCOL_FORMAT= -1, /* Wrong format of the encoded string */
+ ER_DYNCOL_LIMIT= -2, /* Some limit reached */
+ ER_DYNCOL_RESOURCE= -3, /* Out of resourses */
+ ER_DYNCOL_DATA= -4, /* Incorrect input data */
+ ER_DYNCOL_UNKNOWN_CHARSET= -5 /* Unknown character set */
+};
+
+typedef DYNAMIC_STRING DYNAMIC_COLUMN;
+
+enum enum_dynamic_column_type
+{
+ DYN_COL_NULL= 0,
+ DYN_COL_INT,
+ DYN_COL_UINT,
+ DYN_COL_DOUBLE,
+ DYN_COL_STRING,
+ DYN_COL_DECIMAL,
+ DYN_COL_DATETIME,
+ DYN_COL_DATE,
+ DYN_COL_TIME
+};
+
+typedef enum enum_dynamic_column_type DYNAMIC_COLUMN_TYPE;
+
+struct st_dynamic_column_value
+{
+ DYNAMIC_COLUMN_TYPE type;
+ union
+ {
+ long long long_value;
+ unsigned long long ulong_value;
+ double double_value;
+ struct {
+ LEX_STRING value;
+ CHARSET_INFO *charset;
+ } string;
+ struct {
+ decimal_digit_t buffer[DECIMAL_BUFF_LENGTH];
+ decimal_t value;
+ } decimal;
+ MYSQL_TIME time_value;
+ } x;
+};
+
+typedef struct st_dynamic_column_value DYNAMIC_COLUMN_VALUE;
+
+enum enum_dyncol_func_result
+dynamic_column_create(DYNAMIC_COLUMN *str,
+ uint column_nr, DYNAMIC_COLUMN_VALUE *value);
+
+enum enum_dyncol_func_result
+dynamic_column_create_many(DYNAMIC_COLUMN *str,
+ uint column_count,
+ uint *column_numbers,
+ DYNAMIC_COLUMN_VALUE *values);
+
+enum enum_dyncol_func_result
+dynamic_column_update(DYNAMIC_COLUMN *org, uint column_nr,
+ DYNAMIC_COLUMN_VALUE *value);
+enum enum_dyncol_func_result
+dynamic_column_update_many(DYNAMIC_COLUMN *str,
+ uint add_column_count,
+ uint *column_numbers,
+ DYNAMIC_COLUMN_VALUE *values);
+
+enum enum_dyncol_func_result
+dynamic_column_delete(DYNAMIC_COLUMN *org, uint column_nr);
+
+enum enum_dyncol_func_result
+dynamic_column_exists(DYNAMIC_COLUMN *org, uint column_nr);
+
+/* List of not NULL columns */
+enum enum_dyncol_func_result
+dynamic_column_list(DYNAMIC_COLUMN *org, DYNAMIC_ARRAY *array_of_uint);
+
+/*
+ if the column do not exists it is NULL
+*/
+enum enum_dyncol_func_result
+dynamic_column_get(DYNAMIC_COLUMN *org, uint column_nr,
+ DYNAMIC_COLUMN_VALUE *store_it_here);
+
+#define dynamic_column_initialize(A) memset((A), 0, sizeof(*(A)))
+#define dynamic_column_column_free(V) dynstr_free(V)
+
+/***************************************************************************
+ Internal functions, don't use if you don't know what you are doing...
+***************************************************************************/
+
+#define dynamic_column_reassociate(V,P,L, A) dynstr_reassociate((V),(P),(L),(A))
+
+#define dynamic_column_value_init(V) (V)->type= DYN_COL_NULL
+
+/*
+ Prepare value for using as decimal
+*/
+void dynamic_column_prepare_decimal(DYNAMIC_COLUMN_VALUE *value);
+
+#endif
60 deps/libmysql-maria/include/mysql/my_alloc.h
@@ -0,0 +1,60 @@
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/*
+ Data structures for mysys/my_alloc.c (root memory allocator)
+*/
+
+#ifndef _my_alloc_h
+#define _my_alloc_h
+
+#define ALLOC_MAX_BLOCK_TO_DROP 4096
+#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct st_used_mem
+{ /* struct for once_alloc (block) */
+ struct st_used_mem *next; /* Next block in use */
+ size_t left; /* memory left in block */
+ size_t size; /* size of block */
+} USED_MEM;
+
+
+typedef struct st_mem_root
+{
+ USED_MEM *free; /* blocks with free memory in it */
+ USED_MEM *used; /* blocks almost without free memory */
+ USED_MEM *pre_alloc; /* preallocated block */
+ /* if block have less memory it will be put in 'used' list */
+ size_t min_malloc;
+ size_t block_size; /* initial block size */
+ unsigned int block_num; /* allocated blocks counter */
+ /*
+ first free block in queue test counter (if it exceed
+ MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list)
+ */
+ unsigned int first_block_usage;
+
+ void (*error_handler)(void);
+} MEM_ROOT;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
74 deps/libmysql-maria/include/mysql/my_attribute.h
@@ -0,0 +1,74 @@
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/*
+ Helper macros used for setting different __attributes__
+ on functions in a portable fashion
+*/
+
+#ifndef _my_attribute_h
+#define _my_attribute_h
+
+#if defined(__GNUC__)
+# ifndef GCC_VERSION
+# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
+# endif
+#endif
+
+/*
+ Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers.
+ Some forms of __attribute__ are actually supported in earlier versions of
+ g++, but we just disable them all because we only use them to generate
+ compilation warnings.
+*/
+#ifndef __attribute__
+# if !defined(__GNUC__)
+# define __attribute__(A)
+# else
+# ifndef GCC_VERSION
+# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
+# endif
+# if GCC_VERSION < 2008
+# define __attribute__(A)
+# elif defined(__cplusplus) && GCC_VERSION < 3004
+# define __attribute__(A)
+# endif
+# endif
+#endif
+
+/*
+ __attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3.4
+ But that's already covered by the __attribute__ tests above, so this is
+ just a convenience macro.
+*/
+#ifndef ATTRIBUTE_FORMAT
+# define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n)))
+#endif
+
+/*
+
+ __attribute__((format(...))) on a function pointer is not supported
+ until gcc 3.1
+*/
+#ifndef ATTRIBUTE_FORMAT_FPTR
+# if (GCC_VERSION >= 3001)
+# define ATTRIBUTE_FORMAT_FPTR(style, m, n) ATTRIBUTE_FORMAT(style, m, n)
+# else
+# define ATTRIBUTE_FORMAT_FPTR(style, m, n)
+# endif /* GNUC >= 3.1 */
+#endif
+
+
+#endif
153 deps/libmysql-maria/include/mysql/my_compiler.h
@@ -0,0 +1,153 @@
+#ifndef MY_COMPILER_INCLUDED
+#define MY_COMPILER_INCLUDED
+
+/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/**
+ Header for compiler-dependent features.
+
+ Intended to contain a set of reusable wrappers for preprocessor
+ macros, attributes, pragmas, and any other features that are
+ specific to a target compiler.
+*/
+
+#include <my_global.h> /* stddef.h offsetof */
+
+/**
+ Compiler-dependent internal convenience macros.
+*/
+
+/* GNU C/C++ */
+#if defined __GNUC__
+/* Convenience macro to test the minimum required GCC version. */
+# define MY_GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+/* Any after 2.95... */
+# define MY_ALIGN_EXT
+/* Comunicate to the compiler the unreachability of the code. */
+# if MY_GNUC_PREREQ(4,5)
+# define MY_ASSERT_UNREACHABLE() __builtin_unreachable()
+# endif
+
+/* Microsoft Visual C++ */
+#elif defined _MSC_VER
+# define MY_ALIGNOF(type) __alignof(type)
+# define MY_ALIGNED(n) __declspec(align(n))
+
+/* Oracle Solaris Studio */
+#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+# if __SUNPRO_C >= 0x590
+# define MY_ALIGN_EXT
+# endif
+
+/* IBM XL C/C++ */
+#elif defined __xlC__
+# if __xlC__ >= 0x0600
+# define MY_ALIGN_EXT
+# endif
+
+/* HP aCC */
+#elif defined(__HP_aCC) || defined(__HP_cc)
+# if (__HP_aCC >= 60000) || (__HP_cc >= 60000)
+# define MY_ALIGN_EXT
+# endif
+#endif
+
+#ifdef MY_ALIGN_EXT
+/** Specifies the minimum alignment of a type. */
+# define MY_ALIGNOF(type) __alignof__(type)
+/** Determine the alignment requirement of a type. */
+# define MY_ALIGNED(n) __attribute__((__aligned__((n))))
+#endif
+
+/**
+ Generic (compiler-independent) features.
+*/
+
+#ifndef MY_GNUC_PREREQ
+# define MY_GNUC_PREREQ(maj, min) (0)
+#endif
+
+#ifndef MY_ALIGNOF
+# ifdef __cplusplus
+ template<typename type> struct my_alignof_helper { char m1; type m2; };
+ /* Invalid for non-POD types, but most compilers give the right answer. */
+# define MY_ALIGNOF(type) offsetof(my_alignof_helper<type>, m2)
+# else
+# define MY_ALIGNOF(type) offsetof(struct { char m1; type m2; }, m2)
+# endif
+#endif
+
+#ifndef MY_ASSERT_UNREACHABLE
+# define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0)
+#endif
+
+/**
+ C++ Type Traits
+*/
+
+#ifdef __cplusplus
+
+/**
+ Opaque storage with a particular alignment.
+*/
+# if defined(MY_ALIGNED)
+/* Partial specialization used due to MSVC++. */
+template<size_t alignment> struct my_alignment_imp;
+template<> struct MY_ALIGNED(1) my_alignment_imp<1> {};
+template<> struct MY_ALIGNED(2) my_alignment_imp<2> {};
+template<> struct MY_ALIGNED(4) my_alignment_imp<4> {};
+template<> struct MY_ALIGNED(8) my_alignment_imp<8> {};
+template<> struct MY_ALIGNED(16) my_alignment_imp<16> {};
+/* ... expand as necessary. */
+# else
+template<size_t alignment>
+struct my_alignment_imp { double m1; };
+# endif
+
+/**
+ A POD type with a given size and alignment.
+
+ @remark If the compiler does not support a alignment attribute
+ (MY_ALIGN macro), the default alignment of a double is
+ used instead.
+
+ @tparam size The minimum size.
+ @tparam alignment The desired alignment: 1, 2, 4, 8 or 16.
+*/
+template <size_t size, size_t alignment>
+struct my_aligned_storage
+{
+ union
+ {
+ char data[size];
+ my_alignment_imp<alignment> align;
+ };
+};
+
+#endif /* __cplusplus */
+
+# ifndef MY_ALIGNED
+/*
+ Make sure MY_ALIGNED can be used also on platforms where we don't
+ have a way of aligning data structures.
+*/
+#define MY_ALIGNED(size)
+#endif
+
+#include <my_attribute.h>
+
+#endif /* MY_COMPILER_INCLUDED */
633 deps/libmysql-maria/include/mysql/my_config.h
@@ -0,0 +1,633 @@
+/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+#ifndef MY_CONFIG_H
+#define MY_CONFIG_H
+#define DOT_FRM_VERSION 6
+/* Headers we may want to use. */
+#define STDC_HEADERS 1
+#define _GNU_SOURCE 1
+#define HAVE_ALLOCA_H 1
+#define HAVE_AIO_H 1
+#define HAVE_ARPA_INET_H 1
+#define HAVE_ASM_MSR_H 1
+#define HAVE_ASM_TERMBITS_H 1
+#define HAVE_BSEARCH 1
+#define HAVE_CRYPT_H 1
+#define HAVE_CURSES_H 1
+#define HAVE_CXXABI_H 1
+/* #undef HAVE_BFD_H */
+/* #undef HAVE_NCURSES_H */
+/* #undef HAVE_NDIR_H */
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_EXECINFO_H 1
+#define HAVE_FCNTL_H 1
+#define HAVE_FENV_H 1
+#define HAVE_FLOAT_H 1
+/* #undef HAVE_FLOATINGPOINT_H */
+#define HAVE_FNMATCH_H 1
+#define HAVE_FPU_CONTROL_H 1
+#define HAVE_GRP_H 1
+#define HAVE_EXPLICIT_TEMPLATE_INSTANTIATION 1
+/* #undef HAVE_IA64INTRIN_H */
+/* #undef HAVE_IEEEFP_H */
+#define HAVE_INTTYPES_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_LOCALE_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_NETINET_IN_H 1
+#define HAVE_PATHS_H 1
+#define HAVE_POLL_H 1
+/* #undef HAVE_PORT_H */
+#define HAVE_PWD_H 1
+#define HAVE_SCHED_H 1
+/* #undef HAVE_SELECT_H */
+/* #undef HAVE_SOLARIS_LARGE_PAGES */
+#define HAVE_STDDEF_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_SEMAPHORE_H 1
+/* #undef HAVE_SYNCH_H */
+/* #undef HAVE_SYSENT_H */
+#define HAVE_SYS_DIR_H 1
+#define HAVE_SYS_CDEFS_H 1
+#define HAVE_SYS_FILE_H 1
+/* #undef HAVE_SYS_FPU_H */
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_SYS_IPC_H 1
+/* #undef HAVE_SYS_MALLOC_H */
+#define HAVE_SYS_MMAN_H 1
+/* #undef HAVE_SYS_NDIR_H */
+/* #undef HAVE_SYS_PTE_H */
+/* #undef HAVE_SYS_PTEM_H */
+#define HAVE_SYS_PRCTL_H 1
+#define HAVE_SYS_RESOURCE_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_SHM_H 1
+#define HAVE_SYS_SOCKET_H 1
+/* #undef HAVE_SYS_SOCKIO_H */
+#define HAVE_SYS_STAT_H 1
+/* #undef HAVE_SYS_STREAM_H */
+/* #undef HAVE_SYS_TERMCAP_H */
+/* #undef HAVE_SYS_TIMEB_H */
+#define HAVE_SYS_TIMES_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_UN_H 1
+/* #undef HAVE_SYS_VADVISE_H */
+#define HAVE_TERM_H 1
+/* #undef HAVE_TERMBITS_H */
+#define HAVE_TERMIOS_H 1
+#define HAVE_TERMIO_H 1
+#define HAVE_TERMCAP_H 1
+#define HAVE_TIME_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UTIME_H 1
+/* #undef HAVE_VARARGS_H */
+/* #undef HAVE_VIS_H */
+/* #undef HAVE_SYS_UTIME_H */
+#define HAVE_SYS_WAIT_H 1
+#define HAVE_SYS_PARAM_H 1
+
+/* Libraries */
+/* #undef HAVE_LIBPTHREAD */
+#define HAVE_LIBM 1
+#define HAVE_LIBDL 1
+#define HAVE_LIBRT 1
+/* #undef HAVE_LIBSOCKET */
+/* #undef HAVE_LIBNSL */
+#define HAVE_LIBCRYPT 1
+/* #undef HAVE_LIBMTMALLOC */
+/* #undef HAVE_LIBWRAP */
+/* Does "struct timespec" have a "sec" and "nsec" field? */
+/* #undef HAVE_TIMESPEC_TS_SEC */
+
+/* Readline */
+/* #undef HAVE_HIST_ENTRY */
+/* #undef USE_LIBEDIT_INTERFACE */
+#define USE_NEW_READLINE_INTERFACE 1
+
+#define FIONREAD_IN_SYS_IOCTL 1
+#define GWINSZ_IN_SYS_IOCTL 1
+/* #undef TIOCSTAT_IN_SYS_IOCTL */
+/* #undef FIONREAD_IN_SYS_FILIO */
+
+/* Functions we may want to use. */
+/* #undef HAVE_AIOWAIT */
+#define HAVE_ALARM 1
+#define HAVE_ALLOCA 1
+/* #undef HAVE_BFILL */
+/* #undef HAVE_BMOVE */
+#define HAVE_BZERO 1
+#define HAVE_INDEX 1
+#define HAVE_CHOWN 1
+#define HAVE_CLOCK_GETTIME 1
+#define HAVE_CRYPT 1
+#define HAVE_CUSERID 1
+#define HAVE_CXX_NEW 1
+/* #undef HAVE_DIRECTIO */
+#define HAVE_DLERROR 1
+#define HAVE_DLOPEN 1
+/* #undef HAVE_DOPRNT */
+#define HAVE_FCHMOD 1
+#define HAVE_FCNTL 1
+/* #undef HAVE_FCONVERT */
+#define HAVE_FDATASYNC 1
+#define HAVE_DECL_FDATASYNC 1
+#define HAVE_FESETROUND 1
+#define HAVE_FINITE 1
+/* #undef HAVE_FP_EXCEPT */
+/* #undef HAVE_FPSETMASK */
+#define HAVE_FSEEKO 1
+#define HAVE_FSYNC 1
+#define HAVE_FTIME 1
+#define HAVE_GETADDRINFO 1
+#define HAVE_GETCWD 1
+#define HAVE_GETHOSTBYADDR_R 1
+/* #undef HAVE_GETHRTIME */
+#define HAVE_GETLINE 1
+#define HAVE_GETNAMEINFO 1
+#define HAVE_GETPAGESIZE 1
+#define HAVE_GETPASS 1
+/* #undef HAVE_GETPASSPHRASE */
+#define HAVE_GETPWNAM 1
+#define HAVE_GETPWUID 1
+#define HAVE_GETRLIMIT 1
+#define HAVE_GETRUSAGE 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_GETWD 1
+#define HAVE_GMTIME_R 1
+/* #undef gmtime_r */
+#define HAVE_INITGROUPS 1
+/* #undef HAVE_ISSETUGID */
+#define HAVE_GETUID 1
+#define HAVE_GETEUID 1
+#define HAVE_GETGID 1
+#define HAVE_GETEGID 1
+#define HAVE_ISNAN 1
+#define HAVE_ISINF 1
+#define HAVE_LARGE_PAGE_OPTION 1
+#define HAVE_LDIV 1
+#define HAVE_LRAND48 1
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LOG2 1
+#define HAVE_LONGJMP 1
+#define HAVE_LSTAT 1
+#define HAVE_MEMALIGN 1
+/* #define HAVE_MLOCK 1 see Bug#54662 */
+#define HAVE_NPTL 1
+#define HAVE_NL_LANGINFO 1
+#define HAVE_MADVISE 1
+#define HAVE_DECL_MADVISE 1
+/* #undef HAVE_DECL_TGOTO */
+/* #undef HAVE_DECL_MHA_MAPSIZE_VA */
+#define HAVE_MALLINFO 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MKSTEMP 1
+#define HAVE_MLOCKALL 1
+#define HAVE_MMAP 1
+#define HAVE_MMAP64 1
+#define HAVE_PERROR 1
+#define HAVE_POLL 1
+/* #undef HAVE_PORT_CREATE */
+#define HAVE_POSIX_FALLOCATE 1
+#define HAVE_PREAD 1
+#define HAVE_PAUSE_INSTRUCTION 1
+/* #undef HAVE_FAKE_PAUSE_INSTRUCTION */
+/* #undef HAVE_RDTSCLL */
+/* #undef HAVE_READ_REAL_TIME */
+/* #undef HAVE_PTHREAD_ATTR_CREATE */
+#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
+/* #undef HAVE_PTHREAD_ATTR_SETPRIO */
+/* #undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM */
+#define HAVE_PTHREAD_ATTR_SETSCOPE 1
+#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
+/* #undef HAVE_PTHREAD_CONDATTR_CREATE */
+#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
+#define HAVE_PTHREAD_KEY_DELETE 1
+#define HAVE_PTHREAD_KEY_DELETE 1
+/* #undef HAVE_PTHREAD_KILL */
+#define HAVE_PTHREAD_RWLOCK_RDLOCK 1
+/* #undef HAVE_PTHREAD_SETPRIO_NP */
+/* #undef HAVE_PTHREAD_SETSCHEDPARAM */
+#define HAVE_PTHREAD_SIGMASK 1
+/* #undef HAVE_PTHREAD_THREADMASK */
+/* #undef HAVE_PTHREAD_YIELD_NP */
+#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
+#define PTHREAD_ONCE_INITIALIZER PTHREAD_ONCE_INIT
+#define HAVE_PUTENV 1
+#define HAVE_RE_COMP 1
+#define HAVE_REGCOMP 1
+#define HAVE_READDIR_R 1
+#define HAVE_READLINK 1
+#define HAVE_REALPATH 1
+#define HAVE_RENAME 1
+#define HAVE_RINT 1
+/* #undef HAVE_RWLOCK_INIT */
+#define HAVE_SCHED_YIELD 1
+#define HAVE_SELECT 1
+/* #undef HAVE_SETFD */
+#define HAVE_SETENV 1
+#define HAVE_SETLOCALE 1
+#define HAVE_SIGADDSET 1
+#define HAVE_SIGEMPTYSET 1
+#define HAVE_SIGHOLD 1
+#define HAVE_SIGSET 1
+#define HAVE_SIGSET_T 1
+#define HAVE_SIGACTION 1
+/* #undef HAVE_SIGTHREADMASK */
+#define HAVE_SIGWAIT 1
+#define HAVE_SLEEP 1
+#define HAVE_SNPRINTF 1
+#define HAVE_STPCPY 1
+#define HAVE_STRERROR 1
+#define HAVE_STRCOLL 1
+#define HAVE_STRSIGNAL 1
+/* #undef HAVE_STRLCPY */
+/* #undef HAVE_STRLCAT */
+/* #undef HAVE_FGETLN */
+#define HAVE_STRNLEN 1
+#define HAVE_STRPBRK 1
+/* #undef HAVE_STRSEP */
+#define HAVE_STRSTR 1
+#define HAVE_STRTOK_R 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOUL 1
+#define HAVE_STRTOULL 1
+#define HAVE_SHMAT 1
+#define HAVE_SHMCTL 1
+#define HAVE_SHMDT 1
+#define HAVE_SHMGET 1
+/* #undef HAVE_TELL */
+#define HAVE_TEMPNAM 1
+/* #undef HAVE_THR_SETCONCURRENCY */
+/* #undef HAVE_THR_YIELD */
+#define HAVE_TIME 1
+#define HAVE_TIMES 1
+#define HAVE_VALLOC 1
+#define HAVE_VIO_READ_BUFF 1
+#define HAVE_VASPRINTF 1
+#define HAVE_VPRINTF 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_FTRUNCATE 1
+#define HAVE_TZNAME 1
+#define HAVE_AIO_READ 1
+/* Symbols we may use */
+/* #undef HAVE_SYS_ERRLIST */
+/* used by stacktrace functions */
+#define HAVE_BSS_START 1
+#define HAVE_BACKTRACE 1
+#define HAVE_BACKTRACE_SYMBOLS 1
+#define HAVE_BACKTRACE_SYMBOLS_FD 1
+/* #undef HAVE_PRINTSTACK */
+#define HAVE_STRUCT_SOCKADDR_IN6 1
+#define HAVE_STRUCT_IN6_ADDR 1
+/* #undef HAVE_NETINET_IN6_H */
+#define HAVE_IPV6 1
+/* #undef ss_family */
+/* #undef HAVE_SOCKADDR_IN_SIN_LEN */
+/* #undef HAVE_SOCKADDR_IN6_SIN6_LEN */
+/* #undef HAVE_TIMESPEC_TS_SEC */
+#define STRUCT_DIRENT_HAS_D_INO 1
+/* #undef STRUCT_DIRENT_HAS_D_NAMLEN */
+#define SPRINTF_RETURNS_INT 1
+
+#define USE_MB 1
+#define USE_MB_IDENT 1
+
+/* this means that valgrind headers and macros are available */
+/* #undef HAVE_VALGRIND */
+
+/* this means WITH_VALGRIND - we change some code paths for valgrind */
+/* #undef HAVE_valgrind */
+
+/* Types we may use */
+#ifdef __APPLE__
+ /*
+ Special handling required for OSX to support universal binaries that
+ mix 32 and 64 bit architectures.
+ */
+ #if(__LP64__)
+ #define SIZEOF_LONG 8
+ #else
+ #define SIZEOF_LONG 4
+ #endif
+ #define SIZEOF_VOIDP SIZEOF_LONG
+ #define SIZEOF_CHARP SIZEOF_LONG
+ #define SIZEOF_SIZE_T SIZEOF_LONG
+#else
+/* No indentation, to fetch the lines from verification scripts */
+#define SIZEOF_LONG 4
+#define SIZEOF_VOIDP 4
+#define SIZEOF_CHARP 4
+#define SIZEOF_SIZE_T 4
+#endif
+
+#define SIZEOF_CHAR 1
+#define HAVE_CHAR 1
+#define HAVE_LONG 1
+#define HAVE_CHARP 1
+#define SIZEOF_SHORT 2
+#define HAVE_SHORT 1
+#define SIZEOF_INT 4
+#define HAVE_INT 1
+#define SIZEOF_LONG_LONG 8
+#define HAVE_LONG_LONG 1
+#define SIZEOF_OFF_T 8
+#define HAVE_OFF_T 1
+#define SIZEOF_SIGSET_T 128
+#define HAVE_SIGSET_T 1
+#define HAVE_SIZE_T 1
+/* #undef SIZEOF_UCHAR */
+/* #undef HAVE_UCHAR */
+#define SIZEOF_UINT 4
+#define HAVE_UINT 1
+#define SIZEOF_ULONG 4
+#define HAVE_ULONG 1
+/* #undef SIZEOF_INT8 */
+/* #undef HAVE_INT8 */
+/* #undef SIZEOF_UINT8 */
+/* #undef HAVE_UINT8 */
+/* #undef SIZEOF_INT16 */
+/* #undef HAVE_INT16 */
+/* #undef SIZEOF_UINT16 */
+/* #undef HAVE_UINT16 */
+/* #undef SIZEOF_INT32 */
+/* #undef HAVE_INT32 */
+/* #undef SIZEOF_UINT32 */
+/* #undef HAVE_UINT32 */
+#define SIZEOF_U_INT32_T 4
+#define HAVE_U_INT32_T 1
+/* #undef SIZEOF_INT64 */
+/* #undef HAVE_INT64 */
+/* #undef SIZEOF_UINT64 */
+/* #undef HAVE_UINT64 */
+/* #undef SIZEOF_BOOL */
+/* #undef HAVE_BOOL */
+
+#define SOCKET_SIZE_TYPE socklen_t
+
+#define HAVE_MBSTATE_T
+
+#define MAX_INDEXES 64
+
+#define QSORT_TYPE_IS_VOID 1
+#define RETQSORTTYPE void
+
+#define SIGNAL_RETURN_TYPE_IS_VOID 1
+#define RETSIGTYPE void
+#define VOID_SIGHANDLER 1
+#define STRUCT_RLIMIT struct rlimit
+
+#ifdef __APPLE__
+ #if __BIG_ENDIAN
+ #define WORDS_BIGENDIAN 1