diff --git a/Makefile.in b/Makefile.in index 998338bd..f289e3ca 100644 --- a/Makefile.in +++ b/Makefile.in @@ -87,7 +87,6 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ -CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -127,8 +126,6 @@ READLINE_CFLAGS = @READLINE_CFLAGS@ READLINE_LIBS = @READLINE_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ -SOCI_CXXFLAGS = @SOCI_CXXFLAGS@ -SOCI_LIBS = @SOCI_LIBS@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ diff --git a/configure b/configure index eb306d74..280eefd1 100755 --- a/configure +++ b/configure @@ -724,11 +724,6 @@ SQLITE3_CFLAGS SQLITE3_LDFLAGS SQLITE3_LIBS SQLITE3_VERSION -CXXCPP -SOCI_LIBS -SOCI_CXXFLAGS -HAVE_SOCI_TRUE -HAVE_SOCI_FALSE HAVE_LIBSQLITE3_TRUE HAVE_LIBSQLITE3_FALSE LIBOBJS @@ -745,8 +740,7 @@ CPPFLAGS CCC CC CFLAGS -CPP -CXXCPP' +CPP' # Initialize some variables set by options. @@ -1338,7 +1332,6 @@ Optional Packages: --with-readline[=prefix] compile xmlreadline part (via libreadline check) --with-sqlite3=[ARG] use SQLite 3 library [default=yes], optionally specify the prefix for sqlite3 library - --with-soci[=prefix] compile soci part (via libsoci check) Some influential environment variables: CXX C++ compiler command @@ -1351,7 +1344,6 @@ Some influential environment variables: CC C compiler command CFLAGS C compiler flags CPP C preprocessor - CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -6819,428 +6811,6 @@ _ACEOF -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -{ echo "$as_me:$LINENO: checking lib soci" >&5 -echo $ECHO_N "checking lib soci... $ECHO_C" >&6; } - -# Check whether --with-soci was given. -if test "${with_soci+set}" = set; then - withval=$with_soci; -else - with_soci="yes" -fi - -if test ".$with_soci" = ".no" ; then - { echo "$as_me:$LINENO: result: disabled" >&5 -echo "${ECHO_T}disabled" >&6; } - { { echo "$as_me:$LINENO: error: soci required to build" >&5 -echo "$as_me: error: soci required to build" >&2;} - { (exit 1); exit 1; }; } -else - { echo "$as_me:$LINENO: result: (testing)" >&5 -echo "${ECHO_T}(testing)" >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -for ac_header in soci/soci.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to timothyshanestack@gmail.com ## -## ------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - if test "$ac_cv_header_soci_soci_h" = "yes" ; then - if test ".$with_soci" == ".yes"; then - with_soci="/usr/local/include" - fi - SOCI_CXXFLAGS="-I${with_soci}/soci -I${with_soci}/soci/sqlite3" - SOCI_LIBS="-lsoci_sqlite3-gcc-3_0 -lsoci_core-gcc-3_0" - fi -fi - - - - if test x"$SOCI_CXXFLAGS" != x""; then - HAVE_SOCI_TRUE= - HAVE_SOCI_FALSE='#' -else - HAVE_SOCI_TRUE='#' - HAVE_SOCI_FALSE= -fi - if test -n "$SQLITE3_CFLAGS" -a -n "$SQLITE3_LDFLAGS"; then @@ -7409,13 +6979,6 @@ echo "$as_me: error: conditional \"HAVE_OBJCOPY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${HAVE_SOCI_TRUE}" && test -z "${HAVE_SOCI_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"HAVE_SOCI\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"HAVE_SOCI\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi if test -z "${HAVE_LIBSQLITE3_TRUE}" && test -z "${HAVE_LIBSQLITE3_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBSQLITE3\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -8107,18 +7670,13 @@ SQLITE3_CFLAGS!$SQLITE3_CFLAGS$ac_delim SQLITE3_LDFLAGS!$SQLITE3_LDFLAGS$ac_delim SQLITE3_LIBS!$SQLITE3_LIBS$ac_delim SQLITE3_VERSION!$SQLITE3_VERSION$ac_delim -CXXCPP!$CXXCPP$ac_delim -SOCI_LIBS!$SOCI_LIBS$ac_delim -SOCI_CXXFLAGS!$SOCI_CXXFLAGS$ac_delim -HAVE_SOCI_TRUE!$HAVE_SOCI_TRUE$ac_delim -HAVE_SOCI_FALSE!$HAVE_SOCI_FALSE$ac_delim HAVE_LIBSQLITE3_TRUE!$HAVE_LIBSQLITE3_TRUE$ac_delim HAVE_LIBSQLITE3_FALSE!$HAVE_LIBSQLITE3_FALSE$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 20; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 15; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.in b/configure.in index d32717e6..e7147887 100644 --- a/configure.in +++ b/configure.in @@ -59,8 +59,6 @@ AX_PATH_LIB_PCRE([], [AC_MSG_ERROR([pcre required to build])]) AX_PATH_LIB_READLINE([], [AC_MSG_ERROR([readline required to build])]) AX_LIB_SQLITE3("3.0.0") -AX_PATH_LIB_SOCI([], [AC_MSG_ERROR([soci required to build])]) -AM_CONDITIONAL(HAVE_SOCI, test x"$SOCI_CXXFLAGS" != x"") AM_CONDITIONAL(HAVE_LIBSQLITE3, [ test -n "$SQLITE3_CFLAGS" -a -n "$SQLITE3_LDFLAGS"]) diff --git a/lnav.m4 b/lnav.m4 index 704e8f62..d26e51f0 100644 --- a/lnav.m4 +++ b/lnav.m4 @@ -114,29 +114,3 @@ AC_DEFUN([MP_WITH_CURSES], LIBS="$mp_save_LIBS" AC_SUBST(CURSES_LIB) ])dnl - - -AC_DEFUN([AX_PATH_LIB_SOCI],[dnl -AC_MSG_CHECKING([lib soci]) -AC_ARG_WITH(soci, -[ --with-soci[[=prefix]] compile soci part (via libsoci check)],, - with_soci="yes") -if test ".$with_soci" = ".no" ; then - AC_MSG_RESULT([disabled]) - m4_ifval($2,$2) -else - AC_MSG_RESULT([(testing)]) - AC_LANG_PUSH([C++]) - AC_CHECK_HEADERS(soci/soci.h) - AC_LANG_POP([C++]) - if test "$ac_cv_header_soci_soci_h" = "yes" ; then - if test ".$with_soci" == ".yes"; then - with_soci="/usr/local/include" - fi - SOCI_CXXFLAGS="-I${with_soci}/soci -I${with_soci}/soci/sqlite3" - SOCI_LIBS="-lsoci_sqlite3-gcc-3_0 -lsoci_core-gcc-3_0" - fi -fi -AC_SUBST([SOCI_LIBS]) -AC_SUBST([SOCI_CXXFLAGS]) -]) diff --git a/src/Makefile.am b/src/Makefile.am index 65b3640f..29f33431 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,15 +28,13 @@ AM_LDFLAGS = \ -static AM_CPPFLAGS = \ - $(SQLITE3_CFLAGS) \ - $(SOCI_CXXFLAGS) + $(SQLITE3_CFLAGS) LDADD = \ libdiag.a \ $(READLINE_LIBS) \ $(CURSES_LIB) \ $(HELP_O) \ - $(SOCI_LIBS) \ /usr/lib/libsqlite3.a \ -ldl \ -lz \ diff --git a/src/Makefile.in b/src/Makefile.in index d56707a8..33788fec 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -72,7 +72,7 @@ am__DEPENDENCIES_1 = @HAVE_OBJCOPY_TRUE@am__DEPENDENCIES_2 = help.o lnav_DEPENDENCIES = libdiag.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_1) /usr/lib/libsqlite3.a + /usr/lib/libsqlite3.a DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -101,7 +101,6 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ -CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -141,8 +140,6 @@ READLINE_CFLAGS = @READLINE_CFLAGS@ READLINE_LIBS = @READLINE_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ -SOCI_CXXFLAGS = @SOCI_CXXFLAGS@ -SOCI_LIBS = @SOCI_LIBS@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ @@ -211,15 +208,13 @@ AM_LDFLAGS = \ -static AM_CPPFLAGS = \ - $(SQLITE3_CFLAGS) \ - $(SOCI_CXXFLAGS) + $(SQLITE3_CFLAGS) LDADD = \ libdiag.a \ $(READLINE_LIBS) \ $(CURSES_LIB) \ $(HELP_O) \ - $(SOCI_LIBS) \ /usr/lib/libsqlite3.a \ -ldl \ -lz \ diff --git a/src/config.h.in b/src/config.h.in index b39a576e..c51c22a8 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -33,9 +33,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SOCI_SOCI_H - /* sqlite3 */ #undef HAVE_SQLITE3 diff --git a/src/lnav.cc b/src/lnav.cc index 57a77e14..6a5e6b8e 100644 --- a/src/lnav.cc +++ b/src/lnav.cc @@ -29,6 +29,8 @@ #include #include +#include + #include "help.hh" #include "auto_temp_file.hh" #include "logfile.hh" @@ -49,11 +51,7 @@ #include "db_sub_source.hh" #include "pcrecpp.h" -#include -#include - using namespace std; -using namespace soci; typedef enum { LNM_PAGING, @@ -239,6 +237,12 @@ public: bucket_type_t gr_next_field; }; +/* XXX figure out how to do this with the template */ +void sqlite_close_wrapper(void *mem) +{ + sqlite3_close((sqlite3*)mem); +} + static struct { const char *ld_program_name; const char *ld_debug_log_name; @@ -279,7 +283,7 @@ static struct { auto_ptr ld_grep_child[LG__MAX]; log_vtab_manager *ld_vtab_manager; - session *ld_sql; + auto_mem ld_db; } lnav_data; class loading_observer @@ -1447,6 +1451,36 @@ static string com_capture(string cmdline, vector &args) static readline_context::command_map_t lnav_commands; +static int sql_callback(void *arg, + int ncols, + char **values, + char **colnames) +{ + db_label_source &dls = lnav_data.ld_db_rows; + hist_source &hs = lnav_data.ld_db_source; + double num_value = 0.0; + int row_number; + int lpc, retval = 0; + + row_number = dls.dls_rows.size(); + dls.dls_rows.resize(row_number + 1); + if (dls.dls_headers.empty()) { + for (lpc = 0; lpc < ncols; lpc++) { + dls.push_header(colnames[lpc]); + hs.set_role_for_type(bucket_type_t(lpc), + view_colors::singleton(). + next_highlight()); + } + } + for (lpc = 0; lpc < ncols; lpc++) { + dls.push_column(values[lpc]); + sscanf(values[lpc], "%lf", &num_value); + hs.add_value(row_number, bucket_type_t(lpc), num_value); + } + + return retval; +} + static void rl_search(void *dummy, readline_curses *rc) { static string last_search[LG__MAX]; @@ -1468,14 +1502,26 @@ static void rl_search(void *dummy, readline_curses *rc) return; case LNM_SQL: - try { - /* XXX need to use the sqlite api */ - session &sql = *lnav_data.ld_sql; - sql.prepare << rc->get_value(); - } - catch (soci::soci_error &e) { + if (!sqlite3_complete(rc->get_value().c_str())) { lnav_data.ld_bottom_source. - grep_error(string("sql error: ") + e.what()); + grep_error("sql error: incomplete statement"); + } + else { + sqlite3_stmt *stmt; + const char *tail; + int retcode; + + retcode = sqlite3_prepare_v2(lnav_data.ld_db, + rc->get_value().c_str(), + -1, + &stmt, + &tail); + if (retcode != SQLITE_OK) { + const char *errmsg = sqlite3_errmsg(lnav_data.ld_db); + + lnav_data.ld_bottom_source. + grep_error(string("sql error: ") + string(errmsg)); + } } return; default: @@ -1583,112 +1629,33 @@ static void rl_callback(void *dummy, readline_curses *rc) break; case LNM_SQL: - try { - session &sql = *lnav_data.ld_sql; - - rowset rs = (sql.prepare << rc->get_value()); + { db_label_source &dls = lnav_data.ld_db_rows; hist_source &hs = lnav_data.ld_db_source; - bool header_done = false; - int row_number = 0; - char buffer[128]; + auto_mem errmsg; + lnav_data.ld_bottom_source.grep_error(""); hs.clear(); dls.dls_headers.clear(); dls.dls_rows.clear(); - for (rowset::const_iterator it = rs.begin(); - it != rs.end(); - ++it, row_number++) { - dls.dls_rows.resize(dls.dls_rows.size() + 1); - for(std::size_t lpc = 0; lpc != it->size(); ++lpc) { - const column_properties & props = it->get_properties(lpc); - double num_value = 0; - - if (!header_done) { - fprintf(stderr, "<%s> ", props.get_name().c_str()); - fprintf(stderr, " dt %d\n", props.get_data_type()); - dls.push_header(props.get_name()); - hs.set_role_for_type(bucket_type_t(lpc), - view_colors::singleton(). - next_highlight()); - } - switch(props.get_data_type()) - { - case dt_string: - { - const char *str = it->get(lpc).c_str(); - int i; - - dls.push_column(str); - // XXX captures too much - if (sscanf(str, "%d", &i) == 1) { - num_value = i; - } - else { - sscanf(str, "%f", &num_value); - } - } - break; - case dt_double: - snprintf(buffer, sizeof(buffer), - "%f", - it->get(lpc)); - dls.push_column(buffer); - num_value = it->get(lpc); - break; - case dt_integer: - snprintf(buffer, sizeof(buffer), - "%d", - it->get(lpc)); - dls.push_column(buffer); - num_value = it->get(lpc); - break; - case dt_unsigned_long: - snprintf(buffer, sizeof(buffer), - "%ld", - it->get(lpc)); - dls.push_column(buffer); - num_value = it->get(lpc); - break; - case dt_long_long: - snprintf(buffer, sizeof(buffer), - "%lld", - it->get(lpc)); - dls.push_column(buffer); - num_value = it->get(lpc); - break; - case dt_date: - { - std::tm when = it->get(lpc); - - strftime(buffer, sizeof(buffer), - "%a, %d %b %Y %H:%M:%S %z", - &when); - dls.push_column(buffer); - } - break; - - default: - dls.push_column("XXX"); - break; - } - - hs.add_value(row_number, bucket_type_t(lpc), num_value); - } - header_done = true; + if (sqlite3_exec(lnav_data.ld_db, + rc->get_value().c_str(), + sql_callback, + NULL, + errmsg.out()) != SQLITE_OK) { + rc->set_value(errmsg.in()); + } + else { + rc->set_value(""); + + hs.analyze(); + lnav_data.ld_views[LNV_DB].reload_data(); + + if (dls.dls_rows.size() > 0) + toggle_view(&lnav_data.ld_views[LNV_DB]); } - - rc->set_value(""); // XXX - - hs.analyze(); - lnav_data.ld_views[LNV_DB].reload_data(); - - if (row_number > 0) - toggle_view(&lnav_data.ld_views[LNV_DB]); - } - catch (soci::soci_error &e) { - rc->set_value(e.what()); } + lnav_data.ld_mode = LNM_PAGING; break; } @@ -2135,8 +2102,7 @@ public: void extract(const std::string &line, int column, - sqlite_api::sqlite3_context *ctx) { - using namespace sqlite_api; + sqlite3_context *ctx) { string c_ip, cs_username, cs_method, cs_uri_stem, cs_uri_query; string cs_version, sc_status, cs_referer, cs_user_agent; string sc_bytes; @@ -2252,8 +2218,7 @@ public: void extract(const std::string &line, int column, - sqlite_api::sqlite3_context *ctx) { - using namespace sqlite_api; + sqlite3_context *ctx) { string function, args, result, duration = "0"; if (!this->slt_regex.FullMatch(line, @@ -2357,13 +2322,16 @@ int main(int argc, char *argv[]) { int lpc, c, retval = EXIT_SUCCESS; auto_ptr stdin_reader; - session sql(sqlite3, ":memory:"); + + if (sqlite3_open(":memory:", lnav_data.ld_db.out()) != SQLITE_OK) { + fprintf(stderr, "unable to create sqlite memory database\n"); + exit(EXIT_FAILURE); + } lnav_data.ld_program_name = argv[0]; - lnav_data.ld_sql = &sql; lnav_data.ld_vtab_manager = - new log_vtab_manager(sql, lnav_data.ld_log_source); + new log_vtab_manager(lnav_data.ld_db, lnav_data.ld_log_source); lnav_data.ld_vtab_manager->register_vtab(new log_vtab_impl("syslog_log")); lnav_data.ld_vtab_manager->register_vtab(new log_vtab_impl("generic_log")); diff --git a/src/log_format_impls.cc b/src/log_format_impls.cc index 473b9cbd..91391b5a 100644 --- a/src/log_format_impls.cc +++ b/src/log_format_impls.cc @@ -1,11 +1,8 @@ -#include - #include "log_format.hh" #include "log_vtab_impl.hh" using namespace std; -using namespace soci; class access_log_format : public log_format { string get_name() { return "access_log"; }; diff --git a/src/log_vtab_impl.cc b/src/log_vtab_impl.cc index b1f261ae..75c6666e 100644 --- a/src/log_vtab_impl.cc +++ b/src/log_vtab_impl.cc @@ -6,8 +6,6 @@ #include "logfile_sub_source.hh" using namespace std; -using namespace soci; -using namespace sqlite_api; static string declare_table_statement(log_vtab_impl *vi) { @@ -33,7 +31,7 @@ static string declare_table_statement(log_vtab_impl *vi) struct vtab { sqlite3_vtab base; - sqlite_api::sqlite3 *db; + sqlite3 *db; logfile_sub_source *lss; log_vtab_impl *vi; }; @@ -45,7 +43,7 @@ struct vtab_cursor { static int vt_destructor(sqlite3_vtab *p_svt); -static int vt_create( sqlite_api::sqlite3 *db, +static int vt_create( sqlite3 *db, void *pAux, int argc, const char *const*argv, sqlite3_vtab **pp_vt, @@ -87,7 +85,7 @@ static int vt_destructor(sqlite3_vtab *p_svt) return SQLITE_OK; } -static int vt_connect( sqlite_api::sqlite3 *db, void *p_aux, +static int vt_connect( sqlite3 *db, void *p_aux, int argc, const char *const*argv, sqlite3_vtab **pp_vt, char **pzErr ) { @@ -263,7 +261,7 @@ static int vt_best_index(sqlite3_vtab *tab, sqlite3_index_info *p_info) return SQLITE_OK; } -static sqlite_api::sqlite3_module vtab_module = { +static sqlite3_module vtab_module = { 0, /* iVersion */ vt_create, /* xCreate - create a vtable */ vt_connect, /* xConnect - associate a vtable with a connection */ @@ -285,23 +283,31 @@ static sqlite_api::sqlite3_module vtab_module = { NULL, /* xFindFunction - function overloading */ }; -log_vtab_manager::log_vtab_manager(soci::session &sql, logfile_sub_source &lss) - : vm_sql(sql), vm_source(lss) +log_vtab_manager::log_vtab_manager(sqlite3 *memdb, logfile_sub_source &lss) + : vm_db(memdb), vm_source(lss) { - sqlite3_session_backend *be = (sqlite3_session_backend *)sql.get_backend(); - sqlite_api::sqlite3 *db = be->conn_; - - sqlite3_create_module(db, "log_vtab_impl", &vtab_module, this); + sqlite3_create_module(this->vm_db, "log_vtab_impl", &vtab_module, this); } void log_vtab_manager::register_vtab(log_vtab_impl *vi) { if (this->vm_impls.find(vi->get_name()) == this->vm_impls.end()) { + const char *errmsg; + char *sql; + int rc; + this->vm_impls[vi->get_name()] = vi; - vm_sql << "CREATE VIRTUAL TABLE " - << vi->get_name() - << " USING log_vtab_impl(" - << vi->get_name() - << ")"; + sql = sqlite3_mprintf("CREATE VIRTUAL TABLE %s " + "USING log_vtab_impl(%s)", + vi->get_name().c_str(), + vi->get_name().c_str()); + rc = sqlite3_exec(this->vm_db, + sql, + NULL, + NULL, + NULL); + assert(rc == SQLITE_OK); + + sqlite3_free(sql); } } diff --git a/src/log_vtab_impl.hh b/src/log_vtab_impl.hh index 366925a3..93350604 100644 --- a/src/log_vtab_impl.hh +++ b/src/log_vtab_impl.hh @@ -2,13 +2,11 @@ #ifndef __vtab_impl_hh #define __vtab_impl_hh -#include - -#include #include #include #include +#include class logfile_sub_source; @@ -33,7 +31,7 @@ public: virtual void extract(const std::string &line, int column, - sqlite_api::sqlite3_context *ctx) { + sqlite3_context *ctx) { }; private: @@ -42,7 +40,7 @@ private: class log_vtab_manager { public: - log_vtab_manager(soci::session &sql, logfile_sub_source &lss); + log_vtab_manager(sqlite3 *db, logfile_sub_source &lss); logfile_sub_source *get_source() { return &this->vm_source; }; @@ -52,7 +50,7 @@ public: }; private: - soci::session &vm_sql; + sqlite3 *vm_db; logfile_sub_source &vm_source; std::map vm_impls; }; diff --git a/src/view_curses.hh b/src/view_curses.hh index d8c46b10..ee219519 100644 --- a/src/view_curses.hh +++ b/src/view_curses.hh @@ -39,11 +39,11 @@ struct line_range { }; bool operator<(const struct line_range &rhs) const { - if (this->lr_start < rhs.lr_start) return true; - else if (this->lr_start > rhs.lr_start) return false; - - if (this->lr_end < rhs.lr_end) return true; - return false; + if (this->lr_start < rhs.lr_start) return true; + else if (this->lr_start > rhs.lr_start) return false; + + if (this->lr_end < rhs.lr_end) return true; + return false; }; }; diff --git a/src/vt52_curses.cc b/src/vt52_curses.cc index 18c8bef1..4be9b8b1 100644 --- a/src/vt52_curses.cc +++ b/src/vt52_curses.cc @@ -82,17 +82,18 @@ private: this->vem_map[KEY_BEG] = "\x1"; this->vem_map[KEY_END] = "\x5"; - this->vem_map[KEY_SLEFT] = tgetstr("#4", NULL); + this->vem_map[KEY_SLEFT] = tgetstr("#4", &area); if (this->vem_map[KEY_SLEFT] == NULL) { this->vem_map[KEY_SLEFT] = "\033b"; } - this->vem_map[KEY_SRIGHT] = tgetstr("%i", NULL); + this->vem_map[KEY_SRIGHT] = tgetstr("%i", &area); if (this->vem_map[KEY_SRIGHT] == NULL) { this->vem_map[KEY_SRIGHT] = "\033f"; } this->vem_input_map[tgetstr("ce", &area)] = "ce"; this->vem_input_map[tgetstr("kl", &area)] = "kl"; + this->vem_input_map[tgetstr("kr", &area)] = "kr"; tgetent(NULL, getenv("TERM")); }; @@ -158,6 +159,14 @@ void vt52_curses::map_output(const char *output, int len) wmove(this->vc_window, y, this->vc_x); this->vc_escape_len = 0; } + else if (strcmp(cap, "kr") == 0) { + this->vc_x += 1; + wmove(this->vc_window, y, this->vc_x); + this->vc_escape_len = 0; + } + else { + assert(0); + } } } else { diff --git a/test/Makefile.am b/test/Makefile.am index 566e75ee..545dcac0 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -3,18 +3,11 @@ TESTS_ENVIRONMENT = $(SHELL) $(top_builddir)/TESTS_ENVIRONMENT AM_CPPFLAGS = \ -I$(top_srcdir)/src \ - $(SQLITE3_CFLAGS) \ - $(SOCI_CXXFLAGS) + $(SQLITE3_CFLAGS) # AM_CFLAGS = -fprofile-arcs -ftest-coverage # AM_CXXFLAGS = -fprofile-arcs -ftest-coverage -if HAVE_SOCI -SOCI_TESTS = -else -SOCI_TESTS = -endif - check_PROGRAMS = \ drive_line_buffer \ drive_grep_proc \ @@ -28,7 +21,6 @@ check_PROGRAMS = \ test_auto_mem \ test_bookmarks \ test_grep_proc2 \ - $(SOCI_TESTS) \ test_line_buffer2 \ test_top_status @@ -138,7 +130,6 @@ TESTS = test_bookmarks \ test_line_buffer2 \ test_grep_proc.sh \ test_grep_proc2 \ - $(SOCI_TESTS) \ test_listview.sh \ test_logfile.sh \ test_vt52_curses.sh \ diff --git a/test/Makefile.in b/test/Makefile.in index f90801ea..c7639692 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -38,13 +38,13 @@ check_PROGRAMS = drive_line_buffer$(EXEEXT) drive_grep_proc$(EXEEXT) \ drive_vt52_curses$(EXEEXT) drive_readline_curses$(EXEEXT) \ slicer$(EXEEXT) scripty$(EXEEXT) test_auto_fd$(EXEEXT) \ test_auto_mem$(EXEEXT) test_bookmarks$(EXEEXT) \ - test_grep_proc2$(EXEEXT) $(am__EXEEXT_1) \ - test_line_buffer2$(EXEEXT) test_top_status$(EXEEXT) + test_grep_proc2$(EXEEXT) test_line_buffer2$(EXEEXT) \ + test_top_status$(EXEEXT) TESTS = test_bookmarks$(EXEEXT) test_auto_fd$(EXEEXT) \ test_auto_mem$(EXEEXT) test_line_buffer.sh \ test_line_buffer2$(EXEEXT) test_grep_proc.sh \ - test_grep_proc2$(EXEEXT) $(am__EXEEXT_1) test_listview.sh \ - test_logfile.sh test_vt52_curses.sh test_top_status$(EXEEXT) + test_grep_proc2$(EXEEXT) test_listview.sh test_logfile.sh \ + test_vt52_curses.sh test_top_status$(EXEEXT) subdir = test DIST_COMMON = $(dist_noinst_DATA) $(dist_noinst_SCRIPTS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in @@ -56,7 +56,6 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = -am__EXEEXT_1 = am_drive_grep_proc_OBJECTS = line_buffer.$(OBJEXT) grep_proc.$(OBJEXT) \ drive_grep_proc.$(OBJEXT) drive_grep_proc_OBJECTS = $(am_drive_grep_proc_OBJECTS) @@ -162,7 +161,6 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ -CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -202,8 +200,6 @@ READLINE_CFLAGS = @READLINE_CFLAGS@ READLINE_LIBS = @READLINE_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ -SOCI_CXXFLAGS = @SOCI_CXXFLAGS@ -SOCI_LIBS = @SOCI_LIBS@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ @@ -264,14 +260,8 @@ top_srcdir = @top_srcdir@ TESTS_ENVIRONMENT = $(SHELL) $(top_builddir)/TESTS_ENVIRONMENT AM_CPPFLAGS = \ -I$(top_srcdir)/src \ - $(SQLITE3_CFLAGS) \ - $(SOCI_CXXFLAGS) + $(SQLITE3_CFLAGS) -@HAVE_SOCI_FALSE@SOCI_TESTS = - -# AM_CFLAGS = -fprofile-arcs -ftest-coverage -# AM_CXXFLAGS = -fprofile-arcs -ftest-coverage -@HAVE_SOCI_TRUE@SOCI_TESTS = AM_LDFLAGS = \ $(SQLITE3_LDFLAGS) diff --git a/test/logfile_access_log.0 b/test/logfile_access_log.0 index 8c899e34..a90f29fd 100644 --- a/test/logfile_access_log.0 +++ b/test/logfile_access_log.0 @@ -1,3 +1,3 @@ 192.168.202.254 - - [20/Jul/2009:22:59:26 +0000] "GET /vmw/cgi/tramp HTTP/1.0" 200 134 "-" "gPXE/0.9.7" 192.168.202.254 - - [20/Jul/2009:22:59:29 +0000] "GET /vmw/vSphere/default/vmkboot.gz HTTP/1.0" 404 46210 "-" "gPXE/0.9.7" -192.168.202.254 - - [20/Jul/2009:22:59:29 +0000] "GET /vmw/vSphere/default/vmkernel.gz HTTP/1.0" 200 3578929 "-" "gPXE/0.9.7" +192.168.202.254 - - [20/Jul/2009:22:59:29 +0000] "GET /vmw/vSphere/default/vmkernel.gz HTTP/1.0" 200 78929 "-" "gPXE/0.9.7" diff --git a/test/test_capture_proc.cc b/test/test_capture_proc.cc index 7a8e798e..0f319fd4 100644 --- a/test/test_capture_proc.cc +++ b/test/test_capture_proc.cc @@ -5,16 +5,10 @@ #include #include -#include -#include - #include "time_T.hh" #include "auto_temp_file.hh" #include "capture_proc.hh" -using namespace std; -using namespace SOCI; - static const int MS_LINE_COUNT = 4; static struct { diff --git a/test/test_grep_proc.sh b/test/test_grep_proc.sh index 8372c047..9095406c 100644 --- a/test/test_grep_proc.sh +++ b/test/test_grep_proc.sh @@ -6,7 +6,7 @@ Goodbye, World? EOF grep_slice() { - ./drive_grep_proc "$1" "$2" | slicer "$2" + ./drive_grep_proc "$1" "$2" | ./slicer "$2" } grep_capture() {