Commit 5308d0c6 authored by Vysheng's avatar Vysheng

Added --disable-extf to configure script

parent 84795ec0
...@@ -19,8 +19,10 @@ ...@@ -19,8 +19,10 @@
*/ */
#include "mtproto-common.h" #include "mtproto-common.h"
#include "config.h"
#include <string.h> #include <string.h>
#ifndef DISABLE_EXTF
static int cur_token_len; static int cur_token_len;
static char *cur_token; static char *cur_token;
static int cur_token_real_len; static int cur_token_real_len;
...@@ -435,3 +437,4 @@ char *tglf_extf_fetch (struct paramed_type *T) { ...@@ -435,3 +437,4 @@ char *tglf_extf_fetch (struct paramed_type *T) {
if (fetch_type_any (T) < 0) { return 0; } if (fetch_type_any (T) < 0) { return 0; }
return out_buf; return out_buf;
} }
#endif
/* config.h.in. Generated from configure.ac by autoheader. */ /* config.h.in. Generated from configure.ac by autoheader. */
/* disable extf queries */
#undef DISABLE_EXTF
/* Use libevent v1 */ /* Use libevent v1 */
#undef EVENT_V1 #undef EVENT_V1
......
...@@ -692,6 +692,7 @@ enable_option_checking ...@@ -692,6 +692,7 @@ enable_option_checking
with_openssl with_openssl
with_zlib with_zlib
enable_libconfig enable_libconfig
enable_extf
enable_liblua enable_liblua
with_progname with_progname
' '
...@@ -1317,6 +1318,7 @@ Optional Features: ...@@ -1317,6 +1318,7 @@ Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-libconfig/--disable-libconfig --enable-libconfig/--disable-libconfig
--enable-extf/--disable-extf
--enable-liblua/--disable-liblua --enable-liblua/--disable-liblua
Optional Packages: Optional Packages:
...@@ -4502,6 +4504,18 @@ fi ...@@ -4502,6 +4504,18 @@ fi
fi fi
# Check whether --enable-extf was given.
if test "${enable_extf+set}" = set; then :
enableval=$enable_extf;
if test "x$enableval" = "xno" ; then
$as_echo "#define DISABLE_EXTF 1" >>confdefs.h
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for liblua" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for liblua" >&5
$as_echo_n "checking for liblua... " >&6; } $as_echo_n "checking for liblua... " >&6; }
# Check whether --enable-liblua was given. # Check whether --enable-liblua was given.
......
...@@ -52,6 +52,14 @@ AC_ARG_ENABLE(libconfig,[--enable-libconfig/--disable-libconfig], ...@@ -52,6 +52,14 @@ AC_ARG_ENABLE(libconfig,[--enable-libconfig/--disable-libconfig],
AC_CHECK_LIB([config],[config_init],[],AC_MSG_ERROR([No libconfig found. Try --disable-libconfig])) AC_CHECK_LIB([config],[config_init],[],AC_MSG_ERROR([No libconfig found. Try --disable-libconfig]))
]) ])
AC_ARG_ENABLE(extf,[--enable-extf/--disable-extf],
[
if test "x$enableval" = "xno" ; then
AC_DEFINE([DISABLE_EXTF],[1],[disable extf queries])
fi
],[
])
AC_MSG_CHECKING([for liblua]) AC_MSG_CHECKING([for liblua])
AC_ARG_ENABLE(liblua,[--enable-liblua/--disable-liblua], AC_ARG_ENABLE(liblua,[--enable-liblua/--disable-liblua],
[ [
......
This diff is collapsed.
...@@ -1252,7 +1252,10 @@ int complete_command_list (int index, const char *text, int len, char **R) { ...@@ -1252,7 +1252,10 @@ int complete_command_list (int index, const char *text, int len, char **R) {
} }
char *command_generator (const char *text, int state) { char *command_generator (const char *text, int state) {
static int len, index; #ifndef DISABLE_EXTF
static int len;
#endif
static int index;
static enum command_argument mode; static enum command_argument mode;
static char *command_pos; static char *command_pos;
static int command_len; static int command_len;
...@@ -1267,7 +1270,9 @@ char *command_generator (const char *text, int state) { ...@@ -1267,7 +1270,9 @@ char *command_generator (const char *text, int state) {
c = rl_line_buffer[rl_point]; c = rl_line_buffer[rl_point];
rl_line_buffer[rl_point] = 0; rl_line_buffer[rl_point] = 0;
if (!state) { if (!state) {
#ifndef DISABLE_EXTF
len = strlen (text); len = strlen (text);
#endif
index = -1; index = -1;
mode = get_complete_mode (); mode = get_complete_mode ();
...@@ -1314,10 +1319,12 @@ char *command_generator (const char *text, int state) { ...@@ -1314,10 +1319,12 @@ char *command_generator (const char *text, int state) {
index = complete_string_list (modifiers, index, command_pos, command_len, &R); index = complete_string_list (modifiers, index, command_pos, command_len, &R);
if (c) { rl_line_buffer[rl_point] = c; } if (c) { rl_line_buffer[rl_point] = c; }
return R; return R;
#ifndef DISABLE_EXTF
case ca_extf: case ca_extf:
index = tglf_extf_autocomplete (text, len, index, &R, rl_line_buffer, rl_point); index = tglf_extf_autocomplete (text, len, index, &R, rl_line_buffer, rl_point);
if (c) { rl_line_buffer[rl_point] = c; } if (c) { rl_line_buffer[rl_point] = c; }
return R; return R;
#endif
default: default:
if (c) { rl_line_buffer[rl_point] = c; } if (c) { rl_line_buffer[rl_point] = c; }
return 0; return 0;
......
...@@ -3809,6 +3809,7 @@ void tgl_do_import_card (int size, int *card, void (*callback)(void *callback_ex ...@@ -3809,6 +3809,7 @@ void tgl_do_import_card (int size, int *card, void (*callback)(void *callback_ex
} }
/* }}} */ /* }}} */
#ifndef DISABLE_EXTF
static int ext_query_on_answer (struct query *q UU) { static int ext_query_on_answer (struct query *q UU) {
if (q->callback) { if (q->callback) {
char *buf = tglf_extf_fetch (q->type); char *buf = tglf_extf_fetch (q->type);
...@@ -3831,6 +3832,13 @@ void tgl_do_send_extf (char *data, int data_len, void (*callback)(void *callback ...@@ -3831,6 +3832,13 @@ void tgl_do_send_extf (char *data, int data_len, void (*callback)(void *callback
tglq_send_query (tgl_state.DC_working, packet_ptr - packet_buffer, packet_buffer, &ext_query_methods, 0, callback, callback_extra); tglq_send_query (tgl_state.DC_working, packet_ptr - packet_buffer, packet_buffer, &ext_query_methods, 0, callback, callback_extra);
} }
} }
#else
void tgl_do_send_extf (char *data, int data_len, void (*callback)(void *callback_extra, int success, char *buf), void *callback_extra) {
if (callback) {
callback (callback_extra, 0, 0);
}
}
#endif
static void set_flag_4 (void *_D, int success) { static void set_flag_4 (void *_D, int success) {
struct tgl_dc *D = _D; struct tgl_dc *D = _D;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment