GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FMX / V4-0-14 > fmxshr / rhel5-32
Connection and user management functions. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <mysql.h>
#include <FMX/FMX_msgs.h>
#include <FMX/FMX_pubdefs.h>
#include <MDB/MDB_pubdefs.h>
#include <FMX_diction.h>
#include <FMX_prvdefs.h>
Defines | |
#define | FMX_L_BUFFER ( 2048 ) |
Maximum length of a general purpose string buffer. | |
#define | FMX_K_PORT ( 8206 ) |
Standard port on which to contact an fmx database. | |
Functions | |
unsigned int | FMX_connect (FMX_Connection **con, const char *host, const char *user, const char *pass, int port) |
Create a connection to the database. | |
unsigned int | FMX_disconnect (FMX_Connection *ucb) |
Break a connection to the database. |
Connection and user management functions.
CVS $Id: FMX_user.c,v 1.3 2011/03/25 20:42:51 apw Exp $
unsigned int FMX_connect | ( | FMX_Connection ** | con, |
const char * | host, | ||
const char * | user, | ||
const char * | pass, | ||
int | port | ||
) |
Create a connection to the database.
con | (out) Connection handle |
host | (in) Host name (NULL: take from $FMX_C_FDB) |
user | (in) User name (NULL: take from .my.cnf) |
pass | (in) Password (NULL: take from .my.cnf) |
port | (in) Connection handle |
FMX_ALLOCBUF | Local (stack) buffer too small |
FMX_ALLOCMEM | Cannot allocate sufficient memory (dynamic) |
FMX_EVMISS | Expected environment variable not found |
FMX_MYSQLCON | Cannot select database status from global table |
FMX_LINKMIST | Expected file system link not found |
FMX_MYCNFBAD | User's .my.cnf file insufficiently protected |
FMX_MYCNFMIS | Cannot find user's .my.cnf file |
FMX_MYSQLINT | Cannot initialize a MySQL handle |
FMX_MYSQLCON | Cannot connect to MySQL database |
FMX_SUCCESS | Success |
FMX_USERACC | Cannot determine access privileges for user |
FMX_USERID | Cannot identify user from database tables |
FMX_USERNOT | User has no privileges on this database |
References _FMX_Connection::access, FMX_fcb, FMX_K_PORT, FMX_L_BUFFER, FMX_USR_LOGICIAN, FMX_USR_OPTICIAN, FMX_USR_PHYSICIAN, FMX_USR_TECHNICIAN, _FMX_Connection::host, _FMX_Connection::mysql, _FMX_Connection::next, _FMX_Connection::role, _FMX_Control::root, _FMX_Connection::root, s__my_cnf, s_fmx, s_FMX_C_FDB, s_FMX_HOST, s_HOME, s_production, s_Y, _FMX_Connection::self, and _FMX_Connection::user.
unsigned int FMX_disconnect | ( | FMX_Connection * | ucb | ) |
Break a connection to the database.
ucb | (in) User connection block |
FMX_UCBMISS | Connection block not found in list |
FMX_UCBNOT | Invalid connection block |
FMX_SUCCESS | Success |
References FMX_fcb, FMX_freeEnumTable(), FMX_L_ENUM_TABLES, _FMX_Connection::host, _FMX_Connection::mysql, _FMX_Connection::next, _FMX_Connection::root, _FMX_Control::root, _FMX_Connection::self, and _FMX_Connection::user.
Referenced by FMX_shutdown().