Author: cazfi Date: Mon Feb 8 20:17:46 2016 New Revision: 31823 URL: http://svn.gna.org/viewcvs/freeciv?rev=31823&view=rev Log: Made FREECIV_HAVE_LIBREADLINE public in freeciv_config.h
See patch #6912 Modified: branches/S2_6/dependencies/lua-5.3/src/localluaconf.h branches/S2_6/gen_headers/freeciv_config.h.in branches/S2_6/m4/readline.m4 branches/S2_6/server/console.c branches/S2_6/server/sernet.c branches/S2_6/server/stdinhand.c branches/S2_6/server/stdinhand.h Modified: branches/S2_6/dependencies/lua-5.3/src/localluaconf.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/dependencies/lua-5.3/src/localluaconf.h?rev=31823&r1=31822&r2=31823&view=diff ============================================================================== --- branches/S2_6/dependencies/lua-5.3/src/localluaconf.h (original) +++ branches/S2_6/dependencies/lua-5.3/src/localluaconf.h Mon Feb 8 20:17:46 2016 @@ -33,7 +33,7 @@ #define LUA_USE_GMTIME_R #endif -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE #define LUA_USE_READLINE #endif Modified: branches/S2_6/gen_headers/freeciv_config.h.in URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/gen_headers/freeciv_config.h.in?rev=31823&r1=31822&r2=31823&view=diff ============================================================================== --- branches/S2_6/gen_headers/freeciv_config.h.in (original) +++ branches/S2_6/gen_headers/freeciv_config.h.in Mon Feb 8 20:17:46 2016 @@ -77,6 +77,9 @@ /* Have standard compliant stdbool.h */ #undef FREECIV_HAVE_STDBOOL_H +/* Readline support */ +#undef FREECIV_HAVE_LIBREADLINE + /* Have socklen_t type defined */ #undef FREECIV_HAVE_SOCKLEN_T Modified: branches/S2_6/m4/readline.m4 URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/m4/readline.m4?rev=31823&r1=31822&r2=31823&view=diff ============================================================================== --- branches/S2_6/m4/readline.m4 (original) +++ branches/S2_6/m4/readline.m4 Mon Feb 8 20:17:46 2016 @@ -113,7 +113,7 @@ have_readline_lib=1, have_readline_lib=0) if test "$have_readline_lib" = "1"; then SRV_LIB_LIBS="-lreadline $SRV_LIB_LIBS $HAVE_TERMCAP" - AC_DEFINE_UNQUOTED([HAVE_LIBREADLINE], [1], [Readline support]) + AC_DEFINE_UNQUOTED([FREECIV_HAVE_LIBREADLINE], [1], [Readline support]) else if test "$WITH_READLINE" = "yes"; then AC_MSG_ERROR(Specified --with-readline but the Modified: branches/S2_6/server/console.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/console.c?rev=31823&r1=31822&r2=31823&view=diff ============================================================================== --- branches/S2_6/server/console.c (original) +++ branches/S2_6/server/console.c Mon Feb 8 20:17:46 2016 @@ -19,7 +19,7 @@ #include <stdio.h> #include <string.h> -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE #include <readline/readline.h> #endif @@ -42,7 +42,7 @@ static bool console_show_prompt = FALSE; static bool console_prompt_is_showing = FALSE; static bool console_rfcstyle = FALSE; -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE static bool readline_received_enter = TRUE; #else static int con_dump(enum rfc_status rfc_status, const char *message, ...); @@ -87,19 +87,20 @@ ************************************************************************/ static void con_update_prompt(void) { - if (console_prompt_is_showing || !console_show_prompt) + if (console_prompt_is_showing || !console_show_prompt) { return; - -#ifdef HAVE_LIBREADLINE + } + +#ifdef FREECIV_HAVE_LIBREADLINE if (readline_received_enter) { readline_received_enter = FALSE; } else { rl_forced_update_display(); } -#else /* HAVE_LIBREADLINE */ +#else /* FREECIV_HAVE_LIBREADLINE */ con_dump(C_READY,"> "); con_flush(); -#endif /* HAVE_LIBREADLINE */ +#endif /* FREECIV_HAVE_LIBREADLINE */ console_prompt_is_showing = TRUE; } @@ -157,7 +158,7 @@ log_close(); } -#ifndef HAVE_LIBREADLINE +#ifndef FREECIV_HAVE_LIBREADLINE /************************************************************************ Write to console without line-break, don't print prompt. ************************************************************************/ @@ -181,7 +182,7 @@ console_prompt_is_showing = FALSE; return (int) strlen(buf); } -#endif /* HAVE_LIBREADLINE */ +#endif /* FREECIV_HAVE_LIBREADLINE */ /************************************************************************ Write to console and add line-break, and show prompt if required. @@ -288,7 +289,7 @@ void con_prompt_enter(void) { console_prompt_is_showing = FALSE; -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE readline_received_enter = TRUE; #endif } @@ -299,7 +300,7 @@ void con_prompt_enter_clear(void) { console_prompt_is_showing = TRUE; -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE readline_received_enter = FALSE; #endif } Modified: branches/S2_6/server/sernet.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/sernet.c?rev=31823&r1=31822&r2=31823&view=diff ============================================================================== --- branches/S2_6/server/sernet.c (original) +++ branches/S2_6/server/sernet.c Mon Feb 8 20:17:46 2016 @@ -41,7 +41,7 @@ #ifdef HAVE_PWD_H #include <pwd.h> #endif -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE #include <readline/history.h> #include <readline/readline.h> #endif @@ -143,8 +143,8 @@ /* Avoid compiler warning about defined, but unused function * by defining it only when needed */ -#if defined(HAVE_LIBREADLINE) || \ - (!defined(SOCKET_ZERO_ISNT_STDIN) && !defined(HAVE_LIBREADLINE)) +#if defined(FREECIV_HAVE_LIBREADLINE) || \ + (!defined(SOCKET_ZERO_ISNT_STDIN) && !defined(FREECIV_HAVE_LIBREADLINE)) /***************************************************************************** This happens if you type an EOF character with nothing on the current line. *****************************************************************************/ @@ -159,9 +159,9 @@ #endif /* SOCKET_ZERO_ISNT_STDIN */ } -#endif /* HAVE_LIBREADLINE || (!SOCKET_ZERO_ISNT_STDIN && !HAVE_LIBREADLINE) */ - -#ifdef HAVE_LIBREADLINE +#endif /* FREECIV_HAVE_LIBREADLINE || (!SOCKET_ZERO_ISNT_STDIN && !FREECIV_HAVE_LIBREADLINE) */ + +#ifdef FREECIV_HAVE_LIBREADLINE /****************************************************************************/ #define HISTORY_FILENAME "freeciv-server_history" @@ -199,7 +199,7 @@ readline_handled_input = TRUE; } -#endif /* HAVE_LIBREADLINE */ +#endif /* FREECIV_HAVE_LIBREADLINE */ /**************************************************************************** Close the connection (very low-level). See also @@ -262,7 +262,7 @@ fc_closesocket(socklan); } -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE if (history_file) { write_history(history_file); history_truncate_file(history_file, HISTORY_LENGTH); @@ -270,7 +270,7 @@ history_file = NULL; clear_history(); } -#endif +#endif /* FREECIV_HAVE_LIBREADLINE */ send_server_info_to_metaserver(META_GOODBYE); server_close_meta(); @@ -508,7 +508,7 @@ con_prompt_init(); -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE { if (!no_input && !readline_initialized) { char *home_dir = user_home_dir(); @@ -544,7 +544,7 @@ atexit(rl_callback_handler_remove); } } -#endif /* HAVE_LIBREADLINE */ +#endif /* FREECIV_HAVE_LIBREADLINE */ while (TRUE) { con_prompt_on(); /* accepting new input */ @@ -798,14 +798,14 @@ } #else /* !SOCKET_ZERO_ISNT_STDIN */ if (!no_input && FD_ISSET(0, &readfs)) { /* input from server operator */ -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE rl_callback_read_char(); if (readline_handled_input) { readline_handled_input = FALSE; con_prompt_enter_clear(); } continue; -#else /* !HAVE_LIBREADLINE */ +#else /* !FREECIV_HAVE_LIBREADLINE */ ssize_t didget; char *buffer = NULL; /* Must be NULL when calling getline() */ char *buf_internal; @@ -842,7 +842,7 @@ free(buf_internal); } free(buffer); -#endif /* !HAVE_LIBREADLINE */ +#endif /* !FREECIV_HAVE_LIBREADLINE */ } else #endif /* !SOCKET_ZERO_ISNT_STDIN */ Modified: branches/S2_6/server/stdinhand.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/stdinhand.c?rev=31823&r1=31822&r2=31823&view=diff ============================================================================== --- branches/S2_6/server/stdinhand.c (original) +++ branches/S2_6/server/stdinhand.c Mon Feb 8 20:17:46 2016 @@ -20,7 +20,7 @@ #include <stdlib.h> #include <string.h> -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE #include <readline/readline.h> #endif @@ -1536,7 +1536,7 @@ return setting_name(setting_by_number(i)); } -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE /************************************************************************** Returns possible parameters for the /show command. **************************************************************************/ @@ -1550,7 +1550,7 @@ return optname_accessor(i-OLEVELS_NUM-1); } } -#endif /* HAVE_LIBREADLINE */ +#endif /* FREECIV_HAVE_LIBREADLINE */ /************************************************************************** Set timeout options. @@ -6531,7 +6531,7 @@ return FALSE; } -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE /********************* RL completion functions ***************************/ /* To properly complete both commands, player names, options and filenames there is one array per type of completion with the commands that @@ -7243,4 +7243,4 @@ return (matches); } -#endif /* HAVE_LIBREADLINE */ +#endif /* FREECIV_HAVE_LIBREADLINE */ Modified: branches/S2_6/server/stdinhand.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/stdinhand.h?rev=31823&r1=31822&r2=31823&view=diff ============================================================================== --- branches/S2_6/server/stdinhand.h (original) +++ branches/S2_6/server/stdinhand.h Mon Feb 8 20:17:46 2016 @@ -64,7 +64,7 @@ bool conn_is_kicked(struct connection *pconn, int *time_remaining); -#ifdef HAVE_LIBREADLINE +#ifdef FREECIV_HAVE_LIBREADLINE char **freeciv_completion(const char *text, int start, int end); #endif _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits