]> git.notmuchmail.org Git - notmuch/blob - util/talloc-extra.h
Merge tag 'debian/0.26.2-2'
[notmuch] / util / talloc-extra.h
1 #ifndef _TALLOC_EXTRA_H
2 #define _TALLOC_EXTRA_H
3
4 #include <talloc.h>
5
6 /* Like talloc_strndup, but take an extra parameter for the internal talloc
7  * name (for debugging) */
8
9 char *
10 talloc_strndup_named_const (void *ctx, const char *str,
11                             size_t len, const char *name);
12
13 /* use the __location__ macro from talloc.h to name a string according to its
14  * source location */
15
16 #define talloc_strndup_debug(ctx, str, len) talloc_strndup_named_const (ctx, str, len, __location__)
17
18 #endif