IDZEBRA
2.2.6
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <idzebra/api.h>
#include <yaz/log.h>
#include <yaz/proto.h>
#include <yaz/sortspec.h>
#include <yaz/options.h>
#include <yaz/wrbuf.h>
#include <yaz/oid_db.h>
Go to the source code of this file.
Data Structures | |
struct | cmdstruct |
Macros | |
#define | MAX_NO_ARGS 32 |
#define | MAX_OUT_BUFF 4096 |
#define | MAX_ARG_LEN 1024 |
#define | PROMPT "ZebraSh>" |
#define | DEFAULTCONFIG "./zebra.cfg" |
#define | DEFAULTDATABASE "Default" |
#define | DEFAULTRESULTSET "MyResultSet" |
Functions | |
static int | split_args (char *line, char **args) |
static char * | defarg (char *arg, char *def) |
static int | defargint (char *arg, int def) |
static char * | restargs (char *args[], int n) |
int | onecommand (char *line, WRBUF outbuff, const char *prevout) |
int | cmd_echo (char *args[], WRBUF outbuff) |
int | cmd_quit (char *args[], WRBUF outbuff) |
static int | cmd_help (char *args[], WRBUF outbuff) |
static int | cmd_zebra_start (char *args[], WRBUF outbuff) |
static int | cmd_zebra_stop (char *args[], WRBUF outbuff) |
static int | cmd_zebra_open (char *args[], WRBUF outbuff) |
static int | cmd_zebra_close (char *args[], WRBUF outbuff) |
static int | cmd_quickstart (char *args[], WRBUF outbuff) |
static int | cmd_yaz_log_file (char *args[], WRBUF outbuff) |
static int | cmd_yaz_log_level (char *args[], WRBUF outbuff) |
static int | cmd_yaz_log_prefix (char *args[], WRBUF outbuff) |
static int | cmd_logf (char *args[], WRBUF outbuff) |
static int | cmd_err (char *args[], WRBUF outbuff) |
static int | cmd_errcode (char *args[], WRBUF outbuff) |
static int | cmd_errstr (char *args[], WRBUF outbuff) |
static int | cmd_erradd (char *args[], WRBUF outbuff) |
static int | cmd_init (char *args[], WRBUF outbuff) |
static int | cmd_select_database (char *args[], WRBUF outbuff) |
static int | cmd_create_database (char *args[], WRBUF outbuff) |
static int | cmd_drop_database (char *args[], WRBUF outbuff) |
static int | cmd_begin_trans (char *args[], WRBUF outbuff) |
static int | cmd_end_trans (char *args[], WRBUF outbuff) |
static int | cmd_record_insert (char *args[], WRBUF outbuff) |
static int | cmd_exchange_record (char *args[], WRBUF outbuff) |
static int | cmd_search_pqf (char *args[], WRBUF outbuff) |
static int | cmd_find (char *args[], WRBUF outbuff) |
static int | cmd_show (char *args[], WRBUF outbuff) |
static int | cmd_sort (char *args[], WRBUF outbuff) |
static void | Zerrors (WRBUF outbuff) |
void | shell (void) |
static void | usage (void) |
int | main (int argc, char **argv) |
Variables | |
ZebraService | zs =0 |
ZebraHandle | zh =0 |
int | nextrecno =1 |
static char * | default_config = DEFAULTCONFIG |
static int | log_level =0 |
struct cmdstruct | cmds [] |
|
static |
Definition at line 337 of file zebrash.c.
References zebra_begin_trans(), and zh.
|
static |
Definition at line 320 of file zebrash.c.
References defarg(), DEFAULTDATABASE, zebra_create_database(), and zh.
|
static |
Definition at line 328 of file zebrash.c.
References zebra_drop_database(), and zh.
int cmd_echo | ( | char * | args[], |
WRBUF | outbuff | ||
) |
Definition at line 137 of file zebrash.c.
References restargs().
|
static |
Definition at line 345 of file zebrash.c.
References zebra_end_trans(), and zh.
|
static |
Definition at line 276 of file zebrash.c.
References zebra_errAdd(), zebra_errCode(), zebra_errString(), and zh.
|
static |
Definition at line 296 of file zebrash.c.
References zebra_errAdd(), and zh.
|
static |
Definition at line 284 of file zebrash.c.
References zebra_errCode(), and zh.
|
static |
Definition at line 290 of file zebrash.c.
References zebra_errString(), and zh.
|
static |
Definition at line 375 of file zebrash.c.
References action_update, onecommand(), restargs(), zebra_update_record(), and zh.
|
static |
Definition at line 412 of file zebrash.c.
References DEFAULTRESULTSET, nextrecno, onecommand(), restargs(), zebra_search_PQF(), zh, and ZINT_FORMAT.
|
static |
Definition at line 707 of file zebrash.c.
References cmdstruct::args, cmdstruct::cmd, cmds, and cmdstruct::explanation.
|
static |
Definition at line 307 of file zebrash.c.
References zebra_init(), and zh.
|
static |
Definition at line 261 of file zebrash.c.
References defargint(), and restargs().
|
static |
int cmd_quit | ( | char * | args[], |
WRBUF | outbuff | ||
) |
Definition at line 143 of file zebrash.c.
References onecommand(), zh, and zs.
|
static |
Definition at line 353 of file zebrash.c.
References action_insert, restargs(), zebra_update_record(), zh, and ZINT_FORMAT.
|
static |
Definition at line 400 of file zebrash.c.
References restargs(), zebra_search_PQF(), zh, and ZINT_FORMAT.
|
static |
Definition at line 313 of file zebrash.c.
References defarg(), DEFAULTDATABASE, zebra_select_database(), and zh.
|
static |
Definition at line 434 of file zebrash.c.
References defarg(), defargint(), DEFAULTRESULTSET, nextrecno, zebra_records_retrieve(), and zh.
|
static |
Definition at line 473 of file zebrash.c.
References DEFAULTRESULTSET, restargs(), zebra_sort(), and zh.
|
static |
|
static |
Definition at line 245 of file zebrash.c.
References defargint().
|
static |
|
static |
Definition at line 201 of file zebrash.c.
References zebra_close(), and zh.
|
static |
Definition at line 192 of file zebrash.c.
References zebra_open(), zh, and zs.
|
static |
Definition at line 165 of file zebrash.c.
References default_config, zebra_start(), and zs.
|
static |
Definition at line 182 of file zebrash.c.
References zebra_stop(), and zs.
|
static |
Definition at line 104 of file zebrash.c.
Referenced by cmd_create_database(), cmd_select_database(), cmd_show(), cmd_yaz_log_file(), cmd_yaz_log_prefix(), and defargint().
|
static |
Definition at line 112 of file zebrash.c.
References defarg().
Referenced by cmd_logf(), cmd_show(), and cmd_yaz_log_level().
int main | ( | int | argc, |
char ** | argv | ||
) |
int onecommand | ( | char * | line, |
WRBUF | outbuff, | ||
const char * | prevout | ||
) |
Definition at line 654 of file zebrash.c.
References cmdstruct::args, cmdstruct::cmd, cmds, log_level, MAX_ARG_LEN, MAX_NO_ARGS, split_args(), and cmdstruct::testfunc.
Referenced by cmd_exchange_record(), cmd_find(), cmd_quickstart(), cmd_quit(), and shell().
|
static |
Definition at line 121 of file zebrash.c.
Referenced by cmd_echo(), cmd_exchange_record(), cmd_find(), cmd_logf(), cmd_record_insert(), cmd_search_pqf(), and cmd_sort().
void shell | ( | void | ) |
Definition at line 771 of file zebrash.c.
References log_level, MAX_ARG_LEN, MAX_OUT_BUFF, onecommand(), PROMPT, and Zerrors().
Referenced by main().
|
static |
|
static |
Definition at line 750 of file zebrash.c.
References log_level, zebra_errAdd(), zebra_errCode(), zebra_errString(), and zh.
Referenced by shell().
struct cmdstruct cmds[] |
Definition at line 473 of file zebrash.c.
Referenced by cmd_help(), and onecommand().
|
static |
Definition at line 67 of file zebrash.c.
Referenced by cmd_zebra_start(), and main().
|
static |
Definition at line 68 of file zebrash.c.
Referenced by cmd_quickstart(), main(), onecommand(), shell(), and Zerrors().
int nextrecno =1 |
Definition at line 66 of file zebrash.c.
Referenced by cmd_find(), and cmd_show().
ZebraHandle zh =0 |
Definition at line 64 of file zebrash.c.
Referenced by bend_delete(), bend_esrequest(), bend_fetch(), bend_init(), bend_scan(), bend_search(), bend_segment(), bend_sort(), check_log_limit(), cmd_begin_trans(), cmd_create_database(), cmd_drop_database(), cmd_end_trans(), cmd_err(), cmd_erradd(), cmd_errcode(), cmd_errstr(), cmd_exchange_record(), cmd_find(), cmd_init(), cmd_quickstart(), cmd_quit(), cmd_record_insert(), cmd_search_pqf(), cmd_select_database(), cmd_show(), cmd_sort(), cmd_zebra_close(), cmd_zebra_open(), delete_SU_handle(), delete_w_all_handle(), delete_w_handle(), es_admin(), es_admin_request(), extract_add_index_string(), extract_add_sort_string(), extract_flush_record_keys2(), extract_flush_sort_keys(), extract_get_fname_tmp(), extract_rec_keys_adjust(), extract_rec_keys_log(), extract_schema_add(), extract_set_store_data_cb(), extract_set_store_data_prepare(), extract_snippet(), extract_token_add(), facet_fetch(), file_update_r(), file_update_top(), fileDelete_r(), freq_term(), get_first_snippet_from_rset(), get_match_from_spec(), grep_info_prepare(), init_extractCtrl(), key_heap_init_file(), logRecord(), main(), map_basenames(), numeric_relation(), numeric_term(), perform_facet(), perform_facet_index(), perform_facet_sort(), print_dict_item(), print_rec_keys(), read_res_for_transaction(), repositoryExtract(), repositoryExtractR(), repositoryShow(), resultSetAdd(), resultSetAddRPN(), resultSetAddTerm(), resultSetClone(), resultSetDestroy(), resultSetGet(), resultSetGetBaseNames(), resultSetInsertRank(), resultSetInsertSort(), resultSetInvalidate(), resultSetRank(), resultSetRef(), resultSetSearch(), resultSetSort(), resultSetSortSingle(), rpn_get_top_approx_limit(), rpn_scan(), rpn_scan_norm(), rpn_search_APT(), rpn_search_APT_and_list(), rpn_search_APT_local(), rpn_search_APT_numeric(), rpn_search_APT_or_list(), rpn_search_APT_phrase(), rpn_search_database(), rpn_search_structure(), rpn_search_top(), rpn_search_xpath(), rset_trunc(), scan_save_set(), search_group(), search_position(), search_term(), search_terms(), search_terms_chrmap(), search_terms_list(), searchRecordKey(), snippet_check_fields(), snippet_fetch(), snippet_token_add(), snippet_xml_record(), sort_fetch(), special_index_fetch(), special_index_xml_record(), string_term(), term_collect_freq(), trans_scan_term(), xpath_trunc(), zapt_term_to_utf8(), zebra_add_record(), zebra_admin_import_begin(), zebra_admin_import_end(), zebra_admin_import_segment(), zebra_admin_shutdown(), zebra_admin_start(), zebra_apt_get_ord(), zebra_attr_list_get_ord(), zebra_auth(), zebra_begin_read(), zebra_begin_trans(), zebra_buffer_extract_record(), zebra_check_handle(), zebra_clean(), zebra_close(), zebra_close_res(), zebra_commit(), zebra_commit_ex(), zebra_compact(), zebra_create_database(), zebra_create_record_stream(), zebra_create_rset_isam(), zebra_deleteResultSet(), zebra_drop_database(), zebra_end_read(), zebra_end_trans(), zebra_end_transaction(), zebra_errAdd(), zebra_errCode(), zebra_errString(), zebra_extract_explain(), zebra_extract_file(), zebra_extract_record_stream(), zebra_extract_records_stream(), zebra_flush_reg(), zebra_get_bfs(), zebra_get_encoding(), zebra_get_rec_snippets(), zebra_get_resource(), zebra_get_shadow_enable(), zebra_get_state(), zebra_index_merge(), zebra_init(), zebra_it_key_str_dump(), zebra_key_control_create(), zebra_log_dict_entry(), zebra_meta_records_create(), zebra_meta_records_create_range(), zebra_meta_records_destroy(), zebra_octet_term_encoding(), zebra_open(), zebra_open_fmatch(), zebra_open_res(), zebra_rec_keys_to_snippets1(), zebra_recid_to_sysno(), zebra_record_check(), zebra_record_encoding(), zebra_record_fetch(), zebra_records_retrieve(), zebra_register_check(), zebra_register_statistics(), zebra_remove_file_match(), zebra_repository_delete(), zebra_repository_index(), zebra_repository_show(), zebra_repository_update(), zebra_result(), zebra_result_recid_to_sysno(), zebra_result_set_term_info(), zebra_result_set_term_no(), zebra_scan(), zebra_scan_PQF(), zebra_search_PQF(), zebra_search_RPN(), zebra_search_RPN_x(), zebra_select_database(), zebra_select_databases(), zebra_select_default_database(), zebra_select_register(), zebra_set_approx_limit(), zebra_set_break_handler(), zebra_set_limit(), zebra_set_partial_result(), zebra_set_resource(), zebra_set_shadow_enable(), zebra_set_state(), zebra_setError(), zebra_setError_zint(), zebra_shadow_enable(), zebra_snippets_hit_vector(), zebra_sort(), zebra_sort_by_specstr(), zebra_sort_get_ord(), zebra_special_fetch(), zebra_start_res(), zebra_string_norm(), zebra_term_untrans(), zebra_term_untrans_iconv(), zebra_term_untrans_iconv2(), zebra_trans_no(), zebra_update_file_match(), zebra_update_from_path(), zebra_update_record(), zebraRankLookup(), and Zerrors().
ZebraService zs =0 |
Definition at line 63 of file zebrash.c.
Referenced by cmd_quickstart(), cmd_quit(), cmd_zebra_open(), cmd_zebra_start(), cmd_zebra_stop(), main(), rpn_get_top_approx_limit(), rpn_search_structure(), rpn_search_top(), show_filters(), zebra_admin_start(), zebra_auth(), zebra_chdir(), zebra_close(), zebra_filter_info(), zebra_open(), zebra_pidfname(), zebra_register_close(), zebra_register_open(), and zebra_stop().