Mercurial > hg > xemacs-beta
changeset 263:727739f917cb r20-5b30
Import from CVS: tag r20-5b30
line wrap: on
line diff
--- a/CHANGES-beta Mon Aug 13 10:23:52 2007 +0200 +++ b/CHANGES-beta Mon Aug 13 10:24:41 2007 +0200 @@ -1,4 +1,21 @@ -*- indented-text -*- +to 20.5 beta30 "Moxotó" +-- find-gc.el fixes courtesy of Markus Linnala +-- mousewheel support courtesy of William Perry +-- Mule tty initialization courtesy of Kazuyuki IENAGA +-- backspace mapping fixing from Kyle Jones +-- New function `temp-directory' courtesy of Glynn Clements +-- miscellaneous patches from Jens UH Petersen, Greg Klanderman, Kirill + Katsnelson and Kyle Jones +-- miscellaneous cygwin cleanup from Andy Piper +-- dired in C changes courtesy of Darryl Okahata +-- process abstraction changes courtesy of Kirill Katsnelson +-- Added an example of a DLL +-- Coding system cleanup courtesy of Andy Piper +-- Build fixes for --srcdir +-- Miscellaneous fixes +-- Fix localized menubars to work when the application class changes name. + to 20.5 beta29 "Loashan" -- Add autodetection of DLL support -- bug fixes from Kyle Jones
--- a/ChangeLog Mon Aug 13 10:23:52 2007 +0200 +++ b/ChangeLog Mon Aug 13 10:24:41 2007 +0200 @@ -1,3 +1,29 @@ +1998-03-07 SL Baur <steve@altair.xemacs.org> + + * XEmacs 20.5-beta30 is released. + +1998-03-05 SL Baur <steve@altair.xemacs.org> + + * PROBLEMS: Update wording of x86 GCC 2.7 problems. + +Wed Mar 04 08:55:12 1998 Andy Piper <andyp@parallax.co.uk> + + * configure.in: add a --with-msw option. Make X and msw work + together if the user asks. + +1998-03-02 SL Baur <steve@altair.xemacs.org> + + * PROBLEMS: Update documentation of gcc bugs that impact XEmacs. + +1998-03-01 SL Baur <steve@altair.xemacs.org> + + * configure.in: Add substitutable variable ld_dynamic_link_flags + for special required linker flags for building DLL capable + binaries. + + * etc/Emacs.ad: Remove explicit `Emacs' application resource + name. + 1998-02-28 SL Baur <steve@altair.xemacs.org> * Makefile.in (top_distclean): Remove Installation.el.
--- a/PROBLEMS Mon Aug 13 10:23:52 2007 +0200 +++ b/PROBLEMS Mon Aug 13 10:24:41 2007 +0200 @@ -33,14 +33,19 @@ gcc will generate incorrect code otherwise. This bug is present in at least 2.6.x and 2.7.[0-2]. This bug has been fixed in GCC 2.7.2.1 and -later. This bug is also O/S independent. +later. This bug is O/S independent, but is limited to x86 architectures. + +This problem is known to be fixed in egcs (or pgcc) 1.0 or later. ** Don't use -O2 with gcc 2.7.2 under Intel architectures without also using `-fno-caller-saves'. -gcc will generate incorrect code otherwise. This bug is still present -in gcc 2.7.2.3. There have been no reports to indicate the bug is -present in egcs 1.0 (or pgcc 1.0) or later. This bug is O/S independent. +gcc will generate incorrect code otherwise. This bug is still +present in gcc 2.7.2.3. There have been no reports to indicate the +bug is present in egcs 1.0 (or pgcc 1.0) or later. This bug is O/S +independent, but limited to x86 architectures. + +This problem is known to be fixed in egcs (or pgcc) 1.0 or later. ** Excessive optimization with pgcc can break XEmacs
--- a/configure Mon Aug 13 10:23:52 2007 +0200 +++ b/configure Mon Aug 13 10:24:41 2007 +0200 @@ -240,6 +240,7 @@ cflags='UNSPECIFIED' dynamic='' with_x11='' +with_msw='' with_gung='no' with_minimal_tagbits='no' rel_alloc='default' @@ -302,6 +303,7 @@ run_in_place | \ with_x | \ with_x11 | \ + with_msw | \ with_gcc | \ with_gnu_make | \ dynamic | \ @@ -641,7 +643,7 @@ if test -z "$configuration"; then echo $ac_n "checking "host system type"""... $ac_c" 1>&6 -echo "configure:645: checking "host system type"" >&5 +echo "configure:647: checking "host system type"" >&5 if configuration=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess | \ sed 's/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/'` ; then echo "$ac_t""$configuration" 1>&6 @@ -655,7 +657,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:659: checking whether ln -s works" >&5 +echo "configure:661: checking whether ln -s works" >&5 rm -f conftestdata if ln -s X conftestdata 2>/dev/null @@ -832,7 +834,7 @@ echo "checking "the configuration name"" 1>&6 -echo "configure:836: checking "the configuration name"" >&5 +echo "configure:838: checking "the configuration name"" >&5 internal_configuration=`echo $configuration | sed 's/-\(workshop\)//'` if canonical=`$srcdir/config.sub "$internal_configuration"` ; then : ; else exit $? @@ -1290,7 +1292,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1294: checking for $ac_word" >&5 +echo "configure:1296: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1316,7 +1318,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1320: checking for $ac_word" >&5 +echo "configure:1322: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1361,7 +1363,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1365: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1367: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' @@ -1373,11 +1375,11 @@ cross_compiling=no cat > conftest.$ac_ext <<EOF -#line 1377 "configure" +#line 1379 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1397,19 +1399,19 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1401: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1403: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1406: checking whether we are using GNU C" >&5 +echo "configure:1408: checking whether we are using GNU C" >&5 cat > conftest.c <<EOF #ifdef __GNUC__ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1415: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1423,7 +1425,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1427: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1429: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1452,7 +1454,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1456: checking for $ac_word" >&5 +echo "configure:1458: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1478,7 +1480,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1482: checking for $ac_word" >&5 +echo "configure:1484: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1523,7 +1525,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1527: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1529: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' @@ -1535,11 +1537,11 @@ cross_compiling=no cat > conftest.$ac_ext <<EOF -#line 1539 "configure" +#line 1541 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1559,19 +1561,19 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1563: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1565: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1568: checking whether we are using GNU C" >&5 +echo "configure:1570: checking whether we are using GNU C" >&5 cat > conftest.c <<EOF #ifdef __GNUC__ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1585,7 +1587,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1589: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1591: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1614,7 +1616,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1618: checking for $ac_word" >&5 +echo "configure:1620: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1640,7 +1642,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1644: checking for $ac_word" >&5 +echo "configure:1646: checking for $ac_word" >&5 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1685,7 +1687,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1689: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1691: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' @@ -1697,11 +1699,11 @@ cross_compiling=no cat > conftest.$ac_ext <<EOF -#line 1701 "configure" +#line 1703 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1721,19 +1723,19 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1725: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1727: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1730: checking whether we are using GNU C" >&5 +echo "configure:1732: checking whether we are using GNU C" >&5 cat > conftest.c <<EOF #ifdef __GNUC__ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1747,7 +1749,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1751: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1753: checking whether ${CC-cc} accepts -g" >&5 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then @@ -1780,7 +1782,7 @@ test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1784: checking how to run the C preprocessor" >&5 +echo "configure:1786: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1793,13 +1795,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1797 "configure" +#line 1799 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1810,13 +1812,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1814 "configure" +#line 1816 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1839,9 +1841,9 @@ echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:1843: checking for AIX" >&5 -cat > conftest.$ac_ext <<EOF -#line 1845 "configure" +echo "configure:1845: checking for AIX" >&5 +cat > conftest.$ac_ext <<EOF +#line 1847 "configure" #include "confdefs.h" #ifdef _AIX yes @@ -1868,9 +1870,9 @@ echo $ac_n "checking for GNU libc""... $ac_c" 1>&6 -echo "configure:1872: checking for GNU libc" >&5 -cat > conftest.$ac_ext <<EOF -#line 1874 "configure" +echo "configure:1874: checking for GNU libc" >&5 +cat > conftest.$ac_ext <<EOF +#line 1876 "configure" #include "confdefs.h" #include <features.h> int main() { @@ -1882,7 +1884,7 @@ ; return 0; } EOF -if { (eval echo configure:1886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_glibc=yes else @@ -1903,9 +1905,9 @@ echo $ac_n "checking whether we are using SunPro C""... $ac_c" 1>&6 -echo "configure:1907: checking whether we are using SunPro C" >&5 -cat > conftest.$ac_ext <<EOF -#line 1909 "configure" +echo "configure:1909: checking whether we are using SunPro C" >&5 +cat > conftest.$ac_ext <<EOF +#line 1911 "configure" #include "confdefs.h" int main() { @@ -1916,7 +1918,7 @@ ; return 0; } EOF -if { (eval echo configure:1920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* __sunpro_c=yes else @@ -2192,7 +2194,7 @@ fi echo $ac_n "checking for dynodump""... $ac_c" 1>&6 -echo "configure:2196: checking for dynodump" >&5 +echo "configure:2198: checking for dynodump" >&5 if test "$unexec" != "unexsol2.o"; then echo "$ac_t""no" 1>&6 else @@ -2290,19 +2292,19 @@ if test "$add_runtime_path" = "yes"; then echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6 -echo "configure:2294: checking "for runtime libraries flag"" >&5 +echo "configure:2296: checking "for runtime libraries flag"" >&5 dash_r="" for try_dash_r in "-R" "-R " "-rpath "; do xe_check_libs="${try_dash_r}/no/such/file-or-directory" cat > conftest.$ac_ext <<EOF -#line 2299 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:2306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +#line 2301 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* dash_r="$try_dash_r" else @@ -2389,10 +2391,10 @@ fi after_morecore_hook_exists=yes echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6 -echo "configure:2393: checking for malloc_get_state" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2396 "configure" +echo "configure:2395: checking for malloc_get_state" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2398 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char malloc_get_state(); below. */ @@ -2415,7 +2417,7 @@ ; return 0; } EOF -if { (eval echo configure:2419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_malloc_get_state=yes" else @@ -2435,10 +2437,10 @@ fi echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6 -echo "configure:2439: checking for malloc_set_state" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2442 "configure" +echo "configure:2441: checking for malloc_set_state" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2444 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char malloc_set_state(); below. */ @@ -2461,7 +2463,7 @@ ; return 0; } EOF -if { (eval echo configure:2465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_malloc_set_state=yes" else @@ -2481,16 +2483,16 @@ fi echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6 -echo "configure:2485: checking whether __after_morecore_hook exists" >&5 -cat > conftest.$ac_ext <<EOF -#line 2487 "configure" +echo "configure:2487: checking whether __after_morecore_hook exists" >&5 +cat > conftest.$ac_ext <<EOF +#line 2489 "configure" #include "confdefs.h" extern void (* __after_morecore_hook)(); int main() { __after_morecore_hook = 0 ; return 0; } EOF -if { (eval echo configure:2494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2555,7 +2557,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2559: checking for $ac_word" >&5 +echo "configure:2561: checking for $ac_word" >&5 if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -2608,7 +2610,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2612: checking for a BSD compatible install" >&5 +echo "configure:2614: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" @@ -2659,7 +2661,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2663: checking for $ac_word" >&5 +echo "configure:2665: checking for $ac_word" >&5 if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -2690,15 +2692,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2694: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2697 "configure" +echo "configure:2696: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2699 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2731,15 +2733,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2735: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2738 "configure" +echo "configure:2737: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2740 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2772,15 +2774,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2776: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2779 "configure" +echo "configure:2778: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2781 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2810,10 +2812,10 @@ done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:2814: checking for sys/wait.h that is POSIX.1 compatible" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2817 "configure" +echo "configure:2816: checking for sys/wait.h that is POSIX.1 compatible" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2819 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/wait.h> @@ -2829,7 +2831,7 @@ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:2833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -2853,10 +2855,10 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2857: checking for ANSI C header files" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2860 "configure" +echo "configure:2859: checking for ANSI C header files" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2862 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -2864,7 +2866,7 @@ #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2881,7 +2883,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2885 "configure" +#line 2887 "configure" #include "confdefs.h" #include <string.h> EOF @@ -2899,7 +2901,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2903 "configure" +#line 2905 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -2917,7 +2919,7 @@ if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. cat > conftest.$ac_ext <<EOF -#line 2921 "configure" +#line 2923 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2928,7 +2930,7 @@ exit (0); } EOF -if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:2934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then : else @@ -2953,10 +2955,10 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2957: checking whether time.h and sys/time.h may both be included" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2960 "configure" +echo "configure:2959: checking whether time.h and sys/time.h may both be included" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2962 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -2965,7 +2967,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2989,10 +2991,10 @@ fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:2993: checking for sys_siglist declaration in signal.h or unistd.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 2996 "configure" +echo "configure:2995: checking for sys_siglist declaration in signal.h or unistd.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 2998 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -3004,7 +3006,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:3008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -3029,9 +3031,9 @@ echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6 -echo "configure:3033: checking for struct utimbuf" >&5 -cat > conftest.$ac_ext <<EOF -#line 3035 "configure" +echo "configure:3035: checking for struct utimbuf" >&5 +cat > conftest.$ac_ext <<EOF +#line 3037 "configure" #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME #include <sys/time.h> @@ -3050,7 +3052,7 @@ static struct utimbuf x; x.actime = x.modtime; ; return 0; } EOF -if { (eval echo configure:3054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3056: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -3070,10 +3072,10 @@ rm -f conftest* echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3074: checking return type of signal handlers" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3077 "configure" +echo "configure:3076: checking return type of signal handlers" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3079 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -3090,7 +3092,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:3094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3112,10 +3114,10 @@ echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3116: checking for size_t" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3119 "configure" +echo "configure:3118: checking for size_t" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3121 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3146,10 +3148,10 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3150: checking for pid_t" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3153 "configure" +echo "configure:3152: checking for pid_t" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3155 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3180,10 +3182,10 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3184: checking for uid_t in sys/types.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3187 "configure" +echo "configure:3186: checking for uid_t in sys/types.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3189 "configure" #include "confdefs.h" #include <sys/types.h> EOF @@ -3219,10 +3221,10 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:3223: checking for mode_t" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3226 "configure" +echo "configure:3225: checking for mode_t" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3228 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3253,10 +3255,10 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3257: checking for off_t" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3260 "configure" +echo "configure:3259: checking for off_t" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3262 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -3288,9 +3290,9 @@ echo $ac_n "checking for struct timeval""... $ac_c" 1>&6 -echo "configure:3292: checking for struct timeval" >&5 -cat > conftest.$ac_ext <<EOF -#line 3294 "configure" +echo "configure:3294: checking for struct timeval" >&5 +cat > conftest.$ac_ext <<EOF +#line 3296 "configure" #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME #include <sys/time.h> @@ -3306,7 +3308,7 @@ static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } EOF -if { (eval echo configure:3310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 HAVE_TIMEVAL=yes @@ -3328,10 +3330,10 @@ rm -f conftest* echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:3332: checking whether struct tm is in sys/time.h or time.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3335 "configure" +echo "configure:3334: checking whether struct tm is in sys/time.h or time.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3337 "configure" #include "confdefs.h" #include <sys/types.h> #include <time.h> @@ -3339,7 +3341,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:3343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -3363,10 +3365,10 @@ fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:3367: checking for tm_zone in struct tm" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3370 "configure" +echo "configure:3369: checking for tm_zone in struct tm" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3372 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_cv_struct_tm> @@ -3374,7 +3376,7 @@ struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:3378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -3397,10 +3399,10 @@ else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:3401: checking for tzname" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3404 "configure" +echo "configure:3403: checking for tzname" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3406 "configure" #include "confdefs.h" #include <time.h> #ifndef tzname /* For SGI. */ @@ -3410,7 +3412,7 @@ atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:3414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -3436,10 +3438,10 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3440: checking for working const" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3443 "configure" +echo "configure:3442: checking for working const" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3445 "configure" #include "confdefs.h" int main() { @@ -3488,7 +3490,7 @@ ; return 0; } EOF -if { (eval echo configure:3492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3513,7 +3515,7 @@ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:3517: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:3519: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` cat > conftestmake <<\EOF @@ -3538,12 +3540,12 @@ echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:3542: checking whether byte ordering is bigendian" >&5 +echo "configure:3544: checking whether byte ordering is bigendian" >&5 ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext <<EOF -#line 3547 "configure" +#line 3549 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -3554,11 +3556,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:3558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext <<EOF -#line 3562 "configure" +#line 3564 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/param.h> @@ -3569,7 +3571,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:3573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -3586,7 +3588,7 @@ rm -f conftest* if test $ac_cv_c_bigendian = unknown; then cat > conftest.$ac_ext <<EOF -#line 3590 "configure" +#line 3592 "configure" #include "confdefs.h" main () { /* Are we little or big endian? From Harbison&Steele. */ @@ -3599,7 +3601,7 @@ exit (u.c[sizeof (long) - 1] == 1); } EOF -if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_c_bigendian=no else @@ -3625,10 +3627,10 @@ echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:3629: checking size of short" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3632 "configure" +echo "configure:3631: checking size of short" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3634 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -3639,7 +3641,7 @@ exit(0); } EOF -if { (eval echo configure:3643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_sizeof_short=`cat conftestval` else @@ -3666,10 +3668,10 @@ exit 1 fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:3670: checking size of int" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3673 "configure" +echo "configure:3672: checking size of int" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3675 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -3680,7 +3682,7 @@ exit(0); } EOF -if { (eval echo configure:3684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_sizeof_int=`cat conftestval` else @@ -3701,10 +3703,10 @@ echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:3705: checking size of long" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3708 "configure" +echo "configure:3707: checking size of long" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3710 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -3715,7 +3717,7 @@ exit(0); } EOF -if { (eval echo configure:3719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_sizeof_long=`cat conftestval` else @@ -3736,10 +3738,10 @@ echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:3740: checking size of long long" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3743 "configure" +echo "configure:3742: checking size of long long" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3745 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -3750,7 +3752,7 @@ exit(0); } EOF -if { (eval echo configure:3754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_sizeof_long_long=`cat conftestval` else @@ -3771,10 +3773,10 @@ echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:3775: checking size of void *" >&5 - -cat > conftest.$ac_ext <<EOF -#line 3778 "configure" +echo "configure:3777: checking size of void *" >&5 + +cat > conftest.$ac_ext <<EOF +#line 3780 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -3785,7 +3787,7 @@ exit(0); } EOF -if { (eval echo configure:3789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:3791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_sizeof_void_p=`cat conftestval` else @@ -3807,7 +3809,7 @@ echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:3811: checking for long file names" >&5 +echo "configure:3813: checking for long file names" >&5 ac_cv_sys_long_file_names=yes # Test for long file names in all the places we know might matter: @@ -3854,12 +3856,12 @@ echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:3858: checking for sin in -lm" >&5 +echo "configure:3860: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` xe_check_libs=" -lm " cat > conftest.$ac_ext <<EOF -#line 3863 "configure" +#line 3865 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3870,7 +3872,7 @@ sin() ; return 0; } EOF -if { (eval echo configure:3874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3912,14 +3914,14 @@ cat > conftest.$ac_ext <<EOF -#line 3916 "configure" +#line 3918 "configure" #include "confdefs.h" #include <math.h> int main() { return atanh(1.0) + asinh(1.0) + acosh(1.0); ; return 0; } EOF -if { (eval echo configure:3923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_INVERSE_HYPERBOLIC @@ -3936,7 +3938,7 @@ rm -f conftest* echo "checking type of mail spool file locking" 1>&6 -echo "configure:3940: checking type of mail spool file locking" >&5 +echo "configure:3942: checking type of mail spool file locking" >&5 test -z "$mail_locking" -a "$mail_use_flock" = "yes" && mail_locking=flock test -z "$mail_locking" -a "$mail_use_lockf" = "yes" && mail_locking=lockf if test "$mail_locking" = "lockf"; then { test "$extra_verbose" = "yes" && cat << \EOF @@ -3960,12 +3962,12 @@ echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:3964: checking for kstat_open in -lkstat" >&5 +echo "configure:3966: checking for kstat_open in -lkstat" >&5 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lkstat " cat > conftest.$ac_ext <<EOF -#line 3969 "configure" +#line 3971 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3976,7 +3978,7 @@ kstat_open() ; return 0; } EOF -if { (eval echo configure:3980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4010,12 +4012,12 @@ echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:4014: checking for kvm_read in -lkvm" >&5 +echo "configure:4016: checking for kvm_read in -lkvm" >&5 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'` xe_check_libs=" -lkvm " cat > conftest.$ac_ext <<EOF -#line 4019 "configure" +#line 4021 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4026,7 +4028,7 @@ kvm_read() ; return 0; } EOF -if { (eval echo configure:4030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4060,12 +4062,12 @@ echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:4064: checking for cma_open in -lpthreads" >&5 +echo "configure:4066: checking for cma_open in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lpthreads " cat > conftest.$ac_ext <<EOF -#line 4069 "configure" +#line 4071 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4076,7 +4078,7 @@ cma_open() ; return 0; } EOF -if { (eval echo configure:4080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4112,7 +4114,7 @@ fi echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 -echo "configure:4116: checking whether the -xildoff compiler flag is required" >&5 +echo "configure:4118: checking whether the -xildoff compiler flag is required" >&5 if ${CC-cc} '-###' -xildon no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then echo "$ac_t""no" 1>&6; @@ -4123,7 +4125,7 @@ if test "$opsys" = "sol2" && test "$OS_RELEASE" -ge 56; then echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6 -echo "configure:4127: checking for \"-z ignore\" linker flag" >&5 +echo "configure:4129: checking for \"-z ignore\" linker flag" >&5 case "`ld -h 2>&1`" in *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6 ld_switch_site="-z ignore $ld_switch_site" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-z ignore\" to \$ld_switch_site"; fi ;; @@ -4133,7 +4135,7 @@ echo "checking "for specified window system"" 1>&6 -echo "configure:4137: checking "for specified window system"" >&5 +echo "configure:4139: checking "for specified window system"" >&5 if test "$with_x11" != "no"; then test "$x_includes $x_libraries" != "NONE NONE" && \ @@ -4163,7 +4165,7 @@ # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:4167: checking for X" >&5 +echo "configure:4169: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4223,12 +4225,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF -#line 4227 "configure" +#line 4229 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -4297,14 +4299,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF -#line 4301 "configure" +#line 4303 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF -if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -4413,17 +4415,17 @@ case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:4417: checking whether -R must be followed by a space" >&5 +echo "configure:4419: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <<EOF -#line 4420 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +#line 4422 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:4429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_nospace=yes else @@ -4439,14 +4441,14 @@ else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <<EOF -#line 4443 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:4450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +#line 4445 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:4452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_space=yes else @@ -4482,12 +4484,12 @@ else echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:4486: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:4488: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet " cat > conftest.$ac_ext <<EOF -#line 4491 "configure" +#line 4493 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4498,7 +4500,7 @@ dnet_ntoa() ; return 0; } EOF -if { (eval echo configure:4502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4522,12 +4524,12 @@ if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:4526: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:4528: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet_stub " cat > conftest.$ac_ext <<EOF -#line 4531 "configure" +#line 4533 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4538,7 +4540,7 @@ dnet_ntoa() ; return 0; } EOF -if { (eval echo configure:4542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4567,10 +4569,10 @@ # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:4571: checking for gethostbyname" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4574 "configure" +echo "configure:4573: checking for gethostbyname" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4576 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname(); below. */ @@ -4593,7 +4595,7 @@ ; return 0; } EOF -if { (eval echo configure:4597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -4614,12 +4616,12 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:4618: checking for gethostbyname in -lnsl" >&5 +echo "configure:4620: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` xe_check_libs=" -lnsl " cat > conftest.$ac_ext <<EOF -#line 4623 "configure" +#line 4625 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4630,7 +4632,7 @@ gethostbyname() ; return 0; } EOF -if { (eval echo configure:4634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4660,10 +4662,10 @@ # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:4664: checking for connect" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4667 "configure" +echo "configure:4666: checking for connect" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4669 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect(); below. */ @@ -4686,7 +4688,7 @@ ; return 0; } EOF -if { (eval echo configure:4690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -4709,12 +4711,12 @@ xe_msg_checking="for connect in -lsocket" test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:4713: checking "$xe_msg_checking"" >&5 +echo "configure:4715: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocket $X_EXTRA_LIBS" cat > conftest.$ac_ext <<EOF -#line 4718 "configure" +#line 4720 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4725,7 +4727,7 @@ connect() ; return 0; } EOF -if { (eval echo configure:4729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4749,10 +4751,10 @@ # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:4753: checking for remove" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4756 "configure" +echo "configure:4755: checking for remove" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4758 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove(); below. */ @@ -4775,7 +4777,7 @@ ; return 0; } EOF -if { (eval echo configure:4779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -4796,12 +4798,12 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:4800: checking for remove in -lposix" >&5 +echo "configure:4802: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` xe_check_libs=" -lposix " cat > conftest.$ac_ext <<EOF -#line 4805 "configure" +#line 4807 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4812,7 +4814,7 @@ remove() ; return 0; } EOF -if { (eval echo configure:4816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4836,10 +4838,10 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:4840: checking for shmat" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4843 "configure" +echo "configure:4842: checking for shmat" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4845 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat(); below. */ @@ -4862,7 +4864,7 @@ ; return 0; } EOF -if { (eval echo configure:4866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -4883,12 +4885,12 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:4887: checking for shmat in -lipc" >&5 +echo "configure:4889: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` xe_check_libs=" -lipc " cat > conftest.$ac_ext <<EOF -#line 4892 "configure" +#line 4894 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4899,7 +4901,7 @@ shmat() ; return 0; } EOF -if { (eval echo configure:4903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4933,12 +4935,12 @@ # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:4937: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:4939: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` xe_check_libs=" -lICE " cat > conftest.$ac_ext <<EOF -#line 4942 "configure" +#line 4944 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4949,7 +4951,7 @@ IceConnectionNumber() ; return 0; } EOF -if { (eval echo configure:4953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4984,24 +4986,24 @@ no ) window_system=none HAVE_X_WINDOWS=no ;; esac -if test "$window_system" = "none" && test -z "$with_tty"; then +if test "$with_msw" != "no"; then echo "checking for MS-Windows" 1>&6 -echo "configure:4990: checking for MS-Windows" >&5 +echo "configure:4992: checking for MS-Windows" >&5 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6 -echo "configure:4993: checking for main in -lgdi32" >&5 +echo "configure:4995: checking for main in -lgdi32" >&5 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdi32 " cat > conftest.$ac_ext <<EOF -#line 4998 "configure" +#line 5000 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5015,13 +5017,13 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - have_msw=yes -else - echo "$ac_t""no" 1>&6 -fi - - - if test "$have_msw" = "yes"; then + with_msw=yes +else + echo "$ac_t""no" 1>&6 +fi + + + if test "$with_msw" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MS_WINDOWS EOF @@ -5031,20 +5033,30 @@ } libs_system="$libs_system -lshell32 -lgdi32 -luser32" && if test "$extra_verbose" = "yes"; then echo " Appending \"-lshell32 -lgdi32 -luser32\" to \$libs_system"; fi - window_system=msw - test "$with_scrollbars" != "no" && with_scrollbars=msw && extra_objs="$extra_objs scrollbar-msw.o" && if test "$extra_verbose" = "yes"; then + if test "$window_system" != x11; then + window_system=msw + test "$with_scrollbars" != "no" && with_scrollbars=msw \ + && extra_objs="$extra_objs scrollbar-msw.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"scrollbar-msw.o\"" fi - test "$with_menubars" != "no" && with_menubars=msw && extra_objs="$extra_objs menubar-msw.o" && if test "$extra_verbose" = "yes"; then + test "$with_menubars" != "no" && with_menubars=msw \ + && extra_objs="$extra_objs menubar-msw.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"menubar-msw.o\"" fi - with_dialogs=msw - with_toolbars=no - with_tty=no + with_dialogs=msw + with_toolbars=no + else + test "$with_scrollbars" != "no" && extra_objs="$extra_objs scrollbar-msw.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"scrollbar-msw.o\"" + fi + test "$with_menubars" != "no" && extra_objs="$extra_objs menubar-msw.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"menubar-msw.o\"" + fi + fi const_is_losing=no with_file_coding=yes - extra_objs="$extra_objs console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o gif_err.o gifalloc.o dgif_lib.o" && if test "$extra_verbose" = "yes"; then - echo " xemacs will be linked with \"console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o gif_err.o gifalloc.o dgif_lib.o\"" + extra_objs="$extra_objs console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o\"" fi fi fi @@ -5147,7 +5159,7 @@ fi echo "checking for X defines extracted by xmkmf" 1>&6 -echo "configure:5151: checking for X defines extracted by xmkmf" >&5 +echo "configure:5163: checking for X defines extracted by xmkmf" >&5 rm -fr conftestdir if mkdir conftestdir; then cd conftestdir @@ -5179,15 +5191,15 @@ ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6 -echo "configure:5183: checking for X11/Intrinsic.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5186 "configure" +echo "configure:5195: checking for X11/Intrinsic.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5198 "configure" #include "confdefs.h" #include <X11/Intrinsic.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5211,12 +5223,12 @@ echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:5215: checking for XOpenDisplay in -lX11" >&5 +echo "configure:5227: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <<EOF -#line 5220 "configure" +#line 5232 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5227,7 +5239,7 @@ XOpenDisplay() ; return 0; } EOF -if { (eval echo configure:5231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5252,12 +5264,12 @@ xe_msg_checking="for XGetFontProperty in -lX11" test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:5256: checking "$xe_msg_checking"" >&5 +echo "configure:5268: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 -b i486-linuxaout" cat > conftest.$ac_ext <<EOF -#line 5261 "configure" +#line 5273 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5268,7 +5280,7 @@ XGetFontProperty() ; return 0; } EOF -if { (eval echo configure:5272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5295,12 +5307,12 @@ echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 -echo "configure:5299: checking for XShapeSelectInput in -lXext" >&5 +echo "configure:5311: checking for XShapeSelectInput in -lXext" >&5 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'` xe_check_libs=" -lXext " cat > conftest.$ac_ext <<EOF -#line 5304 "configure" +#line 5316 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5311,7 +5323,7 @@ XShapeSelectInput() ; return 0; } EOF -if { (eval echo configure:5315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5334,12 +5346,12 @@ echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 -echo "configure:5338: checking for XtOpenDisplay in -lXt" >&5 +echo "configure:5350: checking for XtOpenDisplay in -lXt" >&5 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lXt " cat > conftest.$ac_ext <<EOF -#line 5343 "configure" +#line 5355 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5350,7 +5362,7 @@ XtOpenDisplay() ; return 0; } EOF -if { (eval echo configure:5354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5373,14 +5385,14 @@ echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6 -echo "configure:5377: checking the version of X11 being used" >&5 +echo "configure:5389: checking the version of X11 being used" >&5 cat > conftest.$ac_ext <<EOF -#line 5379 "configure" +#line 5391 "configure" #include "confdefs.h" #include <X11/Intrinsic.h> main(int c, char* v[]) { return c>1 ? XlibSpecificationRelease : 0; } EOF -if { (eval echo configure:5384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:5396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ./conftest foobar; x11_release=$? else @@ -5404,15 +5416,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5408: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5411 "configure" +echo "configure:5420: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5423 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5416: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5443,7 +5455,7 @@ echo $ac_n "checking for XFree86""... $ac_c" 1>&6 -echo "configure:5447: checking for XFree86" >&5 +echo "configure:5459: checking for XFree86" >&5 if test -d "/usr/X386/include" -o \ -f "/etc/XF86Config" -o \ -f "/etc/X11/XF86Config" -o \ @@ -5463,12 +5475,12 @@ test -z "$with_xmu" && { echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6 -echo "configure:5467: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 +echo "configure:5479: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'` xe_check_libs=" -lXmu " cat > conftest.$ac_ext <<EOF -#line 5472 "configure" +#line 5484 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5479,7 +5491,7 @@ XmuReadBitmapDataFromFile() ; return 0; } EOF -if { (eval echo configure:5483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5518,19 +5530,19 @@ echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:5522: checking for main in -lXbsd" >&5 +echo "configure:5534: checking for main in -lXbsd" >&5 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lXbsd " cat > conftest.$ac_ext <<EOF -#line 5527 "configure" +#line 5539 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5589,7 +5601,7 @@ esac echo "checking for session-management option" 1>&6 -echo "configure:5593: checking for session-management option" >&5; +echo "configure:5605: checking for session-management option" >&5; if test "$with_session" != "no"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SESSION @@ -5604,15 +5616,15 @@ test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6 -echo "configure:5608: checking for X11/Xauth.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5611 "configure" +echo "configure:5620: checking for X11/Xauth.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5623 "configure" #include "confdefs.h" #include <X11/Xauth.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5616: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5635,12 +5647,12 @@ } test -z "$with_xauth" && { echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:5639: checking for XauGetAuthByAddr in -lXau" >&5 +echo "configure:5651: checking for XauGetAuthByAddr in -lXau" >&5 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'` xe_check_libs=" -lXau " cat > conftest.$ac_ext <<EOF -#line 5644 "configure" +#line 5656 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5651,7 +5663,7 @@ XauGetAuthByAddr() ; return 0; } EOF -if { (eval echo configure:5655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5715,15 +5727,15 @@ for dir in "" "Tt/" "desktop/" ; do ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6 -echo "configure:5719: checking for ${dir}tt_c.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5722 "configure" +echo "configure:5731: checking for ${dir}tt_c.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5734 "configure" #include "confdefs.h" #include <${dir}tt_c.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5752,12 +5764,12 @@ xe_msg_checking="for tt_message_create in -ltt" test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:5756: checking "$xe_msg_checking"" >&5 +echo "configure:5768: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'` xe_check_libs=" -ltt $extra_libs" cat > conftest.$ac_ext <<EOF -#line 5761 "configure" +#line 5773 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5768,7 +5780,7 @@ tt_message_create() ; return 0; } EOF -if { (eval echo configure:5772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5817,15 +5829,15 @@ test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6 -echo "configure:5821: checking for Dt/Dt.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5824 "configure" +echo "configure:5833: checking for Dt/Dt.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5836 "configure" #include "confdefs.h" #include <Dt/Dt.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5841: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5848,12 +5860,12 @@ } test -z "$with_cde" && { echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:5852: checking for DtDndDragStart in -lDtSvc" >&5 +echo "configure:5864: checking for DtDndDragStart in -lDtSvc" >&5 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lDtSvc " cat > conftest.$ac_ext <<EOF -#line 5857 "configure" +#line 5869 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5864,7 +5876,7 @@ DtDndDragStart() ; return 0; } EOF -if { (eval echo configure:5868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5901,18 +5913,18 @@ fi echo "checking for LDAP" 1>&6 -echo "configure:5905: checking for LDAP" >&5 +echo "configure:5917: checking for LDAP" >&5 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ldap.h""... $ac_c" 1>&6 -echo "configure:5908: checking for ldap.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5911 "configure" +echo "configure:5920: checking for ldap.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5923 "configure" #include "confdefs.h" #include <ldap.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5935,15 +5947,15 @@ } test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for lber.h""... $ac_c" 1>&6 -echo "configure:5939: checking for lber.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5942 "configure" +echo "configure:5951: checking for lber.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5954 "configure" #include "confdefs.h" #include <lber.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5968,12 +5980,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:5972: checking "$xe_msg_checking"" >&5 +echo "configure:5984: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber" cat > conftest.$ac_ext <<EOF -#line 5977 "configure" +#line 5989 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5984,7 +5996,7 @@ ldap_open() ; return 0; } EOF -if { (eval echo configure:5988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6007,12 +6019,12 @@ } test \( -z "$with_ldap" -o "$with_ldap" = "yes" \) -a "$with_umich_ldap" = "no" && { echo $ac_n "checking for ldap_set_option in -lldap10""... $ac_c" 1>&6 -echo "configure:6011: checking for ldap_set_option in -lldap10" >&5 +echo "configure:6023: checking for ldap_set_option in -lldap10" >&5 ac_lib_var=`echo ldap10'_'ldap_set_option | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap10 " cat > conftest.$ac_ext <<EOF -#line 6016 "configure" +#line 6028 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6023,7 +6035,7 @@ ldap_set_option() ; return 0; } EOF -if { (eval echo configure:6027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6107,13 +6119,13 @@ if test "$with_x11" = "yes"; then echo "checking for X11 graphics libraries" 1>&6 -echo "configure:6111: checking for X11 graphics libraries" >&5 +echo "configure:6123: checking for X11 graphics libraries" >&5 echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6 -echo "configure:6114: checking for Xpm - no older than 3.4f" >&5 +echo "configure:6126: checking for Xpm - no older than 3.4f" >&5 xe_check_libs=-lXpm test -z "$with_xpm" && { cat > conftest.$ac_ext <<EOF -#line 6117 "configure" +#line 6129 "configure" #include "confdefs.h" #include <X11/xpm.h> int main(int c, char **v) { @@ -6123,7 +6135,7 @@ 0 ; } EOF -if { (eval echo configure:6127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:6139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ./conftest foobar; xpm_status=$?; if test "$xpm_status" = "0"; then with_xpm=yes; else with_xpm=no; fi; @@ -6161,15 +6173,15 @@ test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for compface.h""... $ac_c" 1>&6 -echo "configure:6165: checking for compface.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6168 "configure" +echo "configure:6177: checking for compface.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6180 "configure" #include "confdefs.h" #include <compface.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6192,12 +6204,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:6196: checking for UnGenFace in -lcompface" >&5 +echo "configure:6208: checking for UnGenFace in -lcompface" >&5 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` xe_check_libs=" -lcompface " cat > conftest.$ac_ext <<EOF -#line 6201 "configure" +#line 6213 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6208,7 +6220,7 @@ UnGenFace() ; return 0; } EOF -if { (eval echo configure:6212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6259,15 +6271,15 @@ test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6 -echo "configure:6263: checking for jpeglib.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6266 "configure" +echo "configure:6275: checking for jpeglib.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6278 "configure" #include "confdefs.h" #include <jpeglib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6290,12 +6302,12 @@ } test -z "$with_jpeg" && { echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:6294: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:6306: checking for jpeg_destroy_decompress in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'` xe_check_libs=" -ljpeg " cat > conftest.$ac_ext <<EOF -#line 6299 "configure" +#line 6311 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6306,7 +6318,7 @@ jpeg_destroy_decompress() ; return 0; } EOF -if { (eval echo configure:6310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6342,15 +6354,15 @@ test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for png.h""... $ac_c" 1>&6 -echo "configure:6346: checking for png.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6349 "configure" +echo "configure:6358: checking for png.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6361 "configure" #include "confdefs.h" #include <png.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6372,10 +6384,10 @@ fi } test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:6376: checking for pow" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6379 "configure" +echo "configure:6388: checking for pow" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6391 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char pow(); below. */ @@ -6398,7 +6410,7 @@ ; return 0; } EOF -if { (eval echo configure:6402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_pow=yes" else @@ -6423,12 +6435,12 @@ xe_msg_checking="for png_read_image in -lpng" test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6427: checking "$xe_msg_checking"" >&5 +echo "configure:6439: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'` xe_check_libs=" -lpng $extra_libs" cat > conftest.$ac_ext <<EOF -#line 6432 "configure" +#line 6444 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6439,7 +6451,7 @@ png_read_image() ; return 0; } EOF -if { (eval echo configure:6443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6481,12 +6493,12 @@ xe_msg_checking="for TIFFReadScanline in -ltiff" test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6485: checking "$xe_msg_checking"" >&5 +echo "configure:6497: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo tiff'_'TIFFReadScanline | sed 'y%./+-%__p_%'` xe_check_libs=" -ltiff $extra_libs" cat > conftest.$ac_ext <<EOF -#line 6490 "configure" +#line 6502 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6497,7 +6509,7 @@ TIFFReadScanline() ; return 0; } EOF -if { (eval echo configure:6501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6535,12 +6547,12 @@ echo $ac_n "checking for XawScrollbarSetThumb in -lXaw""... $ac_c" 1>&6 -echo "configure:6539: checking for XawScrollbarSetThumb in -lXaw" >&5 +echo "configure:6551: checking for XawScrollbarSetThumb in -lXaw" >&5 ac_lib_var=`echo Xaw'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'` xe_check_libs=" -lXaw " cat > conftest.$ac_ext <<EOF -#line 6544 "configure" +#line 6556 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6551,7 +6563,7 @@ XawScrollbarSetThumb() ; return 0; } EOF -if { (eval echo configure:6555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6575,15 +6587,15 @@ ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:6579: checking for Xm/Xm.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6582 "configure" +echo "configure:6591: checking for Xm/Xm.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6594 "configure" #include "confdefs.h" #include <Xm/Xm.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6600,12 +6612,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:6604: checking for XmStringFree in -lXm" >&5 +echo "configure:6616: checking for XmStringFree in -lXm" >&5 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <<EOF -#line 6609 "configure" +#line 6621 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6616,7 +6628,7 @@ XmStringFree() ; return 0; } EOF -if { (eval echo configure:6620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6907,7 +6919,7 @@ if test "$with_mule" = "yes" ; then echo "checking for Mule-related features" 1>&6 -echo "configure:6911: checking for Mule-related features" >&5 +echo "configure:6923: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -6932,15 +6944,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6936: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6939 "configure" +echo "configure:6948: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6951 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6944: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6971,12 +6983,12 @@ echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:6975: checking for strerror in -lintl" >&5 +echo "configure:6987: checking for strerror in -lintl" >&5 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'` xe_check_libs=" -lintl " cat > conftest.$ac_ext <<EOF -#line 6980 "configure" +#line 6992 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6987,7 +6999,7 @@ strerror() ; return 0; } EOF -if { (eval echo configure:6991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7020,19 +7032,19 @@ echo "checking for Mule input methods" 1>&6 -echo "configure:7024: checking for Mule input methods" >&5 +echo "configure:7036: checking for Mule input methods" >&5 test -z "$with_xim" -a "$opsys" != "sol2" && with_xim=no case "$with_xim" in "" | "yes" ) echo "checking for XIM" 1>&6 -echo "configure:7028: checking for XIM" >&5 +echo "configure:7040: checking for XIM" >&5 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6 -echo "configure:7031: checking for XmImMbLookupString in -lXm" >&5 +echo "configure:7043: checking for XmImMbLookupString in -lXm" >&5 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <<EOF -#line 7036 "configure" +#line 7048 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7043,7 +7055,7 @@ XmImMbLookupString() ; return 0; } EOF -if { (eval echo configure:7047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7108,15 +7120,15 @@ if test "$with_xfs" = "yes" ; then echo "checking for XFontSet" 1>&6 -echo "configure:7112: checking for XFontSet" >&5 +echo "configure:7124: checking for XFontSet" >&5 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6 -echo "configure:7115: checking for XmbDrawString in -lX11" >&5 +echo "configure:7127: checking for XmbDrawString in -lX11" >&5 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <<EOF -#line 7120 "configure" +#line 7132 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7127,7 +7139,7 @@ XmbDrawString() ; return 0; } EOF -if { (eval echo configure:7131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7167,15 +7179,15 @@ test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6 -echo "configure:7171: checking for wnn/jllib.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7174 "configure" +echo "configure:7183: checking for wnn/jllib.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7186 "configure" #include "confdefs.h" #include <wnn/jllib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7200,10 +7212,10 @@ for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7204: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7207 "configure" +echo "configure:7216: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7219 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7226,7 +7238,7 @@ ; return 0; } EOF -if { (eval echo configure:7230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7255,12 +7267,12 @@ test "$ac_cv_func_crypt" != "yes" && { echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:7259: checking for crypt in -lcrypt" >&5 +echo "configure:7271: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` xe_check_libs=" -lcrypt " cat > conftest.$ac_ext <<EOF -#line 7264 "configure" +#line 7276 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7271,7 +7283,7 @@ crypt() ; return 0; } EOF -if { (eval echo configure:7275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7305,12 +7317,12 @@ fi test -z "$with_wnn" && { echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6 -echo "configure:7309: checking for jl_dic_list_e in -lwnn" >&5 +echo "configure:7321: checking for jl_dic_list_e in -lwnn" >&5 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn " cat > conftest.$ac_ext <<EOF -#line 7314 "configure" +#line 7326 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7321,7 +7333,7 @@ jl_dic_list_e() ; return 0; } EOF -if { (eval echo configure:7325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7358,12 +7370,12 @@ fi echo $ac_n "checking for jl_fi_dic_list in -lwnn""... $ac_c" 1>&6 -echo "configure:7362: checking for jl_fi_dic_list in -lwnn" >&5 +echo "configure:7374: checking for jl_fi_dic_list in -lwnn" >&5 ac_lib_var=`echo wnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn " cat > conftest.$ac_ext <<EOF -#line 7367 "configure" +#line 7379 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7374,7 +7386,7 @@ jl_fi_dic_list() ; return 0; } EOF -if { (eval echo configure:7378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7406,15 +7418,15 @@ test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6 -echo "configure:7410: checking for canna/RK.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7413 "configure" +echo "configure:7422: checking for canna/RK.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7425 "configure" #include "confdefs.h" #include <canna/RK.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7418: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -7437,12 +7449,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:7441: checking for RkBgnBun in -lRKC" >&5 +echo "configure:7453: checking for RkBgnBun in -lRKC" >&5 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'` xe_check_libs=" -lRKC " cat > conftest.$ac_ext <<EOF -#line 7446 "configure" +#line 7458 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7453,7 +7465,7 @@ RkBgnBun() ; return 0; } EOF -if { (eval echo configure:7457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7476,12 +7488,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:7480: checking for jrKanjiControl in -lcanna" >&5 +echo "configure:7492: checking for jrKanjiControl in -lcanna" >&5 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'` xe_check_libs=" -lcanna " cat > conftest.$ac_ext <<EOF -#line 7485 "configure" +#line 7497 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7492,7 +7504,7 @@ jrKanjiControl() ; return 0; } EOF -if { (eval echo configure:7496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7541,12 +7553,12 @@ libs_x="-lXm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXm\" to \$libs_x"; fi echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6 -echo "configure:7545: checking for layout_object_getvalue in -li18n" >&5 +echo "configure:7557: checking for layout_object_getvalue in -li18n" >&5 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'` xe_check_libs=" -li18n " cat > conftest.$ac_ext <<EOF -#line 7550 "configure" +#line 7562 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7557,7 +7569,7 @@ layout_object_getvalue() ; return 0; } EOF -if { (eval echo configure:7561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7630,10 +7642,10 @@ for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime gethostname getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask strcasecmp strerror tzset ulimit usleep utimes waitpid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7634: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7637 "configure" +echo "configure:7646: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7649 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7656,7 +7668,7 @@ ; return 0; } EOF -if { (eval echo configure:7660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7693,10 +7705,10 @@ for ac_func in realpath do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7697: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7700 "configure" +echo "configure:7709: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7712 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7719,7 +7731,7 @@ ; return 0; } EOF -if { (eval echo configure:7723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7752,16 +7764,16 @@ esac echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:7756: checking whether netdb declares h_errno" >&5 -cat > conftest.$ac_ext <<EOF -#line 7758 "configure" +echo "configure:7768: checking whether netdb declares h_errno" >&5 +cat > conftest.$ac_ext <<EOF +#line 7770 "configure" #include "confdefs.h" #include <netdb.h> int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:7765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -7781,16 +7793,16 @@ rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:7785: checking for sigsetjmp" >&5 -cat > conftest.$ac_ext <<EOF -#line 7787 "configure" +echo "configure:7797: checking for sigsetjmp" >&5 +cat > conftest.$ac_ext <<EOF +#line 7799 "configure" #include "confdefs.h" #include <setjmp.h> int main() { sigjmp_buf bar; sigsetjmp (bar, 0); ; return 0; } EOF -if { (eval echo configure:7794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -7810,11 +7822,11 @@ rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:7814: checking whether localtime caches TZ" >&5 +echo "configure:7826: checking whether localtime caches TZ" >&5 if test "$ac_cv_func_tzset" = "yes"; then cat > conftest.$ac_ext <<EOF -#line 7818 "configure" +#line 7830 "configure" #include "confdefs.h" #include <time.h> #if STDC_HEADERS @@ -7849,7 +7861,7 @@ exit (0); } EOF -if { (eval echo configure:7853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:7865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then emacs_cv_localtime_cache=no else @@ -7878,9 +7890,9 @@ if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday cannot accept two arguments""... $ac_c" 1>&6 -echo "configure:7882: checking whether gettimeofday cannot accept two arguments" >&5 -cat > conftest.$ac_ext <<EOF -#line 7884 "configure" +echo "configure:7894: checking whether gettimeofday cannot accept two arguments" >&5 +cat > conftest.$ac_ext <<EOF +#line 7896 "configure" #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME @@ -7902,7 +7914,7 @@ ; return 0; } EOF -if { (eval echo configure:7906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""no" 1>&6 else @@ -7924,19 +7936,19 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:7928: checking for inline" >&5 +echo "configure:7940: checking for inline" >&5 ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 7933 "configure" +#line 7945 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:7940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -7986,17 +7998,17 @@ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:7990: checking for working alloca.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7993 "configure" +echo "configure:8002: checking for working alloca.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8005 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:8000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -8020,10 +8032,10 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:8024: checking for alloca" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8027 "configure" +echo "configure:8036: checking for alloca" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8039 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -8046,7 +8058,7 @@ char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:8050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -8085,10 +8097,10 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:8089: checking whether alloca needs Cray hooks" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8092 "configure" +echo "configure:8101: checking whether alloca needs Cray hooks" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8104 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -8112,10 +8124,10 @@ if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8116: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8119 "configure" +echo "configure:8128: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8131 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -8138,7 +8150,7 @@ ; return 0; } EOF -if { (eval echo configure:8142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8168,10 +8180,10 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:8172: checking stack direction for C alloca" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8175 "configure" +echo "configure:8184: checking stack direction for C alloca" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8187 "configure" #include "confdefs.h" find_stack_direction () { @@ -8190,7 +8202,7 @@ exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:8194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_c_stack_direction=1 else @@ -8218,15 +8230,15 @@ ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:8222: checking for vfork.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8225 "configure" +echo "configure:8234: checking for vfork.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8237 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8254,10 +8266,10 @@ fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:8258: checking for working vfork" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8261 "configure" +echo "configure:8270: checking for working vfork" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8273 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -8352,7 +8364,7 @@ } } EOF -if { (eval echo configure:8356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_func_vfork_works=yes else @@ -8377,10 +8389,10 @@ echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:8381: checking for working strcoll" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8384 "configure" +echo "configure:8393: checking for working strcoll" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8396 "configure" #include "confdefs.h" #include <string.h> main () @@ -8390,7 +8402,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:8394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_func_strcoll_works=yes else @@ -8417,10 +8429,10 @@ for ac_func in getpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8421: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8424 "configure" +echo "configure:8433: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8436 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -8443,7 +8455,7 @@ ; return 0; } EOF -if { (eval echo configure:8447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8471,10 +8483,10 @@ done echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:8475: checking whether getpgrp takes no argument" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8478 "configure" +echo "configure:8487: checking whether getpgrp takes no argument" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8490 "configure" #include "confdefs.h" /* @@ -8529,7 +8541,7 @@ } EOF -if { (eval echo configure:8533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then ac_cv_func_getpgrp_void=yes else @@ -8555,10 +8567,10 @@ echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:8559: checking for working mmap" >&5 +echo "configure:8571: checking for working mmap" >&5 case "$opsys" in ultrix* ) have_mmap=no ;; *) cat > conftest.$ac_ext <<EOF -#line 8562 "configure" +#line 8574 "configure" #include "confdefs.h" #include <stdio.h> #include <unistd.h> @@ -8591,7 +8603,7 @@ return 1; } EOF -if { (eval echo configure:8595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 +if { (eval echo configure:8607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>&5 then have_mmap=yes else @@ -8625,15 +8637,15 @@ ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:8629: checking for termios.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8632 "configure" +echo "configure:8641: checking for termios.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8644 "configure" #include "confdefs.h" #include <termios.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8676,15 +8688,15 @@ echo "$ac_t""no" 1>&6 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termio.h""... $ac_c" 1>&6 -echo "configure:8680: checking for termio.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8683 "configure" +echo "configure:8692: checking for termio.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8695 "configure" #include "confdefs.h" #include <termio.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8716,10 +8728,10 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:8720: checking for socket" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8723 "configure" +echo "configure:8732: checking for socket" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8735 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char socket(); below. */ @@ -8742,7 +8754,7 @@ ; return 0; } EOF -if { (eval echo configure:8746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -8757,15 +8769,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6 -echo "configure:8761: checking for netinet/in.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8764 "configure" +echo "configure:8773: checking for netinet/in.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8776 "configure" #include "confdefs.h" #include <netinet/in.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8782,15 +8794,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6 -echo "configure:8786: checking for arpa/inet.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8789 "configure" +echo "configure:8798: checking for arpa/inet.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8801 "configure" #include "confdefs.h" #include <arpa/inet.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8815,9 +8827,9 @@ } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:8819: checking "for sun_len member in struct sockaddr_un"" >&5 +echo "configure:8831: checking "for sun_len member in struct sockaddr_un"" >&5 cat > conftest.$ac_ext <<EOF -#line 8821 "configure" +#line 8833 "configure" #include "confdefs.h" #include <sys/types.h> @@ -8828,7 +8840,7 @@ static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:8832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SOCKADDR_SUN_LEN @@ -8846,9 +8858,9 @@ fi rm -f conftest* echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6 -echo "configure:8850: checking "for ip_mreq struct in netinet/in.h"" >&5 +echo "configure:8862: checking "for ip_mreq struct in netinet/in.h"" >&5 cat > conftest.$ac_ext <<EOF -#line 8852 "configure" +#line 8864 "configure" #include "confdefs.h" #include <netinet/in.h> @@ -8857,7 +8869,7 @@ static struct ip_mreq x; ; return 0; } EOF -if { (eval echo configure:8861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MULTICAST @@ -8888,10 +8900,10 @@ echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:8892: checking for msgget" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8895 "configure" +echo "configure:8904: checking for msgget" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8907 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char msgget(); below. */ @@ -8914,7 +8926,7 @@ ; return 0; } EOF -if { (eval echo configure:8918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_msgget=yes" else @@ -8929,15 +8941,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6 -echo "configure:8933: checking for sys/ipc.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8936 "configure" +echo "configure:8945: checking for sys/ipc.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8948 "configure" #include "confdefs.h" #include <sys/ipc.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8941: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -8954,15 +8966,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6 -echo "configure:8958: checking for sys/msg.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8961 "configure" +echo "configure:8970: checking for sys/msg.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8973 "configure" #include "confdefs.h" #include <sys/msg.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9000,15 +9012,15 @@ ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:9004: checking for dirent.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9007 "configure" +echo "configure:9016: checking for dirent.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9019 "configure" #include "confdefs.h" #include <dirent.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9035,15 +9047,15 @@ echo "$ac_t""no" 1>&6 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6 -echo "configure:9039: checking for sys/dir.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9042 "configure" +echo "configure:9051: checking for sys/dir.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9054 "configure" #include "confdefs.h" #include <sys/dir.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9059: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9076,15 +9088,15 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:9080: checking for nlist.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9083 "configure" +echo "configure:9092: checking for nlist.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9095 "configure" #include "confdefs.h" #include <nlist.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9114,7 +9126,7 @@ echo "checking "for sound support"" 1>&6 -echo "configure:9118: checking "for sound support"" >&5 +echo "configure:9130: checking "for sound support"" >&5 case "$with_sound" in native | both ) with_native_sound=yes;; nas | no ) with_native_sound=no;; @@ -9125,15 +9137,15 @@ if test -n "$native_sound_lib"; then ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6 -echo "configure:9129: checking for multimedia/audio_device.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9132 "configure" +echo "configure:9141: checking for multimedia/audio_device.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9144 "configure" #include "confdefs.h" #include <multimedia/audio_device.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9181,12 +9193,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:9185: checking for ALopenport in -laudio" >&5 +echo "configure:9197: checking for ALopenport in -laudio" >&5 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <<EOF -#line 9190 "configure" +#line 9202 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9197,7 +9209,7 @@ ALopenport() ; return 0; } EOF -if { (eval echo configure:9201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9228,12 +9240,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:9232: checking for AOpenAudio in -lAlib" >&5 +echo "configure:9244: checking for AOpenAudio in -lAlib" >&5 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'` xe_check_libs=" -lAlib " cat > conftest.$ac_ext <<EOF -#line 9237 "configure" +#line 9249 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9244,7 +9256,7 @@ AOpenAudio() ; return 0; } EOF -if { (eval echo configure:9248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9282,15 +9294,15 @@ for dir in "machine" "sys" "linux"; do ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6 -echo "configure:9286: checking for ${dir}/soundcard.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9289 "configure" +echo "configure:9298: checking for ${dir}/soundcard.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9301 "configure" #include "confdefs.h" #include <${dir}/soundcard.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9360,7 +9372,7 @@ fi libs_x="-laudio $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-laudio\" to \$libs_x"; fi cat > conftest.$ac_ext <<EOF -#line 9364 "configure" +#line 9376 "configure" #include "confdefs.h" #include <audio/Xtutil.h> EOF @@ -9387,7 +9399,7 @@ if test "$with_tty" = "yes" ; then echo "checking for TTY-related features" 1>&6 -echo "configure:9391: checking for TTY-related features" >&5 +echo "configure:9403: checking for TTY-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TTY EOF @@ -9403,12 +9415,12 @@ if test -z "$with_ncurses"; then echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:9407: checking for tgetent in -lncurses" >&5 +echo "configure:9419: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lncurses " cat > conftest.$ac_ext <<EOF -#line 9412 "configure" +#line 9424 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9419,7 +9431,7 @@ tgetent() ; return 0; } EOF -if { (eval echo configure:9423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9452,15 +9464,15 @@ ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:9456: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9459 "configure" +echo "configure:9468: checking for ncurses/curses.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9471 "configure" #include "confdefs.h" #include <ncurses/curses.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9464: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9482,15 +9494,15 @@ ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6 -echo "configure:9486: checking for ncurses/term.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9489 "configure" +echo "configure:9498: checking for ncurses/term.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9501 "configure" #include "confdefs.h" #include <ncurses/term.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9520,15 +9532,15 @@ c_switch_site="$c_switch_site -I/usr/include/ncurses" ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:9524: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9527 "configure" +echo "configure:9536: checking for ncurses/curses.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9539 "configure" #include "confdefs.h" #include <ncurses/curses.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9563,12 +9575,12 @@ for lib in curses termlib termcap; do echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 -echo "configure:9567: checking for tgetent in -l$lib" >&5 +echo "configure:9579: checking for tgetent in -l$lib" >&5 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -l$lib " cat > conftest.$ac_ext <<EOF -#line 9572 "configure" +#line 9584 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9579,7 +9591,7 @@ tgetent() ; return 0; } EOF -if { (eval echo configure:9583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9610,12 +9622,12 @@ else echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:9614: checking for tgetent in -lcurses" >&5 +echo "configure:9626: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lcurses " cat > conftest.$ac_ext <<EOF -#line 9619 "configure" +#line 9631 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9626,7 +9638,7 @@ tgetent() ; return 0; } EOF -if { (eval echo configure:9630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9644,12 +9656,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:9648: checking for tgetent in -ltermcap" >&5 +echo "configure:9660: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -ltermcap " cat > conftest.$ac_ext <<EOF -#line 9653 "configure" +#line 9665 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9660,7 +9672,7 @@ tgetent() ; return 0; } EOF -if { (eval echo configure:9664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9708,15 +9720,15 @@ test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for gpm.h""... $ac_c" 1>&6 -echo "configure:9712: checking for gpm.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9715 "configure" +echo "configure:9724: checking for gpm.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9727 "configure" #include "confdefs.h" #include <gpm.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -9739,12 +9751,12 @@ } test -z "$with_gpm" && { echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:9743: checking for Gpm_Open in -lgpm" >&5 +echo "configure:9755: checking for Gpm_Open in -lgpm" >&5 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgpm " cat > conftest.$ac_ext <<EOF -#line 9748 "configure" +#line 9760 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9755,7 +9767,7 @@ Gpm_Open() ; return 0; } EOF -if { (eval echo configure:9759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9804,17 +9816,17 @@ echo "checking for database support" 1>&6 -echo "configure:9808: checking for database support" >&5 +echo "configure:9820: checking for database support" >&5 if test "$with_database_gnudbm" != "no"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:9813: checking for dbm_open in -lgdbm" >&5 +echo "configure:9825: checking for dbm_open in -lgdbm" >&5 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdbm " cat > conftest.$ac_ext <<EOF -#line 9818 "configure" +#line 9830 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9825,7 +9837,7 @@ dbm_open() ; return 0; } EOF -if { (eval echo configure:9829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9847,10 +9859,10 @@ if test "$with_database_gnudbm" != "yes"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:9851: checking for dbm_open" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9854 "configure" +echo "configure:9863: checking for dbm_open" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9866 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dbm_open(); below. */ @@ -9873,7 +9885,7 @@ ; return 0; } EOF -if { (eval echo configure:9877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -9909,10 +9921,10 @@ if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:9913: checking for dbm_open" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9916 "configure" +echo "configure:9925: checking for dbm_open" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9928 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dbm_open(); below. */ @@ -9935,7 +9947,7 @@ ; return 0; } EOF -if { (eval echo configure:9939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -9956,12 +9968,12 @@ if test "$need_libdbm" != "no"; then echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:9960: checking for dbm_open in -ldbm" >&5 +echo "configure:9972: checking for dbm_open in -ldbm" >&5 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -ldbm " cat > conftest.$ac_ext <<EOF -#line 9965 "configure" +#line 9977 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9972,7 +9984,7 @@ dbm_open() ; return 0; } EOF -if { (eval echo configure:9976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:9988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10009,10 +10021,10 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for dbopen""... $ac_c" 1>&6 -echo "configure:10013: checking for dbopen" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10016 "configure" +echo "configure:10025: checking for dbopen" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10028 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dbopen(); below. */ @@ -10035,7 +10047,7 @@ ; return 0; } EOF -if { (eval echo configure:10039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbopen=yes" else @@ -10056,12 +10068,12 @@ if test "$need_libdb" != "no"; then echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6 -echo "configure:10060: checking for dbopen in -ldb" >&5 +echo "configure:10072: checking for dbopen in -ldb" >&5 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'` xe_check_libs=" -ldb " cat > conftest.$ac_ext <<EOF -#line 10065 "configure" +#line 10077 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10072,7 +10084,7 @@ dbopen() ; return 0; } EOF -if { (eval echo configure:10076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10096,7 +10108,7 @@ if test "$with_database_berkdb" = "yes"; then for path in "db/db.h" "db.h"; do cat > conftest.$ac_ext <<EOF -#line 10100 "configure" +#line 10112 "configure" #include "confdefs.h" #ifdef HAVE_INTTYPES_H #define __BIT_TYPES_DEFINED__ @@ -10114,7 +10126,7 @@ ; return 0; } EOF -if { (eval echo configure:10118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* db_h_path="$path"; break else @@ -10166,12 +10178,12 @@ if test "$with_socks" = "yes"; then echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6 -echo "configure:10170: checking for SOCKSinit in -lsocks" >&5 +echo "configure:10182: checking for SOCKSinit in -lsocks" >&5 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocks " cat > conftest.$ac_ext <<EOF -#line 10175 "configure" +#line 10187 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10182,7 +10194,7 @@ SOCKSinit() ; return 0; } EOF -if { (eval echo configure:10186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10237,15 +10249,15 @@ test -z "$with_shlib" && { ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:10241: checking for dlfcn.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10244 "configure" +echo "configure:10253: checking for dlfcn.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10256 "configure" #include "confdefs.h" #include <dlfcn.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -10268,12 +10280,12 @@ } test -z "$with_shlib" && { echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:10272: checking for dlopen in -ldl" >&5 +echo "configure:10284: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -ldl " cat > conftest.$ac_ext <<EOF -#line 10277 "configure" +#line 10289 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10284,7 +10296,7 @@ dlopen() ; return 0; } EOF -if { (eval echo configure:10288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:10300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10298,12 +10310,49 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then echo "$ac_t""yes" 1>&6 - : + LIBS="-ldl $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ldl\" to \$LIBS"; fi +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 +echo "configure:10318: checking for dlopen in -lc" >&5 +ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'` + +xe_check_libs=" -lc " +cat > conftest.$ac_ext <<EOF +#line 10323 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen(); + +int main() { +dlopen() +; return 0; } +EOF +if { (eval echo configure:10334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + with_shlib=yes else echo "$ac_t""no" 1>&6 with_shlib=no fi + +fi + } test -z "$with_shlib" && with_shlib=yes if test "$with_shlib" = "yes"; then @@ -10318,10 +10367,25 @@ extra_objs="$extra_objs dlopen.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"dlopen.o\"" fi - LIBS="-ldl $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ldl\" to \$LIBS"; fi -fi - - + ld_dynamic_link_flags= + case "$opsys" in + linux*) ld_dynamic_link_flags="-rdynamic" ;; + *) ;; + esac +fi + + +{ test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_UNIX_PROCESSES +EOF +cat >> confdefs.h <<\EOF +#define HAVE_UNIX_PROCESSES 1 +EOF +} + +extra_objs="$extra_objs process-unix.o" && if test "$extra_verbose" = "yes"; then + echo " xemacs will be linked with \"process-unix.o\"" + fi @@ -10479,6 +10543,7 @@ + RECURSIVE_MAKE="\$(MAKE) \$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'" @@ -11005,6 +11070,7 @@ s%@docdir@%$docdir%g s%@bitmapdir@%$bitmapdir%g s%@extra_objs@%$extra_objs%g +s%@ld_dynamic_link_flags@%$ld_dynamic_link_flags%g s%@machfile@%$machfile%g s%@opsysfile@%$opsysfile%g s%@c_switch_general@%$c_switch_general%g
--- a/configure.in Mon Aug 13 10:23:52 2007 +0200 +++ b/configure.in Mon Aug 13 10:24:41 2007 +0200 @@ -350,6 +350,7 @@ cflags='UNSPECIFIED' dynamic='' with_x11='' +with_msw='' with_gung='no' with_minimal_tagbits='no' rel_alloc='default' @@ -449,6 +450,7 @@ run_in_place | \ with_x | \ with_x11 | \ + with_msw | \ with_gcc | \ with_gnu_make | \ dynamic | \ @@ -2153,21 +2155,27 @@ no ) window_system=none HAVE_X_WINDOWS=no ;; esac -if test "$window_system" = "none" && test -z "$with_tty"; then +if test "$with_msw" != "no"; then AC_CHECKING(for MS-Windows) - AC_CHECK_LIB(gdi32,main,have_msw=yes) - if test "$have_msw" = "yes"; then + AC_CHECK_LIB(gdi32,main,with_msw=yes) + if test "$with_msw" = "yes"; then AC_DEFINE(HAVE_MS_WINDOWS) XE_APPEND(-lshell32 -lgdi32 -luser32, libs_system) - window_system=msw - test "$with_scrollbars" != "no" && with_scrollbars=msw && XE_ADD_OBJS(scrollbar-msw.o) - test "$with_menubars" != "no" && with_menubars=msw && XE_ADD_OBJS(menubar-msw.o) - with_dialogs=msw - with_toolbars=no - with_tty=no + if test "$window_system" != x11; then + window_system=msw + test "$with_scrollbars" != "no" && with_scrollbars=msw \ + && XE_ADD_OBJS(scrollbar-msw.o) + test "$with_menubars" != "no" && with_menubars=msw \ + && XE_ADD_OBJS(menubar-msw.o) + with_dialogs=msw + with_toolbars=no + else + test "$with_scrollbars" != "no" && XE_ADD_OBJS(scrollbar-msw.o) + test "$with_menubars" != "no" && XE_ADD_OBJS(menubar-msw.o) + fi const_is_losing=no with_file_coding=yes - XE_ADD_OBJS(console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o gif_err.o gifalloc.o dgif_lib.o) + XE_ADD_OBJS(console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw.o) fi fi @@ -3224,20 +3232,26 @@ dnl autodetect dll support test -z "$with_shlib" && { AC_CHECK_HEADER(dlfcn.h, ,with_shlib=no) } -test -z "$with_shlib" && { AC_CHECK_LIB(dl, dlopen,[:],with_shlib=no) } +test -z "$with_shlib" && { AC_CHECK_LIB(dl, dlopen, XE_PREPEND(-ldl, LIBS), + AC_CHECK_LIB(c, dlopen, with_shlib=yes, with_shlib=no)) } test -z "$with_shlib" && with_shlib=yes if test "$with_shlib" = "yes"; then AC_DEFINE(HAVE_SHLIB) XE_ADD_OBJS(dlopen.o) - XE_PREPEND(-ldl, LIBS) + ld_dynamic_link_flags= + dnl Fill this in with other values as this gets more testing + case "$opsys" in + linux*) ld_dynamic_link_flags="-rdynamic" ;; + *) ;; + esac fi dnl Process support (hardcoded) dnl every system that supports this runs configure, the others don't dnl We're not ready for this yet. -dnl AC_DEFINE(HAVE_UNIX_PROCESSES) -dnl XE_ADD_OBJS(process-unix.o) +AC_DEFINE(HAVE_UNIX_PROCESSES) +XE_ADD_OBJS(process-unix.o) dnl -------------------------------- dnl Compute SUBST-itutable variables @@ -3347,6 +3361,7 @@ AC_SUBST(docdir) AC_SUBST(bitmapdir) AC_SUBST(extra_objs) +AC_SUBST(ld_dynamic_link_flags) dnl The following flags combine all the information from: dnl - command line options (user always gets priority)
--- a/etc/Emacs.ad Mon Aug 13 10:23:52 2007 +0200 +++ b/etc/Emacs.ad Mon Aug 13 10:24:41 2007 +0200 @@ -31,11 +31,11 @@ ! `rgb.txt', usually found in /usr/lib/X11/ or /usr/openwin/lib/X11/. ! Set the modeline colors. -!Emacs.modeline*attributeForeground: Black -!Emacs.modeline*attributeBackground: Gray75 +!.modeline*attributeForeground: Black +!.modeline*attributeBackground: Gray75 ! Set the color of the text cursor. -Emacs.text-cursor*attributeBackground: Red3 +.text-cursor*attributeBackground: Red3 ! If you want to set the color of the mouse pointer, do this: ! Emacs.pointer*attributeForeground: Black
--- a/lib-src/ChangeLog Mon Aug 13 10:23:52 2007 +0200 +++ b/lib-src/ChangeLog Mon Aug 13 10:24:41 2007 +0200 @@ -1,3 +1,7 @@ +1998-03-02 SL Baur <steve@altair.xemacs.org> + + * update-elc.sh: Change all -q -no-site-file to -vanilla + 1998-02-27 SL Baur <steve@altair.xemacs.org> * update-elc.sh (ignore_pattern): Add Installation.el, remove old
--- a/lib-src/config.values.in Mon Aug 13 10:23:52 2007 +0200 +++ b/lib-src/config.values.in Mon Aug 13 10:24:41 2007 +0200 @@ -66,6 +66,7 @@ infopath_user_defined "@infopath_user_defined@" internal_makefile_list "@internal_makefile_list@" ld "@ld@" +ld_dynamic_link_flags "@ld_dynamic_link_flags@" ld_libs_all "@ld_libs_all@" ld_libs_general "@ld_libs_general@" ld_libs_window_system "@ld_libs_window_system@"
--- a/lib-src/update-elc.sh Mon Aug 13 10:23:52 2007 +0200 +++ b/lib-src/update-elc.sh Mon Aug 13 10:24:41 2007 +0200 @@ -61,11 +61,11 @@ fi REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS` -BYTECOMP="$REAL -batch -q -no-site-file " +BYTECOMP="$REAL -batch -vanilla " echo "Recompiling in `pwd|sed 's|^/tmp_mnt||'`" echo " with $REAL..." -$EMACS -batch -q -no-site-file -l `pwd`/lisp/cleantree -f batch-remove-old-elc lisp +$EMACS -batch -vanilla -l `pwd`/lisp/cleantree -f batch-remove-old-elc lisp prune_vc="( -name '.*' -o -name SCCS -o -name RCS -o -name CVS ) -prune -o" @@ -91,7 +91,7 @@ # Only use Mule XEmacs to compile Mule-specific elisp dirs echon "Checking for Mule support..." lisp_prog='(princ (featurep (quote mule)))' -mule_p="`$EMACS -batch -q -no-site-file -eval \"$lisp_prog\"`" +mule_p="`$EMACS -batch -vanilla -eval \"$lisp_prog\"`" if test "$mule_p" = nil ; then echo No ignore_dirs="$ignore_dirs its egg mule language leim skk"
--- a/lisp/ChangeLog Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/ChangeLog Mon Aug 13 10:24:41 2007 +0200 @@ -1,3 +1,83 @@ +1998-03-07 Kyle Jones <kyle_jones@wonderworks.com> + + * specifier.el: Define new specifier tag `default'. + + * modeline.el: Initialize faces using `default' tag. + + * x-faces.el (x-init-face-from-resources): Remove + specifier specs containing the `default' tag before + adding new specs. + +1998-03-02 John Jones <jj@asu.edu> + + * package-get.el (package-get-all): fixed arguments on call to + package-admin-add-single-file-package. + * package-get.el (package-get-installedp): fixed to match + advertised behavior. + * package-get.el: added function package-get-update-all which + installs newest versions of all the current packages (if they are + not already installed). + +1998-03-04 Jens-Ulrik Petersen <petersen@kurims.kyoto-u.ac.jp> + + * files.el (find-file-noselect): Uncommented `truename' binding in + `let*' and use it later to set `buffer-file-truename' iff it's + still nil, as happens for example when finding a compressed + file with "jka-compr". + +Wed Mar 04 08:55:12 1998 Andy Piper <andyp@parallax.co.uk> + + * faces.el: in make-face-* type functions do the operation for all + window systems, not just the first one found. + + * font.el: call mswindows-list-fonts for mswindows. + +1998-03-02 Glynn Clements <glynn@sensei.co.uk> + + * code-process.el (call-process-region): + * process.el (call-process-region): + * package-get.el (package-get-dir): + * files.el (backup-enable-predicate): + * gnuserv.el (gnuserv-temp-file-regexp): + Use temp-directory in place of `/tmp'. + +Fri Feb 20 21:22:34 1998 Darryl Okahata <darrylo@sr.hp.com> + + * "Fast" dired-in-C enhancements for Windows 95/NT: + + * files.el: Added function, `wildcard-to-regexp', from GNU + Emacs. + + * files.el (insert-directory): Modified to use special + dired-in-C enhancements if present. + +Mon Mar 02 11:37:36 1998 Andy Piper <andyp@parallax.co.uk> + + * code-files.el: make default coding no-conversion. + +1998-03-02 SL Baur <steve@altair.xemacs.org> + + * dumped-lisp.el (preloaded-file-list): Find Installation.el from + the load-path. + + * update-elc.el: Strip directory when testing for files not to + bytecompile. + +1998-03-02 Aki Vehtari <Aki.Vehtari@hut.fi> + + * lisp-mode.el: Use recommended form for menus. + + * info.el (Info-construct-menu): Use recommended form for menus. + + * gnuserv.el (gnuserv-edit-files): Use recommended form for menu + entry. + +1998-02-28 Kyle Jones <kyle_jones@wonderworks.com> + + * frame.el: Resurrect get-frame-for-buffer-default-to-current. + (get-frame-for-buffer-noselect): Always return frames + in the not-this-window-p cond clause. + 1998-02-27 SL Baur <steve@altair.xemacs.org> * help.el (describe-installation): New function.
--- a/lisp/code-files.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/code-files.el Mon Aug 13 10:24:41 2007 +0200 @@ -32,7 +32,7 @@ ;;; Code: -(setq-default buffer-file-coding-system 'undecided) +(setq-default buffer-file-coding-system 'no-conversion) (put 'buffer-file-coding-system 'permanent-local t) (define-obsolete-variable-alias
--- a/lisp/code-process.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/code-process.el Mon Aug 13 10:24:41 2007 +0200 @@ -111,12 +111,13 @@ (eq system-type 'windows-nt)) (make-temp-name (concat (file-name-as-directory - (or (getenv "TMP") - (getenv "TEMP") - "")) + (temp-directory)) "em"))) (t - (make-temp-name "/tmp/emacs"))))) + (make-temp-name + (concat (file-name-as-directory + (temp-directory)) + "emacs")))))) (unwind-protect (let (cs-r cs-w) (let (ret)
--- a/lisp/dumped-lisp.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/dumped-lisp.el Mon Aug 13 10:24:41 2007 +0200 @@ -6,7 +6,7 @@ "replace" ; match-string used in version.el. ; Ignore compiled-by-mistake version.elc "version.el" - #-infodock "../Installation.el" + #-infodock "Installation.el" "cl" "cl-extra" "cl-seq" @@ -101,6 +101,7 @@ #+mule "mule-misc" #+mule "kinsoku" #+(and mule x) "mule-x-init" + #+(and mule tty) "mule-tty-init" #+mule "mule-cmds" ; to sync with Emacs 20.1 ;; after this goes the specific lisp routines for a particular input system
--- a/lisp/faces.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/faces.el Mon Aug 13 10:24:41 2007 +0200 @@ -966,11 +966,11 @@ (set-face-highlight-p face t locale 'tty))) (lambda () ;; handle X specific entries - (cond ((featurep 'x) - (frob-face-property face 'font 'x-make-font-bold locale)) - ((featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-bold locale)) - )) + (when (featurep 'x) + (frob-face-property face 'font 'x-make-font-bold locale)) + (when (featurep 'mswindows) + (frob-face-property face 'font 'mswindows-make-font-bold locale)) + ) '(([default] . [bold]) ([bold] . t) ([italic] . [bold-italic]) @@ -991,11 +991,11 @@ (set-face-underline-p face t locale 'tty))) (lambda () ;; handle X specific entries - (cond ((featurep 'x) - (frob-face-property face 'font 'x-make-font-italic locale)) - ((featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-italic locale)) - )) + (when (featurep 'x) + (frob-face-property face 'font 'x-make-font-italic locale)) + (when (featurep 'mswindows) + (frob-face-property face 'font 'mswindows-make-font-italic locale)) + ) '(([default] . [italic]) ([bold] . [bold-italic]) ([italic] . t) @@ -1017,11 +1017,11 @@ (set-face-underline-p face t locale 'tty))) (lambda () ;; handle X specific entries - (cond ((featurep 'x) - (frob-face-property face 'font 'x-make-font-bold-italic locale)) - ((featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-bold-italic locale)) - )) + (when (featurep 'x) + (frob-face-property face 'font 'x-make-font-bold-italic locale)) + (when (featurep 'mswindows) + (frob-face-property face 'font 'mswindows-make-font-bold-italic locale)) + ) '(([default] . [italic]) ([bold] . [bold-italic]) ([italic] . [bold-italic]) @@ -1042,11 +1042,11 @@ (set-face-highlight-p face nil locale 'tty))) (lambda () ;; handle X specific entries - (cond ((featurep 'x) - (frob-face-property face 'font 'x-make-font-unbold locale)) - ((featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-unbold locale)) - )) + (when (featurep 'x) + (frob-face-property face 'font 'x-make-font-unbold locale)) + (when (featurep 'mswindows) + (frob-face-property face 'font 'mswindows-make-font-unbold locale)) + ) '(([default] . t) ([bold] . [default]) ([italic] . t) @@ -1067,11 +1067,11 @@ (set-face-underline-p face nil locale 'tty))) (lambda () ;; handle X specific entries - (cond ((featurep 'x) - (frob-face-property face 'font 'x-make-font-unitalic locale)) - ((featurep 'mswindows) - (frob-face-property face 'font 'mswindows-make-font-unitalic locale)) - )) + (when (featurep 'x) + (frob-face-property face 'font 'x-make-font-unitalic locale)) + (when (featurep 'mswindows) + (frob-face-property face 'font 'mswindows-make-font-unitalic locale)) + ) '(([default] . t) ([bold] . t) ([italic] . [default]) @@ -1088,20 +1088,20 @@ because they don't make sense in this context." (interactive (list (read-face-name "Shrink which face: "))) ;; handle X specific entries - (cond ((featurep 'x) - (frob-face-property face 'font 'x-find-smaller-font locale)) - ((featurep 'mswindows) - (frob-face-property face 'font 'mswindows-find-smaller-font locale)))) + (when (featurep 'x) + (frob-face-property face 'font 'x-find-smaller-font locale)) + (when (featurep 'mswindows) + (frob-face-property face 'font 'mswindows-find-smaller-font locale))) (defun make-face-larger (face &optional locale) "Make the font of the given face be larger, if possible. See `make-face-smaller' for the semantics of the LOCALE argument." (interactive (list (read-face-name "Enlarge which face: "))) ;; handle X specific entries - (cond ((featurep 'x) - (frob-face-property face 'font 'x-find-larger-font locale)) - ((featurep 'mswindows) - (frob-face-property face 'font 'mswindows-find-larger-font locale)))) + (when (featurep 'x) + (frob-face-property face 'font 'x-find-larger-font locale)) + (when (featurep 'mswindows) + (frob-face-property face 'font 'mswindows-find-larger-font locale))) (defun invert-face (face &optional locale) "Swap the foreground and background colors of the face." @@ -1384,7 +1384,9 @@ (loop for face in (face-list) do (init-face-from-resources face 'global)) ;; Further X frobbing. - (x-init-global-faces) + (case window-system + (x (x-init-global-faces)) + (mswindows (mswindows-init-global-faces))) ;; for bold and the like, make the global specification be bold etc. ;; if the user didn't already specify a value. These will also be ;; frobbed further in init-other-random-faces.
--- a/lisp/files.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/files.el Mon Aug 13 10:24:41 2007 +0200 @@ -130,8 +130,11 @@ (defvar backup-enable-predicate '(lambda (name) - (or (< (length name) 5) - (not (string-equal "/tmp/" (substring name 0 5))))) + (not (or (string-equal "/tmp/" (substring name 0 5)) + (let ((tmpdir (temp-directory))) + (and tmpdir + (string-equal (concat tmpdir "/") + (substring name 0 (1+ (length tmpdir))))))))) "Predicate that looks at a file name and decides whether to make backups. Called with an absolute file name as argument, it returns t to enable backup.") @@ -974,7 +977,7 @@ filename)) (error "%s is a directory." filename)) (let* ((buf (get-file-buffer filename)) -; (truename (abbreviate-file-name (file-truename filename))) + (truename (abbreviate-file-name (file-truename filename))) (number (nthcdr 10 (file-attributes (file-truename filename)))) ; (number (and buffer-file-truename ; (nthcdr 10 (file-attributes buffer-file-truename)))) @@ -1064,8 +1067,9 @@ ;; If they fail too, set error. (setq error e))))) ;; Find the file's truename, and maybe use that as visited name. - ;; automatically computed in XEmacs. -; (setq buffer-file-truename truename) + ;; automatically computed in XEmacs, unless jka-compr was used! + (unless buffer-file-truename + (setq buffer-file-truename truename)) (setq buffer-file-number number) ;; On VMS, we may want to remember which directory in a search list ;; the file was found in. @@ -2939,6 +2943,73 @@ You can redefine this for customization." (string-match "\\`#.*#\\'" filename)) +(defun wildcard-to-regexp (wildcard) + "Given a shell file name pattern WILDCARD, return an equivalent regexp. +The generated regexp will match a filename iff the filename +matches that wildcard according to shell rules. Only wildcards known +by `sh' are supported." + (let* ((i (string-match "[[.*+\\^$?]" wildcard)) + ;; Copy the initial run of non-special characters. + (result (substring wildcard 0 i)) + (len (length wildcard))) + ;; If no special characters, we're almost done. + (if i + (while (< i len) + (let ((ch (aref wildcard i)) + j) + (setq + result + (concat result + (cond + ((eq ch ?\[) ; [...] maps to regexp char class + (progn + (setq i (1+ i)) + (concat + (cond + ((eq (aref wildcard i) ?!) ; [!...] -> [^...] + (progn + (setq i (1+ i)) + (if (eq (aref wildcard i) ?\]) + (progn + (setq i (1+ i)) + "[^]") + "[^"))) + ((eq (aref wildcard i) ?^) + ;; Found "[^". Insert a `\0' character + ;; (which cannot happen in a filename) + ;; into the character class, so that `^' + ;; is not the first character after `[', + ;; and thus non-special in a regexp. + (progn + (setq i (1+ i)) + "[\000^")) + ((eq (aref wildcard i) ?\]) + ;; I don't think `]' can appear in a + ;; character class in a wildcard, but + ;; let's be general here. + (progn + (setq i (1+ i)) + "[]")) + (t "[")) + (prog1 ; copy everything upto next `]'. + (substring wildcard + i + (setq j (string-match + "]" wildcard i))) + (setq i (if j (1- j) (1- len))))))) + ((eq ch ?.) "\\.") + ((eq ch ?*) "[^\000]*") + ((eq ch ?+) "\\+") + ((eq ch ?^) "\\^") + ((eq ch ?$) "\\$") + ((eq ch ?\\) "\\\\") ; probably cannot happen... + ((eq ch ??) "[^\000]") + (t (char-to-string ch))))) + (setq i (1+ i))))) + ;; Shell wildcards should match the entire filename, + ;; not its part. Make the regexp say so. + (concat "\\`" result "\\'"))) + (defcustom list-directory-brief-switches (if (eq system-type 'vax-vms) "" "-CF") "*Switches for list-directory to pass to `ls' for brief listing." @@ -3017,8 +3088,13 @@ (if handler (funcall handler 'insert-directory file switches wildcard full-directory-p) - (if (eq system-type 'vax-vms) - (vms-read-directory file switches (current-buffer)) + (cond + ((eq system-type 'vax-vms) + (vms-read-directory file switches (current-buffer))) + ((and (fboundp 'mswindows-insert-directory) + (eq system-type 'windows-nt)) + (mswindows-insert-directory file switches wildcard full-directory-p)) + (t (if wildcard ;; Run ls in the directory of the file pattern we asked for. (let ((default-directory @@ -3070,7 +3146,7 @@ (concat (file-name-as-directory file) ;;#### Unix-specific ".") - file)))))))))) + file))))))))))) (defvar kill-emacs-query-functions nil "Functions to call with no arguments to query about killing XEmacs.
--- a/lisp/font.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/font.el Mon Aug 13 10:24:41 2007 +0200 @@ -47,7 +47,7 @@ (defun try-font-name (fontname &rest args) (case window-system ((x pm) (car-safe (x-list-fonts fontname))) - (mswindows (car-safe (x-list-fonts fontname))) ; XXX FIXME + (mswindows (car-safe (mswindows-list-fonts fontname))) (ns (car-safe (ns-list-fonts fontname))) (otherwise nil))))
--- a/lisp/frame.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/frame.el Mon Aug 13 10:24:41 2007 +0200 @@ -902,6 +902,11 @@ (set-window-buffer w buffer)) fr)) +(defcustom get-frame-for-buffer-default-to-current nil + "*When non-nil, `get-frame-for-buffer' will default to the current frame." + :type 'boolean + :group 'frames) + (defun get-frame-for-buffer-noselect (buffer &optional not-this-window-p on-frame) "Return a frame in which to display BUFFER. @@ -1011,7 +1016,9 @@ (let ((w-list (windows-of-buffer buffer)) f w (first-choice nil) - (second-choice nil) + (second-choice (if get-frame-for-buffer-default-to-current + (selected-frame) + nil)) (last-resort nil)) (while (and w-list (null first-choice)) (setq w (car w-list) @@ -1019,13 +1026,16 @@ (cond ((eq w (selected-window)) nil) ((not (frame-visible-p f)) (if (null last-resort) - (setq last-resort w))) + (setq last-resort f))) ((eq f (selected-frame)) - (setq first-choice w)) + (setq first-choice f)) ((null second-choice) - (setq second-choice w))) + (setq second-choice f))) (setq w-list (cdr w-list))) (or first-choice second-choice last-resort))) + + (get-frame-for-buffer-default-to-current (selected-frame)) + (t ;; ;; This buffer's mode did not express a preference for a frame of a
--- a/lisp/gnuserv.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/gnuserv.el Mon Aug 13 10:24:41 2007 +0200 @@ -205,7 +205,8 @@ :type 'boolean :group 'gnuserv) -(defcustom gnuserv-temp-file-regexp "^/tmp/Re\\|/draft$" +(defcustom gnuserv-temp-file-regexp + (concat "^" (temp-directory) "/Re\\|/draft$") "*Regexp which should match filenames of temporary files deleted and reused by the programs that invoke the Emacs server." :type 'regexp @@ -459,7 +460,7 @@ ;; Add the "Done" button to the menubar, only in this buffer. (if (and (featurep 'menubar) current-menubar) (progn (set-buffer-menubar current-menubar) - (add-menu-button nil ["Done" gnuserv-edit t])) + (add-menu-button nil ["Done" gnuserv-edit])) )) (run-hooks 'gnuserv-visit-hook) (pop list)))
--- a/lisp/info.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/info.el Mon Aug 13 10:24:41 2007 +0200 @@ -2660,12 +2660,12 @@ (list (vector (one-space (cadr in)) in t) "--:shadowEtchedIn")) (list - ["Goto Info Top-level" Info-directory t] - (vector "Next Node" 'Info-next next-p) - (vector "Previous Node" 'Info-prev prev-p) - (vector "Parent Node (Up)" 'Info-up up-p) - ["Goto Node..." Info-goto-node t] - ["Goto Last Visited Node " Info-last t]))) + ["Goto Info Top-level" Info-directory] + (vector "Next Node" 'Info-next :active next-p) + (vector "Previous Node" 'Info-prev :active prev-p) + (vector "Parent Node (Up)" 'Info-up :active up-p) + ["Goto Node..." Info-goto-node] + ["Goto Last Visited Node " Info-last]))) ;; Find the xrefs and make a list (while (re-search-forward xref-regexp nil t) (setq xrefs (cons (one-space (buffer-substring (match-beginning 1) @@ -2690,8 +2690,7 @@ (if (eq xref 'more) "...more..." (vector xref - (list 'Info-follow-reference xref) - t))) + (list 'Info-follow-reference xref)))) xrefs))) (if subnodes (nconc menu (list "--:shadowDoubleEtchedIn" @@ -2700,8 +2699,7 @@ (mapcar #'(lambda (node) (if (eq node 'more) "...more..." - (vector node (list 'Info-menu node) - t))) + (vector node (list 'Info-menu node)))) subnodes))) menu))
--- a/lisp/lisp-mode.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/lisp-mode.el Mon Aug 13 10:24:41 2007 +0200 @@ -49,20 +49,24 @@ (defvar lisp-interaction-mode-popup-menu nil) (defvar lisp-interaction-mode-popup-menu-1 (purecopy '("Lisp-Interaction" - ["Evaluate Last S-expression" eval-last-sexp t] - ["Evaluate Entire Buffer" eval-current-buffer t] - ["Evaluate Region" eval-region (region-exists-p)] + ["Evaluate Last S-expression" eval-last-sexp] + ["Evaluate Entire Buffer" eval-current-buffer] + ["Evaluate Region" eval-region + :active (region-exists-p)] "---" - ["Evaluate This Defun" eval-defun t] + ["Evaluate This Defun" eval-defun] ;; FSF says "Instrument Function for Debugging" - ["Debug This Defun" edebug-defun t] + ["Debug This Defun" edebug-defun] + "---" + ["Trace a Function" trace-function-background] + ["Untrace All Functions" untrace-all + :active (fboundp 'untrace-all)] "---" - ["Trace a Function" trace-function-background t] - ["Untrace All Functions" untrace-all (fboundp 'untrace-all)] - "---" - ["Comment Out Region" comment-region (region-exists-p)] - ["Indent Region" indent-region (region-exists-p)] - ["Indent Line" lisp-indent-line t] + ["Comment Out Region" comment-region + :active (region-exists-p)] + ["Indent Region" indent-region + :active (region-exists-p)] + ["Indent Line" lisp-indent-line] "---" ["Debug On Error" (setq debug-on-error (not debug-on-error)) :style toggle :selected debug-on-error] @@ -77,8 +81,8 @@ (purecopy (nconc '("Emacs-Lisp" - ["Byte-compile This File" emacs-lisp-byte-compile t] - ["Byte-recompile Directory..." byte-recompile-directory t] + ["Byte-compile This File" emacs-lisp-byte-compile] + ["Byte-recompile Directory..." byte-recompile-directory] "---") (cdr lisp-interaction-mode-popup-menu-1))))
--- a/lisp/modeline.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/modeline.el Mon Aug 13 10:24:41 2007 +0200 @@ -256,11 +256,12 @@ (define-key modeline-map 'button3 'modeline-menu) (make-face 'modeline-mousable "Face for mousable portions of the modeline.") -(set-face-parent 'modeline-mousable 'modeline) +(set-face-parent 'modeline-mousable 'modeline nil '(default)) (when (featurep 'x) - (set-face-foreground 'modeline-mousable "firebrick" 'global '(color x)) - (set-face-font 'modeline-mousable [bold] nil '(mono x)) - (set-face-font 'modeline-mousable [bold] nil '(grayscale x))) + (set-face-foreground 'modeline-mousable "firebrick" 'global + '(default color x)) + (set-face-font 'modeline-mousable [bold] nil '(default mono x)) + (set-face-font 'modeline-mousable [bold] nil '(default grayscale x))) (defmacro make-modeline-command-wrapper (command) `#'(lambda (event) @@ -291,11 +292,12 @@ (make-face 'modeline-mousable-minor-mode "Face for mousable minor-mode strings in the modeline.") -(set-face-parent 'modeline-mousable-minor-mode 'modeline-mousable) +(set-face-parent 'modeline-mousable-minor-mode 'modeline-mousable nil + '(default)) (when (featurep 'x) (set-face-foreground 'modeline-mousable-minor-mode - '(((color x) . "green4") - ((color x) . "forestgreen")) 'global)) + '(((default color x) . "green4") + ((default color x) . "forestgreen")) 'global)) (defvar modeline-mousable-minor-mode-extent (make-extent nil nil) ;; alliteration at its finest. @@ -503,14 +505,14 @@ (make-face 'modeline-buffer-id "Face for the buffer ID string in the modeline.") -(set-face-parent 'modeline-buffer-id 'modeline) +(set-face-parent 'modeline-buffer-id 'modeline nil '(default)) (when (featurep 'x) - (set-face-foreground 'modeline-buffer-id "blue4" 'global '(color x))) + (set-face-foreground 'modeline-buffer-id "blue4" 'global '(default color x))) (when (featurep 'x) - (set-face-font 'modeline-buffer-id [bold-italic] nil '(mono x)) - (set-face-font 'modeline-buffer-id [bold-italic] nil '(grayscale x))) + (set-face-font 'modeline-buffer-id [bold-italic] nil '(default mono x)) + (set-face-font 'modeline-buffer-id [bold-italic] nil '(default grayscale x))) (when (featurep 'tty) - (set-face-font 'modeline-buffer-id [bold-italic] nil 'tty)) + (set-face-font 'modeline-buffer-id [bold-italic] nil '(default tty))) (defvar modeline-buffer-id-extent (make-extent nil nil) "Extent covering the whole of the buffer-id string.")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/mwheel.el Mon Aug 13 10:24:41 2007 +0200 @@ -0,0 +1,120 @@ +;;; mwheel.el --- Mouse support for MS intelli-mouse type mice + +;; Copyright (C) 1998, Free Software Foundation, Inc. +;; Maintainer: William M. Perry <wmperry@cs.indiana.edu> +;; Keywords: mouse + +;; This file is part of XEmacs. + +;; XEmacs is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; XEmacs is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with XEmacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Synched up with: Not synched. + +;;; Commentary: + +;; This code will enable the use of the infamous 'wheel' on the new +;; crop of mice. Under XFree86 and the XSuSE X Servers, the wheel +;; events are sent as button4/button5 events. + +;; I for one would prefer some way of converting the button4/button5 +;; events into different event types, like 'mwheel-up' or +;; 'mwheel-down', but I cannot find a way to do this very easily (or +;; portably), so for now I just live with it. + +;; To enable this code, simply put this at the top of your .emacs +;; file: +;; +;; (autoload 'mwheel-install "mwheel" "Enable mouse wheel support.") +;; (mwheel-install) + +;;; Code: + +(require 'custom) +(require 'cl) + +(defcustom mwheel-scroll-amount '(5 . 1) + "Amount to scroll windows by when spinning the mouse wheel. +This is actually a cons cell, where the first item is the amount to scroll +on a normal wheel event, and the second is the amount to scroll when the +wheel is moved with the shift key depressed. + +Each item should be the number of lines to scroll, or `nil' for near +full screen. +A near full screen is `next-screen-context-lines' less than a full screen." + :group 'mouse + :type '(cons + (choice :tag "Normal" + (const :tag "Full screen" :value nil) + (integer :tag "Specific # of lines")) + (choice :tag "Shifted" + (const :tag "Full screen" :value nil) + (integer :tag "Specific # of lines")))) + +(defcustom mwheel-follow-mouse nil + "Whether the mouse wheel should scroll the window that the mouse is over. +This can be slightly disconcerting, but some people may prefer it." + :group 'mouse + :type 'boolean) + +(if (not (fboundp 'event-button)) + (defun mwheel-event-button (event) + (let ((x (symbol-name (event-basic-type event)))) + (if (not (string-match "^mouse-\\([0-9]+\\)" x)) + (error "Not a button event: %S" event)) + (string-to-int (substring x (match-beginning 1) (match-end 1))))) + (fset 'mwheel-event-button 'event-button)) + +(if (not (fboundp 'event-window)) + (defun mwheel-event-window (event) + (posn-window (event-start event))) + (fset 'mwheel-event-window 'event-window)) + +(defun mwheel-scroll (event) + (interactive "e") + (let ((curwin (if mwheel-follow-mouse + (prog1 + (selected-window) + (select-window (mwheel-event-window event))))) + (amt (if (memq 'shift (event-modifiers event)) + (cdr mwheel-scroll-amount) + (car mwheel-scroll-amount)))) + (case (mwheel-event-button event) + (4 (scroll-down amt)) + (5 (scroll-up amt)) + (otherwise (error "Bad binding in mwheel-scroll"))) + (if curwin (select-window curwin)))) + +;;;###autoload +(defun mwheel-install () + "Enable mouse wheel support." + (let ((mwheel-running-xemacs (string-match "XEmacs" (emacs-version))) + (keys (if mwheel-running-xemacs + '(button4 [(shift button4)] button5 [(shift button5)]) + '([mouse-4] [S-mouse-4] [mouse-5] [S-mouse-5])))) + ;; This condition-case is here because Emacs 19 will throw an error + ;; if you try to define a key that it does not know about. I for one + ;; prefer to just unconditionally do a mwheel-install in my .emacs, so + ;; that if the wheeled-mouse is there, it just works, and this way it + ;; doesn't yell at me if I'm on my laptop or another machine, etc. + (condition-case () + (while keys + (define-key global-map (car keys) 'mwheel-scroll) + (setq keys (cdr keys))) + (error nil)))) + +(provide 'mwheel) + +;;; mwheel.el ends here
--- a/lisp/package-get-base.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/package-get-base.el Mon Aug 13 10:24:41 2007 +0200 @@ -58,19 +58,19 @@ )) (gnus (standards-version 1.0 - version "1.07" - author-version "0.30q" - date "1998-02-23" - build-date "1998-02-27" + version "1.09" + author-version "5.6.1" + date "1998-03-07" + build-date "1998-03-08" maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>" distribution stable priority medium category "comm" dump nil description "The Gnus Newsreader and Mailreader." - filename "gnus-1.07-pkg.tar.gz" - md5sum "c71f02248d3676f4e03298a0c5db9a3b" - size 1640176 + filename "gnus-1.09-pkg.tar.gz" + md5sum "8e5dd9a1d861f59a5961ba22d511fcbe" + size 1648527 provides (gnus message) requires (gnus w3 mh-e mailcrypt rmail mail-lib xemacs-base) type regular @@ -324,19 +324,19 @@ )) (Sun (standards-version 1.0 - version "1.04" - author-version "20.5b29" - date "1998-01-24" - build-date "1998-02-27" + version "1.05" + author-version "20.5b30" + date "1998-03-06" + build-date "1998-03-08" maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>" distribution sun priority low category "libs" dump t description "Support for Sparcworks." - filename "Sun-1.04-pkg.tar.gz" - md5sum "1e5d0b8e3dfd7f05a409015dd3a3f0fc" - size 63715 + filename "Sun-1.05-pkg.tar.gz" + md5sum "d6c701e221c32cdbf2874eb68cc4def0" + size 63782 provides (sccs eos-browser eos-common eos-debugger eos-debugger eos-editor eos-init eos-load eos-menubar eos-toolbar sunpro) requires (cc-mode xemacs-base) type regular @@ -457,38 +457,38 @@ )) (xemacs-base (standards-version 1.0 - version "1.14" - author-version "20.5b29" - date "1998-02-24" - build-date "1998-02-27" + version "1.15" + author-version "20.5b30" + date "1998-03-04" + build-date "1998-03-08" maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>" distribution mule priority high category "libs" dump nil description "Fundamental XEmacs support, you almost certainly need this." - filename "xemacs-base-1.14-pkg.tar.gz" - md5sum "e4e4a823e051772b8be30e448cceef63" - size 384138 + filename "xemacs-base-1.15-pkg.tar.gz" + md5sum "0b8aaecdcd8ce5070ad4c66310e0f42d" + size 384120 provides (add-log advice annotations assoc case-table chistory comint-xemacs comint compile debug ebuff-menu echistory edmacro ehelp electric enriched env facemenu helper imenu iso-syntax macros novice outline overlay passwd pp regi ring shell skeleton sort thing time-stamp timezone xbm-button xpm-button) requires () type regular )) (xemacs-devel (standards-version 1.0 - version "1.08" - author-version "20.5b29" - date "1998-02-08" - build-date "1998-02-27" + version "1.09" + author-version "20.5b30" + date "1998-03-03" + build-date "1998-03-08" maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>" distribution stable priority medium category "libs" dump nil description "Emacs Lisp developer support." - filename "xemacs-devel-1.08-pkg.tar.gz" - md5sum "6d02c982ca2e7d269802d9d023aecb6b" - size 72861 + filename "xemacs-devel-1.09-pkg.tar.gz" + md5sum "d81dbc1af8301c2339720936a1e77768" + size 75206 provides (docref eldoc elp find-func ielm regexp-opt trace) requires (xemacs-base) type single @@ -533,38 +533,38 @@ )) (locale (standards-version 1.0 - version "1.03" - author-version "20.5b29" - date "1998-01-24" - build-date "1998-02-27" + version "1.04" + author-version "20.5b30" + date "1998-03-01" + build-date "1998-03-08" maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>" distribution mule priority high category "mule" dump nil description "Localized menubars and localized splash screens." - filename "locale-1.03-pkg.tar.gz" - md5sum "6f8be0c05128d96ac787c4a741379fb6" - size 21363 + filename "locale-1.04-pkg.tar.gz" + md5sum "897687db6df1450d83576511da728db1" + size 35573 provides () requires (mule-base) type regular )) (mule-base (standards-version 1.0 - version "1.09" - author-version "20.5b29" - date "1998-02-25" - build-date "1998-02-27" + version "1.10" + author-version "20.5b30" + date "1998-03-07" + build-date "1998-03-08" maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>" distribution mule priority high category "mule" dump t description "Basic Mule support, required for building with Mule." - filename "mule-base-1.09-pkg.tar.gz" - md5sum "dc13aa6e6f958c2dd6c5d6079a061d0b" - size 487022 + filename "mule-base-1.10-pkg.tar.gz" + md5sum "9eeb07585a000efb9172f2c081eaaad3" + size 487358 provides (canna-leim canna char-table china-util cyril-util isearch-ext japan-util ccl can-n-egg mule-help) requires (xemacs-base) type regular @@ -588,21 +588,21 @@ requires (viper mule-base xemacs-base) type regular )) -(speedbar +(calc (standards-version 1.0 - version "1.01" + version "1.02" author-version "2.02f" - date "1998-02-27" - build-date "1998-02-27" + date "1998-03-03" + build-date "1998-03-08" maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>" distribution stable priority low category "oa" dump nil description "Emacs calculator" - filename "calc-1.01-pkg.tar.gz" - md5sum "efd4978d775c86b49ca7660537c35a65" - size 1158290 + filename "calc-1.02-pkg.tar.gz" + md5sum "9e5f89ecd0f03e1abab4d78ca4dbe79e" + size 1158346 provides (calc) requires () type regular @@ -628,19 +628,19 @@ )) (edit-utils (standards-version 1.0 - version "1.12" - author-version "20.5b29" - date "1998-02-21" - build-date "1998-02-27" + version "1.13" + author-version "20.5b30" + date "1998-03-02" + build-date "1998-03-08" maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>" distribution stable priority high category "oa" dump nil description "Miscellaneous editor extensions, you probably need this." - filename "edit-utils-1.12-pkg.tar.gz" - md5sum "153dff6f67b6e6e09613b6f81017988a" - size 549827 + filename "edit-utils-1.13-pkg.tar.gz" + md5sum "89d088c6ac182fe5941d7ed3d239544f" + size 557868 provides (abbrevlist atomic-extents avoid backup-dir balloon-help big-menubar blink-cursor blink-paren bookmark compare-w completion dabbrev desktop detached-minibuf edit-toolbar fast-lock file-part floating-toolbar flow-ctrl foldout func-menu hippie-exp icomplete id-select info-look iswitchb lazy-lock lazy-shot live-icon man mic-paren paren popper mode-motion+ outl-mouse page-ext blink-paren paren permanent-buffers recent-files redo reportmail rsz-minibuf saveconfsavehist saveplace scroll-in-place tempo toolbar-utils tree-menu uniquify where-was-i-db) requires (xemacs-base) type single @@ -742,19 +742,19 @@ )) (psgml (standards-version 1.0 - version "1.04" + version "1.05" author-version "1.01" date "1998-02-06" - build-date "1998-02-27" + build-date "1998-03-08" maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>" distribution stable priority medium category "oa" dump nil description "Validated HTML/SGML editing." - filename "psgml-1.04-pkg.tar.gz" - md5sum "546cca7db9afd44630151c7f45e0d5e6" - size 402845 + filename "psgml-1.05-pkg.tar.gz" + md5sum "d9d9bcb7434b0bf39724e4f3d4119e22" + size 402844 provides (psgml sgml) requires (edit-utils) type regular @@ -1006,25 +1006,6 @@ requires (cc-mode xemacs-base) type regular )) -(cc-mode - (standards-version 1.0 - version "1.07" - author-version "5.20" - date "1998-02-11" - build-date "1998-02-27" - maintainer "Barry Warsaw <cc-mode-help@python.org>" - distribution stable - priority medium - category "prog" - dump nil - description "C, C++ and Java language support." - filename "cc-mode-1.07-pkg.tar.gz" - md5sum "1077a5b4040a05a0847e5d5ab6e6d3ad" - size 147539 - provides (cc-mode) - requires (xemacs-base) - type regular -)) (debug (standards-version 1.0 version "1.01" @@ -1179,19 +1160,19 @@ )) (vc (standards-version 1.0 - version "1.04" - author-version "20.5b29" - date "1998-01-21" - build-date "1998-02-27" + version "1.05" + author-version "20.5b30" + date "1998-03-08" + build-date "1998-03-08" maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>" distribution stable priority low category "prog" dump t description "Version Control for Free systems." - filename "vc-1.04-pkg.tar.gz" - md5sum "9b5b0b2a4d1242aadab2e6e36b4ceed9" - size 74394 + filename "vc-1.05-pkg.tar.gz" + md5sum "9448703c390f3b4e1c0a4b2a2daf7da9" + size 74464 provides (vc) requires (dired xemacs-base) type regular @@ -1272,40 +1253,40 @@ requires (xemacs-base) type regular )) -(textools +(reftex (standards-version 1.0 - version "1.01" - author-version "3.18.0.2" + version "1.02" + author-version "3.18.0.4" date "1998-02-25" - build-date "1998-02-27" + build-date "1998-03-08" maintainer "Carsten Dominik <dominik@strw.LeidenUniv.nl>" distribution stable priority medium category "wp" dump nil description "Emacs support for LaTeX cross-references, citations.." - filename "reftex-1.01-pkg.tar.gz" - md5sum "60b322908ea0e4dda2d177d7080b1596" - size 140425 + filename "reftex-1.02-pkg.tar.gz" + md5sum "15da65e996854bdc212bbfaff9db8417" + size 140412 provides (reftex) requires (xemacs-base) type regular )) (texinfo (standards-version 1.0 - version "1.05" - author-version "20.5b29" - date "1998-01-24" - build-date "1998-02-27" + version "1.06" + author-version "20.5b30" + date "1998-03-03" + build-date "1998-03-08" maintainer "XEmacs Development Team <xemacs-beta@xemacs.org>" distribution stable priority high category "wp" dump nil description "XEmacs TeXinfo support." - filename "texinfo-1.05-pkg.tar.gz" - md5sum "44295e8366210af70df831c579c71c62" - size 113863 + filename "texinfo-1.06-pkg.tar.gz" + md5sum "60579a4364d996cb65b85e62f9c2bf47" + size 125816 provides (makeinfo tex-mode texinfmt texinfo texnfo-tex texnfo-upd) requires (xemacs-base) type regular
--- a/lisp/package-get.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/package-get.el Mon Aug 13 10:24:41 2007 +0200 @@ -145,7 +145,7 @@ be lexically ordered. It is debatable if it makes sense to have more than one version of a package available.") -(defvar package-get-dir "/tmp" +(defvar package-get-dir (temp-directory) "*Where to store temporary files for staging.") (defvar package-get-remote @@ -161,6 +161,16 @@ "*After copying and installing a package, if this is T, then remove the copy. Otherwise, keep it around.") +(defun package-get-update-all () + "Fetch and install the latest versions of all currently installed packages." + (interactive) + ;; Load a fresh copy + (load "package-get-base.el") + (mapcar (lambda (pkg) + (package-get-all + (car pkg) nil)) + packages-package-list)) + (defun package-get-all (package version &optional fetched-packages) "Fetch PACKAGE with VERSION and all other required packages. Uses `package-get-base' to determine just what is required and what @@ -260,7 +270,7 @@ (message "Retrieved package %s" filename) (sit-for 0) (let ((status (if (eq (package-get-info-prop this-package 'type) 'single) - (package-admin-add-single-file-package + (package-admin-add-single-file-package filename (package-get-staging-dir filename)) (package-admin-add-binary-package (package-get-staging-dir filename))))) @@ -361,11 +371,12 @@ (defun package-get-installedp (package version) "Determine if PACKAGE with VERSION has already been installed. I'm not sure if I want to do this by searching directories or checking -some built in variables. For now, use `locate-library'." - ;; Use pacakges-package-list which contains name and version - (if (not (floatp version)) - (setq version (string-to-number version))) - (member (cons package version) packages-package-list)) +some built in variables. For now, use packages-package-list." + ;; Use packages-package-list which contains name and version + (equal (plist-get + (package-get-info-find-package packages-package-list + package) ':version) + (if (floatp version) version (string-to-number version)))) (defun package-get-package-provider (sym) "Search for a package that provides SYM and return the name and
--- a/lisp/process.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/process.el Mon Aug 13 10:24:41 2007 +0200 @@ -120,12 +120,13 @@ (eq system-type 'windows-nt)) (make-temp-name (concat (file-name-as-directory - (or (getenv "TMP") - (getenv "TEMP") - "")) + (temp-directory)) "em"))) (t - (make-temp-name "/tmp/emacs"))))) + (make-temp-name + (concat (file-name-as-directory + (temp-directory)) + "emacs")))))) (unwind-protect (progn (if (or (eq system-type 'ms-dos)
--- a/lisp/specifier.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/specifier.el Mon Aug 13 10:24:41 2007 +0200 @@ -421,4 +421,12 @@ (define-specifier-tag 'mswindows (lambda (dev) (eq (device-type dev) 'mswindows)))) +;; Add special tag for use by initialization code. Code that +;; sets up default specs should use this tag. Code that needs to +;; override default specs (e.g. the X resource initialization +;; code) can safely clear specs with this tag without worrying +;; about clobbering user settings. + +(define-specifier-tag 'default) + ;;; specifier.el ends here
--- a/lisp/startup.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/startup.el Mon Aug 13 10:24:41 2007 +0200 @@ -651,8 +651,18 @@ (load-user-init-file init-file-user) (setq init-file-had-error nil)) (error - (message "Error in init file: ") - (display-error error nil) + (message "Error in init file: %s" (error-message-string error)) + (display-warning 'initialization + (format "\ +An error has occured while loading %s: + +%s + +To ensure normal operation, you should investigate the cause of the error +in your initialization file and remove it. Use the `-debug-init' option +to XEmacs to view a complete error backtrace." + user-init-file (error-message-string error)) + 'error) (setq init-file-had-error t)))) ;; If we can tell that the init file altered debug-on-error, ;; arrange to preserve the value that it set up.
--- a/lisp/tty-init.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/tty-init.el Mon Aug 13 10:24:41 2007 +0200 @@ -66,6 +66,8 @@ ;; we don't do this at startup here so that the user can ;; override term-file-prefix. (startup.el does it after ;; loading the init file.) + (if (featurep 'mule) + (init-mule-tty-win)) (when init-file-loaded ;; temporarily select the console so that the changes ;; to function-key-map are made for the right console.
--- a/lisp/update-elc.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/update-elc.el Mon Aug 13 10:24:41 2007 +0200 @@ -98,7 +98,8 @@ (while preloaded-file-list (let ((arg (car preloaded-file-list))) ;; (print (prin1-to-string arg)) - (if (null (member arg packages-unbytecompiled-lisp)) + (if (null (member (file-name-nondirectory arg) + packages-unbytecompiled-lisp)) (progn (setq arg (locate-library arg)) (if (null arg)
--- a/lisp/x-faces.el Mon Aug 13 10:23:52 2007 +0200 +++ b/lisp/x-faces.el Mon Aug 13 10:24:41 2007 +0200 @@ -419,6 +419,20 @@ ;; hysterical reasons. (jwz) (let* ((append (if set-anyway nil 'append)) + ;; Some faces are initialized before XEmacs is dumped. + ;; In order for the X resources to be able to override + ;; those settings, such initialization always uses the + ;; `default' tag. We remove all specifier specs + ;; containing the `default' tag in the locale before + ;; adding new specs. + (tag-set '(default)) + ;; The tag order matters here. The spec removal + ;; function uses the list cdrs. We want to remove (x + ;; default) and (default) specs, not (default x) and (x) + ;; specs. + (x-tag-set '(x default)) + (tty-tag-set '(tty default)) + (device-class nil) (face-sym (face-name face)) (name (symbol-name face-sym)) (fn (x-get-resource-and-maybe-bogosity-check @@ -467,6 +481,16 @@ 'boolean locale)) ) + (cond ((framep locale) + (setq device-class (device-class (frame-device locale)))) + ((devicep locale) + (setq device-class (device-class locale)))) + + (if device-class + (setq tag-set (cons device-class tag-set) + x-tag-set (cons device-class x-tag-set) + tty-tag-set (cons device-class tty-tag-set))) + ;; ;; If this is the default face, then any unspecified properties should ;; be defaulted from the global properties. Can't do this for @@ -493,34 +517,73 @@ ;; #### should issue warnings? I think this should be ;; done when the instancing actually happens, but I'm not ;; sure how it should actually be dealt with. - (if fn - (set-face-font face fn locale nil append)) + (when fn + ;; Always use the x-tag-set to remove specs, since we don't + ;; know whether the predumped face was initialized with an + ;; 'x tag or not. + (remove-specifier-specs-matching-tag-set-cdrs (face-font face) + locale + x-tag-set) + (set-face-font face fn locale nil append)) ;; Kludge-o-rooni. Set the foreground and background resources for ;; X devices only -- otherwise things tend to get all messed up ;; if you start up an X frame and then later create a TTY frame. - (if fg - (set-face-foreground face fg locale 'x append)) - (if bg - (set-face-background face bg locale 'x append)) - (if bgp - (set-face-background-pixmap face bgp locale nil append)) - (if ulp - (set-face-underline-p face ulp locale nil append)) - (if stp - (set-face-strikethru-p face stp locale nil append)) - (if hp - (set-face-highlight-p face hp locale nil append)) - (if dp - (set-face-dim-p face dp locale nil append)) - (if bp - (set-face-blinking-p face bp locale nil append)) - (if rp - (set-face-reverse-p face rp locale nil append)) + (when fg + (remove-specifier-specs-matching-tag-set-cdrs (face-foreground face) + locale + x-tag-set) + (set-face-foreground face fg locale 'x append)) + (when bg + (remove-specifier-specs-matching-tag-set-cdrs (face-background face) + locale + x-tag-set) + (set-face-background face bg locale 'x append)) + (when bgp + (remove-specifier-specs-matching-tag-set-cdrs (face-background-pixmap + face) + locale + x-tag-set) + (set-face-background-pixmap face bgp locale nil append)) + (when ulp + (remove-specifier-specs-matching-tag-set-cdrs (face-underline-p face) + locale + tty-tag-set) + (set-face-underline-p face ulp locale nil append)) + (when stp + (remove-specifier-specs-matching-tag-set-cdrs (face-strikethru-p face) + locale + tty-tag-set) + (set-face-strikethru-p face stp locale nil append)) + (when hp + (remove-specifier-specs-matching-tag-set-cdrs (face-highlight-p face) + locale + tty-tag-set) + (set-face-highlight-p face hp locale nil append)) + (when dp + (remove-specifier-specs-matching-tag-set-cdrs (face-dim-p face) + locale + tty-tag-set) + (set-face-dim-p face dp locale nil append)) + (when bp + (remove-specifier-specs-matching-tag-set-cdrs (face-blinking-p face) + locale + tty-tag-set) + (set-face-blinking-p face bp locale nil append)) + (when rp + (remove-specifier-specs-matching-tag-set-cdrs (face-reverse-p face) + locale + tty-tag-set) + (set-face-reverse-p face rp locale nil append)) )) ;; GNU Emacs compatibility. (move to obsolete.el?) (defalias 'make-face-x-resource-internal 'x-init-face-from-resources) +(defun remove-specifier-specs-matching-tag-set-cdrs (specifier locale tag-set) + (while tag-set + (remove-specifier specifier locale tag-set) + (setq tag-set (cdr tag-set)))) + ;;; x-init-global-faces is responsible for ensuring that the ;;; default face has some reasonable fallbacks if nothing else is ;;; specified.
--- a/man/ChangeLog Mon Aug 13 10:23:52 2007 +0200 +++ b/man/ChangeLog Mon Aug 13 10:24:41 2007 +0200 @@ -1,3 +1,7 @@ +1998-03-01 Aki Vehtari <Aki.Vehtari@hut.fi> + + * lispref/menus.texi: Use recommended forms in examples. + 1998-02-22 Karl M. Hegbloom <karlheg@bittersweet.inetarena.com> * cl.texi (Creating Symbols): Tell a little bit about the new
--- a/man/lispref/menus.texi Mon Aug 13 10:23:52 2007 +0200 +++ b/man/lispref/menus.texi Mon Aug 13 10:24:41 2007 +0200 @@ -244,8 +244,8 @@ :filter file-menu-filter ; file-menu-filter is a function that takes ; one argument (a list of menu items) and ; returns a list of menu items - [ "Save As..." write-file t ] - [ "Revert Buffer" revert-buffer (buffer-modified-p) ] + [ "Save As..." write-file] + [ "Revert Buffer" revert-buffer :active (buffer-modified-p) ] [ "Read Only" toggle-read-only :style toggle :selected buffer-read-only ] ) @end example @@ -621,8 +621,8 @@ @example (add-submenu nil '("%_Test" ["One" (insert "1") :accelerator ?1 :active t] - ["%_Two" (insert "2") t] - ["%_3" (insert "3") t])) + ["%_Two" (insert "2")] + ["%_3" (insert "3")])) @end example will add a new menu to the top level menubar. The new menu can be reached @@ -709,8 +709,8 @@ (setq menu-accelerator-enabled 'menu-force) (add-submenu nil '("%_Test" ["One" (insert "1") :accelerator ?1 :active t] - ["%_Two" (insert "2") t] - ["%_3" (insert "3") t])) + ["%_Two" (insert "2")] + ["%_3" (insert "3")])) @end example will add the menu "Test" to the top level menubar. Pressing C-x followed by
--- a/nt/ChangeLog Mon Aug 13 10:23:52 2007 +0200 +++ b/nt/ChangeLog Mon Aug 13 10:24:41 2007 +0200 @@ -1,3 +1,9 @@ +Fri Feb 20 21:22:34 1998 Darryl Okahata <darrylo@sr.hp.com> + + * xemacs.mak: Added entry for src/dired-msw.c. Use of the + dired-in-C enhancements is optional, and is determined by + HAVE_MSW_C_DIRED. See comments in xemacs.mak. + 1998-02-18 Kirill M. Katsnelson <kkm@kis.ru> * xemacs.mak: Fixed lost docstrings
--- a/nt/xemacs.mak Mon Aug 13 10:23:52 2007 +0200 +++ b/nt/xemacs.mak Mon Aug 13 10:24:41 2007 +0200 @@ -9,6 +9,11 @@ DEBUG_XEMACS=1 +# Define HAVE_MSW_C_DIRED to be non-zero if you want Xemacs to use C +# primitives to significantly speed up dired, at the expense of an +# additional ~4KB of code. +HAVE_MSW_C_DIRED=1 + !if $(DEBUG_XEMACS) OPT=-Od -Zi !else @@ -37,6 +42,11 @@ !if $(HAVE_MSW) MSW_DEFINES=-DHAVE_MS_WINDOWS -DHAVE_SCROLLBARS -DHAVE_MENUBARS +!if $(HAVE_MSW_C_DIRED) +MSW_C_DIRED_DEFINES=-DHAVE_MSW_C_DIRED +MSW_C_DIRED_SRC=$(XEMACS)\src\dired-msw.c +MSW_C_DIRED_OBJ=$(OUTDIR)\dired-msw.obj +!endif !endif !if $(HAVE_MULE) @@ -57,7 +67,8 @@ INCLUDES=$(X_INCLUDES) -I$(XEMACS)\nt\inc -I$(XEMACS)\src -I$(XEMACS)\lwlib -I"$(MSVCDIR)\include" -DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) -DWIN32 -D_WIN32 \ +DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MSW_C_DIRED_DEFINES) $(MULE_DEFINES) \ + -DWIN32 -D_WIN32 \ -DWIN32_LEAN_AND_MEAN -DWINDOWSNT -Demacs -DHAVE_CONFIG_H \ -D_DEBUG @@ -294,7 +305,8 @@ $(XEMACS)\src\objects-msw.c \ $(XEMACS)\src\redisplay-msw.c \ $(XEMACS)\src\scrollbar-msw.c \ - $(XEMACS)\src\select-msw.c + $(XEMACS)\src\select-msw.c \ + $(MSW_C_DIRED_SRC) !endif !if $(HAVE_MULE) @@ -395,7 +407,8 @@ $(OUTDIR)\objects-msw.obj \ $(OUTDIR)\redisplay-msw.obj \ $(OUTDIR)\scrollbar-msw.obj \ - $(OUTDIR)\select-msw.obj + $(OUTDIR)\select-msw.obj \ + $(MSW_C_DIRED_OBJ) !endif !if $(HAVE_MULE)
--- a/packages/README Mon Aug 13 10:23:52 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -This is a skeletal packages hierarchy that will (eventually) be installed -if it doesn't already exist. Installing XEmacs packages into this directory -in the build area is a mistake. - -Subdirectories: - -etc/ -This directory is added to the data-directory-list and is used for storing -data files needed by Lisp packages at run-time. This includes things like -image files, sound files, etc. - -info/ -This directory is added to the Info-default-directory-list and is used for -storing info documentation meant to be accessed when the user hits `C-h i'. - -lisp/ -This directory and all its subdirectories are added recursively to the -`load-path' at dump time. All auto-autoloads.el files found are dumped with -XEmacs.
--- a/packages/README.Debian Mon Aug 13 10:23:52 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -The `install-info' supplied with Debian Linux 1.3, and installed as -`/usr/sbin/install-info' is not compatible with the official -`install-info' from the Texinfo distribution. XEmacs package -installation requires GNU `install-info'. - -We hope this issue will be made moot in the next release of Debian -Linux. For now, Debian users need to get the Texinfo distribution -(version 3.11 or above), then build and install GNU `install-info' -where it will not conflict with the Debian version. When installing -XEmacs packages, check the Makefile to make sure it refers to the GNU -version of `install-info'. - ->>>>> sb == "Steve Baur" <steve@xemacs.org> writes: - - >> I still can't find an install-info for Debian Linux that isn't - >> theirs. - - sb> ftp://prep.ai.mit.edu/pub/gnu/texinfo-3.11.tar.gz - - sb> Accept no substitutes. - -Mirrors are OK. :-) \ No newline at end of file
--- a/packages/info/localdir Mon Aug 13 10:23:52 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -XEmacs packages.
--- a/src/ChangeLog Mon Aug 13 10:23:52 2007 +0200 +++ b/src/ChangeLog Mon Aug 13 10:24:41 2007 +0200 @@ -1,5 +1,280 @@ +1998-03-07 Kyle Jones <kyle_jones@wonderworks.com> + + * events.h: Add do_backspace_mapping parameter to + function prototype of character_to_event. + + * events.c: Add fifth parameter to character_to_event to + control the backspace mapping. In character_to_event map most + characters that match tty-erase-char to the backspace keysym, + but only if do_backspace_mapping paramter is non-zero. + + (Fcharacter_to_event): Tell character_to_event() to DO + backspace mapping. + + * event-stream.c: + (maybe_read_quit_event): Tell character_to_event() to DO + backspace mapping. + + (maybe_kbd_translate): Tell character_to_event() to DO backspace + mapping. + + (lookup_command_event): Tell character_to_event() to DO backspace + mapping. + + * event-unixoid.c: + (read_event_from_tty_or_stream_desc): Tell character_to_event() + to DO backspace mapping. + + * keymap.c: + (get_keyelt): Tell character_to_event() to NOT DO backspace + mapping. + + (define_key_parser): Tell character_to_event() to NOT DO backspace + mapping. + + (Fsingle_key_description): Tell character_to_event() to DO + backspace mapping. + +1998-03-04 Kirill M. Katsnelson <kkm@kis.ru> + + * alloc.c (Fpurecopy): Do not mark symbols through + Vpure_uninterned_symbol_table twice: hash (OBJ, nil) instead of + (OBJ, OBJ). + +1998-03-07 SL Baur <steve@altair.xemacs.org> + + * emacs.c (shut_down_emacs): Disable forced auto-save in a crash. + It causes more problems than it solves. + +1998-03-02 Greg Klanderman <greg@alphatech.com> + + * window.c (Fwindow_displayed_pixel_height) New function. + (Fenlarge_window_pixels): New function. + (Fshrink_window_pixels): New function. + (window_displayed_pixel_height): New, helper for + Fwindow_displayed_pixel_height. + (change_window_height): Add `inpixels' argument. + (syms_of_window): 3 new DEFSUBR's. + +Thu Mar 05 12:01:35 1998 Andy Piper <andyp@parallax.co.uk> + + * redisplay-msw.c (mswindows_output_cursor): separate getting + cachel index from retrieving cachel to work around apparent bug in + gcc. + +1998-03-06 Kyle Jones <kyle_jones@wonderworks.com> + + * events.c (character_to_event): The tty_erase_char test + doesn't do anything because it's in the wrong place. + Moved it to where it can take effect. + + * dired.c (Fdirectory_files): Initialize GCPRO'ed variable. + + * events.c (character_to_event): Never map '(control + foo) to QKbackspace. Only map ASCII 8 to QKbackspace; + don't map any other key. + +1998-03-05 Kyle Jones <kyle_jones@wonderworks.com> + + * src/redisplay-output.c (redisplay_move_cursor): Bail if + cursor_in_echo_area is non-zero and we're fiddling + with the cursor in a minibuffer window, since that is a + special case that is handled elsewhere and this function + need not handle it. Return 1 so the caller will assume we + succeeded. + +Wed Mar 04 08:55:12 1998 Andy Piper <andyp@parallax.co.uk> + + * device.c (init_global_resources): compile in based on window + system not just x. + + * console.c (select_console_1): add mswindows console type. + +1998-03-04 Kyle Jones <kyle_jones@wonderworks.com> + + * redisplay-output.c (redisplay_redraw_cursor): Redraw + the cursor in the minibuffer window if cursor_in_echo_area + is non-zero. + +Wed Mar 04 08:55:12 1998 Andy Piper <andyp@parallax.co.uk> + + * emacs.c (main_1): predicate display_use to mswindows only if x + is not already selected. + + * event-msw.c: comment out non-code for HAVE_TOOLBAR case. don't + compile debug_process_finalisation if x is compiled in. + + * event-stream.c (init_event_stream): don't make X and mswindows + mutually exclusive. Select msw event loop if started that way, + X/tty event loop otherwise. + + * frame.h: protect toolbar #defines from assuming ints are in + toolbar_data. This happens if you have two display types compiled + in and one supports toolbars and the other doesn't. + + * s/cygwin32.h: warning elimination. + +1998-03-03 SL Baur <steve@altair.xemacs.org> + + * editfns.c (Ftemp_directory): New function. + From Glynn Clements <glynn@sensei.co.uk> + + * editfns.c (Ftemp_directory): Use build_ext_string. + +1998-03-02 Martin Buchholz <Martin Buchholz <martin@xemacs.org>> + + * symsinit.h: add prototype for syms_of_dlopen + +1998-03-02 Kyle Jones <kyle_jones@wonderworks.com> + + * window.c (save_window_save): save value of + default_toolbar_height slot. + + (Fset_window_configuration): restore value of + default_toolbar_height slot. + +Fri Feb 20 21:22:34 1998 Darryl Okahata <darrylo@sr.hp.com> + + * "Fast" dired-in-C enhancements for Windows 95/NT: + + * ntproc.c: + * device-msw.c: + Moved definition of `Vwin32_downcase_file_names' from ntproc.c + to device-msw.c, and renamed it to + `Vmswindows_downcase_file_names'. It doesn't really belong + here, but I didn't want to create a new file, just for this one + variable. This fixes a bug in `expand-file-name' that caused + all returned filenames to be lowercased (this was supposed to be + conditional upon Vmswindows_downcase_file_names, but wasn't, as + it was never initialized due to obsolescence of ntproc.c). This + variable is also used by the dired-in-C enhancements. + + Also moved and renamed `Vwin32_get_true_file_attributes' to + `Vmswindows_get_true_file_attributes'. This affects stat() in + nt.c, and so it really does need to be initialized. + + However, there's still one more variable in ntproc.c that still + needs to be moved/renamed, `Vwin32_pipe_read_delay', but I + didn't touch this, as this is a subprocess issue. + + * dired-msw.c: New file for dired-in-C enhancements for + Windows 96/NT. + + * emacs.c: Initialization calls for dired-msw.c. + + * nt.c (convert_time): make into public function (dired-in-C + functions use it). + +1998-02-28 Kirill M. Katsnelson <kkm@kis.ru> + + * sysdep.h: Prototypes for the above 2 functions + + * sysdep.c (get_pty_max_bytes): Moved here from process.c + (get_eof_char): Ditto + + * symsinit.h: Prototypes for initialization functions called from + emacs.c: process_type_create_mswindows, process_type_create_unix, + vars_of_process_mswindows, vars_of_process_unix. + + * procimpl.h: New file. Includes prototypes and other stuff shared + by process.c and implementation files (process-unix.c, + process-msw.c in future). + + * process.h (PROCESS_LIVE_P): Changed to test against stream + existence, to avoid dependency on fds. + + * process.c: Only process implementation independent code is now + in this file. Moved the rest into process-unix.c + (Fopen_network_stream_internal): Added 5th parameter, protocol + family. Defaults to 'tcp/ip when unspecified. + + * process-unix.c: New file, implementation of UNIX + processes. UNIX-specific code from the old process.c is here. + + * Lstream.c (Lstream_was_blocked_p): New function. Replaces + filedesc_stream_was_blocked_p. + (filedesc_was_blocked_p): Implementation of the method for + filedesc stream + (filedesc_stream_set_pty_flushing): set pty_flushing flag + (filedesc_stream_fd): New function, returns fd of the stream + + * lstream.h (lstream_implementation): was_blocked_p is a new + optional lstream method. + Added prototypes for functions in lstream.c + + * lisp.h: (USID): Typedef for Unique Stream IDentifier. Reuqired + by the new code in many places. + + * events.h (struct event_stream): Declaration of the two mandatory + event stream methods, required by process support. + + * event-unixoid.c (event_stream_unixoid_create_stream_pair): + Implementation of the method shared by TTY and X + (event_stream_unixoid_delete_stream_pair): Ditto + + * event-tty.c (emacs_tty_next_event): get_process_from_usid() + instead of get_process_from_fd() + (emacs_tty_create_stream_pair): New events tream method + (emacs_tty_delete_stream_pair): New events tream method + + * event-stream.c (event_stream_create_stream_pair): New event + stream method + (event_stream_delete_stream_pair): Ditto + + * event-msw.c (debug_process_finalization): Although if0'ed, + removed obsolete code + + * event-Xt.c (emacs_Xt_create_stream_pair): Implementation if the + new event stream method + (emacs_Xt_delete_stream_pair): Ditto + + * emacs.c (main_1): Added calls to process_type_create*() and + vars_of_process() + + * callproc.c: (many places): removed DOS support + +1998-03-02 SL Baur <steve@altair.xemacs.org> + + * process.c (Fprocess_status): Restore old behavior -- call + Fget_process on a string argument. + +Mon Mar 02 11:37:36 1998 Andy Piper <andyp@parallax.co.uk> + + * file-coding.h: + * file-coding.c: more cleanup by only including iso2022 stuff in a + mule build. (setup_eol_coding_systems) move (T) -> :T etc. + + * event-stream.c: (Fopen_dribble_file) Qescape_quoted only exists in + mule. + + * md5.c: remove warning. + + * unexcw.c: move .idata -> .rdata for cygwin b19. + + * Makefile.in.in: add msw dependencies. + + * sheap.c: up static heap parameters. + + * s/cygwin32.h: add prototypes to eliminate warnings. + +1998-03-02 SL Baur <steve@altair.xemacs.org> + + * Makefile.in.in (blddir): Import blddir. + Add blddir to dump-time load-path. + + * nas.c (play_sound_data): Add braces for clarity. + (play_sound_file): Ditto. + 1998-03-01 SL Baur <steve@altair.xemacs.org> + * alloc.c: Boost static vector size for breathing room. Double + the size if we may be dynamically linking. + + * dlopen.c (Fdl_open): Use RTLD_GLOBAL flag on dlopen if available. + + * device-x.c (x_init_device): Hardcode `Emacs' as the filename + containing localized menubars. + * config.h.in: Add HAVE_UNIX_PROCESSES for 20.6. * alloc.c (init_alloc_once_early): Document movement of mmap
--- a/src/Makefile.in.in Mon Aug 13 10:23:52 2007 +0200 +++ b/src/Makefile.in.in Mon Aug 13 10:24:41 2007 +0200 @@ -40,6 +40,7 @@ ## Here are the things that we expect ../configure to edit. prefix=@prefix@ srcdir=@srcdir@ +blddir=@blddir@ version=@version@ infodir=@infodir@ infopath=@infopath@ @@ -59,6 +60,7 @@ ld_libs_general=@ld_libs_general@ ld_libs_window_system=@ld_libs_window_system@ ld_libs_all=@ld_libs_all@ +ld_dynamic_link_flags=@ld_dynamic_link_flags@ extra_objs=@extra_objs@ LN_S=@LN_S@ @@ -136,7 +138,7 @@ cppflags = $(CPPFLAGS) -Demacs -I. $(c_switch_all) cflags = $(CFLAGS) $(cppflags) -ldflags = $(ld_switch_all) +ldflags = $(ld_switch_all) $(ld_dynamic_link_flags) #ifdef SOLARIS2 %.o : %.c @@ -156,6 +158,10 @@ .c.i: $(CC) -P $(cppflags) $< +## Create RTL files +%.c.rtl : %.c + $(CC) -dr -c $(cflags) $< + ## lastfile must follow all files whose initialized data areas should ## be dumped as pure by dump-emacs. @@ -181,6 +187,8 @@ specifier.o strftime.o symbols.o syntax.o sysdep.o\ undo.o $(x_objs) widget.o window.o +obj_rtl = $(objs:.o=.c.rtl) + #ifdef REL_ALLOC rallocdocsrc = ralloc.c rallocobjs = ralloc.o @@ -271,6 +279,8 @@ ## define otherobjs as list of object files that make-docfile ## should not be told about. otherobjs = $(BTL_objs) lastfile.o $(mallocobjs) $(rallocobjs) $(X11_objs) +otherrtls = $(otherobjs:.o=.c.rtl) +othersrcs = $(otherobjs:.o=.c) LIBES = $(lwlib_libs) $(quantify_libs) $(malloclib) $(ld_libs_all) $(lib_gcc) @@ -279,7 +289,7 @@ mo_file = ${mo_dir}emacs.mo #endif -LOADPATH = EMACSLOADPATH="${lispdir}" +LOADPATH = EMACSLOADPATH="${lispdir}:${blddir}" DUMPENV = $(LOADPATH) release: temacs ${libsrc}DOC $(mo_file) ${other_files} @@ -325,6 +335,13 @@ obj_src = $(objs:.o=.c) +dortl : $(obj_rtl) $(otherrtls) + echo "(defvar source-files '(" > ${srcdir}/../lisp/source-files.el + (for a in $(obj_src) $(othersrcs);do \ + echo -n "\""$$a"\"" >> ${srcdir}/../lisp/source-files.el ;\ + done) + echo "))" >> ${srcdir}/../lisp/source-files.el + #ifdef DYNODUMP dynodump_deps = ../dynodump/dynodump.so ../dynodump/dynodump.so: @@ -464,10 +481,18 @@ $(CC) -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c mv EmacsShell-sub.o TopLevelEmacsShell.o +TopLevelEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h + $(CC) -dr -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL ${srcdir}/EmacsShell-sub.c + mv EmacsShell-sub.c.rtl TopLevelEmacsShell.c.rtl + TransientEmacsShell.o : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h $(CC) -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c mv EmacsShell-sub.o TransientEmacsShell.o +TransientEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o config.h xintrinsicp.h EmacsShellP.h + $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c + mv EmacsShell-sub.c.rtl TransientEmacsShell.c.rtl + ## Position-independent code for shared library creation #if USE_GCC pic_arg = -fpic @@ -938,6 +963,156 @@ offix.o: xintrinsic.h #endif +#ifdef HAVE_MS_WINDOWS +console-msw.o: blocktype.h +console-msw.o: config.h +console-msw.o: conslots.h +console-msw.o: console-msw.h +console-msw.o: console.h +console-msw.o: dynarr.h +device-msw.o: blocktype.h +device-msw.o: buffer.h +device-msw.o: bufslots.h +device-msw.o: config.h +device-msw.o: conslots.h +device-msw.o: console-msw.h +device-msw.o: console-stream.h +device-msw.o: console.h +device-msw.o: device.h +device-msw.o: dynarr.h +device-msw.o: events.h +device-msw.o: faces.h +device-msw.o: frame.h +device-msw.o: frameslots.h +device-msw.o: scrollbar.h +device-msw.o: specifier.h +device-msw.o: sysdep.h +device-msw.o: systime.h +device-msw.o: toolbar.h +event-msw.o: blocktype.h +event-msw.o: config.h +event-msw.o: conslots.h +event-msw.o: console-msw.h +event-msw.o: console.h +event-msw.o: device.h +event-msw.o: dynarr.h +event-msw.o: events-mod.h +event-msw.o: events.h +event-msw.o: frame.h +event-msw.o: frameslots.h +event-msw.o: menubar-msw.h +event-msw.o: process.h +event-msw.o: redisplay.h +event-msw.o: scrollbar-msw.h +event-msw.o: scrollbar.h +event-msw.o: specifier.h +event-msw.o: sysproc.h +event-msw.o: systime.h +event-msw.o: syswait.h +event-msw.o: toolbar.h +frame-msw.o: blocktype.h +frame-msw.o: buffer.h +frame-msw.o: bufslots.h +frame-msw.o: config.h +frame-msw.o: conslots.h +frame-msw.o: console-msw.h +frame-msw.o: console.h +frame-msw.o: device.h +frame-msw.o: dynarr.h +frame-msw.o: events.h +frame-msw.o: faces.h +frame-msw.o: frame.h +frame-msw.o: frameslots.h +frame-msw.o: scrollbar.h +frame-msw.o: specifier.h +frame-msw.o: systime.h +frame-msw.o: toolbar.h +menubar-msw.o: blocktype.h +menubar-msw.o: buffer.h +menubar-msw.o: bufslots.h +menubar-msw.o: commands.h +menubar-msw.o: config.h +menubar-msw.o: conslots.h +menubar-msw.o: console-msw.h +menubar-msw.o: console.h +menubar-msw.o: device.h +menubar-msw.o: dynarr.h +menubar-msw.o: elhash.h +menubar-msw.o: events.h +menubar-msw.o: frame.h +menubar-msw.o: frameslots.h +menubar-msw.o: gui.h +menubar-msw.o: menubar-msw.h +menubar-msw.o: menubar.h +menubar-msw.o: opaque.h +menubar-msw.o: redisplay.h +menubar-msw.o: scrollbar.h +menubar-msw.o: specifier.h +menubar-msw.o: systime.h +menubar-msw.o: toolbar.h +menubar-msw.o: window.h +objects-msw.o: blocktype.h +objects-msw.o: buffer.h +objects-msw.o: bufslots.h +objects-msw.o: config.h +objects-msw.o: conslots.h +objects-msw.o: console-msw.h +objects-msw.o: console.h +objects-msw.o: device.h +objects-msw.o: dynarr.h +objects-msw.o: insdel.h +objects-msw.o: objects-msw.h +objects-msw.o: objects.h +objects-msw.o: specifier.h +redisplay-msw.o: blocktype.h +redisplay-msw.o: buffer.h +redisplay-msw.o: bufslots.h +redisplay-msw.o: config.h +redisplay-msw.o: conslots.h +redisplay-msw.o: console-msw.h +redisplay-msw.o: console.h +redisplay-msw.o: debug.h +redisplay-msw.o: device.h +redisplay-msw.o: dynarr.h +redisplay-msw.o: events.h +redisplay-msw.o: faces.h +redisplay-msw.o: frame.h +redisplay-msw.o: frameslots.h +redisplay-msw.o: glyphs.h +redisplay-msw.o: objects-msw.h +redisplay-msw.o: objects.h +redisplay-msw.o: redisplay.h +redisplay-msw.o: scrollbar.h +redisplay-msw.o: specifier.h +redisplay-msw.o: sysdep.h +redisplay-msw.o: systime.h +redisplay-msw.o: toolbar.h +redisplay-msw.o: window.h +scrollbar-msw.o: blocktype.h +scrollbar-msw.o: config.h +scrollbar-msw.o: conslots.h +scrollbar-msw.o: console-msw.h +scrollbar-msw.o: console.h +scrollbar-msw.o: device.h +scrollbar-msw.o: dynarr.h +scrollbar-msw.o: events.h +scrollbar-msw.o: frame.h +scrollbar-msw.o: frameslots.h +scrollbar-msw.o: redisplay.h +scrollbar-msw.o: scrollbar-msw.h +scrollbar-msw.o: scrollbar.h +scrollbar-msw.o: specifier.h +scrollbar-msw.o: systime.h +scrollbar-msw.o: toolbar.h +scrollbar-msw.o: window.h +select-msw.o: blocktype.h +select-msw.o: config.h +select-msw.o: conslots.h +select-msw.o: console-msw.h +select-msw.o: console.h +select-msw.o: dynarr.h +#endif + EmacsFrame.o: $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.o: EmacsFrame.h EmacsFrame.o: EmacsFrameP.h
--- a/src/alloc.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/alloc.c Mon Aug 13 10:24:41 2007 +0200 @@ -2848,7 +2848,7 @@ */ if (!NILP (XSYMBOL (obj)->obarray)) return obj; - Fputhash (obj, obj, Vpure_uninterned_symbol_table); + Fputhash (obj, Qnil, Vpure_uninterned_symbol_table); return obj; } else @@ -3035,7 +3035,11 @@ /* 415 used Mly 29-Jun-93 */ /* 1327 used slb 28-Feb-98 */ -#define NSTATICS 1500 +#ifdef HAVE_SHLIB +#define NSTATICS 4000 +#else +#define NSTATICS 2000 +#endif /* Not "static" because of linker lossage on some systems */ Lisp_Object *staticvec[NSTATICS] /* Force it into data space! */ @@ -3048,6 +3052,8 @@ staticpro (Lisp_Object *varaddress) { if (staticidx >= countof (staticvec)) + /* #### This is now a dubious abort() since this routine may be called */ + /* by Lisp attempting to load a DLL. */ abort (); staticvec[staticidx++] = varaddress; }
--- a/src/callproc.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/callproc.c Mon Aug 13 10:24:41 2007 +0200 @@ -112,13 +112,6 @@ static Lisp_Object call_process_cleanup (Lisp_Object fdpid) { -#ifdef MSDOS - /* for MSDOS fdpid is really (fd . tempfile) */ - Lisp_Object file = Fcdr (fdpid); - close (XINT (Fcar (fdpid))); - if (strcmp (XSTRING_DATA (file), NULL_DEVICE) != 0) - unlink (XSTRING_DATA (file)); -#else /* not MSDOS */ int fd = XINT (Fcar (fdpid)); int pid = XINT (Fcdr (fdpid)); @@ -142,7 +135,6 @@ } synch_process_alive = 0; close (fd); -#endif /* not MSDOS */ return Qnil; } @@ -199,10 +191,6 @@ /* File to use for stderr in the child. t means use same as standard output. */ Lisp_Object error_file; -#ifdef MSDOS - char *outf, *tempfile; - int outfilefd; -#endif /* MSDOS */ CHECK_STRING (args[0]); @@ -320,36 +308,6 @@ if (filefd < 0) report_file_error ("Opening process input file", Fcons (infile, Qnil)); -#ifdef MSDOS - /* These vars record information from process termination. - Clear them now before process can possibly terminate, - to avoid timing error if process terminates soon. */ - synch_process_death = 0; - synch_process_retcode = 0; - - if ((outf = egetenv ("TMP")) || (outf = egetenv ("TEMP"))) - strcpy (tempfile = alloca (strlen (outf) + 20), outf); - else - { - tempfile = alloca (20); - *tempfile = '\0'; - } - dostounix_filename (tempfile); - if (*tempfile == '\0' || tempfile[strlen (tempfile) - 1] != '/') - strcat (tempfile, "/"); - strcat (tempfile, "detmp.XXX"); - mktemp (tempfile); - - outfilefd = creat (tempfile, S_IREAD | S_IWRITE); - if (outfilefd < 0) - { - close (filefd); - report_file_error ("Opening process output file", - Fcons (tempfile, Qnil)); - } -#endif /* MSDOS */ - -#ifndef MSDOS if (INTP (buffer)) { fd[1] = open (NULL_DEVICE, O_WRONLY | OPEN_BINARY, 0); @@ -363,40 +321,9 @@ set_exclusive_use (fd[0]); #endif } -#else /* MSDOS */ + { - char *outf; - - if (INTP (buffer)) - outf = NULL_DEVICE; - else - { - /* DOS can't create pipe for interprocess communication, - so redirect child process's standard output to temporary file - and later read the file. */ - - if ((outf = egetenv ("TMP")) || (outf = egetenv ("TEMP"))) - { - strcpy (tempfile, outf); - dostounix_filename (tempfile); - } - else - *tempfile = '\0'; - if (strlen (tempfile) == 0 || tempfile[strlen (tempfile) - 1] != '/') - strcat (tempfile, "/"); - strcat (tempfile, "demacs.XXX"); - mktemp (tempfile); - outf = tempfile; - } - - if ((fd[1] = creat (outf, S_IREAD | S_IWRITE)) < 0) - report_file_error ("Can't open temporary file", Qnil); - fd[0] = -1; - } -#endif /* MSDOS */ - - { - /* child_setup must clobber environ in systems with true vfork. + /* child_setup must clobber environ in systems with true vfork. Protect it from permanent change. */ REGISTER char **save_environ = environ; REGISTER int fd1 = fd[1]; @@ -422,21 +349,6 @@ synch_process_death = 0; synch_process_retcode = 0; -#ifdef MSDOS - /* ??? Someone who knows MSDOG needs to check whether this properly - closes all descriptors that it opens. */ - pid = run_msdos_command (new_argv, current_dir, filefd, outfilefd); - close (outfilefd); - fd1 = -1; /* No harm in closing that one! */ - fd[0] = open (tempfile, NILP (Vbinary_process_output) ? O_TEXT : - O_BINARY); - if (fd[0] < 0) - { - unlink (tempfile); - close (filefd); - report_file_error ("Cannot re-open temporary file", Qnil); - } -#else /* not MSDOS */ if (NILP (error_file)) fd_error = open (NULL_DEVICE, O_WRONLY | OPEN_BINARY); else if (STRINGP (error_file)) @@ -490,7 +402,6 @@ if (fd_error >= 0) close (fd_error); -#endif /* not MSDOS */ #endif /* not WINDOWSNT */ environ = save_environ; @@ -535,15 +446,8 @@ /* Enable sending signal if user quits below. */ call_process_exited = 0; -#ifdef MSDOS - /* MSDOS needs different cleanup information. */ - record_unwind_protect (call_process_cleanup, - Fcons (make_int (fd[0]), - build_string (tempfile))); -#else /* not MSDOS */ record_unwind_protect (call_process_cleanup, Fcons (make_int (fd[0]), make_int (pid))); -#endif /* not MSDOS */ /* FSFmacs calls Fset_buffer() here. We don't have to because we can insert into buffers other than the current one. */ @@ -624,10 +528,8 @@ NUNGCPRO; QUIT; -#ifndef MSDOS /* Wait for it to terminate, unless it already has. */ wait_for_termination (pid); -#endif /* Don't kill any children that the subprocess may have left behind when exiting. */ @@ -672,10 +574,6 @@ child_setup (int in, int out, int err, char **new_argv, CONST char *current_dir) { -#ifdef MSDOS - /* The MSDOS port of gcc cannot fork, vfork, ... so we must call system - instead. */ -#else /* not MSDOS */ char **env; char *pwd; #ifdef WINDOWSNT @@ -688,7 +586,7 @@ nice (- emacs_priority); #endif -#if !defined (NO_SUBPROCESSES) +#if !defined (NO_SUBPROCESSES) && !defined (WINDOWSNT) /* Close Emacs's descriptors that this process should not have. */ close_process_descs (); #endif /* not NO_SUBPROCESSES */ @@ -860,7 +758,6 @@ stdout_out ("Cant't exec program %s\n", new_argv[0]); _exit (1); #endif /* not WINDOWSNT */ -#endif /* not MSDOS */ } /* Move the file descriptor FD so that its number is not less than MIN.
--- a/src/console.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/console.c Mon Aug 13 10:24:41 2007 +0200 @@ -255,6 +255,11 @@ Vwindow_system = Qx; else #endif +#ifdef HAVE_MS_WINDOWS + if (CONSOLE_MSWINDOWS_P (XCONSOLE (console))) + Vwindow_system = Qmswindows; + else +#endif Vwindow_system = Qnil; }
--- a/src/device-msw.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/device-msw.c Mon Aug 13 10:24:41 2007 +0200 @@ -45,8 +45,19 @@ HSZ mswindows_dde_topic_system; HSZ mswindows_dde_item_open; + +/* Control conversion of upper case file names to lower case. + nil means no, t means yes. */ +Lisp_Object Vmswindows_downcase_file_names; + +/* Control whether stat() attempts to determine file type and link count + exactly, at the expense of slower operation. Since true hard links + are supported on NTFS volumes, this is only relevant on NT. */ +Lisp_Object Vmswindows_get_true_file_attributes; + Lisp_Object Qinit_pre_mswindows_win, Qinit_post_mswindows_win; + static void mswindows_init_device (struct device *d, Lisp_Object props) { @@ -164,6 +175,19 @@ { defsymbol (&Qinit_pre_mswindows_win, "init-pre-mswindows-win"); defsymbol (&Qinit_post_mswindows_win, "init-post-mswindows-win"); + + DEFVAR_LISP ("mswindows-downcase-file-names", &Vmswindows_downcase_file_names /* +Non-nil means convert all-upper case file names to lower case. +This applies when performing completions and file name expansion.*/ ); + Vmswindows_downcase_file_names = Qnil; + + DEFVAR_LISP ("mswindows-get-true-file-attributes", &Vmswindows_get_true_file_attributes /* + "Non-nil means determine accurate link count in file-attributes. +This option slows down file-attributes noticeably, so is disabled by +default. Note that it is only useful for files on NTFS volumes, +where hard links are supported. +*/ ); + Vmswindows_get_true_file_attributes = Qnil; } void
--- a/src/device-x.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/device-x.c Mon Aug 13 10:24:41 2007 +0200 @@ -325,7 +325,7 @@ #if defined(LWLIB_MENUBARS_MOTIF) || defined(HAVE_XIM) || defined (USE_XFONTSET) { /* Read in locale-specific resources from - data-directory/app-defaults/$LANG/emacs-application-class. + data-directory/app-defaults/$LANG/Emacs. This is in addition to the standard app-defaults files, and does not override resources defined elsewhere */ CONST char *data_dir; @@ -337,14 +337,14 @@ XSTRING_LENGTH (Vx_app_defaults_directory) > 0) { GET_C_STRING_FILENAME_DATA_ALLOCA(Vx_app_defaults_directory, data_dir); - sprintf (path, "%s%s/%s", data_dir, locale, app_class); + sprintf (path, "%s%s/Emacs", data_dir, locale); if (!access (path, R_OK)) XrmCombineFileDatabase (path, &db, False); } else if (STRINGP (Vdata_directory) && XSTRING_LENGTH (Vdata_directory) > 0) { GET_C_STRING_FILENAME_DATA_ALLOCA (Vdata_directory, data_dir); - sprintf (path, "%sapp-defaults/%s/%s", data_dir, locale, app_class); + sprintf (path, "%sapp-defaults/%s/Emacs", data_dir, locale); if (!access (path, R_OK)) XrmCombineFileDatabase (path, &db, False); }
--- a/src/device.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/device.c Mon Aug 13 10:24:41 2007 +0200 @@ -358,7 +358,7 @@ extern Lisp_Object Vdefault_x_device; #endif -#ifdef HAVE_X_WINDOWS +#ifdef HAVE_WINDOW_SYSTEM static void init_global_resources (struct device *d)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dired-msw.c Mon Aug 13 10:24:41 2007 +0200 @@ -0,0 +1,660 @@ +/* fast dired replacement routines for mswindows. + Copyright (C) 1998 Darryl Okahata + Portions Copyright (C) 1992, 1994 by Sebastian Kremer <sk@thp.uni-koeln.de> + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Synched up with: Not in FSF. */ + +/* + * Parts of this code (& comments) were taken from ls-lisp.el + * Author: Sebastian Kremer <sk@thp.uni-koeln.de> + */ + +/* + * insert-directory + * - must insert _exactly_one_line_ describing FILE if WILDCARD and + * FULL-DIRECTORY-P is nil. + * The single line of output must display FILE's name as it was + * given, namely, an absolute path name. + * - must insert exactly one line for each file if WILDCARD or + * FULL-DIRECTORY-P is t, plus one optional "total" line + * before the file lines, plus optional text after the file lines. + * Lines are delimited by "\n", so filenames containing "\n" are not + * allowed. + * File lines should display the basename. + * - must be consistent with + * - functions dired-move-to-filename, (these two define what a file line is) + * dired-move-to-end-of-filename, + * dired-between-files, (shortcut for (not (dired-move-to-filename))) + * dired-insert-headerline + * dired-after-subdir-garbage (defines what a "total" line is) + * - variable dired-subdir-regexp + */ + +/* + * Insert directory listing for FILE, formatted according to SWITCHES. + * Leaves point after the inserted text. + * SWITCHES may be a string of options, or a list of strings. + * Optional third arg WILDCARD means treat FILE as shell wildcard. + * Optional fourth arg FULL-DIRECTORY-P means file is a directory and + * switches do not contain `d', so that a full listing is expected. + * + * This works by running a directory listing program + * whose name is in the variable `insert-directory-program'. + * If WILDCARD, it also runs the shell specified by `shell-file-name'." + */ + +/* + * Set INDENT_LISTING to non-zero if the inserted text should be shifted + * over by two spaces. + */ +#define INDENT_LISTING 0 + +#define ROUND_FILE_SIZES 4096 + + +#include <config.h> +#include "lisp.h" + +#include "buffer.h" +#include "regex.h" + +#include "sysfile.h" +#include "sysdir.h" + +#include <windows.h> + +#if ROUND_FILE_SIZES > 0 +#include <math.h> /* for floor() */ +#endif + + +Lisp_Object Vmswindows_ls_sort_case_insensitive; +Lisp_Object Vmswindows_ls_round_file_size; +Lisp_Object Qmswindows_insert_directory; + +extern Lisp_Object Vmswindows_downcase_file_names; /* in device-msw.c */ + + +enum mswindows_sortby { + MSWINDOWS_SORT_BY_NAME, + MSWINDOWS_SORT_BY_NAME_NOCASE, + MSWINDOWS_SORT_BY_MOD_DATE, + MSWINDOWS_SORT_BY_SIZE +}; + + +static enum mswindows_sortby mswindows_sort_method; +static int mswindows_reverse_sort; + + +#define CMPDWORDS(t1a, t1b, t2a, t2b) \ +(((t1a) == (t2a)) ? (((t1b) == (t2b)) ? 0 : (((t1b) < (t2b)) ? -1 : 1)) \ + : (((t1a) < (t2a)) ? -1 : 1)) + + +static int +mswindows_ls_sort_fcn (const void *elem1, const void *elem2) +{ + WIN32_FIND_DATA *e1, *e2; + int status; + + e1 = *(WIN32_FIND_DATA **)elem1; + e2 = *(WIN32_FIND_DATA **)elem2; + switch (mswindows_sort_method) + { + case MSWINDOWS_SORT_BY_NAME: + status = strcmp(e1->cFileName, e2->cFileName); + break; + case MSWINDOWS_SORT_BY_NAME_NOCASE: + status = _stricmp(e1->cFileName, e2->cFileName); + break; + case MSWINDOWS_SORT_BY_MOD_DATE: + status = CMPDWORDS(e1->ftLastWriteTime.dwHighDateTime, + e1->ftLastWriteTime.dwLowDateTime, + e2->ftLastWriteTime.dwHighDateTime, + e2->ftLastWriteTime.dwLowDateTime); + break; + case MSWINDOWS_SORT_BY_SIZE: + status = CMPDWORDS(e1->nFileSizeHigh, e1->nFileSizeLow, + e2->nFileSizeHigh, e2->nFileSizeLow); + break; + default: + status = 0; + break; + } + if (mswindows_reverse_sort) + { + status = -status; + } + return (status); +} + + +static void +mswindows_sort_files (WIN32_FIND_DATA **files, int nfiles, + enum mswindows_sortby sort_by, int reverse) +{ + mswindows_sort_method = sort_by; + mswindows_reverse_sort = reverse; + qsort(files, nfiles, sizeof(WIN32_FIND_DATA *), mswindows_ls_sort_fcn); +} + + +static WIN32_FIND_DATA * +mswindows_get_files (char *dirfile, int nowild, Lisp_Object pattern, + int hide_dot, int hide_system, int *nfiles) +{ + WIN32_FIND_DATA *files; + int array_size; + struct re_pattern_buffer *bufp = NULL; + int findex, len; + char win32pattern[MAXNAMLEN+3]; + HANDLE fh; + + /* + * Much of the following code and comments were taken from dired.c. + * Yes, this is something of a waste, but we want speed, speed, SPEED. + */ + files = NULL; + array_size = *nfiles = 0; + while (1) + { + if (!NILP(pattern)) + { + /* PATTERN might be a flawed regular expression. Rather than + catching and signalling our own errors, we just call + compile_pattern to do the work for us. */ + bufp = compile_pattern (pattern, 0, 0, 0, ERROR_ME); + } + /* Now *bufp is the compiled form of PATTERN; don't call anything + which might compile a new regexp until we're done with the loop! */ + + /* Initialize file info array */ + array_size = 100; /* initial size */ + files = xmalloc(array_size * sizeof (WIN32_FIND_DATA)); + + /* for Win32, we need to insure that the pathname ends with "\*". */ + strcpy (win32pattern, dirfile); + if (!nowild) + { + len = strlen (win32pattern) - 1; + if (!IS_DIRECTORY_SEP (win32pattern[len])) + strcat (win32pattern, "\\"); + strcat (win32pattern, "*"); + } + + /* + * Here, we use FindFirstFile()/FindNextFile() instead of opendir(), + * stat(), & friends, because stat() is VERY expensive in terms of + * time. Hence, we take the time to write complicated Win32-specific + * code, instead of simple Unix-style stuff. + */ + findex = 0; + fh = INVALID_HANDLE_VALUE; + + while (1) + { + int len; + char *filename; + int result; + + if (fh == INVALID_HANDLE_VALUE) + { + fh = FindFirstFile(win32pattern, &files[findex]); + if (fh == INVALID_HANDLE_VALUE) + { + report_file_error ("Opening directory", + list1(build_string(dirfile))); + } + } + else + { + if (!FindNextFile(fh, &files[findex])) + { + if (GetLastError() == ERROR_NO_MORE_FILES) + { + break; + } + FindClose(fh); + report_file_error ("Reading directory", + list1(build_string(dirfile))); + } + } + + filename = files[findex].cFileName; + if (!NILP(Vmswindows_downcase_file_names)) + { + strlwr(filename); + } + len = strlen(filename); + result = (NILP(pattern) + || (0 <= re_search (bufp, filename, + len, 0, len, 0))); + if (result) + { + if ( ! (filename[0] == '.' && + ((hide_system && (filename[1] == '\0' || + (filename[1] == '.' && + filename[2] == '\0'))) || + hide_dot))) + { + if (++findex >= array_size) + { + array_size = findex * 2; + files = xrealloc(files, + array_size * sizeof(WIN32_FIND_DATA)); + } + } + } + } + if (fh != INVALID_HANDLE_VALUE) + { + FindClose (fh); + } + *nfiles = findex; + break; + } + return (files); +} + + +static void +mswindows_format_file (WIN32_FIND_DATA *file, char *buf, int display_size, + int add_newline) +{ + char *cptr; + int len; + Lisp_Object luser; + double file_size; + + len = strlen(file->cFileName); + file_size = + file->nFileSizeHigh * (double)UINT_MAX + file->nFileSizeLow; + cptr = buf; +#if INDENT_LISTING + *cptr++ = ' '; + *cptr++ = ' '; +#endif + if (display_size) + { + sprintf(cptr, "%6d ", (int)((file_size + 1023.) / 1024.)); + cptr += 7; + } + if (file->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + *cptr++ = 'd'; + } else { + *cptr++ = '-'; + } + cptr[0] = cptr[3] = cptr[6] = 'r'; + if (file->dwFileAttributes & FILE_ATTRIBUTE_READONLY) + { + cptr[1] = cptr[4] = cptr[7] = '-'; + } else { + cptr[1] = cptr[4] = cptr[7] = 'w'; + } + if ((file->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || + len > 4 && + (_stricmp(&file->cFileName[len - 4], ".exe") == 0 + || _stricmp(&file->cFileName[len - 4], ".com") == 0 + || _stricmp(&file->cFileName[len - 4], ".bat") == 0 +#if 0 + || _stricmp(&file->cFileName[len - 4], ".pif") == 0 +#endif + )) + { + cptr[2] = cptr[5] = cptr[8] = 'x'; + } else { + cptr[2] = cptr[5] = cptr[8] = '-'; + } + cptr += 9; + if (file->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + strcpy(cptr, " 2 "); + } else { + strcpy(cptr, " 1 "); + } + cptr += 5; + luser = Fuser_login_name(Qnil); + if (!STRINGP(luser)) + { + sprintf(cptr, "%-9d", 0); + } else { + char *str; + + str = XSTRING_DATA(luser); + sprintf(cptr, "%-8s ", str); + } + while (*cptr) + { + ++cptr; + } + sprintf(cptr, "%-8d ", getgid()); + cptr += 9; + if (file_size > 99999999.0) + { + file_size = (file_size + 1023.0) / 1024.; + if (file_size > 999999.0) + { + sprintf(cptr, "%6.0fMB ", (file_size + 1023.0) / 1024.); + } else { + sprintf(cptr, "%6.0fKB ", file_size); + } + } else { + sprintf(cptr, "%8.0f ", file_size); + } + while (*cptr) + { + ++cptr; + } + { + time_t t, now; + char *ctimebuf; + extern char *sys_ctime(const time_t *t); /* in nt.c */ + + if ( +#if 0 + /* + * This doesn't work. + * This code should be correct ... + */ + FileTimeToLocalFileTime(&file->ftLastWriteTime, &localtime) && + ((t = convert_time(localtime)) != 0) && +#else + /* + * But this code "works" ... + */ + ((t = convert_time(file->ftLastWriteTime)) != 0) && +#endif + ((ctimebuf = sys_ctime(&t)) != NULL)) + { + memcpy(cptr, &ctimebuf[4], 7); + now = time(NULL); + if (now - t > (365. / 2.0) * 86400.) + { + /* more than 6 months */ + cptr[7] = ' '; + memcpy(&cptr[8], &ctimebuf[20], 4); + } else { + /* less than 6 months */ + memcpy(&cptr[7], &ctimebuf[11], 5); + } + cptr += 12; + *cptr++ = ' '; + } + } + if (add_newline) + { + sprintf(cptr, "%s\n", file->cFileName); + } + else + { + strcpy(cptr, file->cFileName); + } +} + + +DEFUN ("mswindows-insert-directory", Fmswindows_insert_directory, 2, 4, 0, /* +Insert directory listing for FILE, formatted according to SWITCHES. +Leaves point after the inserted text. +SWITCHES may be a string of options, or a list of strings. +Optional third arg WILDCARD means treat FILE as shell wildcard. +Optional fourth arg FULL-DIRECTORY-P means file is a directory and +switches do not contain `d', so that a full listing is expected. +*/ + (file, switches, wildcard, full_directory_p)) +{ + Lisp_Object result, handler, wildpat, fns, basename; + char *filename; + char *switchstr; + int len, nfiles, i; + int hide_system, hide_dot, reverse, display_size; + WIN32_FIND_DATA *files, **sorted_files; + enum mswindows_sortby sort_by; + char fmtbuf[MAXNAMLEN+100]; /* larger than necessary */ + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; + + result = Qnil; + wildpat = Qnil; + fns = Qnil; + basename = Qnil; + GCPRO5(result, file, wildpat, fns, basename); + sorted_files = NULL; + switchstr = NULL; + hide_system = 1; + hide_dot = 1; + display_size = 0; + reverse = 0; + if (NILP(Vmswindows_ls_sort_case_insensitive)) + { + sort_by = MSWINDOWS_SORT_BY_NAME; + } else { + sort_by = MSWINDOWS_SORT_BY_NAME_NOCASE; + } + nfiles = 0; + while (1) + { + handler = Ffind_file_name_handler (file, Qmswindows_insert_directory); + if (!NILP(handler)) + { + result = call5(handler, Qmswindows_insert_directory, file, switches, + wildcard, full_directory_p); + break; + } + CHECK_STRING (file); + if (!NILP(switches)) + { + char *cptr; + + CHECK_STRING (switches); + switchstr = XSTRING_DATA(switches); + for (cptr = switchstr; *cptr; ++cptr) + { + switch (*cptr) + { + case 'A': + hide_dot = 0; + break; + case 'a': + hide_system = 0; + hide_dot = 0; + break; + case 'r': + reverse = 1; + break; + case 's': + display_size = 1; + break; + case 'S': + sort_by = MSWINDOWS_SORT_BY_SIZE; + break; + case 't': + sort_by = MSWINDOWS_SORT_BY_MOD_DATE; + break; + } + } + } + + /* + * Sometimes we get ".../foo* /" as FILE (without the space). + * While the shell and `ls' don't mind, we certainly do, + * because it makes us think there is no wildcard, only a + * directory name. + */ + if (!NILP(Fstring_match(build_string("[[?*]"), file, Qnil, Qnil))) + { + wildcard = Qt; + filename = XSTRING_DATA(file); + len = strlen(filename); + if (len > 0 && (filename[len - 1] == '\\' || + filename[len - 1] == '/')) + { + filename[len - 1] = '\0'; + } + file = build_string(filename); + } + if (!NILP(wildcard)) + { + Lisp_Object newfile; + + basename = Ffile_name_nondirectory(file); + fns = intern("wildcard-to-regexp"); + wildpat = call1(fns, basename); + newfile = Ffile_name_directory(file); + if (NILP(newfile)) + { + /* Ffile_name_directory() can GC */ + newfile = Ffile_name_directory(Fexpand_file_name(file, Qnil)); + } + file = newfile; + } + if (!NILP(wildcard) || !NILP(full_directory_p)) + { + CHECK_STRING(file); + if (!NILP(wildpat)) + { + CHECK_STRING(wildpat); + } + + files = mswindows_get_files(XSTRING_DATA(file), FALSE, wildpat, + hide_dot, hide_system, &nfiles); + if (files == NULL || nfiles == 0) + { + break; + } + } + else + { + files = mswindows_get_files(XSTRING_DATA(file), TRUE, wildpat, + hide_dot, hide_system, &nfiles); + } + if ((sorted_files = xmalloc(nfiles * sizeof(WIN32_FIND_DATA *))) + == NULL) + { + break; + } + for (i = 0; i < nfiles; ++i) + { + sorted_files[i] = &files[i]; + } + if (nfiles > 1) + { + mswindows_sort_files(sorted_files, nfiles, sort_by, reverse); + } + if (!NILP(wildcard) || !NILP(full_directory_p)) + { + /* + * By using doubles, we can handle files up to 2^53 bytes in + * size (IEEE doubles have 53 bits of resolution). However, + * as we divide by 1024 (or 2^10), the total size is + * accurate up to 2^(53+10) --> 2^63 bytes. + * + * Hopefully, we won't have to handle these file sizes anytime + * soon. + */ + double total_size, file_size, block_size; + + if ((block_size = XINT(Vmswindows_ls_round_file_size)) <= 0) + { + block_size = 0; + } + total_size = 0; + for (i = 0; i < nfiles; ++i) + { + file_size = + sorted_files[i]->nFileSizeHigh * (double)UINT_MAX + + sorted_files[i]->nFileSizeLow; + if (block_size > 0) + { + /* + * Round file_size up to the next nearest block size. + */ + file_size = + floor((file_size + block_size - 1) / block_size) + * block_size; + } + /* Here, we round to the nearest 1K */ + total_size += floor((file_size + 512.) / 1024.); + } + sprintf(fmtbuf, +#if INDENT_LISTING + /* ANSI C compilers auto-concatenate adjacent strings */ + " " +#endif + "total %.0f\n", total_size); + buffer_insert1(current_buffer, build_string(fmtbuf)); + } + for (i = 0; i < nfiles; ++i) + { + mswindows_format_file(sorted_files[i], fmtbuf, display_size, TRUE); + buffer_insert1(current_buffer, build_string(fmtbuf)); + } + break; + } + if (sorted_files) + { + xfree(sorted_files); + } + UNGCPRO; + return (result); +} + + + +/************************************************************************/ +/* initialization */ +/************************************************************************/ + +void +syms_of_dired_mswindows (void) +{ + defsymbol (&Qmswindows_insert_directory, "mswindows-insert-directory"); + + DEFSUBR (Fmswindows_insert_directory); +} + + +void +vars_of_dired_mswindows (void) +{ + DEFVAR_LISP ("mswindows-ls-sort-case-insensitive", &Vmswindows_ls_sort_case_insensitive, /* +*Non-nil means filenames are sorted in a case-insensitive fashion. +Nil means filenames are sorted in a case-sensitive fashion, just like Unix. +*/ ); + Vmswindows_ls_sort_case_insensitive = Qt; + + DEFVAR_INT ("mswindows-ls-round-file-size", &Vmswindows_ls_round_file_size /* +*If non-zero, file sizes are rounded in terms of this block size when +the file totals are being calculated. This is useful for getting a more +accurate estimate of allocated disk space. Note that this only affects +the total size calculation; the individual displayed file sizes are not +changed. This block size should also be a power of 2 (but this is not +enforced), as filesystem block (cluster) sizes are typically powers-of-2. +*/ ); + /* + * Here, we choose 4096 because it's the cluster size for both FAT32 + * and NTFS (?). This is probably much too small for people using + * plain FAT, but, hopefully, plain FAT will go away someday. + * + * We should allow something like a alist here, to make the size + * dependent on the drive letter, etc.. + */ + Vmswindows_ls_round_file_size = 4096; +}
--- a/src/dired.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/dired.c Mon Aug 13 10:24:41 2007 +0200 @@ -66,7 +66,7 @@ /* This function can GC. GC checked 1997.04.06. */ DIR *d; Bytecount name_as_dir_length; - Lisp_Object list, name, dirfilename = Qnil; + Lisp_Object list = Qnil, name, dirfilename = Qnil; Lisp_Object handler; struct re_pattern_buffer *bufp = NULL; Lisp_Object name_as_dir = Qnil;
--- a/src/dlopen.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/dlopen.c Mon Aug 13 10:24:41 2007 +0200 @@ -89,7 +89,10 @@ /* #### Is this right? */ GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (file, file); - handle = dlopen (file, RTLD_LAZY); +#ifndef RTLD_GLOBAL +#define RTLD_GLOBAL 0 +#endif + handle = dlopen (file, RTLD_LAZY|RTLD_GLOBAL); if (handle == NULL) { signal_error (Qerror,
--- a/src/editfns.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/editfns.c Mon Aug 13 10:24:41 2007 +0200 @@ -609,6 +609,31 @@ } +DEFUN ("temp-directory", Ftemp_directory, 0, 0, 0, /* +Return the pathname to the directory to use for temporary files. +On NT/MSDOS, this is obtained from the TEMP or TMP environment variables, +defaulting to / if they are both undefined. +On Unix it is obtained from TMPDIR, with /tmp as the default +*/ + ()) +{ + char *tmpdir; + +#if defined(WINDOWSNT) || defined(MSDOS) + tmpdir = (char *) getenv ("TEMP"); + if (!tmpdir) + tmpdir = (char *) getenv ("TMP"); + if (!tmpdir) + tmpdir = "/"; /* what should this be on NT/MSDOS ? */ +#else /* WINDOWSNT || MSDOS */ + tmpdir = (char *) getenv ("TMPDIR"); + if (!tmpdir) + tmpdir = "/tmp"; +#endif + + return build_ext_string (tmpdir, FORMAT_FILENAME); +} + DEFUN ("user-login-name", Fuser_login_name, 0, 1, 0, /* Return the name under which the user logged in, as a string. This is based on the effective uid, not the real uid. @@ -2137,6 +2162,7 @@ DEFSUBR (Finsert_before_markers); DEFSUBR (Finsert_char); + DEFSUBR (Ftemp_directory); DEFSUBR (Fuser_login_name); DEFSUBR (Fuser_real_login_name); DEFSUBR (Fuser_uid);
--- a/src/emacs.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/emacs.c Mon Aug 13 10:24:41 2007 +0200 @@ -86,6 +86,14 @@ /* Preserves a pointer to the memory allocated that copies that static data inside glibc's malloc. */ void *malloc_state_ptr; +/*#define SLB_MEMORY_CHECKING 1*/ +/* I have observed free being passed the value 0x01 in gdb from somewhere */ +/* in the locale initialization, except that as soon as the following */ +/* monitoring code was added, the problem went away. I don't trust gdb */ +/* at all with glibc, sigh. -slb */ +#ifdef SLB_MEMORY_CHECKING +void slb_memory_checker(__malloc_ptr_t); +#endif #endif /* Variable whose value is symbol giving operating system type. */ @@ -500,7 +508,9 @@ hook for a gmalloc of a potentially incompatible version. */ __malloc_hook = NULL; __realloc_hook = NULL; +#ifndef SLB_MEMORY_CHECKING __free_hook = NULL; +#endif #endif /* not SYSTEM_MALLOC */ noninteractive = 0; @@ -743,7 +753,7 @@ #endif /* HAVE_X_WINDOWS */ #ifdef HAVE_MS_WINDOWS - if (!noninteractive) + if (strcmp(display_use, "x") != 0) display_use = "mswindows"; #endif /* HAVE_MS_WINDOWS */ } @@ -935,7 +945,10 @@ #ifdef HAVE_MENUBARS syms_of_menubar_mswindows (); #endif +#ifdef HAVE_MSW_C_DIRED + syms_of_dired_mswindows (); #endif +#endif /* HAVE_MS_WINDOWS */ #ifdef MULE syms_of_mule (); @@ -1106,6 +1119,18 @@ #endif lstream_type_create_print (); + /* Initialize processes implementation. + The functions may make exactly the following function/macro calls: + + PROCESS_HAS_METHOD() + */ +#ifdef HAVE_UNIX_PROCESSES + process_type_create_unix (); +#endif +#ifdef HAVE_WIN32_PROCESSES + process_type_create_mswindows (); +#endif + /* Now initialize most variables. These functions may do exactly the following: @@ -1216,9 +1241,17 @@ vars_of_minibuf (); vars_of_objects (); vars_of_print (); + #ifndef NO_SUBPROCESSES vars_of_process (); +#ifdef HAVE_UNIX_PROCESSES + vars_of_process_unix (); #endif +#ifdef HAVE_WIN32_PROCESSES + vars_of_process_mswindows (); +#endif +#endif + vars_of_profile (); #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC) vars_of_ralloc (); @@ -1282,7 +1315,10 @@ #ifdef HAVE_MENUBARS vars_of_menubar_mswindows (); #endif +#ifdef HAVE_MSW_C_DIRED + vars_of_dired_mswindows (); #endif +#endif /* HAVE_MS_WINDOWS */ #ifdef MULE vars_of_mule (); @@ -1859,6 +1895,25 @@ return Qnil; /* not reached; warning suppression */ } +#ifdef SLB_MEMORY_CHECKING +void +slb_memory_checker(__malloc_ptr_t mem) +{ + unsigned int u = (unsigned int)mem; + /* 08f6b0a8 */ + if (u < 0x08000000) { + printf("free(%08x)\n", u); + /* abort(); */ + } else { + __free_hook = 0; + + free(mem); + + __free_hook = slb_memory_checker; + } +} +#endif + /* ARGSUSED */ int main (int argc, char **argv, char **envp) @@ -1894,6 +1949,9 @@ quantify_clear_data (); #endif /* QUANTIFY */ +#ifdef SLB_MEMORY_CHECKING + __free_hook = slb_memory_checker; +#endif suppress_early_backtrace = 0; lim_data = 0; /* force reinitialization of this variable */ @@ -2050,12 +2108,21 @@ quantify_stop_recording_data (); #endif /* QUANTIFY */ +#if 0 /* This is absolutely the most important thing to do, so make sure we do it now, before anything else. We might have crashed and be in a weird inconsistent state, and potentially anything could set off another protection fault and cause us to bail out immediately. */ + /* I'm not removing the code entirely, yet. We have run up against + a spate of problems in diagnosing crashes due to crashes within + crashes. It has very definitely been determined that code called + during auto-saving cannot work if XEmacs crashed inside of GC. + We already auto-save on an itimer so there cannot be too much + unsaved stuff around, and if we get better crash reports we might + be able to get more problems fixed so I'm disabling this. -slb */ Fdo_auto_save (Qt, Qnil); /* do this before anything hazardous */ +#endif fflush (stdout); reset_all_consoles ();
--- a/src/event-Xt.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/event-Xt.c Mon Aug 13 10:24:41 2007 +0200 @@ -1872,6 +1872,24 @@ unselect_filedesc (infd); } +static USID +emacs_Xt_create_stream_pair (void* inhandle, void* outhandle, + Lisp_Object* instream, Lisp_Object* outstream, int flags) +{ + USID u = event_stream_unixoid_create_stream_pair + (inhandle, outhandle, instream, outstream, flags); + if (u != USID_ERROR) + u = USID_DONTHASH; + return u; +} + +static USID +emacs_Xt_delete_stream_pair (Lisp_Object instream, Lisp_Object outstream) +{ + event_stream_unixoid_delete_stream_pair (instream, outstream); + return USID_DONTHASH; +} + /* This is called from GC when a process object is about to be freed. If we've still got pointers to it in this file, we're gonna lose hard. */ @@ -1880,11 +1898,12 @@ { #if 0 /* #### */ int i; - int infd, outfd; - get_process_file_descriptors (p, &infd, &outfd); + Lisp_Object instr, outstr; + + get_process_streams (p, &instr, &outstr); /* if it still has fds, then it hasn't been killed yet. */ - assert (infd < 0); - assert (outfd < 0); + assert (NILP(instr)); + assert (NILP(outstr)); /* Better not still be in the "with input" table; we know it's got no fds. */ for (i = 0; i < MAXDESC; i++) { @@ -2829,6 +2848,8 @@ Xt_event_stream->select_process_cb = emacs_Xt_select_process; Xt_event_stream->unselect_process_cb = emacs_Xt_unselect_process; Xt_event_stream->quit_p_cb = emacs_Xt_quit_p; + Xt_event_stream->create_stream_pair_cb= emacs_Xt_create_stream_pair; + Xt_event_stream->delete_stream_pair_cb= emacs_Xt_delete_stream_pair; DEFVAR_BOOL ("modifier-keys-are-sticky", &modifier_keys_are_sticky /* *Non-nil makes modifier keys sticky.
--- a/src/event-msw.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/event-msw.c Mon Aug 13 10:24:41 2007 +0200 @@ -1142,7 +1142,7 @@ #endif #ifdef HAVE_TOOLBARS - O Toolbar Implementor, this place may have something for you!; + /* O Toolbar Implementor, this place may have something for you!;*/ #endif /* Bite me - a spurious command. No abort(), for safety */ @@ -1583,6 +1583,7 @@ } } +#ifndef HAVE_X_WINDOWS /* This is called from GC when a process object is about to be freed. If we've still got pointers to it in this file, we're gonna lose hard. */ @@ -1590,20 +1591,17 @@ debug_process_finalization (struct Lisp_Process *p) { #if 0 /* #### */ - int i; - int infd, outfd; - get_process_file_descriptors (p, &infd, &outfd); + Lisp_Object instr, outstr; + + get_process_streams (p, &instr, &outstr); /* if it still has fds, then it hasn't been killed yet. */ - assert (infd < 0); - assert (outfd < 0); - /* Better not still be in the "with input" table; we know it's got no fds. */ - for (i = 0; i < MAXDESC; i++) - { - Lisp_Object process = filedesc_fds_with_input [i]; - assert (!PROCESSP (process) || XPROCESS (process) != p); - } + assert (NILP(instr)); + assert (NILP(outstr)); + + /* #### More checks here */ #endif } +#endif /************************************************************************/ /* initialization */
--- a/src/event-stream.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/event-stream.c Mon Aug 13 10:24:41 2007 +0200 @@ -528,7 +528,7 @@ int ch = CONSOLE_QUIT_CHAR (con); sigint_happened = 0; Vquit_flag = Qnil; - character_to_event (ch, event, con, 1); + character_to_event (ch, event, con, 1, 1); event->channel = make_console (con); return 1; } @@ -644,6 +644,22 @@ } } +USID +event_stream_create_stream_pair (void* inhandle, void* outhandle, + Lisp_Object* instream, Lisp_Object* outstream, int flags) +{ + check_event_stream_ok (EVENT_STREAM_PROCESS); + return event_stream->create_stream_pair_cb + (inhandle, outhandle, instream, outstream, flags); +} + +USID +event_stream_delete_stream_pair (Lisp_Object instream, Lisp_Object outstream) +{ + check_event_stream_ok (EVENT_STREAM_PROCESS); + return event_stream->delete_stream_pair_cb (instream, outstream); +} + void event_stream_quit_p (void) { @@ -789,7 +805,7 @@ This way is safer. */ zero_event (&ev2); character_to_event (XCHAR (traduit), &ev2, - XCONSOLE (EVENT_CHANNEL (XEVENT (event))), 1); + XCONSOLE (EVENT_CHANNEL (XEVENT (event))), 1, 1); XEVENT (event)->event.key.keysym = ev2.event.key.keysym; XEVENT (event)->event.key.modifiers = ev2.event.key.modifiers; did_translate = 1; @@ -4170,7 +4186,7 @@ struct console *con = XCONSOLE (Fselected_console ()); int ch = CONSOLE_QUIT_CHAR (con); - character_to_event (ch, e, con, 1); + character_to_event (ch, e, con, 1, 1); e->channel = make_console (con); enqueue_command_event (quit_event); @@ -4816,7 +4832,7 @@ if (fd < 0) error ("Unable to create dribble file"); Vdribble_file = make_filedesc_output_stream (fd, 0, 0, LSTR_CLOSING); -#ifdef FILE_CODING +#ifdef MULE Vdribble_file = make_encoding_output_stream (XLSTREAM (Vdribble_file), Fget_coding_system (Qescape_quoted)); @@ -5310,14 +5326,15 @@ if (initialized) { #ifdef HAVE_UNIXOID_EVENT_LOOP - init_event_unixoid (); + if (strcmp (display_use, "mswindows") != 0) + init_event_unixoid (); #endif - #ifdef HAVE_X_WINDOWS if (!strcmp (display_use, "x")) init_event_Xt_late (); else -#elif defined(HAVE_MS_WINDOWS) +#endif +#ifdef HAVE_MS_WINDOWS if (!strcmp (display_use, "mswindows")) init_event_mswindows_late (); else @@ -5329,8 +5346,6 @@ init_event_Xt_late (); #elif defined (HAVE_TTY) init_event_tty_late (); -#elif defined(HAVE_MS_WINDOWS) - init_event_mswindows_late (); #endif } init_interrupts_late ();
--- a/src/event-tty.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/event-tty.c Mon Aug 13 10:24:41 2007 +0200 @@ -158,7 +158,7 @@ { Lisp_Object process; struct Lisp_Process *p = - get_process_from_input_descriptor (i); + get_process_from_usid (FD_TO_USID(i)); assert (p); XSETPROCESS (process, p); @@ -226,6 +226,20 @@ This could change. */ } +static USID +emacs_tty_create_stream_pair (void* inhandle, void* outhandle, + Lisp_Object* instream, Lisp_Object* outstream, int flags) +{ + return event_stream_unixoid_create_stream_pair + (inhandle, outhandle, instream, outstream, flags); +} + +static USID +emacs_tty_delete_stream_pair (Lisp_Object instream, Lisp_Object outstream) +{ + return event_stream_unixoid_delete_stream_pair (instream, outstream); +} + /************************************************************************/ /* initialization */ @@ -246,6 +260,8 @@ tty_event_stream->select_process_cb = emacs_tty_select_process; tty_event_stream->unselect_process_cb = emacs_tty_unselect_process; tty_event_stream->quit_p_cb = emacs_tty_quit_p; + tty_event_stream->create_stream_pair_cb = emacs_tty_create_stream_pair; + tty_event_stream->delete_stream_pair_cb = emacs_tty_delete_stream_pair; } void
--- a/src/event-unixoid.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/event-unixoid.c Mon Aug 13 10:24:41 2007 +0200 @@ -33,6 +33,7 @@ #include "console-tty.h" #include "device.h" #include "events.h" +#include "lstream.h" #include "process.h" #include "sysdep.h" @@ -100,7 +101,7 @@ } else { - character_to_event (ch, event, con, 1); + character_to_event (ch, event, con, 1, 1); event->channel = console; return 1; } @@ -182,13 +183,19 @@ return infd; } +static int +get_process_infd (struct Lisp_Process *p) +{ + Lisp_Object instr, outstr; + get_process_streams (p, &instr, &outstr); + assert (!NILP (instr)); + return filedesc_stream_fd (XLSTREAM (instr)); +} + int event_stream_unixoid_select_process (struct Lisp_Process *proc) { - int infd, outfd; - - get_process_file_descriptors (proc, &infd, &outfd); - assert (infd >= 0); + int infd = get_process_infd (proc); FD_SET (infd, &input_wait_mask); FD_SET (infd, &non_fake_input_wait_mask); @@ -199,10 +206,7 @@ int event_stream_unixoid_unselect_process (struct Lisp_Process *proc) { - int infd, outfd; - - get_process_file_descriptors (proc, &infd, &outfd); - assert (infd >= 0); + int infd = get_process_infd (proc); FD_CLR (infd, &input_wait_mask); FD_CLR (infd, &non_fake_input_wait_mask); @@ -239,6 +243,95 @@ RETURN_NOT_REACHED(0) /* not reached */ } + +/****************************************************************************/ +/* Unixoid (file descriptors based) process I/O streams routines */ +/****************************************************************************/ + +USID +event_stream_unixoid_create_stream_pair (void* inhandle, void* outhandle, + Lisp_Object* instream, + Lisp_Object* outstream, + int flags) +{ + int infd, outfd; + /* Decode inhandle and outhandle. Their meaning depends on + the process implementation being used. */ +#ifdef HAVE_WIN32_PROCESSES + /* We're passed in Windows handles. Open new fds for them */ + if ((HANDLE)inhandle != INVALID_HANDLE_VALUE) + { + infd = open_osfhandle ((HANDLE)inhandle, 0); + if (infd < 0) + return USID_ERROR; + } + else + infd = -1; + + if ((HANDLE)outhandle != INVALID_HANDLE_VALUE) + { + outfd = open_osfhandle ((HANDLE)outhandle, 0); + if (outfd < 0) + { + if (infd >= 0) + close (infd); + return USID_ERROR; + } + } + else + outfd = -1; + + flags = 0; +#endif + +#ifdef HAVE_UNIX_PROCESSES + /* We are passed plain old file descs */ + infd = (int)inhandle; + outfd = (int)outhandle; +#endif + + *instream = (infd >= 0 + ? make_filedesc_input_stream (infd, 0, -1, 0) + : Qnil); + + *outstream = (outfd >= 0 + ? make_filedesc_output_stream (outfd, 0, -1, LSTR_BLOCKED_OK) + : Qnil); + +#if defined(HAVE_UNIX_PROCESSES) && defined(HAVE_PTYS) + /* FLAGS is process->pty_flag for UNIX_PROCESSES */ + if (flags && outfd >= 0) + { + Bufbyte eof_char = get_eof_char (outfd); + int pty_max_bytes = get_pty_max_bytes (outfd); + filedesc_stream_set_pty_flushing (XLSTREAM(*outstream), pty_max_bytes, eof_char); + } +#endif + + return FD_TO_USID (infd); +} + +USID +event_stream_unixoid_delete_stream_pair (Lisp_Object instream, + Lisp_Object outstream) +{ + int in = (NILP(instream) ? -1 + : filedesc_stream_fd (XLSTREAM (instream))); + int out = (NILP(outstream) ? -1 + : filedesc_stream_fd (XLSTREAM (outstream))); + + if (in >= 0) + close (in); + if (out != in && out >= 0) + close (out); + + if (!NILP (instream)) + Lstream_close (XLSTREAM (instream)); + if (!NILP (outstream)) + Lstream_close (XLSTREAM (outstream)); + + return FD_TO_USID (in); +} void
--- a/src/events.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/events.c Mon Aug 13 10:24:41 2007 +0200 @@ -963,7 +963,7 @@ void character_to_event (Emchar c, struct Lisp_Event *event, struct console *con, - int use_console_meta_flag) + int use_console_meta_flag, int do_backspace_mapping) { Lisp_Object k = Qnil; unsigned int m = 0; @@ -1000,23 +1000,25 @@ case 'J': k = QKlinefeed; m &= ~MOD_CONTROL; break; case 'M': k = QKreturn; m &= ~MOD_CONTROL; break; case '[': k = QKescape; m &= ~MOD_CONTROL; break; -#ifdef HAVE_TTY default: - if (CHARP (con->tty_erase_char) && - c - '@' == XCHAR (con->tty_erase_char)) { - k = QKbackspace; - m &= ~MOD_CONTROL; - } +#if defined(HAVE_TTY) && !defined(__CYGWIN32__) + if (do_backspace_mapping && + CHARP (con->tty_erase_char) && + c - '@' == XCHAR (con->tty_erase_char)) + { + k = QKbackspace; + m &= ~MOD_CONTROL; + } +#endif /* defined(HAVE_TTY) && !defined(__CYGWIN32__) */ break; -#endif } if (c >= 'A' && c <= 'Z') c -= 'A'-'a'; } -#ifdef HAVE_TTY - else if (CHARP (con->tty_erase_char) && - c == XCHAR(con->tty_erase_char)) +#if defined(HAVE_TTY) && !defined(__CYGWIN32__) + else if (do_backspace_mapping && + CHARP (con->tty_erase_char) && c == XCHAR (con->tty_erase_char)) k = QKbackspace; -#endif +#endif /* defined(HAVE_TTY) && !defined(__CYGWIN32__) */ else if (c == 127) k = QKdelete; else if (c == ' ') @@ -1172,7 +1174,7 @@ { CHECK_CHAR_COERCE_INT (ch); character_to_event (XCHAR (ch), XEVENT (event), con, - !NILP (use_console_meta_flag)); + !NILP (use_console_meta_flag), 1); } return event; }
--- a/src/events.h Mon Aug 13 10:23:52 2007 +0200 +++ b/src/events.h Mon Aug 13 10:24:41 2007 +0200 @@ -114,6 +114,10 @@ unselect_device_cb (those that use select() and file descriptors and have a separate input fd per device). + create_stream_pair_cb These callbacks are called by process code to + delete_stream_pair_cb create and delete a pait of input and output lstreams + which are used for subprocess I/O. + quitp_cb A handler function called from the `QUIT' macro which should check whether the quit character has been typed. On systems with SIGIO, this will not be called @@ -268,6 +272,57 @@ */ +/* + Stream pairs description + ------------------------ + + Since there are many possible processes/event loop combinations, the event code + is responsible for creating an appropriare lstream type. The process + implementation does not care about that implementation. + + The Create stream pair function is passed two void* values, which identify + process-dependant 'handles'. The process implementation uses these handles + to communicate with child processes. The function must be prepared to receive + handle types of any process implementation. Since there only one process + implementation exists in a particular XEmacs configuration, preprocessing + is a mean of compiling in the support for the code which deals with particular + handle types. + + For example, a unixoid type loop, which relies on file descriptors, may be + asked to create a pair of streams by a unix-style process implementation. + In this case, the handles passed are unix file descriptors, and the code + may deal with these directly. Although, the same code may be used on Win32 + system with X-Windows. In this case, Win32 process implementation passes + handles of type HANDLE, and the create_stream_pair function must call + appropriate function to get file descriptors given HANDLEs, so that these + descriptors may be passed to XtAddInput. + + The handle given may have special denying value, in which case the + corresponding lstream should not be created. + + The return value of the function is a unique stream identifier. It is used + by processes implementation, in its platform-independant part. There is + the get_process_from_usid function, which returns process object given its + USID. The event stream is responsible for converting its internal handle + type into USID. + + Example is the TTY event stream. When a file descriptor signals input, the + event loop must determine process to which the input is destined. Thus, + the imlementation uses process input stream file descriptor as USID, by + simply casting the fd value to USID type. + + There are two special USID values. One, USID_ERROR, indicates that the stream + pair cannot be created. The second, USID_DONTHASH, indicates that streams are + created, but the event stream does not wish to be able to find the process + by its USID. Specifically, if an event stream implementation never calss + get_process_from_usid, this value should always be returned, to prevent + accumulating useless information on USID to process relationship. +*/ + +/* typedef unsigned int USID; in lisp.h */ +#define USID_ERROR ((USID)-1) +#define USID_DONTHASH ((USID)0) + struct Lisp_Event; struct Lisp_Process; @@ -284,9 +339,14 @@ void (*select_process_cb) (struct Lisp_Process *); void (*unselect_process_cb) (struct Lisp_Process *); void (*quit_p_cb) (void); + USID (*create_stream_pair_cb) (void* /* inhandle*/, void* /*outhandle*/ , + Lisp_Object* /* instream */, + Lisp_Object* /* outstream */, + int /* pty_flag */); + USID (*delete_stream_pair_cb) (Lisp_Object /* instream */, + Lisp_Object /* outstream */); }; - extern struct event_stream *event_stream; typedef enum emacs_event_type @@ -461,7 +521,8 @@ void format_event_object (char *buf, struct Lisp_Event *e, int brief); void character_to_event (Emchar c, struct Lisp_Event *event, struct console *con, - int use_console_meta_flag); + int use_console_meta_flag, + int do_backspace_mapping); void enqueue_magic_eval_event (void (*fun) (Lisp_Object), Lisp_Object object); void zero_event (struct Lisp_Event *e); @@ -492,6 +553,9 @@ void event_stream_unselect_console (struct console *c); void event_stream_select_process (struct Lisp_Process *proc); void event_stream_unselect_process (struct Lisp_Process *proc); +USID event_stream_create_stream_pair (void* inhandle, void* outhandle, + Lisp_Object* instream, Lisp_Object* outstream, int flags); +USID event_stream_delete_stream_pair (Lisp_Object instream, Lisp_Object outstream); void event_stream_quit_p (void); struct low_level_timeout @@ -546,6 +610,16 @@ int event_stream_unixoid_unselect_process (struct Lisp_Process *proc); int read_event_from_tty_or_stream_desc (struct Lisp_Event *event, struct console *c, int fd); +USID event_stream_unixoid_create_stream_pair (void* inhandle, void* outhandle, + Lisp_Object* instream, + Lisp_Object* outstream, + int flags); +USID event_stream_unixoid_delete_stream_pair (Lisp_Object instream, + Lisp_Object outstream); + +/* Beware: this evil macro evaluates its arg many times */ +#define FD_TO_USID(fd) ((fd)==0 ? (USID)999999 : ((fd)<0 ? USID_DONTHASH : (USID)(fd))) + #endif /* HAVE_UNIXOID_EVENT_LOOP */ extern int emacs_is_blocking;
--- a/src/file-coding.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/file-coding.c Mon Aug 13 10:24:41 2007 +0200 @@ -70,11 +70,10 @@ Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output; Lisp_Object Qno_iso6429; Lisp_Object Qinput_charset_conversion, Qoutput_charset_conversion; -Lisp_Object Qctext; -#endif +Lisp_Object Qctext, Qescape_quoted; Lisp_Object Qshort, Qno_ascii_eol, Qno_ascii_cntl, Qseven, Qlock_shift; - -Lisp_Object Qencode, Qdecode, Qescape_quoted; +#endif +Lisp_Object Qencode, Qdecode; Lisp_Object Vcoding_system_hashtable; @@ -394,8 +393,8 @@ } while (0) DEFINE_SUB_CODESYS("unix", "", EOL_LF); - DEFINE_SUB_CODESYS("dos", "(T)", EOL_CRLF); - DEFINE_SUB_CODESYS("mac", "(t)", EOL_CR); + DEFINE_SUB_CODESYS("dos", ":T", EOL_CRLF); + DEFINE_SUB_CODESYS("mac", ":t", EOL_CR); } DEFUN ("coding-system-p", Fcoding_system_p, 1, 1, 0, /* @@ -4496,11 +4495,18 @@ Qnil : Fget_coding_system (Vfile_name_coding_system)) /* #### not correct for all values of `fmt'! */ +#ifdef MULE #define FMT_CODING_SYSTEM(fmt) \ (((fmt) == FORMAT_FILENAME) ? FILE_NAME_CODING_SYSTEM : \ ((fmt) == FORMAT_CTEXT ) ? Fget_coding_system (Qctext) : \ ((fmt) == FORMAT_TERMINAL) ? FILE_NAME_CODING_SYSTEM : \ Qnil) +#else +#define FMT_CODING_SYSTEM(fmt) \ + (((fmt) == FORMAT_FILENAME) ? FILE_NAME_CODING_SYSTEM : \ + ((fmt) == FORMAT_TERMINAL) ? FILE_NAME_CODING_SYSTEM : \ + Qnil) +#endif extern CONST Extbyte * convert_to_external_format (CONST Bufbyte *ptr, @@ -4508,11 +4514,7 @@ Extcount *len_out, enum external_data_format fmt) { -#ifdef MULE Lisp_Object coding_system = FMT_CODING_SYSTEM (fmt); -#else - Lisp_Object coding_system = Qnil; -#endif if (!conversion_out_dynarr) conversion_out_dynarr = Dynarr_new (Extbyte); @@ -4580,11 +4582,7 @@ Bytecount *len_out, enum external_data_format fmt) { -#ifdef MULE Lisp_Object coding_system = FMT_CODING_SYSTEM (fmt); -#else - Lisp_Object coding_system = Qnil; -#endif if (!conversion_in_dynarr) conversion_in_dynarr = Dynarr_new (Bufbyte); @@ -4709,14 +4707,13 @@ defsymbol (&Qno_iso6429, "no-iso6429"); defsymbol (&Qinput_charset_conversion, "input-charset-conversion"); defsymbol (&Qoutput_charset_conversion, "output-charset-conversion"); -#endif defsymbol (&Qshort, "short"); defsymbol (&Qno_ascii_eol, "no-ascii-eol"); defsymbol (&Qno_ascii_cntl, "no-ascii-cntl"); defsymbol (&Qseven, "seven"); defsymbol (&Qlock_shift, "lock-shift"); defsymbol (&Qescape_quoted, "escape-quoted"); - +#endif defsymbol (&Qencode, "encode"); defsymbol (&Qdecode, "decode");
--- a/src/file-coding.h Mon Aug 13 10:23:52 2007 +0200 +++ b/src/file-coding.h Mon Aug 13 10:24:41 2007 +0200 @@ -62,6 +62,7 @@ EOL_CR }; +#ifdef MULE typedef struct charset_conversion_spec charset_conversion_spec; struct charset_conversion_spec { @@ -73,6 +74,7 @@ { Dynarr_declare (charset_conversion_spec); } charset_conversion_spec_dynarr; +#endif struct Lisp_Coding_System { @@ -97,7 +99,7 @@ marking, rather than autodetecting it. These will only be non-nil if (eol_type == EOL_AUTODETECT). */ Lisp_Object eol_lf, eol_crlf, eol_cr; - +#ifdef MULE struct { /* What are the charsets to be initially designated to G0, G1, @@ -121,13 +123,13 @@ unsigned int no_iso6429 :1; unsigned int escape_quoted :1; } iso2022; - struct { /* For a CCL coding system, these specify the CCL programs used for decoding (input) and encoding (output). */ Lisp_Object decode, encode; } ccl; +#endif }; DECLARE_LRECORD (coding_system, struct Lisp_Coding_System); @@ -150,6 +152,8 @@ #define CODING_SYSTEM_EOL_LF(codesys) ((codesys)->eol_lf) #define CODING_SYSTEM_EOL_CRLF(codesys) ((codesys)->eol_crlf) #define CODING_SYSTEM_EOL_CR(codesys) ((codesys)->eol_cr) + +#ifdef MULE #define CODING_SYSTEM_ISO2022_INITIAL_CHARSET(codesys, g) \ ((codesys)->iso2022.initial_charset[g]) #define CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT(codesys, g) \ @@ -168,6 +172,7 @@ ((codesys)->iso2022.escape_quoted) #define CODING_SYSTEM_CCL_DECODE(codesys) ((codesys)->ccl.decode) #define CODING_SYSTEM_CCL_ENCODE(codesys) ((codesys)->ccl.encode) +#endif /* MULE */ #define XCODING_SYSTEM_NAME(codesys) \ CODING_SYSTEM_NAME (XCODING_SYSTEM (codesys)) @@ -189,6 +194,8 @@ CODING_SYSTEM_EOL_CRLF (XCODING_SYSTEM (codesys)) #define XCODING_SYSTEM_EOL_CR(codesys) \ CODING_SYSTEM_EOL_CR (XCODING_SYSTEM (codesys)) + +#ifdef MULE #define XCODING_SYSTEM_ISO2022_INITIAL_CHARSET(codesys, g) \ CODING_SYSTEM_ISO2022_INITIAL_CHARSET (XCODING_SYSTEM (codesys), g) #define XCODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT(codesys, g) \ @@ -211,6 +218,7 @@ CODING_SYSTEM_CCL_DECODE (XCODING_SYSTEM (codesys)) #define XCODING_SYSTEM_CCL_ENCODE(codesys) \ CODING_SYSTEM_CCL_ENCODE (XCODING_SYSTEM (codesys)) +#endif /* MULE */ extern Lisp_Object Qbuffer_file_coding_system, Qcoding_system_error; @@ -235,7 +243,7 @@ /* Used by Big 5 on output. */ - +#ifdef MULE #define CODING_STATE_BIG5_1 (1 << 2) /* If set, we just encountered LEADING_BYTE_BIG5_1. */ #define CODING_STATE_BIG5_2 (1 << 3) /* If set, we just encountered @@ -353,6 +361,7 @@ #define ISO_CODE_SS2 0x8E /* single-shift-2 */ #define ISO_CODE_SS3 0x8F /* single-shift-3 */ #define ISO_CODE_CSI 0x9B /* control-sequence-introduce */ +#endif /* MULE */ /* Macros to access an encoding stream or decoding stream */ @@ -393,6 +402,7 @@ #define CODING_CATEGORY_LAST CODING_CATEGORY_NO_CONVERSION +#ifdef MULE #define CODING_CATEGORY_SHIFT_JIS_MASK \ (1 << CODING_CATEGORY_SHIFT_JIS) #define CODING_CATEGORY_ISO_7_MASK \ @@ -407,11 +417,13 @@ (1 << CODING_CATEGORY_ISO_LOCK_SHIFT) #define CODING_CATEGORY_BIG5_MASK \ (1 << CODING_CATEGORY_BIG5) +#endif #define CODING_CATEGORY_NO_CONVERSION_MASK \ (1 << CODING_CATEGORY_NO_CONVERSION) #define CODING_CATEGORY_NOT_FINISHED_MASK \ (1 << 30) +#ifdef MULE /* Convert shift-JIS code (sj1, sj2) into internal string representation (c1, c2). (The leading byte is assumed.) */ @@ -440,6 +452,7 @@ sj1 = (I1 >> 1) + ((I1 < 0xdf) ? 0x30 : 0x70), \ sj2 = I2 - 2; \ } while (0) +#endif /* MULE */ extern Lisp_Object make_decoding_input_stream (Lstream *stream, Lisp_Object codesys);
--- a/src/fileio.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/fileio.c Mon Aug 13 10:24:41 2007 +0200 @@ -373,6 +373,7 @@ (filename, operation)) { /* This function does not GC */ + /* This function can be called during GC */ /* This function must not munge the match data. */ Lisp_Object chain, inhibited_handlers;
--- a/src/frame.h Mon Aug 13 10:23:52 2007 +0200 +++ b/src/frame.h Mon Aug 13 10:24:41 2007 +0200 @@ -403,11 +403,13 @@ #ifdef HAVE_TOOLBARS #define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) \ - (!NILP ((f)->toolbar_visible_p[pos])) + (!NILP((f)->toolbar_data[pos]) && !NILP ((f)->toolbar_visible_p[pos])) #define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) \ - (XINT ((f)->toolbar_size[pos])) + (!NILP ((f)->toolbar_data[pos]) ? \ + (XINT ((f)->toolbar_size[pos])) : 0) #define FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos) \ - (XINT ((f)->toolbar_border_width[pos])) + (!NILP ((f)->toolbar_data[pos]) ? \ + (XINT ((f)->toolbar_border_width[pos])) : 0) #else #define FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE(f, pos) 0 #define FRAME_RAW_THEORETICAL_TOOLBAR_SIZE(f, pos) 0 @@ -481,18 +483,18 @@ to look into this. --ben */ #define FRAME_REAL_TOOLBAR_VISIBLE(f, pos) \ - (FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) > 0 \ - && !NILP (FRAME_REAL_TOOLBAR (f, pos)) \ + ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ + && FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) > 0) \ ? FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \ : 0) #define FRAME_REAL_TOOLBAR_SIZE(f, pos) \ - (FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \ - && !NILP (FRAME_REAL_TOOLBAR (f, pos)) \ + ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ + && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \ ? FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) \ : 0) #define FRAME_REAL_TOOLBAR_BORDER_WIDTH(f, pos) \ - (FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos) \ - && !NILP (FRAME_REAL_TOOLBAR (f, pos)) \ + ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ + && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \ ? FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH (f, pos) \ : 0)
--- a/src/keymap.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/keymap.c Mon Aug 13 10:24:41 2007 +0200 @@ -1054,7 +1054,7 @@ struct Lisp_Event event; event.event_type = empty_event; character_to_event (XCHAR (idx), &event, - XCONSOLE (Vselected_console), 0); + XCONSOLE (Vselected_console), 0, 0); indirection = event.event.key; } else if (CONSP (idx)) @@ -1392,7 +1392,7 @@ struct Lisp_Event event; event.event_type = empty_event; character_to_event (XCHAR_OR_CHAR_INT (spec), &event, - XCONSOLE (Vselected_console), 0); + XCONSOLE (Vselected_console), 0, 0); returned_value->keysym = event.event.key.keysym; returned_value->modifiers = event.event.key.modifiers; } @@ -3244,7 +3244,7 @@ event.event_type = empty_event; CHECK_CHAR_COERCE_INT (key); character_to_event (XCHAR (key), &event, - XCONSOLE (Vselected_console), 0); + XCONSOLE (Vselected_console), 0, 1); format_event_object (buf, &event, 1); } else
--- a/src/lisp.h Mon Aug 13 10:23:52 2007 +0200 +++ b/src/lisp.h Mon Aug 13 10:24:41 2007 +0200 @@ -449,6 +449,10 @@ typedef unsigned int glyph_index; +/* This is shared by process.h, events.h and others in future. + See events.h for description */ +typedef unsigned int USID; + typedef struct { Dynarr_declare (struct glyph_cachel);
--- a/src/lstream.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/lstream.c Mon Aug 13 10:24:41 2007 +0200 @@ -529,6 +529,15 @@ return i == 0 ? -1 : 0; } +int +Lstream_was_blocked_p (Lstream *lstr) +{ + if (lstr->imp->was_blocked_p) + return (lstr->imp->was_blocked_p) (lstr); + else + return 0; +} + static int Lstream_raw_read (Lstream *lstr, unsigned char *buffer, int size) { @@ -1170,6 +1179,13 @@ return 0; } +static int +filedesc_was_blocked_p (Lstream *stream) +{ + struct filedesc_stream *str = FILEDESC_STREAM_DATA (stream); + return str->blocking_error_p; +} + void filedesc_stream_set_pty_flushing (Lstream *stream, int pty_max_bytes, Bufbyte eof_char) @@ -1177,13 +1193,14 @@ struct filedesc_stream *str = FILEDESC_STREAM_DATA (stream); str->pty_max_bytes = pty_max_bytes; str->eof_char = eof_char; + str->pty_flushing = 1; } int -filedesc_stream_was_blocked (Lstream *stream) +filedesc_stream_fd (Lstream *stream) { struct filedesc_stream *str = FILEDESC_STREAM_DATA (stream); - return str->blocking_error_p; + return str->fd; } /*********** read from a Lisp string ***********/ @@ -1707,6 +1724,7 @@ LSTREAM_HAS_METHOD (filedesc, reader); LSTREAM_HAS_METHOD (filedesc, writer); + LSTREAM_HAS_METHOD (filedesc, was_blocked_p); LSTREAM_HAS_METHOD (filedesc, rewinder); LSTREAM_HAS_METHOD (filedesc, seekable_p); LSTREAM_HAS_METHOD (filedesc, closer);
--- a/src/lstream.h Mon Aug 13 10:23:52 2007 +0200 +++ b/src/lstream.h Mon Aug 13 10:24:41 2007 +0200 @@ -107,6 +107,10 @@ non-blocking file descriptor and are getting EWOULDBLOCK errors.) This function can be NULL if the stream is input-only. */ int (*writer) (Lstream *stream, CONST unsigned char *data, int size); + /* Return non-zero if the last write operation on the stream resulted + in an attempt to block (EWOULDBLOCK). If this method does not + exists, the implementation returns 0 */ + int (*was_blocked_p) (Lstream *stream); /* Rewind the stream. If this is NULL, the stream is not seekable. */ int (*rewinder) (Lstream *stream); /* Indicate whether this stream is seekable -- i.e. it can be rewound. @@ -202,6 +206,7 @@ void Lstream_fungetc (Lstream *lstr, int c); int Lstream_read (Lstream *lstr, void *data, int size); int Lstream_write (Lstream *lstr, CONST void *data, int size); +int Lstream_was_blocked_p (Lstream *lstr); void Lstream_unread (Lstream *lstr, CONST void *data, int size); int Lstream_rewind (Lstream *lstr); int Lstream_seekable_p (Lstream *lstr); @@ -324,7 +329,7 @@ void filedesc_stream_set_pty_flushing (Lstream *stream, int pty_max_bytes, Bufbyte eof_char); -int filedesc_stream_was_blocked (Lstream *stream); +int filedesc_stream_fd (Lstream *stream); Lisp_Object make_lisp_string_input_stream (Lisp_Object string, Bytecount offset, Bytecount len);
--- a/src/md5.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/md5.c Mon Aug 13 10:24:41 2007 +0200 @@ -451,10 +451,12 @@ { coding_system = Ffind_coding_system (coding); if (NILP(coding_system)) - if (NILP(error_me_not)) - signal_simple_error("No such coding system", coding); - else - coding_system = Fget_coding_system(Qbinary); /* default to binary */ + { + if (NILP(error_me_not)) + signal_simple_error("No such coding system", coding); + else + coding_system = Fget_coding_system(Qbinary); /* default to binary */ + } } #endif
--- a/src/nas.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/nas.c Mon Aug 13 10:24:41 2007 +0200 @@ -346,7 +346,7 @@ } #endif - if (aud==NULL) + if (aud==NULL) { if (aud_server != NULL) { char *m; @@ -368,6 +368,7 @@ #endif return 0; } + } #ifndef CACHE_SOUNDS sounds_in_play++; @@ -445,7 +446,7 @@ #endif - if (aud == NULL) + if (aud == NULL) { if (aud_server != NULL) { char *m; @@ -466,6 +467,7 @@ #endif return 0; } + } if ((s=SoundOpenDataForReading (data, length))==NULL) {
--- a/src/nt.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/nt.c Mon Aug 13 10:24:41 2007 +0200 @@ -89,9 +89,11 @@ #include "ntheap.h" -extern Lisp_Object Vwin32_downcase_file_names; +extern Lisp_Object Vmswindows_downcase_file_names; +#if 0 extern Lisp_Object Vwin32_generate_fake_inodes; -extern Lisp_Object Vwin32_get_true_file_attributes; +#endif +extern Lisp_Object Vmswindows_get_true_file_attributes; static char startup_dir[ MAXPATHLEN ]; @@ -324,7 +326,7 @@ fp += 2; } - if (NILP (Vwin32_downcase_file_names)) + if (NILP (Vmswindows_downcase_file_names)) { while (*fp) { @@ -1215,7 +1217,7 @@ strcpy (dir_static.d_name, dir_find_data.cFileName); if (dir_is_fat) _strlwr (dir_static.d_name); - else if (!NILP (Vwin32_downcase_file_names)) + else if (!NILP (Vmswindows_downcase_file_names)) { REGISTER char *p; for (p = dir_static.d_name; *p; p++) @@ -1524,7 +1526,7 @@ static long double utc_base; static int init = 0; -static time_t +time_t convert_time (FILETIME ft) { long double ret; @@ -1719,7 +1721,7 @@ buf->st_nlink = 2; /* doesn't really matter */ fake_inode = 0; /* this doesn't either I think */ } - else if (!NILP (Vwin32_get_true_file_attributes)) + else if (!NILP (Vmswindows_get_true_file_attributes)) { /* This is more accurate in terms of gettting the correct number of links, but is quite slow (it is noticable when Emacs is
--- a/src/ntproc.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/ntproc.c Mon Aug 13 10:24:41 2007 +0200 @@ -74,21 +74,12 @@ but is useful for Win32 processes on both Win95 and NT as well. */ Lisp_Object Vwin32_pipe_read_delay; -/* Control conversion of upper case file names to lower case. - nil means no, t means yes. */ -Lisp_Object Vwin32_downcase_file_names; - /* Control whether stat() attempts to generate fake but hopefully "accurate" inode values, by hashing the absolute truenames of files. This should detect aliasing between long and short names, but still allows the possibility of hash collisions. */ Lisp_Object Vwin32_generate_fake_inodes; -/* Control whether stat() attempts to determine file type and link count - exactly, at the expense of slower operation. Since true hard links - are supported on NTFS volumes, this is only relevant on NT. */ -Lisp_Object Vwin32_get_true_file_attributes; - Lisp_Object Qhigh, Qlow; #ifndef DEBUG_XEMACS @@ -1879,11 +1870,6 @@ */ ); Vwin32_pipe_read_delay = 50; - DEFVAR_LISP ("win32-downcase-file-names", &Vwin32_downcase_file_names /* -Non-nil means convert all-upper case file names to lower case. -This applies when performing completions and file name expansion.*/ ); - Vwin32_downcase_file_names = Qnil; - #if 0 DEFVAR_LISP ("win32-generate-fake-inodes", &Vwin32_generate_fake_inodes /* "Non-nil means attempt to fake realistic inode values. @@ -1894,13 +1880,5 @@ */ ); Vwin32_generate_fake_inodes = Qnil; #endif - - DEFVAR_LISP ("win32-get-true-file-attributes", &Vwin32_get_true_file_attributes /* - "Non-nil means determine accurate link count in file-attributes. -This option slows down file-attributes noticeably, so is disabled by -default. Note that it is only useful for files on NTFS volumes, -where hard links are supported. -*/ ); - Vwin32_get_true_file_attributes = Qnil; } /* end of ntproc.c */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/process-unix.c Mon Aug 13 10:24:41 2007 +0200 @@ -0,0 +1,1744 @@ +/* Asynchronous subprocess implemenation for UNIX + Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995 + Free Software Foundation, Inc. + Copyright (C) 1995 Sun Microsystems, Inc. + Copyright (C) 1995, 1996 Ben Wing. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* This file has been Mule-ized except for `start-process-internal', + `open-network-stream-internal' and `open-multicast-group-internal'. */ + +/* This file has been split into process.c and process-unix.c by + Kirill M. Katsnelson <kkm@kis.ru>, so please bash him and not + the original author(s) */ + +#include <config.h> + +#if !defined (NO_SUBPROCESSES) + +/* The entire file is within this conditional */ + +#include "lisp.h" + +#include "buffer.h" +#include "commands.h" +#include "events.h" +#include "frame.h" +#include "hash.h" +#include "insdel.h" +#include "lstream.h" +#include "opaque.h" +#include "process.h" +#include "procimpl.h" +#include "sysdep.h" +#include "window.h" +#ifdef FILE_CODING +#include "file-coding.h" +#endif + +#include <setjmp.h> +#include "sysfile.h" +#include "sysproc.h" +#include "systime.h" +#include "syssignal.h" /* Always include before systty.h */ +#include "systty.h" +#include "syswait.h" + + +/* + * Implemenation-specific data. Pointed to by Lisp_Process->process_data + */ + +struct unix_process_data +{ + /* Non-0 if this is really a ToolTalk channel. */ + int connected_via_filedesc_p; + /* Descriptor by which we read from this process. -1 for dead process */ + int infd; + /* Descriptor for the tty which this process is using. + -1 if we didn't record it (on some systems, there's no need). */ + int subtty; + /* Name of subprocess terminal. */ + Lisp_Object tty_name; + /* Non-false if communicating through a pty. */ + char pty_flag; +}; + +#define UNIX_DATA(p) ((struct unix_process_data*)((p)->process_data)) + +#ifdef HAVE_PTYS +/* The file name of the pty opened by allocate_pty. */ + +static char pty_name[24]; +#endif + + + +/**********************************************************************/ +/* Static helper routines */ +/**********************************************************************/ + +static SIGTYPE +close_safely_handler (int signo) +{ + EMACS_REESTABLISH_SIGNAL (signo, close_safely_handler); + SIGRETURN; +} + +static void +close_safely (int fd) +{ + stop_interrupts (); + signal (SIGALRM, close_safely_handler); + alarm (1); + close (fd); + alarm (0); + start_interrupts (); +} + +static void +close_descriptor_pair (int in, int out) +{ + if (in >= 0) + close (in); + if (out != in && out >= 0) + close (out); +} + +/* Close all descriptors currently in use for communication + with subprocess. This is used in a newly-forked subprocess + to get rid of irrelevant descriptors. */ + +static int +close_process_descs_mapfun (CONST void* key, void* contents, void* arg) +{ + Lisp_Object proc; + CVOID_TO_LISP (proc, contents); + event_stream_delete_stream_pair (XPROCESS(proc)->pipe_instream, + XPROCESS(proc)->pipe_outstream); + return 0; +} + +/* #### This function is currently called from child_setup + in callproc.c. It should become static though - kkm */ +void +close_process_descs (void) +{ + maphash (close_process_descs_mapfun, usid_to_process, 0); +} + +/* connect to an existing file descriptor. This is very similar to + open-network-stream except that it assumes that the connection has + already been initialized. It is currently used for ToolTalk + communication. */ + +/* This function used to be visible on the Lisp level, but there is no + real point in doing that. Here is the doc string: + + "Connect to an existing file descriptor.\n\ +Returns a subprocess-object to represent the connection.\n\ +Input and output work as for subprocesses; `delete-process' closes it.\n\ +Args are NAME BUFFER INFD OUTFD.\n\ +NAME is name for process. It is modified if necessary to make it unique.\n\ +BUFFER is the buffer (or buffer-name) to associate with the process.\n\ + Process output goes at end of that buffer, unless you specify\n\ + an output stream or filter function to handle the output.\n\ + BUFFER may be also nil, meaning that this process is not associated\n\ + with any buffer\n\ +INFD and OUTFD specify the file descriptors to use for input and\n\ + output, respectively." +*/ + +Lisp_Object +connect_to_file_descriptor (Lisp_Object name, Lisp_Object buffer, + Lisp_Object infd, Lisp_Object outfd) +{ + /* This function can GC */ + Lisp_Object proc; + int inch; + + CHECK_STRING (name); + CHECK_INT (infd); + CHECK_INT (outfd); + + inch = XINT (infd); + if (get_process_from_usid (FD_TO_USID(inch))) + error ("There is already a process connected to fd %d", inch); + if (!NILP (buffer)) + buffer = Fget_buffer_create (buffer); + proc = make_process_internal (name); + + XPROCESS (proc)->pid = Fcons (infd, name); + XPROCESS (proc)->buffer = buffer; + init_process_io_handles (XPROCESS (proc), (void*)inch, (void*)XINT (outfd), 0); + UNIX_DATA (XPROCESS (proc))->connected_via_filedesc_p = 1; + + event_stream_select_process (XPROCESS (proc)); + + return proc; +} + +#ifdef HAVE_PTYS + +/* Open an available pty, returning a file descriptor. + Return -1 on failure. + The file name of the terminal corresponding to the pty + is left in the variable pty_name. */ + +static int +allocate_pty (void) +{ + struct stat stb; + int c, i; + int fd; + + /* Some systems name their pseudoterminals so that there are gaps in + the usual sequence - for example, on HP9000/S700 systems, there + are no pseudoterminals with names ending in 'f'. So we wait for + three failures in a row before deciding that we've reached the + end of the ptys. */ + int failed_count = 0; + +#ifdef PTY_ITERATION + PTY_ITERATION +#else + for (c = FIRST_PTY_LETTER; c <= 'z'; c++) + for (i = 0; i < 16; i++) +#endif + { +#ifdef PTY_NAME_SPRINTF + PTY_NAME_SPRINTF +#else + sprintf (pty_name, "/dev/pty%c%x", c, i); +#endif /* no PTY_NAME_SPRINTF */ + +#ifdef PTY_OPEN + PTY_OPEN; +#else /* no PTY_OPEN */ +#ifdef IRIS + /* Unusual IRIS code */ + *ptyv = open ("/dev/ptc", O_RDWR | O_NDELAY | OPEN_BINARY, 0); + if (fd < 0) + return -1; + if (fstat (fd, &stb) < 0) + return -1; +#else /* not IRIS */ + if (stat (pty_name, &stb) < 0) + { + failed_count++; + if (failed_count >= 3) + return -1; + } + else + failed_count = 0; +#ifdef O_NONBLOCK + fd = open (pty_name, O_RDWR | O_NONBLOCK | OPEN_BINARY, 0); +#else + fd = open (pty_name, O_RDWR | O_NDELAY | OPEN_BINARY, 0); +#endif +#endif /* not IRIS */ +#endif /* no PTY_OPEN */ + + if (fd >= 0) + { + /* check to make certain that both sides are available + this avoids a nasty yet stupid bug in rlogins */ +#ifdef PTY_TTY_NAME_SPRINTF + PTY_TTY_NAME_SPRINTF +#else + sprintf (pty_name, "/dev/tty%c%x", c, i); +#endif /* no PTY_TTY_NAME_SPRINTF */ +#ifndef UNIPLUS + if (access (pty_name, 6) != 0) + { + close (fd); +#if !defined(IRIS) && !defined(__sgi) + continue; +#else + return -1; +#endif /* IRIS */ + } +#endif /* not UNIPLUS */ + setup_pty (fd); + return fd; + } + } + return -1; +} +#endif /* HAVE_PTYS */ + +static int +create_bidirectional_pipe (int *inchannel, int *outchannel, + volatile int *forkin, volatile int *forkout) +{ + int sv[2]; + +#ifdef SKTPAIR + if (socketpair (AF_UNIX, SOCK_STREAM, 0, sv) < 0) + return -1; + *outchannel = *inchannel = sv[0]; + *forkout = *forkin = sv[1]; +#else /* not SKTPAIR */ + int temp; + temp = pipe (sv); + if (temp < 0) return -1; + *inchannel = sv[0]; + *forkout = sv[1]; + temp = pipe (sv); + if (temp < 0) return -1; + *outchannel = sv[1]; + *forkin = sv[0]; +#endif /* not SKTPAIR */ + return 0; +} + + +#ifdef HAVE_SOCKETS + +static int +get_internet_address (Lisp_Object host, struct sockaddr_in *address, + Error_behavior errb) +{ + struct hostent *host_info_ptr = NULL; +#ifdef TRY_AGAIN + int count = 0; +#endif + + memset (address, 0, sizeof (*address)); + + while (1) + { +#ifdef TRY_AGAIN + if (count++ > 10) break; +#ifndef BROKEN_CYGWIN + h_errno = 0; +#endif +#endif + /* Some systems can't handle SIGIO/SIGALARM in gethostbyname. */ + slow_down_interrupts (); + host_info_ptr = gethostbyname ((char *) XSTRING_DATA (host)); + speed_up_interrupts (); +#ifdef TRY_AGAIN + if (! (host_info_ptr == 0 && h_errno == TRY_AGAIN)) +#endif + break; + Fsleep_for (make_int (1)); + } + if (host_info_ptr) + { + address->sin_family = host_info_ptr->h_addrtype; + memcpy (&address->sin_addr, host_info_ptr->h_addr, host_info_ptr->h_length); + } + else + { + IN_ADDR numeric_addr; + /* Attempt to interpret host as numeric inet address */ + numeric_addr = inet_addr ((char *) XSTRING_DATA (host)); + if (NUMERIC_ADDR_ERROR) + { + maybe_error (Qprocess, errb, + "Unknown host \"%s\"", XSTRING_DATA (host)); + return 0; + } + + /* There was some broken code here that called strlen() here + on (char *) &numeric_addr and even sometimes accessed + uninitialized data. */ + address->sin_family = AF_INET; + * (IN_ADDR *) &address->sin_addr = numeric_addr; + } + + return 1; +} + +static void +set_socket_nonblocking_maybe (int fd, int port, CONST char* proto) +{ +#ifdef PROCESS_IO_BLOCKING + Lisp_Object tail; + + for (tail = network_stream_blocking_port_list; CONSP (tail); tail = XCDR (tail)) + { + Lisp_Object tail_port = XCAR (tail); + + if (STRINGP (tail_port)) + { + struct servent *svc_info; + CHECK_STRING (tail_port); + svc_info = getservbyname ((char *) XSTRING_DATA (tail_port), proto); + if ((svc_info != 0) && (svc_info->s_port == port)) + break; + else + continue; + } + else if ((INTP (tail_port)) && (htons ((unsigned short) XINT (tail_port)) == port)) + break; + } + + if (!CONSP (tail)) + { + set_descriptor_non_blocking (fd); + } +#else + set_descriptor_non_blocking (fd); +#endif /* PROCESS_IO_BLOCKING */ +} + +#endif /* HAVE_SOCKETS */ + +/* Compute the Lisp form of the process status from + the numeric status that was returned by `wait'. */ + +static void +update_status_from_wait_code (struct Lisp_Process *p, int *w_fmh) +{ + /* C compiler lossage when attempting to pass w directly */ + int w = *w_fmh; + + if (WIFSTOPPED (w)) + { + p->status_symbol = Qstop; + p->exit_code = WSTOPSIG (w); + p->core_dumped = 0; + } + else if (WIFEXITED (w)) + { + p->status_symbol = Qexit; + p->exit_code = WEXITSTATUS (w); + p->core_dumped = 0; + } + else if (WIFSIGNALED (w)) + { + p->status_symbol = Qsignal; + p->exit_code = WTERMSIG (w); + p->core_dumped = WCOREDUMP (w); + } + else + { + p->status_symbol = Qrun; + p->exit_code = 0; + } +} + +#ifdef SIGCHLD + +#define MAX_EXITED_PROCESSES 1000 +static volatile pid_t exited_processes[MAX_EXITED_PROCESSES]; +static volatile int exited_processes_status[MAX_EXITED_PROCESSES]; +static volatile int exited_processes_index; + +static volatile int sigchld_happened; + +/* On receipt of a signal that a child status has changed, + loop asking about children with changed statuses until + the system says there are no more. All we do is record + the processes and wait status. + + This function could be called from within the SIGCHLD + handler, so it must be completely reentrant. When + not called from a SIGCHLD handler, BLOCK_SIGCHLD should + be non-zero so that SIGCHLD is blocked while this + function is running. (This is necessary so avoid + race conditions with the SIGCHLD_HAPPENED flag). */ + +static void +record_exited_processes (int block_sigchld) +{ + if (!sigchld_happened) + { + return; + } + +#ifdef EMACS_BLOCK_SIGNAL + if (block_sigchld) + EMACS_BLOCK_SIGNAL (SIGCHLD); +#endif + + while (sigchld_happened) + { + int pid; + int w; + + /* Keep trying to get a status until we get a definitive result. */ + do + { + errno = 0; +#ifdef WNOHANG +# ifndef WUNTRACED +# define WUNTRACED 0 +# endif /* not WUNTRACED */ +# ifdef HAVE_WAITPID + pid = waitpid ((pid_t) -1, &w, WNOHANG | WUNTRACED); +# else + pid = wait3 (&w, WNOHANG | WUNTRACED, 0); +# endif +#else /* not WNOHANG */ + pid = wait (&w); +#endif /* not WNOHANG */ + } + while (pid <= 0 && errno == EINTR); + + if (pid <= 0) + break; + + if (exited_processes_index < MAX_EXITED_PROCESSES) + { + exited_processes[exited_processes_index] = pid; + exited_processes_status[exited_processes_index] = w; + exited_processes_index++; + } + + /* On systems with WNOHANG, we just ignore the number + of times that SIGCHLD was signalled, and keep looping + until there are no more processes to wait on. If we + don't have WNOHANG, we have to rely on the count in + SIGCHLD_HAPPENED. */ +#ifndef WNOHANG + sigchld_happened--; +#endif /* not WNOHANG */ + } + + sigchld_happened = 0; + + if (block_sigchld) + EMACS_UNBLOCK_SIGNAL (SIGCHLD); +} + +/* For any processes that have changed status and are recorded + and such, update the corresponding struct Lisp_Process. + We separate this from record_exited_processes() so that + we never have to call this function from within a signal + handler. We block SIGCHLD in case record_exited_processes() + is called from a signal handler. */ + +/** USG WARNING: Although it is not obvious from the documentation + in signal(2), on a USG system the SIGCLD handler MUST NOT call + signal() before executing at least one wait(), otherwise the handler + will be called again, resulting in an infinite loop. The relevant + portion of the documentation reads "SIGCLD signals will be queued + and the signal-catching function will be continually reentered until + the queue is empty". Invoking signal() causes the kernel to reexamine + the SIGCLD queue. Fred Fish, UniSoft Systems Inc. + + (Note that now this only applies in SYS V Release 2 and before. + On SYS V Release 3, we use sigset() to set the signal handler for + the first time, and so we don't have to reestablish the signal handler + in the handler below. On SYS V Release 4, we don't get this weirdo + behavior when we use sigaction(), which we do use.) */ + +static SIGTYPE +sigchld_handler (int signo) +{ +#ifdef OBNOXIOUS_SYSV_SIGCLD_BEHAVIOR + int old_errno = errno; + + sigchld_happened++; + record_exited_processes (0); + errno = old_errno; +#else + sigchld_happened++; +#endif +#ifdef HAVE_UNIXOID_EVENT_LOOP + signal_fake_event (); +#endif + /* WARNING - must come after wait3() for USG systems */ + EMACS_REESTABLISH_SIGNAL (signo, sigchld_handler); + SIGRETURN; +} + +#endif /* SIGCHLD */ + +#ifdef SIGNALS_VIA_CHARACTERS +/* Get signal character to send to process if SIGNALS_VIA_CHARACTERS */ + +static int +process_signal_char (int tty_fd, int signo) +{ + /* If it's not a tty, pray that these default values work */ + if (!isatty(tty_fd)) { +#define CNTL(ch) (037 & (ch)) + switch (signo) + { + case SIGINT: return CNTL('C'); + case SIGQUIT: return CNTL('\\'); +#ifdef SIGTSTP + case SIGTSTP: return CNTL('Z'); +#endif + } + } + +#ifdef HAVE_TERMIOS + /* TERMIOS is the latest and bestest, and seems most likely to work. + If the system has it, use it. */ + { + struct termios t; + tcgetattr (tty_fd, &t); + switch (signo) + { + case SIGINT: return t.c_cc[VINTR]; + case SIGQUIT: return t.c_cc[VQUIT]; +# if defined (VSWTCH) && !defined (PREFER_VSUSP) + case SIGTSTP: return t.c_cc[VSWTCH]; +# else + case SIGTSTP: return t.c_cc[VSUSP]; +# endif + } + } + +# elif defined (TIOCGLTC) && defined (TIOCGETC) /* not HAVE_TERMIOS */ + { + /* On Berkeley descendants, the following IOCTL's retrieve the + current control characters. */ + struct tchars c; + struct ltchars lc; + switch (signo) + { + case SIGINT: ioctl (tty_fd, TIOCGETC, &c); return c.t_intrc; + case SIGQUIT: ioctl (tty_fd, TIOCGETC, &c); return c.t_quitc; +# ifdef SIGTSTP + case SIGTSTP: ioctl (tty_fd, TIOCGLTC, &lc); return lc.t_suspc; +# endif /* SIGTSTP */ + } + } + +# elif defined (TCGETA) /* ! defined (TIOCGLTC) && defined (TIOCGETC) */ + { + /* On SYSV descendants, the TCGETA ioctl retrieves the current + control characters. */ + struct termio t; + ioctl (tty_fd, TCGETA, &t); + switch (signo) { + case SIGINT: return t.c_cc[VINTR]; + case SIGQUIT: return t.c_cc[VQUIT]; +# ifdef SIGTSTP + case SIGTSTP: return t.c_cc[VSWTCH]; +# endif /* SIGTSTP */ + } + } +# else /* ! defined (TCGETA) */ +#error ERROR! Using SIGNALS_VIA_CHARACTERS, but not HAVE_TERMIOS || (TIOCGLTC && TIOCGETC) || TCGETA + /* If your system configuration files define SIGNALS_VIA_CHARACTERS, + you'd better be using one of the alternatives above! */ +# endif /* ! defined (TCGETA) */ + return '\0'; +} +#endif /* SIGNALS_VIA_CHARACTERS */ + + + + +/**********************************************************************/ +/* Process implementation methods */ +/**********************************************************************/ + +/* + * Allocate and initialize Lisp_Process->process_data + */ + +static void +unix_alloc_process_data (struct Lisp_Process *p) +{ + p->process_data = xnew (struct unix_process_data); + + UNIX_DATA(p)->connected_via_filedesc_p = 0; + UNIX_DATA(p)->infd = -1; + UNIX_DATA(p)->subtty = -1; + UNIX_DATA(p)->tty_name = Qnil; + UNIX_DATA(p)->pty_flag = 0; +} + +/* + * Mark any Lisp objects in Lisp_Process->process_data + */ + +static void +unix_mark_process_data (struct Lisp_Process *proc, + void (*markobj) (Lisp_Object)) +{ + ((markobj) (UNIX_DATA(proc)->tty_name)); +} + +/* + * Initialize XEmacs process implemenation once + */ + +#ifdef SIGCHLD +static void +unix_init_process (void) +{ +#ifndef CANNOT_DUMP + if (! noninteractive || initialized) +#endif + signal (SIGCHLD, sigchld_handler); +} +#endif /* SIGCHLD */ + +/* + * Initialize any process local data. This is called when newly + * created process is connected to real OS file handles. The + * handles are generally represented by void* type, but are + * of type int (file descriptors) for UNIX + */ + +static void +unix_init_process_io_handles (struct Lisp_Process *p, void* in, void* out, int flags) +{ + UNIX_DATA(p)->infd = (int)in; +} + +/* + * Fork off a subprocess. P is a pointer to newly created subprocess + * object. If this function signals, the caller is responsible for + * deleting (and finalizing) the process object. + * + * The method must return PID of the new proces, a (positive??? ####) number + * which fits into Lisp_Int. No return value indicates an error, the method + * must signal an error instead. + */ + +static int +unix_create_process (struct Lisp_Process *p, + char **new_argv, CONST char *current_dir) +{ + /* This function rewritten by wing@666.com. */ + + int pid, inchannel, outchannel; + /* Use volatile to protect variables from being clobbered by longjmp. */ + volatile int forkin, forkout; + volatile int pty_flag = 0; + char **env; + + env = environ; + + inchannel = outchannel = forkin = forkout = -1; + +#ifdef HAVE_PTYS + if (!NILP (Vprocess_connection_type)) + { + /* find a new pty, open the master side, return the opened + file handle, and store the name of the corresponding slave + side in global variable pty_name. */ + outchannel = inchannel = allocate_pty (); + } + + if (inchannel >= 0) + { + /* You're "supposed" to now open the slave in the child. + On some systems, we can open it here; this allows for + better error checking. */ +#if !defined(USG) + /* On USG systems it does not work to open the pty's tty here + and then close and reopen it in the child. */ +#ifdef O_NOCTTY + /* Don't let this terminal become our controlling terminal + (in case we don't have one). */ + forkout = forkin = open (pty_name, O_RDWR | O_NOCTTY | OPEN_BINARY, 0); +#else + forkout = forkin = open (pty_name, O_RDWR | OPEN_BINARY, 0); +#endif + if (forkin < 0) + goto io_failure; +#endif /* not USG */ + UNIX_DATA(p)->pty_flag = pty_flag = 1; + } + else +#endif /* HAVE_PTYS */ + if (create_bidirectional_pipe (&inchannel, &outchannel, + &forkin, &forkout) < 0) + goto io_failure; + +#if 0 + /* Replaced by close_process_descs */ + set_exclusive_use (inchannel); + set_exclusive_use (outchannel); +#endif + + set_descriptor_non_blocking (inchannel); + + /* Record this as an active process, with its channels. + As a result, child_setup will close Emacs's side of the pipes. */ + init_process_io_handles (p, (void*)inchannel, (void*)outchannel, pty_flag); + /* Record the tty descriptor used in the subprocess. */ + UNIX_DATA(p)->subtty = forkin; + + { +#if !defined(__CYGWIN32__) + /* child_setup must clobber environ on systems with true vfork. + Protect it from permanent change. */ + char **save_environ = environ; +#endif + +#ifdef EMACS_BTL + /* when performance monitoring is on, turn it off before the vfork(), + as the child has no handler for the signal -- when back in the + parent process, turn it back on if it was really on when you "turned + it off" */ + int logging_on = cadillac_stop_logging (); /* #### rename me */ +#endif + + pid = fork (); + if (pid == 0) + { + /**** Now we're in the child process ****/ + int xforkin = forkin; + int xforkout = forkout; + + if (!pty_flag) + EMACS_SEPARATE_PROCESS_GROUP (); +#ifdef HAVE_PTYS + else + { + /* Disconnect the current controlling terminal, pursuant to + making the pty be the controlling terminal of the process. + Also put us in our own process group. */ + + disconnect_controlling_terminal (); + + /* Open the pty connection and make the pty's terminal + our controlling terminal. + + On systems with TIOCSCTTY, we just use it to set + the controlling terminal. On other systems, the + first TTY we open becomes the controlling terminal. + So, we end up with four possibilities: + + (1) on USG and TIOCSCTTY systems, we open the pty + and use TIOCSCTTY. + (2) on other USG systems, we just open the pty. + (3) on non-USG systems with TIOCSCTTY, we + just use TIOCSCTTY. (On non-USG systems, we + already opened the pty in the parent process.) + (4) on non-USG systems without TIOCSCTTY, we + close the pty and reopen it. + + This would be cleaner if we didn't open the pty + in the parent process, but doing it that way + makes it possible to trap error conditions. + It's harder to convey an error from the child + process, and I don't feel like messing with + this now. */ + + /* There was some weirdo, probably wrong, + conditionalization on RTU and UNIPLUS here. + I deleted it. So sue me. */ + + /* SunOS has TIOCSCTTY but the close/open method + also works. */ + +# if defined (USG) || !defined (TIOCSCTTY) + /* Now close the pty (if we had it open) and reopen it. + This makes the pty the controlling terminal of the + subprocess. */ + /* I wonder if close (open (pty_name, ...)) would work? */ + if (xforkin >= 0) + close (xforkin); + xforkout = xforkin = open (pty_name, O_RDWR | OPEN_BINARY, 0); + if (xforkin < 0) + { + write (1, "Couldn't open the pty terminal ", 31); + write (1, pty_name, strlen (pty_name)); + write (1, "\n", 1); + _exit (1); + } +# endif /* USG or not TIOCSCTTY */ + + /* Miscellaneous setup required for some systems. + Must be done before using tc* functions on xforkin. + This guarantees that isatty(xforkin) is true. */ + +# ifdef SETUP_SLAVE_PTY + SETUP_SLAVE_PTY; +# endif /* SETUP_SLAVE_PTY */ + +# ifdef TIOCSCTTY + /* We ignore the return value + because faith@cs.unc.edu says that is necessary on Linux. */ + assert (isatty (xforkin)); + ioctl (xforkin, TIOCSCTTY, 0); +# endif /* TIOCSCTTY */ + + /* Change the line discipline. */ + +# if defined (HAVE_TERMIOS) && defined (LDISC1) + { + struct termios t; + assert (isatty (xforkin)); + tcgetattr (xforkin, &t); + t.c_lflag = LDISC1; + if (tcsetattr (xforkin, TCSANOW, &t) < 0) + perror ("create_process/tcsetattr LDISC1 failed\n"); + } +# elif defined (NTTYDISC) && defined (TIOCSETD) + { + /* Use new line discipline. TIOCSETD is accepted and + ignored on Sys5.4 systems with ttcompat. */ + int ldisc = NTTYDISC; + assert (isatty (xforkin)); + ioctl (xforkin, TIOCSETD, &ldisc); + } +# endif /* TIOCSETD & NTTYDISC */ + + /* Make our process group be the foreground group + of our new controlling terminal. */ + + { + int piddly = EMACS_GET_PROCESS_GROUP (); + EMACS_SET_TTY_PROCESS_GROUP (xforkin, &piddly); + } + +# ifdef AIX + /* On AIX, we've disabled SIGHUP above once we start a + child on a pty. Now reenable it in the child, so it + will die when we want it to. */ + signal (SIGHUP, SIG_DFL); +# endif /* AIX */ + } +#endif /* HAVE_PTYS */ + + signal (SIGINT, SIG_DFL); + signal (SIGQUIT, SIG_DFL); + + if (pty_flag) + { + /* Set up the terminal characteristics of the pty. */ + child_setup_tty (xforkout); + } + + child_setup (xforkin, xforkout, xforkout, new_argv, current_dir); + } +#ifdef EMACS_BTL + else if (logging_on) + cadillac_start_logging (); /* #### rename me */ +#endif + +#if !defined(__CYGWIN32__) + environ = save_environ; +#endif + } + + if (pid < 0) + { + close_descriptor_pair (forkin, forkout); + report_file_error ("Doing fork", Qnil); + } + + /* #### dmoore - why is this commented out, otherwise we leave + subtty = forkin, but then we close forkin just below. */ + /* UNIX_DATA(p)->subtty = -1; */ + + /* If the subfork execv fails, and it exits, + this close hangs. I don't know why. + So have an interrupt jar it loose. */ + if (forkin >= 0) + close_safely (forkin); + if (forkin != forkout && forkout >= 0) + close (forkout); + +#ifdef HAVE_PTYS + if (pty_flag) + UNIX_DATA (p)->tty_name = build_string (pty_name); + else +#endif + UNIX_DATA (p)->tty_name = Qnil; + + /* Notice that SIGCHLD was not blocked. (This is not possible on + some systems.) No biggie if SIGCHLD occurs right around the + time that this call happens, because SIGCHLD() does not actually + deselect the process (that doesn't occur until the next time + we're waiting for an event, when status_notify() is called). */ + return pid; + +io_failure: + { + int temp = errno; + close_descriptor_pair (forkin, forkout); + close_descriptor_pair (inchannel, outchannel); + errno = temp; + report_file_error ("Opening pty or pipe", Qnil); + } + + RETURN_NOT_REACHED (0); +} + +/* + * Return nonzero if this process is a ToolTalk connection. + */ + +static int +unix_tooltalk_connection_p (struct Lisp_Process *p) +{ + return UNIX_DATA(p)->connected_via_filedesc_p; +} + +/* + * This is called to set process' virtual terminal size + */ + +static int +unix_set_window_size (struct Lisp_Process* p, int cols, int rows) +{ + return set_window_size (UNIX_DATA(p)->infd, cols, rows); +} + +/* + * This method is called to update status fields of the process + * structure. If the process has not existed, this method is + * expected to do nothing. + * + * The method is called only for real child processes. + */ + +#ifdef HAVE_WAITPID +static void +unix_update_status_if_terminated (struct Lisp_Process* p) +{ + int w; +#ifdef SIGCHLD + EMACS_BLOCK_SIGNAL (SIGCHLD); +#endif + if (waitpid (XINT (p->pid), &w, WNOHANG) == XINT (p->pid)) + { + p->tick++; + update_status_from_wait_code (p, &w); + } +#ifdef SIGCHLD + EMACS_UNBLOCK_SIGNAL (SIGCHLD); +#endif +} +#endif + +/* + * Update status of all exited processes. Called when SIGCLD has signaled. + */ + +#ifdef SIGCHLD +static void +unix_reap_exited_processes (void) +{ + int i; + struct Lisp_Process *p; + +#ifndef OBNOXIOUS_SYSV_SIGCLD_BEHAVIOR + record_exited_processes (1); +#endif + + if (exited_processes_index <= 0) + { + return; + } + +#ifdef EMACS_BLOCK_SIGNAL + EMACS_BLOCK_SIGNAL (SIGCHLD); +#endif + for (i = 0; i < exited_processes_index; i++) + { + int pid = exited_processes[i]; + int w = exited_processes_status[i]; + + /* Find the process that signaled us, and record its status. */ + + p = 0; + { + Lisp_Object tail; + LIST_LOOP (tail, Vprocess_list) + { + Lisp_Object proc = XCAR (tail); + p = XPROCESS (proc); + if (INTP (p->pid) && XINT (p->pid) == pid) + break; + p = 0; + } + } + + if (p) + { + /* Change the status of the process that was found. */ + p->tick++; + process_tick++; + update_status_from_wait_code (p, &w); + + /* If process has terminated, stop waiting for its output. */ + if (WIFSIGNALED (w) || WIFEXITED (w)) + { + if (!NILP(p->pipe_instream)) + { + /* We can't just call event_stream->unselect_process_cb (p) + here, because that calls XtRemoveInput, which is not + necessarily reentrant, so we can't call this at interrupt + level. + */ + } + } + } + else + { + /* There was no asynchronous process found for that id. Check + if we have a synchronous process. Only set sync process status + if there is one, so we work OK with the waitpid() call in + wait_for_termination(). */ + if (synch_process_alive != 0) + { /* Set the global sync process status variables. */ + synch_process_alive = 0; + + /* Report the status of the synchronous process. */ + if (WIFEXITED (w)) + synch_process_retcode = WEXITSTATUS (w); + else if (WIFSIGNALED (w)) + synch_process_death = signal_name (WTERMSIG (w)); + } + } + } + + exited_processes_index = 0; + + EMACS_UNBLOCK_SIGNAL (SIGCHLD); +} +#endif /* SIGCHLD */ + +/* + * Stuff the entire contents of LSTREAM to the process ouptut pipe + */ + +static JMP_BUF send_process_frame; + +static SIGTYPE +send_process_trap (int signum) +{ + EMACS_REESTABLISH_SIGNAL (signum, send_process_trap); + EMACS_UNBLOCK_SIGNAL (signum); + LONGJMP (send_process_frame, 1); +} + +static void +unix_send_process (volatile Lisp_Object proc, struct lstream* lstream) +{ + /* Use volatile to protect variables from being clobbered by longjmp. */ + SIGTYPE (*volatile old_sigpipe) (int) = 0; + volatile struct Lisp_Process *p = XPROCESS (proc); + + if (!SETJMP (send_process_frame)) + { + /* use a reasonable-sized buffer (somewhere around the size of the + stream buffer) so as to avoid inundating the stream with blocked + data. */ + Bufbyte chunkbuf[512]; + Bytecount chunklen; + + while (1) + { + int writeret; + + chunklen = Lstream_read (lstream, chunkbuf, 512); + if (chunklen <= 0) + break; /* perhaps should abort() if < 0? + This should never happen. */ + old_sigpipe = + (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap); + /* Lstream_write() will never successfully write less than + the amount sent in. In the worst case, it just buffers + the unwritten data. */ + writeret = Lstream_write (XLSTREAM (DATA_OUTSTREAM(p)), chunkbuf, + chunklen); + signal (SIGPIPE, old_sigpipe); + if (writeret < 0) + /* This is a real error. Blocking errors are handled + specially inside of the filedesc stream. */ + report_file_error ("writing to process", + list1 (proc)); + while (Lstream_was_blocked_p (XLSTREAM (p->pipe_outstream))) + { + /* Buffer is full. Wait, accepting input; + that may allow the program + to finish doing output and read more. */ + Faccept_process_output (Qnil, make_int (1), Qnil); + old_sigpipe = + (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap); + Lstream_flush (XLSTREAM (p->pipe_outstream)); + signal (SIGPIPE, old_sigpipe); + } + } + } + else + { /* We got here from a longjmp() from the SIGPIPE handler */ + signal (SIGPIPE, old_sigpipe); + p->status_symbol = Qexit; + p->exit_code = 256; /* #### SIGPIPE ??? */ + p->core_dumped = 0; + p->tick++; + process_tick++; + deactivate_process (proc); + error ("SIGPIPE raised on process %s; closed it", + XSTRING_DATA (p->name)); + } + + old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap); + Lstream_flush (XLSTREAM (DATA_OUTSTREAM(p))); + signal (SIGPIPE, old_sigpipe); +} + +/* + * Send EOF to the process. The default implementation simply + * closes the output stream. The method must return 0 to call + * the default implementation, or 1 if it has taken all care about + * sending EOF to the process. + */ + +static int +unix_process_send_eof (Lisp_Object proc) +{ + if (!UNIX_DATA (XPROCESS (proc))->pty_flag) + return 0; + + /* #### get_eof_char simply doesn't return the correct character + here. Maybe it is needed to determine the right eof + character in init_process_io_handles but here it simply screws + things up. */ +#if 0 + Bufbyte eof_char = get_eof_char (XPROCESS (proc)); + send_process (proc, Qnil, &eof_char, 0, 1); +#else + send_process (proc, Qnil, (CONST Bufbyte *) "\004", 0, 1); +#endif + return 1; +} + +/* + * Called before the process is deactivated. The process object + * is not immediately finalized, just undergoes a transition to + * inactive state. + * + * The return value is a unique stream ID, as returned by + * event_stream_delete_stream_pair + * + * In the lack of this method, only event_stream_delete_stream_pair + * is called on both I/O streams of the process. + * + * The UNIX version quards this by ignoring possible SIGPIPE. + */ + +static USID +unix_deactivate_process (struct Lisp_Process *p) +{ + SIGTYPE (*old_sigpipe) (int) = 0; + USID usid; + + if (UNIX_DATA(p)->infd >= 0) + flush_pending_output (UNIX_DATA(p)->infd); + + /* closing the outstream could result in SIGPIPE, so ignore it. */ + old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, SIG_IGN); + usid = event_stream_delete_stream_pair (p->pipe_instream, p->pipe_outstream); + signal (SIGPIPE, old_sigpipe); + + UNIX_DATA(p)->infd = -1; + + return usid; +} + +/* send a signal number SIGNO to PROCESS. + CURRENT_GROUP means send to the process group that currently owns + the terminal being used to communicate with PROCESS. + This is used for various commands in shell mode. + If NOMSG is zero, insert signal-announcements into process's buffers + right away. + + If we can, we try to signal PROCESS by sending control characters + down the pty. This allows us to signal inferiors who have changed + their uid, for which killpg would return an EPERM error. + + The method signals an error if the given SIGNO is not valid +*/ + +static void +unix_kill_child_process (Lisp_Object proc, int signo, + int current_group, int nomsg) +{ + int gid; + int no_pgrp = 0; + int kill_retval; + struct Lisp_Process *p = XPROCESS (proc); + + if (!UNIX_DATA(p)->pty_flag) + current_group = 0; + + /* If we are using pgrps, get a pgrp number and make it negative. */ + if (current_group) + { +#ifdef SIGNALS_VIA_CHARACTERS + /* If possible, send signals to the entire pgrp + by sending an input character to it. */ + { + char sigchar = process_signal_char(UNIX_DATA(p)->subtty, signo); + if (sigchar) { + send_process (proc, Qnil, (Bufbyte *) &sigchar, 0, 1); + return; + } + } +#endif /* ! defined (SIGNALS_VIA_CHARACTERS) */ + +#ifdef TIOCGPGRP + /* Get the pgrp using the tty itself, if we have that. + Otherwise, use the pty to get the pgrp. + On pfa systems, saka@pfu.fujitsu.co.JP writes: + "TIOCGPGRP symbol defined in sys/ioctl.h at E50. + But, TIOCGPGRP does not work on E50 ;-P works fine on E60" + His patch indicates that if TIOCGPGRP returns an error, then + we should just assume that p->pid is also the process group id. */ + { + int err; + + err = ioctl ( (UNIX_DATA(p)->subtty != -1 + ? UNIX_DATA(p)->subtty + : UNIX_DATA(p)->infd), TIOCGPGRP, &gid); + +#ifdef pfa + if (err == -1) + gid = - XINT (p->pid); +#endif /* ! defined (pfa) */ + } + if (gid == -1) + no_pgrp = 1; + else + gid = - gid; +#else /* ! defined (TIOCGPGRP ) */ + /* Can't select pgrps on this system, so we know that + the child itself heads the pgrp. */ + gid = - XINT (p->pid); +#endif /* ! defined (TIOCGPGRP ) */ + } + else + gid = - XINT (p->pid); + + switch (signo) + { +#ifdef SIGCONT + case SIGCONT: + p->status_symbol = Qrun; + p->exit_code = 0; + p->tick++; + process_tick++; + if (!nomsg) + status_notify (); + break; +#endif /* ! defined (SIGCONT) */ + case SIGINT: + case SIGQUIT: + case SIGKILL: + flush_pending_output (UNIX_DATA(p)->infd); + break; + } + + /* If we don't have process groups, send the signal to the immediate + subprocess. That isn't really right, but it's better than any + obvious alternative. */ + if (no_pgrp) + { + kill_retval = kill (XINT (p->pid), signo) ? errno : 0; + } + else + { + /* gid may be a pid, or minus a pgrp's number */ +#ifdef TIOCSIGSEND + if (current_group) + kill_retval = ioctl (UNIX_DATA(p)->infd, TIOCSIGSEND, signo); + else + kill_retval = kill (- XINT (p->pid), signo) ? errno : 0; +#else /* ! defined (TIOCSIGSEND) */ + kill_retval = EMACS_KILLPG (-gid, signo) ? errno : 0; +#endif /* ! defined (TIOCSIGSEND) */ + } + + if (kill_retval < 0 && errno == EINVAL) + error ("Signal number %d is invalid for this system", make_int (signo)); +} + +/* + * Kill any process in the system given its PID. + * + * Returns zero if a signal successfully sent, or + * negative number upon failure + */ + +static int +unix_kill_process_by_pid (int pid, int sigcode) +{ + return kill (pid, sigcode); +} + +/* + * Return TTY name used to communicate with subprocess + */ + +static Lisp_Object +unix_get_tty_name (struct Lisp_Process *p) +{ + return UNIX_DATA (p)->tty_name; +} + +/* + * Canonicalize host name HOST, and return its canonical form + * + * The default implemenation just takes HOST for a canonical name. + */ + +#ifdef HAVE_SOCKETS +static Lisp_Object +unix_canonicalize_host_name (Lisp_Object host) +{ + struct sockaddr_in address; + + if (!get_internet_address (host, &address, ERROR_ME_NOT)) + return host; + + if (address.sin_family == AF_INET) + return build_string (inet_ntoa (address.sin_addr)); + else + /* #### any clue what to do here? */ + return host; +} + +/* open a TCP network connection to a given HOST/SERVICE. Treated + exactly like a normal process when reading and writing. Only + differences are in status display and process deletion. A network + connection has no PID; you cannot signal it. All you can do is + deactivate and close it via delete-process */ + +static void +unix_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object service, + Lisp_Object family, void** vinfd, void** voutfd) +{ + struct sockaddr_in address; + int s, inch, outch; + volatile int port; + volatile int retry = 0; + int retval; + + CHECK_STRING (host); + + if (!EQ (family, Qtcpip)) + error ("Unsupported protocol family \"%s\"", + string_data (symbol_name (XSYMBOL (family)))); + + if (INTP (service)) + port = htons ((unsigned short) XINT (service)); + else + { + struct servent *svc_info; + CHECK_STRING (service); + svc_info = getservbyname ((char *) XSTRING_DATA (service), "tcp"); + if (svc_info == 0) + error ("Unknown service \"%s\"", XSTRING_DATA (service)); + port = svc_info->s_port; + } + + get_internet_address (host, &address, ERROR_ME); + address.sin_port = port; + + s = socket (address.sin_family, SOCK_STREAM, 0); + if (s < 0) + report_file_error ("error creating socket", list1 (name)); + + /* Turn off interrupts here -- see comments below. There used to + be code which called bind_polling_period() to slow the polling + period down rather than turn it off, but that seems rather + bogus to me. Best thing here is to use a non-blocking connect + or something, to check for QUIT. */ + + /* Comments that are not quite valid: */ + + /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR) + when connect is interrupted. So let's not let it get interrupted. + Note we do not turn off polling, because polling is only used + when not interrupt_input, and thus not normally used on the systems + which have this bug. On systems which use polling, there's no way + to quit if polling is turned off. */ + + /* Slow down polling. Some kernels have a bug which causes retrying + connect to fail after a connect. */ + + slow_down_interrupts (); + + loop: + + /* A system call interrupted with a SIGALRM or SIGIO comes back + here, with can_break_system_calls reset to 0. */ + SETJMP (break_system_call_jump); + if (QUITP) + { + speed_up_interrupts (); + REALLY_QUIT; + /* In case something really weird happens ... */ + slow_down_interrupts (); + } + + /* Break out of connect with a signal (it isn't otherwise possible). + Thus you don't get screwed with a hung network. */ + can_break_system_calls = 1; + retval = connect (s, (struct sockaddr *) &address, sizeof (address)); + can_break_system_calls = 0; + if (retval == -1 && errno != EISCONN) + { + int xerrno = errno; + if (errno == EINTR) + goto loop; + if (errno == EADDRINUSE && retry < 20) + { + /* A delay here is needed on some FreeBSD systems, + and it is harmless, since this retrying takes time anyway + and should be infrequent. + `sleep-for' allowed for quitting this loop with interrupts + slowed down so it can't be used here. Async timers should + already be disabled at this point so we can use `sleep'. */ + sleep (1); + retry++; + goto loop; + } + + close (s); + + speed_up_interrupts (); + + errno = xerrno; + report_file_error ("connection failed", list2 (host, name)); + } + + speed_up_interrupts (); + + inch = s; + outch = dup (s); + if (outch < 0) + { + close (s); /* this used to be leaked; from Kyle Jones */ + report_file_error ("error duplicating socket", list1 (name)); + } + + set_socket_nonblocking_maybe (inch, port, "tcp"); + + *vinfd = (void*)inch; + *voutfd = (void*)outch; +} + + +#ifdef HAVE_MULTICAST + +/* Didier Verna <verna@inf.enst.fr> Nov. 28 1997. + + This function is similar to open-network-stream-internal, but provides a + mean to open an UDP multicast connection instead of a TCP one. Like in the + TCP case, the multicast connection will be seen as a sub-process, + + Some notes: + - Normaly, we should use sendto and recvfrom with non connected + sockets. The current code doesn't allow us to do this. In the future, it + would be a good idea to extend the process data structure in order to deal + properly with the different types network connections. + - For the same reason, when leaving a multicast group, it is better to make + a setsockopt - IP_DROP_MEMBERSHIP before closing the descriptors. + Unfortunately, this can't be done here because delete_process doesn't know + about the kind of connection we have. However, this is not such an + important issue. +*/ + +static void +unix_open_multicast_group (Lisp_Object name, Lisp_Object dest, Lisp_Object port, + Lisp_Object ttl, void** vinfd, void** voutfd) +{ + struct ip_mreq imr; + struct sockaddr_in sa; + struct protoent *udp; + int ws, rs; + int theport; + unsigned char thettl; + int one = 1; /* For REUSEADDR */ + int ret; + volatile int retry = 0; + + CHECK_STRING (dest); + + CHECK_NATNUM (port); + theport = htons ((unsigned short) XINT (port)); + + CHECK_NATNUM (ttl); + thettl = (unsigned char) XINT (ttl); + + if ((udp = getprotobyname ("udp")) == NULL) + error ("No info available for UDP protocol"); + + /* Init the sockets. Yes, I need 2 sockets. I couldn't duplicate one. */ + if ((rs = socket (PF_INET, SOCK_DGRAM, udp->p_proto)) < 0) + report_file_error ("error creating socket", list1(name)); + if ((ws = socket (PF_INET, SOCK_DGRAM, udp->p_proto)) < 0) + { + close (rs); + report_file_error ("error creating socket", list1(name)); + } + + /* This will be used for both sockets */ + bzero(&sa, sizeof(sa)); + sa.sin_family = AF_INET; + sa.sin_port = theport; + sa.sin_addr.s_addr = htonl (inet_addr ((char *) XSTRING_DATA (dest))); + + /* Socket configuration for reading ------------------------ */ + + /* Multiple connections from the same machine. This must be done before + bind. If it fails, it shouldn't be fatal. The only consequence is that + people won't be able to connect twice from the same machine. */ + if (setsockopt (rs, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof (one)) + < 0) + warn_when_safe (Qmulticast, Qwarning, "Cannot reuse socket address"); + + /* bind socket name */ + if (bind (rs, (struct sockaddr *)&sa, sizeof(sa))) + { + close (rs); + close (ws); + report_file_error ("error binding socket", list2(name, port)); + } + + /* join multicast group */ + imr.imr_multiaddr.s_addr = htonl (inet_addr ((char *) XSTRING_DATA (dest))); + imr.imr_interface.s_addr = htonl (INADDR_ANY); + if (setsockopt (rs, IPPROTO_IP, IP_ADD_MEMBERSHIP, + (char *) &imr, sizeof (struct ip_mreq)) < 0) + { + close (ws); + close (rs); + report_file_error ("error adding membership", list2(name, dest)); + } + + /* Socket configuration for writing ----------------------- */ + + /* Normaly, there's no 'connect' in multicast, since we use preferentialy + 'sendto' and 'recvfrom'. However, in order to handle this connection in + the process-like way it is done for TCP, we must be able to use 'write' + instead of 'sendto'. Consequently, we 'connect' this socket. */ + + /* See open-network-stream-internal for comments on this part of the code */ + slow_down_interrupts (); + + loop: + + /* A system call interrupted with a SIGALRM or SIGIO comes back + here, with can_break_system_calls reset to 0. */ + SETJMP (break_system_call_jump); + if (QUITP) + { + speed_up_interrupts (); + REALLY_QUIT; + /* In case something really weird happens ... */ + slow_down_interrupts (); + } + + /* Break out of connect with a signal (it isn't otherwise possible). + Thus you don't get screwed with a hung network. */ + can_break_system_calls = 1; + ret = connect (ws, (struct sockaddr *) &sa, sizeof (sa)); + can_break_system_calls = 0; + if (ret == -1 && errno != EISCONN) + { + int xerrno = errno; + + if (errno == EINTR) + goto loop; + if (errno == EADDRINUSE && retry < 20) + { + /* A delay here is needed on some FreeBSD systems, + and it is harmless, since this retrying takes time anyway + and should be infrequent. + `sleep-for' allowed for quitting this loop with interrupts + slowed down so it can't be used here. Async timers should + already be disabled at this point so we can use `sleep'. */ + sleep (1); + retry++; + goto loop; + } + + close (rs); + close (ws); + speed_up_interrupts (); + + errno = xerrno; + report_file_error ("error connecting socket", list2(name, port)); + } + + speed_up_interrupts (); + + /* scope */ + if (setsockopt (ws, IPPROTO_IP, IP_MULTICAST_TTL, + (char *) &thettl, sizeof (thettl)) < 0) + { + close (rs); + close (ws); + report_file_error ("error setting ttl", list2(name, ttl)); + } + + set_socket_nonblocking_maybe (rs, theport, "udp"); + + *vinfd = (void*)rs; + *voutfd = (void*)ws; +} + +#endif /* HAVE_MULTICAST */ + +#endif /* HAVE_SOCKETS */ + + +/**********************************************************************/ +/* Initialization */ +/**********************************************************************/ + +void +process_type_create_unix (void) +{ + PROCESS_HAS_METHOD (unix, alloc_process_data); + PROCESS_HAS_METHOD (unix, mark_process_data); +#ifdef SIGCHLD + PROCESS_HAS_METHOD (unix, init_process); + PROCESS_HAS_METHOD (unix, reap_exited_processes); +#endif + PROCESS_HAS_METHOD (unix, init_process_io_handles); + PROCESS_HAS_METHOD (unix, create_process); + PROCESS_HAS_METHOD (unix, tooltalk_connection_p); + PROCESS_HAS_METHOD (unix, set_window_size); +#ifdef HAVE_WAITPID + PROCESS_HAS_METHOD (unix, update_status_if_terminated); +#endif + PROCESS_HAS_METHOD (unix, send_process); + PROCESS_HAS_METHOD (unix, process_send_eof); + PROCESS_HAS_METHOD (unix, deactivate_process); + PROCESS_HAS_METHOD (unix, kill_child_process); + PROCESS_HAS_METHOD (unix, kill_process_by_pid); + PROCESS_HAS_METHOD (unix, get_tty_name); +#ifdef HAVE_SOCKETS + PROCESS_HAS_METHOD (unix, canonicalize_host_name); + PROCESS_HAS_METHOD (unix, open_network_stream); +#ifdef HAVE_MULTICAST + PROCESS_HAS_METHOD (unix, open_multicast_group); +#endif +#endif +} + +void +vars_of_process_unix (void) +{ + Fprovide (intern ("unix-processes")); +} + +#endif /* !defined (NO_SUBPROCESSES) */
--- a/src/process.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/process.c Mon Aug 13 10:24:41 2007 +0200 @@ -21,11 +21,13 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Synched up with: Mule 2.0, FSF 19.30. */ - /* This file has been Mule-ized except for `start-process-internal', `open-network-stream-internal' and `open-multicast-group-internal'. */ +/* This file has been split into process.c and process-unix.c by + Kirill M. Katsnelson <kkm@kis.ru>, so please bash him and not + the original author(s) */ + #include <config.h> #if !defined (NO_SUBPROCESSES) @@ -38,25 +40,30 @@ #include "commands.h" #include "events.h" #include "frame.h" +#include "hash.h" #include "insdel.h" #include "lstream.h" #include "opaque.h" #include "process.h" +#include "procimpl.h" #include "sysdep.h" #include "window.h" #ifdef FILE_CODING #include "file-coding.h" #endif -#include <setjmp.h> #include "sysfile.h" #include "sysproc.h" #include "systime.h" #include "syssignal.h" /* Always include before systty.h */ - #include "systty.h" #include "syswait.h" +Lisp_Object Qprocessp; + +/* Process methods */ +struct process_methods the_process_methods; + /* a process object is a network connection when its pid field a cons (name of name of port we are connected to . foreign host name) */ @@ -64,6 +71,8 @@ Lisp_Object Qrun, Qstop; /* Qexit from eval.c, Qsignal from data.c. */ /* Qrun => Qopen, Qexit => Qclosed for "network connection" processes */ Lisp_Object Qopen, Qclosed; +/* Protocol families */ +Lisp_Object Qtcpip; #ifdef HAVE_MULTICAST Lisp_Object Qmulticast; /* Will be used for occasional warnings */ @@ -71,20 +80,16 @@ /* t means use pty, nil means use a pipe, maybe other values to come. */ -static Lisp_Object Vprocess_connection_type; +Lisp_Object Vprocess_connection_type; #ifdef PROCESS_IO_BLOCKING /* List of port numbers or port names to set a blocking I/O mode. Nil means set a non-blocking I/O mode [default]. */ -static Lisp_Object network_stream_blocking_port_list; +Lisp_Object network_stream_blocking_port_list; #endif /* PROCESS_IO_BLOCKING */ -/* FSFmacs says: - - These next two vars are non-static since sysdep.c uses them in the - emulation of `select'. */ /* Number of events of change of status of a process. */ -static volatile int process_tick; +volatile int process_tick; /* Number of events for which the user or sentinel has been notified. */ static int update_tick; @@ -92,114 +97,14 @@ /* Nonzero means delete a process right away if it exits. */ int delete_exited_processes; -/* Indexed by descriptor, gives the process (if any) for that descriptor */ -Lisp_Object descriptor_to_process[MAXDESC]; +/* Hashtable which maps USIDs as returned by create_stream_pair_cb to + process objects. Processes are not GC-protected through this! */ +c_hashtable usid_to_process; /* List of process objects. */ Lisp_Object Vprocess_list; -Lisp_Object Qprocessp; - -/* Buffered-ahead input char from process, indexed by channel. - -1 means empty (no char is buffered). - Used on sys V where the only way to tell if there is any - output from the process is to read at least one char. - Always -1 on systems that support FIONREAD. */ - -#if 0 /* FSFmacs */ -/* FSFmacs says: - Don't make static; need to access externally. */ -static int proc_buffered_char[MAXDESC]; -#endif - -#ifdef HAVE_PTYS -/* The file name of the pty opened by allocate_pty. */ - -static char pty_name[24]; -#endif - -/************************************************************************/ -/* the process Lisp object */ -/************************************************************************/ - -/* - * Structure records pertinent information about open channels. - * There is one channel associated with each process. - */ - -struct Lisp_Process -{ - struct lcrecord_header header; - /* Name of this process */ - Lisp_Object name; - /* List of command arguments that this process was run with */ - Lisp_Object command; - /* (funcall FILTER PROC STRING) (if FILTER is non-nil) - to dispose of a bunch of chars from the process all at once */ - Lisp_Object filter; - /* (funcall SENTINEL PROCESS) when process state changes */ - Lisp_Object sentinel; - /* Buffer that output is going to */ - Lisp_Object buffer; - /* Marker set to end of last buffer-inserted output from this process */ - Lisp_Object mark; - /* Lisp_Int of subprocess' PID, or a cons of - service/host if this is really a network connection */ - Lisp_Object pid; - /* Non-0 if this is really a ToolTalk channel. */ - int connected_via_filedesc_p; -#if 0 /* FSFmacs */ - /* Perhaps it's cleaner this way, but FSFmacs - provides no way of retrieving this value, so I'll - leave this info with PID. */ - /* Non-nil if this is really a child process */ - Lisp_Object childp; -#endif - - /* Symbol indicating status of process. - This may be a symbol: run, stop, exit, signal */ - Lisp_Object status_symbol; - - - /* Exit code if process has terminated, - signal which stopped/interrupted process - or 0 if process is running */ - int exit_code; - /* Number of this process */ - /* Non-false if process has exited and "dumped core" on its way down */ - char core_dumped; - /* Descriptor by which we read from this process. -1 for dead process */ - int infd; - /* Descriptor by which we write to this process. -1 for dead process */ - int outfd; - /* Descriptor for the tty which this process is using. - -1 if we didn't record it (on some systems, there's no need). */ - int subtty; - /* Name of subprocess terminal. */ - Lisp_Object tty_name; - /* Non-false if communicating through a pty. */ - char pty_flag; - /* This next field is only actually used #ifdef ENERGIZE */ - /* if this flag is not NIL, then filter will do the read on the - channel, rather than having a call to make_string. - This only works if the filter is a subr. */ - char filter_does_read; - /* Non-nil means kill silently if Emacs is exited. */ - char kill_without_query; - char selected; - /* Event-count of last event in which this process changed status. */ - volatile int tick; - /* Event-count of last such event reported. */ - int update_tick; - /* streams used in input and output */ - Lisp_Object instream; - Lisp_Object outstream; - /* The actual filedesc stream used for output; may be different - than OUTSTREAM under Mule */ - Lisp_Object filedesc_stream; -}; - static Lisp_Object mark_process (Lisp_Object, void (*) (Lisp_Object)); static void print_process (Lisp_Object, Lisp_Object, int); static void finalize_process (void *, int); @@ -211,6 +116,7 @@ mark_process (Lisp_Object obj, void (*markobj) (Lisp_Object)) { struct Lisp_Process *proc = XPROCESS (obj); + MAYBE_PROCMETH (mark_process_data, (proc, markobj)); ((markobj) (proc->name)); ((markobj) (proc->command)); ((markobj) (proc->filter)); @@ -218,10 +124,12 @@ ((markobj) (proc->buffer)); ((markobj) (proc->mark)); ((markobj) (proc->pid)); - ((markobj) (proc->tty_name)); - ((markobj) (proc->instream)); - ((markobj) (proc->outstream)); - ((markobj) (proc->filedesc_stream)); + ((markobj) (proc->pipe_instream)); + ((markobj) (proc->pipe_outstream)); +#ifdef FILE_CODING + ((markobj) (proc->coding_instream)); + ((markobj) (proc->coding_outstream)); +#endif return proc->status_symbol; } @@ -248,6 +156,7 @@ print_internal (proc->pid, printcharfun, 1); write_c_string (" state:", printcharfun); print_internal (proc->status_symbol, printcharfun, 1); + MAYBE_PROCMETH (print_process_data, (proc, printcharfun)); write_c_string (">", printcharfun); } } @@ -259,15 +168,22 @@ static void finalize_process (void *header, int for_disksave) { - if (for_disksave) return; /* hmm, what would this do anyway? */ /* #### this probably needs to be tied into the tty event loop */ /* #### when there is one */ + struct Lisp_Process *p = (struct Lisp_Process *) header; #ifdef HAVE_WINDOW_SYSTEM - { - struct Lisp_Process *p = (struct Lisp_Process *) header; - debug_process_finalization (p); - } + if (!for_disksave) + { + debug_process_finalization (p); + } #endif /* HAVE_WINDOW_SYSTEM */ + + if (p->process_data) + { + MAYBE_PROCMETH (finalize_process_data, (p, for_disksave)); + if (!for_disksave) + xfree (p->process_data); + } } @@ -275,78 +191,35 @@ /* basic process accessors */ /************************************************************************/ -static SIGTYPE -close_safely_handler (int signo) -{ - EMACS_REESTABLISH_SIGNAL (signo, close_safely_handler); - SIGRETURN; -} - -static void -close_safely (int fd) -{ - stop_interrupts (); - signal (SIGALRM, close_safely_handler); - alarm (1); - close (fd); - alarm (0); - start_interrupts (); -} - -static void -close_descriptor_pair (int in, int out) +/* Under FILE_CODING, this function returns low-level streams, connected + directrly to the child process, rather than en/decoding FILE_CODING + streams */ +void +get_process_streams (struct Lisp_Process *p, + Lisp_Object *instr, Lisp_Object *outstr) { - if (in >= 0) - close (in); - if (out != in && out >= 0) - close (out); -} - -/* Close all descriptors currently in use for communication - with subprocess. This is used in a newly-forked subprocess - to get rid of irrelevant descriptors. */ - -void -close_process_descs (void) -{ -#ifndef WINDOWSNT - int i; - for (i = 0; i < MAXDESC; i++) - { - Lisp_Object process; - process = descriptor_to_process[i]; - if (!NILP (process)) - { - close_descriptor_pair (XPROCESS (process)->infd, - XPROCESS (process)->outfd); - } - } -#endif -} - -void -get_process_file_descriptors (struct Lisp_Process *p, int *infd, - int *outfd) -{ - if (! p) abort (); - /* the cast of MAXDESC is needed for some versions of Linux */ - assert (p->infd >= -1 && p->infd < ((int) (MAXDESC))); - assert (p->outfd >= -1 && p->outfd < ((int) (MAXDESC))); - *infd = p->infd; - *outfd = p->outfd; + assert (p); + assert (NILP (p->pipe_instream) || LSTREAMP(p->pipe_instream)); + assert (NILP (p->pipe_outstream) || LSTREAMP(p->pipe_outstream)); + *instr = p->pipe_instream; + *outstr = p->pipe_outstream; } struct Lisp_Process * -get_process_from_input_descriptor (int infd) +get_process_from_usid (USID usid) { - Lisp_Object proc; + CONST void *vval; + + assert (usid != USID_ERROR && usid != USID_DONTHASH); - if ((infd < 0) || (infd >= ((int) (MAXDESC)))) abort (); - proc = descriptor_to_process[infd]; - if (NILP (proc)) + if (gethash ((CONST void*)usid, usid_to_process, &vval)) + { + Lisp_Object proc; + CVOID_TO_LISP (proc, vval); + return XPROCESS (proc); + } + else return 0; - else - return XPROCESS (proc); } int @@ -361,6 +234,12 @@ p->selected = !!selected_p; } +int +connected_via_filedesc_p (struct Lisp_Process *p) +{ + return MAYBE_INT_PROCMETH (tooltalk_connection_p, (p)); +} + #ifdef HAVE_SOCKETS int network_connection_p (Lisp_Object process) @@ -369,12 +248,6 @@ } #endif -int -connected_via_filedesc_p (struct Lisp_Process *p) -{ - return p->connected_via_filedesc_p; -} - DEFUN ("processp", Fprocessp, 1, 1, 0, /* Return t if OBJECT is a process. */ @@ -483,7 +356,9 @@ } else { - /* fsf: CHECK_PROCESS (obj, 0); */ + /* #### This was commented out. Although, simple + (kill-process 7 "qqq") resulted in a falat error. - kkm */ + CHECK_PROCESS (obj); proc = obj; } return proc; @@ -535,7 +410,7 @@ /* creating a process */ /************************************************************************/ -static Lisp_Object +Lisp_Object make_process_internal (Lisp_Object name) { Lisp_Object val, name1; @@ -564,21 +439,22 @@ p->mark = Fmake_marker (); p->pid = Qnil; p->status_symbol = Qrun; - p->connected_via_filedesc_p = 0; p->exit_code = 0; p->core_dumped = 0; - p->infd = -1; - p->outfd = -1; - p->subtty = -1; - p->tty_name = Qnil; - p->pty_flag = 0; p->filter_does_read = 0; p->kill_without_query = 0; p->selected = 0; p->tick = 0; p->update_tick = 0; - p->instream = Qnil; - p->outstream = Qnil; + p->pipe_instream = Qnil; + p->pipe_outstream = Qnil; +#ifdef FILE_CODING + p->coding_instream = Qnil; + p->coding_outstream = Qnil; +#endif + + p->process_data = 0; + MAYBE_PROCMETH (alloc_process_data, (p)); XSETPROCESS (val, p); @@ -586,506 +462,55 @@ return val; } -#ifdef HAVE_PTYS - -/* Open an available pty, returning a file descriptor. - Return -1 on failure. - The file name of the terminal corresponding to the pty - is left in the variable pty_name. */ - -static int -allocate_pty (void) +void +init_process_io_handles (struct Lisp_Process *p, void* in, void* out, int flags) { - struct stat stb; - int c, i; - int fd; - - /* Some systems name their pseudoterminals so that there are gaps in - the usual sequence - for example, on HP9000/S700 systems, there - are no pseudoterminals with names ending in 'f'. So we wait for - three failures in a row before deciding that we've reached the - end of the ptys. */ - int failed_count = 0; - -#ifdef PTY_ITERATION - PTY_ITERATION -#else - for (c = FIRST_PTY_LETTER; c <= 'z'; c++) - for (i = 0; i < 16; i++) -#endif - { -#ifdef PTY_NAME_SPRINTF - PTY_NAME_SPRINTF -#else - sprintf (pty_name, "/dev/pty%c%x", c, i); -#endif /* no PTY_NAME_SPRINTF */ - -#ifdef PTY_OPEN - PTY_OPEN; -#else /* no PTY_OPEN */ -#ifdef IRIS - /* Unusual IRIS code */ - *ptyv = open ("/dev/ptc", O_RDWR | O_NDELAY | OPEN_BINARY, 0); - if (fd < 0) - return -1; - if (fstat (fd, &stb) < 0) - return -1; -#else /* not IRIS */ - if (stat (pty_name, &stb) < 0) - { - failed_count++; - if (failed_count >= 3) - return -1; - } - else - failed_count = 0; -#ifdef O_NONBLOCK - fd = open (pty_name, O_RDWR | O_NONBLOCK | OPEN_BINARY, 0); -#else - fd = open (pty_name, O_RDWR | O_NDELAY | OPEN_BINARY, 0); -#endif -#endif /* not IRIS */ -#endif /* no PTY_OPEN */ - - if (fd >= 0) - { - /* check to make certain that both sides are available - this avoids a nasty yet stupid bug in rlogins */ -#ifdef PTY_TTY_NAME_SPRINTF - PTY_TTY_NAME_SPRINTF -#else - sprintf (pty_name, "/dev/tty%c%x", c, i); -#endif /* no PTY_TTY_NAME_SPRINTF */ -#ifndef UNIPLUS - if (access (pty_name, 6) != 0) - { - close (fd); -#if !defined(IRIS) && !defined(__sgi) - continue; -#else - return -1; -#endif /* IRIS */ - } -#endif /* not UNIPLUS */ - setup_pty (fd); - return fd; - } - } - return -1; -} -#endif /* HAVE_PTYS */ - -static int -create_bidirectional_pipe (int *inchannel, int *outchannel, - volatile int *forkin, volatile int *forkout) -{ - int sv[2]; + USID usid = event_stream_create_stream_pair (in, out, + &p->pipe_instream, &p->pipe_outstream, + flags); -#ifdef SKTPAIR - if (socketpair (AF_UNIX, SOCK_STREAM, 0, sv) < 0) - return -1; - *outchannel = *inchannel = sv[0]; - *forkout = *forkin = sv[1]; -#else /* not SKTPAIR */ - int temp; - temp = pipe (sv); - if (temp < 0) return -1; - *inchannel = sv[0]; - *forkout = sv[1]; - temp = pipe (sv); - if (temp < 0) return -1; - *outchannel = sv[1]; - *forkin = sv[0]; -#endif /* not SKTPAIR */ - return 0; -} - - -static Bufbyte -get_eof_char (struct Lisp_Process *p) -{ - /* Figure out the eof character for the outfd of the given process. - * The following code is similar to that in process_send_signal, and - * should probably be merged with that code somehow. */ - - CONST Bufbyte ctrl_d = (Bufbyte) '\004'; - - if (!isatty (p->outfd)) - return ctrl_d; -#ifdef HAVE_TERMIOS - { - struct termios t; - tcgetattr (p->outfd, &t); -#if 0 - /* What is the following line designed to do??? -mrb */ - if (strlen ((CONST char *) t.c_cc) < (unsigned int) (VEOF + 1)) - return ctrl_d; - else - return (Bufbyte) t.c_cc[VEOF]; -#endif - return t.c_cc[VEOF] == CDISABLE ? ctrl_d : (Bufbyte) t.c_cc[VEOF]; - } -#else /* ! HAVE_TERMIOS */ - /* On Berkeley descendants, the following IOCTL's retrieve the - current control characters. */ -#if defined (TIOCGETC) - { - struct tchars c; - ioctl (p->outfd, TIOCGETC, &c); - return (Bufbyte) c.t_eofc; - } -#else /* ! defined (TIOCGLTC) && defined (TIOCGETC) */ - /* On SYSV descendants, the TCGETA ioctl retrieves the current control - characters. */ -#ifdef TCGETA - { - struct termio t; - ioctl (p->outfd, TCGETA, &t); - if (strlen ((CONST char *) t.c_cc) < (unsigned int) (VINTR + 1)) - return ctrl_d; - else - return (Bufbyte) t.c_cc[VINTR]; - } -#else /* ! defined (TCGETA) */ - /* Rather than complain, we'll just guess ^D, which is what - * earlier emacsen always used. */ - return ctrl_d; -#endif /* ! defined (TCGETA) */ -#endif /* ! defined (TIOCGETC) */ -#endif /* ! defined (HAVE_TERMIOS) */ -} - -static int -get_pty_max_bytes (struct Lisp_Process *p) -{ - int pty_max_bytes; - -#if defined (HAVE_FPATHCONF) && defined (_PC_MAX_CANON) - pty_max_bytes = fpathconf (p->outfd, _PC_MAX_CANON); - if (pty_max_bytes < 0) - pty_max_bytes = 250; -#else - pty_max_bytes = 250; -#endif - /* Deduct one, to leave space for the eof. */ - pty_max_bytes--; - - return pty_max_bytes; -} - -static void -init_process_fds (struct Lisp_Process *p, int in, int out) -{ - p->infd = in; - p->outfd = out; - p->instream = make_filedesc_input_stream (in, 0, -1, 0); - p->outstream = make_filedesc_output_stream (out, 0, -1, - LSTR_BLOCKED_OK - | (p->pty_flag ? - LSTR_PTY_FLUSHING : 0)); - p->filedesc_stream = p->outstream; - if (p->pty_flag) + if (usid == USID_ERROR) + report_file_error ("Setting up communication with subprocess", Qnil); + + if (usid != USID_DONTHASH) { - Bufbyte eof_char = get_eof_char (p); - int pty_max_bytes = get_pty_max_bytes (p); - filedesc_stream_set_pty_flushing (XLSTREAM (p->outstream), - pty_max_bytes, eof_char); + Lisp_Object proc = Qnil; + XSETPROCESS (proc, p); + puthash ((CONST void*)usid, LISP_TO_VOID (proc), usid_to_process); } -#ifdef FILE_CODING + MAYBE_PROCMETH (init_process_io_handles, (p, in, out, flags)); - p->instream = make_decoding_input_stream - (XLSTREAM (p->instream), +#ifdef FILE_CODING + p->coding_instream = make_decoding_input_stream + (XLSTREAM (p->pipe_instream), Fget_coding_system (Vcoding_system_for_read)); - Lstream_set_character_mode (XLSTREAM (p->instream)); - p->outstream = make_encoding_output_stream - (XLSTREAM (p->outstream), + Lstream_set_character_mode (XLSTREAM (p->coding_instream)); + p->coding_outstream = make_encoding_output_stream + (XLSTREAM (p->pipe_outstream), Fget_coding_system (Vcoding_system_for_write)); /* CODE_CNTL (&out_state[outchannel]) |= CC_END; !!#### What's going on here? */ -#endif +#endif /* FILE_CODING */ } static void create_process (Lisp_Object process, char **new_argv, CONST char *current_dir) { - /* This function rewritten by wing@666.com. */ - - int pid, inchannel, outchannel; - /* Use volatile to protect variables from being clobbered by longjmp. */ - volatile int forkin, forkout; - volatile int pty_flag = 0; - char **env; struct Lisp_Process *p = XPROCESS (process); - - env = environ; - - inchannel = outchannel = forkin = forkout = -1; - -#ifdef HAVE_PTYS - if (!NILP (Vprocess_connection_type)) - { - /* find a new pty, open the master side, return the opened - file handle, and store the name of the corresponding slave - side in global variable pty_name. */ - outchannel = inchannel = allocate_pty (); - } + int pid; - if (inchannel >= 0) - { - /* You're "supposed" to now open the slave in the child. - On some systems, we can open it here; this allows for - better error checking. */ -#if !defined(USG) - /* On USG systems it does not work to open the pty's tty here - and then close and reopen it in the child. */ -#ifdef O_NOCTTY - /* Don't let this terminal become our controlling terminal - (in case we don't have one). */ - forkout = forkin = open (pty_name, O_RDWR | O_NOCTTY | OPEN_BINARY, 0); -#else - forkout = forkin = open (pty_name, O_RDWR | OPEN_BINARY, 0); -#endif - if (forkin < 0) - goto io_failure; -#endif /* not USG */ - p->pty_flag = pty_flag = 1; - } - else -#endif /* HAVE_PTYS */ - if (create_bidirectional_pipe (&inchannel, &outchannel, - &forkin, &forkout) < 0) - goto io_failure; - -#if 0 - /* Replaced by close_process_descs */ - set_exclusive_use (inchannel); - set_exclusive_use (outchannel); -#endif - - set_descriptor_non_blocking (inchannel); - - /* Record this as an active process, with its channels. - As a result, child_setup will close Emacs's side of the pipes. */ - descriptor_to_process[inchannel] = process; - init_process_fds (p, inchannel, outchannel); - /* Record the tty descriptor used in the subprocess. */ - p->subtty = forkin; + /* *_create_process may change status_symbol, if the process + is a kind of "fire-and-forget" (no I/O, unwaitable) */ p->status_symbol = Qrun; p->exit_code = 0; - { -#if !defined(__CYGWIN32__) - /* child_setup must clobber environ on systems with true vfork. - Protect it from permanent change. */ - char **save_environ = environ; -#endif - -#ifdef EMACS_BTL - /* when performance monitoring is on, turn it off before the vfork(), - as the child has no handler for the signal -- when back in the - parent process, turn it back on if it was really on when you "turned - it off" */ - int logging_on = cadillac_stop_logging (); /* #### rename me */ -#endif - -#ifndef WINDOWSNT - pid = fork (); - if (pid == 0) -#endif /* not WINDOWSNT */ - { - /**** Now we're in the child process ****/ - int xforkin = forkin; - int xforkout = forkout; - - if (!pty_flag) - EMACS_SEPARATE_PROCESS_GROUP (); -#ifdef HAVE_PTYS - else - { - /* Disconnect the current controlling terminal, pursuant to - making the pty be the controlling terminal of the process. - Also put us in our own process group. */ - - disconnect_controlling_terminal (); - - /* Open the pty connection and make the pty's terminal - our controlling terminal. - - On systems with TIOCSCTTY, we just use it to set - the controlling terminal. On other systems, the - first TTY we open becomes the controlling terminal. - So, we end up with four possibilities: - - (1) on USG and TIOCSCTTY systems, we open the pty - and use TIOCSCTTY. - (2) on other USG systems, we just open the pty. - (3) on non-USG systems with TIOCSCTTY, we - just use TIOCSCTTY. (On non-USG systems, we - already opened the pty in the parent process.) - (4) on non-USG systems without TIOCSCTTY, we - close the pty and reopen it. - - This would be cleaner if we didn't open the pty - in the parent process, but doing it that way - makes it possible to trap error conditions. - It's harder to convey an error from the child - process, and I don't feel like messing with - this now. */ - - /* There was some weirdo, probably wrong, - conditionalization on RTU and UNIPLUS here. - I deleted it. So sue me. */ - - /* SunOS has TIOCSCTTY but the close/open method - also works. */ - -# if defined (USG) || !defined (TIOCSCTTY) - /* Now close the pty (if we had it open) and reopen it. - This makes the pty the controlling terminal of the - subprocess. */ - /* I wonder if close (open (pty_name, ...)) would work? */ - if (xforkin >= 0) - close (xforkin); - xforkout = xforkin = open (pty_name, O_RDWR | OPEN_BINARY, 0); - if (xforkin < 0) - { - write (1, "Couldn't open the pty terminal ", 31); - write (1, pty_name, strlen (pty_name)); - write (1, "\n", 1); - _exit (1); - } -# endif /* USG or not TIOCSCTTY */ - - /* Miscellaneous setup required for some systems. - Must be done before using tc* functions on xforkin. - This guarantees that isatty(xforkin) is true. */ - -# ifdef SETUP_SLAVE_PTY - SETUP_SLAVE_PTY; -# endif /* SETUP_SLAVE_PTY */ - -# ifdef TIOCSCTTY - /* We ignore the return value - because faith@cs.unc.edu says that is necessary on Linux. */ - assert (isatty (xforkin)); - ioctl (xforkin, TIOCSCTTY, 0); -# endif /* TIOCSCTTY */ - - /* Change the line discipline. */ - -# if defined (HAVE_TERMIOS) && defined (LDISC1) - { - struct termios t; - assert (isatty (xforkin)); - tcgetattr (xforkin, &t); - t.c_lflag = LDISC1; - if (tcsetattr (xforkin, TCSANOW, &t) < 0) - perror ("create_process/tcsetattr LDISC1 failed\n"); - } -# elif defined (NTTYDISC) && defined (TIOCSETD) - { - /* Use new line discipline. TIOCSETD is accepted and - ignored on Sys5.4 systems with ttcompat. */ - int ldisc = NTTYDISC; - assert (isatty (xforkin)); - ioctl (xforkin, TIOCSETD, &ldisc); - } -# endif /* TIOCSETD & NTTYDISC */ - - /* Make our process group be the foreground group - of our new controlling terminal. */ - - { - int piddly = EMACS_GET_PROCESS_GROUP (); - EMACS_SET_TTY_PROCESS_GROUP (xforkin, &piddly); - } - -# ifdef AIX - /* On AIX, we've disabled SIGHUP above once we start a - child on a pty. Now reenable it in the child, so it - will die when we want it to. */ - signal (SIGHUP, SIG_DFL); -# endif /* AIX */ - } -#endif /* HAVE_PTYS */ - - signal (SIGINT, SIG_DFL); - signal (SIGQUIT, SIG_DFL); - -#if !defined(MSDOS) && !defined(WINDOWSNT) - if (pty_flag) - { - /* Set up the terminal characteristics of the pty. */ - child_setup_tty (xforkout); - } - -#ifdef WINDOWSNT - pid = child_setup (xforkin, xforkout, xforkout, - new_argv, current_dir); -#else /* not WINDOWSNT */ - child_setup (xforkin, xforkout, xforkout, new_argv, current_dir); -#endif /* not WINDOWSNT */ -#endif /* not MSDOS */ - } -#ifdef EMACS_BTL - else if (logging_on) - cadillac_start_logging (); /* #### rename me */ -#endif - -#if !defined(__CYGWIN32__) - environ = save_environ; -#endif - } - - if (pid < 0) - { - close_descriptor_pair (forkin, forkout); - report_file_error ("Doing fork", Qnil); - } + pid = PROCMETH (create_process, (p, new_argv, current_dir)); p->pid = make_int (pid); - /* #### dmoore - why is this commented out, otherwise we leave - subtty = forkin, but then we close forkin just below. */ - /* p->subtty = -1; */ - -#ifdef WINDOWSNT - register_child (pid, inchannel); -#endif /* WINDOWSNT */ - - /* If the subfork execv fails, and it exits, - this close hangs. I don't know why. - So have an interrupt jar it loose. */ - if (forkin >= 0) - close_safely (forkin); - if (forkin != forkout && forkout >= 0) - close (forkout); - -#ifdef HAVE_PTYS - if (pty_flag) - XPROCESS (process)->tty_name = build_string (pty_name); - else -#endif - XPROCESS (process)->tty_name = Qnil; - - /* Notice that SIGCHLD was not blocked. (This is not possible on - some systems.) No biggie if SIGCHLD occurs right around the - time that this call happens, because SIGCHLD() does not actually - deselect the process (that doesn't occur until the next time - we're waiting for an event, when status_notify() is called). */ - event_stream_select_process (XPROCESS (process)); - - return; - -io_failure: - { - int temp = errno; - close_descriptor_pair (forkin, forkout); - close_descriptor_pair (inchannel, outchannel); - errno = temp; - report_file_error ("Opening pty or pipe", Qnil); - } + if (!NILP(p->pipe_instream)) + event_stream_select_process (p); } /* This function is the unwind_protect form for Fstart_process_internal. If @@ -1217,117 +642,27 @@ } -/* connect to an existing file descriptor. This is very similar to - open-network-stream except that it assumes that the connection has - already been initialized. It is currently used for ToolTalk - communication. */ - -/* This function used to be visible on the Lisp level, but there is no - real point in doing that. Here is the doc string: - - "Connect to an existing file descriptor.\n\ -Returns a subprocess-object to represent the connection.\n\ -Input and output work as for subprocesses; `delete-process' closes it.\n\ -Args are NAME BUFFER INFD OUTFD.\n\ -NAME is name for process. It is modified if necessary to make it unique.\n\ -BUFFER is the buffer (or buffer-name) to associate with the process.\n\ - Process output goes at end of that buffer, unless you specify\n\ - an output stream or filter function to handle the output.\n\ - BUFFER may be also nil, meaning that this process is not associated\n\ - with any buffer\n\ -INFD and OUTFD specify the file descriptors to use for input and\n\ - output, respectively." -*/ - -Lisp_Object -connect_to_file_descriptor (Lisp_Object name, Lisp_Object buffer, - Lisp_Object infd, Lisp_Object outfd) -{ - /* This function can GC */ - Lisp_Object proc; - int inch; - - CHECK_STRING (name); - CHECK_INT (infd); - CHECK_INT (outfd); - - inch = XINT (infd); - if (!NILP (descriptor_to_process[inch])) - error ("There is already a process connected to fd %d", inch); - if (!NILP (buffer)) - buffer = Fget_buffer_create (buffer); - proc = make_process_internal (name); - - descriptor_to_process[inch] = proc; - - XPROCESS (proc)->pid = Fcons (infd, name); - XPROCESS (proc)->buffer = buffer; - init_process_fds (XPROCESS (proc), inch, XINT (outfd)); - XPROCESS (proc)->connected_via_filedesc_p = 1; - - event_stream_select_process (XPROCESS (proc)); - - return proc; -} - - #ifdef HAVE_SOCKETS -static int -get_internet_address (Lisp_Object host, struct sockaddr_in *address, - Error_behavior errb) -{ - struct hostent *host_info_ptr = NULL; -#ifdef TRY_AGAIN - int count = 0; -#endif - memset (address, 0, sizeof (*address)); +/* #### The network support is fairly synthetical. What we actually + need is a single function, which supports all datagram, stream and + packet stream connections, arbitrary protocol families should they + be supported by the target system, multicast groups, in both data + and control rooted/nonrooted flavors, service quality etc whatever + is supported by the underlying network. - while (1) - { -#ifdef TRY_AGAIN - if (count++ > 10) break; -#ifndef BROKEN_CYGWIN - h_errno = 0; -#endif -#endif - /* Some systems can't handle SIGIO/SIGALARM in gethostbyname. */ - slow_down_interrupts (); - host_info_ptr = gethostbyname ((char *) XSTRING_DATA (host)); - speed_up_interrupts (); -#ifdef TRY_AGAIN - if (! (host_info_ptr == 0 && h_errno == TRY_AGAIN)) -#endif - break; - Fsleep_for (make_int (1)); - } - if (host_info_ptr) - { - address->sin_family = host_info_ptr->h_addrtype; - memcpy (&address->sin_addr, host_info_ptr->h_addr, host_info_ptr->h_length); - } - else - { - IN_ADDR numeric_addr; - /* Attempt to interpret host as numeric inet address */ - numeric_addr = inet_addr ((char *) XSTRING_DATA (host)); - if (NUMERIC_ADDR_ERROR) - { - maybe_error (Qprocess, errb, - "Unknown host \"%s\"", XSTRING_DATA (host)); - return 0; - } + It must accept a property list describing the connection. The current + functions must then go to lisp and provide a suitable list for the + generalized connection function. - /* There was some broken code here that called strlen() here - on (char *) &numeric_addr and even sometimes accessed - uninitialized data. */ - address->sin_family = AF_INET; - * (IN_ADDR *) &address->sin_addr = numeric_addr; - } + Both UNIX ans Win32 support BSD sockets, and there are many extensions + availalble (Sockets 2 spec). - return 1; -} + A todo is define a consistent set of properties abstracting a + network connection. -kkm +*/ + /* open a TCP network connection to a given HOST/SERVICE. Treated exactly like a normal process when reading and writing. Only @@ -1335,7 +670,7 @@ connection has no PID; you cannot signal it. All you can do is deactivate and close it via delete-process */ -DEFUN ("open-network-stream-internal", Fopen_network_stream_internal, 4, 4, 0, /* +DEFUN ("open-network-stream-internal", Fopen_network_stream_internal, 4, 5, 0, /* Open a TCP connection for a service to a host. Returns a subprocess-object to represent the connection. Input and output work as for subprocesses; `delete-process' closes it. @@ -1349,186 +684,48 @@ Third arg is name of the host to connect to, or its IP address. Fourth arg SERVICE is name of the service desired, or an integer specifying a port number to connect to. +Fifth argument FAMILY is a protocol family. When omitted, 'tcp/ip +(Internet protocol family TCP/IP) is assumed. */ - (name, buffer, host, service)) + (name, buffer, host, service, family)) { /* !!#### This function has not been Mule-ized */ /* This function can GC */ - Lisp_Object proc; - struct sockaddr_in address; - int s, outch, inch; - volatile int port; - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; - volatile int retry = 0; - int retval; + Lisp_Object proc = Qnil; + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, ngcpro1; + void *inch, *outch; - GCPRO4 (name, buffer, host, service); + GCPRO5 (name, buffer, host, service, family); CHECK_STRING (name); - CHECK_STRING (host); - if (INTP (service)) - port = htons ((unsigned short) XINT (service)); - else - { - struct servent *svc_info; - CHECK_STRING (service); - svc_info = getservbyname ((char *) XSTRING_DATA (service), "tcp"); - if (svc_info == 0) -#ifdef WIN32 - error ("Unknown service \"%s\" (%d)", - XSTRING_DATA (service), WSAGetLastError ()); -#else - error ("Unknown service \"%s\"", XSTRING_DATA (service)); -#endif - port = svc_info->s_port; - } - - get_internet_address (host, &address, ERROR_ME); - address.sin_port = port; - - s = socket (address.sin_family, SOCK_STREAM, 0); - if (s < 0) - report_file_error ("error creating socket", list1 (name)); - - /* Turn off interrupts here -- see comments below. There used to - be code which called bind_polling_period() to slow the polling - period down rather than turn it off, but that seems rather - bogus to me. Best thing here is to use a non-blocking connect - or something, to check for QUIT. */ - - /* Comments that are not quite valid: */ - - /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR) - when connect is interrupted. So let's not let it get interrupted. - Note we do not turn off polling, because polling is only used - when not interrupt_input, and thus not normally used on the systems - which have this bug. On systems which use polling, there's no way - to quit if polling is turned off. */ - - /* Slow down polling. Some kernels have a bug which causes retrying - connect to fail after a connect. */ - - slow_down_interrupts (); - loop: - - /* A system call interrupted with a SIGALRM or SIGIO comes back - here, with can_break_system_calls reset to 0. */ - SETJMP (break_system_call_jump); - if (QUITP) - { - speed_up_interrupts (); - REALLY_QUIT; - /* In case something really weird happens ... */ - slow_down_interrupts (); - } + if (NILP(family)) + family = Qtcpip; + else + CHECK_SYMBOL (family); - /* Break out of connect with a signal (it isn't otherwise possible). - Thus you don't get screwed with a hung network. */ - can_break_system_calls = 1; - retval = connect (s, (struct sockaddr *) &address, sizeof (address)); - can_break_system_calls = 0; - if (retval == -1 && errno != EISCONN) - { - int xerrno = errno; - if (errno == EINTR) - goto loop; - if (errno == EADDRINUSE && retry < 20) - { - /* A delay here is needed on some FreeBSD systems, - and it is harmless, since this retrying takes time anyway - and should be infrequent. - `sleep-for' allowed for quitting this loop with interrupts - slowed down so it can't be used here. Async timers should - already be disabled at this point so we can use `sleep'. */ - sleep (1); - retry++; - goto loop; - } - - close (s); - - speed_up_interrupts (); - - errno = xerrno; - report_file_error ("connection failed", list2 (host, name)); - } - - speed_up_interrupts (); - - inch = s; - outch = dup (s); - if (outch < 0) - { - close (s); /* this used to be leaked; from Kyle Jones */ - report_file_error ("error duplicating socket", list1 (name)); - } - + /* Since this code is inside HAVE_SOCKETS, existence of + open_network_stream is mandatory */ + PROCMETH (open_network_stream, (name, host, service, family, + &inch, &outch)); + if (!NILP (buffer)) buffer = Fget_buffer_create (buffer); proc = make_process_internal (name); - - descriptor_to_process[inch] = proc; - -#ifdef PROCESS_IO_BLOCKING - { - Lisp_Object tail; - - for (tail = network_stream_blocking_port_list; CONSP (tail); tail = XCDR (tail)) - { - Lisp_Object tail_port = XCAR (tail); - - if (STRINGP (tail_port)) - { - struct servent *svc_info; - CHECK_STRING (tail_port); - svc_info = getservbyname ((char *) XSTRING_DATA (tail_port), "tcp"); - if ((svc_info != 0) && (svc_info->s_port == port)) - break; - else - continue; - } - else if ((INTP (tail_port)) && (htons ((unsigned short) XINT (tail_port)) == port)) - break; - } - - if (!CONSP (tail)) - { -#endif /* PROCESS_IO_BLOCKING */ - set_descriptor_non_blocking (inch); -#ifdef PROCESS_IO_BLOCKING - } - } -#endif /* PROCESS_IO_BLOCKING */ + NGCPRO1 (proc); XPROCESS (proc)->pid = Fcons (service, host); XPROCESS (proc)->buffer = buffer; - init_process_fds (XPROCESS (proc), inch, outch); - XPROCESS (proc)->connected_via_filedesc_p = 0; + init_process_io_handles (XPROCESS (proc), (void*)inch, (void*)outch, 0); event_stream_select_process (XPROCESS (proc)); UNGCPRO; + NUNGCPRO; return proc; } #ifdef HAVE_MULTICAST -/* Didier Verna <verna@inf.enst.fr> Nov. 28 1997. - This function is similar to open-network-stream-internal, but provides a - mean to open an UDP multicast connection instead of a TCP one. Like in the - TCP case, the multicast connection will be seen as a sub-process, - - Some notes: - - Normaly, we should use sendto and recvfrom with non connected - sockets. The current code doesn't allow us to do this. In the future, it - would be a good idea to extend the process data structure in order to deal - properly with the different types network connections. - - For the same reason, when leaving a multicast group, it is better to make - a setsockopt - IP_DROP_MEMBERSHIP before closing the descriptors. - Unfortunately, this can't be done here because delete_process doesn't know - about the kind of connection we have. However, this is not such an - important issue. -*/ DEFUN ("open-multicast-group-internal", Fopen_multicast_group_internal, 5, 5, 0, /* Open a multicast connection on the specified dest/port/ttl. Returns a subprocess-object to represent the connection. @@ -1549,138 +746,16 @@ { /* !!#### This function has not been Mule-ized */ /* This function can GC */ - Lisp_Object proc; - struct ip_mreq imr; - struct sockaddr_in sa; - struct protoent *udp; - int ws, rs; - int theport; - unsigned char thettl; - int one = 1; /* For REUSEADDR */ - int ret; - volatile int retry = 0; + Lisp_Object proc = Qnil; struct gcpro gcpro1; - - CHECK_STRING (name); - CHECK_STRING (dest); - - CHECK_NATNUM (port); - theport = htons ((unsigned short) XINT (port)); - - CHECK_NATNUM (ttl); - thettl = (unsigned char) XINT (ttl); - - if ((udp = getprotobyname ("udp")) == NULL) - error ("No info available for UDP protocol"); - - /* Init the sockets. Yes, I need 2 sockets. I couldn't duplicate one. */ - if ((rs = socket (PF_INET, SOCK_DGRAM, udp->p_proto)) < 0) - report_file_error ("error creating socket", list1(name)); - if ((ws = socket (PF_INET, SOCK_DGRAM, udp->p_proto)) < 0) - { - close (rs); - report_file_error ("error creating socket", list1(name)); - } - - /* This will be used for both sockets */ - bzero(&sa, sizeof(sa)); - sa.sin_family = AF_INET; - sa.sin_port = theport; - sa.sin_addr.s_addr = htonl (inet_addr ((char *) XSTRING_DATA (dest))); + void *inch, *outch; - /* Socket configuration for reading ------------------------ */ - - /* Multiple connections from the same machine. This must be done before - bind. If it fails, it shouldn't be fatal. The only consequence is that - people won't be able to connect twice from the same machine. */ - if (setsockopt (rs, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof (one)) - < 0) - warn_when_safe (Qmulticast, Qwarning, "Cannot reuse socket address"); - - /* bind socket name */ - if (bind (rs, (struct sockaddr *)&sa, sizeof(sa))) - { - close (rs); - close (ws); - report_file_error ("error binding socket", list2(name, port)); - } - - /* join multicast group */ - imr.imr_multiaddr.s_addr = htonl (inet_addr ((char *) XSTRING_DATA (dest))); - imr.imr_interface.s_addr = htonl (INADDR_ANY); - if (setsockopt (rs, IPPROTO_IP, IP_ADD_MEMBERSHIP, - (char *) &imr, sizeof (struct ip_mreq)) < 0) - { - close (ws); - close (rs); - report_file_error ("error adding membership", list2(name, dest)); - } - - /* Socket configuration for writing ----------------------- */ - - /* Normaly, there's no 'connect' in multicast, since we use preferentialy - 'sendto' and 'recvfrom'. However, in order to handle this connection in - the process-like way it is done for TCP, we must be able to use 'write' - instead of 'sendto'. Consequently, we 'connect' this socket. */ - - /* See open-network-stream-internal for comments on this part of the code */ - slow_down_interrupts (); - - loop: - - /* A system call interrupted with a SIGALRM or SIGIO comes back - here, with can_break_system_calls reset to 0. */ - SETJMP (break_system_call_jump); - if (QUITP) - { - speed_up_interrupts (); - REALLY_QUIT; - /* In case something really weird happens ... */ - slow_down_interrupts (); - } - - /* Break out of connect with a signal (it isn't otherwise possible). - Thus you don't get screwed with a hung network. */ - can_break_system_calls = 1; - ret = connect (ws, (struct sockaddr *) &sa, sizeof (sa)); - can_break_system_calls = 0; - if (ret == -1 && errno != EISCONN) - { - int xerrno = errno; - - if (errno == EINTR) - goto loop; - if (errno == EADDRINUSE && retry < 20) - { - /* A delay here is needed on some FreeBSD systems, - and it is harmless, since this retrying takes time anyway - and should be infrequent. - `sleep-for' allowed for quitting this loop with interrupts - slowed down so it can't be used here. Async timers should - already be disabled at this point so we can use `sleep'. */ - sleep (1); - retry++; - goto loop; - } - - close (rs); - close (ws); - speed_up_interrupts (); - - errno = xerrno; - report_file_error ("error connecting socket", list2(name, port)); - } - - speed_up_interrupts (); - - /* scope */ - if (setsockopt (ws, IPPROTO_IP, IP_MULTICAST_TTL, - (char *) &thettl, sizeof (thettl)) < 0) - { - close (rs); - close (ws); - report_file_error ("error setting ttl", list2(name, ttl)); - } + CHECK_STRING (name); + + /* Since this code is inside HAVE_MULTICAST, existence of + open_network_stream is mandatory */ + PROCMETH (open_multicast_group, (name, dest, port, ttl, + &inch, &outch)); if (!NILP (buffer)) buffer = Fget_buffer_create (buffer); @@ -1688,46 +763,9 @@ proc = make_process_internal (name); GCPRO1 (proc); - descriptor_to_process[rs] = proc; - -#ifdef PROCESS_IO_BLOCKING - { - Lisp_Object tail; - - for (tail = network_stream_blocking_port_list; - CONSP (tail); tail = XCDR (tail)) - { - Lisp_Object tail_port = XCAR (tail); - - if (STRINGP (tail_port)) - { - struct servent *svc_info; - - svc_info = - getservbyname ((char *) XSTRING_DATA (tail_port), "udp"); - if ((svc_info != 0) && (svc_info->s_port == theport)) - break; - else - continue; - } - else if ((INTP (tail_port)) && - (htons ((unsigned short) XINT (tail_port)) == theport)) - break; - } - - if (!CONSP (tail)) - { -#endif /* PROCESS_IO_BLOCKING */ - set_descriptor_non_blocking (rs); -#ifdef PROCESS_IO_BLOCKING - } - } -#endif /* PROCESS_IO_BLOCKING */ - XPROCESS (proc)->pid = Fcons (port, dest); XPROCESS (proc)->buffer = buffer; - init_process_fds (XPROCESS (proc), rs, ws); - XPROCESS (proc)->connected_via_filedesc_p = 0; + init_process_io_handles (XPROCESS (proc), (void*)inch, (void*)outch, 0); event_stream_select_process (XPROCESS (proc)); @@ -1741,21 +779,7 @@ Lisp_Object canonicalize_host_name (Lisp_Object host) { -#ifdef HAVE_SOCKETS - /* #### for HAVE_TERM, you probably have to do something else. */ - struct sockaddr_in address; - - if (!get_internet_address (host, &address, ERROR_ME_NOT)) - return host; - - if (address.sin_family == AF_INET) - return build_string (inet_ntoa (address.sin_addr)); - else - /* #### any clue what to do here? */ - return host; -#else - return host; -#endif + return PROCMETH_OR_GIVEN (canonicalize_host_name, (host), host); } @@ -1767,11 +791,9 @@ CHECK_PROCESS (proc); CHECK_NATNUM (height); CHECK_NATNUM (width); - if (set_window_size (XPROCESS (proc)->infd, XINT (height), XINT (width)) - <= 0) - return Qnil; - else - return Qt; + return + MAYBE_INT_PROCMETH (set_window_size, (XPROCESS (proc), XINT (height), XINT (width))) <= 0 + ? Qnil : Qt; } @@ -1779,11 +801,6 @@ /* Process I/O */ /************************************************************************/ -/* (Faccept_process_output is now in event-stream.c) */ - -/* Some FSFmacs error handlers here. We handle this - in call2_trapping_errors(). */ - /* Read pending output from the process channel, starting with our buffered-ahead character if we have one. Yield number of characters read. @@ -1809,7 +826,7 @@ Really, the loop in execute_internal_event() should check itself for a process-filter change, like in status_notify(); but the struct Lisp_Process is not exported outside of this file. */ - if (p->infd < 0) + if (NILP(p->pipe_instream)) return -1; /* already closed */ if (!NILP (p->filter) && (p->filter_does_read)) @@ -1827,32 +844,7 @@ return XINT (filter_result); } -#if 0 /* FSFmacs */ - /* #### equivalent code from FSFmacs. Would need some porting - for Windows NT. */ - if (proc_buffered_char[channel] < 0) -#ifdef WINDOWSNT - nchars = read_child_output (channel, chars, sizeof (chars)); -#else - nchars = read (channel, chars, sizeof chars); -#endif - else - { - chars[0] = proc_buffered_char[channel]; - proc_buffered_char[channel] = -1; -#ifdef WINDOWSNT - nchars = read_child_output (channel, chars + 1, sizeof (chars) - 1); -#else - nchars = read (channel, chars + 1, sizeof chars - 1); -#endif - if (nchars < 0) - nchars = 1; - else - nchars = nchars + 1; - } -#endif /* FSFmacs */ - - nbytes = Lstream_read (XLSTREAM (p->instream), chars, sizeof (chars)); + nbytes = Lstream_read (XLSTREAM (DATA_INSTREAM(p)), chars, sizeof (chars)); if (nbytes <= 0) return nbytes; nchars = bytecount_to_charcount (chars, nbytes); @@ -1956,19 +948,9 @@ } return nchars; } - + /* Sending data to subprocess */ -static JMP_BUF send_process_frame; - -static SIGTYPE -send_process_trap (int signum) -{ - EMACS_REESTABLISH_SIGNAL (signum, send_process_trap); - EMACS_UNBLOCK_SIGNAL (signum); - LONGJMP (send_process_frame, 1); -} - /* send some data to process PROC. If NONRELOCATABLE is non-NULL, it specifies the address of the data. Otherwise, the data comes from the object RELOCATABLE (either a string or a buffer). START and LEN @@ -1977,27 +959,18 @@ Note that START and LEN are in Bufpos's if RELOCATABLE is a buffer, and in Bytecounts otherwise. */ -static void -send_process (volatile Lisp_Object proc, +void +send_process (Lisp_Object proc, Lisp_Object relocatable, CONST Bufbyte *nonrelocatable, int start, int len) { /* This function can GC */ - /* Use volatile to protect variables from being clobbered by longjmp. */ struct gcpro gcpro1, gcpro2; - SIGTYPE (*volatile old_sigpipe) (int) = 0; Lisp_Object lstream = Qnil; - volatile struct Lisp_Process *p = XPROCESS (proc); -#if defined (NO_UNION_TYPE) /* || !defined (__GNUC__) GCC bug only??? */ - /* #### ugh! There must be a better solution. */ - Lisp_Object defeat_volatile_kludge = (Lisp_Object) proc; -#else - Lisp_Object defeat_volatile_kludge = proc; -#endif - GCPRO2 (defeat_volatile_kludge, lstream); + GCPRO2 (proc, lstream); - if (p->outfd < 0) + if (NILP (DATA_OUTSTREAM (XPROCESS (proc)))) signal_simple_error ("Process not open for writing", proc); if (nonrelocatable) @@ -2009,63 +982,8 @@ else lstream = make_lisp_string_input_stream (relocatable, start, len); - if (!SETJMP (send_process_frame)) - { - /* use a reasonable-sized buffer (somewhere around the size of the - stream buffer) so as to avoid inundating the stream with blocked - data. */ - Bufbyte chunkbuf[512]; - Bytecount chunklen; - - while (1) - { - int writeret; + PROCMETH (send_process, (proc, XLSTREAM (lstream))); - chunklen = Lstream_read (XLSTREAM (lstream), chunkbuf, 512); - if (chunklen <= 0) - break; /* perhaps should abort() if < 0? - This should never happen. */ - old_sigpipe = - (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap); - /* Lstream_write() will never successfully write less than - the amount sent in. In the worst case, it just buffers - the unwritten data. */ - writeret = Lstream_write (XLSTREAM (p->outstream), chunkbuf, - chunklen); - signal (SIGPIPE, old_sigpipe); - if (writeret < 0) - /* This is a real error. Blocking errors are handled - specially inside of the filedesc stream. */ - report_file_error ("writing to process", - list1 (proc)); - while (filedesc_stream_was_blocked (XLSTREAM (p->filedesc_stream))) - { - /* Buffer is full. Wait, accepting input; - that may allow the program - to finish doing output and read more. */ - Faccept_process_output (Qnil, make_int (1), Qnil); - old_sigpipe = - (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap); - Lstream_flush (XLSTREAM (p->filedesc_stream)); - signal (SIGPIPE, old_sigpipe); - } - } - } - else - { /* We got here from a longjmp() from the SIGPIPE handler */ - signal (SIGPIPE, old_sigpipe); - p->status_symbol = Qexit; - p->exit_code = 256; /* #### SIGPIPE ??? */ - p->core_dumped = 0; - p->tick++; - process_tick++; - deactivate_process (proc); - error ("SIGPIPE raised on process %s; closed it", - XSTRING_DATA (p->name)); - } - old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap); - Lstream_flush (XLSTREAM (p->outstream)); - signal (SIGPIPE, old_sigpipe); UNGCPRO; Lstream_delete (XLSTREAM (lstream)); } @@ -2078,7 +996,7 @@ (proc)) { CHECK_PROCESS (proc); - return XPROCESS (proc)->tty_name; + return MAYBE_LISP_PROCMETH (get_tty_name, (XPROCESS (proc))); } DEFUN ("set-process-buffer", Fset_process_buffer, 2, 2, 0, /* @@ -2206,7 +1124,7 @@ (process)) { process = get_process (process); - return decoding_stream_coding_system (XLSTREAM ( XPROCESS (process)->instream) ); + return decoding_stream_coding_system (XLSTREAM (XPROCESS (process)->coding_instream) ); } DEFUN ("process-output-coding-system", Fprocess_output_coding_system, 1, 1, 0, /* @@ -2215,7 +1133,7 @@ (process)) { process = get_process (process); - return encoding_stream_coding_system (XLSTREAM (XPROCESS (process)->outstream)); + return encoding_stream_coding_system (XLSTREAM (XPROCESS (process)->coding_outstream)); } DEFUN ("process-coding-system", Fprocess_coding_system, 1, 1, 0, /* @@ -2225,9 +1143,9 @@ { process = get_process (process); return Fcons (decoding_stream_coding_system - (XLSTREAM (XPROCESS (process)->instream)), + (XLSTREAM (XPROCESS (process)->coding_instream)), encoding_stream_coding_system - (XLSTREAM (XPROCESS (process)->outstream))); + (XLSTREAM (XPROCESS (process)->coding_outstream))); } DEFUN ("set-process-input-coding-system", @@ -2238,7 +1156,7 @@ { codesys = Fget_coding_system (codesys); process = get_process (process); - set_decoding_stream_coding_system ( XLSTREAM ( XPROCESS (process)->instream ), codesys); + set_decoding_stream_coding_system ( XLSTREAM ( XPROCESS (process)->coding_instream ), codesys); return Qnil; } @@ -2251,7 +1169,7 @@ codesys = Fget_coding_system (codesys); process = get_process (process); set_encoding_stream_coding_system - ( XLSTREAM ( XPROCESS (process)->outstream), codesys); + ( XLSTREAM ( XPROCESS (process)->coding_outstream), codesys); return Qnil; } @@ -2270,16 +1188,12 @@ return Qnil; } -#endif - +#endif /* FILE_CODING */ /************************************************************************/ /* process status */ /************************************************************************/ -/* Some FSFmacs error handlers here. We handle this - in call2_trapping_errors(). */ - static Lisp_Object exec_sentinel_unwind (Lisp_Object datum) { @@ -2348,40 +1262,6 @@ return (CONST char *) GETTEXT ("unknown signal"); } -/* Compute the Lisp form of the process status from - the numeric status that was returned by `wait'. */ - -static void -update_status_from_wait_code (struct Lisp_Process *p, int *w_fmh) -{ - /* C compiler lossage when attempting to pass w directly */ - int w = *w_fmh; - - if (WIFSTOPPED (w)) - { - p->status_symbol = Qstop; - p->exit_code = WSTOPSIG (w); - p->core_dumped = 0; - } - else if (WIFEXITED (w)) - { - p->status_symbol = Qexit; - p->exit_code = WEXITSTATUS (w); - p->core_dumped = 0; - } - else if (WIFSIGNALED (w)) - { - p->status_symbol = Qsignal; - p->exit_code = WTERMSIG (w); - p->core_dumped = WCOREDUMP (w); - } - else - { - p->status_symbol = Qrun; - p->exit_code = 0; - } -} - void update_process_status (Lisp_Object p, Lisp_Object status_symbol, @@ -2395,212 +1275,6 @@ XPROCESS (p)->core_dumped = core_dumped; } -#ifdef SIGCHLD - -#define MAX_EXITED_PROCESSES 1000 -static volatile pid_t exited_processes[MAX_EXITED_PROCESSES]; -static volatile int exited_processes_status[MAX_EXITED_PROCESSES]; -static volatile int exited_processes_index; - -static volatile int sigchld_happened; - -/* For any processes that have changed status and are recorded - and such, update the corresponding struct Lisp_Process. - We separate this from record_exited_processes() so that - we never have to call this function from within a signal - handler. We block SIGCHLD in case record_exited_processes() - is called from a signal handler. */ - -static void -reap_exited_processes (void) -{ - int i; - struct Lisp_Process *p; - - if (exited_processes_index <= 0) - { - return; - } - -#ifdef EMACS_BLOCK_SIGNAL - EMACS_BLOCK_SIGNAL (SIGCHLD); -#endif - for (i = 0; i < exited_processes_index; i++) - { - int pid = exited_processes[i]; - int w = exited_processes_status[i]; - - /* Find the process that signaled us, and record its status. */ - - p = 0; - { - Lisp_Object tail; - LIST_LOOP (tail, Vprocess_list) - { - Lisp_Object proc = XCAR (tail); - p = XPROCESS (proc); - if (INTP (p->pid) && XINT (p->pid) == pid) - break; - p = 0; - } - } - - if (p) - { - /* Change the status of the process that was found. */ - p->tick++; - process_tick++; - update_status_from_wait_code (p, &w); - - /* If process has terminated, stop waiting for its output. */ - if (WIFSIGNALED (w) || WIFEXITED (w)) - { - if (p->infd >= 0) - { - /* We can't just call event_stream->unselect_process_cb (p) - here, because that calls XtRemoveInput, which is not - necessarily reentrant, so we can't call this at interrupt - level. - */ - } - } - } - else - { - /* There was no asynchronous process found for that id. Check - if we have a synchronous process. Only set sync process status - if there is one, so we work OK with the waitpid() call in - wait_for_termination(). */ - if (synch_process_alive != 0) - { /* Set the global sync process status variables. */ - synch_process_alive = 0; - - /* Report the status of the synchronous process. */ - if (WIFEXITED (w)) - synch_process_retcode = WEXITSTATUS (w); - else if (WIFSIGNALED (w)) - synch_process_death = signal_name (WTERMSIG (w)); - } - } - } - - exited_processes_index = 0; - - EMACS_UNBLOCK_SIGNAL (SIGCHLD); -} - -/* On receipt of a signal that a child status has changed, - loop asking about children with changed statuses until - the system says there are no more. All we do is record - the processes and wait status. - - This function could be called from within the SIGCHLD - handler, so it must be completely reentrant. When - not called from a SIGCHLD handler, BLOCK_SIGCHLD should - be non-zero so that SIGCHLD is blocked while this - function is running. (This is necessary so avoid - race conditions with the SIGCHLD_HAPPENED flag). */ - -static void -record_exited_processes (int block_sigchld) -{ - if (!sigchld_happened) - { - return; - } - -#ifdef EMACS_BLOCK_SIGNAL - if (block_sigchld) - EMACS_BLOCK_SIGNAL (SIGCHLD); -#endif - - while (sigchld_happened) - { - int pid; - int w; - - /* Keep trying to get a status until we get a definitive result. */ - do - { - errno = 0; -#ifdef WNOHANG -# ifndef WUNTRACED -# define WUNTRACED 0 -# endif /* not WUNTRACED */ -# ifdef HAVE_WAITPID - pid = waitpid ((pid_t) -1, &w, WNOHANG | WUNTRACED); -# else - pid = wait3 (&w, WNOHANG | WUNTRACED, 0); -# endif -#else /* not WNOHANG */ - pid = wait (&w); -#endif /* not WNOHANG */ - } - while (pid <= 0 && errno == EINTR); - - if (pid <= 0) - break; - - if (exited_processes_index < MAX_EXITED_PROCESSES) - { - exited_processes[exited_processes_index] = pid; - exited_processes_status[exited_processes_index] = w; - exited_processes_index++; - } - - /* On systems with WNOHANG, we just ignore the number - of times that SIGCHLD was signalled, and keep looping - until there are no more processes to wait on. If we - don't have WNOHANG, we have to rely on the count in - SIGCHLD_HAPPENED. */ -#ifndef WNOHANG - sigchld_happened--; -#endif /* not WNOHANG */ - } - - sigchld_happened = 0; - - if (block_sigchld) - EMACS_UNBLOCK_SIGNAL (SIGCHLD); -} - -/** USG WARNING: Although it is not obvious from the documentation - in signal(2), on a USG system the SIGCLD handler MUST NOT call - signal() before executing at least one wait(), otherwise the handler - will be called again, resulting in an infinite loop. The relevant - portion of the documentation reads "SIGCLD signals will be queued - and the signal-catching function will be continually reentered until - the queue is empty". Invoking signal() causes the kernel to reexamine - the SIGCLD queue. Fred Fish, UniSoft Systems Inc. - - (Note that now this only applies in SYS V Release 2 and before. - On SYS V Release 3, we use sigset() to set the signal handler for - the first time, and so we don't have to reestablish the signal handler - in the handler below. On SYS V Release 4, we don't get this weirdo - behavior when we use sigaction(), which we do use.) */ - -static SIGTYPE -sigchld_handler (int signo) -{ -#ifdef OBNOXIOUS_SYSV_SIGCLD_BEHAVIOR - int old_errno = errno; - - sigchld_happened++; - record_exited_processes (0); - errno = old_errno; -#else - sigchld_happened++; -#endif -#ifdef HAVE_UNIXOID_EVENT_LOOP - signal_fake_event (); -#endif - /* WARNING - must come after wait3() for USG systems */ - EMACS_REESTABLISH_SIGNAL (signo, sigchld_handler); - SIGRETURN; -} - -#endif /* SIGCHLD */ - /* Return a string describing a process status list. */ static Lisp_Object @@ -2649,6 +1323,7 @@ process_tick++; } + /* Report all recent events of a change in process status (either run the sentinel or output a message). This is done while Emacs is waiting for keyboard input. */ @@ -2671,12 +1346,7 @@ stuff in -- it can't hurt.) */ int temp_process_tick; -#ifdef SIGCHLD -#ifndef OBNOXIOUS_SYSV_SIGCLD_BEHAVIOR - record_exited_processes (1); -#endif - reap_exited_processes (); -#endif + MAYBE_PROCMETH (reap_exited_processes, ()); temp_process_tick = process_tick; @@ -2696,26 +1366,12 @@ /* p->tick is also volatile. Same thing as above applies. */ int this_process_tick; -#ifdef HAVE_WAITPID /* #### extra check for terminated processes, in case a SIGCHLD got missed (this seems to happen sometimes, I'm not sure why). */ - { - int w; -#ifdef SIGCHLD - EMACS_BLOCK_SIGNAL (SIGCHLD); -#endif - if (INTP (p->pid) && - waitpid (XINT (p->pid), &w, WNOHANG) == XINT (p->pid)) - { - p->tick++; - update_status_from_wait_code (p, &w); - } -#ifdef SIGCHLD - EMACS_UNBLOCK_SIGNAL (SIGCHLD); -#endif - } -#endif + if (INTP (p->pid)) + MAYBE_PROCMETH (update_status_if_terminated, (p)); + this_process_tick = p->tick; if (this_process_tick != p->update_tick) { @@ -2851,83 +1507,7 @@ } -#ifdef SIGNALS_VIA_CHARACTERS -/* Get signal character to send to process if SIGNALS_VIA_CHARACTERS */ -static int -process_signal_char (int tty_fd, int signo) -{ - /* If it's not a tty, pray that these default values work */ - if (!isatty(tty_fd)) { -#define CNTL(ch) (037 & (ch)) - switch (signo) - { - case SIGINT: return CNTL('C'); - case SIGQUIT: return CNTL('\\'); -#ifdef SIGTSTP - case SIGTSTP: return CNTL('Z'); -#endif - } - } - -#ifdef HAVE_TERMIOS - /* TERMIOS is the latest and bestest, and seems most likely to work. - If the system has it, use it. */ - { - struct termios t; - tcgetattr (tty_fd, &t); - switch (signo) - { - case SIGINT: return t.c_cc[VINTR]; - case SIGQUIT: return t.c_cc[VQUIT]; -# if defined (VSWTCH) && !defined (PREFER_VSUSP) - case SIGTSTP: return t.c_cc[VSWTCH]; -# else - case SIGTSTP: return t.c_cc[VSUSP]; -# endif - } - } - -# elif defined (TIOCGLTC) && defined (TIOCGETC) /* not HAVE_TERMIOS */ - { - /* On Berkeley descendants, the following IOCTL's retrieve the - current control characters. */ - struct tchars c; - struct ltchars lc; - switch (signo) - { - case SIGINT: ioctl (tty_fd, TIOCGETC, &c); return c.t_intrc; - case SIGQUIT: ioctl (tty_fd, TIOCGETC, &c); return c.t_quitc; -# ifdef SIGTSTP - case SIGTSTP: ioctl (tty_fd, TIOCGLTC, &lc); return lc.t_suspc; -# endif /* SIGTSTP */ - } - } - -# elif defined (TCGETA) /* ! defined (TIOCGLTC) && defined (TIOCGETC) */ - { - /* On SYSV descendants, the TCGETA ioctl retrieves the current - control characters. */ - struct termio t; - ioctl (tty_fd, TCGETA, &t); - switch (signo) { - case SIGINT: return t.c_cc[VINTR]; - case SIGQUIT: return t.c_cc[VQUIT]; -# ifdef SIGTSTP - case SIGTSTP: return t.c_cc[VSWTCH]; -# endif /* SIGTSTP */ - } - } -# else /* ! defined (TCGETA) */ -#error ERROR! Using SIGNALS_VIA_CHARACTERS, but not HAVE_TERMIOS || (TIOCGLTC && TIOCGETC) || TCGETA - /* If your system configuration files define SIGNALS_VIA_CHARACTERS, - you'd better be using one of the alternatives above! */ -# endif /* ! defined (TCGETA) */ - return '\0'; -} -#endif /* SIGNALS_VIA_CHARACTERS */ - - /* send a signal number SIGNO to PROCESS. CURRENT_GROUP means send to the process group that currently owns the terminal being used to communicate with PROCESS. @@ -2940,111 +1520,20 @@ their uid, for which killpg would return an EPERM error. */ static void -process_send_signal (Lisp_Object process0, int signo, +process_send_signal (Lisp_Object process, int signo, int current_group, int nomsg) { /* This function can GC */ - Lisp_Object proc = get_process (process0); - struct Lisp_Process *p = XPROCESS (proc); - int gid; - int no_pgrp = 0; + Lisp_Object proc = get_process (process); if (network_connection_p (proc)) error ("Network connection %s is not a subprocess", - XSTRING_DATA (p->name)); - if (p->infd < 0) + XSTRING_DATA (XPROCESS(proc)->name)); + if (!PROCESS_LIVE_P (proc)) error ("Process %s is not active", - XSTRING_DATA (p->name)); - - if (!p->pty_flag) - current_group = 0; - - /* If we are using pgrps, get a pgrp number and make it negative. */ - if (current_group) - { -#ifdef SIGNALS_VIA_CHARACTERS - /* If possible, send signals to the entire pgrp - by sending an input character to it. */ - { - char sigchar = process_signal_char(p->subtty, signo); - if (sigchar) { - send_process (proc, Qnil, (Bufbyte *) &sigchar, 0, 1); - return; - } - } -#endif /* ! defined (SIGNALS_VIA_CHARACTERS) */ - -#ifdef TIOCGPGRP - /* Get the pgrp using the tty itself, if we have that. - Otherwise, use the pty to get the pgrp. - On pfa systems, saka@pfu.fujitsu.co.JP writes: - "TIOCGPGRP symbol defined in sys/ioctl.h at E50. - But, TIOCGPGRP does not work on E50 ;-P works fine on E60" - His patch indicates that if TIOCGPGRP returns an error, then - we should just assume that p->pid is also the process group id. */ - { - int err; - - err = ioctl ( (p->subtty != -1 ? p->subtty : p->infd), TIOCGPGRP, &gid); + XSTRING_DATA (XPROCESS(proc)->name)); -#ifdef pfa - if (err == -1) - gid = - XINT (p->pid); -#endif /* ! defined (pfa) */ - } - if (gid == -1) - no_pgrp = 1; - else - gid = - gid; -#else /* ! defined (TIOCGPGRP ) */ - /* Can't select pgrps on this system, so we know that - the child itself heads the pgrp. */ - gid = - XINT (p->pid); -#endif /* ! defined (TIOCGPGRP ) */ - } - else - gid = - XINT (p->pid); - - switch (signo) - { -#ifdef SIGCONT - case SIGCONT: - p->status_symbol = Qrun; - p->exit_code = 0; - p->tick++; - process_tick++; - if (!nomsg) - status_notify (); - break; -#endif /* ! defined (SIGCONT) */ - case SIGINT: - case SIGQUIT: - case SIGKILL: - flush_pending_output (p->infd); - break; - } - - /* If we don't have process groups, send the signal to the immediate - subprocess. That isn't really right, but it's better than any - obvious alternative. */ - if (no_pgrp) - { - kill (XINT (p->pid), signo); - return; - } - - /* gid may be a pid, or minus a pgrp's number */ -#ifdef TIOCSIGSEND - if (current_group) - ioctl (p->infd, TIOCSIGSEND, signo); - else - { - gid = - XINT (p->pid); - kill (gid, signo); - } -#else /* ! defined (TIOCSIGSEND) */ - EMACS_KILLPG (-gid, signo); -#endif /* ! defined (TIOCSIGSEND) */ + MAYBE_PROCMETH (kill_child_process, (proc, signo, current_group, nomsg)); } DEFUN ("interrupt-process", Finterrupt_process, 0, 2, 0, /* @@ -3070,8 +1559,7 @@ (process, current_group)) { /* This function can GC */ - process_send_signal (process, SIGKILL, !NILP (current_group), - 0); + process_send_signal (process, SIGKILL, !NILP (current_group), 0); return process; } @@ -3082,8 +1570,7 @@ (process, current_group)) { /* This function can GC */ - process_send_signal (process, SIGQUIT, !NILP (current_group), - 0); + process_send_signal (process, SIGQUIT, !NILP (current_group), 0); return process; } @@ -3094,11 +1581,10 @@ (process, current_group)) { /* This function can GC */ -#ifndef SIGTSTP - error ("no SIGTSTP support"); +#ifdef SIGTSTP + process_send_signal (process, SIGTSTP, !NILP (current_group), 0); #else - process_send_signal (process, SIGTSTP, !NILP (current_group), - 0); + error ("stop-process: Not supported on this system"); #endif return process; } @@ -3111,10 +1597,9 @@ { /* This function can GC */ #ifdef SIGCONT - process_send_signal (process, SIGCONT, !NILP (current_group), - 0); + process_send_signal (process, SIGCONT, !NILP (current_group), 0); #else - error ("no SIGCONT support"); + error ("continue-process: Not supported on this system"); #endif return process; } @@ -3240,7 +1725,8 @@ #undef handle_signal - return make_int (kill (XINT (pid), XINT (sigcode))); + return make_int (PROCMETH_OR_GIVEN (kill_process_by_pid, + (XINT (pid), XINT (sigcode)), -1)); } DEFUN ("process-send-eof", Fprocess_send_eof, 0, 1, 0, /* @@ -3262,24 +1748,14 @@ if (! EQ (XPROCESS (proc)->status_symbol, Qrun)) error ("Process %s not running", XSTRING_DATA (XPROCESS (proc)->name)); - if (XPROCESS (proc)->pty_flag) + if (!MAYBE_INT_PROCMETH (process_send_eof, (proc))) { - /* #### get_eof_char simply doesn't return the correct character - here. Maybe it is needed to determine the right eof - character in init_process_fds but here it simply screws - things up. */ -#if 0 - Bufbyte eof_char = get_eof_char (XPROCESS (proc)); - send_process (proc, Qnil, &eof_char, 0, 1); -#else - send_process (proc, Qnil, (CONST Bufbyte *) "\004", 0, 1); + event_stream_delete_stream_pair (Qnil, XPROCESS (proc)->pipe_outstream); + XPROCESS (proc)->pipe_outstream = Qnil; +#ifdef FILE_CODING + XPROCESS (proc)->coding_outstream = Qnil; #endif } - else - { - close (XPROCESS (proc)->outfd); - XPROCESS (proc)->outfd = open (NULL_DEVICE, O_WRONLY | OPEN_BINARY, 0); - } return process; } @@ -3292,42 +1768,36 @@ void deactivate_process (Lisp_Object proc) { - int inchannel, outchannel; struct Lisp_Process *p = XPROCESS (proc); - SIGTYPE (*old_sigpipe) (int) = 0; - - inchannel = p->infd; - outchannel = p->outfd; + USID usid; - /* closing the outstream could result in SIGPIPE, so ignore it. */ - old_sigpipe = - (SIGTYPE (*) (int)) signal (SIGPIPE, SIG_IGN); - if (!NILP (p->instream)) - Lstream_close (XLSTREAM (p->instream)); - if (!NILP (p->outstream)) - Lstream_close (XLSTREAM (p->outstream)); - signal (SIGPIPE, old_sigpipe); + /* It's possible that we got as far in the process-creation + process as creating the descriptors but didn't get so + far as selecting the process for input. In this + case, p->pid is nil: p->pid is set at the same time that + the process is selected for input. */ + /* #### The comment does not look correct. event_stream_unselect_process + is guarded by process->selected, so this is not a problem. - kkm*/ + /* Must call this before setting the streams to nil */ + event_stream_unselect_process (p); - if (inchannel >= 0) - { - /* Beware SIGCHLD hereabouts. */ - flush_pending_output (inchannel); - close_descriptor_pair (inchannel, outchannel); - if (!NILP (p->pid)) - { - /* It's possible that we got as far in the process-creation - process as creating the descriptors but didn't get so - far as selecting the process for input. In this - case, p->pid is nil: p->pid is set at the same time that - the process is selected for input. */ - /* Must call this before setting the file descriptors to 0 */ - event_stream_unselect_process (p); - } + /* Provide minimal implementation for deactivate_process + if there's no process-specific one */ + if (HAS_PROCMETH_P (deactivate_process)) + usid = PROCMETH (deactivate_process, (p)); + else + usid = event_stream_delete_stream_pair (p->pipe_instream, + p->pipe_outstream); - p->infd = -1; - p->outfd = -1; - descriptor_to_process[inchannel] = Qnil; - } + if (usid != USID_DONTHASH) + remhash ((CONST void*)usid, usid_to_process); + + p->pipe_instream = Qnil; + p->pipe_outstream = Qnil; +#ifdef FILE_CODING + p->coding_instream = Qnil; + p->coding_outstream = Qnil; +#endif } static void @@ -3357,7 +1827,7 @@ p->tick++; process_tick++; } - else if (p->infd >= 0) + else if (!NILP(p->pipe_instream)) { Fkill_process (proc, Qnil); /* Do this now, since remove_process will make sigchld_handler do nothing. */ @@ -3389,30 +1859,12 @@ { if (network_connection_p (proc)) Fdelete_process (proc); - else if (XPROCESS (proc)->infd >= 0) + else if (!NILP (XPROCESS (proc)->pipe_instream)) process_send_signal (proc, SIGHUP, 0, 1); } } } -#if 0 /* Unused */ -int -count_active_processes (void) -{ - Lisp_Object tail; - int count = 0; - - for (tail = Vprocess_list; CONSP (tail); tail = XCDR (tail)) - { - Lisp_Object status = XPROCESS (XCAR (tail))->status_symbol; - if ((EQ (status, Qrun) || EQ (status, Qstop))) - count++; - } - - return count; -} -#endif /* Unused */ - DEFUN ("process-kill-without-query", Fprocess_kill_without_query, 1, 2, 0, /* Say no query needed if PROCESS is running when Emacs is exited. Optional second argument if non-nil says to require a query. @@ -3443,23 +1895,10 @@ void init_xemacs_process (void) { - int i; - -#ifdef SIGCHLD -# ifndef CANNOT_DUMP - if (! noninteractive || initialized) -# endif - signal (SIGCHLD, sigchld_handler); -#endif /* SIGCHLD */ + MAYBE_PROCMETH (init_process, ()); Vprocess_list = Qnil; - for (i = 0; i < MAXDESC; i++) - { - descriptor_to_process[i] = Qnil; -#if 0 /* FSFmacs */ - proc_buffered_char[i] = -1; -#endif - } + usid_to_process = make_hashtable (32); } #if 0 @@ -3488,6 +1927,8 @@ defsymbol (&Qopen, "open"); defsymbol (&Qclosed, "closed"); + defsymbol (&Qtcpip, "tcp/ip"); + #ifdef HAVE_MULTICAST defsymbol(&Qmulticast, "multicast"); /* Used for occasional warnings */ #endif @@ -3537,7 +1978,7 @@ DEFSUBR (Fset_process_output_coding_system); DEFSUBR (Fprocess_coding_system); DEFSUBR (Fset_process_coding_system); -#endif +#endif /* FILE_CODING */ } void
--- a/src/process.h Mon Aug 13 10:23:52 2007 +0200 +++ b/src/process.h Mon Aug 13 10:24:41 2007 +0200 @@ -18,8 +18,6 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Synched up with: FSF 19.30. */ - #ifndef _XEMACS_PROCESS_H_ #define _XEMACS_PROCESS_H_ @@ -48,7 +46,7 @@ #define PROCESSP(x) RECORDP (x, process) #define GC_PROCESSP(x) GC_RECORDP (x, process) #define CHECK_PROCESS(x) CHECK_RECORD (x, process) -#define PROCESS_LIVE_P(x) (XPROCESS(x)->infd >= 0) +#define PROCESS_LIVE_P(x) (!NILP (XPROCESS(x)->pipe_instream)) #ifdef emacs @@ -62,7 +60,8 @@ Lisp_Object Fopen_network_stream_internal (Lisp_Object name, Lisp_Object buffer, Lisp_Object host, - Lisp_Object service); + Lisp_Object service, + Lisp_Object family); Lisp_Object Fopen_multicast_group_internal (Lisp_Object name, Lisp_Object buffer, Lisp_Object dest, @@ -97,12 +96,12 @@ Lisp_Object status_symbol, int exit_code, int core_dumped); -void get_process_file_descriptors (struct Lisp_Process *p, - int *infd, int *outfd); +void get_process_streams (struct Lisp_Process *p, + Lisp_Object *instr, Lisp_Object *outstr); int get_process_selected_p (struct Lisp_Process *p); void set_process_selected_p (struct Lisp_Process *p, int selected_p); -struct Lisp_Process *get_process_from_input_descriptor (int infd); +struct Lisp_Process *get_process_from_usid (USID usid); #ifdef HAVE_SOCKETS int network_connection_p (Lisp_Object process);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/procimpl.h Mon Aug 13 10:24:41 2007 +0200 @@ -0,0 +1,185 @@ +/* Processes implementation header + Copyright (C) 1985, 1992, 1993, 1994 Free Software Foundation, Inc. + +This file is part of XEmacs. + +XEmacs is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +XEmacs is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with XEmacs; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* This file must be only included by the process implementation files: + process-unix.c, process-msw.c etc. The Lisp_Process structure and other + contents of this file is not exported to the rest of the world */ + +#ifndef _XEMACS_PROCIMPL_H_ +#define _XEMACS_PROCIMPL_H_ + +struct Lisp_Process; + +/* + * Structure which keeps methods of the process implementation. + * There is only one object of this class exists in a perticular + * XEmacs implementation. + */ + +/* #### Comment me... */ + +struct process_methods +{ + void (*mark_process_data) (struct Lisp_Process *proc, + void (*markobj) (Lisp_Object)); + void (*print_process_data) (struct Lisp_Process *proc, + Lisp_Object printcharfun); + void (*finalize_process_data) (struct Lisp_Process *proc, int for_disksave); + void (*alloc_process_data) (struct Lisp_Process *p); + void (*init_process_io_handles) (struct Lisp_Process *p, + void* in, void* out, int flags); + int (*create_process) (struct Lisp_Process *p, + char **new_argv, CONST char *current_dir); + int (*tooltalk_connection_p) (struct Lisp_Process *p); +#ifdef HAVE_SOCKETS + void (*open_network_stream) (Lisp_Object name, Lisp_Object host, + Lisp_Object service, Lisp_Object family, + void** vinfd, void** voutfd); +#ifdef HAVE_MULTICAST + void (*open_multicast_group) (Lisp_Object name, Lisp_Object dest, + Lisp_Object port, Lisp_Object ttl, + void** vinfd, void** voutfd); +#endif /* HAVE_MULTICAST */ +#endif /* HAVE_SOCKETS */ + Lisp_Object (*canonicalize_host_name) (Lisp_Object host); + int (*set_window_size) (struct Lisp_Process* p, int height, int width); + void (*send_process) (Lisp_Object proc, struct lstream* lstream); + void (*reap_exited_processes) (void); + void (*update_status_if_terminated) (struct Lisp_Process* p); + void (*kill_child_process) (Lisp_Object proc, int signo, + int current_group, int nomsg); + int (*kill_process_by_pid) (int pid, int sigcode); + int (*process_send_eof) (Lisp_Object proc); + Lisp_Object (*get_tty_name) (struct Lisp_Process *p); + USID (*deactivate_process) (struct Lisp_Process *p); + void (*init_process) (void); +}; + +extern struct process_methods the_process_methods; + +/* + * Accessors for process_methods + */ + +#define HAS_PROCMETH_P(name) (the_process_methods.name != 0) +#define PROCMETH(name, par) ((the_process_methods.name) par) +#define PROCMETH_OR_GIVEN(name, par, given) (HAS_PROCMETH_P(name) ? PROCMETH(name, par) : (given)) +#define MAYBE_PROCMETH(name, par) do { if (HAS_PROCMETH_P(name)) PROCMETH(name, par); } while (0); +#define MAYBE_LISP_PROCMETH(name, par) PROCMETH_OR_GIVEN(name, par, Qnil) +#define MAYBE_INT_PROCMETH(name, par) PROCMETH_OR_GIVEN(name, par, 0) +#define PROCESS_HAS_METHOD(os, name) the_process_methods.name = os##_##name + +/* + * Structure records pertinent information about open channels. + * There is one channel associated with each process. + */ + +struct Lisp_Process +{ + struct lcrecord_header header; + /* Name of this process */ + Lisp_Object name; + /* List of command arguments that this process was run with */ + Lisp_Object command; + /* (funcall FILTER PROC STRING) (if FILTER is non-nil) + to dispose of a bunch of chars from the process all at once */ + Lisp_Object filter; + /* (funcall SENTINEL PROCESS) when process state changes */ + Lisp_Object sentinel; + /* Buffer that output is going to */ + Lisp_Object buffer; + /* Marker set to end of last buffer-inserted output from this process */ + Lisp_Object mark; + /* Lisp_Int of subprocess' PID, or a cons of + service/host if this is really a network connection */ + Lisp_Object pid; + + /* Symbol indicating status of process. + This may be a symbol: run, stop, exit, signal */ + Lisp_Object status_symbol; + + /* Exit code if process has terminated, + signal which stopped/interrupted process + or 0 if process is running */ + int exit_code; + /* Non-false if process has exited and "dumped core" on its way down */ + char core_dumped; + + /* This next field is only actually used #ifdef ENERGIZE */ + /* if this flag is not NIL, then filter will do the read on the + channel, rather than having a call to make_string. + This only works if the filter is a subr. */ + char filter_does_read; + /* Non-nil means kill silently if Emacs is exited. */ + char kill_without_query; + char selected; + /* Event-count of last event in which this process changed status. */ + volatile int tick; + /* Event-count of last such event reported. */ + int update_tick; + /* Low level streams used in input and output, connected to child */ + Lisp_Object pipe_instream; + Lisp_Object pipe_outstream; +#ifdef FILE_CODING + /* Data end streams, decoding and encoding pipe_* streams */ + Lisp_Object coding_instream; + Lisp_Object coding_outstream; +#endif + + /* Implementation dependent data */ + void *process_data; +}; + +/* Macros to refer to data connection streams */ +#ifdef FILE_CODING +#define DATA_INSTREAM(p) (p)->coding_instream +#define DATA_OUTSTREAM(p) (p)->coding_outstream +#else +#define DATA_INSTREAM(p) (p)->pipe_instream +#define DATA_OUTSTREAM(p) (p)->pipe_outstream +#endif + +/* Random externs from process.c */ +extern Lisp_Object Qrun, Qstop, Qopen, Qclosed; +extern Lisp_Object Qtcpip; +extern Lisp_Object Vprocess_connection_type; +extern Lisp_Object Vprocess_list; + +extern c_hashtable usid_to_process; + +extern volatile int process_tick; + +#ifdef HAVE_MULTICAST +extern Lisp_Object Qmulticast; +#endif + +#ifdef PROCESS_IO_BLOCKING +extern Lisp_Object network_stream_blocking_port_list; +#endif /* PROCESS_IO_BLOCKING */ + +Lisp_Object make_process_internal (Lisp_Object name); +void init_process_io_handles (struct Lisp_Process *p, void* in, + void* out, int flags); +void send_process (Lisp_Object proc, + Lisp_Object relocatable, + CONST Bufbyte *nonrelocatable, + int start, int len); + +#endif /* _XEMACS_PROCIMPL_H_ */
--- a/src/redisplay-msw.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/redisplay-msw.c Mon Aug 13 10:24:41 2007 +0200 @@ -324,6 +324,7 @@ int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d)); HDC hdc = FRAME_MSWINDOWS_DC (f); int real_char_p = (rb->type == RUNE_CHAR && rb->object.chr.ch != '\n'); + unsigned int face_index=0; char *p_char = NULL; int n_char = 0; RECT rect = { xpos, @@ -352,10 +353,8 @@ /* Use cursor fg/bg for block cursor, or character fg/bg for the bar. Output nothing at eol if bar cursor */ - cachel = WINDOW_FACE_CACHEL (w, - (bar_p - ? rb->findex - : get_builtin_face_cache_index (w, Vtext_cursor_face))); + face_index = get_builtin_face_cache_index (w, Vtext_cursor_face); + cachel = WINDOW_FACE_CACHEL (w, (bar_p ? rb->findex : face_index)); mswindows_update_dc (hdc, font, cachel->foreground, cachel->background, Qnil); ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE|ETO_CLIPPED, &rect, p_char, n_char, NULL); @@ -363,8 +362,8 @@ if (focus && bar_p) { rect.right = rect.left + (EQ (bar, Qt) ? 1 : 2); - cachel = WINDOW_FACE_CACHEL (w, - get_builtin_face_cache_index (w, Vtext_cursor_face)); + face_index = get_builtin_face_cache_index (w, Vtext_cursor_face); + cachel = WINDOW_FACE_CACHEL (w, face_index); mswindows_update_dc (hdc, Qnil, Qnil, cachel->background, Qnil); ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE, &rect, NULL, 0, NULL); } @@ -381,8 +380,8 @@ n_char = 1; } - cachel = WINDOW_FACE_CACHEL (w, (real_char_p ? rb->findex - : get_builtin_face_cache_index (w, Vdefault_face))); + face_index = get_builtin_face_cache_index (w, Vdefault_face); + cachel = WINDOW_FACE_CACHEL (w, (real_char_p ? rb->findex : face_index)); mswindows_update_dc (hdc, Qnil, cachel->foreground, cachel->background, Qnil); ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE | ETO_CLIPPED,
--- a/src/redisplay-output.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/redisplay-output.c Mon Aug 13 10:24:41 2007 +0200 @@ -744,10 +744,21 @@ struct display_line *dl; struct display_block *db; struct rune *rb; - int x = w->last_point_x[CURRENT_DISP]; int y = w->last_point_y[CURRENT_DISP]; + extern int cursor_in_echo_area; + + /* + * Bail if cursor_in_echo_area is non-zero and we're fiddling + * with the cursor in a minibuffer window, since that is a + * special case that is handled elsewhere and this function + * need not handle it. Return 1 so the caller will assume we + * succeeded. + */ + if (cursor_in_echo_area && MINI_WINDOW_P (w)) + return 1; + if (y < 0 || y >= Dynarr_length (cla)) return 0; @@ -958,7 +969,15 @@ redisplay_redraw_cursor (struct frame *f, int run_end_begin_meths) { struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f)); - + extern int cursor_in_echo_area; + + if (cursor_in_echo_area) + if (FRAME_HAS_MINIBUF_P (f)) + { + w = XWINDOW (FRAME_MINIBUF_WINDOW (f)); + } + else + return; redraw_cursor_in_window (w, run_end_begin_meths); }
--- a/src/s/cygwin32.h Mon Aug 13 10:23:52 2007 +0200 +++ b/src/s/cygwin32.h Mon Aug 13 10:24:41 2007 +0200 @@ -78,6 +78,14 @@ #endif extern void cygwin32_win32_to_posix_path_list(const char*, char*); extern int cygwin32_win32_to_posix_path_list_buf_size(const char*); +struct timeval; +struct timezone; +extern int gettimeofday(struct timeval *tp, struct timezone *tzp); +extern int gethostname (char* name, int namelen); +extern char* mktemp(char *); +extern double logb(double); +extern void sync(); +extern int ioctl(int, int, ...); #endif #ifdef HAVE_MS_WINDOWS @@ -89,7 +97,7 @@ #define ORDINARY_LINK #endif -#define C_SWITCH_SYSTEM -Wno-sign-compare +#define C_SWITCH_SYSTEM -Wno-sign-compare -Wno-implicit #undef MOD_ALT #undef MOD_CONTROL #undef MOD_SHIFT
--- a/src/sheap.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/sheap.c Mon Aug 13 10:24:41 2007 +0200 @@ -25,10 +25,10 @@ #include "sheap-adjust.h" #ifdef MULE -#define STATIC_HEAP_BASE 0x500000 +#define STATIC_HEAP_BASE 0x600000 #define STATIC_HEAP_SLOP 0x30000 #else -#define STATIC_HEAP_BASE 0x400000 +#define STATIC_HEAP_BASE 0x500000 #define STATIC_HEAP_SLOP 0x30000 #endif #define STATIC_HEAP_SIZE \
--- a/src/symsinit.h Mon Aug 13 10:23:52 2007 +0200 +++ b/src/symsinit.h Mon Aug 13 10:24:41 2007 +0200 @@ -67,6 +67,7 @@ void syms_of_dialog_x (void); void syms_of_dialog (void); void syms_of_dired (void); +void syms_of_dlopen (void); void syms_of_doc (void); void syms_of_editfns (void); void syms_of_elhash (void); @@ -189,6 +190,11 @@ void lstream_type_create_mule_coding (void); void lstream_type_create_print (void); +/* Initialize process types */ + +void process_type_create_mswindows (void); +void process_type_create_unix (void); + /* Allow for Fprovide() (dump-time only). */ void init_provide_once (void); @@ -266,6 +272,8 @@ void vars_of_objects_x (void); void vars_of_print (void); void vars_of_process (void); +void vars_of_process_mswindows (void); +void vars_of_process_unix (void); void vars_of_profile (void); void vars_of_ralloc (void); void vars_of_redisplay (void);
--- a/src/sysdep.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/sysdep.c Mon Aug 13 10:24:41 2007 +0200 @@ -633,7 +633,7 @@ if (str) sys_chdir (str); -#if !defined (NO_SUBPROCESSES) +#if !defined (NO_SUBPROCESSES) && !defined (WINDOWSNT) close_process_descs (); /* Close Emacs's pipes/ptys */ #endif @@ -718,6 +718,79 @@ kill(process, SIGTSTP); #endif } + + +/* Given FD, obtain pty buffer size. When no luck, a good guess is made, + so that the function works even fd is not a pty. */ + +int +get_pty_max_bytes (int fd) +{ + int pty_max_bytes; + +#if defined (HAVE_FPATHCONF) && defined (_PC_MAX_CANON) + pty_max_bytes = fpathconf (fd, _PC_MAX_CANON); + if (pty_max_bytes < 0) +#endif + pty_max_bytes = 250; + + /* Deduct one, to leave space for the eof. */ + pty_max_bytes--; + + return pty_max_bytes; +} + +/* Figure out the eof character for the FD. */ + +Bufbyte +get_eof_char (int fd) +{ + CONST Bufbyte ctrl_d = (Bufbyte) '\004'; + + if (!isatty (fd)) + return ctrl_d; +#ifdef HAVE_TERMIOS + { + struct termios t; + tcgetattr (fd, &t); +#if 0 + /* What is the following line designed to do??? -mrb */ + if (strlen ((CONST char *) t.c_cc) < (unsigned int) (VEOF + 1)) + return ctrl_d; + else + return (Bufbyte) t.c_cc[VEOF]; +#endif + return t.c_cc[VEOF] == CDISABLE ? ctrl_d : (Bufbyte) t.c_cc[VEOF]; + } +#else /* ! HAVE_TERMIOS */ + /* On Berkeley descendants, the following IOCTL's retrieve the + current control characters. */ +#if defined (TIOCGETC) + { + struct tchars c; + ioctl (fd, TIOCGETC, &c); + return (Bufbyte) c.t_eofc; + } +#else /* ! defined (TIOCGLTC) && defined (TIOCGETC) */ + /* On SYSV descendants, the TCGETA ioctl retrieves the current control + characters. */ +#ifdef TCGETA + { + struct termio t; + ioctl (fd, TCGETA, &t); + if (strlen ((CONST char *) t.c_cc) < (unsigned int) (VINTR + 1)) + return ctrl_d; + else + return (Bufbyte) t.c_cc[VINTR]; + } +#else /* ! defined (TCGETA) */ + /* Rather than complain, we'll just guess ^D, which is what + * earlier emacsen always used. */ + return ctrl_d; +#endif /* ! defined (TCGETA) */ +#endif /* ! defined (TIOCGETC) */ +#endif /* ! defined (HAVE_TERMIOS) */ +} /* Set the logical window size associated with descriptor FD to HEIGHT and WIDTH. This is used mainly with ptys. */
--- a/src/sysdep.h Mon Aug 13 10:23:52 2007 +0200 +++ b/src/sysdep.h Mon Aug 13 10:24:41 2007 +0200 @@ -43,6 +43,9 @@ void wait_without_blocking (void); +int get_pty_max_bytes (int fd); +Bufbyte get_eof_char (int fd); + /* Wait for subprocess with process id `pid' to terminate and make sure it will get eliminated (not remain forever as a zombie) */ void wait_for_termination (int pid);
--- a/src/unexcw.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/unexcw.c Mon Aug 13 10:24:41 2007 +0200 @@ -199,7 +199,7 @@ /* The .idata section. */ if (read (a_out, &f_idata, sizeof (f_idata)) != sizeof (f_idata) && - strcmp (f_idata.s_name, ".idata")) + strcmp (f_idata.s_name, ".rdata")) { PERROR ("no .idata section"); } @@ -238,12 +238,13 @@ f_data_s_vaddr = f_data.s_vaddr; f_data.s_vaddr = f_bss.s_vaddr; f_data.s_paddr += new_bss_size; - +#if 0 if (f_data.s_size + f_idata.s_size != f_ohdr.dsize) { printf("section size doesn't tally with dsize %lx != %lx\n", f_data.s_size + f_idata.s_size, f_ohdr.dsize); } +#endif f_data.s_size += new_bss_size; lseek (a_new, 0, SEEK_SET); /* write file header */ @@ -283,7 +284,7 @@ { PERROR("failed to write data header"); } - + printf("writing .idata header\n"); f_idata.s_scnptr += file_sz_change; if (f_idata.s_lnnoptr != 0) f_idata.s_lnnoptr += file_sz_change; @@ -292,7 +293,7 @@ { PERROR("failed to write idata header"); } - + /* copy other section headers adjusting the file offset */ for (i=0; i<(f_hdr.f_nscns-3); i++) {
--- a/src/window.c Mon Aug 13 10:23:52 2007 +0200 +++ b/src/window.c Mon Aug 13 10:24:41 2007 +0200 @@ -66,7 +66,9 @@ static int window_char_height_to_pixel_height (struct window *w, int char_height, int include_gutters_p); -static void change_window_height (struct window *w, int delta, int widthflag); +static void change_window_height (struct window *w, int delta, int widthflag, + int inpixels); +static int window_displayed_pixel_height (struct window *); /* Thickness of shadow border around 3d modelines. */ @@ -1329,6 +1331,16 @@ return make_int (decode_window (window)->pixel_height); } +DEFUN ("window-displayed-pixel-height", Fwindow_displayed_pixel_height, 0, 1, 0, /* +Return the height in pixels of the buffer-displaying portion of WINDOW. +Unlike `window-pixel-height', the space occupied by the gutters +(modeline, horizontal scrollbar, ...) is not counted. +*/ + (window)) +{ + return make_int (window_displayed_pixel_height (decode_window (window))); +} + DEFUN ("window-width", Fwindow_width, 0, 1, 0, /* Return the number of display columns in WINDOW. This is the width that is usable columns available for text in WINDOW. @@ -3400,7 +3412,21 @@ { struct window *w = decode_window (window); CHECK_INT (n); - change_window_height (w, XINT (n), !NILP (side)); + change_window_height (w, XINT (n), !NILP (side), /* inpixels */ 0); + return Qnil; +} + +DEFUN ("enlarge-window-pixels", Fenlarge_window_pixels, 1, 3, "_p", /* +Make the selected window ARG pixels bigger. +From program, optional second arg non-nil means grow sideways ARG pixels, +and optional third ARG specifies the window to change instead of the +selected window. +*/ + (n, side, window)) +{ + struct window *w = decode_window (window); + CHECK_INT (n); + change_window_height (w, XINT (n), !NILP (side), /* inpixels */ 1); return Qnil; } @@ -3413,7 +3439,22 @@ (n, side, window)) { CHECK_INT (n); - change_window_height (decode_window (window), -XINT (n), !NILP (side)); + change_window_height (decode_window (window), -XINT (n), !NILP (side), + /* inpixels */ 0); + return Qnil; +} + +DEFUN ("shrink-window-pixels", Fshrink_window_pixels, 1, 3, "_p", /* +Make the selected window ARG pixels smaller. +From program, optional second arg non-nil means shrink sideways ARG pixels, +and optional third ARG specifies the window to change instead of the +selected window. +*/ + (n, side, window)) +{ + CHECK_INT (n); + change_window_height (decode_window (window), -XINT (n), !NILP (side), + /* inpixels */ 1); return Qnil; } @@ -3566,6 +3607,18 @@ return num_lines; } +/* + * Return height in pixels of buffer-displaying portion of window w. + * Does not include the gutters (modeline, scrollbars, ...) + */ +int +window_displayed_pixel_height (struct window *w) +{ + return (WINDOW_HEIGHT (w) + - window_top_gutter_height (w) + - window_bottom_gutter_height (w)); +} + static int window_pixel_width (Lisp_Object window) { @@ -3667,7 +3720,8 @@ keep everything consistent. */ static void -change_window_height (struct window *win, int delta, int widthflag) +change_window_height (struct window *win, int delta, int widthflag, + int inpixels) { Lisp_Object parent; Lisp_Object window = Qnil; @@ -3717,7 +3771,8 @@ sizep = &CURSIZE (w); dim = CURCHARSIZE (w); - if ((dim + delta) < MINCHARSIZE (window)) + if ((inpixels && (*sizep + delta) < MINSIZE (window)) || + (!inpixels && (dim + delta) < MINCHARSIZE (window))) { if (MINI_WINDOW_P (XWINDOW (window))) return; @@ -3728,7 +3783,8 @@ } } - delta *= (widthflag ? defwidth : defheight); + if (!inpixels) + delta *= (widthflag ? defwidth : defheight); { int maxdelta; @@ -5003,6 +5059,7 @@ w->toolbar_buttons_captioned_p = p->toolbar_buttons_captioned_p; w->default_toolbar = p->default_toolbar; w->default_toolbar_width = p->default_toolbar_width; + w->default_toolbar_height = p->default_toolbar_height; w->default_toolbar_visible_p = p->default_toolbar_visible_p; w->default_toolbar_border_width = p->default_toolbar_border_width; #endif /* HAVE_TOOLBARS */ @@ -5271,6 +5328,7 @@ p->toolbar_buttons_captioned_p = w->toolbar_buttons_captioned_p; p->default_toolbar = w->default_toolbar; p->default_toolbar_width = w->default_toolbar_width; + p->default_toolbar_height = w->default_toolbar_height; p->default_toolbar_visible_p = w->default_toolbar_visible_p; p->default_toolbar_border_width = w->default_toolbar_border_width; #endif /* HAVE_TOOLBARS */ @@ -5503,6 +5561,7 @@ DEFSUBR (Fwindow_frame); DEFSUBR (Fwindow_height); DEFSUBR (Fwindow_displayed_height); + DEFSUBR (Fwindow_displayed_pixel_height); DEFSUBR (Fwindow_width); DEFSUBR (Fwindow_pixel_height); DEFSUBR (Fwindow_pixel_width); @@ -5539,7 +5598,9 @@ DEFSUBR (Fselect_window); DEFSUBR (Fsplit_window); DEFSUBR (Fenlarge_window); + DEFSUBR (Fenlarge_window_pixels); DEFSUBR (Fshrink_window); + DEFSUBR (Fshrink_window_pixels); DEFSUBR (Fscroll_up); DEFSUBR (Fscroll_down); DEFSUBR (Fscroll_left);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/DLL/dltest.c Mon Aug 13 10:24:41 2007 +0200 @@ -0,0 +1,40 @@ +/* +Make a symbolic link to ${blddir}/src/config.h in this directory and do: + +gcc -shared -fPIC -Demacs -DHAVE_CONFIG_H -I. \ + -I/home/xemacs/xemacs-20.0/src -g dltest.c -o dltest +*/ + +# include <config.h> +# include "lisp.h" +# include "emacsfns.h" + +Lisp_Object Qdltest_counter; + +DEFUN ("dltest", Fdltest, 0, 0, 0, /* +Simple test function. +*/ +()) +{ + Qdltest_counter = make_int(XINT(Qdltest_counter) + 1); + + return Qdltest_counter; +} + +void +vars_of() +{ + DEFVAR_LISP("dltest-counter", &Qdltest_counter /* +counter. +*/ ); + + printf("Ten = %d\n", 10); + + Qdltest_counter = make_int(10); +} + +void +syms_of() +{ + DEFSUBR(Fdltest); +}