00001
00002
00003
00004
00005 #include <config.h>
00006
00007 #ifndef _SQL_H_
00008 #define _SQL_H_
00009
00010 #ifdef USE_SQL
00011
00012 #if 0
00013 #include "utils.h"
00014 #ifndef _WIN32
00015 # include <mysql.h>
00016 #else
00017 # include <mysql/mysql.h>
00018 #endif
00019 #endif
00020
00021 #define MAX_SQL_BUFFER 65535 * 2 // memo is limited to 60000, x2 for escape code
00022
00023 #ifdef USE_MYSQL
00024
00025 unsigned int db_mysql_server_port;
00026 char db_mysql_server_ip[1024];
00027 char db_mysql_server_id[32];
00028 char db_mysql_server_pw[32];
00029 char db_mysql_server_db[32];
00030 #endif
00031
00032 #ifdef USE_SQLITE
00033 char db_sqlite_database_file[256];
00034 #endif
00035
00036 #ifdef USE_PGSQL
00037
00038 char db_pgsql_conninfo[1024];
00039 #endif
00040
00041
00042 int sql_request(const char *format, ...);
00043 void sql_init();
00044 void sql_close(void);
00045 int sql_get_row(void);
00046 char *sql_get_string(int num_col);
00047 int sql_get_integer(int num_col);
00048 unsigned long sql_num_rows(void);
00049 unsigned long db_sql_escape_string(char *to, const char *from, unsigned long from_length);
00050
00051 #endif
00052
00053 #endif
00054