mysql2/ext/mysql2_ext.h

40 lines
1.4 KiB
C
Raw Normal View History

#include <time.h>
2010-03-26 08:03:08 +00:00
#include <ruby.h>
#include <mysql/mysql.h>
#include <mysql/mysql_com.h>
#include <mysql/errmsg.h>
#include <mysql/mysqld_error.h>
2010-04-01 19:56:49 +00:00
#ifdef HAVE_RUBY_ENCODING_H
#include <ruby/encoding.h>
int utf8Encoding, binaryEncoding;
2010-04-01 19:56:49 +00:00
#endif
static VALUE cBigDecimal, cDate, cDateTime;
ID intern_new, intern_local;
/* Mysql2::Error */
VALUE cMysql2Error;
/* Mysql2::Client */
#define GetMysql2Client(obj, sval) (sval = (MYSQL*)DATA_PTR(obj));
static ID sym_socket, sym_host, sym_port, sym_username, sym_password,
sym_database, sym_reconnect, sym_connect_timeout, sym_id, sym_version;
static VALUE rb_mysql_client_new(int argc, VALUE * argv, VALUE klass);
static VALUE rb_mysql_client_init(VALUE self, int argc, VALUE * argv);
2010-03-26 08:03:08 +00:00
static VALUE rb_mysql_client_query(VALUE self, VALUE query);
2010-04-01 18:44:59 +00:00
static VALUE rb_mysql_client_escape(VALUE self, VALUE str);
static VALUE rb_mysql_client_info(VALUE self);
static VALUE rb_mysql_client_server_info(VALUE self);
static VALUE rb_mysql_client_socket(VALUE self);
2010-03-26 08:03:08 +00:00
void rb_mysql_client_free(void * client);
/* Mysql2::Result */
#define GetMysql2Result(obj, sval) (sval = (MYSQL_RES*)DATA_PTR(obj));
VALUE cMysql2Result;
static ID sym_symbolize_keys;
2010-03-26 08:03:08 +00:00
static VALUE rb_mysql_result_to_obj(MYSQL_RES * res);
static VALUE rb_mysql_result_fetch_row(int argc, VALUE * argv, VALUE self);
static VALUE rb_mysql_result_each(int argc, VALUE * argv, VALUE self);
2010-04-01 19:04:48 +00:00
void rb_mysql_result_free(void * result);