TinyMUSH 3.3
TinyMUSH Server
Loading...
Searching...
No Matches
Functions | Variables
db_sql.c File Reference

Module for SQL interface. More...

#include <system.h>
#include <tinymushapi.h>
#include "db_sql.h"
Include dependency graph for db_sql.c:

Functions

void mod_db_sql_do_init (dbref player, dbref cause, int key)
 
void mod_db_sql_do_connect (dbref player, dbref cause, int key)
 
void mod_db_sql_do_disconnect (dbref player, dbref cause, int key)
 
void mod_db_sql_do_query (dbref player, dbref cause, int key, char *arg1)
 
void mod_db_sql_fun_init (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs)
 
void mod_db_sql_fun_connect (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs)
 
void mod_db_sql_fun_shutdown (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs)
 
void mod_db_sql_fun_query (char *buff, char **bufc, dbref player, dbref caller, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs)
 
void mod_db_sql_init ()
 
void mod_db_sql_notify (dbref player, char *buff, char **bufc, const char *format,...)
 

Variables

MODVER mod_db_sql_version
 
mod_db_sql_confstorage mod_db_sql_config
 
CONF mod_db_sql_conftable []
 
CMDENT mod_db_sql_cmdtable []
 
FUN mod_db_sql_functable []
 

Detailed Description

Module for SQL interface.

Author
TinyMUSH development team (https://github.com/TinyMUSH)
Version
3.3
Date
2020-12-28
Bug:
This code is currently not working. Won't be fixed until we go Beta

Variable Documentation

◆ mod_db_sql_cmdtable

CMDENT mod_db_sql_cmdtable[]
Initial value:
= {
{(char *)"@sql", NULL, CA_MODULE_OK, 0, CS_ONE_ARG, NULL, NULL, NULL, {mod_db_sql_do_query}},
{(char *)"@sqlinit", NULL, CA_WIZARD, 0, CS_NO_ARGS, NULL, NULL, NULL, {mod_db_sql_do_init}},
{(char *)"@sqlconnect", NULL, CA_WIZARD, 0, CS_NO_ARGS, NULL, NULL, NULL, {mod_db_sql_do_connect}},
{(char *)"@sqldisconnect", NULL, CA_WIZARD, 0, CS_NO_ARGS, NULL, NULL, NULL, {mod_db_sql_do_disconnect}},
{(char *)NULL, NULL, 0, 0, 0, NULL, NULL, NULL, {NULL}}}
#define CA_WIZARD
Definition: constants.h:375
#define CS_ONE_ARG
Definition: constants.h:350
#define CA_MODULE_OK
Definition: constants.h:380
#define CS_NO_ARGS
Command handler call conventions.
Definition: constants.h:349

◆ mod_db_sql_conftable

CONF mod_db_sql_conftable[]
Initial value:
= {
{(char *)"sql_database", cf_string, CA_STATIC, CA_GOD, (int *)&mod_db_sql_config.db, MBUF_SIZE},
{(char *)"sql_host", cf_string, CA_STATIC, CA_GOD, (int *)&mod_db_sql_config.host, MBUF_SIZE},
{(char *)"sql_username", cf_string, CA_STATIC, CA_GOD, (int *)&mod_db_sql_config.username, MBUF_SIZE},
{(char *)"sql_password", cf_string, CA_STATIC, CA_GOD, (int *)&mod_db_sql_config.password, MBUF_SIZE},
{(char *)"sql_reconnect", cf_bool, CA_GOD, CA_WIZARD, &mod_db_sql_config.reconnect, (long)"SQL queries re-initiate dropped connections"},
{(char *)"sql_port", cf_int, CA_STATIC, CA_GOD, &mod_db_sql_config.port, (long)"SQL database port"},
{(char *)"sql_socket", cf_int, CA_STATIC, CA_GOD, &mod_db_sql_config.socket, 0},
{NULL, NULL, 0, 0, NULL, 0}}
CF_Result cf_bool(int *vp, char *str, long extra __attribute__((unused)), dbref player __attribute__((unused)), char *cmd __attribute__((unused)))
Set boolean parameter.
Definition: conf.c:676
CF_Result cf_int(int *vp, char *str, long extra, dbref player, char *cmd)
Set integer parameter.
Definition: conf.c:483
CF_Result cf_string(int *vp, char *str, long extra, dbref player, char *cmd)
Set string parameter.
Definition: conf.c:722
#define MBUF_SIZE
Definition: constants.h:22
#define CA_STATIC
Definition: constants.h:409
#define CA_GOD
Definition: constants.h:374

◆ mod_db_sql_functable

FUN mod_db_sql_functable[]
Initial value:
= {
{"SQL", mod_db_sql_fun_query, 0, FN_VARARGS, CA_MODULE_OK, NULL},
{"SQLINIT", mod_db_sql_fun_init, 0, 0, CA_WIZARD | CA_GOD, NULL},
{"SQLCONNECT", mod_db_sql_fun_connect, 0, 0, CA_WIZARD | CA_GOD, NULL},
{"SQLDISCONECT", mod_db_sql_fun_shutdown, 0, 0, CA_WIZARD | CA_GOD, NULL},
{NULL, NULL, 0, 0, 0, NULL}}
#define FN_VARARGS
Definition: constants.h:765