From: Rusty Russell Date: Sun, 23 Jan 2011 12:03:46 +0000 (+1030) Subject: lca2011: oserver _info file. X-Git-Url: https://git.ozlabs.org/?p=ccan-lca-2011.git;a=commitdiff_plain;h=916074dc3309c4e94d8192ee57633f8a0e9d48d3 lca2011: oserver _info file. Header from folded patch 'ccanlint-idempotent-and-license.patch': lca2011: oserver idempotent and license link and tag. Header from folded patch 'ccanlint-fix-control-reaches-end.patch': lca2011: mark oserver_serve NORETURN. --- diff --git a/ccan/oserver/LICENSE b/ccan/oserver/LICENSE new file mode 120000 index 0000000..190cfd5 --- /dev/null +++ b/ccan/oserver/LICENSE @@ -0,0 +1 @@ +../../licenses/GPL-3 \ No newline at end of file diff --git a/ccan/oserver/_info b/ccan/oserver/_info new file mode 100644 index 0000000..087b043 --- /dev/null +++ b/ccan/oserver/_info @@ -0,0 +1,44 @@ +#include +#include "config.h" + +/** + * oserver - a demonstration module for LCA2011 + * + * This code shows off the features of CCAN and various C cantrips. + * + * License: GPL + * + * Example: + * #include + * #include + * #include + * #include + * #include + * + * int main(void) + * { + * int fd, sockfd; + * + * sockfd = oserver_setup(); + * + * fd = accept(sockfd, NULL, NULL); + * if (fd < 0) + * err(1, "Accepting connection on TCP socket"); + * + * oserver_serve(fd); + * } + */ +int main(int argc, char *argv[]) +{ + /* Expect exactly one argument */ + if (argc != 2) + return 1; + + if (strcmp(argv[1], "depends") == 0) { + printf("ccan/compiler\n"); + printf("ccan/read_write_all\n"); + return 0; + } + + return 1; +}