diff options
author | xengineering <me@xengineering.eu> | 2022-11-27 18:53:12 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2022-11-27 19:07:49 +0100 |
commit | 2efc9022bf064136bb7cd25bd59971f2b419ff48 (patch) | |
tree | 87ea72030a3bb28f1ddba1675482a9346c5df814 /main.c | |
parent | 8b9ce1d7848bd8ad417a3834d11e1b00c028f8eb (diff) | |
download | limox-2efc9022bf064136bb7cd25bd59971f2b419ff48.tar limox-2efc9022bf064136bb7cd25bd59971f2b419ff48.tar.zst limox-2efc9022bf064136bb7cd25bd59971f2b419ff48.zip |
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)
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 50 |
1 files changed, 17 insertions, 33 deletions
@@ -5,17 +5,9 @@ #include <getopt.h> #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(); + } + +} |