aboutsummaryrefslogtreecommitdiffstats
path: root/moon-abe/pbc-0.5.14/include/pbc_memory.h
diff options
context:
space:
mode:
authorWuKong <rebirthmonkey@gmail.com>2015-09-04 09:25:34 +0200
committerWuKong <rebirthmonkey@gmail.com>2015-09-04 09:25:34 +0200
commit3baeb11a8fbcfcdbc31976d421f17b85503b3ecd (patch)
tree04891d88c1127148f1b390b5a24414e85b270aee /moon-abe/pbc-0.5.14/include/pbc_memory.h
parent67c5b73910f5fc437429c356978081b252a59480 (diff)
init attribute-based encryption
Change-Id: Iba1a3d722110abf747a0fba366f3ebc911d25b25
Diffstat (limited to 'moon-abe/pbc-0.5.14/include/pbc_memory.h')
-rw-r--r--moon-abe/pbc-0.5.14/include/pbc_memory.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/moon-abe/pbc-0.5.14/include/pbc_memory.h b/moon-abe/pbc-0.5.14/include/pbc_memory.h
new file mode 100644
index 00000000..4c71a2e0
--- /dev/null
+++ b/moon-abe/pbc-0.5.14/include/pbc_memory.h
@@ -0,0 +1,24 @@
+// Requires:
+// * stdlib.h
+#ifndef __PBC_MEMORY_H__
+#define __PBC_MEMORY_H__
+
+// Memory allocation functions used by PBC.
+extern void *(*pbc_malloc)(size_t);
+extern void *(*pbc_realloc)(void *, size_t);
+extern void (*pbc_free)(void *);
+
+void *pbc_calloc(size_t, size_t);
+
+/*@manual alloc
+Set custom allocation functions. The parameters must be function pointers to
+drop-in replacements for malloc, realloc and free, except that malloc and
+realloc should terminate the program on failure: they must not return in this
+case.
+*/
+void pbc_set_memory_functions(void *(*malloc_fn)(size_t),
+ void *(*realloc_fn)(void *, size_t), void (*free_fn)(void *));
+
+char *pbc_strdup(const char *s);
+
+#endif //__PBC_MEMORY_H__