nsxivb9cd06d
Basic main skeleton
+12 −2
1 file changed
- M main.c +12 −2
| @@ -16,6 +16,8 @@ | |||
| 16 | 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
| 17 | 17 | */ | |
| 18 | 18 | ||
| 19 | + | #include <stdlib.h> | |
| 20 | + | ||
| 19 | 21 | #include "sxiv.h" | |
| 20 | 22 | #include "app.h" | |
| 21 | 23 | ||
| @@ -24,11 +26,19 @@ app_t app; | |||
| 24 | 26 | void cleanup() { | |
| 25 | 27 | static int in = 0; | |
| 26 | 28 | ||
| 27 | − | if (!in++) { | |
| 28 | − | } | |
| 29 | + | if (!in++) | |
| 30 | + | app_quit(&app); | |
| 29 | 31 | } | |
| 30 | 32 | ||
| 31 | 33 | int main(int argc, char **argv) { | |
| 32 | 34 | ||
| 35 | + | // TODO: parse cmd line arguments properly | |
| 36 | + | app.filenames = argv + 1; | |
| 37 | + | app.filecnt = argc - 1; | |
| 38 | + | ||
| 39 | + | app_init(&app); | |
| 40 | + | app_run(&app); | |
| 41 | + | app_quit(&app); | |
| 42 | + | ||
| 33 | 43 | return 0; | |
| 34 | 44 | } | |