• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/libxml2-26/libxml2/

Lines Matching defs:buff

1487  * @buff:  Compressed memory buffer
1494 append_reverse_ulong( xmlZMemBuff * buff, unsigned long data ) {
1498 if ( buff == NULL )
1509 *buff->zctrl.next_out = ( data & 0xff );
1511 buff->zctrl.next_out++;
1520 * @buff: The memory buffer context to clear
1525 xmlFreeZMemBuff( xmlZMemBuffPtr buff ) {
1531 if ( buff == NULL )
1534 xmlFree( buff->zbuff );
1536 z_err = deflateEnd( &buff->zctrl );
1542 deflateEnd( &buff->zctrl );
1545 xmlFree( buff );
1564 xmlZMemBuffPtr buff = NULL;
1571 buff = xmlMalloc( sizeof( xmlZMemBuff ) );
1572 if ( buff == NULL ) {
1577 (void)memset( buff, 0, sizeof( xmlZMemBuff ) );
1578 buff->size = INIT_HTTP_BUFF_SIZE;
1579 buff->zbuff = xmlMalloc( buff->size );
1580 if ( buff->zbuff == NULL ) {
1581 xmlFreeZMemBuff( buff );
1586 z_err = deflateInit2( &buff->zctrl, compression, Z_DEFLATED,
1590 xmlFreeZMemBuff( buff );
1591 buff = NULL;
1601 buff->crc = crc32( 0L, NULL, 0 );
1602 hdr_lgth = snprintf( (char *)buff->zbuff, buff->size,
1606 buff->zctrl.next_out = buff->zbuff + hdr_lgth;
1607 buff->zctrl.avail_out = buff->size - hdr_lgth;
1609 return ( buff );
1614 * @buff: Buffer used to compress and consolidate data.
1624 xmlZMemBuffExtend( xmlZMemBuffPtr buff, size_t ext_amt ) {
1632 if ( buff == NULL )
1638 cur_used = buff->zctrl.next_out - buff->zbuff;
1639 new_size = buff->size + ext_amt;
1650 tmp_ptr = xmlRealloc( buff->zbuff, new_size );
1653 buff->size = new_size;
1654 buff->zbuff = tmp_ptr;
1655 buff->zctrl.next_out = tmp_ptr + cur_used;
1656 buff->zctrl.avail_out = new_size - cur_used;
1672 * @buff: Buffer used to compress and consolidate data
1682 xmlZMemBuffAppend( xmlZMemBuffPtr buff, const char * src, int len ) {
1687 if ( ( buff == NULL ) || ( src == NULL ) )
1690 buff->zctrl.avail_in = len;
1691 buff->zctrl.next_in = (unsigned char *)src;
1692 while ( buff->zctrl.avail_in > 0 ) {
1697 min_accept = buff->zctrl.avail_in / DFLT_ZLIB_RATIO;
1698 if ( buff->zctrl.avail_out <= min_accept ) {
1699 if ( xmlZMemBuffExtend( buff, buff->size ) == -1 )
1703 z_err = deflate( &buff->zctrl, Z_NO_FLUSH );
1715 buff->crc = crc32( buff->crc, (unsigned char *)src, len );
1722 * @buff: Compressed memory content buffer
1732 xmlZMemBuffGetContent( xmlZMemBuffPtr buff, char ** data_ref ) {
1737 if ( ( buff == NULL ) || ( data_ref == NULL ) )
1744 z_err = deflate( &buff->zctrl, Z_FINISH );
1748 if ( xmlZMemBuffExtend( buff, buff->size ) == -1 )
1760 if ( buff->zctrl.avail_out < ( 2 * sizeof( unsigned long ) ) ) {
1761 if ( xmlZMemBuffExtend(buff, (2 * sizeof(unsigned long))) == -1 )
1770 append_reverse_ulong( buff, buff->crc );
1771 append_reverse_ulong( buff, buff->zctrl.total_in );
1773 zlgth = buff->zctrl.next_out - buff->zbuff;
1774 *data_ref = (char *)buff->zbuff;