diff options
-rw-r--r-- | meson.build | 27 | ||||
-rw-r--r-- | src/levels/levels.c (renamed from src/text/levels.c) | 4 | ||||
-rw-r--r-- | src/levels/levels.h (renamed from src/text/levels.h) | 3 | ||||
-rw-r--r-- | src/sdl/draw.h | 2 | ||||
-rw-r--r-- | src/sdl/main.c | 2 | ||||
-rw-r--r-- | src/solve/main.c | 3 | ||||
-rw-r--r-- | src/text/draw.h | 2 | ||||
-rw-r--r-- | src/text/main.c | 4 |
8 files changed, 21 insertions, 26 deletions
diff --git a/meson.build b/meson.build index dccfe9a..d9dca9d 100644 --- a/meson.build +++ b/meson.build @@ -4,25 +4,26 @@ project('sok', 'c', default_options: ['c_std=c11']) cc = meson.get_compiler('c') libm = cc.find_library('m', required: true) +# core source (shared across all applications) sources = [ - 'src/libsok/sok-level-parser.c', - 'src/libsok/sok-ctx.c', - 'src/libsok/sok-ctx-hash.c', - 'src/libsok/sok-cache.c', - 'src/libsok/sok-solve.c', + 'src/core/sok-level-parser.c', + 'src/core/sok-ctx.c', + 'src/core/sok-ctx-hash.c', + 'src/core/sok-cache.c', + 'src/core/sok-solve.c', ] -# text exe -executable('sok-text', sources + [ +# text UI +executable('text', sources + [ + 'src/levels/levels.c', 'src/text/main.c', - 'src/text/levels.c', 'src/text/action.c', 'src/text/draw.c', ], dependencies: []) -# sdl exe -executable('sok-sdl', sources + [ - 'src/text/levels.c', +# sdl (main) exe +executable('sok', sources + [ + 'src/levels/levels.c', 'src/sdl/warp-buf.c', 'src/sdl/color.c', 'src/sdl/action.c', @@ -41,7 +42,7 @@ executable('sok-sdl', sources + [ ]) # sprite-packer exe -executable('sprite-packer', sources + [ +executable('sprite-packer', [ 'src/sprite-packer/main.c', ], dependencies: [ dependency('SDL2'), @@ -50,7 +51,7 @@ executable('sprite-packer', sources + [ # solver solve = executable('solve', sources + [ - 'src/text/levels.c', + 'src/levels/levels.c', 'src/solve/main.c', ], dependencies: []) diff --git a/src/text/levels.c b/src/levels/levels.c index a091b7f..e8ab085 100644 --- a/src/text/levels.c +++ b/src/levels/levels.c @@ -1,7 +1,3 @@ -#include <stdbool.h> // bool -#include <string.h> // atoi() -#include <stdlib.h> // EXIT_{FAILURE,SUCCESS} -#include <stdio.h> #include "../core/sok.h" #include "levels.h" diff --git a/src/text/levels.h b/src/levels/levels.h index 79ef494..b9fa1aa 100644 --- a/src/text/levels.h +++ b/src/levels/levels.h @@ -4,7 +4,7 @@ #include <stddef.h> // size_t typedef struct { - char *pack, *name, *data; + const char *pack, *name, *data; } level_t; const level_t *levels_get_level(const size_t); @@ -12,4 +12,3 @@ const level_t *levels_get_level(const size_t); size_t levels_get_num_levels(void); #endif /* LEVELS_H */ - diff --git a/src/sdl/draw.h b/src/sdl/draw.h index 956e474..7be5a28 100644 --- a/src/sdl/draw.h +++ b/src/sdl/draw.h @@ -5,7 +5,7 @@ #include <SDL.h> #include <SDL_ttf.h> #include "../core/sok.h" -#include "../text/levels.h" +#include "../levels/levels.h" #include "theme.h" // arbitrary diff --git a/src/sdl/main.c b/src/sdl/main.c index 6ca9b86..28da951 100644 --- a/src/sdl/main.c +++ b/src/sdl/main.c @@ -3,7 +3,7 @@ #include <string.h> // strerror #include <errno.h> // errno #include <SDL.h> -#include "../text/levels.h" +#include "../levels/levels.h" #include "../core/sok.h" #include "util.h" #include "action.h" diff --git a/src/solve/main.c b/src/solve/main.c index c45c5bb..82b3031 100644 --- a/src/solve/main.c +++ b/src/solve/main.c @@ -1,10 +1,9 @@ -#include <stdbool.h> // bool #include <string.h> // atoi() #include <stdlib.h> // EXIT_{FAILURE,SUCCESS} #include <stdio.h> #include "../core/sok.h" #include "../text/util.h" -#include "../text/levels.h" +#include "../levels/levels.h" static void solve_on_error( diff --git a/src/text/draw.h b/src/text/draw.h index c3add0d..a0a6967 100644 --- a/src/text/draw.h +++ b/src/text/draw.h @@ -3,7 +3,7 @@ #include <stddef.h> #include "../core/sok.h" -#include "levels.h" +#include "../levels/levels.h" void draw( const sok_ctx_t * const, diff --git a/src/text/main.c b/src/text/main.c index 1f76bf3..8e89bed 100644 --- a/src/text/main.c +++ b/src/text/main.c @@ -1,10 +1,10 @@ #include <stdbool.h> // bool #include <string.h> // atoi() #include <stdlib.h> // EXIT_{FAILURE,SUCCESS} -#include <stdio.h> +#include <stdio.h> // printf(), fputs() #include "../core/sok.h" +#include "../levels/levels.h" #include "util.h" -#include "levels.h" #include "action.h" #include "draw.h" |