Home | History | Annotate | Download | only in libxml2

Lines Matching refs:buffer

173     "Inappropriate message buffer length",/* EMSGSIZE */
201 "buffer full",
800 * @buffer: where to drop data
803 * Read @len bytes to @buffer from the I/O channel.
808 xmlFdRead (void * context, char * buffer, int len) {
811 ret = read((int) (long) context, &buffer[0], len);
820 * @buffer: where to get data
823 * Write @len bytes from @buffer to the I/O channel.
828 xmlFdWrite (void * context, const char * buffer, int len) {
832 ret = write((int) (long) context, &buffer[0], len);
1004 * @buffer: where to drop data
1007 * Read @len bytes to @buffer from the I/O channel.
1012 xmlFileRead (void * context, char * buffer, int len) {
1014 if ((context == NULL) || (buffer == NULL))
1016 ret = fread(&buffer[0], 1, len, (FILE *) context);
1025 * @buffer: where to drop data
1028 * Write @len bytes from @buffer to the I/O channel.
1033 xmlFileWrite (void * context, const char * buffer, int len) {
1036 if ((context == NULL) || (buffer == NULL))
1038 items = fwrite(&buffer[0], len, 1, (FILE *) context);
1099 * @buffer: the data to write
1102 * Write @len bytes from @buffer to the xml buffer
1107 xmlBufferWrite (void * context, const char * buffer, int len) {
1110 ret = xmlBufferAdd((xmlBufferPtr) context, (const xmlChar *) buffer, len);
1259 * @buffer: where to drop data
1262 * Read @len bytes to @buffer from the compressed I/O channel.
1267 xmlGzfileRead (void * context, char * buffer, int len) {
1270 ret = gzread((gzFile) context, &buffer[0], len);
1279 * @buffer: where to drop data
1282 * Write @len bytes from @buffer to the compressed I/O channel.
1287 xmlGzfileWrite (void * context, const char * buffer, int len) {
1290 ret = gzwrite((gzFile) context, (char *) &buffer[0], len);
1399 * @buffer: where to drop data
1402 * Read @len bytes to @buffer from the compressed I/O channel.
1407 xmlXzfileRead (void * context, char * buffer, int len) {
1410 ret = __libxml2_xzread((xzFile) context, &buffer[0], len);
1476 * @buff: Compressed memory buffer
1480 * memory buffer.
1509 * @buff: The memory buffer context to clear
1511 * Release all the resources associated with the compressed memory buffer.
1542 * Create a memory buffer to hold the compressed XML document. The
1562 xmlIOErrMemory("creating buffer context");
1571 xmlIOErrMemory("creating buffer");
1603 * @buff: Buffer used to compress and consolidate data.
1604 * @ext_amt: Number of bytes to extend the buffer.
1606 * Extend the internal buffer used to store the compressed data by the
1609 * Returns 0 on success or -1 on failure to extend the buffer. On failure
1610 * the original buffer still exists at the original size.
1634 "Buffer overwrite detected during compressed memory",
1635 "buffer extension. Overflowed by",
1651 "Allocation failure extending output buffer to",
1661 * @buff: Buffer used to compress and consolidate data
1662 * @src: Uncompressed source content to append to buffer
1663 * @len: Length of source data to append to buffer
1665 * Compress and append data to the internal buffer. The data buffer
1668 * Returns the number of bytes appended to the buffer or -1 on error.
1683 ** Extend the buffer prior to deflate call if a reasonable amount
1684 ** of output buffer space is not available.
1698 len, "bytes to buffer. ZLIB error", z_err );
1711 * @buff: Compressed memory content buffer
1735 /* In this case Z_OK means more buffer space needed */
1847 * Open a temporary buffer to collect the document for a subsequent HTTP POST
1848 * request. Non-static as is called from the output buffer creation routine.
1879 * ** need to put the document into a buffer. A memory buffer
1925 * @buffer: where to drop data
1928 * Read @len bytes to @buffer from the I/O channel.
1933 xmlIOHTTPRead(void * context, char * buffer, int len) {
1934 if ((buffer == NULL) || (len < 0)) return(-1);
1935 return(xmlNanoHTTPRead(context, &buffer[0], len));
1942 * @buffer: data to output to temporary buffer
1945 * Collect data from memory buffer into a temporary file for later
1952 xmlIOHTTPWrite( void * context, const char * buffer, int len ) {
1956 if ( ( ctxt == NULL ) || ( ctxt->doc_buff == NULL ) || ( buffer == NULL ) )
1965 len = xmlZMemBuffAppend( ctxt->doc_buff, buffer, len );
1969 len = xmlOutputBufferWrite( ctxt->doc_buff, len, buffer );
1975 "Error appending to internal buffer.",
2025 /* Retrieve the content from the appropriate buffer */
2036 /* Pull the data out of the memory output buffer */
2039 http_content = (char *)dctxt->buffer->content;
2040 content_lgth = dctxt->buffer->use;
2063 char buffer[ 4096 ];
2080 (void)snprintf( buffer, sizeof(buffer), "%s.content", dump_name );
2082 tst_file = fopen( buffer, "wb" );
2085 "Transmitted content saved in file: %s\n", buffer );
2092 (void)snprintf( buffer, sizeof(buffer), "%s.reply", dump_name );
2093 tst_file = fopen( buffer, "wb" );
2096 "Reply content saved in file: %s\n", buffer );
2100 buffer, sizeof( buffer ) )) > 0 ) {
2102 fwrite( buffer, sizeof( char ), avail, tst_file );
2204 * @buffer: where to drop data
2207 * Read @len bytes to @buffer from the I/O channel.
2212 xmlIOFTPRead(void * context, char * buffer, int len) {
2213 if ((buffer == NULL) || (len < 0)) return(-1);
2214 return(xmlNanoFTPRead(context, &buffer[0], len));
2403 xmlIOErrMemory("creating input buffer");
2407 ret->buffer = xmlBufferCreateSize(2 * xmlDefaultBufferSize);
2408 if (ret->buffer == NULL) {
2412 ret->buffer->alloc = XML_BUFFER_ALLOC_DOUBLEIT;
2442 xmlIOErrMemory("creating output buffer");
2446 ret->buffer = xmlBufferCreate();
2447 if (ret->buffer == NULL) {
2453 if (ret->buffer->alloc == XML_BUFFER_ALLOC_EXACT)
2454 ret->buffer->alloc = XML_BUFFER_ALLOC_DOUBLEIT;
2492 xmlIOErrMemory("creating output buffer");
2496 ret->buffer = xmlBufferCreate();
2497 if (ret->buffer == NULL) {
2508 ret->buffer->alloc = XML_BUFFER_ALLOC_IO;
2509 ret->buffer->contentIO = ret->buffer->content;
2555 if (in->buffer != NULL) {
2556 xmlBufferFree(in->buffer);
2557 in->buffer = NULL;
2594 if (out->buffer != NULL) {
2595 xmlBufferFree(out->buffer);
2596 out->buffer = NULL;
2637 * Allocate the Input buffer front-end.
2805 * Allocate the Output buffer front-end.
2903 * @buffer: a xmlBufferPtr
2911 xmlOutputBufferCreateBuffer(xmlBufferPtr buffer,
2915 if (buffer == NULL) return(NULL);
2920 NULL, (void *) buffer, encoder);
2977 errcode = xmlBufferAdd(ret->buffer, (const xmlChar *) mem, size);
2995 * the buffer, but the memory is expected to be available until the end of
3010 xmlIOErrMemory("creating input buffer");
3014 ret->buffer = xmlBufferCreateStatic((void *)mem, (size_t) size);
3015 if (ret->buffer == NULL) {
3168 * Push the content of the arry in the input buffer
3172 * Returns the number of chars read and stored in the buffer, or -1
3187 * Store the data in the incoming raw buffer
3197 * convert as much as possible to the parser reading buffer.
3200 nbchars = xmlCharEncInFunc(in->encoder, in->buffer, in->raw);
3209 ret = xmlBufferAdd(in->buffer, (xmlChar *) buf, nbchars);
3215 "I/O: pushed %d chars, buffer %d/%d\n",
3216 nbchars, in->buffer->use, in->buffer->size);
3229 char * buffer ATTRIBUTE_UNUSED,
3239 * Grow up the content of the input buffer, the old data are preserved
3244 * onto in->buffer or in->raw
3246 * Returns the number of chars read and stored in the buffer, or -1
3251 char *buffer = NULL;
3261 buffree = in->buffer->size - in->buffer->use;
3268 needSize = in->buffer->use + len + 1;
3269 if (needSize > in->buffer->size){
3270 if (!xmlBufferResize(in->buffer, needSize)){
3271 xmlIOErrMemory("growing input buffer");
3276 buffer = (char *)&in->buffer->content[in->buffer->use];
3282 res = in->readcallback(in->context, &buffer[0], len);
3298 * Store the data in the incoming raw buffer
3303 res = xmlBufferAdd(in->raw, (const xmlChar *) buffer, len);
3308 * convert as much as possible to the parser reading buffer.
3311 nbchars = xmlCharEncInFunc(in->encoder, in->buffer, in->raw);
3320 in->buffer->use += nbchars;
3321 buffer[nbchars] = 0;
3325 "I/O: read %d chars, buffer %d/%d\n",
3326 nbchars, in->buffer->use, in->buffer->size);
3336 * Refresh the content of the input buffer, the old data are considered
3340 * Returns the number of chars read and stored in the buffer, or -1
3348 else if ((in->buffer != NULL) &&
3349 (in->buffer->alloc == XML_BUFFER_ALLOC_IMMUTABLE))
3362 * Write the content of the array in the output I/O buffer
3364 * The buffer is lossless, i.e. will store in case of partial
3391 * Store the data in the incoming raw buffer
3396 ret = xmlBufferAdd(out->buffer, (const xmlChar *) buf, chunk);
3400 if ((out->buffer->use < MINLEN) && (chunk == len))
3404 * convert as much as possible to the parser reading buffer.
3406 ret = xmlCharEncOutFunc(out->encoder, out->conv, out->buffer);
3414 ret = xmlBufferAdd(out->buffer, (const xmlChar *) buf, chunk);
3417 nbchars = out->buffer->use;
3436 (const char *)out->buffer->content, nbchars);
3438 xmlBufferShrink(out->buffer, ret);
3524 * Write the content of the string in the output I/O buffer
3527 * The buffer is lossless, i.e. will store in case of partial
3545 (out->buffer == NULL) ||
3546 (out->buffer->alloc == XML_BUFFER_ALLOC_IMMUTABLE)) return(-1);
3559 chunk = (out->buffer->size - out->buffer->use) - 1;
3566 if (xmlBufferGrow(out->buffer, out->buffer->size + 100) < 0)
3577 * Store the data in the incoming raw buffer
3582 ret = escaping(out->buffer->content + out->buffer->use ,
3586 out->buffer->use += chunk;
3587 out->buffer->content[out->buffer->use] = 0;
3589 if ((out->buffer->use < MINLEN) && (cons == len))
3593 * convert as much as possible to the output buffer.
3595 ret = xmlCharEncOutFunc(out->encoder, out->conv, out->buffer);
3603 ret = escaping(out->buffer->content + out->buffer->use ,
3607 out->buffer->use += chunk;
3608 out->buffer->content[out->buffer->use] = 0;
3609 nbchars = out->buffer->use;
3628 (const char *)out->buffer->content, nbchars);
3630 xmlBufferShrink(out->buffer, ret);
3638 } else if (out->buffer->size - out->buffer->use < MINLEN) {
3639 xmlBufferResize(out->buffer, out->buffer->size + MINLEN);
3657 * Write the content of the string in the output I/O buffer
3659 * The buffer is lossless, i.e. will store in case of partial
3697 * convert as much as possible to the parser reading buffer.
3699 nbchars = xmlCharEncOutFunc(out->encoder, out->conv, out->buffer);
3718 (const char *)out->buffer->content, out->buffer->use);
3720 xmlBufferShrink(out->buffer, ret);