buffer.c revision 8e4a702a1f96f118976da6eb9ece344df625eabb
/* Copyright (c) 2002-2012 Dovecot authors, see the included COPYING file */
/* @UNSAFE: whole file */
#include "lib.h"
#include "buffer.h"
struct real_buffer {
/* public: */
const unsigned char *r_buffer;
/* private: */
unsigned char *w_buffer;
unsigned int alloced:1;
unsigned int dynamic:1;
};
{
return;
}
static inline void
{
unsigned int extra;
}
/* clear used..dirty area */
}
/* always keep +1 byte allocated available in case str_c() is called
for this buffer. this is mainly for cases where the buffer is
allocated from data stack, and str_c() is called in a separate stack
frame. */
}
}
#if 0
void *new_buf;
/* buffer's size increased: move the buffer's memory elsewhere.
this should help catch bugs where old pointers are tried to
be used to access the buffer's memory */
}
#endif
}
{
struct real_buffer *buf;
}
{
struct real_buffer *buf;
}
{
struct real_buffer *buf;
}
{
}
{
void *data;
return data;
}
{
}
{
buffer_set_used_size(buf, 0);
}
{
}
{
}
{
}
{
else {
}
}
{
return;
/* delete from between */
} else {
/* delete the rest of the buffer */
end_size = 0;
}
}
{
}
{
}
{
else {
}
}
{
} else {
}
}
{
}
{
}
{
}
{
if (used_size_r != NULL)
}
{
}
{
}
{
return FALSE;
}
{
void *ret;
/* this doesn't really do anything except verify the
stack frame */
}
}