]> git.ozlabs.org Git - ccan/blob - ccan/coroutine/_info
tal: allow notifiers on NULL.
[ccan] / ccan / coroutine / _info
1 #include "config.h"
2 #include <stdio.h>
3 #include <string.h>
4
5 /**
6  * coroutine - Co-routines
7  *
8  * This code has helper functions for implementing co-routines, that
9  * is, explicit co-operative context switching.  It's intended to
10  * provide similar functionality to ucontext, but with a cleaner
11  * interface.  At the moment this is implemented in terms of ucontext,
12  * but the hope is to add other implementations for platforms that
13  * don't have ucontext in future.
14  *
15  * Author: David Gibson <david@gibson.dropbear.id.au>
16  * License: LGPL (v2.1 or any later version)
17  */
18 int main(int argc, char *argv[])
19 {
20         /* Expect exactly one argument */
21         if (argc != 2)
22                 return 1;
23
24         if (strcmp(argv[1], "depends") == 0) {
25                 printf("ccan/ptrint\n");
26                 printf("ccan/compiler\n");
27                 printf("ccan/build_assert\n");
28                 printf("ccan/typesafe_cb\n");
29                 return 0;
30         }
31
32         if (strcmp(argv[1], "ported") == 0) {
33 #if !HAVE_UCONTEXT
34                 printf("Requires working ucontext.h\n");
35 #endif
36                 return 0;
37         }
38
39         if (strcmp(argv[1], "ccanlint") == 0) {
40 #if !HAVE_VALGRIND_MEMCHECK_H
41                 /* valgrind needs extra information to cope with stack
42                  * switching */
43                 printf("tests_pass_valgrind FAIL\n");
44 #endif
45                 return 0;
46         }
47
48         return 1;
49 }