buffer.c revision 9894ca11d0ddbdc968f1eb5675c1eefadc91d031
/* Copyright (c) 2002-2003 Timo Sirainen */
/* @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 hard:1;
};
{
return;
}
{
return FALSE;
return TRUE;
}
static inline int
int accept_partial)
{
/* make sure we're within our limits */
}
return FALSE;
}
/* see if we need to grow the buffer */
}
return TRUE;
}
{
struct real_buffer *buf;
}
{
return buf;
}
{
struct real_buffer *buf;
}
{
struct real_buffer *buf;
}
{
struct real_buffer *buf;
}
{
}
{
void *data;
return data;
}
{
}
{
return 0;
return data_size;
}
{
}
{
}
{
/* move_size == number of bytes we have to move forward to make space */
/* size == number of bytes we want to modify after pos */
else
return 0;
/* size == number of bytes we actually inserted. data_size usually. */
return size;
}
{
return 0;
/* delete from between */
} else {
/* delete the rest of the buffer */
end_size = 0;
}
return size;
}
{
return 0;
return 0;
} else {
}
return copy_size;
}
{
}
{
return NULL;
}
{
}
{
}
{
}
{
}
#ifdef BUFFER_TEST
/* gcc buffer.c -o testbuffer liblib.a -Wall -DHAVE_CONFIG_H -DBUFFER_TEST -g */
int main(void)
{
lib_init();
return 0;
}
#endif