Skip to content

Commit

Permalink
include updates windows binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Feb 23, 2015
1 parent a5c443c commit 265b18e
Show file tree
Hide file tree
Showing 50 changed files with 459 additions and 962 deletions.
Binary file added windows/libmariadbclient-2.1.0/.DS_Store
Binary file not shown.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
#ifdef __cplusplus
extern "C" {
#endif

/* unsupported macros (used by async) */
#define DBUG_SWAP_CODE_STATE(a) {}
#define DBUG_FREE_CODE_STATE(a) {}

#if !defined(DBUG_OFF) && !defined(_lint)

struct _db_stack_frame_ {
Expand Down Expand Up @@ -120,7 +125,6 @@ extern const char* _db_get_func_(void);
#endif

#else /* No debugger */

#define DBUG_ENTER(a1)
#define DBUG_END() {}
#define DBUG_RETURN(a1) return(a1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ extern const char *client_errors[]; /* Error messages */
#define CR_PARAMS_NOT_BOUND 2031
#define CR_INVALID_PARAMETER_NO 2034
#define CR_UNSUPPORTED_PARAM_TYPE 2036
#define CR_SECURE_AUTH 2049
#define CR_NO_DATA 2051
#define CR_NO_STMT_METADATA 2052
#define CR_NOT_IMPLEMENTED 2054
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ typedef struct st_mariadb_db_driver
void *buffer;
} MARIADB_DB_DRIVER;

struct st_mysql_options_extention {
struct mysql_async_context;

struct st_mysql_options_extension {
char *plugin_dir;
char *default_auth;
char *ssl_crl;
char *ssl_crlpath;
char *server_public_key_path;
struct mysql_async_context *async_context;
HASH connect_attrs;
size_t connect_attrs_len;
void (*report_progress)(const MYSQL *mysql,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define HAVE_FLOAT_H 1
/* #undef HAVE_FPU_CONTROL_H */
/* #undef HAVE_GRP_H */
/* #undef HAVE_IEEEFP_H */
#define HAVE_IEEEFP_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MEMORY_H 1
Expand Down Expand Up @@ -97,7 +97,7 @@
/* #undef HAVE_MEMALIGN */
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
/* #undef HAVE_MKSTEMP */
#define HAVE_MKSTEMP 1
/* #undef HAVE_MLOCK */
/* #undef HAVE_MLOCKALL */
/* #undef HAVE_MMAP */
Expand Down Expand Up @@ -273,6 +273,6 @@
*/
#define HAVE_THREADS 1
#define SHAREDIR "share"
#define DEFAULT_CHARSET_HOME "C:/Program Files (x86)/mariadb-client"
#define PLUGINDIR "C:/Program Files (x86)/mariadb-client/lib/plugin"
#define DEFAULT_CHARSET_HOME "C:/msys64-x86_64/home/Jeroen/mingw-packages/mingw-w64-libmariadbclient/pkg/mingw-w64-x86_64-libmariadbclient/mingw64"
#define PLUGINDIR "/lib/plugin"

232 changes: 232 additions & 0 deletions windows/libmariadbclient-2.1.0/include/my_context.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
/*
Copyright 2011 Kristian Nielsen and Monty Program Ab
This file 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 General Public License
along with this. If not, see <http://www.gnu.org/licenses/>.
*/

/*
Simple API for spawning a co-routine, to be used for async libmysqlclient.
Idea is that by implementing this interface using whatever facilities are
available for given platform, we can use the same code for the generic
libmysqlclient-async code.
(This particular implementation uses Posix ucontext swapcontext().)
*/

#ifdef _WIN32
#define MY_CONTEXT_USE_WIN32_FIBERS 1
#elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__x86_64__) && !defined(__ILP32__)
#define MY_CONTEXT_USE_X86_64_GCC_ASM
#elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__i386__)
#define MY_CONTEXT_USE_I386_GCC_ASM
#elif defined(HAVE_UCONTEXT)
#define MY_CONTEXT_USE_UCONTEXT
#else
#define MY_CONTEXT_DISABLE
#endif

#ifdef MY_CONTEXT_USE_WIN32_FIBERS
struct my_context {
void (*user_func)(void *);
void *user_arg;
void *app_fiber;
void *lib_fiber;
int return_value;
#ifndef DBUG_OFF
void *dbug_state;
#endif
};
#endif


#ifdef MY_CONTEXT_USE_UCONTEXT
#include <ucontext.h>

struct my_context {
void (*user_func)(void *);
void *user_data;
void *stack;
size_t stack_size;
ucontext_t base_context;
ucontext_t spawned_context;
int active;
#ifdef HAVE_VALGRIND
unsigned int valgrind_stack_id;
#endif
#ifndef DBUG_OFF
void *dbug_state;
#endif
};
#endif


#ifdef MY_CONTEXT_USE_X86_64_GCC_ASM
#include <stdint.h>

struct my_context {
uint64_t save[9];
void *stack_top;
void *stack_bot;
#ifdef HAVE_VALGRIND
unsigned int valgrind_stack_id;
#endif
#ifndef DBUG_OFF
void *dbug_state;
#endif
};
#endif


#ifdef MY_CONTEXT_USE_I386_GCC_ASM
#include <stdint.h>

struct my_context {
uint64_t save[7];
void *stack_top;
void *stack_bot;
#ifdef HAVE_VALGRIND
unsigned int valgrind_stack_id;
#endif
#ifndef DBUG_OFF
void *dbug_state;
#endif
};
#endif


#ifdef MY_CONTEXT_DISABLE
struct my_context {
int dummy;
};
#endif


/*
Initialize an asynchroneous context object.
Returns 0 on success, non-zero on failure.
*/
extern int my_context_init(struct my_context *c, size_t stack_size);

/* Free an asynchroneous context object, deallocating any resources used. */
extern void my_context_destroy(struct my_context *c);

/*
Spawn an asynchroneous context. The context will run the supplied user
function, passing the supplied user data pointer.
The context must have been initialised with my_context_init() prior to
this call.
The user function may call my_context_yield(), which will cause this
function to return 1. Then later my_context_continue() may be called, which
will resume the asynchroneous context by returning from the previous
my_context_yield() call.
When the user function returns, this function returns 0.
In case of error, -1 is returned.
*/
extern int my_context_spawn(struct my_context *c, void (*f)(void *), void *d);

/*
Suspend an asynchroneous context started with my_context_spawn.
When my_context_yield() is called, execution immediately returns from the
last my_context_spawn() or my_context_continue() call. Then when later
my_context_continue() is called, execution resumes by returning from this
my_context_yield() call.
Returns 0 if ok, -1 in case of error.
*/
extern int my_context_yield(struct my_context *c);

/*
Resume an asynchroneous context. The context was spawned by
my_context_spawn(), and later suspended inside my_context_yield().
The asynchroneous context may be repeatedly suspended with
my_context_yield() and resumed with my_context_continue().
Each time it is suspended, this function returns 1. When the originally
spawned user function returns, this function returns 0.
In case of error, -1 is returned.
*/
extern int my_context_continue(struct my_context *c);


struct mysql_async_context {
/*
This is set to the value that should be returned from foo_start() or
foo_cont() when a call is suspended.
*/
unsigned int events_to_wait_for;
/*
It is also set to the event(s) that triggered when a suspended call is
resumed, eg. whether we woke up due to connection completed or timeout
in mysql_real_connect_cont().
*/
unsigned int events_occured;
/*
This is set to the result of the whole asynchronous operation when it
completes. It uses a union, as different calls have different return
types.
*/
union {
void *r_ptr;
const void *r_const_ptr;
int r_int;
my_bool r_my_bool;
} ret_result;
/*
The timeout value (in millisecods), for suspended calls that need to wake
up on a timeout (eg. mysql_real_connect_start().
*/
unsigned int timeout_value;
/*
This flag is set when we are executing inside some asynchronous call
foo_start() or foo_cont(). It is used to decide whether to use the
synchronous or asynchronous version of calls that may block such as
recv().
Note that this flag is not set when a call is suspended, eg. after
returning from foo_start() and before re-entering foo_cont().
*/
my_bool active;
/*
This flag is set when an asynchronous operation is in progress, but
suspended. Ie. it is set when foo_start() or foo_cont() returns because
the operation needs to block, suspending the operation.
It is used to give an error (rather than crash) if the application
attempts to call some foo_cont() method when no suspended operation foo is
in progress.
*/
my_bool suspended;
/*
If non-NULL, this is a pointer to a callback hook that will be invoked with
the user data argument just before the context is suspended, and just after
it is resumed.
*/
void (*suspend_resume_hook)(my_bool suspend, void *user_data);
void *suspend_resume_hook_user_data;
/*
This is used to save the execution contexts so that we can suspend an
operation and switch back to the application context, to resume the
suspended context later when the application re-invokes us with
foo_cont().
*/
struct my_context async_context;
};
File renamed without changes.
31 changes: 23 additions & 8 deletions ...ws/mariadb-client-2.0/include/my_global.h → ...ibmariadbclient-2.1.0/include/my_global.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ typedef unsigned short ushort;
*/
#define _VARARGS(X) X
#define _STATIC_VARARGS(X) X
#define _PC(X) X

#if defined(DBUG_ON) && defined(DBUG_OFF)
#undef DBUG_OFF
Expand Down Expand Up @@ -364,14 +363,11 @@ typedef int (*qsort_cmp)(const void *,const void *);
#else
#define qsort_t RETQSORTTYPE /* Broken GCC cant handle typedef !!!! */
#endif
#ifdef HAVE_mit_thread
#define size_socket socklen_t /* Type of last arg to accept */
#else

#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif

#endif
typedef SOCKET_SIZE_TYPE size_socket;

#ifndef SOCKOPT_OPTLEN_TYPE
#define SOCKOPT_OPTLEN_TYPE size_socket
Expand Down Expand Up @@ -455,9 +451,12 @@ typedef int (*qsort_cmp)(const void *,const void *);
#define NO_PISAM /* Not needed anymore */
#define NO_MISAM /* Not needed anymore */
#define NO_HASH /* Not needed anymore */
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
#define NO_DIR_LIBRARY /* Not standar dir-library */
#define USE_MY_STAT_STRUCT /* For my_lib */
#ifdef _SIZE_T_DEFINED
typedef SSIZE_T ssize_t;
#endif
#endif

/* Some things that this system does have */
Expand Down Expand Up @@ -1080,11 +1079,27 @@ do { doubleget_union _tmp; \
#elif defined(HAVE_DLFCN_H)
#include <dlfcn.h>
#endif
#if HAVE_DLERROR
#ifndef HAVE_DLERROR
#define dlerror() ""
#endif
#endif

#if SIZEOF_CHARP == SIZEOF_INT
typedef unsigned int intptr;
#elif SIZEOF_CHARP == SIZEOF_LONG
typedef unsigned long intptr;
#elif SIZEOF_CHARP == SIZEOF_LONG_LONG
typedef unsigned long long intptr;
#else
#error sizeof(void *) is not sizeof(int, long or long long)
#endif

#ifdef _WIN32
#define IF_WIN(A,B) A
#else
#define IF_WIN(A,B) B
#endif

#ifndef RTLD_NOW
#define RTLD_NOW 1
#endif
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 265b18e

Please sign in to comment.