Lines Matching refs:buffer
176 "Inappropriate message buffer length",/* EMSGSIZE */
204 "buffer full",
811 * @buffer: where to drop data
814 * Read @len bytes to @buffer from the I/O channel.
819 xmlFdRead (void * context, char * buffer, int len) {
822 ret = read((int) (long) context, &buffer[0], len);
831 * @buffer: where to get data
834 * Write @len bytes from @buffer to the I/O channel.
839 xmlFdWrite (void * context, const char * buffer, int len) {
843 ret = write((int) (long) context, &buffer[0], len);
1015 * @buffer: where to drop data
1018 * Read @len bytes to @buffer from the I/O channel.
1023 xmlFileRead (void * context, char * buffer, int len) {
1025 if ((context == NULL) || (buffer == NULL))
1027 ret = fread(&buffer[0], 1, len, (FILE *) context);
1036 * @buffer: where to drop data
1039 * Write @len bytes from @buffer to the I/O channel.
1044 xmlFileWrite (void * context, const char * buffer, int len) {
1047 if ((context == NULL) || (buffer == NULL))
1049 items = fwrite(&buffer[0], len, 1, (FILE *) context);
1110 * @buffer: the data to write
1113 * Write @len bytes from @buffer to the xml buffer
1118 xmlBufferWrite (void * context, const char * buffer, int len) {
1121 ret = xmlBufferAdd((xmlBufferPtr) context, (const xmlChar *) buffer, len);
1270 * @buffer: where to drop data
1273 * Read @len bytes to @buffer from the compressed I/O channel.
1278 xmlGzfileRead (void * context, char * buffer, int len) {
1281 ret = gzread((gzFile) context, &buffer[0], len);
1290 * @buffer: where to drop data
1293 * Write @len bytes from @buffer to the compressed I/O channel.
1298 xmlGzfileWrite (void * context, const char * buffer, int len) {
1301 ret = gzwrite((gzFile) context, (char *) &buffer[0], len);
1410 * @buffer: where to drop data
1413 * Read @len bytes to @buffer from the compressed I/O channel.
1418 xmlXzfileRead (void * context, char * buffer, int len) {
1421 ret = __libxml2_xzread((xzFile) context, &buffer[0], len);
1487 * @buff: Compressed memory buffer
1491 * memory buffer.
1520 * @buff: The memory buffer context to clear
1522 * Release all the resources associated with the compressed memory buffer.
1553 * Create a memory buffer to hold the compressed XML document. The
1573 xmlIOErrMemory("creating buffer context");
1582 xmlIOErrMemory("creating buffer");
1614 * @buff: Buffer used to compress and consolidate data.
1615 * @ext_amt: Number of bytes to extend the buffer.
1617 * Extend the internal buffer used to store the compressed data by the
1620 * Returns 0 on success or -1 on failure to extend the buffer. On failure
1621 * the original buffer still exists at the original size.
1645 "Buffer overwrite detected during compressed memory",
1646 "buffer extension. Overflowed by",
1662 "Allocation failure extending output buffer to",
1672 * @buff: Buffer used to compress and consolidate data
1673 * @src: Uncompressed source content to append to buffer
1674 * @len: Length of source data to append to buffer
1676 * Compress and append data to the internal buffer. The data buffer
1679 * Returns the number of bytes appended to the buffer or -1 on error.
1694 ** Extend the buffer prior to deflate call if a reasonable amount
1695 ** of output buffer space is not available.
1709 len, "bytes to buffer. ZLIB error", z_err );
1722 * @buff: Compressed memory content buffer
1746 /* In this case Z_OK means more buffer space needed */
1858 * Open a temporary buffer to collect the document for a subsequent HTTP POST
1859 * request. Non-static as is called from the output buffer creation routine.
1890 * ** need to put the document into a buffer. A memory buffer
1936 * @buffer: where to drop data
1939 * Read @len bytes to @buffer from the I/O channel.
1944 xmlIOHTTPRead(void * context, char * buffer, int len) {
1945 if ((buffer == NULL) || (len < 0)) return(-1);
1946 return(xmlNanoHTTPRead(context, &buffer[0], len));
1953 * @buffer: data to output to temporary buffer
1956 * Collect data from memory buffer into a temporary file for later
1963 xmlIOHTTPWrite( void * context, const char * buffer, int len ) {
1967 if ( ( ctxt == NULL ) || ( ctxt->doc_buff == NULL ) || ( buffer == NULL ) )
1976 len = xmlZMemBuffAppend( ctxt->doc_buff, buffer, len );
1980 len = xmlOutputBufferWrite( ctxt->doc_buff, len, buffer );
1986 "Error appending to internal buffer.",
2036 /* Retrieve the content from the appropriate buffer */
2047 /* Pull the data out of the memory output buffer */
2050 http_content = (char *) xmlBufContent(dctxt->buffer);
2051 content_lgth = xmlBufUse(dctxt->buffer);
2074 char buffer[ 4096 ];
2091 (void)snprintf( buffer, sizeof(buffer), "%s.content", dump_name );
2093 tst_file = fopen( buffer, "wb" );
2096 "Transmitted content saved in file: %s\n", buffer );
2103 (void)snprintf( buffer, sizeof(buffer), "%s.reply", dump_name );
2104 tst_file = fopen( buffer, "wb" );
2107 "Reply content saved in file: %s\n", buffer );
2111 buffer, sizeof( buffer ) )) > 0 ) {
2113 fwrite( buffer, sizeof( char ), avail, tst_file );
2215 * @buffer: where to drop data
2218 * Read @len bytes to @buffer from the I/O channel.
2223 xmlIOFTPRead(void * context, char * buffer, int len) {
2224 if ((buffer == NULL) || (len < 0)) return(-1);
2225 return(xmlNanoFTPRead(context, &buffer[0], len));
2414 xmlIOErrMemory("creating input buffer");
2418 ret->buffer = xmlBufCreateSize(2 * xmlDefaultBufferSize);
2419 if (ret->buffer == NULL) {
2423 xmlBufSetAllocationScheme(ret->buffer, XML_BUFFER_ALLOC_DOUBLEIT);
2453 xmlIOErrMemory("creating output buffer");
2457 ret->buffer = xmlBufCreate();
2458 if (ret->buffer == NULL) {
2464 if (xmlBufGetAllocationScheme(ret->buffer) == XML_BUFFER_ALLOC_EXACT)
2465 xmlBufSetAllocationScheme(ret->buffer, XML_BUFFER_ALLOC_DOUBLEIT);
2503 xmlIOErrMemory("creating output buffer");
2507 ret->buffer = xmlBufCreate();
2508 if (ret->buffer == NULL) {
2517 xmlBufSetAllocationScheme(ret->buffer, XML_BUFFER_ALLOC_IO);
2563 if (in->buffer != NULL) {
2564 xmlBufFree(in->buffer);
2565 in->buffer = NULL;
2602 if (out->buffer != NULL) {
2603 xmlBufFree(out->buffer);
2604 out->buffer = NULL;
2645 * Allocate the Input buffer front-end.
2813 * Allocate the Output buffer front-end.
2911 * @buffer: a xmlBufferPtr
2919 xmlOutputBufferCreateBuffer(xmlBufferPtr buffer,
2923 if (buffer == NULL) return(NULL);
2928 NULL, (void *) buffer, encoder);
2937 * Gives a pointer to the data currently held in the output buffer
2943 if ((out == NULL) || (out->buffer == NULL))
2946 return(xmlBufContent(out->buffer));
2953 * Gives the length of the data currently held in the output buffer
2959 if ((out == NULL) || (out->buffer == NULL))
2962 return(xmlBufUse(out->buffer));
3018 errcode = xmlBufAdd(ret->buffer, (const xmlChar *) mem, size);
3036 * the buffer, but the memory is expected to be available until the end of
3051 xmlIOErrMemory("creating input buffer");
3055 ret->buffer = xmlBufCreateStatic((void *)mem, (size_t) size);
3056 if (ret->buffer == NULL) {
3209 * Push the content of the arry in the input buffer
3213 * Returns the number of chars read and stored in the buffer, or -1
3228 * Store the data in the incoming raw buffer
3238 * convert as much as possible to the parser reading buffer.
3250 ret = xmlBufAdd(in->buffer, (xmlChar *) buf, nbchars);
3256 "I/O: pushed %d chars, buffer %d/%d\n",
3257 nbchars, xmlBufUse(in->buffer), xmlBufLength(in->buffer));
3270 char * buffer ATTRIBUTE_UNUSED,
3280 * Grow up the content of the input buffer, the old data are preserved
3285 * onto in->buffer or in->raw
3287 * Returns the number of chars read and stored in the buffer
3292 char *buffer = NULL;
3300 if (xmlBufAvail(in->buffer) <= 0) {
3306 if (xmlBufGrow(in->buffer, len + 1) < 0) {
3307 xmlIOErrMemory("growing input buffer");
3311 buffer = (char *)xmlBufEnd(in->buffer);
3317 res = in->readcallback(in->context, &buffer[0], len);
3333 * Store the data in the incoming raw buffer
3338 res = xmlBufAdd(in->raw, (const xmlChar *) buffer, len);
3343 * convert as much as possible to the parser reading buffer.
3355 xmlBufAddLen(in->buffer, nbchars);
3359 "I/O: read %d chars, buffer %d\n",
3360 nbchars, xmlBufUse(in->buffer));
3370 * Refresh the content of the input buffer, the old data are considered
3374 * Returns the number of chars read and stored in the buffer, or -1
3382 else if (xmlBufGetAllocationScheme(in->buffer) == XML_BUFFER_ALLOC_IMMUTABLE)
3395 * Write the content of the array in the output I/O buffer
3397 * The buffer is lossless, i.e. will store in case of partial
3424 * Store the data in the incoming raw buffer
3429 ret = xmlBufAdd(out->buffer, (const xmlChar *) buf, chunk);
3433 if ((xmlBufUse(out->buffer) < MINLEN) && (chunk == len))
3437 * convert as much as possible to the parser reading buffer.
3447 ret = xmlBufAdd(out->buffer, (const xmlChar *) buf, chunk);
3450 nbchars = xmlBufUse(out->buffer);
3469 (const char *)xmlBufContent(out->buffer), nbchars);
3471 xmlBufShrink(out->buffer, ret);
3557 * Write the content of the string in the output I/O buffer
3560 * The buffer is lossless, i.e. will store in case of partial
3578 (out->buffer == NULL) ||
3579 (xmlBufGetAllocationScheme(out->buffer) == XML_BUFFER_ALLOC_IMMUTABLE))
3593 chunk = xmlBufAvail(out->buffer) - 1;
3600 if (xmlBufGrow(out->buffer, 100) < 0)
3611 * Store the data in the incoming raw buffer
3616 ret = escaping(xmlBufEnd(out->buffer) ,
3620 xmlBufAddLen(out->buffer, chunk);
3622 if ((xmlBufUse(out->buffer) < MINLEN) && (cons == len))
3626 * convert as much as possible to the output buffer.
3636 ret = escaping(xmlBufEnd(out->buffer), &chunk, str, &cons);
3639 xmlBufAddLen(out->buffer, chunk);
3640 nbchars = xmlBufUse(out->buffer);
3659 (const char *)xmlBufContent(out->buffer), nbchars);
3661 xmlBufShrink(out->buffer, ret);
3669 } else if (xmlBufAvail(out->buffer) < MINLEN) {
3670 xmlBufGrow(out->buffer, MINLEN);
3688 * Write the content of the string in the output I/O buffer
3690 * The buffer is lossless, i.e. will store in case of partial
3728 * convert as much as possible to the parser output buffer.
3752 (const char *)xmlBufContent(out->buffer),
3753 xmlBufUse(out->buffer));
3755 xmlBufShrink(out->buffer, ret);