fgms 0.11.8
The
FlightGear MultiPlayer Server
project
testdb.c File Reference
#include "common.h"
#include "wrappers.h"
#include "error.h"
#include <libpq-fe.h>

Go to the source code of this file.

Macros

#define DEF_DATABASE   "fgtracker"
 
#define DEF_IP_ADDRESS   "192.168.1.105"
 
#define DEF_PORT   "5432"
 
#define DEF_USER_LOGIN   "fgtracker"
 
#define DEF_USER_PWD   "fgtracker"
 
#define PQ_EXEC_SUCCESS(res)   ((PQresultStatus(res) == PGRES_COMMAND_OK)||(PQresultStatus(res) == PGRES_TUPLES_OK))
 

Functions

int ConnectDB (PGconn **conn)
 
static void exit_nicely (PGconn *conn)
 
char * get_base_name (char *name)
 
void give_help (char *name)
 
int main (int argc, char **argv)
 
int parse_commands (int argc, char **argv)
 
void query_tables (PGconn *conn, int verb)
 
int test_alternate_connection (void)
 
void test_template1 (void)
 

Variables

static char * database = (char *)DEF_DATABASE
 
static int got_flights = 0
 
static int got_waypts = 0
 
static char * ip_address = (char *)DEF_IP_ADDRESS
 
static char * pgoptions = (char *)""
 
static char * pgtty = (char *)""
 
static char * port = (char *)DEF_PORT
 
static char * pwd = (char *)DEF_USER_PWD
 
static char * user = (char *)DEF_USER_LOGIN
 

Macro Definition Documentation

#define DEF_DATABASE   "fgtracker"

Definition at line 29 of file testdb.c.

#define DEF_IP_ADDRESS   "192.168.1.105"

Definition at line 21 of file testdb.c.

#define DEF_PORT   "5432"

Definition at line 25 of file testdb.c.

#define DEF_USER_LOGIN   "fgtracker"

Definition at line 33 of file testdb.c.

#define DEF_USER_PWD   "fgtracker"

Definition at line 37 of file testdb.c.

#define PQ_EXEC_SUCCESS (   res)    ((PQresultStatus(res) == PGRES_COMMAND_OK)||(PQresultStatus(res) == PGRES_TUPLES_OK))

Definition at line 51 of file testdb.c.

Referenced by query_tables().

Function Documentation

int ConnectDB ( PGconn **  conn)

Definition at line 247 of file testdb.c.

Referenced by main().

static void exit_nicely ( PGconn *  conn)
static

Definition at line 64 of file testdb.c.

Referenced by test_template1().

char* get_base_name ( char *  name)

Definition at line 264 of file testdb.c.

Referenced by give_help().

void give_help ( char *  name)

Definition at line 279 of file testdb.c.

Referenced by parse_commands().

int main ( int  argc,
char **  argv 
)

Definition at line 375 of file testdb.c.

int parse_commands ( int  argc,
char **  argv 
)

Definition at line 292 of file testdb.c.

Referenced by main().

void query_tables ( PGconn *  conn,
int  verb 
)

Definition at line 165 of file testdb.c.

Referenced by main(), and test_alternate_connection().

int test_alternate_connection ( void  )

Definition at line 227 of file testdb.c.

Referenced by main().

void test_template1 ( void  )

Definition at line 70 of file testdb.c.

Variable Documentation

char* database = (char *)DEF_DATABASE
static

Definition at line 42 of file testdb.c.

Referenced by ConnectDB(), give_help(), main(), parse_commands(), and test_alternate_connection().

int got_flights = 0
static

Definition at line 48 of file testdb.c.

Referenced by check_tables(), main(), and query_tables().

int got_waypts = 0
static

Definition at line 49 of file testdb.c.

Referenced by check_tables(), main(), and query_tables().

char* ip_address = (char *)DEF_IP_ADDRESS
static

Definition at line 40 of file testdb.c.

Referenced by ConnectDB(), give_help(), main(), parse_commands(), and test_alternate_connection().

char* pgoptions = (char *)""
static

Definition at line 45 of file testdb.c.

Referenced by ConnectDB(), and test_template1().

char* pgtty = (char *)""
static

Definition at line 46 of file testdb.c.

Referenced by ConnectDB(), and test_template1().

char* port = (char *)DEF_PORT
static

Definition at line 41 of file testdb.c.

Referenced by ConnectDB(), give_help(), main(), parse_commands(), and test_alternate_connection().

char* pwd = (char *)DEF_USER_PWD
static

Definition at line 44 of file testdb.c.

Referenced by ConnectDB(), give_help(), main(), parse_commands(), and test_alternate_connection().

char* user = (char *)DEF_USER_LOGIN
static

Definition at line 43 of file testdb.c.

Referenced by ConnectDB(), give_help(), main(), parse_commands(), and test_alternate_connection().