Foundation; either version 3 of the License, or (at your option) any later
version.
-GNU Make is distributed in the hope that it will be useful, but
+GNU Thales is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "cmd.h"
-#include "conf.h"
-static inline bool
-dummy(const char *type, const char *name,
- const struct envz *env)
-{
- (void)(&env);
- printf("[%s]{%s}\n", type, name);
- fflush(stdout);
- return true;
-}
-static inline void
-fatal_error(const char *message)
-{
- fprintf(stderr, "fatal eror: %s\n", message);
- exit(EXIT_FAILURE);
-}
+#include "error.h"
+#include "irc.h"
+#include "mysql_sentry.h"
+
int
-main(int argc, char **argv)
+main (int argc, char **argv)
{
- struct cmd_options opts = {
- .conf_filename = NULL
- };
- FILE *config_file;
-
- parse_cmdopts(&opts, argc, argv);
- config_file = opts.conf_filename ?
- fopen(opts.conf_filename, "r")
- : default_config_file();
+ struct irc_options irc_opts = { 0 };
+ struct mysql_options mysql_opts = { 0 };
+ struct config_options config_opts = { 0 };
+
+
+ parse_cmd_options (&irc_opts, &config_opts, argc, argv);
+ FILE *config_file = config_opts.conf_filename ? fopen (config_opts.conf_filename, "r")
+ : default_config_file ();
+
if (!config_file)
- fatal_error("failed to open config file");
- parse_config(config_file, &dummy);
+ fatal ("failed to open config file");
+
+ parse_mysql_options(&mysql_opts, config_file);
+
+SENTRY *sentry = sentry_initialize(&mysql_opts);
+#warning "mysql is not used"
+/* if (!sentry) */
+/* fatal("failed to connect to database"); */
+
+ start_listen_irc(&irc_opts, sentry);
return 0;
}