CTWave Database Functions

Name

CTWave Database Functions -- CTWave Database object management functions.

Synopsis


#include ctwave/ctwave-database.h


struct      CTWaveDatabase;

CTWaveDatabase* ctwave_database_new         (void *p);
void        ctwave_database_del             (CTWaveDatabase *ctdb);
WaveResult  ctwave_database_ready           (CTWaveDatabase *ctdb,
                                             const gchar *ifile,
                                             const gchar *login,
                                             const gchar *password,
                                             const gchar *server,
                                             const gchar *database);
gboolean    ctwave_database_is_ready        (CTWaveDatabase *ctdb);
WaveResult  ctwave_database_activate        (CTWaveDatabase *ctdb);
gboolean    ctwave_database_is_ready        (CTWaveDatabase *ctdb);

Description

These functions manage the CTWave Database objects, along with connection and activation.

Details

struct CTWaveDatabase

struct CTWaveDatabase {
  CTWaveConnectionHolder *holder;
};

Use the internals at your own risk.


ctwave_database_new ()

CTWaveDatabase* ctwave_database_new         (void *p);

Initiates a new CTWave Database object. A new connection holder object is also created.

p: unused at the moment, pass in 0.
Returns : a new CTWaveDatabase pointer.


ctwave_database_del ()

void        ctwave_database_del             (CTWaveDatabase *ctdb);

Deletes a CTWave Database object. The connection holder object is also deleted.

ctdb: CTWave Database pointer to delete.


ctwave_database_ready ()

WaveResult  ctwave_database_ready           (CTWaveDatabase *ctdb,
                                             const gchar *ifile,
                                             const gchar *login,
                                             const gchar *password,
                                             const gchar *server,
                                             const gchar *database);

Prepares a CTWave Database object for connection to Sybase. After a call to this function call ctwave_connection_connect to initiate the connection.

ctdb: CTWave Database pointer.
ifile: Interfaces file or null for default.
login: Login name.
password: Password.
server: Server name.
database: Database name or null for master.
Returns : WAVE_OK or WAVE_FAIL.


ctwave_database_is_ready ()

gboolean    ctwave_database_is_ready        (CTWaveDatabase *ctdb);

Checks if the CTWave Database object is currently connected.

ctdb: CTWave Database pointer.
Returns : TRUE if connected or FALSE if not.


ctwave_database_activate ()

WaveResult  ctwave_database_activate        (CTWaveDatabase *ctdb);

Acitvates the specified CTWave Database object.

ctdb: CTWave Database pointer.
Returns : WAVE_OK or WAVE_FAIL.


ctwave_database_is_ready ()

gboolean    ctwave_database_is_ready        (CTWaveDatabase *ctdb);

Checks if the CTWave Database object is currently connected.

ctdb: CTWave Database pointer.
Returns : TRUE if connected or FALSE if not.