#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 * #include * * int main(int argc, char *argv[]) * { * struct tevent_context *ev = tevent_context_init(NULL); * unsigned int port = OSERVER_PORT; * * opt_register_noarg("--help|--usage|-h", opt_usage_and_exit, * "\nA oserver program", "Usage information"); * opt_register_arg("--port", opt_set_uintval, opt_show_uintval, * &port, "Server port number"); * * opt_parse(&argc, argv, opt_log_stderr_exit); * if (argc != 1) * opt_log_stderr_exit("Unknown extra arguments"); * * if (!oserver_setup(ev, port)) * err(1, "Failed to set up server"); * * while (tevent_loop_wait(ev) == 0); * err(1, "Serving client"); * } */ 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/failtest\n"); printf("ccan/opt\n"); printf("ccan/array_size\n"); printf("ccan/tevent\n"); printf("ccan/cdump\n"); return 0; } return 1; }