IDZEBRA
2.2.7
|
#include <assert.h>
#include <stdio.h>
#include <limits.h>
#include <yaz/diagbib1.h>
#include <yaz/snprintf.h>
#include <yaz/pquery.h>
#include <yaz/sortspec.h>
#include "index.h"
#include "rank.h"
#include "orddict.h"
#include <charmap.h>
#include <idzebra/api.h>
#include <yaz/oid_db.h>
Go to the source code of this file.
Data Structures | |
struct | map_baseinfo |
Macros | |
#define | DEFAULT_APPROX_LIMIT 2000000000 |
#define | ASSERTZH assert(zh && zh->service) |
#define | ASSERTZHRES assert(zh && zh->service && zh->res) |
#define | ASSERTZS assert(zs) |
#define | ZEBRA_CHECK_HANDLE(zh) if (zebra_check_handle(zh) != ZEBRA_OK) return ZEBRA_FAIL |
#define | ZEBRA_CHECK_DICT 1 |
#define | ZEBRA_CHECK_ISAM 2 |
Functions | |
static void | zebra_open_res (ZebraHandle zh) |
static void | zebra_close_res (ZebraHandle zh) |
static ZEBRA_RES | zebra_check_handle (ZebraHandle zh) |
static int | zebra_chdir (ZebraService zs) |
static ZEBRA_RES | zebra_flush_reg (ZebraHandle zh) |
static struct zebra_register * | zebra_register_open (ZebraService zs, const char *name, int rw, int useshadow, Res res, const char *reg_path) |
static void | zebra_register_close (ZebraService zs, struct zebra_register *reg) |
const char * | zebra_get_encoding (ZebraHandle zh) |
Returns character set encoding for session. More... | |
ZebraHandle | zebra_open (ZebraService zs, Res res) |
Creates a Zebra session handle within service. More... | |
ZebraService | zebra_start (const char *configName) |
Creates a Zebra Service. More... | |
ZebraService | zebra_start_res (const char *configName, Res def_res, Res over_res) |
Creates a Zebra service with resources. More... | |
void | zebra_filter_info (ZebraService zs, void *cd, void(*cb)(void *cd, const char *name)) |
Lists enabled Zebra filters. More... | |
void | zebra_pidfname (ZebraService zs, char *path) |
Dict | dict_open_res (BFiles bfs, const char *name, int cache, int rw, int compact_flag, Res res) |
ZEBRA_RES | zebra_admin_shutdown (ZebraHandle zh) |
ZEBRA_RES | zebra_admin_start (ZebraHandle zh) |
ZEBRA_RES | zebra_stop (ZebraService zs) |
stops a Zebra service. More... | |
ZEBRA_RES | zebra_close (ZebraHandle zh) |
Destroys Zebra session handle. More... | |
static void | zebra_select_register (ZebraHandle zh, const char *new_reg) |
void | map_basenames_func (void *vp, const char *name, const char *value) |
int | zebra_select_default_database (ZebraHandle zh) |
void | map_basenames (ZebraHandle zh, ODR stream, int *num_bases, char ***basenames) |
ZEBRA_RES | zebra_select_database (ZebraHandle zh, const char *basename) |
ZEBRA_RES | zebra_select_databases (ZebraHandle zh, int num_bases, const char **basenames) |
ZEBRA_RES | zebra_set_approx_limit (ZebraHandle zh, zint approx_limit) |
Set limit before Zebra does approx hit count. More... | |
void | zebra_set_partial_result (ZebraHandle zh) |
ZEBRA_RES | zebra_set_break_handler (ZebraHandle zh, int(*f)(void *client_data), void *client_data) |
ZEBRA_RES | zebra_search_RPN_x (ZebraHandle zh, ODR o, Z_RPNQuery *query, const char *setname, zint *hits, int *estimated_hit_count, int *partial_resultset) |
Search using RPN Query structure (from ASN.1) More... | |
ZEBRA_RES | zebra_search_RPN (ZebraHandle zh, ODR o, Z_RPNQuery *query, const char *setname, zint *hits) |
Search using RPN Query structure (from ASN.1) More... | |
ZEBRA_RES | zebra_records_retrieve (ZebraHandle zh, ODR stream, const char *setname, Z_RecordComposition *comp, const Odr_oid *input_format, int num_recs, ZebraRetrievalRecord *recs) |
Retrieve records from result set (after search) More... | |
ZEBRA_RES | zebra_scan_PQF (ZebraHandle zh, ODR stream, const char *query, int *position, int *num_entries, ZebraScanEntry **entries, int *is_partial, const char *setname) |
performs Scan (taking PQF string) More... | |
ZEBRA_RES | zebra_scan (ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, const Odr_oid *attributeset, int *position, int *num_entries, ZebraScanEntry **entries, int *is_partial, const char *setname) |
performs Scan (Z39.50 style) More... | |
ZEBRA_RES | zebra_sort (ZebraHandle zh, ODR stream, int num_input_setnames, const char **input_setnames, const char *output_setname, Z_SortKeySpecList *sort_sequence, int *sort_status) |
int | zebra_deleteResultSet (ZebraHandle zh, int function, int num_setnames, char **setnames, int *statuses) |
Deletes one or more resultsets. More... | |
int | zebra_errCode (ZebraHandle zh) |
Returns error code for last error. More... | |
const char * | zebra_errString (ZebraHandle zh) |
Returns error string for last error. More... | |
char * | zebra_errAdd (ZebraHandle zh) |
Returns additional info for last error. More... | |
ZEBRA_RES | zebra_auth (ZebraHandle zh, const char *user, const char *pass) |
authenticate user. Returns 0 if OK, != 0 on failure More... | |
ZEBRA_RES | zebra_admin_import_begin (ZebraHandle zh, const char *database, const char *record_type) |
ZEBRA_RES | zebra_admin_import_end (ZebraHandle zh) |
ZEBRA_RES | zebra_admin_import_segment (ZebraHandle zh, Z_Segment *segment) |
int | delete_w_handle (const char *info, void *handle) |
int | delete_w_all_handle (const char *info, void *handle) |
static int | delete_SU_handle (void *handle, int ord, const char *index_type, const char *string_index, zinfo_index_category_t cat) |
ZEBRA_RES | zebra_drop_database (ZebraHandle zh, const char *db) |
Deletes a database (drop) More... | |
ZEBRA_RES | zebra_create_database (ZebraHandle zh, const char *db) |
Creates a database. More... | |
int | zebra_string_norm (ZebraHandle zh, const char *index_type, const char *input_str, int input_len, char *output_str, int output_len) |
Normalize zebra term for register (subject to change!) More... | |
static void | zebra_set_state (ZebraHandle zh, int val, int seqno) |
set register state (state*.LCK) More... | |
static void | zebra_get_state (ZebraHandle zh, char *val, int *seqno) |
ZEBRA_RES | zebra_begin_read (ZebraHandle zh) |
ZEBRA_RES | zebra_end_read (ZebraHandle zh) |
static void | read_res_for_transaction (ZebraHandle zh) |
ZEBRA_RES | zebra_begin_trans (ZebraHandle zh, int rw) |
ZEBRA_RES | zebra_end_trans (ZebraHandle zh) |
ZEBRA_RES | zebra_end_transaction (ZebraHandle zh, ZebraTransactionStatus *status) |
ZEBRA_RES | zebra_repository_update (ZebraHandle zh, const char *path) |
ZEBRA_RES | zebra_repository_delete (ZebraHandle zh, const char *path) |
ZEBRA_RES | zebra_repository_index (ZebraHandle zh, const char *path, enum zebra_recctrl_action_t action) |
ZEBRA_RES | zebra_repository_show (ZebraHandle zh, const char *path) |
static ZEBRA_RES | zebra_commit_ex (ZebraHandle zh, int clean_only) |
ZEBRA_RES | zebra_clean (ZebraHandle zh) |
ZEBRA_RES | zebra_commit (ZebraHandle zh) |
ZEBRA_RES | zebra_init (ZebraHandle zh) |
ZEBRA_RES | zebra_compact (ZebraHandle zh) |
static ZEBRA_RES | zebra_record_check (ZebraHandle zh, Record rec, zint *no_keys, int message_limit, unsigned flags, zint *no_long_dict_entries, zint *no_failed_dict_lookups, zint *no_invalid_keys, zint *no_invalid_dict_infos, zint *no_invalid_isam_entries) |
ZEBRA_RES | zebra_register_check (ZebraHandle zh, const char *spec) |
void | zebra_result (ZebraHandle zh, int *code, char **addinfo) |
Returns error code and additional info for last error. More... | |
void | zebra_shadow_enable (ZebraHandle zh, int value) |
ZEBRA_RES | zebra_octet_term_encoding (ZebraHandle zh, const char *encoding) |
ZEBRA_RES | zebra_record_encoding (ZebraHandle zh, const char *encoding) |
void | zebra_set_resource (ZebraHandle zh, const char *name, const char *value) |
const char * | zebra_get_resource (ZebraHandle zh, const char *name, const char *defaultvalue) |
int | zebra_trans_no (ZebraHandle zh) |
int | zebra_get_shadow_enable (ZebraHandle zh) |
void | zebra_set_shadow_enable (ZebraHandle zh, int value) |
ZEBRA_RES | zebra_add_record (ZebraHandle zh, const char *buf, int buf_size) |
Simple update record. More... | |
ZEBRA_RES | zebra_update_record (ZebraHandle zh, enum zebra_recctrl_action_t action, const char *recordType, zint *sysno, const char *match, const char *fname, const char *buf, int buf_size) |
Updates record. More... | |
ZEBRA_RES | zebra_search_PQF (ZebraHandle zh, const char *pqf_query, const char *setname, zint *hits) |
Search using PQF Query String. More... | |
int | zebra_sort_by_specstr (ZebraHandle zh, ODR stream, const char *sort_spec, const char *output_setname, const char **input_setnames) |
struct BFiles_struct * | zebra_get_bfs (ZebraHandle zh) |
ZEBRA_RES | zebra_set_limit (ZebraHandle zh, int complement_flag, zint *ids) |
void | zebra_setError (ZebraHandle zh, int code, const char *addinfo) |
void | zebra_setError_zint (ZebraHandle zh, int code, zint i) |
void | zebra_lock_prefix (Res res, char *path) |
Variables | |
static int | log_level = 0 |
static int | log_level_initialized = 0 |
#define ASSERTZH assert(zh && zh->service) |
Definition at line 49 of file zebraapi.c.
#define ASSERTZHRES assert(zh && zh->service && zh->res) |
Definition at line 50 of file zebraapi.c.
#define ASSERTZS assert(zs) |
Definition at line 51 of file zebraapi.c.
#define DEFAULT_APPROX_LIMIT 2000000000 |
Definition at line 46 of file zebraapi.c.
#define ZEBRA_CHECK_DICT 1 |
Definition at line 2204 of file zebraapi.c.
#define ZEBRA_CHECK_HANDLE | ( | zh | ) | if (zebra_check_handle(zh) != ZEBRA_OK) return ZEBRA_FAIL |
Definition at line 66 of file zebraapi.c.
#define ZEBRA_CHECK_ISAM 2 |
Definition at line 2205 of file zebraapi.c.
|
static |
Definition at line 1495 of file zebraapi.c.
References delete_w_all_handle(), delete_w_handle(), zebra_register::dict, dict_delete_subtree(), zebra_register::isamb, key_SU_encode(), zebra_register::records, and zebra_session::reg.
Referenced by zebra_drop_database().
int delete_w_all_handle | ( | const char * | info, |
void * | handle | ||
) |
Definition at line 1469 of file zebraapi.c.
References delete_w_handle(), zebra_register::isamb, isamb_pp_close(), isamb_pp_open(), isamb_pp_read(), it_key::mem, rec_del(), rec_get(), zebra_register::records, zebra_session::reg, and map_baseinfo::zh.
Referenced by delete_SU_handle().
int delete_w_handle | ( | const char * | info, |
void * | handle | ||
) |
Definition at line 1456 of file zebraapi.c.
References zebra_register::isamb, isamb_unlink(), zebra_session::reg, and map_baseinfo::zh.
Referenced by delete_SU_handle(), and delete_w_all_handle().
Definition at line 321 of file zebraapi.c.
References zebra_register::bfs, dict_open(), zebra_register::name, res_get_int(), and ZEBRA_OK.
Referenced by repositoryShow(), zebra_open_fmatch(), and zebra_register_open().
void map_basenames | ( | ZebraHandle | zh, |
ODR | stream, | ||
int * | num_bases, | ||
char *** | basenames | ||
) |
Definition at line 905 of file zebraapi.c.
References ASSERTZH, map_baseinfo::basenames, log_level, map_basenames_func(), map_baseinfo::mem, map_baseinfo::new_basenames, map_baseinfo::new_num_bases, map_baseinfo::new_num_max, map_baseinfo::num_bases, res_trav(), zebra_session::session_res, and map_baseinfo::zh.
void map_basenames_func | ( | void * | vp, |
const char * | name, | ||
const char * | value | ||
) |
Definition at line 858 of file zebraapi.c.
References map_baseinfo::basenames, map_baseinfo::mem, map_baseinfo::new_basenames, map_baseinfo::new_num_bases, map_baseinfo::new_num_max, map_baseinfo::num_bases, and STRCASECMP.
Referenced by map_basenames().
|
static |
Definition at line 1681 of file zebraapi.c.
References zebra_session::m_explain_database, zebra_session::m_file_verbose_limit, zebra_session::m_flag_rw, zebra_session::m_follow_links, zebra_session::m_group, zebra_session::m_record_id, zebra_session::m_record_type, zebra_session::m_store_data, zebra_session::m_store_keys, zebra_session::res, res_get(), and res_get_prefix().
Referenced by zebra_begin_trans().
ZEBRA_RES zebra_add_record | ( | ZebraHandle | zh, |
const char * | buf, | ||
int | buf_size | ||
) |
Simple update record.
zh | session handle |
buf | record buffer |
buf_size | record buffer size |
This function is a simple wrapper or zebra_update_record with action=action_update (insert or replace) .
Definition at line 2600 of file zebraapi.c.
References action_update, and zebra_update_record().
ZEBRA_RES zebra_admin_import_begin | ( | ZebraHandle | zh, |
const char * | database, | ||
const char * | record_type | ||
) |
Definition at line 1404 of file zebraapi.c.
References log_level, zebra_begin_trans(), ZEBRA_FAIL, zebra_select_database(), and map_baseinfo::zh.
Referenced by es_admin_request().
ZEBRA_RES zebra_admin_import_end | ( | ZebraHandle | zh | ) |
Definition at line 1414 of file zebraapi.c.
References log_level, ZEBRA_CHECK_HANDLE, zebra_end_trans(), and map_baseinfo::zh.
Referenced by bend_segment().
ZEBRA_RES zebra_admin_import_segment | ( | ZebraHandle | zh, |
Z_Segment * | segment | ||
) |
Definition at line 1421 of file zebraapi.c.
References action_update, log_level, ZEBRA_CHECK_HANDLE, ZEBRA_FAIL, ZEBRA_OK, zebra_update_record(), and map_baseinfo::zh.
Referenced by bend_segment().
ZEBRA_RES zebra_admin_shutdown | ( | ZebraHandle | zh | ) |
Definition at line 570 of file zebraapi.c.
References log_level, zebra_session::service, zebra_service::session_lock, zebra_service::stop_flag, ZEBRA_CHECK_HANDLE, zebra_mutex_cond_lock(), zebra_mutex_cond_unlock(), and ZEBRA_OK.
Referenced by es_admin_request().
ZEBRA_RES zebra_admin_start | ( | ZebraHandle | zh | ) |
Definition at line 581 of file zebraapi.c.
References log_level, zebra_session::service, zebra_service::session_lock, ZEBRA_CHECK_HANDLE, zebra_mutex_cond_lock(), zebra_mutex_cond_unlock(), and ZEBRA_OK.
Referenced by es_admin_request().
ZEBRA_RES zebra_auth | ( | ZebraHandle | zh, |
const char * | user, | ||
const char * | pass | ||
) |
authenticate user. Returns 0 if OK, != 0 on failure
zh | session handle |
user | user name |
pass | password |
Definition at line 1372 of file zebraapi.c.
References zebra_service::dbaccess, zebra_session::dbaccesslist, zebra_service::global_res, zebra_service::passwd_db, passwd_db_auth(), res_get(), zebra_session::service, zebra_session::user_perm, ZEBRA_CHECK_HANDLE, ZEBRA_FAIL, ZEBRA_OK, and map_baseinfo::zh.
Referenced by bend_init().
ZEBRA_RES zebra_begin_read | ( | ZebraHandle | zh | ) |
Definition at line 1671 of file zebraapi.c.
References zebra_begin_trans().
Referenced by zebra_deleteResultSet(), zebra_records_retrieve(), zebra_register_check(), zebra_register_statistics(), zebra_scan(), zebra_search_RPN_x(), zebra_sort(), and zebra_sort_by_specstr().
ZEBRA_RES zebra_begin_trans | ( | ZebraHandle | zh, |
int | rw | ||
) |
Definition at line 1710 of file zebraapi.c.
References ASSERTZHRES, zebra_session::basenames, zebra_session::errCode, zebra_session::errString, zebra_register::last_val, zebra_session::lock_normal, zebra_session::lock_shadow, log_level, zebra_session::path_reg, read_res_for_transaction(), zebra_session::records_deleted, zebra_session::records_inserted, zebra_session::records_processed, zebra_session::records_skipped, zebra_session::records_updated, zebra_session::reg, zebra_session::reg_name, zebra_session::res, res_get(), resultSetInvalidate(), zebra_register::seqno, zebra_session::service, zebra_session::shadow_enable, zebra_session::trans_no, zebra_session::trans_w_no, zebra_session::user_perm, ZEBRA_CHECK_HANDLE, zebra_commit(), ZEBRA_FAIL, zebra_flush_reg(), zebra_get_state(), zebra_lock_r(), zebra_lock_w(), ZEBRA_OK, zebra_register_close(), zebra_register_open(), zebra_select_default_database(), zebra_set_state(), zebra_setError(), zebra_unlock(), zebraExplain_curDatabase(), and zebra_register::zei.
Referenced by bend_esrequest(), main(), zebra_admin_import_begin(), zebra_begin_read(), zebra_create_database(), zebra_drop_database(), and zebra_update_record().
|
static |
Definition at line 68 of file zebraapi.c.
References ASSERTZS, zebra_service::global_res, log_level, and res_get().
Referenced by zebra_register_close(), and zebra_start_res().
|
static |
Definition at line 59 of file zebraapi.c.
References ZEBRA_FAIL, and ZEBRA_OK.
ZEBRA_RES zebra_clean | ( | ZebraHandle | zh | ) |
Definition at line 2139 of file zebraapi.c.
References log_level, ZEBRA_CHECK_HANDLE, and zebra_commit_ex().
Referenced by main().
ZEBRA_RES zebra_close | ( | ZebraHandle | zh | ) |
Destroys Zebra session handle.
zh | zebra session handle. |
Definition at line 657 of file zebraapi.c.
References zebra_session::basenames, zebra_session::dbaccesslist, zebra_session::errCode, zebra_session::iconv_from_utf8, zebra_session::iconv_to_utf8, zebra_session::lock_normal, zebra_session::lock_shadow, log_level, zebra_session::m_limit, zebra_session::next, zebra_session::nmem_error, zebra_session::num_basenames, zebra_session::path_reg, zebra_session::record_encoding, zebra_session::reg, zebra_session::reg_name, res_close(), resultSetDestroy(), zebra_session::service, zebra_service::session_lock, zebra_session::session_res, zebra_service::sessions, zebra_session::user_perm, ZEBRA_CHECK_HANDLE, zebra_close_res(), zebra_limit_destroy(), zebra_lock_destroy(), zebra_mutex_cond_lock(), zebra_mutex_cond_unlock(), ZEBRA_OK, and zebra_register_close().
Referenced by bend_close(), main(), and zebra_stop().
|
static |
Definition at line 751 of file zebraapi.c.
References ASSERTZH, zebra_session::errCode, zebra_session::res, and res_close().
Referenced by zebra_close(), and zebra_select_register().
ZEBRA_RES zebra_commit | ( | ZebraHandle | zh | ) |
Definition at line 2146 of file zebraapi.c.
References log_level, ZEBRA_CHECK_HANDLE, and zebra_commit_ex().
Referenced by es_admin_request(), main(), and zebra_begin_trans().
|
static |
Definition at line 2047 of file zebraapi.c.
References ASSERTZH, bf_cache(), bf_commitClean(), bf_commitExec(), bf_commitExists(), bfs_create(), bfs_destroy(), zebra_session::errCode, zebra_session::lock_normal, zebra_session::lock_shadow, log_level, zebra_session::path_reg, zebra_session::res, res_get(), ZEBRA_FAIL, zebra_get_state(), zebra_lock_r(), zebra_lock_w(), ZEBRA_OK, zebra_select_default_database(), zebra_set_state(), and zebra_unlock().
Referenced by zebra_clean(), and zebra_commit().
ZEBRA_RES zebra_compact | ( | ZebraHandle | zh | ) |
Definition at line 2187 of file zebraapi.c.
References bfs_create(), bfs_destroy(), zebra_session::errCode, inv_compact(), log_level, zebra_session::path_reg, zebra_session::res, res_get(), ZEBRA_CHECK_HANDLE, ZEBRA_FAIL, and ZEBRA_OK.
Referenced by main().
ZEBRA_RES zebra_create_database | ( | ZebraHandle | zh, |
const char * | db | ||
) |
Creates a database.
zh | session handle |
db | database to be created |
Definition at line 1562 of file zebraapi.c.
References log_level, zebra_session::reg, zebra_begin_trans(), ZEBRA_CHECK_HANDLE, zebra_end_trans(), ZEBRA_FAIL, ZEBRA_OK, zebra_select_database(), zebra_setError(), zebraExplain_newDatabase(), and zebra_register::zei.
Referenced by es_admin_request(), and main().
int zebra_deleteResultSet | ( | ZebraHandle | zh, |
int | function, | ||
int | num_setnames, | ||
char ** | setnames, | ||
int * | statuses | ||
) |
Deletes one or more resultsets.
zh | session handle |
function | Z_DeleteResultSetRequest_{list,all} |
num_setnames | number of result sets |
setnames | result set names |
statuses | status result |
Definition at line 1314 of file zebraapi.c.
References ASSERTZH, log_level, resultSetDestroy(), zebra_begin_read(), zebra_end_read(), and map_baseinfo::zh.
Referenced by bend_delete().
ZEBRA_RES zebra_drop_database | ( | ZebraHandle | zh, |
const char * | db | ||
) |
Deletes a database (drop)
zh | session handle |
db | database to be deleted |
Definition at line 1518 of file zebraapi.c.
References delete_SU_handle(), dict_delete_subtree_ord(), zebra_register::isamb, log_level, zebra_register::matchDict, zebra_session::reg, zebra_begin_trans(), ZEBRA_CHECK_HANDLE, zebra_end_trans(), ZEBRA_FAIL, ZEBRA_OK, zebra_remove_file_match(), zebra_select_database(), zebra_setError(), zebraExplain_curDatabase(), zebraExplain_get_database_ord(), zebraExplain_removeDatabase(), zebraExplain_trav_ord(), and zebra_register::zei.
Referenced by es_admin_request(), and main().
ZEBRA_RES zebra_end_read | ( | ZebraHandle | zh | ) |
Definition at line 1676 of file zebraapi.c.
References zebra_end_trans().
Referenced by zebra_deleteResultSet(), zebra_records_retrieve(), zebra_register_check(), zebra_register_statistics(), zebra_scan(), zebra_search_RPN_x(), zebra_sort(), and zebra_sort_by_specstr().
ZEBRA_RES zebra_end_trans | ( | ZebraHandle | zh | ) |
Definition at line 1910 of file zebraapi.c.
References log_level, ZEBRA_CHECK_HANDLE, and zebra_end_transaction().
Referenced by bend_esrequest(), main(), zebra_admin_import_end(), zebra_create_database(), zebra_drop_database(), zebra_end_read(), and zebra_update_record().
ZEBRA_RES zebra_end_transaction | ( | ZebraHandle | zh, |
ZebraTransactionStatus * | status | ||
) |
Definition at line 1919 of file zebraapi.c.
References bf_commitClean(), bfs_create(), bfs_destroy(), ZebraTransactionStatus::deleted, ZebraTransactionStatus::inserted, zebra_session::lock_normal, zebra_session::lock_shadow, log_level, zebra_session::path_reg, ZebraTransactionStatus::processed, zebra_session::records_deleted, zebra_session::records_inserted, zebra_session::records_processed, zebra_session::records_updated, zebra_session::reg, zebra_session::res, res_get(), resultSetInvalidate(), zebra_session::service, ZebraTransactionStatus::stime, zebra_session::trans_no, zebra_session::trans_w_no, ZebraTransactionStatus::updated, ZebraTransactionStatus::utime, ZEBRA_CHECK_HANDLE, ZEBRA_FAIL, zebra_flush_reg(), zebra_get_state(), ZEBRA_OK, zebra_register_close(), zebra_set_state(), zebra_setError(), zebra_unlock(), zebraExplain_runNumberIncrement(), zebra_register::zei, and ZINT_FORMAT.
Referenced by zebra_end_trans().
char* zebra_errAdd | ( | ZebraHandle | zh | ) |
Returns additional info for last error.
zh | zebra session handle. |
Definition at line 1363 of file zebraapi.c.
References zebra_session::errString, log_level, and map_baseinfo::zh.
Referenced by main().
int zebra_errCode | ( | ZebraHandle | zh | ) |
Returns error code for last error.
zh | zebra session handle. |
Definition at line 1343 of file zebraapi.c.
References zebra_session::errCode, log_level, and map_baseinfo::zh.
Referenced by main().
const char* zebra_errString | ( | ZebraHandle | zh | ) |
Returns error string for last error.
zh | zebra session handle. |
Definition at line 1354 of file zebraapi.c.
References zebra_session::errCode, log_level, and map_baseinfo::zh.
Referenced by main().
void zebra_filter_info | ( | ZebraService | zs, |
void * | cd, | ||
void(*)(void *cd, const char *name) | cb | ||
) |
Lists enabled Zebra filters.
zs | service handle |
cd | callback parameter (opaque) |
cb | callback function |
Definition at line 306 of file zebraapi.c.
References ASSERTZS, zebra_service::record_classes, and recTypeClass_info().
Referenced by show_filters().
|
static |
Definition at line 88 of file zebraapi.c.
References zebra_register::key_block, key_block_flush(), log_level, zebra_session::reg, ZEBRA_CHECK_HANDLE, zebra_index_merge(), ZEBRA_OK, zebraExplain_flush(), and zebra_register::zei.
Referenced by zebra_begin_trans(), and zebra_end_transaction().
struct BFiles_struct* zebra_get_bfs | ( | ZebraHandle | zh | ) |
Definition at line 2733 of file zebraapi.c.
References zebra_register::bfs, and zebra_session::reg.
Referenced by zebra_register_statistics().
const char* zebra_get_encoding | ( | ZebraHandle | zh | ) |
Returns character set encoding for session.
zh | zebra session handle. |
Definition at line 107 of file zebraapi.c.
References res_get_def(), and zebra_session::session_res.
Referenced by bend_init(), and zebra_open().
const char* zebra_get_resource | ( | ZebraHandle | zh, |
const char * | name, | ||
const char * | defaultvalue | ||
) |
Definition at line 2565 of file zebraapi.c.
References ASSERTZH, log_level, zebra_session::res, and res_get_def().
Referenced by resultSetAdd().
int zebra_get_shadow_enable | ( | ZebraHandle | zh | ) |
Definition at line 2586 of file zebraapi.c.
References ASSERTZH, log_level, and zebra_session::shadow_enable.
|
static |
Definition at line 1644 of file zebraapi.c.
References ASSERTZH, log_level, zebra_session::reg_name, zebra_session::res, res_get(), and zebra_mk_fname().
Referenced by zebra_begin_trans(), zebra_commit_ex(), and zebra_end_transaction().
ZEBRA_RES zebra_init | ( | ZebraHandle | zh | ) |
Definition at line 2154 of file zebraapi.c.
References bf_cache(), bf_reset(), bfs_create(), bfs_destroy(), log_level, zebra_session::path_reg, zebra_session::res, res_get(), ZEBRA_CHECK_HANDLE, ZEBRA_FAIL, ZEBRA_OK, zebra_select_default_database(), zebra_set_state(), and zebra_setError().
Referenced by main().
void zebra_lock_prefix | ( | Res | res, |
char * | path | ||
) |
Definition at line 2774 of file zebraapi.c.
References res_get_def().
Referenced by zebra_pidfname().
ZEBRA_RES zebra_octet_term_encoding | ( | ZebraHandle | zh, |
const char * | encoding | ||
) |
Definition at line 2522 of file zebraapi.c.
References zebra_session::iconv_from_utf8, zebra_session::iconv_to_utf8, log_level, ZEBRA_CHECK_HANDLE, and ZEBRA_OK.
Referenced by bend_init().
ZebraHandle zebra_open | ( | ZebraService | zs, |
Res | res | ||
) |
Creates a Zebra session handle within service.
zs | service handle. |
res | resources to be used for the service (NULL for none) |
There should be one handle for each thread doing something with zebra, be that searching or indexing. In simple apps one handle is sufficient
Definition at line 113 of file zebraapi.c.
References zebra_session::approx_limit, zebra_session::basenames, zebra_session::break_handler_data, zebra_session::break_handler_func, zebra_session::dbaccesslist, DEFAULT_APPROX_LIMIT, zebra_session::destroyed, zebra_session::errCode, zebra_session::errString, zebra_service::global_res, zebra_session::iconv_from_utf8, zebra_session::iconv_to_utf8, zebra_session::lock_normal, zebra_session::lock_shadow, log_level, log_level_initialized, zebra_session::m_limit, zebra_session::m_segment_indexing, zebra_session::m_staticrank, zebra_session::next, zebra_session::nmem_error, zebra_session::num_basenames, zebra_session::path_reg, zebra_session::record_encoding, zebra_session::reg, zebra_session::reg_name, zebra_session::res, res_open(), zebra_session::service, zebra_service::session_lock, zebra_session::session_res, zebra_service::sessions, zebra_session::sets, zebra_session::shadow_enable, zebra_session::store_data_buf, zebra_session::trans_no, zebra_session::trans_w_no, zebra_session::user_perm, zebra_get_encoding(), zebra_limit_create(), zebra_mutex_cond_lock(), and zebra_mutex_cond_unlock().
Referenced by bend_init(), and main().
|
static |
Definition at line 728 of file zebraapi.c.
References ASSERTZH, zebra_session::errCode, zebra_session::path_reg, zebra_session::reg_name, zebra_session::res, res_open(), res_read_file(), and zebra_session::session_res.
Referenced by zebra_select_register().
void zebra_pidfname | ( | ZebraService | zs, |
char * | path | ||
) |
Definition at line 314 of file zebraapi.c.
References ASSERTZS, zebra_service::global_res, and zebra_lock_prefix().
Referenced by bend_start(), and bend_stop().
|
static |
Definition at line 2207 of file zebraapi.c.
References CAST_ZINT_TO_INT, zebra_register::dict, dict_lookup(), record_info::info, zebra_register::isamb, isamb_pp_close(), isamb_pp_forward(), isamb_pp_open(), IT_KEY_LEVEL_MAX, IT_MAX_WORD, key_compare(), key_logdump_txt(), key_SU_encode(), it_key::len, zebra_session::m_staticrank, it_key::mem, recInfo_delKeys, zebra_session::reg, scope, record_info::size, record_info::sysno, ZEBRA_CHECK_DICT, ZEBRA_CHECK_ISAM, ZEBRA_FAIL, zebra_it_key_str_dump(), ZEBRA_OK, zebra_rec_keys_close(), zebra_rec_keys_open(), zebra_rec_keys_read(), zebra_rec_keys_rewind(), zebra_rec_keys_set_buf(), and ZINT_FORMAT.
Referenced by zebra_register_check().
ZEBRA_RES zebra_record_encoding | ( | ZebraHandle | zh, |
const char * | encoding | ||
) |
Definition at line 2545 of file zebraapi.c.
References log_level, zebra_session::record_encoding, ZEBRA_CHECK_HANDLE, and ZEBRA_OK.
Referenced by bend_init().
ZEBRA_RES zebra_records_retrieve | ( | ZebraHandle | zh, |
ODR | stream, | ||
const char * | setname, | ||
Z_RecordComposition * | comp, | ||
const Odr_oid * | input_format, | ||
int | num_recs, | ||
ZebraRetrievalRecord * | recs | ||
) |
Retrieve records from result set (after search)
zh | session handle |
stream | allocate records returned using this ODR |
setname | name of result set to retrieve records from |
comp | Z39.50 record composition |
input_format | transfer syntax (OID) |
num_recs | number of records to retrieve |
recs | store records in this structure (size is num_recs) |
Definition at line 1118 of file zebraapi.c.
References zebra_session::approx_limit, ZebraRetrievalRecord::base, ZebraRetrievalRecord::buf, ZebraMetaRecord::db, ZebraRetrievalRecord::errCode, ZebraRetrievalRecord::errString, ZebraRetrievalRecord::format, ZebraRetrievalRecord::len, log_level, zebra_session::res, ZebraRetrievalRecord::score, ZebraMetaRecord::score, ZebraRetrievalRecord::sysno, ZebraMetaRecord::sysno, ZebraMetaRecord::term, zebra_begin_read(), ZEBRA_CHECK_HANDLE, zebra_end_read(), ZEBRA_FAIL, zebra_meta_records_create(), zebra_meta_records_destroy(), ZEBRA_OK, zebra_record_fetch(), zebra_setError(), zebra_setError_zint(), zebra_snippets_create(), zebra_snippets_destroy(), zebra_snippets_hit_vector(), and map_baseinfo::zh.
Referenced by bend_fetch().
ZEBRA_RES zebra_register_check | ( | ZebraHandle | zh, |
const char * | spec | ||
) |
Definition at line 2413 of file zebraapi.c.
References zebra_session::m_file_verbose_limit, rec_free(), rec_get_next(), rec_get_root(), zebra_register::records, zebra_session::reg, zebra_begin_read(), ZEBRA_CHECK_DICT, ZEBRA_CHECK_ISAM, zebra_end_read(), ZEBRA_FAIL, ZEBRA_OK, zebra_record_check(), and ZINT_FORMAT.
Referenced by main().
|
static |
Definition at line 592 of file zebraapi.c.
References ASSERTZS, zebra_register::bfs, bfs_destroy(), data1_destroy(), zebra_register::dh, zebra_register::dict, dict_close(), zebra_register::isamb, isamb_close(), zebra_register::isamc, isamc_close(), zebra_register::isams, isams_close(), zebra_register::key_block, key_block_destroy(), zebra_register::keys, zebra_register::matchDict, zebra_register::name, rec_close(), zebra_register::records, zebra_register::recTypes, recTypes_destroy(), zebra_register::sort_index, zebra_register::sortKeys, zebra_register::stop_flag, zebra_chdir(), zebra_register::zebra_maps, zebra_maps_close(), zebra_rec_keys_close(), zebra_sort_close(), zebraExplain_close(), zebraRankDestroy(), and zebra_register::zei.
Referenced by zebra_begin_trans(), zebra_close(), zebra_end_transaction(), zebra_register_open(), and zebra_select_register().
|
static |
Definition at line 337 of file zebraapi.c.
References ASSERTZS, bf_cache(), zebra_register::bfs, bfs_create(), bfs_destroy(), data1_create(), data1_destroy(), data1_set_tabpath(), data1_set_tabroot(), zebra_register::dh, zebra_register::dict, dict_open_res(), FNAME_DICT, FNAME_ISAMC, FNAME_ISAMS, GMATCH_DICT, ISAM_DEFAULT, zebra_register::isamb, isamb_open(), zebra_register::isamc, isamc_open(), zebra_register::isams, isams_open(), zebra_register::key_block, key_isamc_m(), key_isams_m(), zebra_register::keys, zebra_register::last_val, zebra_register::matchDict, zebra_register::name, rank_1_class, rank_2_class, zebra_register::rank_classes, rank_similarity_class, rank_static_class, rec_check_compression_method(), REC_COMPRESS_BZIP2, REC_COMPRESS_NONE, REC_COMPRESS_ZLIB, rec_open(), zebra_service::record_classes, zebra_register::records, zebra_register::recTypes, recTypes_destroy(), recTypes_init(), res_get(), res_get_def(), res_get_match(), zebra_register::seqno, zebra_register::sort_index, zebra_register::sortKeys, zebra_extract_explain(), ZEBRA_FAIL, zebra_register::zebra_maps, zebra_maps_define_default_sort(), zebra_maps_open(), zebra_maps_read_file(), ZEBRA_OK, zebra_rec_keys_open(), zebra_register_close(), zebra_sort_open(), ZEBRA_SORT_TYPE_FLAT, ZEBRA_SORT_TYPE_ISAMB, ZEBRA_SORT_TYPE_MULTI, zebraExplain_open(), zebraRankInstall(), and zebra_register::zei.
Referenced by zebra_begin_trans().
ZEBRA_RES zebra_repository_delete | ( | ZebraHandle | zh, |
const char * | path | ||
) |
Definition at line 2012 of file zebraapi.c.
References action_delete, and zebra_repository_index().
ZEBRA_RES zebra_repository_index | ( | ZebraHandle | zh, |
const char * | path, | ||
enum zebra_recctrl_action_t | action | ||
) |
Definition at line 2017 of file zebraapi.c.
References action_a_delete, action_delete, action_update, ASSERTZH, log_level, zebra_session::m_record_id, zebra_update_file_match(), and zebra_update_from_path().
Referenced by main(), zebra_repository_delete(), and zebra_repository_update().
ZEBRA_RES zebra_repository_show | ( | ZebraHandle | zh, |
const char * | path | ||
) |
Definition at line 2038 of file zebraapi.c.
References ASSERTZH, log_level, repositoryShow(), and ZEBRA_OK.
Referenced by main().
ZEBRA_RES zebra_repository_update | ( | ZebraHandle | zh, |
const char * | path | ||
) |
Definition at line 2007 of file zebraapi.c.
References action_update, and zebra_repository_index().
void zebra_result | ( | ZebraHandle | zh, |
int * | code, | ||
char ** | addinfo | ||
) |
Returns error code and additional info for last error.
zh | zebra session handle. |
code | pointer to returned error code |
addinfo | pointer to returned additional info |
Definition at line 2500 of file zebraapi.c.
References zebra_session::errCode, zebra_session::errString, and log_level.
Referenced by bend_esrequest(), bend_fetch(), bend_scan(), bend_search(), bend_sort(), and es_admin_request().
ZEBRA_RES zebra_scan | ( | ZebraHandle | zh, |
ODR | stream, | ||
Z_AttributesPlusTerm * | zapt, | ||
const Odr_oid * | attributeset, | ||
int * | position, | ||
int * | num_entries, | ||
ZebraScanEntry ** | entries, | ||
int * | is_partial, | ||
const char * | setname | ||
) |
performs Scan (Z39.50 style)
zh | session handle |
stream | ODR handle for result |
zapt | Attribute plus Term (start term) |
attributeset | Attributeset for Attribute plus Term |
position | input/output position |
num_entries | number of terms requested / returned |
entries | list of resulting terms (ODR allocated) |
is_partial | upon return 1=partial, 0=complete |
setname | limit scan by this set (NULL means no limit) |
Definition at line 1258 of file zebraapi.c.
References zebra_session::basenames, log_level, zebra_session::num_basenames, rpn_scan(), zebra_begin_read(), ZEBRA_CHECK_HANDLE, zebra_end_read(), ZEBRA_FAIL, and map_baseinfo::zh.
Referenced by bend_scan(), and zebra_scan_PQF().
ZEBRA_RES zebra_scan_PQF | ( | ZebraHandle | zh, |
ODR | stream, | ||
const char * | query, | ||
int * | position, | ||
int * | num_entries, | ||
ZebraScanEntry ** | entries, | ||
int * | is_partial, | ||
const char * | setname | ||
) |
performs Scan (taking PQF string)
zh | session handle |
stream | ODR handle for result |
query | PQF scan query |
position | input/output position |
num_entries | number of terms requested / returned |
entries | list of resulting terms (ODR allocated) |
is_partial | upon return 1=partial, 0=complete |
setname | limit scan by this set (NULL means no limit) |
Definition at line 1232 of file zebraapi.c.
References zebra_session::errCode, ZEBRA_FAIL, zebra_scan(), and map_baseinfo::zh.
ZEBRA_RES zebra_search_PQF | ( | ZebraHandle | zh, |
const char * | pqf_query, | ||
const char * | setname, | ||
zint * | hits | ||
) |
Search using PQF Query String.
zh | session handle |
pqf_query | query |
setname | name of resultset |
hits | of hits is returned |
Definition at line 2651 of file zebraapi.c.
References zebra_session::errCode, log_level, ZEBRA_CHECK_HANDLE, ZEBRA_FAIL, ZEBRA_OK, zebra_search_RPN(), and ZINT_FORMAT.
ZEBRA_RES zebra_search_RPN | ( | ZebraHandle | zh, |
ODR | o, | ||
Z_RPNQuery * | query, | ||
const char * | setname, | ||
zint * | hits | ||
) |
Search using RPN Query structure (from ASN.1)
zh | session handle |
o | ODR handle |
query | RPN query using YAZ structure |
setname | name of resultset |
hits | number of hits is returned |
Definition at line 1108 of file zebraapi.c.
References zebra_search_RPN_x(), and map_baseinfo::zh.
Referenced by zebra_search_PQF().
ZEBRA_RES zebra_search_RPN_x | ( | ZebraHandle | zh, |
ODR | o, | ||
Z_RPNQuery * | query, | ||
const char * | setname, | ||
zint * | hits, | ||
int * | estimated_hit_count, | ||
int * | partial_resultset | ||
) |
Search using RPN Query structure (from ASN.1)
zh | session handle |
o | ODR handle |
query | RPN query using YAZ structure |
setname | name of resultset |
hits | number of hits is returned |
estimated_hit_count | whether hit count is an estimate |
partial_resultset | whether result is only partially evaluated |
Definition at line 1079 of file zebraapi.c.
References zebra_session::basenames, log_level, zebra_session::num_basenames, zebra_session::partial_result, resultSetAddRPN(), zebra_begin_read(), ZEBRA_CHECK_HANDLE, zebra_end_read(), ZEBRA_FAIL, and map_baseinfo::zh.
Referenced by bend_search(), and zebra_search_RPN().
ZEBRA_RES zebra_select_database | ( | ZebraHandle | zh, |
const char * | basename | ||
) |
Definition at line 939 of file zebraapi.c.
References log_level, ZEBRA_CHECK_HANDLE, zebra_select_databases(), and map_baseinfo::zh.
Referenced by bend_esrequest(), es_admin_request(), main(), zebra_admin_import_begin(), zebra_create_database(), zebra_drop_database(), and zebra_select_default_database().
ZEBRA_RES zebra_select_databases | ( | ZebraHandle | zh, |
int | num_bases, | ||
const char ** | basenames | ||
) |
Definition at line 948 of file zebraapi.c.
References zebra_session::basenames, map_baseinfo::basenames, zebra_session::dbaccesslist, zebra_session::errCode, zebra_session::lock_normal, zebra_session::lock_shadow, log_level, zebra_session::num_basenames, map_baseinfo::num_bases, zebra_session::res, ZEBRA_CHECK_HANDLE, ZEBRA_FAIL, ZEBRA_OK, zebra_select_register(), and map_baseinfo::zh.
Referenced by bend_scan(), bend_search(), and zebra_select_database().
int zebra_select_default_database | ( | ZebraHandle | zh | ) |
Definition at line 890 of file zebraapi.c.
References zebra_session::res, res_get(), res_get_prefix(), zebra_session::session_res, zebra_select_database(), and map_baseinfo::zh.
Referenced by zebra_begin_trans(), zebra_commit_ex(), and zebra_init().
|
static |
Definition at line 759 of file zebraapi.c.
References ASSERTZH, zebra_session::errCode, zebra_session::lock_normal, zebra_session::lock_shadow, zebra_session::m_segment_indexing, zebra_session::m_staticrank, zebra_session::path_reg, zebra_service::path_root, zebra_session::reg, zebra_session::reg_name, zebra_session::res, res_get(), res_get_int(), res_set(), resultSetInvalidate(), zebra_session::service, zebra_close_res(), zebra_lock_create(), zebra_lock_destroy(), ZEBRA_OK, zebra_open_res(), zebra_register_close(), and zebra_set_approx_limit().
Referenced by zebra_select_databases().
ZEBRA_RES zebra_set_approx_limit | ( | ZebraHandle | zh, |
zint | approx_limit | ||
) |
Set limit before Zebra does approx hit count.
zh | session handle |
approx_limit | the limit |
Results will be approximiate if hit count is greater than the limit specified. By default there is a high-limit (no limit).
Definition at line 1056 of file zebraapi.c.
References zebra_session::approx_limit, DEFAULT_APPROX_LIMIT, ZEBRA_OK, and map_baseinfo::zh.
Referenced by zebra_select_register().
ZEBRA_RES zebra_set_break_handler | ( | ZebraHandle | zh, |
int(*)(void *client_data) | f, | ||
void * | client_data | ||
) |
Definition at line 1070 of file zebraapi.c.
References zebra_session::break_handler_data, zebra_session::break_handler_func, ZEBRA_OK, and map_baseinfo::zh.
Referenced by bend_search().
ZEBRA_RES zebra_set_limit | ( | ZebraHandle | zh, |
int | complement_flag, | ||
zint * | ids | ||
) |
Definition at line 2744 of file zebraapi.c.
References zebra_session::m_limit, ZEBRA_CHECK_HANDLE, zebra_limit_create(), zebra_limit_destroy(), and ZEBRA_OK.
void zebra_set_partial_result | ( | ZebraHandle | zh | ) |
Definition at line 1064 of file zebraapi.c.
References zebra_session::partial_result, and map_baseinfo::zh.
Referenced by numeric_relation(), and string_term().
void zebra_set_resource | ( | ZebraHandle | zh, |
const char * | name, | ||
const char * | value | ||
) |
Definition at line 2556 of file zebraapi.c.
References ASSERTZH, log_level, zebra_session::res, and res_set().
void zebra_set_shadow_enable | ( | ZebraHandle | zh, |
int | value | ||
) |
Definition at line 2593 of file zebraapi.c.
References ASSERTZH, log_level, and zebra_session::shadow_enable.
|
static |
set register state (state*.LCK)
zh | Zebra handle |
val | state |
seqno | sequence number |
val is one of: d=writing to shadow(shadow enabled); writing to register (shadow disabled) o=reading only c=commit (writing to register, reading from shadow, shadow mode only)
Definition at line 1621 of file zebraapi.c.
References ASSERTZH, log_level, zebra_session::reg_name, zebra_session::res, res_get(), and zebra_mk_fname().
Referenced by zebra_begin_trans(), zebra_commit_ex(), zebra_end_transaction(), and zebra_init().
void zebra_setError | ( | ZebraHandle | zh, |
int | code, | ||
const char * | addinfo | ||
) |
Definition at line 2755 of file zebraapi.c.
References zebra_session::errCode, zebra_session::errString, and zebra_session::nmem_error.
Referenced by grep_info_prepare(), numeric_term(), resultSetRank(), resultSetSort(), resultSetSortSingle(), rpn_scan(), rpn_search_APT(), rpn_search_database(), rpn_search_structure(), string_term(), zapt_term_to_utf8(), zebra_apt_get_ord(), zebra_attr_list_get_ord(), zebra_begin_trans(), zebra_create_database(), zebra_drop_database(), zebra_end_transaction(), zebra_init(), and zebra_records_retrieve().
void zebra_setError_zint | ( | ZebraHandle | zh, |
int | code, | ||
zint | i | ||
) |
Definition at line 2764 of file zebraapi.c.
References zebra_session::errCode, zebra_session::errString, zebra_session::nmem_error, and ZINT_FORMAT.
Referenced by rpn_search_structure(), search_position(), string_term(), zebra_apt_get_ord(), zebra_attr_list_get_ord(), and zebra_records_retrieve().
void zebra_shadow_enable | ( | ZebraHandle | zh, |
int | value | ||
) |
Definition at line 2515 of file zebraapi.c.
References ASSERTZH, log_level, and zebra_session::shadow_enable.
Referenced by main().
ZEBRA_RES zebra_sort | ( | ZebraHandle | zh, |
ODR | stream, | ||
int | num_input_setnames, | ||
const char ** | input_setnames, | ||
const char * | output_setname, | ||
Z_SortKeySpecList * | sort_sequence, | ||
int * | sort_status | ||
) |
Definition at line 1291 of file zebraapi.c.
References log_level, resultSetSort(), zebra_begin_read(), ZEBRA_CHECK_HANDLE, zebra_end_read(), ZEBRA_FAIL, and map_baseinfo::zh.
Referenced by bend_sort().
int zebra_sort_by_specstr | ( | ZebraHandle | zh, |
ODR | stream, | ||
const char * | sort_spec, | ||
const char * | output_setname, | ||
const char ** | input_setnames | ||
) |
Definition at line 2693 of file zebraapi.c.
References zebra_session::errCode, log_level, resultSetSort(), zebra_begin_read(), ZEBRA_CHECK_HANDLE, and zebra_end_read().
ZebraService zebra_start | ( | const char * | configName | ) |
Creates a Zebra Service.
configName | name of configuration file |
This function is a simplified version of zebra_start_res.
Definition at line 192 of file zebraapi.c.
References zebra_start_res().
ZebraService zebra_start_res | ( | const char * | configName, |
Res | def_res, | ||
Res | over_res | ||
) |
Creates a Zebra service with resources.
configName | name of configuration file |
def_res | default resources |
over_res | overriding resources |
This function typically called once in a program. A Zebra Service acts as a factory for Zebra session handles.
Definition at line 197 of file zebraapi.c.
References zebra_service::dbaccess, zebra_service::global_res, log_level, log_level_initialized, zebra_service::nmem, zebra_service::passwd_db, passwd_db_file_crypt(), passwd_db_file_plain(), passwd_db_open(), zebra_service::path_root, zebra_service::record_classes, recTypeClass_create(), recTypeClass_load_modules(), res_close(), res_get(), res_open(), res_read_file(), zebra_service::session_lock, zebra_service::sessions, zebra_service::timing, zebra_chdir(), zebra_check_res(), zebra_flock_init(), zebra_get_version(), zebra_mutex_cond_init(), and ZEBRA_OK.
Referenced by bend_start(), main(), and zebra_start().
ZEBRA_RES zebra_stop | ( | ZebraService | zs | ) |
stops a Zebra service.
zs | service handle |
Frees resources used by the service.
Definition at line 627 of file zebraapi.c.
References zebra_service::global_res, zebra_service::nmem, zebra_service::passwd_db, passwd_db_close(), zebra_service::record_classes, recTypeClass_destroy(), res_close(), zebra_service::session_lock, zebra_service::sessions, zebra_service::timing, zebra_close(), zebra_mutex_cond_destroy(), and ZEBRA_OK.
Referenced by bend_start(), bend_stop(), and main().
int zebra_string_norm | ( | ZebraHandle | zh, |
const char * | index_type, | ||
const char * | input_str, | ||
int | input_len, | ||
char * | output_str, | ||
int | output_len | ||
) |
Normalize zebra term for register (subject to change!)
zh | session handle |
index_type | "w", "p",.. |
input_str | input string buffer |
input_len | input string length |
output_str | output string buffer |
output_len | output string length |
Definition at line 1587 of file zebraapi.c.
References ASSERTZH, log_level, zebra_session::reg, zebra_map_get(), zebra_register::zebra_maps, and zebra_replace().
int zebra_trans_no | ( | ZebraHandle | zh | ) |
Definition at line 2579 of file zebraapi.c.
References ASSERTZH, log_level, and zebra_session::trans_no.
ZEBRA_RES zebra_update_record | ( | ZebraHandle | zh, |
enum zebra_recctrl_action_t | action, | ||
const char * | recordType, | ||
zint * | sysno, | ||
const char * | match, | ||
const char * | fname, | ||
const char * | buf, | ||
int | buf_size | ||
) |
Updates record.
zh | session handle |
action | (insert,replace,delete or update (replace/insert) |
recordType | filter type (0 indicates default) |
sysno | system id (0 may be passed for no known id) |
match | match criteria (0 may be passed for no known criteria) |
fname | filename to be printed for logging (0 may be passed) |
buf | record buffer |
buf_size | record buffer size |
Definition at line 2611 of file zebraapi.c.
References log_level, zebra_begin_trans(), zebra_buffer_extract_record(), ZEBRA_CHECK_HANDLE, zebra_end_trans(), ZEBRA_FAIL, ZEBRA_OK, and ZINT_FORMAT.
Referenced by bend_esrequest(), zebra_add_record(), and zebra_admin_import_segment().
|
static |
Definition at line 53 of file zebraapi.c.
Referenced by map_basenames(), zebra_admin_import_begin(), zebra_admin_import_end(), zebra_admin_import_segment(), zebra_admin_shutdown(), zebra_admin_start(), zebra_begin_trans(), zebra_chdir(), zebra_clean(), zebra_close(), zebra_commit(), zebra_commit_ex(), zebra_compact(), zebra_create_database(), zebra_deleteResultSet(), zebra_drop_database(), zebra_end_trans(), zebra_end_transaction(), zebra_errAdd(), zebra_errCode(), zebra_errString(), zebra_flush_reg(), zebra_get_resource(), zebra_get_shadow_enable(), zebra_get_state(), zebra_init(), zebra_octet_term_encoding(), zebra_open(), zebra_record_encoding(), zebra_records_retrieve(), zebra_repository_index(), zebra_repository_show(), zebra_result(), zebra_scan(), zebra_search_PQF(), zebra_search_RPN_x(), zebra_select_database(), zebra_select_databases(), zebra_set_resource(), zebra_set_shadow_enable(), zebra_set_state(), zebra_shadow_enable(), zebra_sort(), zebra_sort_by_specstr(), zebra_start_res(), zebra_string_norm(), zebra_trans_no(), and zebra_update_record().
|
static |
Definition at line 54 of file zebraapi.c.
Referenced by zebra_open(), and zebra_start_res().