2 Copyright (c) 2012 Frank Lahm <franklahm@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
17 #endif /* HAVE_CONFIG_H */
22 #include <atalk/talloc.h>
24 /* dynamic datastore */
26 void **dd_talloc_array;
29 /* Use dalloc_add_copy() macro, not this function */
30 extern int dalloc_add_talloc_chunk(DALLOC_CTX *dd, void *talloc_chunk, void *obj, size_t size);
32 #define dalloc_add_copy(d, obj, type) dalloc_add_talloc_chunk((d), talloc((d), type), (obj), sizeof(type));
33 #define dalloc_add(d, obj, type) dalloc_add_talloc_chunk((d), NULL, (obj), 0);
34 extern void *dalloc_get(const DALLOC_CTX *d, ...);
35 extern void *dalloc_value_for_key(const DALLOC_CTX *d, ...);
36 extern int dalloc_size(DALLOC_CTX *d);
37 extern char *dalloc_strdup(const void *ctx, const char *string);
38 extern char *dalloc_strndup(const void *ctx, const char *string, size_t n);