diff options
author | tim@black.box <> | 2001-08-10 12:37:36 -0400 |
---|---|---|
committer | tim@black.box <> | 2001-08-10 12:37:36 -0400 |
commit | a1a834a650fe8956d13d6e16c447c5c4de75df5c (patch) | |
tree | 0b1bf2d0aed5c3d69b112448bb146dcc526f9890 /include/mysql.h | |
parent | d9737f20f838f189ef1f3d25df7739770f3b52b9 (diff) | |
download | mariadb-git-a1a834a650fe8956d13d6e16c447c5c4de75df5c.tar.gz |
Embedded mysql fixes.
There is now a mysql_server_init() function which needs to be
called at the beginning of the program (and _end() for the end
of the program). This routine handles argument parsing for the
embedded server.
Use the embedded version of mysql_load_file() (ignore the LOCAL
argument, since the client and server are the same program).
There are now mysql_thread_init/end() functions for the client
to use in a multi-threaded app. They are just wrappers for
my_thread_init/end().
Diffstat (limited to 'include/mysql.h')
-rw-r--r-- | include/mysql.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/include/mysql.h b/include/mysql.h index b4a7f977cd5..9578336a945 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -15,8 +15,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -/* defines for the libmysql library */ - #ifndef _mysql_h #define _mysql_h @@ -222,6 +220,20 @@ typedef struct st_mysql_res { my_bool eof; /* Used my mysql_fetch_row */ } MYSQL_RES; + +/* Set up and bring down the server; to ensure that applications will + * work when linked against either the standard client library or the + * embedded server library, these functions should be called. */ +void mysql_server_init(int argc, char **argv, const char **groups); +void mysql_server_end(); + +/* Set up and bring down a thread; these function should be called + * for each thread in an application which opens at least one MySQL + * connection. All uses of the connection(s) should be between these + * function calls. */ +my_bool mysql_thread_init(); +void mysql_thread_end(); + /* Functions to get information from the MYSQL and MYSQL_RES structures */ /* Should definitely be used if one uses shared libraries */ @@ -359,15 +371,13 @@ unsigned int STDCALL mysql_thread_safe(void); #define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) -#ifndef USE_OLD_FUNCTIONS +#ifdef USE_OLD_FUNCTIONS MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd); int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); #endif -/* new api functions */ - #define HAVE_MYSQL_REAL_CONNECT #ifndef MYSQL_SERVER |