Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
[platform/upstream/evolution-data-server.git] / camel / camel-mempool.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU Lesser General Public License as published by
7  *  the Free Software Foundation; either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Lesser General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Lesser General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
18  *
19  */
20
21 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
22 #error "Only <camel/camel.h> can be included directly."
23 #endif
24
25 #ifndef CAMEL_MEMPOOL_H
26 #define CAMEL_MEMPOOL_H
27
28 #include <glib.h>
29
30 G_BEGIN_DECLS
31
32 /* mempools - allocate variable sized blocks of memory, and free as one */
33 /* allocation is very fast, but cannot be freed individually */
34
35 /**
36  * CamelMemPool:
37  *
38  * Since: 2.32
39  **/
40 typedef struct _CamelMemPool CamelMemPool;
41
42 /**
43  * CamelMemPoolFlags:
44  * @CAMEL_MEMPOOL_ALIGN_STRUCT:
45  *      Allocate to native structure alignment
46  * @CAMEL_MEMPOOL_ALIGN_WORD:
47  *      Allocate to words - 16 bit alignment
48  * @CAMEL_MEMPOOL_ALIGN_BYTE:
49  *      Allocate to bytes - 8 bit alignment
50  * @CAMEL_MEMPOOL_ALIGN_MASK:
51  *      Which bits determine the alignment information
52  *
53  * Since: 2.32
54  **/
55 typedef enum {
56         CAMEL_MEMPOOL_ALIGN_STRUCT,
57         CAMEL_MEMPOOL_ALIGN_WORD,
58         CAMEL_MEMPOOL_ALIGN_BYTE,
59         CAMEL_MEMPOOL_ALIGN_MASK = 0x3
60 } CamelMemPoolFlags;
61
62 CamelMemPool *  camel_mempool_new               (gint blocksize,
63                                                  gint threshold,
64                                                  CamelMemPoolFlags flags);
65 gpointer        camel_mempool_alloc             (CamelMemPool *pool,
66                                                  gint size);
67 gchar *         camel_mempool_strdup            (CamelMemPool *pool,
68                                                  const gchar *str);
69 void            camel_mempool_flush             (CamelMemPool *pool,
70                                                  gint freeall);
71 void            camel_mempool_destroy           (CamelMemPool *pool);
72
73 G_END_DECLS
74
75 #endif /* CAMEL_MEMPOOL_H */