]> git.ozlabs.org Git - ccan/blob - ccan/tal/talloc/_info
9b1544d0885721d5ea496005f6369d40534b5280
[ccan] / ccan / tal / talloc / _info
1 #include <stdio.h>
2 #include <string.h>
3 #include "config.h"
4
5 /**
6  * tal/talloc - an implementation of the tal interface in terms of talloc.
7  *
8  * Tal and talloc are both hierarchical allocators, but have different APIs.
9  * The tal API is mostly a subset of talloc, but if your project already
10  * uses talloc then having both tal and talloc pointers is confusing, and
11  * a waste of resources.
12  *
13  * The standard convention to tell ccan modules to use this instead of
14  * ccan/tal is to define TAL_USE_TALLOC, usually on the commandline.
15  *
16  * Bugs:
17  *      tal_first() and tal_next() can't be implemented.
18  *      tal_set_backend() can only change the error function.
19  *
20  * License: LGPL
21  */
22 int main(int argc, char *argv[])
23 {
24         if (argc != 2)
25                 return 1;
26
27         if (strcmp(argv[1], "depends") == 0) {
28                 printf("ccan/take\n");
29                 printf("ccan/typesafe_cb\n");
30                 printf("ccan/compiler\n");
31                 printf("ccan/likely\n");
32                 printf("ccan/str\n");
33                 printf("talloc\n");
34                 return 0;
35         }
36
37         if (strcmp(argv[1], "libs") == 0) {
38                 printf("talloc\n");
39                 return 0;
40         }
41
42         return 1;
43 }