netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
dalloc.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2012 Frank Lahm <[email protected]>
3
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.
8
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.
13*/
14
15#ifdef HAVE_CONFIG_H
16#include "config.h"
17#endif /* HAVE_CONFIG_H */
18
19#ifndef DALLOC_H
20#define DALLOC_H
21
22#include <talloc.h>
23
24/* dynamic datastore */
25typedef struct {
28
29/* Use dalloc_add_copy() macro, not this function */
30extern int dalloc_add_talloc_chunk(DALLOC_CTX *dd, void *talloc_chunk,
31 void *obj, size_t size);
32
33#define dalloc_add_copy(d, obj, type) dalloc_add_talloc_chunk((d), talloc((d), type), (obj), sizeof(type));
34#define dalloc_add(d, obj, type) dalloc_add_talloc_chunk((d), NULL, (obj), 0);
35extern void *dalloc_get(const DALLOC_CTX *d, ...);
36extern void *dalloc_value_for_key(const DALLOC_CTX *d, ...);
37extern char *dalloc_strdup(const void *ctx, const char *string);
38extern char *dalloc_strndup(const void *ctx, const char *string, size_t n);
39#endif /* DALLOC_H */
void * dalloc_get(const DALLOC_CTX *d,...)
Definition dalloc.c:158
char * dalloc_strndup(const void *ctx, const char *string, size_t n)
Definition dalloc.c:273
char * dalloc_strdup(const void *ctx, const char *string)
Definition dalloc.c:254
int dalloc_add_talloc_chunk(DALLOC_CTX *dd, void *talloc_chunk, void *obj, size_t size)
Definition dalloc.c:127
void * dalloc_value_for_key(const DALLOC_CTX *d,...)
Definition dalloc.c:204
static AFPObj obj
Definition netatalk.c:62
Definition dalloc.h:25
void ** dd_talloc_array
Definition dalloc.h:26