cli.h File Reference

#include "config.h"
#include <stdlib.h>
#include <time.h>

Classes

struct  cli_rectangle_t
struct  cli_array_t
struct  cli_field_descriptor
struct  cli_field_layout
struct  cli_table_descriptor
struct  cli_database_monitor

Defines

#define FASTDB_DLL_ENTRY
#define CLI_RECTANGLE_DIMENSION   2

Typedefs

typedef char cli_bool_t
typedef signed char cli_int1_t
typedef signed short cli_int2_t
typedef signed int cli_int4_t
typedef float cli_real4_t
typedef double cli_real8_t
typedef RECTANGLE_COORDINATE_TYPE cli_coord_t
typedef signed long long cli_int8_t
typedef time_t cli_time_t
typedef unsigned cli_oid_t
typedef void *(CLI_CALLBACK_CC * cli_column_set )(int var_type, void *var_ptr, int len)
typedef void *(CLI_CALLBACK_CC * cli_column_get )(int var_type, void *var_ptr, int *len)
typedef void *(CLI_CALLBACK_CC * cli_column_set_ex )(int var_type, void *var_ptr, int len, char const *column_name, int statement, void const *data_ptr, void *user_data)
typedef void *(CLI_CALLBACK_CC * cli_column_get_ex )(int var_type, void *var_ptr, int *len, char const *column_name, int statemen, void *user_data)
typedef void(CLI_CALLBACK_CC * cli_error_handler )(int error, char const *msg, int msgarg, void *context)
typedef void(CLI_CALLBACK_CC * cli_trace_function_t )(char *msg)
typedef void * cli_transaction_context_t

Enumerations

enum  cli_result_code {
  cli_ok = 0,
  cli_bad_address = -1,
  cli_connection_refused = -2,
  cli_database_not_found = -3,
  cli_bad_statement = -4,
  cli_parameter_not_found = -5,
  cli_unbound_parameter = -6,
  cli_column_not_found = -7,
  cli_incompatible_type = -8,
  cli_network_error = -9,
  cli_runtime_error = -10,
  cli_bad_descriptor = -11,
  cli_unsupported_type = -12,
  cli_not_found = -13,
  cli_not_update_mode = -14,
  cli_table_not_found = -15,
  cli_not_all_columns_specified = -16,
  cli_not_fetched = -17,
  cli_already_updated = -18,
  cli_table_already_exists = -19,
  cli_not_implemented = -20
}
enum  cli_var_type {
  cli_oid,
  cli_bool,
  cli_int1,
  cli_int2,
  cli_int4,
  cli_int8,
  cli_real4,
  cli_real8,
  cli_decimal,
  cli_asciiz,
  cli_pasciiz,
  cli_cstring,
  cli_array_of_oid,
  cli_array_of_bool,
  cli_array_of_int1,
  cli_array_of_int2,
  cli_array_of_int4,
  cli_array_of_int8,
  cli_array_of_real4,
  cli_array_of_real8,
  cli_array_of_decimal,
  cli_array_of_string,
  cli_any,
  cli_datetime,
  cli_autoincrement,
  cli_rectangle,
  cli_unknown
}
enum  cli_open_attributes {
  cli_open_default = 0x0,
  cli_open_readonly = 0x1,
  cli_open_truncate = 0x2,
  cli_open_concurrent = 0x4
}
enum  {
  cli_view_only,
  cli_for_update
}
enum  cli_field_flags {
  cli_hashed = 1,
  cli_indexed = 2,
  cli_autoincremented = 16
}
enum  cli_error_class {
  cli_no_error,
  cli_query_error,
  cli_arithmetic_error,
  cli_index_out_of_range_error,
  cli_database_open_error,
  cli_file_error,
  cli_out_of_memory_error,
  cli_deadlock,
  cli_null_reference_error,
  cli_lock_revoked,
  cli_file_limit_exeeded
}
enum  cli_detach_mode {
  cli_commit_on_detach = 1,
  cli_destroy_context_on_detach = 2
}

Functions

int FASTDB_DLL_ENTRY cli_open (char const *server_url, int max_connect_attempts, int reconnect_timeout_sec)
int FASTDB_DLL_ENTRY cli_create (char const *databaseName, char const *filePath, unsigned transactionCommitDelay, int openAttr, size_t initDatabaseSize, size_t extensionQuantum, size_t initIndexSize, size_t fileSizeLimit)
int FASTDB_DLL_ENTRY cli_create_replication_node (int nodeId, int nServers, char *nodeNames[], char const *databaseName, char const *filePath, int openAttr, size_t initDatabaseSize, size_t extensionQuantum, size_t initIndexSize, size_t fileSizeLimit)
int FASTDB_DLL_ENTRY cli_close (int session)
int FASTDB_DLL_ENTRY cli_statement (int session, char const *stmt)
int FASTDB_DLL_ENTRY cli_parameter (int statement, char const *param_name, int var_type, void *var_ptr)
int FASTDB_DLL_ENTRY cli_column (int statement, char const *column_name, int var_type, int *var_len, void *var_ptr)
int FASTDB_DLL_ENTRY cli_array_column (int statement, char const *column_name, int var_type, void *var_ptr, cli_column_set set, cli_column_get get)
int FASTDB_DLL_ENTRY cli_array_column_ex (int statement, char const *column_name, int var_type, void *var_ptr, cli_column_set_ex set, cli_column_get_ex get, void *user_data)
int FASTDB_DLL_ENTRY cli_fetch (int statement, int for_update)
int FASTDB_DLL_ENTRY cli_insert (int statement, cli_oid_t *oid)
int FASTDB_DLL_ENTRY cli_get_first (int statement)
int FASTDB_DLL_ENTRY cli_get_last (int statement)
int FASTDB_DLL_ENTRY cli_get_next (int statement)
int FASTDB_DLL_ENTRY cli_get_prev (int statement)
int FASTDB_DLL_ENTRY cli_skip (int statement, int n)
int FASTDB_DLL_ENTRY cli_seek (int statement, cli_oid_t oid)
cli_oid_t FASTDB_DLL_ENTRY cli_get_oid (int statement)
int FASTDB_DLL_ENTRY cli_update (int statement)
int FASTDB_DLL_ENTRY cli_remove (int statement)
int FASTDB_DLL_ENTRY cli_remove_current (int statement)
int FASTDB_DLL_ENTRY cli_free (int statement)
int FASTDB_DLL_ENTRY cli_close_cursor (int statement)
int FASTDB_DLL_ENTRY cli_commit (int session)
int FASTDB_DLL_ENTRY cli_precommit (int session)
int FASTDB_DLL_ENTRY cli_abort (int session)
int FASTDB_DLL_ENTRY cli_describe (int session, char const *table, cli_field_descriptor **fields)
int FASTDB_DLL_ENTRY cli_describe_layout (int session, char const *table, cli_field_layout **fields, int *rec_size)
int FASTDB_DLL_ENTRY cli_get_field_size (cli_field_descriptor *fields, int field_no)
int FASTDB_DLL_ENTRY cli_get_field_offset (cli_field_descriptor *fields, int field_no)
int FASTDB_DLL_ENTRY cli_show_tables (int session, cli_table_descriptor **tables)
int FASTDB_DLL_ENTRY cli_create_table (int session, char const *tableName, int nFields, cli_field_descriptor *fields)
int FASTDB_DLL_ENTRY cli_alter_table (int session, char const *tableName, int nFields, cli_field_descriptor *fields)
int FASTDB_DLL_ENTRY cli_drop_table (int session, char const *tableName)
int FASTDB_DLL_ENTRY cli_alter_index (int session, char const *tableName, char const *fieldName, int newFlags)
cli_error_handler FASTDB_DLL_ENTRY cli_set_error_handler (int session, cli_error_handler new_handler, void *context)
int FASTDB_DLL_ENTRY cli_freeze (int statement)
int FASTDB_DLL_ENTRY cli_unfreeze (int statement)
int FASTDB_DLL_ENTRY cli_attach (int session)
int FASTDB_DLL_ENTRY cli_detach (int session, int detach_mode)
void FASTDB_DLL_ENTRY cli_free_memory (int session, void *ptr)
int FASTDB_DLL_ENTRY cli_get_database_state (int session, cli_database_monitor *monitor)
void FASTDB_DLL_ENTRY cli_set_trace_function (cli_trace_function_t func)
int FASTDB_DLL_ENTRY cli_prepare_query (int session, char const *query)
int FASTDB_DLL_ENTRY cli_execute_query (int statement, int for_update, void *record_struct,...)
 cli_execute_query Execute query previously prepared by cli_prepare_query with varying list of parameters Parameters: statement - statement descriptor returned by cli_prepare_query for_update - not zero if fetched rows will be updated record_struct - structure to receive selected record fields
int FASTDB_DLL_ENTRY cli_execute_query_ex (int statement, int for_update, void *record_struct, int n_params, int *param_types, void **param_values)
 cli_execute_query_ex Execute query previously prepared by cli_prepare_query with parameters passed as array Parameters: statement - statement descriptor returned by cli_prepare_query for_update - not zero if fetched rows will be updated record_struct - structure to receive selected record fields n_params - number of parameters param_types - types of parameters (cli_var_type) param_values - array of pointers to parameter values Returns: >= 0 - success, for select statements number of fetched rows is returned < 0 - error code as described in cli_result_code enum
int FASTDB_DLL_ENTRY cli_insert_struct (int session, char const *table_name, void *record_struct, cli_oid_t *oid)
 cli_insert_struct Insert new record represented as C structure Parameters: session - session descriptor returned by cli_open table_name - name of the destination table record_struct - structure specifying value of record fields oid - pointer to the location to receive OID of created record (may be NULL) Returns: result code as described in cli_result_code enum
cli_transaction_context_t
FASTDB_DLL_ENTRY 
cli_create_transaction_context ()
int FASTDB_DLL_ENTRY cli_join_transaction (int session, cli_transaction_context_t ctx)
void FASTDB_DLL_ENTRY cli_remove_transaction_context (cli_transaction_context_t ctx)


Define Documentation

#define FASTDB_DLL_ENTRY

#define CLI_RECTANGLE_DIMENSION   2


Typedef Documentation

typedef char cli_bool_t

typedef signed char cli_int1_t

typedef signed short cli_int2_t

typedef signed int cli_int4_t

typedef float cli_real4_t

typedef double cli_real8_t

typedef RECTANGLE_COORDINATE_TYPE cli_coord_t

typedef signed long long cli_int8_t

typedef time_t cli_time_t

typedef unsigned cli_oid_t

typedef void*(CLI_CALLBACK_CC * cli_column_set)(int var_type, void *var_ptr, int len)

typedef void*(CLI_CALLBACK_CC * cli_column_get)(int var_type, void *var_ptr, int *len)

typedef void*(CLI_CALLBACK_CC * cli_column_set_ex)(int var_type, void *var_ptr, int len, char const *column_name, int statement, void const *data_ptr, void *user_data)

typedef void*(CLI_CALLBACK_CC * cli_column_get_ex)(int var_type, void *var_ptr, int *len, char const *column_name, int statemen, void *user_data)

typedef void(CLI_CALLBACK_CC * cli_error_handler)(int error, char const *msg, int msgarg, void *context)

typedef void(CLI_CALLBACK_CC * cli_trace_function_t)(char *msg)


Enumeration Type Documentation

Enumerator:
cli_ok 
cli_bad_address 
cli_connection_refused 
cli_database_not_found 
cli_bad_statement 
cli_parameter_not_found 
cli_unbound_parameter 
cli_column_not_found 
cli_incompatible_type 
cli_network_error 
cli_runtime_error 
cli_bad_descriptor 
cli_unsupported_type 
cli_not_found 
cli_not_update_mode 
cli_table_not_found 
cli_not_all_columns_specified 
cli_not_fetched 
cli_already_updated 
cli_table_already_exists 
cli_not_implemented 

Enumerator:
cli_oid 
cli_bool 
cli_int1 
cli_int2 
cli_int4 
cli_int8 
cli_real4 
cli_real8 
cli_decimal 
cli_asciiz 
cli_pasciiz 
cli_cstring 
cli_array_of_oid 
cli_array_of_bool 
cli_array_of_int1 
cli_array_of_int2 
cli_array_of_int4 
cli_array_of_int8 
cli_array_of_real4 
cli_array_of_real8 
cli_array_of_decimal 
cli_array_of_string 
cli_any 
cli_datetime 
cli_autoincrement 
cli_rectangle 
cli_unknown 

Enumerator:
cli_open_default 
cli_open_readonly 
cli_open_truncate 
cli_open_concurrent 

anonymous enum

Enumerator:
cli_view_only 
cli_for_update 

Enumerator:
cli_hashed 
cli_indexed 
cli_autoincremented 

Enumerator:
cli_no_error 
cli_query_error 
cli_arithmetic_error 
cli_index_out_of_range_error 
cli_database_open_error 
cli_file_error 
cli_out_of_memory_error 
cli_deadlock 
cli_null_reference_error 
cli_lock_revoked 
cli_file_limit_exeeded 

Enumerator:
cli_commit_on_detach 
cli_destroy_context_on_detach 


Function Documentation

int FASTDB_DLL_ENTRY cli_open ( char const *  server_url,
int  max_connect_attempts,
int  reconnect_timeout_sec 
)

int FASTDB_DLL_ENTRY cli_create ( char const *  databaseName,
char const *  filePath,
unsigned  transactionCommitDelay,
int  openAttr,
size_t  initDatabaseSize,
size_t  extensionQuantum,
size_t  initIndexSize,
size_t  fileSizeLimit 
)

int FASTDB_DLL_ENTRY cli_create_replication_node ( int  nodeId,
int  nServers,
char *  nodeNames[],
char const *  databaseName,
char const *  filePath,
int  openAttr,
size_t  initDatabaseSize,
size_t  extensionQuantum,
size_t  initIndexSize,
size_t  fileSizeLimit 
)

int FASTDB_DLL_ENTRY cli_close ( int  session  ) 

int FASTDB_DLL_ENTRY cli_statement ( int  session,
char const *  stmt 
)

int FASTDB_DLL_ENTRY cli_parameter ( int  statement,
char const *  param_name,
int  var_type,
void *  var_ptr 
)

int FASTDB_DLL_ENTRY cli_column ( int  statement,
char const *  column_name,
int  var_type,
int *  var_len,
void *  var_ptr 
)

int FASTDB_DLL_ENTRY cli_array_column ( int  statement,
char const *  column_name,
int  var_type,
void *  var_ptr,
cli_column_set  set,
cli_column_get  get 
)

int FASTDB_DLL_ENTRY cli_array_column_ex ( int  statement,
char const *  column_name,
int  var_type,
void *  var_ptr,
cli_column_set_ex  set,
cli_column_get_ex  get,
void *  user_data 
)

int FASTDB_DLL_ENTRY cli_fetch ( int  statement,
int  for_update 
)

int FASTDB_DLL_ENTRY cli_insert ( int  statement,
cli_oid_t oid 
)

int FASTDB_DLL_ENTRY cli_get_first ( int  statement  ) 

int FASTDB_DLL_ENTRY cli_get_last ( int  statement  ) 

int FASTDB_DLL_ENTRY cli_get_next ( int  statement  ) 

int FASTDB_DLL_ENTRY cli_get_prev ( int  statement  ) 

int FASTDB_DLL_ENTRY cli_skip ( int  statement,
int  n 
)

int FASTDB_DLL_ENTRY cli_seek ( int  statement,
cli_oid_t  oid 
)

cli_oid_t FASTDB_DLL_ENTRY cli_get_oid ( int  statement  ) 

int FASTDB_DLL_ENTRY cli_update ( int  statement  ) 

int FASTDB_DLL_ENTRY cli_remove ( int  statement  ) 

int FASTDB_DLL_ENTRY cli_remove_current ( int  statement  ) 

int FASTDB_DLL_ENTRY cli_free ( int  statement  ) 

int FASTDB_DLL_ENTRY cli_close_cursor ( int  statement  ) 

int FASTDB_DLL_ENTRY cli_commit ( int  session  ) 

int FASTDB_DLL_ENTRY cli_precommit ( int  session  ) 

int FASTDB_DLL_ENTRY cli_abort ( int  session  ) 

int FASTDB_DLL_ENTRY cli_describe ( int  session,
char const *  table,
cli_field_descriptor **  fields 
)

int FASTDB_DLL_ENTRY cli_describe_layout ( int  session,
char const *  table,
cli_field_layout **  fields,
int *  rec_size 
)

int FASTDB_DLL_ENTRY cli_get_field_size ( cli_field_descriptor fields,
int  field_no 
)

int FASTDB_DLL_ENTRY cli_get_field_offset ( cli_field_descriptor fields,
int  field_no 
)

int FASTDB_DLL_ENTRY cli_show_tables ( int  session,
cli_table_descriptor **  tables 
)

int FASTDB_DLL_ENTRY cli_create_table ( int  session,
char const *  tableName,
int  nFields,
cli_field_descriptor fields 
)

int FASTDB_DLL_ENTRY cli_alter_table ( int  session,
char const *  tableName,
int  nFields,
cli_field_descriptor fields 
)

int FASTDB_DLL_ENTRY cli_drop_table ( int  session,
char const *  tableName 
)

int FASTDB_DLL_ENTRY cli_alter_index ( int  session,
char const *  tableName,
char const *  fieldName,
int  newFlags 
)

cli_error_handler FASTDB_DLL_ENTRY cli_set_error_handler ( int  session,
cli_error_handler  new_handler,
void *  context 
)

int FASTDB_DLL_ENTRY cli_freeze ( int  statement  ) 

int FASTDB_DLL_ENTRY cli_unfreeze ( int  statement  ) 

int FASTDB_DLL_ENTRY cli_attach ( int  session  ) 

int FASTDB_DLL_ENTRY cli_detach ( int  session,
int  detach_mode 
)

void FASTDB_DLL_ENTRY cli_free_memory ( int  session,
void *  ptr 
)

int FASTDB_DLL_ENTRY cli_get_database_state ( int  session,
cli_database_monitor monitor 
)

void FASTDB_DLL_ENTRY cli_set_trace_function ( cli_trace_function_t  func  ) 

int FASTDB_DLL_ENTRY cli_prepare_query ( int  session,
char const *  query 
)

int FASTDB_DLL_ENTRY cli_execute_query ( int  statement,
int  for_update,
void *  record_struct,
  ... 
)

cli_execute_query Execute query previously prepared by cli_prepare_query with varying list of parameters Parameters: statement - statement descriptor returned by cli_prepare_query for_update - not zero if fetched rows will be updated record_struct - structure to receive selected record fields

.. - varying list of query parameters Returns: >= 0 - success, for select statements number of fetched rows is returned < 0 - error code as described in cli_result_code enum

int FASTDB_DLL_ENTRY cli_execute_query_ex ( int  statement,
int  for_update,
void *  record_struct,
int  n_params,
int *  param_types,
void **  param_values 
)

cli_execute_query_ex Execute query previously prepared by cli_prepare_query with parameters passed as array Parameters: statement - statement descriptor returned by cli_prepare_query for_update - not zero if fetched rows will be updated record_struct - structure to receive selected record fields n_params - number of parameters param_types - types of parameters (cli_var_type) param_values - array of pointers to parameter values Returns: >= 0 - success, for select statements number of fetched rows is returned < 0 - error code as described in cli_result_code enum

int FASTDB_DLL_ENTRY cli_insert_struct ( int  session,
char const *  table_name,
void *  record_struct,
cli_oid_t oid 
)

cli_insert_struct Insert new record represented as C structure Parameters: session - session descriptor returned by cli_open table_name - name of the destination table record_struct - structure specifying value of record fields oid - pointer to the location to receive OID of created record (may be NULL) Returns: result code as described in cli_result_code enum

cli_transaction_context_t FASTDB_DLL_ENTRY cli_create_transaction_context (  ) 

int FASTDB_DLL_ENTRY cli_join_transaction ( int  session,
cli_transaction_context_t  ctx 
)

void FASTDB_DLL_ENTRY cli_remove_transaction_context ( cli_transaction_context_t  ctx  ) 


Online Library Docs

sipXecs home page

Version 4.2.1-018930 2010-07-31T01:13:23 build16 abuild