From 2efc9022bf064136bb7cd25bd59971f2b419ff48 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 27 Nov 2022 18:53:12 +0100 Subject: Switch completely to SDL2 version The now legacy version of LimoX with GTK4 and libstrophe is now not part of the main branch anymore. There might be a legacy branch keeping this version at the time of reading. This cut of implemented functionality is motivated by these reasons: - Implementing XMPP is fun, educative and gives full control. - Low level graphics with SDL2 is portable, fast, educative an mature. - I do not have to use GLib and a crazy event loop anymore (run and hide) --- main.c | 50 +++++++++++++++++--------------------------------- 1 file changed, 17 insertions(+), 33 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 016ea99..b86e911 100644 --- a/main.c +++ b/main.c @@ -5,17 +5,9 @@ #include #include "gui.h" -#include "net.h" +#include "xmpp.h" -// error code definition -typedef enum error { - Ok = 0, - UnknownError = 1, - WrongArgs = 2, - GuiError = 3, -} Error; - // configuration struct for all command line options typedef struct options { bool unknown; @@ -23,28 +15,6 @@ typedef struct options { } Options; -// prototypes -static void get_opts(Options* opts, int argc, char* argv[]); -static void print_help(void); - - -int main(int argc, char* argv[]) { - - // parse command line options - Options opts; - get_opts(&opts, argc, argv); - - // handle correct use case - if (opts.unknown || opts.help) { - print_help(); - } else { - net_init(); - gui_run(); - net_quit(); - } - -} - // parses all command line arguments. static void get_opts(Options* opts, int argc, char* argv[]) { @@ -63,9 +33,7 @@ static void get_opts(Options* opts, int argc, char* argv[]) { default: opts->unknown = true; } - } - } // prints out the help page. @@ -81,3 +49,19 @@ static void print_help(void) { ); } + +int main(int argc, char* argv[]) { + + // parse command line options + Options opts; + get_opts(&opts, argc, argv); + + // handle correct use case + if (opts.unknown || opts.help) { + print_help(); + } else { + xmpp_connect(); + gui_run(); + } + +} -- cgit v1.2.3-70-g09d2