diff options
author | AlejandroColomar <colomar.6.4.3@gmail.com> | 2019-01-08 12:16:09 +0100 |
---|---|---|
committer | AlejandroColomar <colomar.6.4.3@gmail.com> | 2019-01-08 12:16:09 +0100 |
commit | 3f1918353789dbec21764c815a8af045c5cc465e (patch) | |
tree | 931724f32255b78f842e6fea7e0adda344c3881d | |
parent | 15713d6fe8888aa02fb545cfddabdd22aa06463c (diff) |
Update libalx: #include "libalx/alx_XXX.h"
m--------- | libalx | 0 | ||||
-rw-r--r-- | modules/about/src/about.c | 6 | ||||
-rw-r--r-- | modules/about/tmp/Makefile | 2 | ||||
-rw-r--r-- | modules/ctrl/src/start.c | 6 | ||||
-rw-r--r-- | modules/game/src/game.c | 9 | ||||
-rw-r--r-- | modules/game/src/game_iface.c | 8 | ||||
-rw-r--r-- | modules/game/tmp/Makefile | 2 | ||||
-rw-r--r-- | modules/menu/src/menu_clui.c | 7 | ||||
-rw-r--r-- | modules/menu/src/menu_gui.c | 9 | ||||
-rw-r--r-- | modules/menu/src/menu_iface.c | 7 | ||||
-rw-r--r-- | modules/menu/src/menu_tui.c | 8 | ||||
-rw-r--r-- | modules/menu/src/parser.c | 7 | ||||
-rw-r--r-- | modules/menu/tmp/Makefile | 28 | ||||
-rw-r--r-- | modules/player/src/player_clui.c | 5 | ||||
-rw-r--r-- | modules/player/src/player_gui.c | 15 | ||||
-rw-r--r-- | modules/player/src/player_iface.c | 6 | ||||
-rw-r--r-- | modules/player/src/player_tui.c | 50 | ||||
-rw-r--r-- | modules/player/tmp/Makefile | 10 | ||||
-rw-r--r-- | modules/save/src/save.c | 9 | ||||
-rw-r--r-- | modules/save/src/score.c | 9 | ||||
-rw-r--r-- | modules/xyzzy/src/xyzzy.c | 2 | ||||
-rw-r--r-- | src/main.c | 13 | ||||
-rw-r--r-- | tmp/Makefile | 2 |
23 files changed, 55 insertions, 165 deletions
diff --git a/libalx b/libalx -Subproject 207eade1bd19c0934da8f64571a1bff58a2d29f +Subproject 683a19b251a72cbed5b8a6d2ed368ae1642ed63 diff --git a/modules/about/src/about.c b/modules/about/src/about.c index c46f66b..ec6aac7 100644 --- a/modules/about/src/about.c +++ b/modules/about/src/about.c @@ -7,14 +7,10 @@ ******* headers ************************************************************** ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ - /* printf() */ #include <stdio.h> #include <stdlib.h> - /* libalx ------------------------------------------------------------------*/ - /* alx_prn_file() */ - #include "alx_file.h" - + #include "libalx/alx_file.h" /* Project -------------------------------------------------------------------*/ #include "about.h" diff --git a/modules/about/tmp/Makefile b/modules/about/tmp/Makefile index dad4f88..55afbaa 100644 --- a/modules/about/tmp/Makefile +++ b/modules/about/tmp/Makefile @@ -14,7 +14,7 @@ SRC_DIR = $(ABOUT_DIR)/src/ _ALL = about.o ALL = $(_ALL) about_mod.o -ABOU_INC_LIBALX = alx_file.h +ABOU_INC_LIBALX = libalx/alx_file.h ABOU_INC = about.h ABOU_DEPS = $(SRC_DIR)/about.c \ $(patsubst %,$(LIBALX_INC_DIR)/%,$(ABOU_INC_LIBALX)) \ diff --git a/modules/ctrl/src/start.c b/modules/ctrl/src/start.c index 84ccbc8..7a31810 100644 --- a/modules/ctrl/src/start.c +++ b/modules/ctrl/src/start.c @@ -7,17 +7,11 @@ ******* headers ************************************************************** ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ - /* errno */ #include <errno.h> - /* Project -------------------------------------------------------------------*/ - /* game() */ #include "game.h" - /* game_iface() */ #include "game_iface.h" - /* menu_iface_board() */ #include "menu_iface.h" - /* player_iface() */ #include "player_iface.h" #include "start.h" diff --git a/modules/game/src/game.c b/modules/game/src/game.c index 9923e2f..be749aa 100644 --- a/modules/game/src/game.c +++ b/modules/game/src/game.c @@ -7,19 +7,12 @@ ******* headers ************************************************************** ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ - /* bool */ #include <stdbool.h> - /* rand() */ #include <stdlib.h> - /* time_t & clock() & time() */ #include <time.h> - /* getpid() */ #include <unistd.h> - /* libalx --------------------------------------------------------------------*/ - /* seedf() */ - #include "alx_seed.h" - + #include "libalx/alx_seed.h" /* Project -------------------------------------------------------------------*/ #include "save.h" diff --git a/modules/game/src/game_iface.c b/modules/game/src/game_iface.c index f5ae3e7..4fc602d 100644 --- a/modules/game/src/game_iface.c +++ b/modules/game/src/game_iface.c @@ -8,20 +8,12 @@ ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ #include <stdbool.h> - /* time_t & time() */ #include <time.h> - /* Project -------------------------------------------------------------------*/ - /* player_iface() */ #include "player_iface.h" - /* save_game_file() */ #include "save.h" - /* save_score() */ #include "score.h" - /* xyzzy_...() */ #include "xyzzy.h" - - /* game_action() */ #include "game.h" #include "game_iface.h" diff --git a/modules/game/tmp/Makefile b/modules/game/tmp/Makefile index 1895019..9cea18b 100644 --- a/modules/game/tmp/Makefile +++ b/modules/game/tmp/Makefile @@ -18,7 +18,7 @@ SRC_DIR = $(GAME_DIR)/src/ _ALL = game.o game_iface.o ALL = $(_ALL) game_mod.o -GAME_INC_LIBALX = alx_seed.h +GAME_INC_LIBALX = libalx/alx_seed.h GAME_INC_SAVE = save.h GAME_INC = game.h GAME_DEPS = $(SRC_DIR)/game.c \ diff --git a/modules/menu/src/menu_clui.c b/modules/menu/src/menu_clui.c index 8657dfe..ab81acf 100644 --- a/modules/menu/src/menu_clui.c +++ b/modules/menu/src/menu_clui.c @@ -7,20 +7,15 @@ ******* headers ************************************************************** ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ - /* INFINITY */ #include <math.h> - /* srand() */ #include <stdlib.h> - /* libalx --------------------------------------------------------------------*/ - #include "alx_input.h" - + #include "libalx/alx_input.h" /* Project -------------------------------------------------------------------*/ #include "about.h" #include "game_iface.h" // #include "save.h" #include "start.h" - #include "menu_iface.h" #include "menu_clui.h" diff --git a/modules/menu/src/menu_gui.c b/modules/menu/src/menu_gui.c index 18860d2..5383bfb 100644 --- a/modules/menu/src/menu_gui.c +++ b/modules/menu/src/menu_gui.c @@ -8,25 +8,18 @@ ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ #include <gtk/gtk.h> - /* INFINITY */ #include <math.h> - /* true & false */ #include <stdbool.h> - /* snprintf() */ #include <stdio.h> - /* srand() */ #include <stdlib.h> - /* libalx --------------------------------------------------------------------*/ - #include "alx_input.h" - + #include "libalx/alx_input.h" /* Project -------------------------------------------------------------------*/ #include "about.h" #include "game_iface.h" #include "save.h" #include "score.h" #include "start.h" - #include "menu_iface.h" #include "menu_gui.h" diff --git a/modules/menu/src/menu_iface.c b/modules/menu/src/menu_iface.c index 23eeb73..92e0351 100644 --- a/modules/menu/src/menu_iface.c +++ b/modules/menu/src/menu_iface.c @@ -6,18 +6,11 @@ /****************************************************************************** ******* headers ************************************************************** ******************************************************************************/ -/* * * * * * * * * * - * * * Standard * * * * * * - * * * * * * * * * */ #include <math.h> #include <stdbool.h> -/* * * * * * * * * * - * * * Other * * * * * * * - * * * * * * * * * */ #include "game_iface.h" #include "start.h" - #include "menu_clui.h" #include "menu_tui.h" #include "menu_gui.h" diff --git a/modules/menu/src/menu_tui.c b/modules/menu/src/menu_tui.c index d9e9cc1..4e73a5b 100644 --- a/modules/menu/src/menu_tui.c +++ b/modules/menu/src/menu_tui.c @@ -7,24 +7,18 @@ ******* headers ************************************************************** ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ - /* INFINITY */ #include <math.h> #include <ncurses.h> #include <stdbool.h> - /* srand() */ #include <stdlib.h> - /* libalx --------------------------------------------------------------------*/ - #include "alx_ncur.h" - + #include "libalx/alx_ncur.h" /* Project -------------------------------------------------------------------*/ #include "about.h" #include "game_iface.h" #include "save.h" #include "score.h" #include "start.h" - -/* Module --------------------------------------------------------------------*/ #include "menu_iface.h" #include "menu_tui.h" diff --git a/modules/menu/src/parser.c b/modules/menu/src/parser.c index 37bc16f..f6151be 100644 --- a/modules/menu/src/parser.c +++ b/modules/menu/src/parser.c @@ -8,21 +8,16 @@ ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ #include <getopt.h> - /* FILE & fopen() & snprintf() & FILENAME_MAX */ #include <stdio.h> - /* exit() */ #include <stdlib.h> - /* libalx --------------------------------------------------------------------*/ - #include "alx_seed.h" - + #include "libalx/alx_seed.h" /* Project -------------------------------------------------------------------*/ #include "about.h" #include "game_iface.h" #include "player_iface.h" #include "save.h" #include "start.h" - #include "menu_iface.h" #include "parser.h" diff --git a/modules/menu/tmp/Makefile b/modules/menu/tmp/Makefile index eba74e8..4304d65 100644 --- a/modules/menu/tmp/Makefile +++ b/modules/menu/tmp/Makefile @@ -20,13 +20,13 @@ SRC_DIR = $(MENU_DIR)/src/ _ALL = parser.o menu_iface.o menu_clui.o menu_tui.o menu_gui.o ALL = $(_ALL) menu_mod.o -PARS_INC_LIBALX = alx_seed.h -PARS_INC_ABOUT = about.h -PARS_INC_CTRL = start.h -PARS_INC_GAME = game_iface.h -PARS_INC_PLAY = player_iface.h -PARS_INC_SAVE = save.h -PARS_INC = parser.h menu_iface.h +PARS_INC_LIBALX = libalx/alx_seed.h +PARS_INC_ABOUT = about.h +PARS_INC_CTRL = start.h +PARS_INC_GAME = game_iface.h +PARS_INC_PLAY = player_iface.h +PARS_INC_SAVE = save.h +PARS_INC = parser.h menu_iface.h PARS_DEPS = $(SRC_DIR)/parser.c \ $(patsubst %,$(INC_DIR)/%,$(PARS_INC)) \ $(patsubst %,$(LIBALX_INC_DIR)/%,$(PARS_INC_LIBALX)) \ @@ -43,10 +43,10 @@ PARS_INC_DIRS = -I $(INC_DIR) \ -I $(PLAY_INC_DIR) \ -I $(SAVE_INC_DIR) -MENUI_INC_CTRL = start.h -MENUI_INC_GAME = game_iface.h -MENUI_INC = menu_iface.h menu_clui.h menu_tui.h menu_gui.h -MENUI_DEPS = $(SRC_DIR)/menu_iface.c \ +MENUI_INC_CTRL = start.h +MENUI_INC_GAME = game_iface.h +MENUI_INC = menu_iface.h menu_clui.h menu_tui.h menu_gui.h +MENUI_DEPS = $(SRC_DIR)/menu_iface.c \ $(patsubst %,$(INC_DIR)/%,$(MENUI_INC)) \ $(patsubst %,$(CTRL_INC_DIR)/%,$(MENUI_INC_CTRL)) \ $(patsubst %,$(GAME_INC_DIR)/%,$(MENUI_INC_GAME)) @@ -54,7 +54,7 @@ MENUI_INC_DIRS = -I $(INC_DIR) \ -I $(CTRL_INC_DIR) \ -I $(GAME_INC_DIR) -MENUCLUI_INC_LIBALX = alx_input.h +MENUCLUI_INC_LIBALX = libalx/alx_input.h MENUCLUI_INC_ABOUT = about.h MENUCLUI_INC_CTRL = start.h MENUCLUI_INC_GAME = game_iface.h @@ -74,7 +74,7 @@ MENUCLUI_INC_DIRS = -I $(INC_DIR) \ -I $(GAME_INC_DIR) \ -I $(SAVE_INC_DIR) -MENUTUI_INC_LIBALX = alx_ncur.h +MENUTUI_INC_LIBALX = libalx/alx_ncur.h MENUTUI_INC_ABOUT = about.h MENUTUI_INC_CTRL = start.h MENUTUI_INC_GAME = game_iface.h @@ -94,7 +94,7 @@ MENUTUI_INC_DIRS = -I $(INC_DIR) \ -I $(GAME_INC_DIR) \ -I $(SAVE_INC_DIR) -MENUGUI_INC_LIBALX = alx_input.h +MENUGUI_INC_LIBALX = libalx/alx_input.h MENUGUI_INC_ABOUT = about.h MENUGUI_INC_CTRL = start.h MENUGUI_INC_GAME = game_iface.h diff --git a/modules/player/src/player_clui.c b/modules/player/src/player_clui.c index d08e676..6afd8cd 100644 --- a/modules/player/src/player_clui.c +++ b/modules/player/src/player_clui.c @@ -8,15 +8,10 @@ ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ #include <stdbool.h> - /* printf() & sscanf() */ #include <stdio.h> #include <wchar.h> - /* Project -------------------------------------------------------------------*/ - /* struct Game_Iface_Out */ #include "game_iface.h" - - /* struct Player_Iface_Position */ #include "player_iface.h" #include "player_clui.h" diff --git a/modules/player/src/player_gui.c b/modules/player/src/player_gui.c index f68e49c..5f1bc1f 100644 --- a/modules/player/src/player_gui.c +++ b/modules/player/src/player_gui.c @@ -7,25 +7,16 @@ ******* headers ************************************************************** ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ - #include <gtk/gtk.h> - /* fmod */ #include <math.h> - /* true & false */ #include <stdbool.h> - /* snprintf() */ #include <stdio.h> - +/* Packages ------------------------------------------------------------------*/ + #include <gtk/gtk.h> /* libalx ------------------------------------------------------------------*/ - /* alx_sscan_fname() */ - #include "alx_input.h" - + #include "libalx/alx_input.h" /* Project -------------------------------------------------------------------*/ - /* struct Game_Iface_Out */ #include "game_iface.h" - /* window_gui */ #include "menu_gui.h" - - /* struct Player_Iface_Position */ #include "player_iface.h" #include "player_gui.h" diff --git a/modules/player/src/player_iface.c b/modules/player/src/player_iface.c index ee3b30f..a454f82 100644 --- a/modules/player/src/player_iface.c +++ b/modules/player/src/player_iface.c @@ -7,18 +7,12 @@ ******* headers ************************************************************** ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ - /* snprintf() & fflush() */ #include <stdio.h> - /* Project -------------------------------------------------------------------*/ - /* struct Game_Iface_... */ #include "game_iface.h" - /* game_tui() */ #include "player_clui.h" - /* game_tui() */ #include "player_tui.h" - /* game_gui() */ #include "player_gui.h" #include "player_iface.h" diff --git a/modules/player/src/player_tui.c b/modules/player/src/player_tui.c index 899b054..4313d2f 100644 --- a/modules/player/src/player_tui.c +++ b/modules/player/src/player_tui.c @@ -7,20 +7,12 @@ ******* headers ************************************************************** ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ - /* WINDOW & wgetch() & KEY_... & ... */ #include <ncurses.h> - /* wchar_t */ - #include <wchar.h> - /* libalx ------------------------------------------------------------------*/ - /* alx_..._curses() & alx_ncur_prn_...() */ - #include "alx_ncur.h" - + #include "libalx/alx_ncur.h" /* Project -------------------------------------------------------------------*/ - /* struct Game_Iface_Out */ #include "game_iface.h" - /* struct Player_Iface_Position */ #include "player_iface.h" #include "player_tui.h" @@ -60,11 +52,11 @@ static void show_board (const struct Game_Iface_Out *board, static void board_loop (const struct Game_Iface_Out *board, const struct Player_Iface_Position *position); -static void highlight_cursor(wchar_t c, +static void highlight_cursor(int c, const struct Player_Iface_Position *position); -static wchar_t set_char (int tile); -static void show_char (int row, int col, wchar_t c); +static int set_char (int tile); +static void show_char (int row, int col, int c); /* Input */ static int usr_input (void); /* Help */ @@ -224,7 +216,7 @@ static void board_loop_start(const struct Player_Iface_Position *position) int j; int k; int l; - wchar_t c; + int c; c = PLAYER_TUI_CHAR_HIDDEN_FIELD; @@ -278,7 +270,7 @@ static void board_loop (const struct Game_Iface_Out *board, int j; int k; int l; - wchar_t c; + int c; for (i = 0; i < board->rows; i++) { k = 1 + i; @@ -317,7 +309,7 @@ static void board_loop (const struct Game_Iface_Out *board, } } -static void highlight_cursor(wchar_t c, +static void highlight_cursor(int c, const struct Player_Iface_Position *position) { int k; @@ -339,9 +331,9 @@ static void highlight_cursor(wchar_t c, } } -static wchar_t set_char (int tile) +static int set_char (int tile) { - wchar_t c; + int c; switch (tile) { case GAME_IFACE_VIS_KBOOM: @@ -406,7 +398,7 @@ static wchar_t set_char (int tile) return c; } -static void show_char (int row, int col, wchar_t c) +static void show_char (int row, int col, int c) { int pair; @@ -482,12 +474,12 @@ static void show_char (int row, int col, wchar_t c) * * * * * * * * * */ static int usr_input (void) { - wchar_t ch; + int c; int action; - ch = wgetch(win_board); + c = wgetch(win_board); - switch (ch) { + switch (c) { case '+': case '\r': case '\n': @@ -516,14 +508,14 @@ static int usr_input (void) /* Wait for special sequence "xyzzy" */ wtimeout(win_board, 1000); - ch = wgetch(win_board); - if (ch == 'y') { - ch = wgetch(win_board); - if (ch == 'z') { - ch = wgetch(win_board); - if (ch == 'z') { - ch = wgetch(win_board); - if (ch == 'y') { + c = wgetch(win_board); + if (c == 'y') { + c = wgetch(win_board); + if (c == 'z') { + c = wgetch(win_board); + if (c == 'z') { + c = wgetch(win_board); + if (c == 'y') { action = PLAYER_IFACE_ACT_XYZZY_ON; } } diff --git a/modules/player/tmp/Makefile b/modules/player/tmp/Makefile index 0c4838b..0aae428 100644 --- a/modules/player/tmp/Makefile +++ b/modules/player/tmp/Makefile @@ -33,7 +33,7 @@ PLAYCLUI_DEPS = $(SRC_DIR)/player_clui.c \ PLAYCLUI_INC_DIRS = -I $(INC_DIR) \ -I $(GAME_INC_DIR) -PLAYTUI_INC_LIBALX = alx_ncur.h +PLAYTUI_INC_LIBALX = libalx/alx_ncur.h PLAYTUI_INC_GAME = game_iface.h PLAYTUI_INC = player_tui.h player_iface.h PLAYTUI_DEPS = $(SRC_DIR)/player_tui.c \ @@ -44,10 +44,10 @@ PLAYTUI_INC_DIRS = -I $(INC_DIR) \ -I $(LIBALX_INC_DIR) \ -I $(GAME_INC_DIR) -PLAYGUI_INC_LIBALX = alx_input.h -PLAYGUI_INC_GAME = game_iface.h -PLAYGUI_INC_MENU = menu_gui.h -PLAYGUI_INC = player_gui.h player_iface.h +PLAYGUI_INC_LIBALX = libalx/alx_input.h +PLAYGUI_INC_GAME = game_iface.h +PLAYGUI_INC_MENU = menu_gui.h +PLAYGUI_INC = player_gui.h player_iface.h PLAYGUI_DEPS = $(SRC_DIR)/player_gui.c \ $(patsubst %,$(INC_DIR)/%,$(PLAYGUI_INC)) \ $(patsubst %,$(LIBALX_INC_DIR)/%,$(PLAYGUI_INC_LIBALX)) \ diff --git a/modules/save/src/save.c b/modules/save/src/save.c index d1b49ae..5e2c647 100644 --- a/modules/save/src/save.c +++ b/modules/save/src/save.c @@ -8,26 +8,17 @@ ******* headers ************************************************************** ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ - /* errno */ #include <errno.h> - /* bool */ #include <stdbool.h> - /* fscanf() & fprintf() & FILE & FILENAME_MAX & snprintf() */ #include <stdio.h> - /* getenv() & exit() */ #include <stdlib.h> - /* Linux ---------------------------------------------------------------------*/ /* mkdir */ #include <sys/stat.h> - /* Project -------------------------------------------------------------------*/ - /* struct Game_Board */ #include "game.h" - /* player_iface_save_name() */ #include "player_iface.h" -/* Module --------------------------------------------------------------------*/ #include "save.h" diff --git a/modules/save/src/score.c b/modules/save/src/score.c index 2a8d274..055b8f4 100644 --- a/modules/save/src/score.c +++ b/modules/save/src/score.c @@ -9,23 +9,14 @@ ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ #include <errno.h> - /* fscanf() & fprintf() & FILE & FILENAME_MAX & snprintf() */ #include <stdio.h> - /* exit() */ #include <stdlib.h> - /* time_t & time() & struct tm & localtime() */ #include <time.h> - /* Project -------------------------------------------------------------------*/ - /* struct Game_Board */ #include "game.h" - /* enum Game_Iface_Level */ #include "game_iface.h" - /* player_iface_score_name() */ #include "player_iface.h" -/* Module --------------------------------------------------------------------*/ - /* saved_name */ #include "save.h" #include "score.h" diff --git a/modules/xyzzy/src/xyzzy.c b/modules/xyzzy/src/xyzzy.c index 7bd05cf..6b7ad0a 100644 --- a/modules/xyzzy/src/xyzzy.c +++ b/modules/xyzzy/src/xyzzy.c @@ -8,9 +8,7 @@ ******************************************************************************/ /* Standard C ----------------------------------------------------------------*/ #include <stdbool.h> - /* Project -------------------------------------------------------------------*/ - /* game_action() */ #include "game_iface.h" #include "xyzzy.h" @@ -6,19 +6,12 @@ /****************************************************************************** ******* headers ************************************************************** ******************************************************************************/ -/* * * * * * * * * * - * * * Standard * * * * * * - * * * * * * * * * */ - #include <gtk/gtk.h> - /* getchar() */ #include <stdio.h> -/* * * * * * * * * * - * * * Other * * * * * * * - * * * * * * * * * */ - #include "alx_ncur.h" + #include <gtk/gtk.h> + + #include "libalx/alx_ncur.h" - /* about_init() & print_cpright() */ #include "about.h" #include "game.h" #include "menu_iface.h" diff --git a/tmp/Makefile b/tmp/Makefile index d0c0919..b323a91 100644 --- a/tmp/Makefile +++ b/tmp/Makefile @@ -30,7 +30,7 @@ SRC_DIR = $(MAIN_DIR)/src/ ALL = main.o -MAIN_INC_LIBALX = alx_ncur.h +MAIN_INC_LIBALX = libalx/alx_ncur.h MAIN_INC_ABOUT = about.h MAIN_INC_CTRL = start.h MAIN_INC_GAME = game.h |