[cleanup] make all C symbols static
Other than the Init_$extension() function, the only reason to have public symbols is for large C extensions that need to span multiple .c files and we're not one of them.
This commit is contained in:
parent
081eea9a9c
commit
f7a6b49cbd
|
@ -175,7 +175,7 @@ static VALUE rb_mysql_client_init(RB_MYSQL_UNUSED int argc, RB_MYSQL_UNUSED VALU
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rb_mysql_client_free(void * client) {
|
static void rb_mysql_client_free(void * client) {
|
||||||
MYSQL * c = client;
|
MYSQL * c = client;
|
||||||
if (c) {
|
if (c) {
|
||||||
/*
|
/*
|
||||||
|
@ -366,7 +366,7 @@ static VALUE rb_mysql_result_to_obj(MYSQL_RES * r) {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rb_mysql_result_free(void * wrapper) {
|
static void rb_mysql_result_free(void * wrapper) {
|
||||||
mysql2_result_wrapper * w = wrapper;
|
mysql2_result_wrapper * w = wrapper;
|
||||||
if (w && w->resultFreed != 1) {
|
if (w && w->resultFreed != 1) {
|
||||||
/* FIXME: this may call flush_use_result, which can hit the socket */
|
/* FIXME: this may call flush_use_result, which can hit the socket */
|
||||||
|
@ -375,7 +375,7 @@ void rb_mysql_result_free(void * wrapper) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rb_mysql_result_mark(void * wrapper) {
|
static void rb_mysql_result_mark(void * wrapper) {
|
||||||
mysql2_result_wrapper * w = wrapper;
|
mysql2_result_wrapper * w = wrapper;
|
||||||
if (w) {
|
if (w) {
|
||||||
rb_gc_mark(w->fields);
|
rb_gc_mark(w->fields);
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#ifdef HAVE_RUBY_ENCODING_H
|
#ifdef HAVE_RUBY_ENCODING_H
|
||||||
#include <ruby/encoding.h>
|
#include <ruby/encoding.h>
|
||||||
int utf8Encoding, binaryEncoding;
|
static int utf8Encoding, binaryEncoding;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && (__GNUC__ >= 3)
|
#if defined(__GNUC__) && (__GNUC__ >= 3)
|
||||||
|
@ -24,10 +24,10 @@ int utf8Encoding, binaryEncoding;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static VALUE cBigDecimal, cDate, cDateTime;
|
static VALUE cBigDecimal, cDate, cDateTime;
|
||||||
ID intern_new, intern_local;
|
static ID intern_new, intern_local;
|
||||||
|
|
||||||
/* Mysql2::Error */
|
/* Mysql2::Error */
|
||||||
VALUE cMysql2Error;
|
static VALUE cMysql2Error;
|
||||||
|
|
||||||
/* Mysql2::Client */
|
/* Mysql2::Client */
|
||||||
#define GetMysql2Client(obj, sval) (sval = (MYSQL*)DATA_PTR(obj));
|
#define GetMysql2Client(obj, sval) (sval = (MYSQL*)DATA_PTR(obj));
|
||||||
|
@ -45,7 +45,7 @@ static VALUE rb_mysql_client_socket(VALUE self);
|
||||||
static VALUE rb_mysql_client_async_result(VALUE self);
|
static VALUE rb_mysql_client_async_result(VALUE self);
|
||||||
static VALUE rb_mysql_client_last_id(VALUE self);
|
static VALUE rb_mysql_client_last_id(VALUE self);
|
||||||
static VALUE rb_mysql_client_affected_rows(VALUE self);
|
static VALUE rb_mysql_client_affected_rows(VALUE self);
|
||||||
void rb_mysql_client_free(void * client);
|
static void rb_mysql_client_free(void * client);
|
||||||
|
|
||||||
/* Mysql2::Result */
|
/* Mysql2::Result */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -58,12 +58,12 @@ typedef struct {
|
||||||
MYSQL_RES *result;
|
MYSQL_RES *result;
|
||||||
} mysql2_result_wrapper;
|
} mysql2_result_wrapper;
|
||||||
#define GetMysql2Result(obj, sval) (sval = (mysql2_result_wrapper*)DATA_PTR(obj));
|
#define GetMysql2Result(obj, sval) (sval = (mysql2_result_wrapper*)DATA_PTR(obj));
|
||||||
VALUE cMysql2Result;
|
static VALUE cMysql2Result;
|
||||||
static VALUE rb_mysql_result_to_obj(MYSQL_RES * res);
|
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_fetch_row(int argc, VALUE * argv, VALUE self);
|
||||||
static VALUE rb_mysql_result_each(int argc, VALUE * argv, VALUE self);
|
static VALUE rb_mysql_result_each(int argc, VALUE * argv, VALUE self);
|
||||||
void rb_mysql_result_free(void * wrapper);
|
static void rb_mysql_result_free(void * wrapper);
|
||||||
void rb_mysql_result_mark(void * wrapper);
|
static void rb_mysql_result_mark(void * wrapper);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* used to pass all arguments to mysql_real_connect while inside
|
* used to pass all arguments to mysql_real_connect while inside
|
||||||
|
|
Loading…
Reference in New Issue