Ejemplo n.º 1
0
HEADER_DECLARE
Term* String(char* ptr, size_t size){
    Term* term = Term_new_gc();
    term->type = STRING;
    term->data.string.ptr = NULL;
    term->data.string.alloc_size = 0;
    term->data.string.end = 0;
    Buffer_append(&term->data.string, ptr, size);
    return term;
}
Ejemplo n.º 2
0
void pngWriteData (png_structp png, png_bytep dataPtr, png_size_t numBytes)
{
	Buffer* buffer = (Buffer*)png_get_io_ptr(png);
	if (!Buffer_append(buffer, (const deUint8*)dataPtr, numBytes))
		png_error(png, "unable to resize PNG write buffer!");
}
Ejemplo n.º 3
0
HEADER_DECLARE
Buffer* Buffer_new(char* str, size_t size){
    Buffer* buf = Buffer_empty(0);
    Buffer_append(buf, str, size);
    return buf;
}
Ejemplo n.º 4
0
HEADER_DECLARE
void Buffer_append_nt(Buffer* buffer, char* str){
    size_t len = strlen(str);
    Buffer_append(buffer, str, len);
}
Ejemplo n.º 5
0
void Image_get_png_write_data(png_structp png, png_bytep data, png_size_t length) {
  Buffer *buffer = (Buffer *)png_get_io_ptr(png);
  Buffer_append(buffer, length, data);
}