TaPAS  0.2
ccl-buffer.h
Go to the documentation of this file.
1 /*
2  * ccl-buffer.h -- an auto-extensible buffer
3  *
4  * This file is a part of the C Common Library (CCL) project.
5  *
6  * Copyright (C) 2010 CNRS UMR 5800 & Université Bordeaux I (see AUTHORS file).
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the AltaRica Public License that comes with this
10  * package.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  */
16 
22 #ifndef __CCL_BUFFER_H__
23 # define __CCL_BUFFER_H__
24 
25 # include <ccl/ccl-common.h>
26 # include <ccl/ccl-array.h>
27 
28 BEGIN_C_DECLS
29 
30 typedef struct ccl_buffer_st ccl_buffer;
31 typedef CCL_ARRAY (int8_t) ccl_buffer_content;
32 
33 extern ccl_buffer *
34 ccl_buffer_create (void);
35 
36 extern ccl_buffer *
37 ccl_buffer_add_reference (ccl_buffer *buf);
38 
39 extern void
40 ccl_buffer_del_reference (ccl_buffer *buf);
41 
42 extern size_t
43 ccl_buffer_get_content_size (ccl_buffer *buf);
44 
45 extern void
46 ccl_buffer_append (ccl_buffer *buf, void *data, size_t datasize);
47 
48 extern void
49 ccl_buffer_reset (ccl_buffer *buf);
50 
51 extern void
52 ccl_buffer_get_content (ccl_buffer *buf, ccl_buffer_content *pcontent);
53 
54 END_C_DECLS
55 
56 #endif /* ! __CCL_BUFFER_H__ */
#define CCL_ARRAY(_t_)
Macro to define an array of objects of type t
Definition: ccl-array.h:32
Some useful and common macros.
A kind of template for dynamic arrays.