IDZEBRA  2.1.2
Macros | Typedefs | Functions
util.h File Reference
#include <yaz/yconfig.h>
#include <yaz/log.h>

Go to the source code of this file.

Macros

#define ZEBRA_GCC_ATTR(x)
 
#define ZINT_FORMAT0   "ld"
 
#define ZINT_FORMAT   "%" ZINT_FORMAT0
 
#define ZEBRA_FAIL   -1
 
#define ZEBRA_OK   0
 
#define CAST_ZINT_TO_INT(x)   (int)(x)
 
#define CAST_ZINT_TO_DOUBLE(x)   (double)(x)
 

Typedefs

typedef long zint
 Zebra integer. More...
 
typedef short ZEBRA_RES
 Common return type for Zebra API. More...
 

Functions

zint atoi_zn (const char *buf, zint len)
 
void zebra_zint_encode (char **dst, zint pos)
 
void zebra_zint_decode (const char **src, zint *pos)
 
void zebra_exit (const char *msg)
 
zint atozint (const char *src)
 

Macro Definition Documentation

#define CAST_ZINT_TO_DOUBLE (   x)    (double)(x)

Definition at line 97 of file util.h.

#define CAST_ZINT_TO_INT (   x)    (int)(x)
#define ZEBRA_FAIL   -1

Definition at line 81 of file util.h.

Referenced by bend_esrequest(), bf_cache(), create_schemas(), filter_config(), grep_info_prepare(), main(), numeric_term(), parse_convert(), parse_dom(), parse_input(), rec_close(), rec_delete_single(), rec_flush_shared(), rec_open(), rec_release_blocks(), rec_write_multiple(), rec_write_tmp_buf(), recindex_write_head(), res_get_int(), res_read_file(), res_write_file(), resultSetAddRPN(), resultSetGetBaseNames(), resultSetRank(), resultSetSort(), resultSetSortSingle(), rpn_scan(), rpn_scan_norm(), rpn_search_APT(), rpn_search_APT_and_list(), rpn_search_APT_numeric(), rpn_search_APT_or_list(), rpn_search_APT_phrase(), rpn_search_database(), rpn_search_structure(), search_position(), search_term(), search_terms_chrmap(), string_term(), trans_scan_term(), tst(), tst_res_read_file(), xpath_trunc(), zapt_term_to_utf8(), zebra_admin_import_begin(), zebra_admin_import_segment(), zebra_apt_get_ord(), zebra_attr_list_get_ord(), zebra_auth(), zebra_begin_trans(), zebra_buffer_extract_record(), zebra_check_handle(), zebra_commit_ex(), zebra_compact(), zebra_create_database(), zebra_drop_database(), zebra_end_transaction(), zebra_extract_file(), zebra_extract_record_stream(), zebra_init(), zebra_maps_read_file(), zebra_open_fmatch(), zebra_recid_to_sysno(), zebra_record_check(), zebra_record_fetch(), zebra_records_retrieve(), zebra_register_check(), zebra_register_open(), zebra_remove_file_match(), 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_x(), zebra_select_databases(), zebra_snippets_hit_vector(), zebra_sort(), zebra_sort_get_ord(), zebra_update_file_match(), and zebra_update_record().

#define ZEBRA_GCC_ATTR (   x)

expand GCC_ATTRIBUTE if GCC is in use. See : http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

To see gcc pre-defines for c: gcc -E -dM -x c /dev/null

Definition at line 41 of file util.h.

#define ZEBRA_OK   0

Definition at line 82 of file util.h.

Referenced by bend_esrequest(), bend_fetch(), bend_init(), bend_scan(), bend_search(), bend_sort(), bf_cache(), config_marc(), create_schemas(), dict_open_res(), es_admin_request(), facet_fetch(), file_update_r(), file_update_top(), filter_config(), grep_info_prepare(), grs_config(), grs_config_sgml(), main(), numeric_term(), parse_convert(), parse_dom(), parse_input(), perform_convert(), rec_cache_insert(), rec_close(), rec_del(), rec_delete_single(), rec_flush_shared(), rec_get_int(), rec_open(), rec_put(), rec_release_blocks(), rec_write_multiple(), rec_write_tmp_buf(), recindex_write_head(), recType_byName(), res_get_int(), res_read_file(), res_write_file(), resultSetGetBaseNames(), resultSetRank(), resultSetSearch(), 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(), rpn_sort_spec(), search_position(), search_term(), search_terms_chrmap(), string_term(), trans_scan_term(), tst(), tst_res_read_file(), zapt_term_to_utf8(), zebra_admin_import_segment(), zebra_admin_shutdown(), zebra_admin_start(), zebra_apt_get_ord(), zebra_attr_list_get_ord(), zebra_auth(), zebra_begin_trans(), zebra_check_handle(), zebra_close(), zebra_commit_ex(), zebra_compact(), zebra_create_database(), zebra_drop_database(), zebra_end_transaction(), zebra_extract_explain(), zebra_extract_file(), zebra_extract_record_stream(), zebra_extract_records_stream(), zebra_flush_reg(), zebra_init(), zebra_maps_read_file(), zebra_octet_term_encoding(), zebra_open_fmatch(), 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_open(), zebra_remove_file_match(), zebra_repository_show(), zebra_result_recid_to_sysno(), zebra_result_set_term_info(), zebra_result_set_term_no(), zebra_search_PQF(), zebra_select_databases(), zebra_select_register(), zebra_set_approx_limit(), zebra_set_break_handler(), zebra_set_limit(), zebra_snippets_hit_vector(), zebra_sort_get_ord(), zebra_start_res(), zebra_stop(), zebra_term_limits_APT(), zebra_update_file_match(), zebra_update_from_path(), and zebra_update_record().

#define ZINT_FORMAT   "%" ZINT_FORMAT0

Definition at line 72 of file util.h.

Referenced by begin(), bf_alloc(), bf_xclose(), bf_xopen(), calc(), calc_1(), cf_close(), cf_commit_flat(), cf_moveto_flat(), cf_read(), close_block(), cmd_find(), cmd_record_insert(), cmd_search_pqf(), code_read(), data1_mk_tag_data_zint(), extract_flush_record_keys2(), extract_flush_sort_keys(), extract_token_add(), file_position(), filter_extract(), filter_retrieve(), flush_blocks(), index_block_flush(), index_term(), isamb_close(), isamb_dump_r(), isamb_pp_close_x(), isamb_pp_pos(), isamc_alloc_block(), isamc_merge(), isamc_pp_open(), isamc_read_item(), isamc_release_block(), isamc_write_block(), isamc_write_dblock(), key_logdump_txt(), logRecord(), main(), mf_write(), new_block(), open_block(), perform_facet(), perform_facet_index(), print_rec_keys(), r_read(), rec_prstat(), rec_write_tmp_buf(), recindex_read_indx(), recindex_write_indx(), rect_log_item(), resultSetRank(), resultSetSortSingle(), rset_close(), rset_set_hits_limit(), rset_visit(), set_param_int(), sort_fetch(), sort_term_log_item(), special_index_fetch(), trav_rset_for_termids(), tst(), zebra_end_transaction(), zebra_extract_record_stream(), zebra_get_rec_snippets(), zebra_grs_retrieve(), zebra_index_merge(), zebra_it_key_str_dump(), zebra_limit_filter_cb(), zebra_meta_records_create(), zebra_rec_keys_write(), zebra_record_check(), zebra_record_fetch(), zebra_register_check(), zebra_register_statistics(), zebra_search_PQF(), zebra_setError_zint(), zebra_snippets_hit_vector(), zebra_snippets_log(), zebra_snippets_window(), zebra_special_fetch(), zebra_term_limits_APT(), zebra_update_record(), and zebraExplain_open().

#define ZINT_FORMAT0   "ld"

Definition at line 67 of file util.h.

Referenced by index_block_flush(), print_dict_item(), rec_prstat(), and zebra_register_statistics().

Typedef Documentation

typedef ZEBRA_RES

Common return type for Zebra API.

This return code indicates success with code ZEBRA_OK and failure with ZEBRA_FAIL

Definition at line 80 of file util.h.

Zebra integer.

This integer is used in various Zebra APIs to specify record identifires, number of occurrences etc. It is a "large" integer and is usually 64-bit on newer architectures.

Definition at line 66 of file util.h.

Function Documentation

zint atoi_zn ( const char *  buf,
zint  len 
)
zint atozint ( const char *  src)
void zebra_exit ( const char *  msg)
void zebra_zint_decode ( const char **  src,
zint pos 
)

Definition at line 39 of file zint.c.

Referenced by bf_alloc(), rect_decode(), sort_term_decode1(), and sort_term_decode2().

void zebra_zint_encode ( char **  dst,
zint  pos 
)

Definition at line 26 of file zint.c.

Referenced by bf_free(), rect_encode(), sort_term_encode1(), and sort_term_encode2().