]> git.ozlabs.org Git - ccan/blob - ccan/coroutine/_info
coroutine: New module
[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  * Ccanlint:
19  *      // Context switching really confuses valgrind
20  *      tests_pass_valgrind FAIL
21  */
22 int main(int argc, char *argv[])
23 {
24         /* Expect exactly one argument */
25         if (argc != 2)
26                 return 1;
27
28         if (strcmp(argv[1], "depends") == 0) {
29                 printf("ccan/ptrint\n");
30                 printf("ccan/compiler\n");
31                 printf("ccan/build_assert\n");
32                 printf("ccan/typesafe_cb\n");
33                 return 0;
34         }
35
36         if (strcmp(argv[1], "ported") == 0) {
37 #if !HAVE_UCONTEXT
38                 printf("Requires working ucontext.h\n");
39 #endif
40                 return 0;
41         }
42
43         return 1;
44 }