|
YAZ 5.37.0
|
Implements NMEM dup utilities. More...
Go to the source code of this file.
Functions | |
| char * | nmem_strdup (NMEM mem, const char *src) |
| allocates string on NMEM handle (similar strdup) | |
| char * | nmem_strdup_null (NMEM mem, const char *src) |
| allocates string on NMEM handle - allows NULL ptr buffer | |
| char * | nmem_strdupn (NMEM mem, const char *src, size_t n) |
| allocates string of certain size on NMEM handle | |
| nmem_int_t * | nmem_intdup (NMEM mem, nmem_int_t v) |
| allocates and sets integer for NMEM | |
| nmem_bool_t * | nmem_booldup (NMEM mem, nmem_bool_t v) |
| allocates and sets boolean for NMEM | |
| void | nmem_strsplit_blank (NMEM nmem, const char *dstr, char ***darray, int *num) |
| splits string into sub strings delimited by blanks | |
| void | nmem_strsplit (NMEM nmem, const char *delim, const char *dstr, char ***darray, int *num) |
| allocates sub strings out of string using certain delimitors | |
| void | nmem_strsplitx (NMEM nmem, const char *delim, const char *dstr, char ***darray, int *num, int collapse) |
| allocates sub strings out of string using certain delimitors | |
| void | nmem_strsplit_escape (NMEM nmem, const char *delim, const char *dstr, char ***darray, int *num, int collapse, int escape_char) |
| allocates sub strings out of string using certain delimitors | |
| void | nmem_strsplit_escape2 (NMEM nmem, const char *delim, const char *dstr, char ***darray, int *num, int collapse, int escape_char, int subst_escape) |
| allocates sub strings out of string using certain delimitors | |
| char * | nmem_printf (NMEM nmem, const char *fmt,...) |
| formats and prints a string into NMEM allocated memory | |
Implements NMEM dup utilities.
Definition in file nmemsdup.c.
| nmem_bool_t * nmem_booldup | ( | NMEM | nmem, |
| nmem_bool_t | v ) |
allocates and sets boolean for NMEM
| nmem | NMEM handle |
| v | value (0=false, != 0 true) |
Definition at line 49 of file nmemsdup.c.
References nmem_malloc().
Referenced by match_v_next(), and odr_booldup().
| nmem_int_t * nmem_intdup | ( | NMEM | nmem, |
| nmem_int_t | v ) |
allocates and sets integer for NMEM
| nmem | NMEM handle |
| v | integer value |
Definition at line 42 of file nmemsdup.c.
References nmem_malloc().
Referenced by cql_transform_parse_tok_line(), and odr_intdup().
| char * nmem_printf | ( | NMEM | nmem, |
| const char * | fmt, | ||
| ... ) |
formats and prints a string into NMEM allocated memory
| nmem | NMEM handle |
| fmt | printf format string |
The implementation uses an internal buffer of 4096 bytes. This limits the formatted output to at most 4095 characters, plus a terminating null byte. If the formatted output would exceed this size, it is truncated to fit within the buffer.
Definition at line 145 of file nmemsdup.c.
References nmem_strdup(), and yaz_vsnprintf().
Referenced by xml_config_read(), yaz_add_name_value_int(), yaz_sru_get_encode(), z_HTTP_header_add_basic_auth(), and z_HTTP_header_add_content_type().
| char * nmem_strdup | ( | NMEM | mem, |
| const char * | src ) |
allocates string on NMEM handle (similar strdup)
| mem | HNEM handle |
| src | string |
Definition at line 19 of file nmemsdup.c.
References nmem_malloc().
Referenced by add_entry(), append_removed_item(), conf_retrieval(), construct_marc(), construct_one_rdf_lookup(), construct_rdf_lookup(), construct_select(), construct_xslt(), cql_apply_prefix(), cql_node_dup(), cql_node_mk_boolean(), cql_node_mk_sc(), cql_node_mk_sort(), cql_transform_parse_tok_line(), element_attribute_value_extract(), extract_user_pass(), gfs_listen_new(), nmem_printf(), nmem_strdup_null(), odr_strdup(), yaz_get_proposal_charneg(), yaz_get_response_charneg(), yaz_marc_add_comment(), yaz_marc_add_controlfield(), yaz_marc_add_datafield(), yaz_marc_add_datafield_xml(), yaz_match_xsd_string_n_nmem(), yaz_set_esn(), and yyparse().
| char * nmem_strdup_null | ( | NMEM | mem, |
| const char * | src ) |
allocates string on NMEM handle - allows NULL ptr buffer
| mem | HNEM handle |
| src | string |
Definition at line 26 of file nmemsdup.c.
References nmem_strdup().
Referenced by gfs_server_new(), and odr_strdup_null().
| char * nmem_strdupn | ( | NMEM | mem, |
| const char * | src, | ||
| size_t | n ) |
allocates string of certain size on NMEM handle
| mem | NMEM handle |
| src | string |
| n | size of string |
Definition at line 34 of file nmemsdup.c.
References nmem_malloc().
Referenced by extract_user_pass(), nmem_from_xml_buffer(), nmem_strsplit_escape2(), odr_strdupn(), yaz_marc_add_controlfield(), yaz_marc_add_datafield(), yaz_marc_add_leader(), yaz_marc_add_subfield(), and yaz_record_render().
| void nmem_strsplit | ( | NMEM | nmem, |
| const char * | delim, | ||
| const char * | dstr, | ||
| char *** | darray, | ||
| int * | num ) |
allocates sub strings out of string using certain delimitors
| nmem | NMEM handle |
| delim | delimitor chars (splits on each char in there) |
| dstr | string to be split |
| darray | result string array for each sub string |
| num | number of result strings |
Definition at line 62 of file nmemsdup.c.
References nmem_strsplitx().
Referenced by nmem_strsplit_blank(), xml_config_read(), yaz_pqf_parse_facet_list(), yaz_set_proposal_charneg_list(), yaz_solr_sortkeys_to_sort_spec(), and ZOOM_connection_get_databases().
| void nmem_strsplit_blank | ( | NMEM | nmem, |
| const char * | dstr, | ||
| char *** | darray, | ||
| int * | num ) |
splits string into sub strings delimited by blanks
| nmem | NMEM handle |
| dstr | string to be split |
| darray | result string array for each sub string |
| num | number of result strings |
Definition at line 56 of file nmemsdup.c.
References nmem_strsplit().
Referenced by yaz_srw_sortkeys_to_sort_spec().
| void nmem_strsplit_escape | ( | NMEM | nmem, |
| const char * | delim, | ||
| const char * | dstr, | ||
| char *** | darray, | ||
| int * | num, | ||
| int | collapse, | ||
| int | escape_char ) |
allocates sub strings out of string using certain delimitors
| nmem | NMEM handle |
| delim | delimitor chars (splits on each char in there) |
| dstr | string to be split |
| darray | result string array for each sub string |
| num | number of result strings |
| collapse | 1=collapse multiple delims to one; 0=no collapse |
| escape_char | != 0, an escape char (could be ) |
Definition at line 74 of file nmemsdup.c.
References nmem_strsplit_escape2().
Referenced by nmem_strsplitx().
| void nmem_strsplit_escape2 | ( | NMEM | nmem, |
| const char * | delim, | ||
| const char * | dstr, | ||
| char *** | darray, | ||
| int * | num, | ||
| int | collapse, | ||
| int | escape_char, | ||
| int | subst_escape ) |
allocates sub strings out of string using certain delimitors
| nmem | NMEM handle |
| delim | delimitor chars (splits on each char in there) |
| dstr | string to be split |
| darray | result string array for each sub string |
| num | number of result strings |
| collapse | 1=collapse multiple delims to one; 0=no collapse |
| escape_char | != 0, an escape char (could be ) |
| subst_escape | 1=substitute escapes, 0 leave as is |
Definition at line 82 of file nmemsdup.c.
References nmem_malloc(), and nmem_strdupn().
Referenced by nmem_strsplit_escape().
| void nmem_strsplitx | ( | NMEM | nmem, |
| const char * | delim, | ||
| const char * | dstr, | ||
| char *** | darray, | ||
| int * | num, | ||
| int | collapse ) |
allocates sub strings out of string using certain delimitors
| nmem | NMEM handle |
| delim | delimitor chars (splits on each char in there) |
| dstr | string to be split |
| darray | result string array for each sub string |
| num | number of result strings |
| collapse | 1=collapse multiple delims to one; 0=no collapse |
Definition at line 68 of file nmemsdup.c.
References nmem_strsplit_escape().
Referenced by nmem_strsplit(), yaz_solr_sortkeys_to_sort_spec(), and yaz_srw_sortkeys_to_sort_spec().