2006-11-17 03:15:40 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2005-02-11 22:01:19 +00:00
|
|
|
|
2006-11-17 03:15:40 +00:00
|
|
|
#include "rfbbuffer.h"
|
2005-02-11 22:01:19 +00:00
|
|
|
|
|
|
|
RfbBuffer *
|
|
|
|
rfb_buffer_new (void)
|
|
|
|
{
|
|
|
|
return g_new0 (RfbBuffer, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
RfbBuffer *
|
|
|
|
rfb_buffer_new_and_alloc (int len)
|
|
|
|
{
|
|
|
|
RfbBuffer *buffer = g_new0 (RfbBuffer, 1);
|
|
|
|
|
|
|
|
buffer->data = g_malloc (len);
|
|
|
|
buffer->free_data = (void *) g_free;
|
|
|
|
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
rfb_buffer_free (RfbBuffer * buffer)
|
|
|
|
{
|
2006-11-17 03:15:40 +00:00
|
|
|
g_return_if_fail (buffer != NULL);
|
2005-02-11 22:01:19 +00:00
|
|
|
|
2006-11-17 03:15:40 +00:00
|
|
|
buffer->free_data (buffer->data, buffer->buffer_private);
|
2005-02-11 22:01:19 +00:00
|
|
|
}
|