Kannel: Open Source WAP and SMS gateway  svn-r5262
sqlbox_sql.h File Reference
#include "gwlib/gwlib.h"
#include "gw/msg.h"
#include "sqlbox_mssql.h"
#include "sqlbox_mysql.h"
#include "sqlbox_oracle.h"
#include "sqlbox_pgsql.h"
#include "sqlbox_sdb.h"
#include "sqlbox_sqlite.h"
#include "sqlbox_sqlite3.h"

Go to the source code of this file.

Data Structures

struct  server_type
 
struct  sqlbox_db_queries
 

Macros

#define gw_sql_fetch_msg   sql_type->sql_fetch_msg
 
#define gw_sql_fetch_msg_list   sql_type->sql_fetch_msg_list
 
#define gw_sql_save_list   sql_type->sql_save_list
 
#define gw_sql_save_msg(message, table)
 
#define gw_sql_enter   sql_type->sql_enter
 
#define gw_sql_leave   sql_type->sql_leave
 
#define sqlbox_run_query(query, table)
 

Functions

struct server_typesqlbox_init_sql (Cfg *cfg)
 

Variables

struct server_typesql_type
 

Macro Definition Documentation

◆ gw_sql_enter

#define gw_sql_enter   sql_type->sql_enter

Definition at line 51 of file sqlbox_sql.h.

Referenced by init_sqlbox().

◆ gw_sql_fetch_msg

#define gw_sql_fetch_msg   sql_type->sql_fetch_msg

Definition at line 42 of file sqlbox_sql.h.

Referenced by sql_single().

◆ gw_sql_fetch_msg_list

#define gw_sql_fetch_msg_list   sql_type->sql_fetch_msg_list

Definition at line 43 of file sqlbox_sql.h.

Referenced by sql_list(), and sql_to_bearerbox().

◆ gw_sql_leave

#define gw_sql_leave   sql_type->sql_leave

Definition at line 52 of file sqlbox_sql.h.

Referenced by main().

◆ gw_sql_save_list

#define gw_sql_save_list   sql_type->sql_save_list

Definition at line 44 of file sqlbox_sql.h.

Referenced by sql_list(), and sql_to_bearerbox().

◆ gw_sql_save_msg

#define gw_sql_save_msg (   message,
  table 
)
Value:
do { \
octstr_url_encode(message->sms.msgdata); \
octstr_url_encode(message->sms.udhdata); \
sql_type->sql_save_msg(message, table); \
} while (0)

Definition at line 45 of file sqlbox_sql.h.

Referenced by bearerbox_to_smsbox(), bearerbox_to_sql(), smsbox_to_bearerbox(), and sql_single().

◆ sqlbox_run_query

#define sqlbox_run_query (   query,
  table 
)
Value:
if (query != NULL) { \
sql = octstr_format(query, table, table, table); \
sql_update(pc, sql); \
octstr_destroy(sql); \
}
Octstr * octstr_format(const char *fmt,...)
Definition: octstr.c:2462

Definition at line 55 of file sqlbox_sql.h.

Function Documentation

◆ sqlbox_init_sql()

struct server_type* sqlbox_init_sql ( Cfg cfg)

Definition at line 4 of file sqlbox_sql.c.

Referenced by init_sqlbox().

5 {
6  struct server_type *res = NULL;
7 
8 #ifdef HAVE_MSSQL
9  res = (struct server_type *)sqlbox_init_mssql(cfg);
10  if (res) {
11  return res;
12  }
13 #endif
14 #ifdef HAVE_MYSQL
15  res = (struct server_type *)sqlbox_init_mysql(cfg);
16  if (res) {
17  return res;
18  }
19 #endif
20 #ifdef HAVE_ORACLE
21  res = (struct server_type *)sqlbox_init_oracle(cfg);
22  if (res) {
23  return res;
24  }
25 #endif
26 #ifdef HAVE_PGSQL
27  res = (struct server_type *)sqlbox_init_pgsql(cfg);
28  if (res) {
29  return res;
30  }
31 #endif
32 #ifdef HAVE_SDB
33  res = (struct server_type *)sqlbox_init_sdb(cfg);
34  if (res) {
35  return res;
36  }
37 #endif
38 #ifdef HAVE_SQLITE
39  res = (struct server_type *)sqlbox_init_sqlite(cfg);
40  if (res) {
41  return res;
42  }
43 #endif
44 #ifdef HAVE_SQLITE3
45  res = (struct server_type *)sqlbox_init_sqlite3(cfg);
46  if (res) {
47  return res;
48  }
49 #endif
50  return res;
51 }

Variable Documentation

◆ sql_type

struct server_type* sql_type

Referenced by init_sqlbox().

See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.