30 #define API_BH_INTERFACE ifs__ 35 BH_INTERFACE *API_BH_INTERFACE;\ 38 #define API_HOUSEKEEP_BEGIN(h__, TYPE__, p__) \ 41 retval__ = bh_get_rid ((h__), &rid__); \ 42 if (retval__ != NO_ERROR) \ 43 API_IMPL_TBL->err_set(retval__); \ 44 retval__ = bh_root_lock (rid__, &ifs__); \ 45 if (retval__ != NO_ERROR) \ 46 API_IMPL_TBL->err_set(retval__); \ 47 retval__ = ifs__->lookup (ifs__, (h__), &bind__); \ 48 if (retval__ != NO_ERROR) \ 50 bh_root_unlock(rid__); \ 51 API_IMPL_TBL->err_set(retval__); \ 53 (p__) = (TYPE__)bind__; \ 56 #define API_HOUSEKEEP_END() \ 57 (void) bh_root_unlock(rid__) 59 #define API_CHECK_HANDLE(s__,ht__) \ 61 if((s__)->handle_type != (ht__)) \ 63 API_IMPL_TBL->err_set(ER_INTERFACE_INVALID_HANDLE); \ 64 API_RETURN(ER_INTERFACE_INVALID_HANDLE); \ 68 #define API_RETURN(c) \ 70 API_HOUSEKEEP_END(); \ 74 #define API_IMPL_TBL (&Cubrid_api_function_table) 102 const char *user_name,
const char *password)
108 if (databasename ==
NULL)
116 retval =
API_IMPL_TBL->conn_connect (pst, host, port, databasename, user_name, password);
166 retval =
API_IMPL_TBL->conn_create_statement (pst, stmt);
195 retval =
API_IMPL_TBL->conn_set_option (pst, option, arg, size);
224 retval =
API_IMPL_TBL->conn_get_option (pst, option, arg, size);
293 retval =
API_IMPL_TBL->conn_get_error (pst, err, msg, size);
358 retval =
API_IMPL_TBL->stmt_add_batch_query (pst, sql, len);
428 retval =
API_IMPL_TBL->stmt_execute_immediate (pst, sql, len, rs, r);
513 retval =
API_IMPL_TBL->stmt_get_option (pst, option, arg, size);
542 retval =
API_IMPL_TBL->stmt_set_option (pst, option, arg, size);
597 retval =
API_IMPL_TBL->stmt_register_out_parameter (pst, index);
624 retval =
API_IMPL_TBL->stmt_get_resultset_metadata (pst, r);
651 retval =
API_IMPL_TBL->stmt_get_parameter_metadata (pst, r);
675 if (index <= 0 || addr ==
NULL || outlen ==
NULL || isnull ==
NULL)
684 retval =
API_IMPL_TBL->stmt_get_parameter (pst, index, type, addr, len, outlen, isnull);
705 if (index <= 0 || val ==
NULL)
714 retval =
API_IMPL_TBL->stmt_set_parameter (pst, index, type, val, size);
840 if (exist_result ==
NULL)
849 retval =
API_IMPL_TBL->stmt_next_result (pst, exist_result);
880 retval =
API_IMPL_TBL->stmt_get_first_error (pst, line, col, errcode, err_msg, size);
911 retval =
API_IMPL_TBL->stmt_get_next_error (pst, line, col, errcode, err_msg, size);
939 retval = pres->ifs->get_resultset_metadata (pres, &prmeta);
966 retval = pres->ifs->fetch (pres, offset, pos);
993 retval = pres->ifs->tell (pres, offset);
1013 retval = pres->ifs->clear_updates (pres);
1033 retval = pres->ifs->delete_row (pres);
1056 if (index <= 0 || addr ==
NULL || outlen ==
NULL || isnull ==
NULL)
1065 retval = pres->ifs->get_value (pres, index, type, addr, len, outlen, isnull);
1098 retval = pres->ifs->get_value_by_name (pres, name, type, addr, len, outlen, isnull);
1119 if (index <= 0 || addr ==
NULL)
1128 retval = pres->ifs->update_value (pres, index, type, addr, len);
1148 retval = pres->ifs->apply_update (pres);
1195 retval =
API_IMPL_TBL->batch_res_query_count (pst, count);
1215 if (ret ==
NULL || nr ==
NULL || index <= 0)
1224 retval =
API_IMPL_TBL->batch_res_get_result (pst, index - 1, ret, nr);
1245 if (err_code ==
NULL || err_msg ==
NULL)
1254 retval =
API_IMPL_TBL->batch_res_get_error (pst, index - 1, err_code, err_msg, size);
1302 if (index <= 0 || arg ==
NULL)
1311 retval =
API_IMPL_TBL->pmeta_get_info (pst, index, type, arg, size);
1338 retval = prmeta->ifs->get_count (prmeta, count);
1359 if (index <= 0 || arg ==
NULL)
1368 retval = prmeta->ifs->get_info (prmeta, index, type, arg, size);
1395 res =
API_IMPL_TBL->get_connection_opool (pst, &opool);
1427 res =
API_IMPL_TBL->get_connection_opool (pst, &opool);
1458 res =
API_IMPL_TBL->get_connection_opool (pst, &opool);
1537 if (coll ==
NULL || length ==
NULL)
1571 if (coll ==
NULL || pos < 0)
1581 res = co->
ifs->
insert (co, pos - 1, type, ptr, size);
1603 if (coll ==
NULL || pos <= 0)
1613 res = co->
ifs->
update (co, pos - 1, type, ptr, size);
1632 if (coll ==
NULL || pos <= 0)
1664 if (coll ==
NULL || pos <= 0 || type ==
NULL)
1691 ci_collection_get (CI_COLLECTION coll,
long pos, CI_TYPE type,
void *addr,
size_t len,
size_t * outlen,
bool * isnull)
1698 if (coll ==
NULL || pos <= 0 || outlen ==
NULL || isnull ==
NULL)
1709 res = co->
ifs->
get_elem (co, pos - 1, type, addr, len, outlen, isnull);
int bh_root_unlock(int rrid)
int ci_collection_get(CI_COLLECTION coll, long pos, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull)
int ci_stmt_register_out_parameter(CI_STATEMENT stmt, int index)
int ci_res_update_value(CI_RESULTSET res, int index, CI_TYPE type, void *addr, size_t len)
int ci_stmt_execute_batch(CI_STATEMENT stmt, CI_BATCH_RESULT *br)
int ci_stmt_get_start_line(CI_STATEMENT stmt, int *line)
int ci_conn_create_statement(CI_CONNECTION conn, CI_STATEMENT *stmt)
int bh_root_release(int rrid)
int ci_oid_get_classname(CI_OID *oid, char *name, size_t size)
int ci_stmt_close(CI_STATEMENT stmt)
int(* update)(API_COLLECTION *col, long pos, CI_TYPE type, void *ptr, size_t size)
int bh_root_lock(int rrid, BH_INTERFACE **bhifs)
int ci_collection_delete(CI_COLLECTION coll, long pos)
int(* delete)(API_COLLECTION *col, long pos)
int ci_stmt_get_next_error(CI_STATEMENT stmt, int *line, int *col, int *errcode, char *err_msg, size_t size)
void(* destroy)(API_COLLECTION *col)
int ci_stmt_prepare(CI_STATEMENT stmt, const char *sql, size_t len)
int ci_res_get_value(CI_RESULTSET res, int index, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull)
#define API_CHECK_HANDLE(s__, ht__)
int ci_stmt_affected_rows(CI_STATEMENT stmt, int *out)
int ci_stmt_get_parameter_metadata(CI_STATEMENT stmt, CI_PARAMETER_METADATA *r)
int ci_batch_res_get_error(CI_BATCH_RESULT br, int index, int *err_code, char *err_msg, size_t size)
int ci_res_fetch_tell(CI_RESULTSET res, int *offset)
int ci_res_clear_updates(CI_RESULTSET res)
int ci_create_connection(CI_CONNECTION *conn)
int ci_stmt_next_result(CI_STATEMENT stmt, bool *exist_result)
int(* oid_delete)(API_OBJECT_RESULTSET_POOL *pool, CI_OID *oid)
int ci_stmt_get_resultset_metadata(CI_STATEMENT stmt, CI_RESULTSET_METADATA *r)
int ci_collection_get_elem_domain_info(CI_COLLECTION coll, long pos, CI_TYPE *type, int *precision, int *scale)
int ci_conn_connect(CI_CONNECTION conn, const char *host, unsigned short port, const char *databasename, const char *user_name, const char *password)
int ci_stmt_get_option(CI_STATEMENT stmt, CI_STATEMENT_OPTION option, void *arg, size_t size)
int(* length)(API_COLLECTION *col, int *len)
int ci_batch_res_get_result(CI_BATCH_RESULT br, int index, int *ret, int *nr)
int ci_oid_delete(CI_OID *oid)
int ci_res_close(CI_RESULTSET res)
int ci_conn_get_error(CI_CONNECTION conn, int *err, char *msg, size_t size)
int ci_rmeta_get_count(CI_RESULTSET_METADATA rmeta, int *count)
int ci_stmt_get_parameter(CI_STATEMENT stmt, int index, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull)
int ci_stmt_get_resultset(CI_STATEMENT stmt, CI_RESULTSET *res)
int(* oid_get_classname)(API_OBJECT_RESULTSET_POOL *pool, CI_OID *oid, char *name, size_t size)
int ci_res_delete_row(CI_RESULTSET res)
int ci_res_get_resultset_metadata(CI_RESULTSET res, CI_RESULTSET_METADATA *r)
int ci_stmt_set_option(CI_STATEMENT stmt, CI_STATEMENT_OPTION option, void *arg, size_t size)
int ci_conn_commit(CI_CONNECTION conn)
int count(int &result, const cub_regex_object ®, const std::string &src, const int position, const INTL_CODESET codeset)
int ci_stmt_get_first_error(CI_STATEMENT stmt, int *line, int *col, int *errcode, char *err_msg, size_t size)
int ci_conn_rollback(CI_CONNECTION conn)
int ci_stmt_add_batch_query(CI_STATEMENT stmt, const char *sql, size_t len)
int ci_oid_get_resultset(CI_OID *oid, CI_RESULTSET *rs)
#define API_HOUSEKEEP_BEGIN(h__, TYPE__, p__)
int ci_res_apply_row(CI_RESULTSET res)
int ci_stmt_execute(CI_STATEMENT stmt, CI_RESULTSET *rs, int *r)
int ci_stmt_clear_batch(CI_STATEMENT stmt)
int(* get_object_resultset)(API_OBJECT_RESULTSET_POOL *pool, CI_OID *oid, API_RESULTSET **rres)
int ci_collection_free(CI_COLLECTION coll)
int ci_pmeta_get_info(CI_PARAMETER_METADATA pmeta, int index, CI_PMETA_INFO_TYPE type, void *arg, size_t size)
int ci_collection_insert(CI_COLLECTION coll, long pos, CI_TYPE type, void *ptr, size_t size)
int ci_stmt_add_batch(CI_STATEMENT stmt)
int ci_collection_new(CI_CONNECTION conn, CI_COLLECTION *coll)
int bh_get_rid(BIND_HANDLE bh, int *rid)
int(* get_elem_domain_info)(API_COLLECTION *col, long pos, CI_TYPE *type, int *precision, int *scale)
int ci_stmt_execute_immediate(CI_STATEMENT stmt, char *sql, size_t len, CI_RESULTSET *rs, int *r)
int(* insert)(API_COLLECTION *col, long pos, CI_TYPE type, void *ptr, size_t size)
int(* destroy_handle)(BH_INTERFACE *ifs, BIND_HANDLE bh)
int(* get_elem)(API_COLLECTION *col, long pos, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull)
int ci_res_get_value_by_name(CI_RESULTSET res, const char *name, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull)
int ci_collection_update(CI_COLLECTION coll, long pos, CI_TYPE type, void *ptr, size_t size)
int ci_batch_res_query_count(CI_BATCH_RESULT br, int *count)
#define ER_INTERFACE_INVALID_ARGUMENT
int ci_pmeta_get_count(CI_PARAMETER_METADATA pmeta, int *count)
int ci_conn_set_option(CI_CONNECTION conn, CI_CONNECTION_OPTION option, void *arg, size_t size)
int ci_collection_length(CI_COLLECTION coll, long *length)
int ci_stmt_get_query_type(CI_STATEMENT stmt, CUBRID_STMT_TYPE *type)
int ci_conn_close(CI_CONNECTION conn)
int ci_conn_get_option(CI_CONNECTION conn, CI_CONNECTION_OPTION option, void *arg, size_t size)
int ci_stmt_set_parameter(CI_STATEMENT stmt, int index, CI_TYPE type, void *val, size_t size)
int ci_rmeta_get_info(CI_RESULTSET_METADATA rmeta, int index, CI_RMETA_INFO_TYPE type, void *arg, size_t size)
int ci_res_fetch(CI_RESULTSET res, int offset, CI_FETCH_POSITION pos)
#define API_HOUSEKEEP_END()