Commit 5308d0c6 authored by Vysheng's avatar Vysheng

Added --disable-extf to configure script

parent 84795ec0
......@@ -19,8 +19,10 @@
*/
#include "mtproto-common.h"
#include "config.h"
#include <string.h>
#ifndef DISABLE_EXTF
static int cur_token_len;
static char *cur_token;
static int cur_token_real_len;
......@@ -435,3 +437,4 @@ char *tglf_extf_fetch (struct paramed_type *T) {
if (fetch_type_any (T) < 0) { return 0; }
return out_buf;
}
#endif
/* config.h.in. Generated from configure.ac by autoheader. */
/* disable extf queries */
#undef DISABLE_EXTF
/* Use libevent v1 */
#undef EVENT_V1
......
......@@ -692,6 +692,7 @@ enable_option_checking
with_openssl
with_zlib
enable_libconfig
enable_extf
enable_liblua
with_progname
'
......@@ -1317,6 +1318,7 @@ Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-libconfig/--disable-libconfig
--enable-extf/--disable-extf
--enable-liblua/--disable-liblua
Optional Packages:
......@@ -4502,6 +4504,18 @@ 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_n "checking for liblua... " >&6; }
# Check whether --enable-liblua was given.
......
......@@ -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_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_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) {
}
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 char *command_pos;
static int command_len;
......@@ -1267,7 +1270,9 @@ char *command_generator (const char *text, int state) {
c = rl_line_buffer[rl_point];
rl_line_buffer[rl_point] = 0;
if (!state) {
#ifndef DISABLE_EXTF
len = strlen (text);
#endif
index = -1;
mode = get_complete_mode ();
......@@ -1314,10 +1319,12 @@ char *command_generator (const char *text, int state) {
index = complete_string_list (modifiers, index, command_pos, command_len, &R);
if (c) { rl_line_buffer[rl_point] = c; }
return R;
#ifndef DISABLE_EXTF
case ca_extf:
index = tglf_extf_autocomplete (text, len, index, &R, rl_line_buffer, rl_point);
if (c) { rl_line_buffer[rl_point] = c; }
return R;
#endif
default:
if (c) { rl_line_buffer[rl_point] = c; }
return 0;
......
......@@ -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) {
if (q->callback) {
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
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) {
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