#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(); * if (sockfd < 0) * err(1, "Failed to set up server socket"); * * fd = accept(sockfd, NULL, NULL); * if (fd < 0) * err(1, "Accepting connection on TCP socket"); * * if (!oserver_serve(fd)) * err(1, "Serving client"); * exit(0); * } */ int main(int argc, char *argv[]) { /* Expect exactly one argument */ if (argc != 2) return 1; if (strcmp(argv[1], "depends") == 0) { printf("ccan/read_write_all\n"); printf("ccan/str\n"); printf("ccan/foreach\n"); printf("ccan/noerr\n"); printf("ccan/failtest\n"); return 0; } return 1; }