From 9593fc545950782ed75f12f53238b07885559b2b Mon Sep 17 00:00:00 2001 From: William Casarin Date: Mon, 9 Jul 2018 22:28:25 -0700 Subject: remove ccan for now --- ccan/take/_info | 61 --------------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 ccan/take/_info (limited to 'ccan/take/_info') diff --git a/ccan/take/_info b/ccan/take/_info deleted file mode 100644 index c8cc4ac..0000000 --- a/ccan/take/_info +++ /dev/null @@ -1,61 +0,0 @@ -#include "config.h" -#include -#include - -/** - * take - routines to mark pointers to be consumed by called functions. - * - * This code helps to implement ownership transfer on a per-arg basis: - * the caller wraps the pointer argument in take() and the callee checks - * taken() to see if it should consume it. - * - * Author: Rusty Russell - * License: CC0 (Public domain) - * - * Example: - * // Given "foo/bar.c" outputs basename is bar.c - * #include - * #include - * - * // Dumb basename program and driver. - * static char *base(const char *file TAKES) - * { - * const char *p = strrchr(file, '/'); - * if (!p) - * p = file; - * else - * p++; - * - * // Use arg in place if we're allowed. - * if (taken(file)) - * return memmove((char *)file, p, strlen(p)+1); - * else - * return strdup(p); - * } - * - * int main(int argc, char *argv[]) - * { - * char *b; - * - * if (argc > 1) // Mangle in place. - * b = base(take(argv[1])); - * else - * b = base("test/string"); - * - * printf("basename is %s\n", b); - * return 0; - * } - */ -int main(int argc, char *argv[]) -{ - if (argc != 2) - return 1; - - if (strcmp(argv[1], "depends") == 0) { - printf("ccan/likely\n"); - printf("ccan/str\n"); - return 0; - } - - return 1; -} -- cgit v1.2.3