YAZ  5.23.1
Functions
wrbuf.c File Reference

Implements WRBUF (growing buffer) More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>
#include <yaz/wrbuf.h>
#include <yaz/snprintf.h>
#include <yaz/yaz-iconv.h>

Go to the source code of this file.

Functions

WRBUF wrbuf_alloc (void)
 construct WRBUF More...
 
void wrbuf_destroy (WRBUF b)
 destroy WRBUF and its buffer More...
 
void wrbuf_rewind (WRBUF b)
 empty WRBUF content (length of buffer set to 0) More...
 
int wrbuf_grow (WRBUF b, size_t minsize)
 grow WRBUF larger More...
 
void wrbuf_write (WRBUF b, const char *buf, size_t size)
 append constant size buffer to WRBUF More...
 
void wrbuf_insert (WRBUF b, size_t pos, const char *buf, size_t size)
 inserts buffer into WRBUF at some position More...
 
void wrbuf_puts (WRBUF b, const char *buf)
 appends C-string to WRBUF More...
 
void wrbuf_vp_puts (const char *buf, void *client_data)
 appends C-string to WRBUF - void pointer variant More...
 
void wrbuf_puts_replace_char (WRBUF b, const char *buf, const char from, const char to)
 puts buf to WRBUF and replaces a single char More...
 
void wrbuf_puts_replace_str (WRBUF b, const char *buf, const char *from, const char *to)
 puts buf to WRBUF and replaces a string with another More...
 
void wrbuf_chop_right (WRBUF b)
 chips traling blanks away from WRBUF More...
 
void wrbuf_xmlputs (WRBUF b, const char *cp)
 writes C-String to WRBUF and XML encode (as CDATA) More...
 
void wrbuf_xmlputs_n (WRBUF b, const char *cp, size_t size)
 writes buffer of certain size to WRBUF and XML encode (as CDATA) More...
 
void wrbuf_printf (WRBUF b, const char *fmt,...)
 writes printf result to WRBUF More...
 
int wrbuf_iconv_write2 (WRBUF b, yaz_iconv_t cd, const char *buf, size_t size, void(*wfunc)(WRBUF, const char *, size_t))
 General writer of string using iconv and cdata. More...
 
int wrbuf_iconv_write_x (WRBUF b, yaz_iconv_t cd, const char *buf, size_t size, int cdata)
 writer of string using iconv and cdata More...
 
void wrbuf_iconv_write (WRBUF b, yaz_iconv_t cd, const char *buf, size_t size)
 Converts buffer using iconv and appends to WRBUF. More...
 
void wrbuf_iconv_puts (WRBUF b, yaz_iconv_t cd, const char *strz)
 iconv converts C-string and appends to WRBUF More...
 
void wrbuf_iconv_putchar (WRBUF b, yaz_iconv_t cd, int ch)
 iconv converts character and appends to WRBUF More...
 
void wrbuf_iconv_write_cdata (WRBUF b, yaz_iconv_t cd, const char *buf, size_t size)
 Converts buffer using iconv and appends to WRBUF as XML CDATA. More...
 
void wrbuf_iconv_puts_cdata (WRBUF b, yaz_iconv_t cd, const char *strz)
 iconv converts C-string and appends to WRBUF as XML CDATA More...
 
void wrbuf_iconv_json_write (WRBUF b, yaz_iconv_t cd, const char *buf, size_t size)
 
void wrbuf_iconv_json_puts (WRBUF b, yaz_iconv_t cd, const char *strz)
 
void wrbuf_iconv_reset (WRBUF b, yaz_iconv_t cd)
 iconv reset(flush) to WRBUF More...
 
const char * wrbuf_cstr (WRBUF b)
 returns WRBUF content as C-string More...
 
const char * wrbuf_cstr_null (WRBUF b)
 returns WRBUF content as C-string or NULL More...
 
void wrbuf_cut_right (WRBUF b, size_t no_to_remove)
 cut size of WRBUF More...
 
void wrbuf_puts_escaped (WRBUF b, const char *str)
 writes C-string to WRBUF and escape non-ASCII characters More...
 
void wrbuf_write_escaped (WRBUF b, const char *str, size_t len)
 writes buffer to WRBUF and escape non-ASCII characters More...
 
void wrbuf_json_write (WRBUF b, const char *cp, size_t sz)
 writes JSON text to WRBUF with escaping More...
 
void wrbuf_json_puts (WRBUF b, const char *str)
 writes JSON text to WRBUF with escaping More...
 

Detailed Description

Implements WRBUF (growing buffer)

Definition in file wrbuf.c.

Function Documentation

WRBUF wrbuf_alloc ( void  )

construct WRBUF

Returns
WRBUF

Definition at line 25 of file wrbuf.c.

References wrbuf::buf, wrbuf::pos, wrbuf::size, wrbuf_grow(), and xmalloc.

Referenced by add_marc_datafield_turbo_xml(), bibliographicRecord(), ccl_pr_tree(), ccl_rpn_query(), ccl_scan_query(), ccl_xml_config(), config_include_src(), convert_solrmarc(), cql2pqf(), cql_transform(), cql_transform_create(), cql_transform_parse_tok_line(), cql_transform_rpn2cql_stream(), dummy_json_record(), dummy_xml_record(), echo_extra_args(), get_facet_term_count(), get_term_hit(), process_deleteRequest(), process_ESRequest(), process_initRequest(), process_presentRequest(), process_scanRequest(), process_sortRequest(), rdf_lookup_debug_comment(), rdf_lookup_node(), replace_node(), response_searchRequest(), retrieve_fetch(), solr_transform_rpn2solr_stream(), srw_bend_scan(), srw_bend_search(), xml_config_open(), yaz_marc_create(), yaz_marc_read_iso2709(), yaz_marc_read_json_node(), yaz_marc_read_line(), yaz_marc_write_iso2709(), yaz_marc_write_xml(), yaz_marc_write_xml_turbo_xml(), yaz_query_charset_convert_apt(), yaz_query_charset_convert_rpnquery(), yaz_query_charset_convert_rpnquery_check(), yaz_record_conv_create(), yaz_record_conv_opac_record(), yaz_retrieval_create(), yaz_sc_program(), yaz_solr_decode_spellcheck(), yaz_solr_encode_facet_field(), yaz_sru_facet_request(), yaz_sru_proxy_get_facet_term_count(), yaz_tok_parse_create(), yaz_url_create(), ZOOM_connection_connect(), ZOOM_connection_option_set(), ZOOM_memcached_add(), ZOOM_memcached_lookup(), ZOOM_memcached_resultset(), ZOOM_query_ccl2rpn(), ZOOM_query_create(), ZOOM_record_get(), and ZOOM_resultset_create().

void wrbuf_chop_right ( WRBUF  b)

chips traling blanks away from WRBUF

Parameters
bWRBUF

Definition at line 130 of file wrbuf.c.

References wrbuf::buf, and wrbuf::pos.

Referenced by yaz_rpnquery_to_wrbuf().

const char* wrbuf_cstr ( WRBUF  b)

returns WRBUF content as C-string

Parameters
bWRBUF (may not be NULL)
Returns
C-string

Definition at line 281 of file wrbuf.c.

References wrbuf::buf, wrbuf::pos, and wrbuf::size.

Referenced by add_marc_datafield_turbo_xml(), base64_render(), ccl_pr_tree(), ccl_rpn_query(), ccl_scan_query(), ccl_xml_config_qual(), config_include_src(), cql2pqf(), cql_transform(), cql_transform_error(), cql_transform_parse_tok_line(), cql_transform_rpn2cql_stream(), dummy_json_record(), dummy_xml_record(), echo_extra_args(), generate(), get_facet_term_count(), get_record_format(), get_term_hit(), insert_field(), log_warn(), parse_field(), process_deleteRequest(), process_ESRequest(), process_initRequest(), process_presentRequest(), process_scanRequest(), process_sortRequest(), rdf_lookup_debug_comment(), rdf_lookup_node(), response_searchRequest(), return_marc_record(), return_opac_record(), return_string_record(), rpn2cql_simple(), rpn2solr_simple(), solr_transform_rpn2solr_stream(), srw_bend_scan(), srw_bend_search(), xml_config_open(), yaz_marc_decode_buf(), yaz_marc_read_iso2709(), yaz_marc_read_line(), yaz_marc_write_xml(), yaz_marc_write_xml_turbo_xml(), yaz_record_conv_get_error(), yaz_retrieval_get_error(), yaz_sc_program(), yaz_solr_decode_spellcheck(), yaz_solr_encode_facet_field(), yaz_sru_facet_request(), yaz_sru_proxy_get_facet_term_count(), yaz_tok_parse_string(), yaz_url_get_error(), ZOOM_connection_connect(), ZOOM_connection_option_get(), ZOOM_connection_option_getl(), ZOOM_memcached_add(), ZOOM_memcached_hitcount(), ZOOM_memcached_lookup(), ZOOM_memcached_resultset(), ZOOM_memcached_search(), ZOOM_query_ccl2rpn(), ZOOM_query_get_query_string(), and ZOOM_query_get_sru11().

const char* wrbuf_cstr_null ( WRBUF  b)

returns WRBUF content as C-string or NULL

Parameters
bWRBUF
Returns
C-string or NULL

This function returns NULL if either b is NULL or length of buffer is 0

Definition at line 288 of file wrbuf.c.

References wrbuf::buf, wrbuf::pos, and wrbuf::size.

void wrbuf_cut_right ( WRBUF  b,
size_t  no_to_remove 
)

cut size of WRBUF

Parameters
bWRBUF
no_to_removenumber of bytes to remove

Definition at line 297 of file wrbuf.c.

References wrbuf::pos.

Referenced by yaz_marc_line_gets(), and yaz_sru_facet_request().

void wrbuf_destroy ( WRBUF  b)

destroy WRBUF and its buffer

Parameters
bWRBUF

For YAZ 4.0.2 WRBUF b may be NULL.

Definition at line 38 of file wrbuf.c.

References wrbuf::buf, and xfree.

Referenced by add_marc_datafield_turbo_xml(), bibliographicRecord(), ccl_pr_tree(), ccl_rpn_query(), ccl_scan_query(), ccl_xml_config(), config_include_src(), convert_solrmarc(), cql2pqf(), cql_transform(), cql_transform_close(), cql_transform_parse_tok_line(), cql_transform_rpn2cql_stream(), dummy_json_record(), dummy_xml_record(), echo_extra_args(), get_facet_term_count(), get_term_hit(), process_deleteRequest(), process_ESRequest(), process_initRequest(), process_presentRequest(), process_scanRequest(), process_sortRequest(), rdf_lookup_debug_comment(), rdf_lookup_node(), replace_node(), response_searchRequest(), resultset_destroy(), retrieve_fetch(), solr_transform_rpn2solr_stream(), srw_bend_scan(), srw_bend_search(), xml_config_open(), yaz_marc_destroy(), yaz_marc_read_iso2709(), yaz_marc_read_json_node(), yaz_marc_read_line(), yaz_marc_write_iso2709(), yaz_marc_write_xml(), yaz_marc_write_xml_turbo_xml(), yaz_query_charset_convert_apt(), yaz_query_charset_convert_rpnquery(), yaz_query_charset_convert_rpnquery_check(), yaz_record_conv_destroy(), yaz_record_conv_opac_record(), yaz_retrieval_destroy(), yaz_sc_program(), yaz_solr_encode_facet_field(), yaz_sru_facet_request(), yaz_sru_proxy_get_facet_term_count(), yaz_tok_parse_destroy(), yaz_url_destroy(), ZOOM_connection_connect(), ZOOM_connection_destroy(), ZOOM_connection_option_set(), ZOOM_memcached_add(), ZOOM_memcached_lookup(), ZOOM_memcached_resultset(), ZOOM_query_ccl2rpn(), ZOOM_query_destroy(), and ZOOM_record_release().

int wrbuf_grow ( WRBUF  b,
size_t  minsize 
)

grow WRBUF larger

Parameters
bWRBUF
minsizemake WRBUF at least this size

This function is normally not used by applications

Definition at line 52 of file wrbuf.c.

References wrbuf::buf, wrbuf::size, and xrealloc.

Referenced by wrbuf_alloc(), wrbuf_insert(), and wrbuf_write().

void wrbuf_iconv_json_puts ( WRBUF  b,
yaz_iconv_t  cd,
const char *  strz 
)

Definition at line 263 of file wrbuf.c.

References wrbuf_iconv_write2(), and wrbuf_json_write().

Referenced by yaz_marc_write_json().

void wrbuf_iconv_json_write ( WRBUF  b,
yaz_iconv_t  cd,
const char *  buf,
size_t  size 
)

Definition at line 257 of file wrbuf.c.

References wrbuf_iconv_write2(), and wrbuf_json_write().

Referenced by yaz_marc_write_json().

void wrbuf_iconv_putchar ( WRBUF  b,
yaz_iconv_t  cd,
int  ch 
)

iconv converts character and appends to WRBUF

Parameters
bWRBUF
cdiconv handle
chcharacter

Definition at line 240 of file wrbuf.c.

References wrbuf_iconv_write().

Referenced by yaz_marc_write_iso2709().

void wrbuf_iconv_puts ( WRBUF  b,
yaz_iconv_t  cd,
const char *  str 
)

iconv converts C-string and appends to WRBUF

Parameters
bWRBUF
cdiconv handle
strC-string

Definition at line 235 of file wrbuf.c.

References wrbuf_iconv_write().

Referenced by add_marc_datafield_turbo_xml(), yaz_marc_write_iso2709(), yaz_marc_write_line(), yaz_marc_write_marcxml_wrbuf(), yaz_marc_write_xml(), and yaz_marc_write_xml_turbo_xml().

void wrbuf_iconv_puts_cdata ( WRBUF  b,
yaz_iconv_t  cd,
const char *  str 
)

iconv converts C-string and appends to WRBUF as XML CDATA

Parameters
bWRBUF
cdiconv handle
strC-string

Definition at line 252 of file wrbuf.c.

References wrbuf_iconv_write2(), and wrbuf_xmlputs_n().

void wrbuf_iconv_reset ( WRBUF  b,
yaz_iconv_t  cd 
)

iconv reset(flush) to WRBUF

Parameters
b
cdiconv handle

This function calls iconv(cd, 0, 0, ..) to make it flush any remaining content.

Definition at line 268 of file wrbuf.c.

References wrbuf_write(), and yaz_iconv().

Referenced by marc_iconv_reset(), return_string_record(), and yaz_query_charset_convert_buf().

void wrbuf_iconv_write ( WRBUF  b,
yaz_iconv_t  cd,
const char *  buf,
size_t  size 
)

Converts buffer using iconv and appends to WRBUF.

Parameters
bWRBUF
cdiconv handle
bufbuffer
sizesize of buffer

Definition at line 230 of file wrbuf.c.

References wrbuf_iconv_write2(), and wrbuf_write().

Referenced by add_marc_datafield_turbo_xml(), return_string_record(), wrbuf_iconv_putchar(), wrbuf_iconv_puts(), yaz_marc_write_check(), yaz_marc_write_line(), yaz_marc_write_xml(), and yaz_query_charset_convert_buf().

int wrbuf_iconv_write2 ( WRBUF  b,
yaz_iconv_t  cd,
const char *  buf,
size_t  size,
void(*)(WRBUF, const char *, size_t)  wfunc 
)

General writer of string using iconv and cdata.

Parameters
bWRBUF
cdiconv handle (0 for no conversion)
bufbuffer
sizesize of buffer
wfuncwrite handler (that takes WRBUF only)
Returns
-1 if invalid sequence was encountered (truncation in effect)
0 if buffer could be converted and written

Definition at line 190 of file wrbuf.c.

References yaz_iconv(), YAZ_ICONV_E2BIG, and yaz_iconv_error().

Referenced by opac_element_str(), wrbuf_iconv_json_puts(), wrbuf_iconv_json_write(), wrbuf_iconv_puts_cdata(), wrbuf_iconv_write(), wrbuf_iconv_write_cdata(), and wrbuf_iconv_write_x().

void wrbuf_iconv_write_cdata ( WRBUF  b,
yaz_iconv_t  cd,
const char *  buf,
size_t  size 
)

Converts buffer using iconv and appends to WRBUF as XML CDATA.

Parameters
bWRBUF
cdiconv handle
bufbuffer
sizesize of buffer

Definition at line 247 of file wrbuf.c.

References wrbuf_iconv_write2(), and wrbuf_xmlputs_n().

Referenced by element_name_append_attribute_value(), and yaz_marc_write_marcxml_wrbuf().

int wrbuf_iconv_write_x ( WRBUF  b,
yaz_iconv_t  cd,
const char *  buf,
size_t  size,
int  cdata 
)

writer of string using iconv and cdata

Obsolete: use wrbuf_iconv_write2 instead.

Parameters
bWRBUF
cdiconv handle (0 for no conversion)
bufbuffer
sizesize of buffer
cdatanon-zero for CDATA; 0 for cdata
Returns
-1 if invalid sequence was encountered (truncation in effect)
0 if buffer could be converted and written

Definition at line 223 of file wrbuf.c.

References wrbuf_iconv_write2(), wrbuf_write(), and wrbuf_xmlputs_n().

void wrbuf_insert ( WRBUF  b,
size_t  pos,
const char *  buf,
size_t  size 
)

inserts buffer into WRBUF at some position

Parameters
bWRBUF
posposition (0=beginning)
bufbuffer
sizesize of buffer

Definition at line 78 of file wrbuf.c.

References wrbuf::buf, wrbuf::pos, wrbuf::size, and wrbuf_grow().

Referenced by insert_field(), yaz_sort_spec_to_type7(), and yaz_sru_facet_request().

void wrbuf_json_puts ( WRBUF  b,
const char *  str 
)

writes JSON text to WRBUF with escaping

Parameters
bresult
strinput string to be encoded

Definition at line 354 of file wrbuf.c.

References wrbuf_json_write().

Referenced by json_write_wrbuf_r(), and yaz_marc_write_json().

void wrbuf_json_write ( WRBUF  b,
const char *  cp,
size_t  sz 
)

writes JSON text to WRBUF with escaping

Parameters
bresult
cpchar buffer
szsize of char buffer

Definition at line 319 of file wrbuf.c.

References wrbuf_printf(), and wrbuf_putc.

Referenced by wrbuf_iconv_json_puts(), wrbuf_iconv_json_write(), wrbuf_json_puts(), and yaz_marc_write_json().

void wrbuf_printf ( WRBUF  b,
const char *  fmt,
  ... 
)

writes printf result to WRBUF

Parameters
bWRBUF
fmtprintf-like format

Definition at line 178 of file wrbuf.c.

References wrbuf_puts(), and yaz_vsnprintf().

Referenced by ccl_pquery_complex(), ccl_xml_config_attr(), ccl_xml_config_combqual(), ccl_xml_config_qual(), conf_dir_path(), conf_retrieval(), config_include_src(), construct_marc(), construct_one_rdf_lookup(), construct_rdf_lookup(), construct_select(), construct_xslt(), convert_marc(), convert_rdf_lookup(), convert_select(), convert_xslt(), display_grs1(), display_variant(), dummy_xml_record(), element_name_append_attribute_value(), emit_term(), json_write_wrbuf_r(), process_deleteRequest(), process_initRequest(), process_presentRequest(), process_scanRequest(), process_sortRequest(), rdf_lookup_debug_comment(), rdf_lookup_node(), response_searchRequest(), rpn2cql_attr(), rpn2cql_simple(), srw_bend_scan(), srw_bend_search(), wr_diag(), wrbuf_diags(), wrbuf_json_write(), wrbuf_sha1_write(), wrbuf_write_escaped(), yaz_apt_to_wrbuf(), yaz_attribute_element_to_wrbuf(), yaz_marc_write_iso2709(), yaz_marc_write_json(), yaz_marc_write_line(), yaz_marc_write_marcxml_wrbuf(), yaz_marc_write_trailer(), yaz_query_to_wrbuf(), yaz_record_conv_configure_t(), yaz_retrieval_configure_t(), yaz_retrieval_request(), yaz_rpnquery_to_wrbuf(), yaz_rpnstructure_to_wrbuf(), yaz_solr_decode_misspelled(), yaz_solr_encode_facet_field(), yaz_sort_spec_to_type7(), yaz_spipe_create(), yaz_sru_facet_request(), yaz_url_exec(), ZOOM_connection_connect(), ZOOM_memcached_add(), ZOOM_memcached_lookup(), and ZOOM_query_get_hash().

void wrbuf_puts ( WRBUF  b,
const char *  buf 
)

appends C-string to WRBUF

Parameters
bWRBUF
bufC-string (0-terminated)

Definition at line 89 of file wrbuf.c.

References wrbuf_write().

Referenced by add_marc_datafield_turbo_xml(), ccl_pquery_complex(), ccl_pquery_indent(), conf_dir_path(), convert_select(), cql_pr_attr_uri(), cql_pr_prox(), cql_transform_parse_tok_line(), cql_transform_set_error(), display_grs1(), echo_extra_args(), emit_node(), emit_term(), extract_text_node(), generate(), get_facet_term_count(), insert_field(), json_write_wrbuf_r(), opac_element_bool(), opac_element_str(), parse_field(), parse_subfields(), process_scanRequest(), process_sortRequest(), rdf_lookup_debug_comment(), response_searchRequest(), rpn2cql_attr(), rpn2cql_simple(), rpn2solr_attr(), rpn2solr_simple(), wr_diag(), wrbuf_diags(), wrbuf_printf(), wrbuf_puts_replace_str(), wrbuf_vary_puts(), wrbuf_vp_puts(), wrbuf_xmlputs_n(), yaz_apt_to_wrbuf(), yaz_attribute_element_to_wrbuf(), yaz_facet_list_to_wrbuf(), yaz_marc_line_gets(), yaz_marc_read_iso2709(), yaz_marc_write_check(), yaz_marc_write_iso2709(), yaz_marc_write_json(), yaz_marc_write_line(), yaz_marc_write_marcxml_ns(), yaz_marc_write_marcxml_wrbuf(), yaz_opac_decode_wrbuf2(), yaz_query_to_wrbuf(), yaz_record_conv_opac_record(), yaz_rpnstructure_to_wrbuf(), yaz_sc_program(), yaz_scan_to_wrbuf(), yaz_solr_decode_misspelled(), yaz_solr_decode_spellcheck(), yaz_solr_decode_suggestion_values(), yaz_solr_sortkeys_to_sort_spec(), yaz_sort_spec_to_cql(), yaz_sort_spec_to_solr_sortkeys(), yaz_sort_spec_to_srw_sortkeys(), yaz_sort_spec_to_type7(), yaz_sru_facet_request(), yaz_sru_proxy_get_facet_term_count(), yaz_srw_sortkeys_to_sort_spec(), ZOOM_memcached_resultset(), and ZOOM_query_get_hash().

void wrbuf_puts_escaped ( WRBUF  b,
const char *  str 
)

writes C-string to WRBUF and escape non-ASCII characters

Parameters
bWRBUF
strC-string

Non-ASCII characters will be presented as \xDD .

Definition at line 304 of file wrbuf.c.

References wrbuf_write_escaped().

void wrbuf_puts_replace_char ( WRBUF  b,
const char *  buf,
const char  from,
const char  to 
)

puts buf to WRBUF and replaces a single char

Parameters
bWRBUF
bufbuffer to append (C-string)
fromcharacter "from"
tocharcter "to"

Definition at line 100 of file wrbuf.c.

References wrbuf_putc.

Referenced by wr_diag().

void wrbuf_puts_replace_str ( WRBUF  b,
const char *  buf,
const char *  from,
const char *  to 
)

puts buf to WRBUF and replaces a string with another

Parameters
bWRBUF
bufbuffer to append (C-string)
frompattern string
toreplacement string

Definition at line 113 of file wrbuf.c.

References wrbuf_puts(), and wrbuf_write().

Referenced by rdf_lookup_debug_comment().

void wrbuf_rewind ( WRBUF  b)
void wrbuf_vp_puts ( const char *  buf,
void *  client_data 
)

appends C-string to WRBUF - void pointer variant

Parameters
bufC-string
client_dataassumed WRBUF

Definition at line 94 of file wrbuf.c.

References wrbuf_puts().

Referenced by cql2pqf(), cql_transform_rpn2cql_wrbuf(), and solr_transform_rpn2solr_wrbuf().

void wrbuf_write ( WRBUF  b,
const char *  buf,
size_t  size 
)
void wrbuf_write_escaped ( WRBUF  b,
const char *  buf,
size_t  len 
)

writes buffer to WRBUF and escape non-ASCII characters

Parameters
bWRBUF
bufbuffer
lensize of buffer

Non-ASCII characters will be presented as \xDD .

Definition at line 309 of file wrbuf.c.

References wrbuf_printf(), and wrbuf_putc.

Referenced by wrbuf_puts_escaped(), and yaz_marc_read_iso2709().

void wrbuf_xmlputs ( WRBUF  b,
const char *  cp 
)

writes C-String to WRBUF and XML encode (as CDATA)

Parameters
bWRBUF
cpCDATA buffer (0-terminated)

Definition at line 138 of file wrbuf.c.

References wrbuf_xmlputs_n().

Referenced by echo_extra_args().

void wrbuf_xmlputs_n ( WRBUF  b,
const char *  cp,
size_t  size 
)

writes buffer of certain size to WRBUF and XML encode (as CDATA)

Parameters
bWRBUF
cpCDATA
sizesize of CDATA

Definition at line 143 of file wrbuf.c.

References wrbuf_putc, and wrbuf_puts().

Referenced by opac_element_str(), wrbuf_iconv_puts_cdata(), wrbuf_iconv_write_cdata(), wrbuf_iconv_write_x(), and wrbuf_xmlputs().