pidgin 2.14.12
circbuffer.h File Reference

Buffer Utility Functions. More...

#include <glib.h>

Go to the source code of this file.

Data Structures

struct  _PurpleCircBuffer
 

Typedefs

typedef struct _PurpleCircBuffer PurpleCircBuffer
 

Functions

PurpleCircBufferpurple_circ_buffer_new (gsize growsize)
 Creates a new circular buffer. More...
 
void purple_circ_buffer_destroy (PurpleCircBuffer *buf)
 Dispose of the PurpleCircBuffer and free any memory used by it (including any memory used by the internal buffer). More...
 
void purple_circ_buffer_append (PurpleCircBuffer *buf, gconstpointer src, gsize len)
 Append data to the PurpleCircBuffer. More...
 
gsize purple_circ_buffer_get_max_read (const PurpleCircBuffer *buf)
 Determine the maximum number of contiguous bytes that can be read from the PurpleCircBuffer. More...
 
gboolean purple_circ_buffer_mark_read (PurpleCircBuffer *buf, gsize len)
 Mark the number of bytes that have been read from the buffer. More...
 

Detailed Description

Buffer Utility Functions.

Definition in file circbuffer.h.

Function Documentation

◆ purple_circ_buffer_append()

void purple_circ_buffer_append ( PurpleCircBuffer buf,
gconstpointer  src,
gsize  len 
)

Append data to the PurpleCircBuffer.

This will grow the internal buffer to fit the added data, if needed.

Parameters
bufThe PurpleCircBuffer to which to append the data
srcpointer to the data to copy into the buffer
lennumber of bytes to copy into the buffer

◆ purple_circ_buffer_destroy()

void purple_circ_buffer_destroy ( PurpleCircBuffer buf)

Dispose of the PurpleCircBuffer and free any memory used by it (including any memory used by the internal buffer).

Parameters
bufThe PurpleCircBuffer to free

◆ purple_circ_buffer_get_max_read()

gsize purple_circ_buffer_get_max_read ( const PurpleCircBuffer buf)

Determine the maximum number of contiguous bytes that can be read from the PurpleCircBuffer.

Note: This may not be the total number of bytes that are buffered - a subsequent call after calling