# HG changeset patch # User cvs # Date 1186997905 -7200 # Node ID 3078fd1074e86f5d039011cb4d2877511d3c83b4 # Parent 4fc5f13f3bd3eb64b1ded271eb737bc77406f62b Import from CVS: tag r21-2-39 diff -r 4fc5f13f3bd3 -r 3078fd1074e8 CHANGES-beta --- a/CHANGES-beta Mon Aug 13 11:37:23 2007 +0200 +++ b/CHANGES-beta Mon Aug 13 11:38:25 2007 +0200 @@ -1,3 +1,19 @@ +to 21.2.39 "Millennium" +-- Safer coding-priority-list -- Stephen Turnbull +-- Andreas Jaeger resigns as core maintainer :-( +-- Make font-lock know about all C++ keywords -- Enrico Scholz +-- Comments beginning in column zero are no longer indented by + indent-for-comment -- Adrian Aichner +-- Better documentation for package creation -- Stephen Turnbull +-- input-method-xfs.c removed. Functionality incorporated into + input-method-xlib.c -- Kazuyuki IENAGA +-- replace-buffer-in-windows fixes -- Yoshiki Hayashi +-- Fix redisplay bugs with buffer-local face specifiers -- Yoshiki Hayashi +-- More printing fixes -- Martin Buchholz +-- Another SGI dumping fix -- Martin Buchholz +-- A new Windows installer in netinstall -- Andy Piper +-- Support Berkeley DB 3.1 -- Daiki Ueno + to 21.2.38 "Peisino,Ak(B" -- Keyboard commands to set code system now work in file-coding Emacsen! -- Jan Vroonhof (actually in 21.2.37) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 ChangeLog --- a/ChangeLog Mon Aug 13 11:37:23 2007 +0200 +++ b/ChangeLog Mon Aug 13 11:38:25 2007 +0200 @@ -1,3 +1,21 @@ +2000-12-31 Martin Buchholz + + * XEmacs 21.2.39 is released. + +2000-02-02 Daiki Ueno + + * configure.in: Added check if the berkdb has db_create or not. + +2000-10-11 Yoshiki Hayashi + + * configure.in: Fix broken gcc detection for 2.7.2. + +2000-12-11 Andy Piper + + * configure.in (XE_COMPUTE_RUNPATH): add netinstall as a subdirectory. + + * netinstall: new net installer for MS-Windows. + 2000-12-05 Martin Buchholz * XEmacs 21.2.38 is released. diff -r 4fc5f13f3bd3 -r 3078fd1074e8 PROBLEMS --- a/PROBLEMS Mon Aug 13 11:37:23 2007 +0200 +++ b/PROBLEMS Mon Aug 13 11:38:25 2007 +0200 @@ -1258,6 +1258,39 @@ ** Linux +*** Mandrake (all versions) + +Cannot be fully supported by XEmacs developers because they insist on +applying known broken patches. + +One known issue is that on keyboards with both a Meta key (typically +the Windows key on PCs) and an Alt key, XEmacs wants to bind the Meta +modifier to the Meta key. Mandrake has a policy that XEmacs +Meta-chords should use the Alt key, which they enforce by patching +XEmacs's modifier-handling code, making the Meta and Alt modifiers +synonymous. This will break planned upgrades to XEmacs to allow menu +hotkeys; be warned. See next topic for how to implement Meta-on-Alt +portably. + +*** I want XEmacs to use the Alt key, not the XXX key, for Meta commands + +For historical reasons, XEmacs looks for a Meta key, then an Alt key. +It binds Meta commands to the X11 modifier bit attached to the first +of these it finds. On PCs, the Windows key is often assigned the Meta +bit, but many desktop environments go to great lengths to get all apps +to use the Alt key, and reserve the Windows key to (sensibly enough) +the window manager. + +One correct way to implement this was suggested on comp.emacs.xemacs +(by Kilian Foth and in more detail by Michael Piotrowski): unmap the +Meta modifier using xmodmap or xkb, and then map the Meta/Windows key +to the Super or Hyper modifier. XEmacs will not find the Meta keysym, +and default to using the Alt key for Meta keybindings. Typically few +applications use the (X11) Meta modifier (sawfish is one); it is +tedious but not too much so to teach them to use Super instead of +Meta. There may be further useful hints in the discussion of +keymapping on non-Linux platforms. + *** You get crashes in a non-C locale with Linux GNU Libc 2.0. Internationalization was not the top priority for GNU Libc 2.0. @@ -1285,16 +1318,20 @@ *** Slow startup on Linux. People using systems based on the Linux kernel sometimes report that -startup takes 10 to 15 seconds longer than `usual'. +startup takes 10 to 15 seconds longer than `usual'. There are two +problems, one older, one newer. + +**** Old problem: IPv4 host lookup -This is because Emacs looks up the host name when it starts. -Normally, this takes negligible time; the extra delay is due to -improper system configuration. This problem can occur for both -networked and non-networked machines. +On older systems, this is because Emacs looks up the host name when it +starts. Normally, this takes negligible time; the extra delay is due +to improper system configuration. (Recent Linux distros usually have +this configuration correct "out of the box".) This problem can occur +for both networked and non-networked machines. Here is how to fix the configuration. It requires being root. -**** Networked Case +***** Networked Case First, make sure the files `/etc/hosts' and `/etc/host.conf' both exist. The first line in the `/etc/hosts' file should look like this @@ -1313,7 +1350,7 @@ database of addresses and names (e.g., some SLIP connections dynamically allocate ip addresses). -**** Non-Networked Case +***** Non-Networked Case The solution described in the networked case applies here as well. However, if you never intend to network your machine, you can use a @@ -1321,6 +1358,45 @@ `touch /etc/host.conf' suffices to create the file. The `/etc/hosts' file is not necessary with this approach. +**** New problem: IPv6 CNAME lookup + +A newer problem is due to XEmacs changing to use the modern +getaddrinfo() interface from the older gethostbyname() interface. The +solution above is insufficient, because getaddrinfo() by default tries +to get IPv6 information for localhost. This always involves a dns +lookup to get the CNAME, and the strategies above don't work. It then +falls back to IPv4 behavior. This is good[tm]; trust us. + +***** Robust network case + +Configure your network so that there are no nameservers configured +until the network is actually running. getaddrinfo() will not try to +access a nameserver that isn't configured. + +***** Flaky network case + +If you have a flaky modem or DSL connection that can be relied on only +to go down whenever you want to bring XEmacs up, you need to force +IPv4 behavior. Explicitly setting DISPLAY=127.0.0.1:0.0 (or whatever +is appropriate) works in most cases. + +If you cannot or do not want to do that, you can hard code IPv4 +behavior in src/process-unix.c. This is bad[tm], on your own head be +it. In the function unix_canonicalize_host_name() about ten lines +down, change the statement + + hints.ai_family = AF_UNSPEC; + +to + + hints.ai_family = PF_INET; + +and rebuild XEmacs. + +getaddrinfo() is also called in src/sysdep.c:init_system_name() and in +src/process-unix.c:unix_open_network_stream(). It should not be +useful to make this change in either of those places. + ** IRIX *** On Irix, I don't see the toolbar icons and I'm getting lots of diff -r 4fc5f13f3bd3 -r 3078fd1074e8 configure --- a/configure Mon Aug 13 11:37:23 2007 +0200 +++ b/configure Mon Aug 13 11:38:25 2007 +0200 @@ -2785,10 +2785,10 @@ { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; } ;; *:i*86*:2.7.2*) - case "$GCC_VERSION" in - 2.7.2) - case "$CFLAGS" in - *-O2*|*-O3*) + case "$CFLAGS" in + *-O2*|*-O3*) + case "$GCC_VERSION" in + 2.7.2) case "$CFLAGS" in *-fno-strength-reduce*) ;; *) @@ -2800,17 +2800,17 @@ esac ;; esac + case "$CFLAGS" in + *-fno-caller-saves*) ;; + *) + echo "$ac_t""yes" 1>&6 + echo "configure: warning: Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using" 1>&2 + echo "configure: warning: -fno-caller-saves." 1>&2 + { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; } + ;; + esac ;; esac - case "$CFLAGS" in - *-fno-caller-saves*) ;; - *) - echo "$ac_t""yes" 1>&6 - echo "configure: warning: Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using" 1>&2 - echo "configure: warning: -fno-caller-saves." 1>&2 - { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; } - ;; - esac ;; esac echo "$ac_t""no" 1>&6 @@ -6533,6 +6533,11 @@ EOF } + + MAKE_SUBDIR="$MAKE_SUBDIR netinstall" && if test "$extra_verbose" = "yes"; then echo " Appending \"netinstall\" to \$MAKE_SUBDIR"; fi + SRC_SUBDIR_DEPS="$SRC_SUBDIR_DEPS netinstall" && if test "$extra_verbose" = "yes"; then echo " Appending \"netinstall\" to \$SRC_SUBDIR_DEPS"; fi + INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR netinstall" && if test "$extra_verbose" = "yes"; then echo " Appending \"netinstall\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi + install_pp="$blddir/lib-src/installexe.sh" libs_system="$libs_system -lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lwinspool" && if test "$extra_verbose" = "yes"; then echo " Appending \"-lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lwinspool\" to \$libs_system"; fi test "$with_dragndrop" != no && dragndrop_proto="$dragndrop_proto msw" && if test "$extra_verbose" = "yes"; then echo " Appending \"msw\" to \$dragndrop_proto"; fi @@ -6570,12 +6575,12 @@ fi fi cat > conftest.$ac_ext < int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; } EOF -if { (eval echo configure:6579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:6584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MSG_SELECT @@ -6639,15 +6644,15 @@ if test "$with_x11" = "yes"; then ac_safe=`echo "X11/extensions/shape.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/extensions/shape.h""... $ac_c" 1>&6 -echo "configure:6643: checking for X11/extensions/shape.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6694,7 +6699,7 @@ esac echo "checking for WM_COMMAND option" 1>&6 -echo "configure:6698: checking for WM_COMMAND option" >&5; +echo "configure:6703: checking for WM_COMMAND option" >&5; if test "$with_wmcommand" != "no"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_WMCOMMAND @@ -6709,15 +6714,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:6713: checking for X11/Xauth.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6740,12 +6745,12 @@ } test -z "$with_xauth" && { echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:6744: checking for XauGetAuthByAddr in -lXau" >&5 +echo "configure:6749: checking for XauGetAuthByAddr in -lXau" >&5 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'` xe_check_libs=" -lXau " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6801,15 +6806,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:6805: checking for ${dir}tt_c.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6845,12 +6850,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:6849: checking "$xe_msg_checking"" >&5 +echo "configure:6854: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6918,15 +6923,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:6922: checking for Dt/Dt.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6949,12 +6954,12 @@ } test -z "$with_cde" && { echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:6953: checking for DtDndDragStart in -lDtSvc" >&5 +echo "configure:6958: checking for DtDndDragStart in -lDtSvc" >&5 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lDtSvc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7035,7 +7040,7 @@ if test "$with_dragndrop" != "no" ; then echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6 -echo "configure:7039: checking if drag and drop API is needed" >&5 +echo "configure:7044: checking if drag and drop API is needed" >&5 if test -n "$dragndrop_proto" ; then with_dragndrop=yes echo "$ac_t""yes (${dragndrop_proto} )" 1>&6 @@ -7055,18 +7060,18 @@ fi echo "checking for LDAP" 1>&6 -echo "configure:7059: checking for LDAP" >&5 +echo "configure:7064: 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:7062: checking for ldap.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7089,15 +7094,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:7093: checking for lber.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7101: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7121,12 +7126,12 @@ if test "$with_ldap" != "no"; then echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6 -echo "configure:7125: checking for ldap_search in -lldap" >&5 +echo "configure:7130: checking for ldap_search in -lldap" >&5 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7162,12 +7167,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:7166: checking "$xe_msg_checking"" >&5 +echo "configure:7171: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7203,12 +7208,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber -lkrb" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:7207: checking "$xe_msg_checking"" >&5 +echo "configure:7212: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber -lkrb" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7244,12 +7249,12 @@ xe_msg_checking="for ldap_open in -lldap" test -n "-llber -lkrb -ldes" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb -ldes" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:7248: checking "$xe_msg_checking"" >&5 +echo "configure:7253: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber -lkrb -ldes" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7311,10 +7316,10 @@ for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7315: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7368,20 +7373,20 @@ if test "$with_postgresql" != "no"; then echo "checking for PostgreSQL" 1>&6 -echo "configure:7372: checking for PostgreSQL" >&5 +echo "configure:7377: checking for PostgreSQL" >&5 for header_dir in "" "pgsql/" "postgresql/"; do ac_safe=`echo "${header_dir}libpq-fe.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ${header_dir}libpq-fe.h""... $ac_c" 1>&6 -echo "configure:7377: checking for ${header_dir}libpq-fe.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7385: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7405,12 +7410,12 @@ test -n "$libpq_fe_h_file" && { echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6 -echo "configure:7409: checking for PQconnectdb in -lpq" >&5 +echo "configure:7414: checking for PQconnectdb in -lpq" >&5 ac_lib_var=`echo pq'_'PQconnectdb | sed 'y%./+-%__p_%'` xe_check_libs=" -lpq " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7454,12 +7459,12 @@ echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6 -echo "configure:7458: checking for PQconnectStart in -lpq" >&5 +echo "configure:7463: checking for PQconnectStart in -lpq" >&5 ac_lib_var=`echo pq'_'PQconnectStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lpq " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7518,15 +7523,15 @@ if test "$window_system" != "none"; then echo "checking for graphics libraries" 1>&6 -echo "configure:7522: checking for graphics libraries" >&5 +echo "configure:7527: checking for graphics libraries" >&5 xpm_problem="" if test -z "$with_xpm"; then echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6 -echo "configure:7527: checking for Xpm - no older than 3.4f" >&5 +echo "configure:7532: checking for Xpm - no older than 3.4f" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext < @@ -7535,7 +7540,7 @@ XpmIncludeVersion != XpmLibraryVersion() ? 1 : XpmIncludeVersion < 30406 ? 2 : 0 ;} EOF -if { (eval echo configure:7539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:7544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest dummy_arg; xpm_status=$?; if test "$xpm_status" = "0"; then @@ -7577,17 +7582,17 @@ libs_x="-lXpm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXpm\" to \$libs_x"; fi echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6 -echo "configure:7581: checking for \"FOR_MSW\" xpm" >&5 +echo "configure:7586: checking for \"FOR_MSW\" xpm" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* xpm_for_msw=no else @@ -7613,15 +7618,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:7617: checking for compface.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7630: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7644,12 +7649,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:7648: checking for UnGenFace in -lcompface" >&5 +echo "configure:7653: checking for UnGenFace in -lcompface" >&5 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` xe_check_libs=" -lcompface " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7712,12 +7717,12 @@ if test "$with_png $with_tiff" != "no no"; then echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6 -echo "configure:7716: checking for inflate in -lc" >&5 +echo "configure:7721: checking for inflate in -lc" >&5 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7747,12 +7752,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 -echo "configure:7751: checking for inflate in -lz" >&5 +echo "configure:7756: checking for inflate in -lz" >&5 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lz " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7782,12 +7787,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6 -echo "configure:7786: checking for inflate in -lgz" >&5 +echo "configure:7791: checking for inflate in -lgz" >&5 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lgz " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7828,15 +7833,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:7832: checking for jpeglib.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7859,12 +7864,12 @@ } test -z "$with_jpeg" && { echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:7863: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:7868: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7911,10 +7916,10 @@ png_problem="" test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:7915: checking for pow" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pow=yes" else @@ -7958,15 +7963,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:7962: checking for png.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7970: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7989,12 +7994,12 @@ } test -z "$with_png" && { echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:7993: checking for png_read_image in -lpng" >&5 +echo "configure:7998: checking for png_read_image in -lpng" >&5 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'` xe_check_libs=" -lpng " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8028,10 +8033,10 @@ } if test -z "$with_png"; then echo $ac_n "checking for workable png version information""... $ac_c" 1>&6 -echo "configure:8032: checking for workable png version information" >&5 +echo "configure:8037: checking for workable png version information" >&5 xe_check_libs="-lpng -lz" cat > conftest.$ac_ext < int main(int c, char **v) { @@ -8039,7 +8044,7 @@ if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1; return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;} EOF -if { (eval echo configure:8043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:8048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest dummy_arg; png_status=$?; if test "$png_status" = "0"; then @@ -8082,15 +8087,15 @@ test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6 -echo "configure:8086: checking for tiffio.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8113,12 +8118,12 @@ } test -z "$with_tiff" && { echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:8117: checking for TIFFClientOpen in -ltiff" >&5 +echo "configure:8122: checking for TIFFClientOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'` xe_check_libs=" -ltiff " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8168,10 +8173,10 @@ if test "$with_x11" = "yes"; then echo "checking for X11 graphics libraries" 1>&6 -echo "configure:8172: checking for X11 graphics libraries" >&5 +echo "configure:8177: checking for X11 graphics libraries" >&5 echo "checking for the Athena widgets" 1>&6 -echo "configure:8175: checking for the Athena widgets" >&5 +echo "configure:8180: checking for the Athena widgets" >&5 case "$with_athena" in "xaw" | "") athena_variant=Xaw athena_3d=no ;; @@ -8185,12 +8190,12 @@ if test "$athena_3d" = "no"; then echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:8189: checking for XawScrollbarSetThumb in -l$athena_variant" >&5 +echo "configure:8194: checking for XawScrollbarSetThumb in -l$athena_variant" >&5 ac_lib_var=`echo $athena_variant'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'` xe_check_libs=" -l$athena_variant " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8217,12 +8222,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:8221: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:8226: checking for threeDClassRec in -l$athena_variant" >&5 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -l$athena_variant " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8264,12 +8269,12 @@ else echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:8268: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:8273: checking for threeDClassRec in -l$athena_variant" >&5 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -l$athena_variant " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8298,12 +8303,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6 -echo "configure:8302: checking for threeDClassRec in -lXaw" >&5 +echo "configure:8307: checking for threeDClassRec in -lXaw" >&5 ac_lib_var=`echo Xaw'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -lXaw " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8345,15 +8350,15 @@ if test "$athena_3d" = "no"; then ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8349: checking for X11/Xaw/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8373,15 +8378,15 @@ echo "$ac_t""no" 1>&6 ac_safe=`echo "X11/Xaw/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/XawInit.h""... $ac_c" 1>&6 -echo "configure:8377: checking for X11/Xaw/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8385: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8407,15 +8412,15 @@ else ac_safe=`echo "X11/$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/$athena_variant/XawInit.h""... $ac_c" 1>&6 -echo "configure:8411: checking for X11/$athena_variant/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8432,15 +8437,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "X11/$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/$athena_variant/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8436: checking for X11/$athena_variant/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8449: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8468,15 +8473,15 @@ if test -z "$athena_h_path"; then ac_safe=`echo "$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $athena_variant/XawInit.h""... $ac_c" 1>&6 -echo "configure:8472: checking for $athena_variant/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8493,15 +8498,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $athena_variant/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8497: checking for $athena_variant/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8530,15 +8535,15 @@ if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then ac_safe=`echo "X11/Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw3d/XawInit.h""... $ac_c" 1>&6 -echo "configure:8534: checking for X11/Xaw3d/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8542: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8547: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8555,15 +8560,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "X11/Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw3d/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8559: checking for X11/Xaw3d/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8595,15 +8600,15 @@ if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then ac_safe=`echo "Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xaw3d/XawInit.h""... $ac_c" 1>&6 -echo "configure:8599: checking for Xaw3d/XawInit.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8607: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8620,15 +8625,15 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xaw3d/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8624: checking for Xaw3d/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8632: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8660,15 +8665,15 @@ if test -z "$athena_h_path"; then ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6 -echo "configure:8664: checking for X11/Xaw/ThreeD.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8703,15 +8708,15 @@ ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:8707: checking for Xm/Xm.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8728,12 +8733,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:8732: checking for XmStringFree in -lXm" >&5 +echo "configure:8737: checking for XmStringFree in -lXm" >&5 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8773,9 +8778,9 @@ if test "$have_motif" = "yes"; then echo $ac_n "checking for Lesstif""... $ac_c" 1>&6 -echo "configure:8777: checking for Lesstif" >&5 +echo "configure:8782: checking for Lesstif" >&5 cat > conftest.$ac_ext < #ifdef LESSTIF_VERSION @@ -9181,7 +9186,7 @@ if test "$with_mule" = "yes" ; then echo "checking for Mule-related features" 1>&6 -echo "configure:9185: checking for Mule-related features" >&5 +echo "configure:9190: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -9206,15 +9211,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9210: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9218: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9245,12 +9250,12 @@ echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:9249: checking for strerror in -lintl" >&5 +echo "configure:9254: checking for strerror in -lintl" >&5 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'` xe_check_libs=" -lintl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9294,18 +9299,18 @@ echo "checking for Mule input methods" 1>&6 -echo "configure:9298: checking for Mule input methods" >&5 +echo "configure:9303: checking for Mule input methods" >&5 case "$with_xim" in "" | "yes" ) echo "checking for XIM" 1>&6 -echo "configure:9301: checking for XIM" >&5 +echo "configure:9306: checking for XIM" >&5 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6 -echo "configure:9304: checking for XOpenIM in -lX11" >&5 +echo "configure:9309: checking for XOpenIM in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9340,12 +9345,12 @@ if test "$have_motif $have_lesstif" = "yes no"; then echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6 -echo "configure:9344: checking for XmImMbLookupString in -lXm" >&5 +echo "configure:9349: checking for XmImMbLookupString in -lXm" >&5 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9421,15 +9426,15 @@ if test "$with_xfs" = "yes" ; then echo "checking for XFontSet" 1>&6 -echo "configure:9425: checking for XFontSet" >&5 +echo "configure:9430: checking for XFontSet" >&5 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6 -echo "configure:9428: checking for XmbDrawString in -lX11" >&5 +echo "configure:9433: checking for XmbDrawString in -lX11" >&5 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9480,15 +9485,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:9484: checking for wnn/jllib.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9497: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9513,10 +9518,10 @@ for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9517: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9568,12 +9573,12 @@ test "$ac_cv_func_crypt" != "yes" && { echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:9572: checking for crypt in -lcrypt" >&5 +echo "configure:9577: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` xe_check_libs=" -lcrypt " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9619,12 +9624,12 @@ if test -z "$with_wnn" -o "$with_wnn" = "yes"; then echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6 -echo "configure:9623: checking for jl_dic_list_e in -lwnn" >&5 +echo "configure:9628: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9653,12 +9658,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6 -echo "configure:9657: checking for jl_dic_list_e in -lwnn4" >&5 +echo "configure:9662: checking for jl_dic_list_e in -lwnn4" >&5 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn4 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9687,12 +9692,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6 -echo "configure:9691: checking for jl_dic_list_e in -lwnn6" >&5 +echo "configure:9696: checking for jl_dic_list_e in -lwnn6" >&5 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn6 " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9721,12 +9726,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6 -echo "configure:9725: checking for dic_list_e in -lwnn6_fromsrc" >&5 +echo "configure:9730: checking for dic_list_e in -lwnn6_fromsrc" >&5 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn6_fromsrc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9785,12 +9790,12 @@ if test "$with_wnn6" != "no"; then echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6 -echo "configure:9789: checking for jl_fi_dic_list in -l$libwnn" >&5 +echo "configure:9794: checking for jl_fi_dic_list in -l$libwnn" >&5 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'` xe_check_libs=" -l$libwnn " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9836,15 +9841,15 @@ if test "$with_canna" != "no"; then ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6 -echo "configure:9840: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9853: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9871,15 +9876,15 @@ c_switch_site="$c_switch_site -I/usr/local/canna/include" ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6 -echo "configure:9875: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9907,15 +9912,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:9911: checking for canna/RK.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9919: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9938,12 +9943,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:9942: checking for RkBgnBun in -lRKC" >&5 +echo "configure:9947: checking for RkBgnBun in -lRKC" >&5 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'` xe_check_libs=" -lRKC " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9977,12 +9982,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:9981: checking for jrKanjiControl in -lcanna" >&5 +echo "configure:9986: checking for jrKanjiControl in -lcanna" >&5 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'` xe_check_libs=" -lcanna " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10042,12 +10047,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:10046: checking for layout_object_getvalue in -li18n" >&5 +echo "configure:10051: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10144,10 +10149,10 @@ for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo 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 snprintf stpcpy strerror tzset ulimit usleep utimes waitpid vsnprintf fsync ftruncate umask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10148: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10201,10 +10206,10 @@ for ac_func in getpt _getpty grantpt unlockpt ptsname killpg tcgetpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10205: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10256,10 +10261,10 @@ echo $ac_n "checking for openpty""... $ac_c" 1>&6 -echo "configure:10260: checking for openpty" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_openpty=yes" else @@ -10301,12 +10306,12 @@ echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6 -echo "configure:10305: checking for openpty in -lutil" >&5 +echo "configure:10310: checking for openpty in -lutil" >&5 ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'` xe_check_libs=" -lutil " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10352,15 +10357,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10356: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10396,15 +10401,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10400: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10437,10 +10442,10 @@ for ac_func in isastream do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10441: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10494,15 +10499,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10498: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10539,10 +10544,10 @@ for ac_func in getloadavg do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10543: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10598,15 +10603,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10602: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10642,12 +10647,12 @@ echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:10646: checking for kstat_open in -lkstat" >&5 +echo "configure:10651: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10693,15 +10698,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:10697: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10710: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10733,12 +10738,12 @@ echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:10737: checking for kvm_read in -lkvm" >&5 +echo "configure:10742: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10783,16 +10788,16 @@ fi echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:10787: checking whether netdb declares h_errno" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:10796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 { test "$extra_verbose" = "yes" && cat << \EOF @@ -10812,16 +10817,16 @@ rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:10816: checking for sigsetjmp" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext < int main() { sigjmp_buf bar; sigsetjmp (bar, 0); ; return 0; } EOF -if { (eval echo configure:10825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10830: \"$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 @@ -10841,11 +10846,11 @@ rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:10845: checking whether localtime caches TZ" >&5 +echo "configure:10850: checking whether localtime caches TZ" >&5 if test "$ac_cv_func_tzset" = "yes"; then cat > conftest.$ac_ext < #if STDC_HEADERS @@ -10880,7 +10885,7 @@ exit (0); } EOF -if { (eval echo configure:10884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:10889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then emacs_cv_localtime_cache=no else @@ -10910,9 +10915,9 @@ if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6 -echo "configure:10914: checking whether gettimeofday accepts one or two arguments" >&5 -cat > conftest.$ac_ext <&5 +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""two" 1>&6 else @@ -10955,19 +10960,19 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:10959: checking for inline" >&5 +echo "configure:10964: checking for inline" >&5 ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -11008,17 +11013,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:11012: checking for working alloca.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:11022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -11042,10 +11047,10 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:11046: checking for alloca" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -11112,10 +11117,10 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:11116: checking whether alloca needs Cray hooks" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&6 -echo "configure:11143: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11195,10 +11200,10 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:11199: checking stack direction for C alloca" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:11226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_stack_direction=1 else @@ -11247,15 +11252,15 @@ ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:11251: checking for vfork.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11264: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11283,10 +11288,10 @@ fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:11287: checking for working vfork" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < @@ -11381,7 +11386,7 @@ } } EOF -if { (eval echo configure:11385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:11390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_vfork_works=yes else @@ -11407,10 +11412,10 @@ echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:11411: checking for working strcoll" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < main () @@ -11420,7 +11425,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:11424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:11429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_strcoll_works=yes else @@ -11448,10 +11453,10 @@ for ac_func in getpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11452: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11502,10 +11507,10 @@ done echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:11506: checking whether getpgrp takes no argument" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:11569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_getpgrp_void=yes else @@ -11587,10 +11592,10 @@ echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:11591: checking for working mmap" >&5 +echo "configure:11596: checking for working mmap" >&5 case "$opsys" in ultrix* ) have_mmap=no ;; *) cat > conftest.$ac_ext < #include @@ -11623,7 +11628,7 @@ return 1; } EOF -if { (eval echo configure:11627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:11632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then have_mmap=yes else @@ -11649,9 +11654,9 @@ if test "$rel_alloc $have_mmap" = "default yes"; then if test "$doug_lea_malloc" = "yes"; then echo $ac_n "checking for M_MMAP_THRESHOLD""... $ac_c" 1>&6 -echo "configure:11653: checking for M_MMAP_THRESHOLD" >&5 +echo "configure:11658: checking for M_MMAP_THRESHOLD" >&5 cat > conftest.$ac_ext < int main() { @@ -11663,7 +11668,7 @@ ; return 0; } EOF -if { (eval echo configure:11667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rel_alloc=no; echo "$ac_t""yes" 1>&6; else @@ -11688,15 +11693,15 @@ ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:11692: checking for termios.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11739,15 +11744,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:11743: checking for termio.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11779,10 +11784,10 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:11783: checking for socket" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -11820,15 +11825,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:11824: checking for netinet/in.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11845,15 +11850,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:11849: checking for arpa/inet.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11862: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11878,9 +11883,9 @@ } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:11882: checking "for sun_len member in struct sockaddr_un"" >&5 +echo "configure:11887: checking "for sun_len member in struct sockaddr_un"" >&5 cat > conftest.$ac_ext < @@ -11891,7 +11896,7 @@ static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:11895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_SOCKADDR_SUN_LEN @@ -11909,9 +11914,9 @@ fi rm -f conftest* echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6 -echo "configure:11913: checking "for ip_mreq struct in netinet/in.h"" >&5 +echo "configure:11918: checking "for ip_mreq struct in netinet/in.h"" >&5 cat > conftest.$ac_ext < @@ -11921,7 +11926,7 @@ static struct ip_mreq x; ; return 0; } EOF -if { (eval echo configure:11925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_MULTICAST @@ -11952,10 +11957,10 @@ echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:11956: checking for msgget" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_msgget=yes" else @@ -11993,15 +11998,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:11997: checking for sys/ipc.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12018,15 +12023,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:12022: checking for sys/msg.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12064,15 +12069,15 @@ ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:12068: checking for dirent.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12099,15 +12104,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:12103: checking for sys/dir.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12116: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12140,15 +12145,15 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:12144: checking for nlist.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12178,22 +12183,22 @@ echo "checking "for sound support"" 1>&6 -echo "configure:12182: checking "for sound support"" >&5 +echo "configure:12187: checking "for sound support"" >&5 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes if test "$with_native_sound" != "no"; then 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:12189: checking for multimedia/audio_device.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12241,12 +12246,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:12245: checking for ALopenport in -laudio" >&5 +echo "configure:12250: checking for ALopenport in -laudio" >&5 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12288,12 +12293,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:12292: checking for AOpenAudio in -lAlib" >&5 +echo "configure:12297: checking for AOpenAudio in -lAlib" >&5 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'` xe_check_libs=" -lAlib " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12342,15 +12347,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:12346: checking for ${dir}/soundcard.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12411,15 +12416,15 @@ if test "$with_nas_sound" != "no"; then ac_safe=`echo "audio/audiolib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for audio/audiolib.h""... $ac_c" 1>&6 -echo "configure:12415: checking for audio/audiolib.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12423: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12437,12 +12442,12 @@ echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6 -echo "configure:12441: checking for AuOpenServer in -laudio" >&5 +echo "configure:12446: checking for AuOpenServer in -laudio" >&5 ac_lib_var=`echo audio'_'AuOpenServer | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12492,7 +12497,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 @@ -12523,7 +12528,7 @@ # Extract the first word of "esd-config", so it can be a program name with args. set dummy esd-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:12527: checking for $ac_word" >&5 +echo "configure:12532: checking for $ac_word" >&5 if test -n "$have_esd_config"; then ac_cv_prog_have_esd_config="$have_esd_config" # Let the user override the test. @@ -12552,10 +12557,10 @@ c_switch_site="$c_switch_site `esd-config --cflags`" && if test "$extra_verbose" = "yes"; then echo " Appending \"`esd-config --cflags`\" to \$c_switch_site"; fi LIBS="`esd-config --libs` $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"`esd-config --libs`\" to \$LIBS"; fi echo $ac_n "checking for esd_play_stream""... $ac_c" 1>&6 -echo "configure:12556: checking for esd_play_stream" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_esd_play_stream=yes" else @@ -12629,7 +12634,7 @@ if test "$with_tty" = "yes" ; then echo "checking for TTY-related features" 1>&6 -echo "configure:12633: checking for TTY-related features" >&5 +echo "configure:12638: checking for TTY-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TTY EOF @@ -12645,12 +12650,12 @@ if test -z "$with_ncurses"; then echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:12649: checking for tgetent in -lncurses" >&5 +echo "configure:12654: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lncurses " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12694,15 +12699,15 @@ ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:12698: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12724,15 +12729,15 @@ ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6 -echo "configure:12728: checking for ncurses/term.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12762,15 +12767,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:12766: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12805,12 +12810,12 @@ for lib in curses termlib termcap; do echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 -echo "configure:12809: checking for tgetent in -l$lib" >&5 +echo "configure:12814: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12852,12 +12857,12 @@ else echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:12856: checking for tgetent in -lcurses" >&5 +echo "configure:12861: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lcurses " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12886,12 +12891,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:12890: checking for tgetent in -ltermcap" >&5 +echo "configure:12895: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -ltermcap " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12950,15 +12955,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:12954: checking for gpm.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12981,12 +12986,12 @@ } test -z "$with_gpm" && { echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:12985: checking for Gpm_Open in -lgpm" >&5 +echo "configure:12990: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13047,20 +13052,20 @@ test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \ != "no no no" && echo "checking for database support" 1>&6 -echo "configure:13051: checking for database support" >&5 +echo "configure:13056: checking for database support" >&5 if test "$with_database_gdbm $with_database_dbm" != "no no"; then ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6 -echo "configure:13056: checking for ndbm.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13090,12 +13095,12 @@ if test "$with_database_gdbm" != "no"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:13094: checking for dbm_open in -lgdbm" >&5 +echo "configure:13099: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13134,10 +13139,10 @@ if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:13138: checking for dbm_open" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -13179,12 +13184,12 @@ echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:13183: checking for dbm_open in -ldbm" >&5 +echo "configure:13188: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13236,10 +13241,10 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6 -echo "configure:13240: checking for Berkeley db.h" >&5 +echo "configure:13245: checking for Berkeley db.h" >&5 for header in "db/db.h" "db.h"; do cat > conftest.$ac_ext < @@ -13261,7 +13266,7 @@ ; return 0; } EOF -if { (eval echo configure:13265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* db_h_file="$header"; break else @@ -13277,9 +13282,9 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6 -echo "configure:13281: checking for Berkeley DB version" >&5 +echo "configure:13286: checking for Berkeley DB version" >&5 cat > conftest.$ac_ext < #if DB_VERSION_MAJOR > 1 @@ -13290,18 +13295,38 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* - echo "$ac_t""2" 1>&6; dbfunc=db_open -else - rm -rf conftest* - echo "$ac_t""1" 1>&6; dbfunc=dbopen + cat > conftest.$ac_ext < +#if DB_VERSION_MAJOR > 2 +yes +#endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""3" 1>&6; dbfunc=db_create +else + rm -rf conftest* + + echo "$ac_t""2" 1>&6; dbfunc=db_open +fi +rm -f conftest* + +else + rm -rf conftest* + + echo "$ac_t""1" 1>&6; dbfunc=dbopen fi rm -f conftest* echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6 -echo "configure:13302: checking for $dbfunc" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$dbfunc=yes" else @@ -13343,12 +13368,12 @@ echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6 -echo "configure:13347: checking for $dbfunc in -ldb" >&5 +echo "configure:13372: checking for $dbfunc in -ldb" >&5 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'` xe_check_libs=" -ldb " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13423,12 +13448,12 @@ if test "$with_socks" = "yes"; then echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6 -echo "configure:13427: checking for SOCKSinit in -lsocks" >&5 +echo "configure:13452: checking for SOCKSinit in -lsocks" >&5 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocks " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13494,22 +13519,22 @@ if test "$with_modules" != "no"; then echo "checking for module support" 1>&6 -echo "configure:13498: checking for module support" >&5 +echo "configure:13523: checking for module support" >&5 if test "$with_msw" = "yes"; then have_dl=yes; else ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:13505: checking for dlfcn.h" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13527,12 +13552,12 @@ echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:13531: checking for dlopen in -ldl" >&5 +echo "configure:13556: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -ldl " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13562,12 +13587,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 -echo "configure:13566: checking for dlopen in -lc" >&5 +echo "configure:13591: checking for dlopen in -lc" >&5 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13617,12 +13642,12 @@ else echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:13621: checking for shl_load in -ldld" >&5 +echo "configure:13646: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` xe_check_libs=" -ldld " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13660,12 +13685,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6 -echo "configure:13664: checking for dld_init in -ldld" >&5 +echo "configure:13689: checking for dld_init in -ldld" >&5 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'` xe_check_libs=" -ldld " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13721,7 +13746,7 @@ xealias=$internal_configuration echo "checking how to build dynamic libraries for ${xehost}" 1>&6 -echo "configure:13725: checking how to build dynamic libraries for ${xehost}" >&5 +echo "configure:13750: checking how to build dynamic libraries for ${xehost}" >&5 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts. case "$xehost" in *-*-linux-gnu*) ;; @@ -13749,9 +13774,9 @@ XEGCC=yes else echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:13753: checking checking whether we are using GNU C" >&5 +echo "configure:13778: checking checking whether we are using GNU C" >&5 cat > conftest.$ac_ext <&6 -echo "configure:13777: checking how to produce PIC code" >&5 +echo "configure:13802: checking how to produce PIC code" >&5 wl= can_build_shared=yes @@ -13869,18 +13894,18 @@ # Check to make sure the dll_cflags actually works. echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6 -echo "configure:13873: checking if PIC flag ${dll_cflags} really works" >&5 +echo "configure:13898: checking if PIC flag ${dll_cflags} really works" >&5 save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $dll_cflags -DPIC" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also @@ -13911,7 +13936,7 @@ xldf= xcldf= echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6 -echo "configure:13915: checking if C compiler can produce shared libraries" >&5 +echo "configure:13940: checking if C compiler can produce shared libraries" >&5 if test "$XEGCC" = yes; then xcldf="-shared" xldf="-shared" @@ -13962,14 +13987,14 @@ xe_libs= ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cc_produces_so=yes else @@ -13994,7 +14019,7 @@ if test "$XEGCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:13998: checking for ld used by GCC" >&5 +echo "configure:14023: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -14019,7 +14044,7 @@ esac else echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:14023: checking for GNU ld" >&5 +echo "configure:14048: checking for GNU ld" >&5 fi if test -z "$LTLD"; then @@ -14057,7 +14082,7 @@ # Check to see if it really is or isn't GNU ld. echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6 -echo "configure:14061: checking if the linker is GNU ld" >&5 +echo "configure:14086: checking if the linker is GNU ld" >&5 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LTLD -v 2>&1 &5; then xe_gnu_ld=yes @@ -14085,7 +14110,7 @@ # OK - only NOW do we futz about with ld. # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6 -echo "configure:14089: checking whether the linker supports shared libraries" >&5 +echo "configure:14114: checking whether the linker supports shared libraries" >&5 dll_ld=$CC dll_ldflags=$LDFLAGS ld_shlibs=yes @@ -14300,10 +14325,10 @@ for ac_func in dlerror _dlerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14304: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <&5 + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14365,11 +14390,11 @@ fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:14398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else diff -r 4fc5f13f3bd3 -r 3078fd1074e8 configure.in --- a/configure.in Mon Aug 13 11:37:23 2007 +0200 +++ b/configure.in Mon Aug 13 11:38:25 2007 +0200 @@ -1951,10 +1951,10 @@ AC_MSG_ERROR(Aborting due to known problem) ;; *:i*86*:2.7.2*) - case "$GCC_VERSION" in - 2.7.2) - case "$CFLAGS" in - *-O2*|*-O3*) + case "$CFLAGS" in + *-O2*|*-O3*) + case "$GCC_VERSION" in + 2.7.2) case "$CFLAGS" in *-fno-strength-reduce*) ;; *) @@ -1966,17 +1966,17 @@ esac ;; esac + case "$CFLAGS" in + *-fno-caller-saves*) ;; + *) + AC_MSG_RESULT(yes) + AC_MSG_WARN(Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using) + AC_MSG_WARN(-fno-caller-saves.) + AC_MSG_ERROR(Aborting due to known problem) + ;; + esac ;; esac - case "$CFLAGS" in - *-fno-caller-saves*) ;; - *) - AC_MSG_RESULT(yes) - AC_MSG_WARN(Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using) - AC_MSG_WARN(-fno-caller-saves.) - AC_MSG_ERROR(Aborting due to known problem) - ;; - esac ;; esac AC_MSG_RESULT(no) @@ -2760,6 +2760,12 @@ AC_CHECK_LIB(gdi32,main,with_msw=yes) if test "$with_msw" = "yes"; then AC_DEFINE(HAVE_MS_WINDOWS) + + dnl The net installer only works with MS-Windows currently + XE_APPEND(netinstall, MAKE_SUBDIR) + XE_APPEND(netinstall, SRC_SUBDIR_DEPS) + XE_APPEND(netinstall, INSTALL_ARCH_DEP_SUBDIR) + install_pp="$blddir/lib-src/installexe.sh" XE_APPEND(-lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lwinspool, libs_system) test "$with_dragndrop" != no && XE_APPEND(msw, dragndrop_proto) @@ -4110,7 +4116,14 @@ #if DB_VERSION_MAJOR > 1 yes #endif -], [AC_MSG_RESULT(2); dbfunc=db_open], [AC_MSG_RESULT(1); dbfunc=dbopen]) +], [AC_EGREP_CPP(yes, +[#include <$db_h_file> +#if DB_VERSION_MAJOR > 2 +yes +#endif +], [AC_MSG_RESULT(3); dbfunc=db_create],[ + AC_MSG_RESULT(2); dbfunc=db_open])],[ + AC_MSG_RESULT(1); dbfunc=dbopen]) AC_CHECK_FUNC($dbfunc, with_database_berkdb=yes need_libdb=no, [ AC_CHECK_LIB(db, $dbfunc, with_database_berkdb=yes need_libdb=yes)]) fi diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lib-src/ChangeLog --- a/lib-src/ChangeLog Mon Aug 13 11:37:23 2007 +0200 +++ b/lib-src/ChangeLog Mon Aug 13 11:38:25 2007 +0200 @@ -1,3 +1,7 @@ +2000-12-31 Martin Buchholz + + * XEmacs 21.2.39 is released. + 2000-12-05 Martin Buchholz * XEmacs 21.2.38 is released. diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lisp/ChangeLog --- a/lisp/ChangeLog Mon Aug 13 11:37:23 2007 +0200 +++ b/lisp/ChangeLog Mon Aug 13 11:38:25 2007 +0200 @@ -1,3 +1,50 @@ +2000-12-31 Martin Buchholz + + * XEmacs 21.2.39 is released. + +2000-12-27 Martin Buchholz + + * byte-optimize.el (byte-optimize-cond): + (byte-optimize-cond-1): New. + Rewrite `cond' in terms of `if' and `or', which are easier to optimize. + Optimizes (cond (x nil)) ==> nil. + Provide better diagnostic on malformed expr like (cond foo). + +2000-12-20 Stephen J. Turnbull + + * mule/mule-coding.el: + mule/mule-cmds.el (reset-language-environment, + set-language-environment-coding-systems): + Safer default coding-priority-list, corresponding to src/file-coding.h. + +2000-12-03 Jorma Laaksonen + + * package-admin.el: Allow package removal from + early-package-load-path. + +2000-12-15 Andreas Jaeger + + * about.el (about-maintainer-info): Update my entry. + +2000-12-11 Matt Tucker + + * packages.el (locate-library): Add support for bzip2 + compressed .el files. + +2000-12-12 Andy Piper + + * package-net.el: new file. + +2000-12-01 Enrico Scholz + + * font-lock.el: Add missing C++ keywords. + +2000-12-08 Adrian Aichner + + * simple.el (indent-for-comment): Preserve indentation of comments + starting in column 0, as documented in (Info-goto-node + "(xemacs)Comments"). Update docstring accordingly. + 2000-12-05 Martin Buchholz * XEmacs 21.2.38 is released. diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lisp/about.el --- a/lisp/about.el Mon Aug 13 11:37:23 2007 +0200 +++ b/lisp/about.el Mon Aug 13 11:38:25 2007 +0200 @@ -990,9 +990,6 @@ (widget-insert ".\n")) (aj (widget-insert "\ -In the XEmacs team I'm responsible for the packages which means mainly -applying patches and packaging the packages. - I'm a software developer working for the SuSE Labs of the Linux distributor SuSE. My main task is to improve the GNU C library.") (widget-insert ".\n")) @@ -1207,7 +1204,7 @@ (about-show-linked-info 'chr "\ Maintainer of the XEmacs FAQ and proud author of `zap-up-to-char'.\n") (about-show-linked-info 'aj "\ -`Package Patch Tender', beta tester and GNU libc developer.\n") +Former `Package Patch Tender', beta tester and GNU libc developer.\n") (flet ((print-short (name addr &optional shortinfo) (concat (about-with-face name 'italic) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lisp/byte-optimize.el --- a/lisp/byte-optimize.el Mon Aug 13 11:37:23 2007 +0200 +++ b/lisp/byte-optimize.el Mon Aug 13 11:38:25 2007 +0200 @@ -939,41 +939,23 @@ (byte-optimize-predicate form) (nth 1 form)))) +;;; For the byte optimizer, `cond' is just overly sweet syntactic sugar. +;;; So we rewrite (cond ...) in terms of `if' and `or', +;;; which are easier to optimize. (defun byte-optimize-cond (form) - ;; if any clauses have a literal nil as their test, throw them away. - ;; if any clause has a literal non-nil constant as its test, throw - ;; away all following clauses. - (let (rest) - ;; This must be first, to reduce (cond (t ...) (nil)) to (progn t ...) - (while (setq rest (assq nil (cdr form))) - (setq form (delq rest (copy-sequence form)))) - (if (memq nil (cdr form)) - (setq form (delq nil (copy-sequence form)))) - (setq rest form) - (while (setq rest (cdr rest)) - (cond ((byte-compile-trueconstp (car-safe (car rest))) - (cond ((eq rest (cdr form)) - (setq form - (if (cdr (car rest)) - (if (cdr (cdr (car rest))) - (cons 'progn (cdr (car rest))) - (nth 1 (car rest))) - (car (car rest))))) - ((cdr rest) - (setq form (copy-sequence form)) - (setcdr (memq (car rest) form) nil))) - (setq rest nil))))) - ;; - ;; Turn (cond (( )) ... ) into (or (cond ... )) - (if (eq 'cond (car-safe form)) - (let ((clauses (cdr form))) - (if (and (consp (car clauses)) - (null (cdr (car clauses)))) - (list 'or (car (car clauses)) - (byte-optimize-cond - (cons (car form) (cdr (cdr form))))) - form)) - form)) + (byte-optimize-cond-1 (cdr form))) + +(defun byte-optimize-cond-1 (clauses) + (cond + ((null clauses) nil) + ((consp (car clauses)) + (nconc + (case (length (car clauses)) + (1 `(or ,(nth 0 (car clauses)))) + (2 `(if ,(nth 0 (car clauses)) ,(nth 1 (car clauses)))) + (t `(if ,(nth 0 (car clauses)) (progn ,@(cdr (car clauses)))))) + (when (cdr clauses) (list (byte-optimize-cond-1 (cdr clauses)))))) + (t (error "malformed cond clause %s" (car clauses))))) (defun byte-optimize-if (form) ;; (if ) ==> diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lisp/font-lock.el --- a/lisp/font-lock.el Mon Aug 13 11:37:23 2007 +0200 +++ b/lisp/font-lock.el Mon Aug 13 11:38:25 2007 +0200 @@ -2099,22 +2099,38 @@ (c++-keywords ; ("break" "continue" "do" "else" "for" "if" "return" "switch" "while" ; "asm" "catch" "delete" "new" "operator" "sizeof" "this" "throw" "try" -; "protected" "private" "public") - (concat "asm\\|break\\|c\\(atch\\|ontinue\\)\\|d\\(elete\\|o\\)\\|" - "else\\|for\\|if\\|new\\|" - "p\\(r\\(ivate\\|otected\\)\\|ublic\\)\\|return\\|" - "s\\(izeof\\|witch\\)\\|t\\(h\\(is\\|row\\)\\|ry\\)\\|while")) +; "protected" "private" "public" "const_cast" "dynamic_cast" "reinterpret_cast" +; "static_cast" "and" "bitor" "or" "xor" "compl" "bitand" "and_eq" +; "or_eq" "xor_eq" "not" "not_eq" "typeid" "false" "true") + (concat "a\\(nd\\(\\|_eq\\)\\|sm\\)\\|" + "b\\(it\\(or\\|and\\)\\|reak\\)\\|" + "c\\(atch\\|o\\(mpl\\|n\\(tinue\\|st_cast\\)\\)\\)\\|" + "d\\(elete\\|o\\|ynamic_cast\\)\\|" + "else\\|" + "f\\(alse\\|or\\)\\|if\\|" + "n\\(ew\\|ot\\(\\|_eq\\)\\)\\|" + "p\\(r\\(ivate\\|otected\\)\\|ublic\\)\\|" + "or\\(\\|_eq\\)\\|" + "re\\(interpret_cast\\|turn\\)\\|" + "s\\(izeof\\|tatic_cast\\|witch\\)\\|" + "t\\(h\\(is\\|row\\)\\|r\\(ue\\|y\\)\\|ypeid\\)\\|" + "xor\\(\\|_eq\\)\\|while")) (c++-type-types ; ("auto" "extern" "register" "static" "typedef" "struct" "union" "enum" ; "signed" "unsigned" "short" "long" "int" "char" "float" "double" ; "void" "volatile" "const" "class" "inline" "friend" "bool" -; "virtual" "complex" "template") +; "virtual" "complex" "template" "explicit" "mutable" "export" "namespace" +; "using" "typename" "wchar_t") (concat "auto\\|bool\\|c\\(har\\|lass\\|o\\(mplex\\|nst\\)\\)\\|" - "double\\|e\\(num\\|xtern\\)\\|f\\(loat\\|riend\\)\\|" - "in\\(line\\|t\\)\\|long\\|register\\|" + "double\\|" + "e\\(num\\|x\\(p\\(licit\\|ort\\)\\|tern\\)\\)\\|" + "f\\(loat\\|riend\\)\\|" + "in\\(line\\|t\\)\\|long\\|mutable\\|namespace\\|register\\|" "s\\(hort\\|igned\\|t\\(atic\\|ruct\\)\\)\\|" - "t\\(emplate\\|ypedef\\)\\|un\\(ion\\|signed\\)\\|" - "v\\(irtual\\|o\\(id\\|latile\\)\\)")) ; 11 ()s deep. + "t\\(emplate\\|ype\\(def\\|name\\)\\)\\|" + "u\\(\\(n\\(ion\\|signed\\)\\|sing\\)\\)\\|" + "v\\(irtual\\|o\\(id\\|latile\\)\\)\\|" + "wchar_t")) ; 11 ()s deep. (ctoken "\\(\\sw\\|\\s_\\|[:~*&]\\)+") ) (setq c-font-lock-keywords-1 diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lisp/lisp-mnt.el --- a/lisp/lisp-mnt.el Mon Aug 13 11:37:23 2007 +0200 +++ b/lisp/lisp-mnt.el Mon Aug 13 11:38:25 2007 +0200 @@ -343,7 +343,7 @@ (defun lm-version (&optional file) "Return the version listed in file FILE, or current buffer if FILE is nil. -This can befound in an RCS or SCCS header to crack it out of." +This can be found in an RCS or SCCS header to crack it out of." (save-excursion (if file (find-file file)) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lisp/mule/mule-cmds.el --- a/lisp/mule/mule-cmds.el Mon Aug 13 11:37:23 2007 +0200 +++ b/lisp/mule/mule-cmds.el Mon Aug 13 11:38:25 2007 +0200 @@ -689,52 +689,68 @@ bound to each category are as follows coding category coding system -------------------------------------------------- - iso-8-2 iso-8859-1 + iso-7 iso-2022-7bit + no-conversion raw-text + utf-8 utf-8 iso-8-1 iso-8859-1 - iso-7 iso-2022-7bit + iso-8-2 ctext (iso-8859-1 alias) + iso-8-designate ctext (iso-8859-1 alias) iso-lock-shift iso-2022-lock - iso-8-designate iso-2022-8bit-ss2 - no-conversion raw-text shift-jis shift_jis big5 big5 - ucs-4 ---- - utf-8 ---- + ucs-4 iso-10646-ucs-4 " +;; The old table (from FSF synch?) was not what we use (cf mule-coding.el), +;; and as documented iso-8-designate is inconsistent with iso-2022-8bit-ss2. +;; The order of priorities of coding categories and the coding system +;; bound to each category are as follows +;; coding category coding system +;; -------------------------------------------------- +;; iso-8-2 iso-8859-1 +;; iso-8-1 iso-8859-1 +;; iso-7 iso-2022-7bit +;; iso-lock-shift iso-2022-lock +;; iso-8-designate iso-2022-8bit-ss2 +;; no-conversion raw-text +;; shift-jis shift_jis +;; big5 big5 +;; ucs-4 ---- +;; utf-8 ---- (interactive) - ;; This function formerly set default-enable-multibyte-characters to t, - ;; but that is incorrect. It should not alter the unibyte/multibyte choice. - (set-coding-category-system 'iso-7 'iso-2022-7bit) + (set-coding-category-system 'iso-7 'iso-2022-7) (set-coding-category-system 'iso-8-1 'iso-8859-1) - (set-coding-category-system 'iso-8-2 'iso-8859-1) + (set-coding-category-system 'iso-8-2 'ctext) (set-coding-category-system 'iso-lock-shift 'iso-2022-lock) - (set-coding-category-system 'iso-8-designate 'iso-2022-8bit-ss2) + (set-coding-category-system 'iso-8-designate 'ctext) (set-coding-category-system 'no-conversion 'raw-text) (set-coding-category-system 'shift-jis 'shift_jis) (set-coding-category-system 'big5 'big5) + ;; #### Can we now assume the existence of the 10646 coding systems? + ;; #### These lists need to be synched with the ones in mule-coding.el. (cond ((eq (coding-system-type (coding-category-system 'utf-8)) 'utf-8) (set-coding-category-system 'ucs-4 'iso-10646-ucs-4) (set-coding-category-system 'utf-8 'utf-8) (set-coding-priority-list - '(iso-8-1 + '(iso-7 + no-conversion + utf-8 + iso-8-1 iso-8-2 - iso-7 - iso-lock-shift iso-8-designate - utf-8 - ucs-4 - no-conversion + iso-lock-shift shift-jis - big5)) + big5 + ucs-4)) ) (t (set-coding-priority-list - '(iso-8-1 + '(iso-7 + no-conversion + iso-8-1 iso-8-2 - iso-7 + iso-8-designate iso-lock-shift - iso-8-designate - no-conversion shift-jis big5)) )) @@ -867,7 +883,17 @@ "Do various coding system setups for language environment LANGUAGE-NAME. The optional arg EOL-TYPE specifies the eol-type of the default value -of buffer-file-coding-system set by this function." +of buffer-file-coding-system set by this function. + +Note that `coding-priority-list' is not reset first; thus changing language +environment allows recognition of coding systems from previously set language +environments. (This will not work if the desired coding systems are from the +same category. E.g., starting with a Hebrew language environment, ISO 8859-8 +will be recognized. If you shift to Russian, ISO 8859-8 will be shadowed by +ISO 8859-5, and cannot be automatically recognized without resetting the +language environment to Hebrew. However, if you shift from Japanese to +Russian, ISO-2022-JP will continue to be automatically recognized, since +ISO-8859-5 and ISO-2022-JP are different coding categories.)" (let* ((priority (get-language-info language-name 'coding-priority)) (default-coding (car priority))) (if priority diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lisp/mule/mule-coding.el --- a/lisp/mule/mule-coding.el Mon Aug 13 11:37:23 2007 +0200 +++ b/lisp/mule/mule-coding.el Mon Aug 13 11:38:25 2007 +0200 @@ -174,9 +174,19 @@ ;; initialize the coding categories to something semi-reasonable ;; so that the remaining Lisp files can contain extended characters. ;; (They will be in ISO-7 format) +;; #### This list needs to be synched with the ones in mule-cmds.el. -(set-coding-priority-list '(iso-8-2 iso-8-designate iso-8-1 - iso-7 iso-lock-shift no-conversion)) +(set-coding-priority-list '(iso-7 + no-conversion + ;; utf-8 + iso-8-1 + iso-8-2 + iso-8-designate + iso-lock-shift + shift-jis + big5 + ;; ucs-4 + )) (set-coding-category-system 'iso-7 'iso-2022-7) (set-coding-category-system 'iso-8-designate 'ctext) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lisp/package-admin.el --- a/lisp/package-admin.el Mon Aug 13 11:37:23 2007 +0200 +++ b/lisp/package-admin.el Mon Aug 13 11:38:25 2007 +0200 @@ -165,13 +165,13 @@ (featurep package-feature) (setq autoload-dir (feature-file package-feature)) (setq autoload-dir (file-name-directory autoload-dir)) - (member autoload-dir late-package-load-path)) + (member autoload-dir (append early-package-load-path late-package-load-path))) ;; Find the corresponding entry in late-package (setq pkg-dir (car-safe (member-if (lambda (h) (string-match (concat "^" (regexp-quote h)) autoload-dir)) - late-packages)))) + (append (cdr early-packages) late-packages))))) (if pkg-dir pkg-dir ;; Ok we need to guess diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lisp/package-net.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/package-net.el Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,147 @@ +;;; package-net.el --- Installation and Maintenance of XEmacs packages + +;; Copyright (C) 2000 Andy Piper. + +;; Keywords: internal + +;; 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 + +;;; Commentary: + +;; Manipulate packages for the netinstall setup utility + +(require 'package-admin) +(require 'package-get) + +;; What path should we use from the myriad available? +;; For netinstall we just want something simple, and anyway this is only to +;; bootstrap the process. This will be: +;; /setup/ for native windows +;; /lib/xemacs/setup for cygwin. +(defun package-net-setup-directory () + (file-truename (concat data-directory "../../" (if (eq system-type 'cygwin32) + "xemacs/setup/" "setup/")))) + +(defun package-net-convert-index-to-ini (&optional destdir remote version) + "Convert the package index to ini file format in DESTDIR. +DESTDIR defaults to the value of `data-directory'." + (package-get-require-base remote) + + (setq destdir (file-name-as-directory (or destdir data-directory))) + (let ((buf (get-buffer-create "*setup.ini*"))) + (unwind-protect + (save-excursion + (set-buffer buf) + (erase-buffer buf) + (goto-char (point-min)) + (let ((entries package-get-base) entry plist) + (insert "# This file is automatically generated. If you edit it, your\n") + (insert "# edits will be discarded next time the file is generated.\n") + (insert "#\n\n") + (insert (format "setup-timestamp: %d\n" + (+ (* (car (current-time)) 65536) (car (cdr (current-time)))))) + (insert (format "setup-version: %s\n\n" (or version "1.0"))) + ;; Native version + ;; We give the package a capitalised name so that it appears at the top + (insert (format "@ %s\n" "xemacs-i586-pc-win32")) + (insert (format "version: %s\n" emacs-program-version)) + (insert "type: native\n") + (insert (format "install: binaries/win32/%s %d\n\n" + (concat emacs-program-name + "-i586-pc-win32-" + emacs-program-version ".tar.gz") 0)) + ;; Cygwin version + ;; We give the package a capitalised name so that it appears at the top + (insert (format "@ %s\n" "xemacs-i686-pc-cygwin32")) + (insert (format "version: %s\n" emacs-program-version)) + (insert "type: cygwin\n") + (insert (format "install: binaries/cygwin32/%s %d\n\n" + (concat emacs-program-name + "-i686-pc-cygwin32-" + emacs-program-version ".tar.gz") 6779200)) + ;; Standard packages + (while entries + (setq entry (car entries)) + (setq plist (car (cdr entry))) + (insert (format "@ %s\n" (symbol-name (car entry)))) + (insert (format "version: %s\n" (plist-get plist 'version))) + (insert (format "install: packages/%s %s\n" (plist-get plist 'filename) + (plist-get plist 'size))) + ;; These are not supported as yet + ;; + ;; (insert (format "source: %s\n" (plist-get plist 'source))) + ;; (insert "[prev]\n") + ;; (insert (format "version: %s\n" (plist-get plist 'version))) + ;; (insert (format "install: %s\n" (plist-get plist 'filename))) + ;; (insert (format "source: %s\n" (plist-get plist 'source))) + (insert "\n") + (setq entries (cdr entries)))) + (insert "# setup.ini file ends here\n") + (write-region (point-min) (point-max) (concat destdir "setup.ini"))) + (kill-buffer buf)))) + +(defun package-net-update-installed-db (&optional destdir) + "Write out the installed package index in a net install suitable format. +If DESTDIR is non-nil then use that as the destination directory. +DESTDIR defaults to the value of `package-net-setup-directory'." + ;; Need the local version + (package-get-require-base) + + (setq destdir (file-name-as-directory + (or destdir (package-net-setup-directory)))) + (let ((buf (get-buffer-create "*installed.db*"))) + (unwind-protect + (save-excursion + (set-buffer buf) + (erase-buffer buf) + (goto-char (point-min)) + (let ((entries package-get-base) entry plist) + (while entries + (setq entry (car entries)) + (setq plist (car (cdr entry))) + (insert (format "%s %s %s\n" (symbol-name (car entry)) + (plist-get plist 'filename) + (plist-get plist 'size))) + (setq entries (cdr entries)))) + (make-directory-path destdir) + (write-region (point-min) (point-max) (concat destdir "installed.db"))) + (kill-buffer buf)))) + +(defun package-net-convert-download-sites-to-mirrors (&optional destdir) + "Write out the download site list in a net install suitable format. +If DESTDIR is non-nil then use that as the destination directory. +DESTDIR defaults to the value of `data-directory'." + + (setq destdir (file-name-as-directory (or destdir data-directory))) + (let ((buf (get-buffer-create "*mirrors.lst*"))) + (unwind-protect + (save-excursion + (set-buffer buf) + (erase-buffer buf) + (goto-char (point-min)) + (let ((entries package-get-download-sites) entry) + (while entries + (setq entry (car entries)) + (insert (format "ftp://%s/%s;%s;%s\n" + (nth 1 entry) (substring (nth 2 entry) 0 -9) + (nth 0 entry) (nth 0 entry))) + (setq entries (cdr entries)))) + (write-region (point-min) (point-max) (concat destdir "mirrors.lst"))) + (kill-buffer buf)))) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lisp/packages.el --- a/lisp/packages.el Mon Aug 13 11:37:23 2007 +0200 +++ b/lisp/packages.el Mon Aug 13 11:38:25 2007 +0200 @@ -202,8 +202,10 @@ (member 'crypt-find-file-hook find-file-hooks))) ;; Compression involved. (if nosuffix - '("" ".gz" ".Z") - '(".elc" ".elc.gz" "elc.Z" ".el" ".el.gz" ".el.Z" "" ".gz" ".Z"))) + '("" ".gz" ".Z" ".bz2") + '(".elc" ".elc.gz" "elc.Z" ".elc.bz2" + ".el" ".el.gz" ".el.Z" ".el.bz2" + "" ".gz" ".Z" ".bz2"))) (t ;; No compression. (if nosuffix diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lisp/replace.el --- a/lisp/replace.el Mon Aug 13 11:37:23 2007 +0200 +++ b/lisp/replace.el Mon Aug 13 11:38:25 2007 +0200 @@ -394,8 +394,8 @@ If a match spreads across multiple lines, all those lines are shown. -If variable `list-matching-lines-whole-buffer' is non-nil, the entire buffer is -searched, otherwise search begins at point. +If variable `list-matching-lines-whole-buffer' is non-nil, the entire +buffer is searched, otherwise search begins at point. Each line is displayed with NLINES lines before and after, or -NLINES before if NLINES is negative. diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lisp/simple.el --- a/lisp/simple.el Mon Aug 13 11:37:23 2007 +0200 +++ b/lisp/simple.el Mon Aug 13 11:38:25 2007 +0200 @@ -2544,7 +2544,8 @@ :group 'fill-comments) (defun indent-for-comment () - "Indent this line's comment to comment column, or insert an empty comment." + "Indent this line's comment to comment column, or insert an empty +comment. Comments starting in column 0 are not moved." (interactive "*") (let* ((empty (save-excursion (beginning-of-line) (looking-at "[ \t]*$"))) @@ -2571,13 +2572,19 @@ (skip-syntax-backward "^ " (match-beginning 0))))) (setq begpos (point)) ;; Compute desired indent. - (if (= (current-column) - (setq indent (funcall comment-indent-function))) - (goto-char begpos) + ;; XEmacs change: Preserve indentation of comments starting in + ;; column 0, as documented. + (cond + ((= (current-column) 0) + (goto-char begpos)) + ((= (current-column) + (setq indent (funcall comment-indent-function))) + (goto-char begpos)) + (t ;; If that's different from current, change it. (skip-chars-backward " \t") (delete-region (point) begpos) - (indent-to indent)) + (indent-to indent))) ;; An existing comment? (if cpos (progn (goto-char cpos) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lwlib/ChangeLog --- a/lwlib/ChangeLog Mon Aug 13 11:37:23 2007 +0200 +++ b/lwlib/ChangeLog Mon Aug 13 11:38:25 2007 +0200 @@ -1,3 +1,23 @@ +2000-12-31 Martin Buchholz + + * XEmacs 21.2.39 is released. + +2000-12-30 Andy Piper + + * xlwtabs.c: remove assertion definitions and put them in + lwlib-internal.h. This has the effect of enabling assertions which + should have been done from the very start. + (TabsShuffleRows): fix duff assertion. + (PreferredSize3): use dimensions throughout. + (PreferredSize2): ditto. + (TabLayout): ditto. + (DrawFrame): be clever about the enclosing frame if the child + height is 0. + (TabsResize): don't configure children that are no visible + anyway. Make sure geometry calculations don't end up negative. + + * lwlib-internal.h: put in assertion definitions. + 2000-12-05 Martin Buchholz * XEmacs 21.2.38 is released. diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lwlib/lwlib-internal.h --- a/lwlib/lwlib-internal.h Mon Aug 13 11:37:23 2007 +0200 +++ b/lwlib/lwlib-internal.h Mon Aug 13 11:38:25 2007 +0200 @@ -3,6 +3,20 @@ #include "lwlib.h" +#ifdef USE_ASSERTIONS +/* Highly dubious kludge */ +/* (thanks, Jamie, I feel better now -- ben) */ +void assert_failed (const char *, int, const char *); +# define abort() (assert_failed (__FILE__, __LINE__, "abort()")) +# define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x)) +#else +# ifdef DEBUG_XEMACS +# define assert(x) ((x) ? (void) 0 : (void) abort ()) +# else +# define assert(x) +# endif +#endif + /* This represents a single widget within a widget tree. All the widgets in a widget tree are chained through the `next' field. `info' is a back pointer to the widget tree. */ diff -r 4fc5f13f3bd3 -r 3078fd1074e8 lwlib/xlwtabs.c --- a/lwlib/xlwtabs.c Mon Aug 13 11:37:23 2007 +0200 +++ b/lwlib/xlwtabs.c Mon Aug 13 11:38:25 2007 +0200 @@ -66,6 +66,8 @@ #include #include #include + +#include "lwlib-internal.h" #include "../src/xmu.h" #include "xlwtabsP.h" #include "xlwgcs.h" @@ -267,7 +269,7 @@ static void UndrawTab( TabsWidget tw, Widget child) ; static void TabWidth( Widget w) ; -static int TabLayout( TabsWidget, int wid, int hgt, Dimension *r_hgt, +static int TabLayout( TabsWidget, Dimension wid, Dimension hgt, Dimension *r_hgt, Bool query_only) ; static void GetPreferredSizes(TabsWidget) ; static void MaxChild(TabsWidget, Widget except, Dimension, Dimension) ; @@ -275,9 +277,9 @@ static int PreferredSize( TabsWidget, Dimension *reply_width, Dimension *reply_height, Dimension *reply_cw, Dimension *reply_ch) ; -static int PreferredSize2( TabsWidget, int cw, int ch, +static int PreferredSize2( TabsWidget, Dimension cw, Dimension ch, Dimension *rw, Dimension *rh) ; -static int PreferredSize3( TabsWidget, int wid, int hgt, +static int PreferredSize3( TabsWidget, Dimension wid, Dimension hgt, Dimension *rw, Dimension *rh) ; static void MakeSizeRequest(TabsWidget) ; @@ -392,20 +394,6 @@ WidgetClass tabsWidgetClass = (WidgetClass)&tabsClassRec; - - -#ifdef DEBUG -#ifdef __STDC__ -#define assert(e) \ - if(!(e)) fprintf(stderr,"yak! %s at %s:%d\n",#e,__FILE__,__LINE__) -#else -#define assert(e) \ - if(!(e)) fprintf(stderr,"yak! e at %s:%d\n",__FILE__,__LINE__) -#endif -#else -#define assert(e) -#endif - #define TabsNumChildren(tw) (((TabsWidget)tw)->composite.num_children) #define TabVisible(tab) \ (XtIsManaged(tab) && \ @@ -570,18 +558,20 @@ tw->tabs.child_width = cw = tw->core.width - 2 * SHADWID ; tw->tabs.child_height = ch = - tw->core.height - tw->tabs.tab_total - 2 * SHADWID ; - + tw->core.height < (tw->tabs.tab_total + 2 * SHADWID) ? 0 : + tw->core.height - tw->tabs.tab_total - 2 * SHADWID ; for(i=0, childP=tw->composite.children; i < num_children; ++i, ++childP) - if( TabVisible(*childP) ) + if( XtIsManaged(*childP) ) { tab = (TabsConstraints) (*childP)->core.constraints ; bw = (*childP)->core.border_width ; - XtConfigureWidget(*childP, SHADWID,tw->tabs.tab_total+SHADWID, - cw-bw*2,ch-bw*2, bw) ; + /* Don't do anything if we can't see any of the child. */ + if (ch >= bw*2 && ch > 0 && cw >= bw*2 && cw > 0) + XtConfigureWidget(*childP, SHADWID,tw->tabs.tab_total+SHADWID, + cw-bw*2,ch-bw*2, bw) ; } if( XtIsRealized(w) ) { XClearWindow(XtDisplay((Widget)tw), XtWindow((Widget)tw)) ; @@ -873,7 +863,8 @@ myrequest.width = wid ; myrequest.height = hgt ; myrequest.request_mode = CWWidth | CWHeight ; - + + assert (wid > 0 && hgt > 0); /* If child is only querying, or if we're going to have to * offer the child a compromise, then make this a query only. */ @@ -1505,8 +1496,26 @@ GC botgc = tw->tabs.botGC ; Dimension s = SHADWID ; Dimension ch = tw->tabs.child_height ; - Draw3dBox((Widget)tw, 0,tw->tabs.tab_total, - tw->core.width, ch+2*s, s, topgc, botgc) ; + if (ch > 0) + Draw3dBox((Widget)tw, 0,tw->tabs.tab_total, + tw->core.width, ch+2*s, s, topgc, botgc) ; + else + { + Widget w = tw->tabs.topWidget ; + if (w != NULL) + { + TabsConstraints tab = (TabsConstraints) w->core.constraints ; + Draw3dBox((Widget)tw, 0,tw->core.height - 2*s, + tab->tabs.x, 2*s, s, topgc, botgc); + Draw3dBox((Widget)tw, tab->tabs.x + tab->tabs.width, + tw->core.height - 2*s, + tw->core.width - tab->tabs.x - tab->tabs.width, 2*s, s, + topgc, botgc); + } + else + Draw3dBox((Widget)tw, 0,tw->core.height - 2*s, + tw->core.width, 2*s, s, topgc, botgc) ; + } } @@ -1712,7 +1721,10 @@ */ static int -TabLayout(TabsWidget tw, int wid, int hgt, Dimension *reply_height, Bool query_only) +TabLayout(TabsWidget tw, + Dimension wid, + Dimension hgt, + Dimension *reply_height, Bool query_only) { int i, row, done = 0, display_rows = 0 ; int num_children = tw->composite.num_children ; @@ -1817,7 +1829,7 @@ XtWidgetGeometry preferred ; for(i=tw->composite.num_children; --i >=0; ++childP) - if( XtIsManaged(*childP) && *childP != except ) + if( TabVisible (*childP) /*XtIsManaged(*childP)*/ && *childP != except ) { (void) XtQueryGeometry(*childP, NULL, &preferred) ; cw = Max(cw, preferred.width + preferred.border_width * 2 ) ; @@ -1859,7 +1871,7 @@ { display_rows = tw->tabs.numRows ; real_rows = tw->tabs.realRows ; - assert( display_rows >= real_rows ) ; + assert( display_rows <= real_rows ) ; if( real_rows > 1 ) { @@ -1959,18 +1971,22 @@ static int PreferredSize2( TabsWidget tw, - int cw, /* child width, height */ - int ch, + Dimension cw, /* child width, height */ + Dimension ch, Dimension *reply_width, /* total widget size */ Dimension *reply_height) { Dimension s = SHADWID ; + int ret; /* make room for shadow frame */ cw += s*2 ; ch += s*2 ; - return PreferredSize3(tw, cw, ch, reply_width, reply_height) ; + ret = PreferredSize3(tw, cw, ch, reply_width, reply_height) ; + + assert (*reply_width > 0 && *reply_height > 0); + return ret; } @@ -1979,8 +1995,8 @@ static int PreferredSize3( TabsWidget tw, - int wid, /* child width, height */ - int hgt, + Dimension wid, /* child width, height */ + Dimension hgt, Dimension *reply_width, /* total widget size */ Dimension *reply_height) { diff -r 4fc5f13f3bd3 -r 3078fd1074e8 man/ChangeLog --- a/man/ChangeLog Mon Aug 13 11:37:23 2007 +0200 +++ b/man/ChangeLog Mon Aug 13 11:38:25 2007 +0200 @@ -1,3 +1,12 @@ +2000-12-31 Martin Buchholz + + * XEmacs 21.2.39 is released. + +2000-12-05 Stephen J. Turnbull + + * internals/internals.texi (General Coding Rules): further document + usage of symsinit.h. Reorder slightly. + 2000-11-29 Stephen J. Turnbull * xemacs/packages.texi (Creating Packages): new node. diff -r 4fc5f13f3bd3 -r 3078fd1074e8 man/internals/internals.texi --- a/man/internals/internals.texi Mon Aug 13 11:37:23 2007 +0200 +++ b/man/internals/internals.texi Mon Aug 13 11:38:25 2007 +0200 @@ -1721,21 +1721,6 @@ tools means that a greater variety of development tools are available to the developer. -Almost every module contains a @code{syms_of_*()} function and a -@code{vars_of_*()} function. The former declares any Lisp primitives -you have defined and defines any symbols you will be using. The latter -declares any global Lisp variables you have added and initializes global -C variables in the module. For each such function, declare it in -@file{symsinit.h} and make sure it's called in the appropriate place in -@file{emacs.c}. @strong{Important}: There are stringent requirements on -exactly what can go into these functions. See the comment in -@file{emacs.c}. The reason for this is to avoid obscure unwanted -interactions during initialization. If you don't follow these rules, -you'll be sorry! If you want to do anything that isn't allowed, create -a @code{complex_vars_of_*()} function for it. Doing this is tricky, -though: You have to make sure your function is called at the right time -so that all the initialization dependencies work out. - Every module includes @file{} (angle brackets so that @samp{--srcdir} works correctly; @file{config.h} may or may not be in the same directory as the C sources) and @file{lisp.h}. @file{config.h} @@ -1753,6 +1738,24 @@ @file{config.h} files. Which one will be used if you @samp{#include "config.h"}? +Almost every module contains a @code{syms_of_*()} function and a +@code{vars_of_*()} function. The former declares any Lisp primitives +you have defined and defines any symbols you will be using. The latter +declares any global Lisp variables you have added and initializes global +C variables in the module. @strong{Important}: There are stringent +requirements on exactly what can go into these functions. See the +comment in @file{emacs.c}. The reason for this is to avoid obscure +unwanted interactions during initialization. If you don't follow these +rules, you'll be sorry! If you want to do anything that isn't allowed, +create a @code{complex_vars_of_*()} function for it. Doing this is +tricky, though: you have to make sure your function is called at the +right time so that all the initialization dependencies work out. + +Declare each function of these kinds in @file{symsinit.h}. Make sure +it's called in the appropriate place in @file{emacs.c}. You never need +to include @file{symsinit.h} directly, because it is included by +@file{lisp.h}. + @strong{All global and static variables that are to be modifiable must be declared uninitialized.} This means that you may not use the ``declare with initializer'' form for these variables, such as @code{int @@ -5865,7 +5868,7 @@ @enumerate @item We do not use the mark bit (which does not exist for C structures -anyway), we use a big hash table instead. +anyway); we use a big hash table instead. @item We do not use the mark function of lrecords but instead rely on the @@ -5882,7 +5885,7 @@ allows us to look up a pdump_entry_list_elmt with the object it points to). Entries are added with @code{pdump_add_entry()} and looked up with @code{pdump_get_entry()}. There is no need for entry removal. The hash -value is computed quite basically from the object pointer by +value is computed quite simply from the object pointer by @code{pdump_make_hash()}. The roots for the marking are: @@ -5893,7 +5896,7 @@ call for protected variables we do not want to dump). @item -the @code{pdump_wire}'d variables (@code{staticpro} is equivalent to +the @code{pdump_wire}'d variables (@code{staticpro()} is equivalent to @code{staticpro_nodump()} + @code{pdump_wire()}). @item @@ -5925,7 +5928,7 @@ @item the C compiler is required to adjust the size of a struct so that you -can have an array of them next to each other. This means you can have a +can have an array of them next to each other. This means you can have an upper bound of the alignment requirements of a given structure by looking at which power of two its size is a multiple. @@ -5943,14 +5946,14 @@ The maximum alignment requirement we take into account is 2^8. @code{pdump_allocate_offset()} only has to do a linear allocation, -starting at offset 256 (this leaves room for the header and keep the +starting at offset 256 (this leaves room for the header and keeps the alignments happy). @node The header, Data dumping, Address allocation, Dumping phase @subsection The header The next step creates the file and writes a header with a signature and -some random informations in it (number of staticpro, number of assigned +some random information in it (number of staticpro, number of assigned lrecord types, etc...). The reloc_address field, which indicates at which address the file should be loaded if we want to avoid post-reload relocation, is set to 0. It then seeks to offset 256 (base offset for @@ -5985,7 +5988,7 @@ a vector of all the offsets to the objects in the file that include a description (for faster relocation at reload time) @item -the pdump_wired and pdump_wired_list arrays +the pdump_wire and pdump_wire_list arrays @end enumerate For each of the arrays we write both the pointer to the variables and @@ -5993,7 +5996,7 @@ are global, the pointers are still valid when restarting the program and are used to regenerate the global pointers. -The @code{pdump_wired_list} array is a special case. The variables it +The @code{pdump_wire_list} array is a special case. The variables it points to are the head of weak linked lists of lisp objects of the same type. Not all objects of this list are dumped so the relocated pointer we associate with them points to the first dumped object of the list, or diff -r 4fc5f13f3bd3 -r 3078fd1074e8 man/xemacs/packages.texi --- a/man/xemacs/packages.texi Mon Aug 13 11:37:23 2007 +0200 +++ b/man/xemacs/packages.texi Mon Aug 13 11:38:25 2007 +0200 @@ -19,6 +19,7 @@ * Package Terminology:: Understanding different kinds of packages. * Using Packages:: How to install and use packages. * Building Packages:: Building packages from sources. +* Creating Packages:: The basics. * Available Packages:: A brief, out-of-date, directory of packaged LISP. @end menu @@ -339,7 +340,7 @@ @end enumerate -@node Building Packages, Available Packages, Using Packages, Packages +@node Building Packages, Creating Packages, Using Packages, Packages @comment node-name, next, previous, up Source packages are available from the @file{packages/source-packages} @@ -381,7 +382,7 @@ of TeXinfo documentation if present. @item srckit -Usually aliased to @code{make srckit-std}. This does a @code{make +Usually aliased to @code{srckit-std}. This does a @code{make distclean} and creates a package source tarball in the staging directory. This is generally only of use for package maintainers. @@ -402,7 +403,132 @@ @end table -@node Available Packages, , Building Packages, Packages +@node Creating Packages, Available Packages, Building Packages, Packages +@comment node-name, next, previous, up + +Creating a package from an existing Lisp library is not very difficult. + +In addition to the Lisp libraries themselves, you need a +@file{package-info.in} file and a simple @file{Makefile}. The rest is +done by @file{XEmacs.rules}, part of the packaging system +infrastructure. + +@file{package-info.in} contains a single Lisp form like this: + +@example +(name ; your package's name + (standards-version 1.1 + version VERSION + author-version AUTHOR_VERSION + date DATE + build-date BUILD_DATE + maintainer MAINTAINER + distribution xemacs ; change to "mule" if MULE is needed + priority high + category CATEGORY + dump nil + description "description" ; a one-line description string + filename FILENAME + md5sum MD5SUM + size SIZE + provides (feature1 feature2) ; one for every `provides' form + requires (REQUIRES) + type regular +)) +@end example + +You must fill in the four commented lines. The value of @code{name} is +the name of your package as an unquoted symbol. Normally it is the name +of the main Lisp file or principal feature provided. The allowed values +for distribution are @code{xemacs} and @code{mule}. Write them as +unquoted symbols. The @code{description} is a quoted Lisp string; use +the usual conventions. The value for @code{provides} is a list of +feature symbols (written unquoted). All of the features provided by +libraries in your package should be elements of this list. Implementing +an automatic method for generating the @file{provides} line is +desirable, but as yet undone. + +The variables in upper-case are references to variables set in the +@file{Makefile} or automatically generated. Do not change them; they +are automatically filled in by the build process. + +The remaining lines refer to implementation constants +(@code{standards-version}), or features that are unimplemented or have +been removed (@code{priority} and @code{dump}). The @code{type} line is +not normally relevant to external maintainers; the alternate value is +@code{single-file}, which refers to packages consed up out of a number +of single-file libraries that are more or less thematically related. An +example is @code{prog-modes}. Single-file packages are basically for +administrative convenience, and new packages should generally be created +as regular packages. + +The @file{Makefile} is quite stylized. The idea is similar to an +@file{Imakefile} or an @code{automake} file: the complexity is hidden in +generic rules files, in this case the @file{XEmacs.rules} include file +in the top directory of the packages hierarchy. Although a number of +facilities are available for complex libraries, most simple packages' +@file{Makefile}s contain a copyright notice, a few variable definitions, +an include for @file{XEmacs.rules}, and a couple of standard targets. + +The first few @code{make} variables defined are @code{VERSION}, +@code{AUTHOR_VERSION}, @code{MAINTAINER}, @code{PACKAGE}, +@code{PKG_TYPE}, @code{REQUIRES}, and @code{CATEGORY}. All but one were +described in the description of @file{package-info.in}. The last is an +admistrative grouping. Current categories include @code{comm}, +@code{games}, @code{libs}, @code{mule}, @code{oa}, @code{os}, +@code{prog}, and @code{wp}. @ref{Available Packages}, for a list of +categories. + +Next, define the variable @code{ELCS}. This contains the list of the +byte-compiled Lisp files used by the package. These files and their +@file{.el} versions will be included in the binary package. If there +are other files (such as extra Lisp sources or an upstream +@file{Makefile}) that are normally placed in the installed Lisp +directory, but not byte-compiled, they can be listed as the value of +@code{EXTRA_SOURCES}. + +The include is simply +@example +include ../../XEmacs.rules +@end example + +The standard targets follow. These are + +@example +all:: $(ELCS) auto-autoloads.elc + +srckit: srckit-alias + +binkit: binkit-alias +@end example + +Other targets (such as Texinfo sources) may need to be added as +dependencies for the @code{all} target. Dependencies for @code{srckit} +and @code{binkit} (that is, values for @var{srckit-alias} and +@var{binkit-alias}) are defined in @file{XEmacs.rules}. The most useful +of these values are given in the following table. + +@table @var +@item srckit-alias +Usually set to @code{srckit-std}. + +@item binkit-alias +May be set to @code{binkit-sourceonly}, @code{binkit-sourceinfo}, +@code{binkit-sourcedata}, or +@code{binkit-sourcedatainfo}. @code{sourceonly} indicates there is +nothing to install in a data directory or info directory. +@code{sourceinfo} indicates that source and info files are to be +installed. @code{sourcedata} indicates that source and etc (data) files +are to be installed. @code{sourcedatainfo} indicates source, etc +(data), and info files are to be installed. +@end table + +Data files include things like pixmaps for a package-specific toolbar, +and are normally installed in @file{etc/@var{PACKAGE_NAME}}. A few +packages have needs beyond the basic templates. See @file{XEmacs.rules} +or a future revision of this manual for details. + +@node Available Packages, , Creating Packages, Packages @comment node-name, next, previous, up This section is surely out-of-date. If you're sure that XEmacs is diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/ChangeLog --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/ChangeLog Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,128 @@ +2000-12-31 Martin Buchholz + + * XEmacs 21.2.39 is released. + +2000-12-28 Andy Piper + + * desktop.cc (FROB): add more app paths. + +2000-12-24 Fabrice Popineau + + * choose.cc (create_listview): CreateWindowEx() does not take this kind of + parameter. + + * choose.cc (package_sort): + * hash.cc (rev_len): + * site.cc (site_sort): must be __cdecl to be called by qsort(). + + * download.cc: + * install.cc: + * nio-file.cc: + * tar.cc: because of the redefinition of stat to _stat, the + inclusion of win32 headers has to be delayed. + + * win32.h: added some declarations, such as CDECL if + not defined, #define for functions that are not standard in msvc + libc (strdup, stat ...) + + * concat.h, concat.cc (concat): must be declared CDECL + + * desktop.cc: is needed. + + * dialog.h (NEXT): cast needed, the first parameter of EndDialog() must + be a HWND. + + * diskfull.cc: syntax when declaring GDFS. + + * ini.cc: Various `extern "C"' declarations: yylineno, yyerror() + and fprintf(). Various CDECL declarations: yyerror(), fprintf(). + + * inilex.l: required. + + * iniparse.y: use strdup(), require "win32.h" and + + * install.cc (dialog): syntax when declaring. CreateDialog() + returns a HWND. + + * postinstall.cc: and are needed. + + * regedit.cc (find_cygwin_mount): WIN32_NATIVE does not know + anything about Cygwin stuff. + + * setup.mak: new makefile for WIN32_NATIVE. + + * splash.cc (load_dialog): GetDlgItem() returns a HWND. + + * tar.cc: msvc knows about __int64, but not `long long'. + + * win32.h: is missing for regedit.cc. Also, I ended up + in including because the files listed there are not + enough for . + + * desktop.cc: + * fromcwd.cc: + * install.cc: + * postinstall.cc: does not exist for WIN32_NATIVE + + * choose.cc (do_choose): + * ini.cc (do_ini): + * nio-ftp.cc (ftp_line): the construct (x ?: y) is not standard. + +2000-12-24 Andy Piper + + * choose.cc (read_installed_db): grok package versions correctly. + + * Makefile.in.in: add MINGW define. + +2000-12-18 Andy Piper + + * res.rc: better look and feel. + +2000-12-18 Andy Piper + + * desktop.cc (do_desktop_setup): more app path fiddling. + +2000-12-13 Andy Piper + + * root.cc (dialog_cmd): create the root in the registry if we are successful. + + * desktop.cc (find_xemacs_exe_path): new function. Split out from + find_xemacs_exe (). + (find_xemacs_exe_name): ditto. + (do_desktop_setup): setup app paths if we are installing xemacs + itself. + (do_desktop): use new functions. + + * regedit.cc (create_xemacs_root): fix key name. + (find_xemacs_root): set isnative whatever the key value. + (set_app_path): new function. Set path for an app. + +2000-12-12 Andy Piper + + * package-net.el (package-net-convert-index-to-ini): use sensible defaults. + +2000-12-12 Andy Piper + + * reginfo.h: new macros. + + * iniparse.y: define xemacs_package. + + * ini.h: declare xemacs_package. + + * fromcwd.cc (found_file): guess core type from name. + + * concat.cc: kill warnings. + * net.cc: ditto. + + * choose.cc (do_choose): pick up core package type chosen. + + * Makefile.in.in: make sure we can pick up a mingw zlib. + + * desktop.cc: fix desktop icon creation. + +2000-11-12 Andy Piper + + * all: port from cygwin setup. + +%%% $Id: ChangeLog,v 1.1.2.5 2000/12/31 12:03:34 martinb Exp $ +$Revision: 1.1.2.5 $ diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/Makefile.in.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/Makefile.in.in Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,252 @@ +## Copyright (c) 2000, Red Hat, Inc. +## +## This program 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 of the License, or +## (at your option) any later version. +## +## A copy of the GNU General Public License can be found at +## http://www.gnu.org/ +## +## Written by Christopher Faylor +## Adapted for XEmacs by Andy Piper +## +## Makefile for Cygwin installer + +## FIXME: integrate autoload.c so that wininet doesn't have to be linked. + +## For performance and consistency, no built-in rules +.SUFFIXES: +.SUFFIXES: .c .cc .h .o +## ==================== Things "configure" will edit ==================== + +@SET_MAKE@ +SHELL = /bin/sh +RM = rm -f +pwd = /bin/pwd + +CC=@CC@ +CPP=@CPP@ +CFLAGS=@CFLAGS@ +CPPFLAGS=@CPPFLAGS@ +LDFLAGS=@LDFLAGS@ +ALLOCA=@ALLOCA@ +LN_S=@LN_S@ +version=@version@ + +## This will be the name of the generated binary and is set automatically +## by configure. +PROGNAME=@PROGNAME@ +INSTALLABLES=setup +#ifdef USE_GNU_MAKE +vpath %.c @srcdir@ +vpath %.cc @srcdir@ +vpath %.h @srcdir@ +#else +VPATH=@srcdir@ +#endif + +## ==================== Where To Install Things ==================== + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +libdir=@libdir@ +srcdir=@srcdir@ +datadir=@datadir@ +instvardir=@instvardir@ +top_srcdir=@top_srcdir@ +archlibdir=@archlibdir@ +configuration=@configuration@ +moduledir=@moduledir@ +sitemoduledir=@sitemoduledir@ + +## ==================== Utility Programs for the Build ================= + +INSTALL = @install_pp@ @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +SHELL = @SHELL@ +## ========================== Lists of Files =========================== + +#define NO_SHORTNAMES +#define NOT_C_CODE +#include "../src/config.h" + +program_transform_name = @program_transform_name@ + +CC = @CC@ +CC_FOR_TARGET = $(CC) + +LOCALCFLAGS = $(CFLAGS) -DMINGW +CXXFLAGS = $(LOCALCFLAGS) -fno-exceptions -nostdinc++ -fno-rtti + +WINDRES = windres +MINGW_INCLUDES = -I. -I$(srcdir) +MINGW_CXXFLAGS = $(CXXFLAGS) -mno-cygwin $(MINGW_INCLUDES) -mwindows +MINGW_CFLAGS = $(LOCALCFLAGS) -mno-cygwin $(MINGW_INCLUDES) -mwindows +MINGW_ZLIB_DIR = /usr/local/lib + +PROGS = setup.exe + +CONFIG_H = ../src/config.h + +OBJS = \ + choose.o \ + concat.o \ + desktop.o \ + dialog.o \ + diskfull.o \ + download.o \ + find.o \ + fromcwd.o \ + geturl.o \ + hash.o \ + ini.o \ + inilex.o \ + iniparse.o \ + install.o \ + localdir.o \ + log.o \ + main.o \ + mkdir.o \ + mklink2.o \ + regedit.o \ + msg.o \ + net.o \ + netio.o \ + nio-ie5.o \ + nio-file.o \ + nio-ftp.o \ + nio-http.o \ + other.o \ + postinstall.o \ + res.o \ + root.o \ + simpsock.o \ + site.o \ + source.o \ + splash.o \ + state.o \ + tar.o \ + version.o + +.SUFFIXES: +.NOEXPORT: + +.PHONY: all install + +all: Makefile $(PROGS) + +setup.exe: $(OBJS) + $(CXX) $(MINGW_CXXFLAGS) -o $@ $(OBJS) \ + -lole32 -lwsock32 -lnetapi32 -ladvapi32 \ + -luuid -lkernel32 -luser32 -lwininet \ + -L$(MINGW_ZLIB_DIR) -lz -lmingw32 + @chmod a-x $@ + +install: + @echo; echo "Installing net setup." + for file in ${INSTALLABLES} ; do \ + (cd .. && $(INSTALL_PROGRAM) netinstall/$${file} ${bindir}/$${file}) ; \ + done + +version.c : $(srcdir)/ChangeLog Makefile + V=`grep '^\$$Revision.*' $(srcdir)/ChangeLog \ + | sed -e 's/\$$Revision:* *//' \ + -e 's/ *$$.*//'` ;\ + echo "char *version = \"$$V\";" > version.tmp ;\ + echo "static char *id = \"\\n%%% setup-version $$V\\n\";" >> version.tmp + mv version.tmp version.c + +%.o: %.rc + $(WINDRES) --include-dir $(srcdir) -o $@ $< + +%.o: %.c + $(CC) $(MINGW_CFLAGS) -c -o $@ ${srcdir}/$< + +%.o: %.cc + $(CC) $(MINGW_CXXFLAGS) -c -o $@ ${srcdir}/$< + +iniparse.c iniparse.h : iniparse.y + bison -d -o iniparse.c $(srcdir)/iniparse.y + +inilex.c : inilex.l iniparse.h + flex -8 $(srcdir)/inilex.l + mv lex.yy.c inilex.c + +.PHONY: mostlyclean clean distclean realclean extraclean + +mostlyclean: + $(RM) *.o *.i core $(PROGS) + +clean: mostlyclean + +distclean: clean + $(RM) GNUmakefile Makefile Makefile.in TAGS + +realclean: distclean + +extraclean: distclean + $(RM) *~ \#* + +choose.o: choose.cc win32.h dialog.h resource.h state.h ini.h concat.h \ + msg.h log.h find.h reginfo.h +concat.o: concat.cc +desktop.o: desktop.cc win32.h resource.h ini.h msg.h state.h concat.h \ + mkdir.h dialog.h version.h port.h +dialog.o: dialog.cc win32.h dialog.h msg.h log.h +diskfull.o: diskfull.cc win32.h diskfull.h +download.o: download.cc win32.h resource.h msg.h ini.h dialog.h \ + concat.h geturl.h state.h mkdir.h log.h +find.o: find.cc win32.h port.h +fromcwd.o: fromcwd.cc win32.h ini.h resource.h concat.h state.h \ + dialog.h msg.h find.h version.h port.h +geturl.o: geturl.cc win32.h dialog.h \ + geturl.h resource.h netio.h msg.h log.h +hash.o: hash.cc hash.h +ini.o: ini.cc win32.h ini.h resource.h concat.h state.h geturl.h \ + dialog.h msg.h mkdir.h log.h reginfo.h version.h +inilex.o: inilex.c win32.h \ + ini.h \ + iniparse.h +iniparse.o: iniparse.c ini.h \ + iniparse.h \ + port.h +install.o: install.cc win32.h \ + resource.h ini.h dialog.h concat.h geturl.h mkdir.h state.h tar.h \ + diskfull.h msg.h regedit.h reginfo.h log.h hash.h port.h +localdir.o: localdir.cc win32.h dialog.h resource.h state.h msg.h \ + concat.h log.h +log.o: log.cc win32.h resource.h msg.h log.h dialog.h state.h concat.h \ + mkdir.h +main.o: main.cc win32.h resource.h dialog.h state.h msg.h netio.h \ + find.h log.h port.h +mkdir.o: mkdir.cc win32.h mkdir.h +mklink2.o: mklink2.c win32.h /usr/include/w32api/shlobj.h +msg.o: msg.cc win32.h dialog.h log.h +net.o: net.cc win32.h dialog.h resource.h state.h msg.h log.h +netio.o: netio.cc win32.h resource.h state.h msg.h netio.h nio-file.h \ + nio-ie5.h nio-http.h nio-ftp.h dialog.h log.h port.h +nio-file.o: nio-file.cc win32.h netio.h nio-file.h resource.h msg.h +nio-ftp.o: nio-ftp.cc win32.h resource.h state.h simpsock.h log.h \ + netio.h nio-ftp.h +nio-http.o: nio-http.cc win32.h resource.h state.h simpsock.h msg.h \ + netio.h nio-http.h +nio-ie5.o: nio-ie5.cc win32.h resource.h state.h dialog.h msg.h \ + netio.h nio-ie5.h +other.o: other.cc win32.h dialog.h resource.h state.h msg.h log.h +postinstall.o: postinstall.cc win32.h state.h dialog.h find.h concat.h \ + port.h +regedit.o: regedit.cc win32.h reginfo.h regedit.h msg.h resource.h \ + dialog.h +root.o: root.cc win32.h dialog.h resource.h state.h msg.h regedit.h \ + reginfo.h concat.h log.h +simpsock.o: simpsock.cc win32.h simpsock.h msg.h +site.o: site.cc win32.h dialog.h resource.h state.h geturl.h msg.h \ + concat.h regedit.h reginfo.h log.h port.h +source.o: source.cc win32.h dialog.h resource.h state.h msg.h log.h +splash.o: splash.cc win32.h dialog.h resource.h msg.h version.h +state.o: state.cc state.h +tar.o: tar.cc win32.h tar.h mkdir.h log.h port.h +version.o: version.c diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/README Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,25 @@ +This directory contains the source for the setup program for the cygwin +net releases. + + + +To-Do list: + +ini.cc: add field in setup.ini to specify whether package is installed +by default, or not. + +install.cc: scan newly installed files for README files, show list to +user, let them read them if they want. + +download.cc: add a "total progress" indicator, like the install one. + +add a "category" field to setup.ini, let user choose which categories +of packages to install, perhaps with a "custom..." button to lead to +the current chooser. + +remember which packages were selected to be skipped, and which prev/curr/exp +option was last selected, and recall them each time the chooser runs. + +Add friendly error reporting to simpsock.cc + +Add option to download sources also. diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/README.xemacs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/README.xemacs Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,23 @@ +This directory contains the source for the setup program for the +XEmacs net releases. + +This code has been adapted from the cygwin net release installer. In +particular note that the cygwin net release installer is actively +maintained and therefore we will want to incorporate improvements from +that. I have therefore tried to use the cygwin way wherever +possible. I have however cleaned up the code somewhat so that there +are not billions of warnings. + +This program should get built as part of the standard XEmacs +make. Note however that if you use trhe cygwin build you will need a +NON CYGWIN VERSION OF ZLIB. + +New files: + regedit.cc: + regedit.h + reginfo.h + Makefile.in.in: + +Deleted files: + mount.cc: moved to regedit.cc + mount.h: moved to regedit.h diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/autoload.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/autoload.c Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +#include "win32.h" + +typedef struct { + char *name; + HINSTANCE handle; +} DllInfo; + +#define DLL(n) static DllInfo n ## _info __asm__ (#n "_info") = { #n, 0} + +#define Auto(dll, func, size) \ + __asm__ ("\t.data"); \ + __asm__ ("\t.global\t_" #func "@" #size); \ + __asm__ ("_" #func "@" #size ":"); \ + __asm__ ("\tcall\tautoload_common"); \ + __asm__ ("\t.long\t" #dll "_info"); \ + __asm__ ("\t.ascii\t\"" #func "\\0\"") + +DLL (wininet); + +Auto (wininet, InternetAttemptConnect, 4); +Auto (wininet, InternetCloseHandle, 4); +Auto (wininet, InternetGetLastResponseInfoA, 12); +Auto (wininet, InternetOpenA, 20); +Auto (wininet, InternetOpenUrlA, 24); +Auto (wininet, InternetReadFile, 16); +Auto (wininet, InternetSetOptionA, 16); +Auto (wininet, InternetQueryOptionA, 16); +Auto (wininet, HttpQueryInfoA, 20); +Auto (wininet, HttpSendRequestA, 20); + +typedef struct { + DllInfo *dll; + char name[100]; +} AutoEntry; + +static void autoload_common () __asm__ ("autoload_common"); + +static void +autoload_common (int x) +{ + int fp, rel; + unsigned char *proc; + HINSTANCE h; + AutoEntry *a; + + a = *(AutoEntry **)(&x - 1); + if (a->dll->handle == 0) + { + h = LoadLibrary (a->dll->name); + a->dll->handle = h; + } + fp = (int) GetProcAddress (a->dll->handle, a->name); + proc = ((unsigned char *)a) - 5; + rel = fp - (int)(a); /* now it's a relative call */ + *proc++ = 0xe9; /* jump near 32-bit relative */ + *proc++ = rel; + *proc++ = rel>>8; + *proc++ = rel>>16; + *proc++ = rel>>24; + + *(int *)(&x-1) = (int)proc-5; +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/check-na.bmp Binary file netinstall/check-na.bmp has changed diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/check-no.bmp Binary file netinstall/check-no.bmp has changed diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/check-yes.bmp Binary file netinstall/check-yes.bmp has changed diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/choose-rtarrow.bmp Binary file netinstall/choose-rtarrow.bmp has changed diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/choose-spin.bmp Binary file netinstall/choose-spin.bmp has changed diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/choose.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/choose.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,831 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to let the user choose which packages + to install, and which versions of the package when more than one + version is provided. The "trust" level serves as an indication as + to which version should be the default choice. At the moment, all + we do is compare with previously installed packages to skip any + that are already installed (by setting the action to ACTION_SAME). + While the "trust" stuff is supported, it's not really implemented + yet. We always prefer the "current" option. In the future, this + file might have a user dialog added to let the user choose to not + install packages, or to install packages that aren't installed by + default. */ + +#include "win32.h" +#include +#include +#include + +#include "dialog.h" +#include "resource.h" +#include "state.h" +#include "ini.h" +#include "concat.h" +#include "msg.h" +#include "log.h" +#include "find.h" +#include "reginfo.h" + +#define HMARGIN 10 +#define ROW_MARGIN 5 +#define ICON_MARGIN 4 + +#define CHECK_SIZE 11 + +#define TRUST_KEEP 101 +#define TRUST_UNINSTALL 102 +#define TRUST_NONE 103 + +static int initialized = 0; + +static int full_list = 0; + +static int scroll_ulc_x, scroll_ulc_y; + +static HWND lv, nextbutton; +static TEXTMETRIC tm; +static int header_height; +static HANDLE sysfont; +static int row_height; +static HANDLE bm_spin, bm_rtarrow, bm_checkyes, bm_checkno, bm_checkna; +static HDC bitmap_dc; + +static struct { + char *text; + int slen; + int width; + int x; +} headers[] = { + { "Current", 7, 0, 0 }, +#define CURRENT_COL 0 + { "New", 3, 0, 0 }, +#define NEW_COL 1 + { "Src?", 4, 0, 0 }, +#define SRC_COL 2 + { "Package", 7, 0, 0 }, +#define PACKAGE_COL 3 + { 0, 0, 0, 0 } +}; +#define NUM_COLUMNS (sizeof(headers)/(sizeof(headers[0]))-1) + +int *package_indexes, nindexes; + +struct ExtraPackageInfo { + char *installed_file; /* filename of previous "install" file */ + char *installed_ver; /* version part */ + int installed_size; /* ditto, size. */ + + int in_partial_list; + int pick; + int npick; + int which_is_installed; /* == TRUST* or -1 */ + + struct { + int src_avail; + int trust; /* may be keep or uninstall */ + char *caption; /* ==0 at EOL */ + } chooser[NTRUST+3]; /* one extra for NULL above */ +}; + +static ExtraPackageInfo *extra; + +static void +paint (HWND hwnd) +{ + HDC hdc; + PAINTSTRUCT ps; + int x, y, i, ii; + + hdc = BeginPaint (hwnd, &ps); + + SelectObject (hdc, sysfont); + + RECT cr; + GetClientRect (hwnd, &cr); + + POINT p; + + x = cr.left - scroll_ulc_x; + y = cr.top - scroll_ulc_y + header_height; + + + for (i=0; headers[i].text; i++) + { + TextOut (hdc, x+headers[i].x, 3, headers[i].text, headers[i].slen); + MoveToEx (hdc, x+headers[i].x, header_height-3, &p); + LineTo (hdc, x+headers[i].x+headers[i].width, header_height-3); + } + + IntersectClipRect (hdc, cr.left, cr.top+header_height, cr.right, cr.bottom); + + for (ii=0; ii 1) + { + SelectObject (bitmap_dc, bm_spin); + BitBlt (hdc, x+headers[NEW_COL].x, by, 11, 11, + bitmap_dc, 0, 0, SRCCOPY); + } + } + + HANDLE check_bm = bm_checkna; + if (extra[i].chooser[extra[i].pick].src_avail) + { + if (package[i].srcaction == SRCACTION_NO) + check_bm = bm_checkno; + else if (package[i].srcaction == SRCACTION_YES) + check_bm = bm_checkyes; + } + SelectObject (bitmap_dc, check_bm); + BitBlt (hdc, x+headers[SRC_COL].x, by, 11, 11, + bitmap_dc, 0, 0, SRCCOPY); + + if (package[i].name) + TextOut (hdc, x+headers[PACKAGE_COL].x, r, package[i].name, strlen(package[i].name)); + } + + if (nindexes == 0) + { + static char *m = "Nothing to Install/Update"; + TextOut (hdc, HMARGIN, header_height, m, strlen (m)); + } + + EndPaint (hwnd, &ps); +} + +static void +scroll_common (HWND hwnd, int which, int *var, int code) +{ + SCROLLINFO si; + si.cbSize = sizeof (si); + si.fMask = SIF_ALL; + GetScrollInfo (hwnd, which, &si); + + switch (code) + { + case SB_THUMBTRACK: + si.nPos = si.nTrackPos; + break; + case SB_THUMBPOSITION: + break; + case SB_BOTTOM: + si.nPos = si.nMax; + break; + case SB_TOP: + si.nPos = 0; + break; + case SB_LINEDOWN: + si.nPos += row_height; + break; + case SB_LINEUP: + si.nPos -= row_height; + break; + case SB_PAGEDOWN: + si.nPos += si.nPage * 9/10; + break; + case SB_PAGEUP: + si.nPos -= si.nPage * 9/10; + break; + } + + if ((int)si.nPos < 0) + si.nPos = 0; + if ((int)(si.nPos + si.nPage) > si.nMax) + si.nPos = si.nMax - si.nPage; + + si.fMask = SIF_POS; + SetScrollInfo (hwnd, which, &si, TRUE); + + int ox = scroll_ulc_x; + int oy = scroll_ulc_y; + *var = si.nPos; + + RECT cr, sr; + GetClientRect (hwnd, &cr); + sr = cr; + sr.top += header_height; + ScrollWindow (hwnd, ox - scroll_ulc_x, oy - scroll_ulc_y, &sr, &sr); + sr.bottom = sr.top; + sr.top = cr.top; + ScrollWindow (hwnd, ox - scroll_ulc_x, 0, &sr, &sr); +} + +static LRESULT CALLBACK +list_vscroll (HWND hwnd, HWND hctl, UINT code, int pos) +{ + scroll_common (hwnd, SB_VERT, &scroll_ulc_y, code); + return FALSE; +} + +static LRESULT CALLBACK +list_hscroll (HWND hwnd, HWND hctl, UINT code, int pos) +{ + scroll_common (hwnd, SB_HORZ, &scroll_ulc_x, code); + return FALSE; +} + +static LRESULT CALLBACK +list_click (HWND hwnd, BOOL dblclk, int x, int y, UINT hitCode) +{ + int r; + + if (nindexes == 0) + return 0; + + if (y < header_height) + return 0; + x += scroll_ulc_x; + y += scroll_ulc_y - header_height; + + r = (y + ROW_MARGIN/2) / row_height; + + if (r < 0 || r >= npackages) + return 0; + + int p = package_indexes[r]; + + if (x >= headers[NEW_COL].x - HMARGIN/2 && x <= headers[NEW_COL+1].x - HMARGIN/2) + { + extra[p].pick ++; + if (extra[p].chooser[extra[p].pick].caption == 0) + extra[p].pick = 0; + } + + if (x >= headers[SRC_COL].x - HMARGIN/2 && x <= headers[SRC_COL+1].x - HMARGIN/2) + { + if (extra[p].chooser[extra[p].pick].src_avail) + package[p].srcaction ^= (SRCACTION_NO^SRCACTION_YES); + } + + RECT rect; + rect.left = headers[NEW_COL].x - scroll_ulc_x; + rect.right = headers[SRC_COL+1].x - scroll_ulc_x; + rect.top = header_height + r * row_height - scroll_ulc_y; + rect.bottom = rect.top + row_height; + InvalidateRect (hwnd, &rect, TRUE); + return FALSE; +} + +static LRESULT CALLBACK +listview_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) { + case WM_HSCROLL: + return HANDLE_WM_HSCROLL (hwnd, wParam, lParam, list_hscroll); + case WM_VSCROLL: + return HANDLE_WM_VSCROLL (hwnd, wParam, lParam, list_vscroll); + case WM_LBUTTONDOWN: + return HANDLE_WM_LBUTTONDOWN (hwnd, wParam, lParam, list_click); + case WM_PAINT: + paint (hwnd); + return 0; + default: + return DefWindowProc (hwnd, message, wParam, lParam); + } +} + +static void +register_windows (HINSTANCE hinst) +{ + WNDCLASSEX wcex; + static int done = 0; + + if (done) + return; + done = 1; + + memset (&wcex, 0, sizeof (wcex)); + wcex.cbSize = sizeof (WNDCLASSEX); + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = listview_proc; + wcex.hInstance = hinst; + wcex.hIcon = LoadIcon (0, IDI_APPLICATION); + wcex.hCursor = LoadCursor (0, IDC_ARROW); + wcex.hbrBackground = (HBRUSH) (COLOR_WINDOW+1); + wcex.lpszClassName = "listview"; + + RegisterClassEx (&wcex); +} + +static void +note_width (HDC dc, char *string, int addend, int column) +{ + if (!string) + return; + SIZE s; + GetTextExtentPoint32 (dc, string, strlen (string), &s); + if (headers[column].width < s.cx + addend) + headers[column].width = s.cx + addend; +} + +static int +best_trust (int p, int trust) +{ + int t; + for (t=trust; t>=0; t--) + if (package[p].info[t].install) + return t; + for (t=trust+1; t<=NTRUST; t++) + if (package[p].info[t].install) + return t; + if (extra[p].installed_file) + return TRUST_KEEP; + return TRUST_NONE; +} + +static void +default_trust (HWND h, int trust) +{ + int i, t, c; + + for (i=0; ileft, r->top, + r->right-r->left+1, r->bottom-r->top+1, + dlg, + NULL, // ??? MAKEINTRESOURCE(IDC_CHOOSE_LIST), + hinstance, + 0); + ShowWindow (lv, SW_SHOW); + + for (i=0; headers[i].text; i++) + headers[i].width = 0; + + HDC dc = GetDC (lv); + sysfont = GetStockObject (DEFAULT_GUI_FONT); + SelectObject (dc, sysfont); + GetTextMetrics (dc, &tm); + header_height = tm.tmHeight + 5 + 3; + + bitmap_dc = CreateCompatibleDC (dc); + + row_height = (tm.tmHeight + tm.tmExternalLeading + ROW_MARGIN); + int irh = tm.tmExternalLeading + tm.tmDescent + 11 + ROW_MARGIN; + if (row_height < irh) + row_height = irh; + + for (i=0; headers[i].text; i++) + note_width (dc, headers[i].text, 0, i); + for (i=0; ileft; + p.y = r->top; + ScreenToClient (parent, &p); + r->left = p.x; + r->top = p.y; + p.x = r->right; + p.y = r->bottom; + ScreenToClient (parent, &p); + r->right = p.x; + r->bottom = p.y; +} + +static BOOL CALLBACK +dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + HWND frame; + RECT r; + switch (message) + { + case WM_INITDIALOG: + nextbutton = GetDlgItem (h, IDOK); + frame = GetDlgItem (h, IDC_LISTVIEW_POS); + GetParentRect (h, frame, &r); + r.top += 2; + r.bottom -= 2; + create_listview (h, &r); +#if 0 + load_dialog (h); +#endif + return FALSE; + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); + } + return FALSE; +} + +static char * +base (char *s) +{ + if (!s) + return 0; + char *rv = s; + while (*s) + { + if ((*s == '/' || *s == ':' || *s == '\\') && s[1]) + rv = s+1; + s++; + } + return rv; +} + +static void +scan2 (char *path, unsigned int size) +{ + int i, t; + for (i=0; iname, b->name); +} + +void +do_choose (HINSTANCE h) +{ + int rv, i; + + qsort (package, npackages, sizeof (package[0]), package_sort); + + nextbutton = 0; + bm_spin = LoadImage (h, MAKEINTRESOURCE (IDB_SPIN), IMAGE_BITMAP, 0, 0, 0); + bm_rtarrow = LoadImage (h, MAKEINTRESOURCE (IDB_RTARROW), IMAGE_BITMAP, 0, 0, 0); + + bm_checkyes = LoadImage (h, MAKEINTRESOURCE (IDB_CHECK_YES), IMAGE_BITMAP, 0, 0, 0); + bm_checkno = LoadImage (h, MAKEINTRESOURCE (IDB_CHECK_NO), IMAGE_BITMAP, 0, 0, 0); + bm_checkna = LoadImage (h, MAKEINTRESOURCE (IDB_CHECK_NA), IMAGE_BITMAP, 0, 0, 0); + + extra = (ExtraPackageInfo *) malloc (npackages * sizeof (ExtraPackageInfo)); + memset (extra, 0, npackages * sizeof (ExtraPackageInfo)); + for (i=0; i + * + */ + +/* See concat.h. Note that we canonicalize the result, this avoids + multiple slashes being interpreted as UNCs. */ + +#include "win32.h" +#include +#include +#include + +char * CDECL +concat (char *s, ...) +{ + int len; + char *rv, *arg; + va_list v; + + if (!s) + return 0; + + len = strlen (s); + + va_start (v, s); + while (1) + { + arg = va_arg (v, char *); + if (arg == 0) + break; + len += strlen (arg); + } + va_end (v); + + rv = (char *) malloc (len+1); + strcpy (rv, s); + va_start (v, s); + while (1) + { + arg = va_arg (v, char *); + if (arg == 0) + break; + strcat (rv, arg); + } + va_end (v); + + /* concat is only used for urls and files, so we can safely + canonicalize the results */ + char *d; + for (s=rv; *s; s++) + if (*s == '\\') + *s = '/'; + for (s=d=rv; *s; s++) + { + *d++ = *s; + /* special case for URLs */ + if (*s == ':' && s[1] == '/' && s[2] == '/' && s > rv+1) + { + *d++ = *++s; + *d++ = *++s; + } + else if (*s == '/') + while (s[1] == '/') + s++; + } + *d = 0; + + return rv; +} + +char * +backslash (char *s) +{ + for (char *t = s; *t; t++) + if (*t == '/') + *t = '\\'; + return s; +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/concat.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/concat.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Pass a null-terminated list of strings, and it concatenates them + into a single string. Warning - it assumes the result is a file + name or URL, and will canonicalize the result accordingly + (i.e. replace \ with /, collapse multiple /// to a single /, etc.) */ + +char * CDECL concat (char *s, ...); + +/* convert slashes to backslashes */ + +char * backslash (char *s); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/desktop.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/desktop.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,438 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to manage all the desktop setup, such + as start menu, batch files, desktop icons, and shortcuts. Note + that unlike other do_* functions, this one is called directly from + install.cc */ + + +#include "win32.h" +#include + +#include +#include +#include +#ifndef WIN32_NATIVE +#include +#endif + +#include "resource.h" +#include "ini.h" +#include "msg.h" +#include "state.h" +#include "concat.h" +#include "mkdir.h" +#include "dialog.h" +#include "version.h" +#include "reginfo.h" +#include "regedit.h" +#include "port.h" + +extern "C" { + void make_link_2 (char *exepath, char *args, char *icon, char *lname); +}; + +static OSVERSIONINFO verinfo; + +/* Lines starting with '@' are conditionals - include 'N' for NT, + '5' for Win95, '8' for Win98, '*' for all, like this: + echo foo + @N8 + echo NT or 98 + @* + */ + +#define COMMAND9XARGS "/E:4096 /c" +#define COMMAND9XEXE "\\command.com" + +static char *iconname; +static char *batname; + +static void +make_link (char *linkpath, char *title, char *target) +{ + char argbuf[_MAX_PATH]; + char *fname = concat (linkpath, "/", title, ".lnk", 0); + + if (_access (fname, 0) == 0) + return; /* already exists */ + + msg ("make_link %s, %s, %s\n", fname, title, target); + + mkdir_p (0, fname); + + char *exepath, *args; + + /* If we are running Win9x, build a command line. */ + if (verinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) + { + exepath = target; + args = ""; + } + else + { + char windir[MAX_PATH]; + + GetWindowsDirectory (windir, sizeof (windir)); + exepath = concat (windir, COMMAND9XEXE, 0); + sprintf (argbuf, "%s %s", COMMAND9XARGS, target); + args = argbuf; + } + + msg ("make_link_2 (%s, %s, %s, %s)", exepath, args, iconname, fname); + make_link_2 (exepath, args, iconname, fname); +} + +static char* +find_xemacs_exe_path () +{ + if (xemacs_package->type == TY_CYGWIN) + return backslash (concat (root_dir, "/bin/", XEMACS_CYGWIN_ARCH_NAME, 0)); + else + return backslash (concat (root_dir, "\\XEmacs-", + xemacs_package->info[xemacs_package->trust].version, + "\\", XEMACS_NATIVE_ARCH_NAME, 0)); +} + +static char* +find_xemacs_exe_name () +{ + if (xemacs_package->type == TY_CYGWIN) + return backslash (concat ("xemacs-", + xemacs_package->info[xemacs_package->trust].version, + ".exe", 0)); + else + return strdup ("xemacs.exe"); +} + +static void +start_menu (char *title, char *target) +{ + char path[_MAX_PATH]; + LPITEMIDLIST id; + int issystem = (root_scope == IDC_ROOT_SYSTEM) ? 1 : 0; + SHGetSpecialFolderLocation (NULL, issystem ? CSIDL_COMMON_PROGRAMS : CSIDL_PROGRAMS, &id); + SHGetPathFromIDList (id, path); +// following lines added because it appears Win95 does not use common programs +// unless it comes into play when multiple users for Win95 is enabled + msg("Program directory for program link: %s",path); + if ( strlen(path) == 0) { + SHGetSpecialFolderLocation (NULL, CSIDL_PROGRAMS, &id); + SHGetPathFromIDList (id, path); + msg("Program directory for program link changed to: %s",path); + } +// end of Win95 addition + strcat (path, "/"); + strcat (path, XEMACS_INFO_XEMACS_ORG_REGISTRY_NAME); + make_link (path, title, target); +} + +static void +desktop_icon (char *title, char *target) +{ + char path[_MAX_PATH]; + LPITEMIDLIST id; + int issystem = (root_scope == IDC_ROOT_SYSTEM) ? 1 : 0; + //SHGetSpecialFolderLocation (NULL, issystem ? CSIDL_DESKTOP : CSIDL_COMMON_DESKTOPDIRECTORY, &id); + SHGetSpecialFolderLocation (NULL, issystem ? CSIDL_COMMON_DESKTOPDIRECTORY : CSIDL_DESKTOPDIRECTORY, &id); + SHGetPathFromIDList (id, path); +// following lines added because it appears Win95 does not use common programs +// unless it comes into play when multiple users for Win95 is enabled + msg("Desktop directory for desktop link: %s",path); + if ( strlen(path) == 0) { + SHGetSpecialFolderLocation (NULL, CSIDL_DESKTOPDIRECTORY, &id); + SHGetPathFromIDList (id, path); + msg("Desktop directory for deskop link changed to: %s",path); + } +// end of Win95 addition + make_link (path, title, target); +} + +static int +uexists (char *path) +{ + char *f = concat (root_dir, path, 0); + int a = _access (f, 0); + free (f); + if (a == 0) + return 1; + return 0; +} + +static void +make_passwd_group () +{ + if (verinfo.dwPlatformId != VER_PLATFORM_WIN32_NT) + { + int i; + + LOOP_PACKAGES + { + if (!strcmp (package[i].name, "cygwin")) + { + /* mkpasswd and mkgroup are not working on 9x/ME up to 1.1.5-4 */ + char *border_version = canonicalize_version ("1.1.5-4"); + char *inst_version = canonicalize_version (pi.version); + + if (strcmp (inst_version, border_version) <= 0) + return; + + break; + } + } + } + + if (uexists ("/etc/passwd") && uexists ("/etc/group")) + return; + + char *fname = concat (root_dir, "/etc/postinstall/passwd-grp.bat", 0); + mkdir_p (0, fname); + + FILE *p = fopen (fname, "wb"); + if (!p) + return; + + if (!uexists ("/etc/passwd")) + fprintf (p, "bin\\mkpasswd -l > etc\\passwd\n"); + if (!uexists ("/etc/group")) + fprintf (p, "bin\\mkgroup -l > etc\\group\n"); + + fclose (p); +} + +static void +save_icon () +{ + iconname = backslash (concat (root_dir, XEMACS_RESOURCE_DIR, + "xemacs.ico", 0)); + + HRSRC rsrc = FindResource (NULL, "XEMACS.ICON", "FILE"); + if (rsrc == NULL) + { + fatal ("FindResource failed"); + } + HGLOBAL res = LoadResource (NULL, rsrc); + char *data = (char *) LockResource (res); + int len = SizeofResource (NULL, rsrc); + + FILE *f = fopen (iconname, "wb"); + if (f) + { + fwrite (data, 1, len, f); + fclose (f); + } +} + +static void +do_desktop_setup() +{ + save_icon (); + + if (root_menu && batname) { + start_menu ("XEmacs", batname); + } + + if (root_desktop && batname) { + desktop_icon ("XEmacs", batname); + } + + // set regkeys for the application + if (xemacs_package != 0) + { + int issystem = (root_scope == IDC_ROOT_SYSTEM ? 1 : 0); + if (xemacs_package->type == TY_NATIVE) + { +#define FROB(exe) set_app_path ((exe), \ + find_xemacs_exe_path (), \ + issystem) + FROB (find_xemacs_exe_name ()); + FROB ("runemacs.exe"); + FROB ("xemacs.exe"); +#undef FROB + } + else if (xemacs_package->type == TY_CYGWIN) + { + int junk; + char* root = find_cygwin_root (&junk); +#define FROB(exe) set_app_path ((exe), \ + concat (find_xemacs_exe_path (), ";", \ + root, "\\bin;", \ + root, "\\usr\\bin", 0), \ + issystem) + FROB (find_xemacs_exe_name ()); + FROB ("runemacs.exe"); + FROB ("xemacs.exe"); +#undef FROB + } + } +} + +static int da[] = { IDC_ROOT_DESKTOP, 0 }; +static int ma[] = { IDC_ROOT_MENU, 0 }; + +static void +check_if_enable_next (HWND h) +{ + EnableWindow (GetDlgItem (h, IDOK), 1); +} + +static void +load_dialog (HWND h) +{ + rbset (h, da, root_desktop); + rbset (h, ma, root_menu); + check_if_enable_next (h); +} + +static int check_desktop (char *title, char *target) +{ + char path[_MAX_PATH]; + LPITEMIDLIST id; + int issystem = (root_scope == IDC_ROOT_SYSTEM) ? 1 : 0; + SHGetSpecialFolderLocation (NULL, issystem ? CSIDL_COMMON_DESKTOPDIRECTORY : CSIDL_DESKTOPDIRECTORY, &id); + SHGetPathFromIDList (id, path); + // following lines added because it appears Win95 does not use common programs + // unless it comes into play when multiple users for Win95 is enabled + msg ("Desktop directory for desktop link: %s",path); + if (strlen (path) == 0) { + SHGetSpecialFolderLocation (NULL, CSIDL_DESKTOPDIRECTORY, &id); + SHGetPathFromIDList (id, path); + msg ("Desktop directory for deskop link changed to: %s",path); + } + // end of Win95 addition + char *fname = concat (path, "/", title, ".lnk", 0); + + if (_access (fname, 0) == 0) + return 0; /* already exists */ + + fname = concat (path, "/", title, ".pif", 0); /* check for a pif as well */ + + if (_access (fname, 0) == 0) + return 0; /* already exists */ + + return IDC_ROOT_DESKTOP; +} + +static int check_startmenu (char *title, char *target) +{ + char path[_MAX_PATH]; + LPITEMIDLIST id; + int issystem = (root_scope == IDC_ROOT_SYSTEM) ? 1 : 0; + SHGetSpecialFolderLocation (NULL, issystem ? CSIDL_COMMON_PROGRAMS : CSIDL_PROGRAMS, &id); + SHGetPathFromIDList (id, path); + // following lines added because it appears Win95 does not use common programs + // unless it comes into play when multiple users for Win95 is enabled + msg ("Program directory for program link: %s",path); + if (strlen (path) == 0) { + SHGetSpecialFolderLocation (NULL, CSIDL_PROGRAMS, &id); + SHGetPathFromIDList (id, path); + msg ("Program directory for program link changed to: %s",path); + } + // end of Win95 addition + strcat (path, "/"); + strcat (path, XEMACS_INFO_XEMACS_ORG_REGISTRY_NAME); + char *fname = concat (path, "/", title, ".lnk", 0); + + if (_access (fname, 0) == 0) + return 0; /* already exists */ + + fname = concat (path, "/", title, ".pif", 0); /* check for a pif as well */ + + if (_access (fname, 0) == 0) + return 0; /* already exists */ + + return IDC_ROOT_MENU; +} + +static void +save_dialog (HWND h) +{ + root_desktop= rbget (h, da); + root_menu = rbget (h, ma); +} + +static BOOL +dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) +{ + switch (id) + { + + case IDC_ROOT_DESKTOP: + case IDC_ROOT_MENU: + save_dialog (h); + check_if_enable_next (h); + break; + + case IDOK: + save_dialog (h); + do_desktop_setup(); + NEXT (IDD_S_POSTINSTALL); + break; + + case IDC_BACK: + save_dialog (h); + NEXT (IDD_CHOOSE); + break; + + case IDCANCEL: + NEXT (0); + break; + } + return FALSE; +} + +static BOOL CALLBACK +dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + load_dialog (h); + return FALSE; + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); + } + return FALSE; +} + +void +do_desktop (HINSTANCE h) +{ + CoInitialize (NULL); + + verinfo.dwOSVersionInfoSize = sizeof (verinfo); + GetVersionEx (&verinfo); + batname = 0; + + if (xemacs_package != 0 && xemacs_package->type != TY_GENERIC) + { + batname = concat (find_xemacs_exe_path (), "\\", + find_xemacs_exe_name (), 0); + root_desktop = check_desktop ("XEmacs", batname); + root_menu = check_startmenu ("XEmacs", batname); + } + else + { + root_desktop = 0; + root_menu = 0; + } + + int rv = 0; + + rv = DialogBox (h, MAKEINTRESOURCE (IDD_DESKTOP), 0, dialog_proc); + if (rv == -1) + fatal (IDS_DIALOG_FAILED); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/dialog.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/dialog.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to provide common functionality for + all the dialogs in the program. */ + +#include "win32.h" +#include +#include +#include "dialog.h" +#include "msg.h" +#include "log.h" + +char * +eget (HWND h, int id, char *var) +{ + char tmp[4000]; + if (var) + { + free (var); + var = 0; + } + if (GetDlgItemText (h, id, tmp, sizeof (tmp)) > 0) + { + var = (char *) malloc (strlen (tmp)+1); + strcpy (var, tmp); + } + return var; +} + +int +eget (HWND h, int id) +{ + BOOL s; + int r = GetDlgItemInt (h, id, &s, TRUE); + return r; +} + +void +eset (HWND h, int id, char *val) +{ + SetDlgItemText (h, id, val); +} + +void +eset (HWND h, int id, int val) +{ + SetDlgItemInt (h, id, (UINT)val, TRUE); +} + +int +rbget (HWND h, int *ids) +{ + int i; + for (i=0; ids[i]; i++) + if (IsDlgButtonChecked (h, ids[i]) == BST_CHECKED) + return ids[i]; + return 0; +} + +void +rbset (HWND h, int *ids, int id) +{ + int i; + for (i=0; ids[i]; i++) + CheckDlgButton (h, ids[i], id==ids[i] ? BST_CHECKED : BST_UNCHECKED); +} + +void +fatal (char *m) +{ + DWORD e = GetLastError (); + char *buf; + FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + 0, + e, + 0, + (CHAR *)&buf, + 0, + 0); + MessageBox (0, buf, m, 0); + exit_setup (1); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/dialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/dialog.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* global instance for the application; set in main.cc */ +extern HINSTANCE hinstance; + +/* used by main.cc to select the next do_* function */ +extern int next_dialog; + +/* either "nothing to do" or "setup complete" or something like that */ +extern int exit_msg; + +#define D(x) void x(HINSTANCE _h) + +/* prototypes for all the do_* functions (most called by main.cc) */ + +D(do_choose); +D(do_desktop); +D(do_download); +D(do_fromcwd); +D(do_ini); +D(do_install); +D(do_local_dir); +D(do_net); +D(do_other); +D(do_postinstall); +D(do_root); +D(do_site); +D(do_source); +D(do_splash); + +#undef D + +/* end this dialog and select the next. Pass 0 to exit the program */ +#define NEXT(id) EndDialog((HWND)h, 0), next_dialog = id + +/* Get the value of an EditText control. Pass the previously stored + value and it will free the memory if needed. */ + +char *eget (HWND h, int id, char *var); + +/* Same, but convert the value to an integer */ + +int eget (HWND h, int id); + +/* Set the EditText control to the given string or integer */ + +void eset (HWND h, int id, char *var); +void eset (HWND h, int id, int var); + +/* RadioButtons. ids is a null-terminated list of IDs. Get + returns the selected ID (or zero), pass an ID to set */ + +int rbget (HWND h, int *ids); +void rbset (HWND h, int *ids, int id); + +/* *This* version of fatal (compare with msg.h) uses GetLastError() to + format a suitable error message. Similar to perror() */ + +void fatal (char *msg); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/diskfull.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/diskfull.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to hide the mess needed just to figure + out how full a given disk is. There is an old API that can't + handle disks bigger than 2G, and a new API that isn't always + available. */ + +#include "win32.h" +#include "diskfull.h" + +typedef BOOL (WINAPI * GDFS)(LPCTSTR, PULARGE_INTEGER, PULARGE_INTEGER, + PULARGE_INTEGER); + +int +diskfull (char *path) +{ + GDFS gdfs = 0; + + HINSTANCE k = LoadLibrary ("KERNEL32.DLL"); + if (k) + { + gdfs = (GDFS) GetProcAddress (k, "GetDiskFreeSpaceExA"); + + if (gdfs) + { + ULARGE_INTEGER avail, total, free; + if (gdfs (path, &avail, &total, &free)) + { + int perc = avail.QuadPart * 100 / total.QuadPart; + return 100-perc; + } + } + } + + char root[4]; + if (path[1] != ':') + return 0; + + root[0] = path[0]; + root[1] = ':'; + root[2] = '\\'; + root[3] = 0; + + DWORD junk, free_clusters, total_clusters; + + if (GetDiskFreeSpace (root, &junk, &junk, &free_clusters, &total_clusters)) + { + int perc = free_clusters * 100 / total_clusters; + return 100-perc; + } + + return 0; +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/diskfull.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/diskfull.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* returns 0..100 (percent) */ +int diskfull (char *path); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/download.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/download.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to download all the files we need to + do the installation. */ + +#include +#include +#include + +#include "win32.h" + +#include "resource.h" +#include "msg.h" +#include "ini.h" +#include "dialog.h" +#include "concat.h" +#include "geturl.h" +#include "state.h" +#include "mkdir.h" +#include "log.h" + +#define pi (package[i].info[package[i].trust]) + +static int +download_one (char *name, int expected_size) +{ + char *local = name; + + struct stat s; + if (stat (local, &s) >= 0) + if (s.st_size == expected_size) + return 0; + + mkdir_p (0, local); + + if (get_url_to_file (concat (MIRROR_SITE, "/", name, 0), + concat (local, ".tmp", 0), + expected_size)) + { + note (IDS_DOWNLOAD_FAILED, name); + return 1; + } + else + { + stat (concat (local, ".tmp", 0), &s); + if (s.st_size == expected_size) + { + log (0, "Downloaded %s", local); + rename (concat (local, ".tmp", 0), local); + } + else + { + log (0, "Download %s wrong size (%d actual vs %d expected)", + local, s.st_size, expected_size); + note (IDS_DOWNLOAD_SHORT, local, s.st_size, expected_size); + return 1; + } + } + + return 0; +} + +void +do_download (HINSTANCE h) +{ + int i; + int errors = 0; + + for (i=0; i + * + */ + +/* The purpose of this file is to doa recursive find on a given + directory, calling a given function for each file found. */ + +#include "win32.h" +#include +#include + +#include "port.h" + +static void (*for_each)(char *, unsigned int); +static char dir[_MAX_PATH], *found_part; + +static int +find_sub () +{ + WIN32_FIND_DATA wfd; + HANDLE h; + char *end = dir + strlen (dir); + int rv = 0; + + *end++ = '/'; + strcpy (end, "*"); + + h = FindFirstFile (dir, &wfd); + + if (h == INVALID_HANDLE_VALUE) + return 0; + + do { + if (strcmp (wfd.cFileName, ".") == 0 + || strcmp (wfd.cFileName, "..") == 0) + continue; + + strcpy (end, wfd.cFileName); + + if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + find_sub (); + else + { + for_each (found_part, wfd.nFileSizeLow); + rv ++; + } + + } while (FindNextFile (h, &wfd)); + + FindClose (h); + return rv; +} + +int +find (char *starting_dir, void (*_for_each)(char *, unsigned int)) +{ + strcpy (dir, starting_dir); + for_each = _for_each; + found_part = dir + strlen (dir) + 1; + + return find_sub (); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/find.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/find.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The for_each function is called once for each file found in the + starting_dir or any subdir (recursively), passing the relative path + (i.e. it doesn't include "starting_dir") and the size of the file + (bytes). find() returns the number of files found. Directories + are scanned but not included in the "found" files. */ + +extern int find (char *starting_dir, void (*for_each)(char *, unsigned int)); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/fromcwd.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/fromcwd.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to handle the case where we're + installing from files that already exist in the current directory. + If a setup.ini file is present, we set the mirror site to "." and + pretend we're installing from the `internet' ;-) else we have to + find all the .tar.gz files, deduce their versions, and try to + compare versions in the case where the current directory contains + multiple versions of any given package. We do *not* try to compare + versions with already installed packages; we always choose a + package in the current directory over one that's already installed + (otherwise, why would you have asked to install it?). Note + that we search recursively. */ + +#include "win32.h" + +#include +#include +#include +#include +#ifndef WIN32_NATIVE +#include +#endif + +#include "ini.h" +#include "resource.h" +#include "concat.h" +#include "state.h" +#include "dialog.h" +#include "msg.h" +#include "find.h" +#include "version.h" + +#include "port.h" + +static int +is_test_version (char *v) +{ + int i; + for (i=0; v[i] && isdigit (v[i]); i++) ; + return (i >= 6) ? 1 : 0; +} + +char * +canonicalize_version (char *v) +{ + static char nv[3][100]; + static int idx = 0; + char *np, *dp; + int i; + + idx = (idx+1) % 3; + np = nv[idx]; + + while (*v) + { + if (isdigit (*v)) + { + for (dp=v; *dp && isdigit (*dp); dp++) ; + for (i=dp-v; i<12; i++) + *np++ = '0'; + while (v < dp) + *np++ = *v++; + } + else + *np++ = *v++; + } + *np++ = 0; + return nv[idx]; +} + +static void +found_file (char *path, unsigned int fsize) +{ + char base[_MAX_PATH], *ver; + + int l = strlen (path); + + if (strcmp (path + l - 7, ".tar.gz") != 0) + return; + if (strstr (path, "-src.")) + return; + if (strstr (path, "-patch.")) + return; + + char *sl = strrchr (path, '/'); + if (sl) + sl ++; + else + sl = path; + strcpy (base, sl); + base[strlen (base) - 7] = 0; /* remove .tar.gz */ + for (ver=base; *ver; ver++) + if ((*ver == '-' || *ver == '_') && isdigit (ver[1])) + { + *ver++ = 0; + break; + } + + Package *p = 0; + int i; + + for (i=0; iinfo[trust].version) + { + char *ov = canonicalize_version (p->info[trust].version); + char *nv = canonicalize_version (ver); + if (strcmp (ov, nv) > 0) + return; + } + + l = strlen (base); + if (l >= 5 && strcmp (base + l - 5, "win32") == 0) + p->type = TY_NATIVE; + if (l >= 8 && strcmp (base + l - 8, "cygwin32") == 0) + p->type = TY_CYGWIN; + + p->info[trust].version = strdup (ver); + p->info[trust].install = strdup (path); + p->info[trust].install_size = fsize; +} + +void +do_fromcwd (HINSTANCE h) +{ + if (_access ("./setup.ini", 0) == 0) + { + mirror_site = "."; + next_dialog = IDD_S_LOAD_INI; + return; + } + + next_dialog = IDD_CHOOSE; + + find (".", found_file); + + // Now see about source tarballs + int i, t; + Package *p; + char srcpath[_MAX_PATH]; + for (i=0; iinfo[t].install) + { + strcpy (srcpath, p->info[t].install); + strcpy (srcpath + strlen (srcpath) - 7, "-src.tar.gz"); + msg ("looking for %s", srcpath); + + WIN32_FIND_DATA wfd; + HANDLE h = FindFirstFile (srcpath, &wfd); + if (h != INVALID_HANDLE_VALUE) + { + msg("-- got it"); + FindClose (h); + p->info[t].source = strdup (srcpath); + p->info[t].source_size = wfd.nFileSizeLow; + } + } + } + + return; +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/geturl.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/geturl.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to act as a pretty interface to + netio.cc. We add a progress dialog and some convenience functions + (like collect to string or file */ + +#include "win32.h" +#include "commctrl.h" + +#include +#include +#include + +#include "dialog.h" +#include "geturl.h" +#include "resource.h" +#include "netio.h" +#include "msg.h" +#include "log.h" + +static int is_showing = 0; +static HWND gw_dialog = 0; +static HWND gw_url = 0; +static HWND gw_rate = 0; +static HWND gw_progress = 0; +static HANDLE init_event; +static int max_bytes = 0; + +static BOOL +dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) +{ + switch (id) + { + case IDCANCEL: + exit_setup (0); + } + return FALSE; +} + +static BOOL CALLBACK +dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + gw_dialog = h; + gw_url = GetDlgItem (h, IDC_DLS_URL); + gw_rate = GetDlgItem (h, IDC_DLS_RATE); + gw_progress = GetDlgItem (h, IDC_DLS_PROGRESS); + SetEvent (init_event); + return FALSE; + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); + } + return FALSE; +} + +static DWORD WINAPI +dialog (void *) +{ + MSG m; + HWND gw_dialog = CreateDialog (hinstance, MAKEINTRESOURCE (IDD_DLSTATUS), + 0, dialog_proc); + ShowWindow (gw_dialog, SW_SHOWNORMAL); + UpdateWindow (gw_dialog); + while (GetMessage (&m, 0, 0, 0) > 0) { + TranslateMessage (&m); + DispatchMessage (&m); + } + return FALSE; +} + +static DWORD start_tics; + +static void +init_dialog (char *url, int length) +{ + if (gw_dialog == 0) + { + DWORD tid; + HANDLE thread; + init_event = CreateEvent (0, 0, 0, 0); + thread = CreateThread (0, 0, dialog, 0, 0, &tid); + WaitForSingleObject (init_event, 1000); + CloseHandle (init_event); + SendMessage (gw_progress, PBM_SETRANGE, 0, MAKELPARAM (0, 100)); + is_showing = 0; + } + char *sl=url, *cp; + for (cp=url; *cp; cp++) + if (*cp == '/' || *cp == '\\' || *cp == ':') + sl = cp+1; + max_bytes = length; + SetWindowText (gw_url, sl); + SetWindowText (gw_rate, "Connecting..."); + SendMessage (gw_progress, PBM_SETPOS, (WPARAM) 0, 0); + ShowWindow (gw_progress, (length > 0) ? SW_SHOW : SW_HIDE); + ShowWindow (gw_dialog, SW_SHOWNORMAL); + if (!is_showing) + { + SetForegroundWindow (gw_dialog); + is_showing = 1; + } + start_tics = GetTickCount (); +} + + +static void +progress (int bytes) +{ + static char buf[100]; + int kbps; + static DWORD last_tics = 0; + DWORD tics = GetTickCount (); + if (tics == start_tics) // to prevent division by zero + return; + if (tics < last_tics + 200) // to prevent flickering updates + return; + last_tics = tics; + + kbps = bytes / (tics - start_tics); + ShowWindow (gw_progress, (max_bytes > 0) ? SW_SHOW : SW_HIDE); + if (max_bytes > 100) + { + int perc = bytes / (max_bytes / 100); + SendMessage (gw_progress, PBM_SETPOS, (WPARAM) perc, 0); + sprintf (buf, "%3d %% (%dk/%dk) %d kb/s\n", + perc, bytes/1000, max_bytes/1000, kbps); + } + else + sprintf (buf, "%d %d kb/s\n", bytes, kbps); + + SetWindowText (gw_rate, buf); +} + +struct GUBuf { + GUBuf *next; + int count; + char buf[2000]; +}; + +char * +get_url_to_string (char *_url) +{ + log (LOG_BABBLE, "get_url_to_string %s", _url); + init_dialog (_url, 0); + NetIO *n = NetIO::open (_url); + if (!n || !n->ok ()) + { + delete n; + log (LOG_BABBLE, "get_url_to_string failed!"); + return 0; + } + + if (n->file_size) + max_bytes = n->file_size; + + GUBuf *bufs = 0; + GUBuf **nextp = &bufs; + int total_bytes = 1; /* for the NUL */ + progress (0); + while (1) + { + GUBuf *b = new GUBuf; + *nextp = b; + b->next = 0; + nextp = &(b->next); + + b->count = n->read (b->buf, sizeof (b->buf)); + if (b->count <= 0) + break; + total_bytes += b->count; + progress (total_bytes); + } + + char *rv = (char *) malloc (total_bytes); + char *rvp = rv; + while (bufs && bufs->count > 0) + { + GUBuf *tmp = bufs->next; + memcpy (rvp, bufs->buf, bufs->count); + rvp += bufs->count; + delete bufs; + bufs = tmp; + } + *rvp = 0; + return rv; +} + +int +get_url_to_file (char *_url, char *_filename, int expected_length) +{ + log (LOG_BABBLE, "get_url_to_file %s %s", _url, _filename); + init_dialog (_url, expected_length); + + remove (_filename); /* but ignore errors */ + + NetIO *n = NetIO::open (_url); + if (!n || !n->ok ()) + { + delete n; + log (LOG_BABBLE, "get_url_to_file failed!"); + return 1; + } + + FILE *f = fopen (_filename, "wb"); + if (!f) + { + char *err = strerror (errno); + if (!err) + err = "(unknown error)"; + fatal (IDS_ERR_OPEN_WRITE, _filename, err); + } + + if (n->file_size) + max_bytes = n->file_size; + + int total_bytes = 0; + progress (0); + while (1) + { + char buf[8192]; + int count; + count = n->read (buf, sizeof (buf)); + if (count <= 0) + break; + fwrite (buf, 1, count, f); + total_bytes += count; + progress (total_bytes); + } + + fclose (f); + + return 0; +} + +void +dismiss_url_status_dialog () +{ + ShowWindow (gw_dialog, SW_HIDE); + is_showing = 0; +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/geturl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/geturl.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Download files from the Internet. These pop up a progress dialog; + don't forget to dismiss it when you're done downloading for a while */ + +char *get_url_to_string (char *_url); +int get_url_to_file (char *_url, char *_filename, int expected_size); +void dismiss_url_status_dialog (); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/gnu.bmp Binary file netinstall/gnu.bmp has changed diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/hash.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/hash.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Simple hash class for install.cc */ + +#include "win32.h" +#include +#include + +#include "hash.h" + +class hash_internals { +public: + char **keys; + int numkeys; + int maxkeys; + int prev_index; +}; + +hash::hash () +{ + h = new hash_internals; + h->numkeys = 0; + h->maxkeys = 10; + h->keys = (char **) malloc (h->maxkeys * sizeof (char *)); + h->prev_index = 0; +} + +hash::~hash () +{ + free (h->keys); + free (h); +} + + +void +hash::add (char *string) +{ + int i; + for (i=0; inumkeys; i++) + if (strcmp (h->keys[i], string) == 0) + return; + if (h->numkeys >= h->maxkeys) + { + h->maxkeys += 10; + h->keys = (char **) realloc (h->keys, h->maxkeys * sizeof (char *)); + } + + h->keys[h->numkeys] = _strdup (string); + h->numkeys ++; +} + + +int +hash::has (char *string) +{ + int i; + for (i=0; inumkeys; i++) + if (strcmp (h->keys[i], string) == 0) + return 1; + return 0; +} + +char * +hash::enumerate (char *prev) +{ + if (prev == 0) + h->prev_index = -1; + h->prev_index ++; + if (h->prev_index >= h->numkeys) + return 0; + return h->keys[h->prev_index]; +} + +static int CDECL +rev_len (const void *va, const void *vb) +{ + char *a = *(char **)va; + char *b = *(char **)vb; + return strcmp (b, a); +} + +void +hash::reverse_sort () +{ + qsort (h->keys, h->numkeys, sizeof (h->keys[0]), rev_len); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/hash.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/hash.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Simple hash class for install.cc */ + +class hash_internals; + +class hash { + hash_internals *h; + public: + hash (); + ~hash (); + + void add (char *string); + int has (char *string); + + /* specialty for install.cc */ + void add_subdirs (char *path); + void reverse_sort (); + + char *enumerate (char *prev=0); +}; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/ini.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/ini.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to get and parse the setup.ini file + from the mirror site. A few support routines for the bison and + flex parsers are provided also. We check to see if this setup.ini + is older than the one we used last time, and if so, warn the user. */ + +#include "win32.h" + +#include +#include +#include + +#include "ini.h" +#include "resource.h" +#include "concat.h" +#include "state.h" +#include "geturl.h" +#include "dialog.h" +#include "msg.h" +#include "mkdir.h" +#include "log.h" +#include "reginfo.h" +#include "version.h" + +unsigned int setup_timestamp = 0; +char *setup_version = 0; + +extern "C" int yyparse (); +/*extern int yydebug;*/ + +static char *error_buf = 0; +static int error_count = 0; + +void +do_ini (HINSTANCE h) +{ + char *ini_file = get_url_to_string (concat (MIRROR_SITE, "/setup.ini", 0)); + dismiss_url_status_dialog (); + + if (!ini_file) + { + note (IDS_SETUPINI_MISSING, MIRROR_SITE); + next_dialog = IDD_SITE; + return; + } + + package = 0; + npackages = 0; + setup_timestamp = 0; + setup_version = 0; + + ini_init (ini_file); + + setup_timestamp = 0; + /*yydebug = 1;*/ + + if (yyparse () || error_count > 0) + { + if (error_count == 1) + MessageBox (0, error_buf, "Parse Error", 0); + else + MessageBox (0, error_buf, "Parse Errors", 0); + } + else + { + /* save known-good setup.ini locally */ + FILE *inif = fopen ("setup.ini", "wb"); + if (inif) + { + fwrite (ini_file, 1, strlen (ini_file), inif); + fclose (inif); + } + } + + if (root_dir) + { + mkdir_p (1, concat (root_dir, XEMACS_SETUP_DIR, 0)); + + unsigned int old_timestamp = 0; + FILE *ots = fopen (concat (root_dir, XEMACS_SETUP_DIR, "timestamp", 0), "rt"); + if (ots) + { + fscanf (ots, "%u", &old_timestamp); + fclose (ots); + if (old_timestamp && setup_timestamp + && (old_timestamp > setup_timestamp)) + { + int yn = yesno (IDS_OLD_SETUPINI); + if (yn == IDNO) + exit_setup (1); + } + } + if (setup_timestamp) + { + FILE *nts = fopen (concat (root_dir, XEMACS_SETUP_DIR, "timestamp", 0), "wt"); + if (nts) + { + fprintf (nts, "%u", setup_timestamp); + fclose (nts); + } + } + } + + msg ("setup_version is %s, our_version is %s", setup_version? setup_version : "(null)", version); + if (setup_version) + { + char *ini_version = canonicalize_version (setup_version); + char *our_version = canonicalize_version (version); + if (strcmp (our_version, ini_version) < 0) + note (IDS_OLD_SETUP_VERSION, version, setup_version); + } + + next_dialog = IDD_CHOOSE; +} + +extern "C" int yylineno; + +extern "C" int CDECL yyerror (char *s, ...) +{ + char buf[1000]; + int len; + sprintf (buf, "setup.ini line %d: ", yylineno); + va_list args; + va_start (args, s); + vsprintf (buf + strlen (buf), s, args); + OutputDebugString (buf); + if (error_buf) + { + strcat (error_buf, "\n"); + len = strlen (error_buf) + strlen (buf) + 5; + error_buf = (char *) realloc (error_buf, len); + strcat (error_buf, buf); + } + else + { + len = strlen (buf) + 5; + error_buf = (char *) malloc (len); + strcpy (error_buf, buf); + } + error_count++; + return 0; +} + +extern "C" int CDECL fprintf (FILE *f, const char *s, ...); + +static char stderrbuf[1000]; + +int CDECL +fprintf (FILE *f, const char *fmt, ...) +{ + char buf[1000]; + int rv; + va_list args; + va_start (args, fmt); + if (f == stderr) + { + rv = vsprintf (buf, fmt, args); + strcat (stderrbuf, buf); + if (char *nl = strchr (stderrbuf, '\n')) + { + *nl = 0; + /*OutputDebugString (stderrbuf);*/ + MessageBox (0, buf, "XEmacs Setup", 0); + stderrbuf[0] = 0; + } + + } + else + { + rv = vfprintf (f, fmt, args); + } + return rv; +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/ini.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/ini.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* When setup.ini is parsed, the information is stored according to + the declarations here. ini.cc (via inilex and iniparse) + initializes these structures. choose.cc sets the action and trust + fields. download.cc downloads any needed files for selected + packages (the chosen "install" field). install.cc installs + selected packages. */ + +#define YYSTYPE char * + +/* lowest number must be most trusted, highest least trusted */ +#define TRUST_PREV 0 +#define TRUST_CURR 1 +#define TRUST_TEST 2 +#define NTRUST 3 +#define TRUST_UNKNOWN 3 /* intentionally not in NTRUST */ + +#define TY_GENERIC 0 +#define TY_CYGWIN 1 +#define TY_NATIVE 2 + +#define ACTION_UNKNOWN 0 +#define ACTION_SAME 1 +#define ACTION_NEW 2 +#define ACTION_UPGRADE 3 +#define ACTION_UNINSTALL 4 +#define ACTION_ERROR 5 + +#define SRCACTION_NO 0 +#define SRCACTION_YES 1 + +typedef struct { + char *name; /* package name, like "cygwin" */ + char *sdesc; /* short description (replaces "name" if provided) */ + char *ldesc; /* long description (multi-line) */ + int action; /* ACTION_* - only NEW and UPGRADE get installed */ + int srcaction;/* SRCACTION_ */ + int trust; /* TRUST_* (selects among info[] below) */ + int type; /* TY_GENERIC, TY_CYGWIN or TY_NATIVE. */ + + struct { + char *version; /* version part of filename */ + char *install; /* file name to install */ + int install_size; /* in bytes */ + char *source; /* sources for installed binaries */ + int source_size; /* in bytes */ + } info[NTRUST+1]; /* +1 for TRUST_UNKNOWN */ +} Package; + +extern Package *package; +extern Package *xemacs_package; + +extern int npackages; + +#ifdef __cplusplus +extern "C" { +#endif + +Package *new_package (char *name); +void ini_init (char *string); + +#define pi (package[i].info[package[i].trust]) + +#define LOOP_PACKAGES \ + for (i=0; i + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define YY_USES_REJECT + +#define yywrap() 1 +#define YY_SKIP_YYWRAP +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern int yylineno; +int yylineno = 1; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 21 +#define YY_END_OF_BUFFER 22 +static yyconst short int yy_acclist[188] = + { 0, + 22, 20, 21, 17, 20, 21, 19, 21, 20, 21, + 20, 21, 16, 20, 21, 20, 21, 16, 20, 21, + 16, 20, 21, 16, 20, 21, 16, 20, 21, 16, + 20, 21, 16, 20, 21, 16, 20, 21, 16, 20, + 21, 16, 20, 21, 16, 20, 21, 16, 20, 21, + 17, 1, 18, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 10, 16, 16, 16, 16, 16, 16, 16, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, + + 15, 16, 16, 16, 16, 16, 6, 16, 16, 16, + 16, 16, 16, 6, 10, 16, 11, 15, 14, 15, + 12, 15, 16, 9, 8, 16, 16, 16, 16, 9, + 10, 8, 10, 16, 16, 16, 16, 16, 16, 7, + 16, 16, 16, 16, 7, 10, 16, 5, 16, 16, + 4, 5, 10, 16, 16, 4, 10, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 3, 16, + 3, 10, 16, 16, 2, 2, 10 + } ; + +static yyconst short int yy_accept[167] = + { 0, + 1, 1, 1, 2, 4, 7, 9, 11, 13, 16, + 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, + 48, 51, 52, 52, 53, 53, 54, 55, 55, 55, + 55, 55, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 72, 72, 72, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 86, 86, + 86, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 100, 102, 102, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + + 113, 114, 116, 117, 119, 121, 123, 124, 125, 126, + 127, 128, 129, 130, 132, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 147, 148, 149, + 150, 151, 152, 154, 155, 156, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 183, 184, 185, 186, 188, 188 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 4, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 6, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 8, 1, 1, + 1, 1, 1, 1, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 9, 1, 10, 1, 7, 1, 11, 7, 12, 13, + + 14, 7, 7, 7, 15, 7, 7, 16, 17, 18, + 19, 20, 7, 21, 22, 23, 24, 25, 7, 26, + 27, 7, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[28] = + { 0, + 1, 1, 1, 1, 1, 2, 2, 3, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2 + } ; + +static yyconst short int yy_base[171] = + { 0, + 0, 27, 264, 265, 261, 265, 258, 258, 0, 43, + 242, 246, 45, 231, 243, 248, 52, 48, 54, 57, + 61, 253, 250, 265, 250, 265, 0, 242, 61, 62, + 66, 64, 229, 236, 235, 225, 223, 226, 224, 236, + 265, 69, 72, 75, 71, 73, 82, 74, 265, 82, + 86, 90, 83, 220, 220, 219, 216, 218, 224, 215, + 90, 93, 99, 100, 91, 102, 101, 101, 226, 104, + 107, 224, 222, 221, 212, 219, 222, 214, 117, 119, + 124, 118, 125, 220, 126, 217, 265, 216, 215, 208, + 215, 214, 215, 206, 265, 200, 127, 210, 209, 112, + + 131, 265, 132, 265, 265, 265, 200, 265, 265, 119, + 207, 196, 138, 265, 265, 139, 205, 140, 204, 196, + 196, 265, 201, 200, 141, 145, 265, 199, 265, 189, + 184, 265, 265, 144, 142, 265, 190, 181, 152, 147, + 180, 186, 149, 157, 177, 180, 159, 160, 187, 179, + 162, 166, 179, 178, 168, 175, 161, 265, 167, 265, + 172, 170, 265, 265, 265, 187, 190, 175, 117, 192 + } ; + +static yyconst short int yy_def[171] = + { 0, + 165, 165, 165, 165, 165, 165, 166, 167, 168, 169, + 168, 168, 168, 168, 168, 170, 170, 170, 170, 170, + 170, 165, 166, 165, 167, 165, 168, 169, 169, 169, + 169, 169, 168, 168, 168, 168, 168, 168, 168, 170, + 165, 170, 170, 170, 170, 170, 170, 170, 165, 169, + 169, 169, 169, 168, 168, 168, 168, 168, 168, 168, + 170, 170, 170, 170, 170, 170, 170, 169, 169, 169, + 169, 168, 168, 168, 168, 168, 168, 168, 170, 170, + 170, 170, 170, 170, 170, 169, 165, 169, 169, 168, + 168, 168, 168, 168, 165, 168, 170, 170, 170, 170, + + 170, 165, 170, 165, 165, 165, 168, 165, 165, 168, + 168, 168, 170, 165, 165, 170, 170, 170, 168, 168, + 168, 165, 168, 170, 170, 170, 165, 170, 165, 168, + 168, 165, 165, 170, 170, 165, 168, 168, 170, 170, + 168, 168, 170, 170, 168, 168, 170, 170, 168, 168, + 170, 170, 168, 168, 170, 170, 168, 165, 170, 165, + 168, 170, 165, 165, 0, 165, 165, 165, 165, 165 + } ; + +static yyconst short int yy_nxt[293] = + { 0, + 4, 5, 6, 7, 8, 9, 9, 4, 10, 4, + 9, 9, 9, 9, 11, 12, 9, 9, 9, 9, + 9, 13, 14, 9, 15, 9, 9, 4, 5, 6, + 7, 8, 16, 16, 4, 10, 4, 16, 16, 16, + 16, 17, 18, 16, 16, 16, 16, 16, 19, 20, + 16, 21, 16, 16, 29, 41, 30, 35, 36, 41, + 43, 41, 31, 37, 41, 32, 44, 45, 41, 42, + 49, 49, 46, 49, 48, 49, 41, 53, 41, 41, + 41, 41, 41, 47, 50, 62, 52, 51, 63, 41, + 61, 49, 49, 64, 67, 49, 65, 41, 41, 49, + + 41, 66, 68, 70, 71, 69, 41, 41, 41, 41, + 49, 83, 79, 49, 80, 84, 49, 116, 28, 41, + 81, 86, 85, 82, 41, 41, 41, 97, 88, 89, + 98, 41, 41, 41, 41, 99, 101, 100, 41, 41, + 103, 120, 113, 121, 117, 41, 41, 41, 41, 41, + 118, 41, 41, 124, 41, 134, 41, 128, 135, 41, + 139, 125, 140, 126, 41, 143, 41, 41, 144, 41, + 147, 148, 155, 41, 41, 41, 27, 164, 152, 163, + 161, 151, 160, 156, 159, 158, 162, 23, 23, 23, + 25, 25, 25, 40, 40, 157, 154, 153, 150, 149, + + 146, 145, 142, 141, 138, 137, 136, 133, 132, 131, + 130, 129, 127, 123, 122, 119, 115, 114, 112, 111, + 110, 109, 108, 107, 106, 105, 104, 102, 96, 95, + 94, 93, 92, 91, 90, 87, 78, 77, 76, 75, + 74, 73, 72, 41, 60, 59, 58, 57, 56, 55, + 54, 49, 26, 24, 22, 41, 39, 38, 34, 33, + 26, 24, 22, 165, 3, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165 + + } ; + +static yyconst short int yy_chk[293] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 10, 18, 10, 13, 13, 17, + 18, 19, 10, 13, 20, 10, 19, 19, 21, 17, + 29, 30, 19, 32, 21, 31, 42, 32, 45, 43, + 46, 48, 44, 20, 29, 43, 31, 30, 44, 47, + 42, 50, 53, 45, 48, 51, 46, 61, 65, 52, + + 62, 47, 50, 52, 53, 51, 63, 64, 67, 66, + 68, 65, 61, 70, 62, 66, 71, 100, 169, 100, + 63, 68, 67, 64, 79, 82, 80, 79, 70, 71, + 80, 81, 83, 85, 97, 81, 83, 82, 101, 103, + 85, 110, 97, 110, 101, 113, 116, 118, 125, 135, + 103, 134, 126, 113, 140, 125, 143, 118, 126, 139, + 134, 116, 135, 116, 144, 139, 147, 148, 140, 151, + 143, 144, 151, 152, 159, 155, 168, 162, 148, 161, + 157, 147, 156, 152, 155, 154, 159, 166, 166, 166, + 167, 167, 167, 170, 170, 153, 150, 149, 146, 145, + + 142, 141, 138, 137, 131, 130, 128, 124, 123, 121, + 120, 119, 117, 112, 111, 107, 99, 98, 96, 94, + 93, 92, 91, 90, 89, 88, 86, 84, 78, 77, + 76, 75, 74, 73, 72, 69, 60, 59, 58, 57, + 56, 55, 54, 40, 39, 38, 37, 36, 35, 34, + 33, 28, 25, 23, 22, 16, 15, 14, 12, 11, + 8, 7, 5, 3, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165 + + } ; + +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +++yy_lp; \ +goto find_rule; \ +} +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +char *yytext; +#line 1 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +#define INITIAL 0 +#line 2 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* tokenize the setup.ini files. We parse a string which we've + previously downloaded. The program must call ini_init() to specify + that string. */ + +#include "win32.h" +#include +#include + +#include "ini.h" +#include "iniparse.h" + +#define YY_INPUT(buf,result,max_size) { result = ini_getchar(buf, max_size); } + +static int ini_getchar(char *buf, int max_size); +static void ignore_line (); + +/*%option debug */ +#define YY_NEVER_INTERACTIVE 1 +#line 546 "lex.yy.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + yy_current_buffer->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 42 "/windows/build/xemacs/xemacs/netinstall/inilex.l" + + +#line 699 "lex.yy.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 166 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 265 ); + +yy_find_action: + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + { + yy_full_match = yy_cp; + break; + } + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER ) + { + int yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + ++yylineno; + } + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +YY_RULE_SETUP +#line 44 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +{ yylval = strdup (yytext+1); + yylval[strlen (yylval)-1] = 0; + return STRING; } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 48 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return SETUP_TIMESTAMP; + YY_BREAK +case 3: +YY_RULE_SETUP +#line 49 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return SETUP_VERSION; + YY_BREAK +case 4: +YY_RULE_SETUP +#line 50 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return VERSION; + YY_BREAK +case 5: +YY_RULE_SETUP +#line 51 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return INSTALL; + YY_BREAK +case 6: +YY_RULE_SETUP +#line 52 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return TYPE; + YY_BREAK +case 7: +YY_RULE_SETUP +#line 53 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return SOURCE; + YY_BREAK +case 8: +YY_RULE_SETUP +#line 54 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return SDESC; + YY_BREAK +case 9: +YY_RULE_SETUP +#line 55 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return LDESC; + YY_BREAK +case 10: +YY_RULE_SETUP +#line 57 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +ignore_line (); + YY_BREAK +case 11: +YY_RULE_SETUP +#line 59 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return T_CURR; + YY_BREAK +case 12: +YY_RULE_SETUP +#line 60 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return T_TEST; + YY_BREAK +case 13: +YY_RULE_SETUP +#line 61 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return T_TEST; + YY_BREAK +case 14: +YY_RULE_SETUP +#line 62 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return T_PREV; + YY_BREAK +case 15: +YY_RULE_SETUP +#line 63 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +return T_UNKNOWN; + YY_BREAK +case 16: +YY_RULE_SETUP +#line 65 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +{ yylval = strdup (yytext); + return STRING; } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 68 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +/* do nothing */ + YY_BREAK +case 18: +YY_RULE_SETUP +#line 70 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +/* ignore comments */ + YY_BREAK +case 19: +YY_RULE_SETUP +#line 72 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +{ return yytext[0]; } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 73 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +{ return yytext[0]; } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 75 "/windows/build/xemacs/xemacs/netinstall/inilex.l" +ECHO; + YY_BREAK +#line 899 "lex.yy.c" + case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a singled characater, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 166 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 166 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + yy_is_jam = (yy_current_state == 165); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + if ( c == '\n' ) + --yylineno; + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + yytext_ptr = yy_c_buf_p; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + { + yy_c_buf_p = + yytext_ptr + YY_MORE_ADJ; + return EOF; + } + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + break; + + case EOB_ACT_LAST_MATCH: +#ifdef __cplusplus + YY_FATAL_ERROR( + "unexpected last match in yyinput()" ); +#else + YY_FATAL_ERROR( + "unexpected last match in input()" ); +#endif + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + yy_current_buffer->yy_at_bol = (c == '\n'); + if ( yy_current_buffer->yy_at_bol ) + ++yylineno; + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *str ) +#else +YY_BUFFER_STATE yy_scan_string( str ) +yyconst char *str; +#endif + { + int len; + for ( len = 0; str[len]; ++len ) + ; + + return yy_scan_bytes( str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n - YY_MORE_ADJ; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 75 "/windows/build/xemacs/xemacs/netinstall/inilex.l" + + +static char *input_string = 0; +static char *end_input_string; + +void +ini_init(char *string) +{ + input_string = string; + end_input_string = input_string + strlen(input_string); +} + +static int +ini_getchar(char *buf, int max_size) +{ + if (input_string) + { + int avail = end_input_string - input_string; + if (avail == 0) + { + input_string = end_input_string = 0; + return 0; + } + if (avail > max_size) + avail = max_size; + memcpy(buf, input_string, avail); + input_string += avail; + return avail; + } + else + return 0; +} + +static void +ignore_line () +{ + char c; + while (c = input ()) + { + if (c == EOF) + return; + if (c == '\n') + return; + } +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/inilex.l --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/inilex.l Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,119 @@ +%{ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* tokenize the setup.ini files. We parse a string which we've + previously downloaded. The program must call ini_init() to specify + that string. */ + +#include "win32.h" +#include +#include + +#include "ini.h" +#include "iniparse.h" + +#define YY_INPUT(buf,result,max_size) { result = ini_getchar(buf, max_size); } + +static int ini_getchar(char *buf, int max_size); +static void ignore_line (); + +%} + +/*%option debug */ +%option noyywrap +%option yylineno +%option never-interactive + +STR [a-zA-Z0-9_./-]+ + +%% + +\"[^"]*\" { yylval = strdup (yytext+1); + yylval[strlen (yylval)-1] = 0; + return STRING; } + +"setup-timestamp:" return SETUP_TIMESTAMP; +"setup-version:" return SETUP_VERSION; +"version:" return VERSION; +"install:" return INSTALL; +"type:" return TYPE; +"source:" return SOURCE; +"sdesc:" return SDESC; +"ldesc:" return LDESC; + +^{STR}":" ignore_line (); + +"[curr]" return T_CURR; +"[test]" return T_TEST; +"[exp]" return T_TEST; +"[prev]" return T_PREV; +"["{STR}"]" return T_UNKNOWN; + +{STR} { yylval = strdup (yytext); + return STRING; } + +[ \t\r]+ /* do nothing */ + +"#".*\n /* ignore comments */ + +\n { return yytext[0]; } +. { return yytext[0]; } + +%% + +static char *input_string = 0; +static char *end_input_string; + +void +ini_init(char *string) +{ + input_string = string; + end_input_string = input_string + strlen(input_string); +} + +static int +ini_getchar(char *buf, int max_size) +{ + if (input_string) + { + int avail = end_input_string - input_string; + if (avail == 0) + { + input_string = end_input_string = 0; + return 0; + } + if (avail > max_size) + avail = max_size; + memcpy(buf, input_string, avail); + input_string += avail; + return avail; + } + else + return 0; +} + +static void +ignore_line () +{ + char c; + while (c = input ()) + { + if (c == EOF) + return; + if (c == '\n') + return; + } +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/iniparse.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/iniparse.c Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,1068 @@ + +/* A Bison parser, made from /windows/build/xemacs/xemacs/netinstall/iniparse.y + by GNU Bison version 1.28 */ + +#define YYBISON 1 /* Identify Bison output. */ + +#define STRING 257 +#define SETUP_TIMESTAMP 258 +#define SETUP_VERSION 259 +#define VERSION 260 +#define INSTALL 261 +#define SOURCE 262 +#define SDESC 263 +#define LDESC 264 +#define TYPE 265 +#define T_PREV 266 +#define T_CURR 267 +#define T_TEST 268 +#define T_UNKNOWN 269 + +#line 1 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" + +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Parse the setup.ini files. inilex.l provides the tokens for this. */ + +#include +#include +#include +#include "win32.h" + +#include "ini.h" +#include "iniparse.h" + +#include "port.h" + +#define YYERROR_VERBOSE 1 +/*#define YYDEBUG 1*/ + +static Package *cp; +static int trust; +extern unsigned int setup_timestamp; +extern char *setup_version; +extern int yylineno; +extern int CDECL yyerror (char *s, ...); + +#define cpt (cp->info+trust) + +#ifndef YYSTYPE +#define YYSTYPE int +#endif +#include + +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif + + + +#define YYFINAL 47 +#define YYFLAG -32768 +#define YYNTBASE 18 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 269 ? yytranslate[x] : 27) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 17, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15 +}; + +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 3, 6, 7, 11, 15, 17, 18, 22, 25, + 26, 27, 33, 37, 39, 42, 45, 48, 52, 56, + 59, 61, 63, 65, 67, 68 +}; + +static const short yyrhs[] = { 19, + 22, 0, 20, 19, 0, 0, 4, 3, 16, 0, + 5, 3, 16, 0, 16, 0, 0, 1, 21, 16, + 0, 23, 22, 0, 0, 0, 17, 3, 16, 24, + 25, 0, 26, 16, 25, 0, 26, 0, 6, 3, + 0, 9, 3, 0, 10, 3, 0, 7, 3, 3, + 0, 8, 3, 3, 0, 11, 3, 0, 12, 0, + 13, 0, 14, 0, 15, 0, 0, 1, 16, 0 +}; + +#endif + +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 50, 54, 55, 59, 60, 61, 62, 63, 66, 67, + 71, 73, 76, 77, 81, 82, 83, 84, 86, 88, + 94, 95, 96, 97, 98, 99 +}; +#endif + + +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) + +static const char * const yytname[] = { "$","error","$undefined.","STRING", +"SETUP_TIMESTAMP","SETUP_VERSION","VERSION","INSTALL","SOURCE","SDESC","LDESC", +"TYPE","T_PREV","T_CURR","T_TEST","T_UNKNOWN","'\\n'","'@'","whole_file","setup_headers", +"setup_header","@1","packages","package","@2","lines","simple_line", NULL +}; +#endif + +static const short yyr1[] = { 0, + 18, 19, 19, 20, 20, 20, 21, 20, 22, 22, + 24, 23, 25, 25, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26 +}; + +static const short yyr2[] = { 0, + 2, 2, 0, 3, 3, 1, 0, 3, 2, 0, + 0, 5, 3, 1, 2, 2, 2, 3, 3, 2, + 1, 1, 1, 1, 0, 2 +}; + +static const short yydefact[] = { 0, + 7, 0, 0, 6, 10, 0, 0, 0, 0, 0, + 1, 10, 2, 8, 4, 5, 0, 9, 11, 0, + 0, 0, 0, 0, 0, 0, 0, 21, 22, 23, + 24, 12, 14, 26, 15, 0, 0, 16, 17, 20, + 0, 18, 19, 13, 0, 0, 0 +}; + +static const short yydefgoto[] = { 45, + 5, 6, 7, 11, 12, 20, 32, 33 +}; + +static const short yypact[] = { 18, +-32768, -1, 1,-32768, -14, 18, -11, 4, 5, 21, +-32768, -14,-32768,-32768,-32768,-32768, 9,-32768,-32768, 0, + 10, 24, 25, 26, 27, 28, 29,-32768,-32768,-32768, +-32768,-32768, 17,-32768,-32768, 33, 34,-32768,-32768,-32768, + 0,-32768,-32768,-32768, 38, 39,-32768 +}; + +static const short yypgoto[] = {-32768, + 35,-32768,-32768, 30,-32768,-32768, 2,-32768 +}; + + +#define YYLAST 43 + + +static const short yytable[] = { -25, + 21, 8, 10, 9, 14, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, -25, -25, -3, 1, 15, + 16, 2, 3, 17, 19, 34, 35, 36, 37, 38, + 39, 40, 41, 4, -3, 42, 43, 46, 47, 0, + 13, 18, 44 +}; + +static const short yycheck[] = { 0, + 1, 3, 17, 3, 16, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 0, 1, 16, + 16, 4, 5, 3, 16, 16, 3, 3, 3, 3, + 3, 3, 16, 16, 17, 3, 3, 0, 0, -1, + 6, 12, 41 +}; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/bison.simple" +/* This file comes from bison-1.28. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(token, value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +#ifndef YYPURE +#define YYLEX yylex() +#endif + +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) +#endif +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ +#endif + +/* If nonreentrant, generate the variables here */ + +#ifndef YYPURE + +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ + +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif + +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ + +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ +#endif + +/* YYINITDEPTH indicates the initial size of the parser's stacks */ + +#ifndef YYINITDEPTH +#define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ + +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 10000 +#endif + +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; +{ + register char *f = from; + register char *t = to; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#else /* __cplusplus */ + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *to, char *from, unsigned int count) +{ + register char *t = to; + register char *f = from; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#endif +#endif + +#line 217 "/usr/share/bison.simple" + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +#ifdef YYPARSE_PARAM +int yyparse (void *); +#else +int yyparse (void); +#endif +#endif + +int +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +#define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + + int yylen; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss - 1; + yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif + +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + + /* Get the current used size of the three stacks, in elements. */ + int size = yyssp - yyss + 1; + +#ifdef yyoverflow + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif + + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif +#else /* no yyoverflow */ + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif +#endif /* no yyoverflow */ + + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif + + goto yybackup; + yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif + } + else + { + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + + yystate = yyn; + goto yynewstate; + +/* Do the default action for the current state. */ +yydefault: + + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + +/* Do a reduction. yyn is the number of a rule to reduce with. */ +yyreduce: + yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ + +#if YYDEBUG != 0 + if (yydebug) + { + int i; + + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + + switch (yyn) { + +case 4: +#line 59 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ setup_timestamp = strtoul (yyvsp[-1], 0, 0); ; + break;} +case 5: +#line 60 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ setup_version = strdup (yyvsp[-1]); ; + break;} +case 7: +#line 62 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ yyerror ("unrecognized line in setup.ini headers (do you have the latest setup?)"); ; + break;} +case 11: +#line 71 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ new_package(yyvsp[-1]); ; + break;} +case 15: +#line 81 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ cpt->version = yyvsp[0]; ; + break;} +case 16: +#line 82 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ cp->sdesc = yyvsp[0]; ; + break;} +case 17: +#line 83 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ cp->ldesc = yyvsp[0]; ; + break;} +case 18: +#line 84 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ cpt->install = yyvsp[-1]; + cpt->install_size = atoi(yyvsp[0]); ; + break;} +case 19: +#line 86 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ cpt->source = yyvsp[-1]; + cpt->source_size = atoi(yyvsp[0]); ; + break;} +case 20: +#line 88 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ if (!strcmp (yyvsp[0], "cygwin")) + cp->type = TY_CYGWIN; + else if (!strcmp (yyvsp[0], "native")) + cp->type = TY_NATIVE; + else + cp->type = TY_GENERIC; ; + break;} +case 21: +#line 94 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ trust = TRUST_PREV; ; + break;} +case 22: +#line 95 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ trust = TRUST_CURR; ; + break;} +case 23: +#line 96 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ trust = TRUST_TEST; ; + break;} +case 24: +#line 97 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ trust = TRUST_UNKNOWN; ; + break;} +case 26: +#line 99 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" +{ yylineno --; + yyerror ("unrecognized line in package %s (do you have the latest setup?)", cp->name); + yylineno ++; + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; + +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif + + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + +yyerrlab: /* here on detecting error */ + + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); + } + + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; + + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; + + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 1; +} +#line 105 "/windows/build/xemacs/xemacs/netinstall/iniparse.y" + + +Package *package = 0; +Package *xemacs_package = 0; +int npackages = 0; +static int maxpackages = 0; + +Package * +new_package (char *name) +{ + if (package == 0) + maxpackages = npackages = 0; + if (npackages >= maxpackages) + { + maxpackages += 10; + if (package) + package = (Package *) realloc (package, maxpackages * sizeof (Package)); + else + package = (Package *) malloc (maxpackages * sizeof (Package)); + } + cp = package + npackages; + npackages ++; + + memset (cp, 0, sizeof (Package)); + cp->name = name; + + trust = TRUST_CURR; + + return cp; +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/iniparse.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/iniparse.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,19 @@ +#ifndef YYSTYPE +#define YYSTYPE int +#endif +#define STRING 257 +#define SETUP_TIMESTAMP 258 +#define SETUP_VERSION 259 +#define VERSION 260 +#define INSTALL 261 +#define SOURCE 262 +#define SDESC 263 +#define LDESC 264 +#define TYPE 265 +#define T_PREV 266 +#define T_CURR 267 +#define T_TEST 268 +#define T_UNKNOWN 269 + + +extern YYSTYPE yylval; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/iniparse.y --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/iniparse.y Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,134 @@ +%{ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Parse the setup.ini files. inilex.l provides the tokens for this. */ + +#include +#include +#include +#include "win32.h" + +#include "ini.h" +#include "iniparse.h" + +#include "port.h" + +#define YYERROR_VERBOSE 1 +/*#define YYDEBUG 1*/ + +static Package *cp; +static int trust; +extern unsigned int setup_timestamp; +extern char *setup_version; +extern int yylineno; +extern int CDECL yyerror (char *s, ...); + +#define cpt (cp->info+trust) + +%} + +%token STRING +%token SETUP_TIMESTAMP SETUP_VERSION VERSION INSTALL SOURCE SDESC LDESC TYPE +%token T_PREV T_CURR T_TEST T_UNKNOWN + +%% + +whole_file + : setup_headers packages + ; + +setup_headers + : setup_header setup_headers + | /* empty */ + ; + +setup_header + : SETUP_TIMESTAMP STRING '\n' { setup_timestamp = strtoul ($2, 0, 0); } + | SETUP_VERSION STRING '\n' { setup_version = strdup ($2); } + | '\n' + | error { yyerror ("unrecognized line in setup.ini headers (do you have the latest setup?)"); } '\n' + ; + +packages + : package packages + | /* empty */ + ; + +package + : '@' STRING '\n' { new_package($2); } + lines + ; + +lines + : simple_line '\n' lines + | simple_line + ; + +simple_line + : VERSION STRING { cpt->version = $2; } + | SDESC STRING { cp->sdesc = $2; } + | LDESC STRING { cp->ldesc = $2; } + | INSTALL STRING STRING { cpt->install = $2; + cpt->install_size = atoi($3); } + | SOURCE STRING STRING { cpt->source = $2; + cpt->source_size = atoi($3); } + | TYPE STRING { if (!strcmp ($2, "cygwin")) + cp->type = TY_CYGWIN; + else if (!strcmp ($2, "native")) + cp->type = TY_NATIVE; + else + cp->type = TY_GENERIC; } + | T_PREV { trust = TRUST_PREV; } + | T_CURR { trust = TRUST_CURR; } + | T_TEST { trust = TRUST_TEST; } + | T_UNKNOWN { trust = TRUST_UNKNOWN; } + | /* empty */ + | error '\n' { yylineno --; + yyerror ("unrecognized line in package %s (do you have the latest setup?)", cp->name); + yylineno ++; + } + ; + +%% + +Package *package = 0; +Package *xemacs_package = 0; +int npackages = 0; +static int maxpackages = 0; + +Package * +new_package (char *name) +{ + if (package == 0) + maxpackages = npackages = 0; + if (npackages >= maxpackages) + { + maxpackages += 10; + if (package) + package = (Package *) realloc (package, maxpackages * sizeof (Package)); + else + package = (Package *) malloc (maxpackages * sizeof (Package)); + } + cp = package + npackages; + npackages ++; + + memset (cp, 0, sizeof (Package)); + cp->name = name; + + trust = TRUST_CURR; + + return cp; +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/install.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/install.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,491 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to intall all the packages selected in + the install list (in ini.h). Note that we use a separate thread to + maintain the progress dialog, so we avoid the complexity of + handling two tasks in one thread. We also create or update all the + files in /etc/setup and create the mount points. */ + +#include +#include +#include +#ifndef WIN32_NATIVE +#include +#endif +#include +#include +#include +#include + +#include "win32.h" +#include "commctrl.h" + +#include "resource.h" +#include "ini.h" +#include "dialog.h" +#include "concat.h" +#include "geturl.h" +#include "mkdir.h" +#include "state.h" +#include "tar.h" +#include "diskfull.h" +#include "msg.h" +#include "regedit.h" +#include "reginfo.h" +#include "log.h" +#include "hash.h" + +#include "port.h" + +static HWND ins_dialog = 0; +static HWND ins_action = 0; +static HWND ins_pkgname = 0; +static HWND ins_filename = 0; +static HWND ins_pprogress = 0; +static HWND ins_iprogress = 0; +static HWND ins_diskfull = 0; +static HANDLE init_event; + +static int total_bytes = 0; +static int total_bytes_sofar = 0; +static int package_bytes = 0; + +static BOOL +dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) +{ + switch (id) + { + case IDCANCEL: + exit_setup (1); + } + return FALSE; +} + +static BOOL CALLBACK +dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + ins_dialog = h; + ins_action = GetDlgItem (h, IDC_INS_ACTION); + ins_pkgname = GetDlgItem (h, IDC_INS_PKG); + ins_filename = GetDlgItem (h, IDC_INS_FILE); + ins_pprogress = GetDlgItem (h, IDC_INS_PPROGRESS); + ins_iprogress = GetDlgItem (h, IDC_INS_IPROGRESS); + ins_diskfull = GetDlgItem (h, IDC_INS_DISKFULL); + SetEvent (init_event); + return FALSE; + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); + } + return FALSE; +} + +static DWORD WINAPI +dialog (void *) +{ + MSG m; + HWND new_dialog = CreateDialog (hinstance, MAKEINTRESOURCE (IDD_INSTATUS), + 0, dialog_proc); + if (new_dialog == 0) + fatal ("create dialog"); + ShowWindow (new_dialog, SW_SHOWNORMAL); + UpdateWindow (new_dialog); + while (GetMessage (&m, 0, 0, 0) > 0) { + TranslateMessage (&m); + DispatchMessage (&m); + } + return FALSE; +} + +static void +init_dialog () +{ + if (ins_dialog == 0) + { + DWORD tid; + HANDLE thread; + init_event = CreateEvent (0, 0, 0, 0); + thread = CreateThread (0, 0, dialog, 0, 0, &tid); + WaitForSingleObject (init_event, 10000); + CloseHandle (init_event); + SendMessage (ins_pprogress, PBM_SETRANGE, 0, MAKELPARAM (0, 100)); + SendMessage (ins_iprogress, PBM_SETRANGE, 0, MAKELPARAM (0, 100)); + SendMessage (ins_diskfull, PBM_SETRANGE, 0, MAKELPARAM (0, 100)); + } + + SetWindowText (ins_pkgname, ""); + SetWindowText (ins_filename, ""); + SendMessage (ins_pprogress, PBM_SETPOS, (WPARAM) 0, 0); + SendMessage (ins_iprogress, PBM_SETPOS, (WPARAM) 0, 0); + SendMessage (ins_diskfull, PBM_SETPOS, (WPARAM) 0, 0); + ShowWindow (ins_dialog, SW_SHOWNORMAL); + SetForegroundWindow (ins_dialog); +} + +static void +progress (int bytes) +{ + int perc; + + if (package_bytes > 100) + { + perc = bytes / (package_bytes / 100); + SendMessage (ins_pprogress, PBM_SETPOS, (WPARAM) perc, 0); + } + + if (total_bytes > 100) + { + perc = (total_bytes_sofar + bytes) / (total_bytes / 100); + SendMessage (ins_iprogress, PBM_SETPOS, (WPARAM) perc, 0); + } +} + +static void +badrename (char *o, char *n) +{ + char *err = strerror (errno); + if (!err) + err = "(unknown error)"; + note (IDS_ERR_RENAME, o, n, err); +} + +static char *standard_dirs[] = { + 0 +}; + +void +hash::add_subdirs (char *path) +{ + char *nonp, *pp; + for (nonp = path; *nonp == '\\' || *nonp == '/'; nonp++); + for (pp = path + strlen(path) - 1; pp>nonp; pp--) + if (*pp == '/' || *pp == '\\') + { + int i, s=0; + char c = *pp; + *pp = 0; + for (i=0; standard_dirs[i]; i++) + if (strcmp (standard_dirs[i]+1, path) == 0) + { + s = 1; + break; + } + if (s == 0) + add (path); + *pp = c; + } +} + +char * +map_filename (char *fn, int type) +{ + char *dest_file; + while (*fn == '/' || *fn == '\\') + fn++; + if (type == TY_GENERIC) + dest_file = concat (root_dir, XEMACS_PACKAGE_DIR, fn, 0); + else // TY_CYGWIN | TY_NATIVE + dest_file = concat (root_dir, "/", fn, 0); + return dest_file; +} + +static int +exists (char *file) +{ + if (_access (file, 0) == 0) + return 1; + return 0; +} + + +static int num_installs, num_uninstalls; + +static void +uninstall_one (char *name, int action, int type) +{ + hash dirs; + char line[_MAX_PATH]; + char* fname = (type == TY_GENERIC ? + concat (root_dir, XEMACS_PACKAGE_DIR, "pkginfo/MANIFEST.", + name, 0) : + concat (root_dir, XEMACS_SETUP_DIR, "MANIFEST.", name, 0)); + + FILE* lst = fopen (fname, "rb"); + + if (lst) + { + SetWindowText (ins_pkgname, name); + SetWindowText (ins_action, "Uninstalling..."); + if (action == ACTION_UPGRADE) + log (0, "Uninstalling old %s", name); + else + log (0, "Uninstalling %s", name); + + while (fgets (line, sizeof (line), lst)) + { + if (line[strlen(line)-1] == '\n') + line[strlen(line)-1] = 0; + + dirs.add_subdirs (line); + + char *d = map_filename (line, type); + DWORD dw = GetFileAttributes (d); + if (dw != 0xffffffff && !(dw & FILE_ATTRIBUTE_DIRECTORY)) + { + log (LOG_BABBLE, "unlink %s", d); + DeleteFile (d); + } + } + fclose (lst); + + remove (fname); + + dirs.reverse_sort (); + char *subdir = 0; + while ((subdir = dirs.enumerate (subdir)) != 0) + { + char *d = map_filename (subdir, type); + if (RemoveDirectory (d)) + log (LOG_BABBLE, "rmdir %s", d); + } + num_uninstalls ++; + } +} + + +static int +install_one (char *name, char *file, int file_size, int action, int type) +{ + int errors = 0; + char *local = file, *cp, *fn, *base; + + base = local; + for (cp=local; *cp; cp++) + if (*cp == '/' || *cp == '\\' || *cp == ':') + base = cp+1; + SetWindowText (ins_pkgname, base); + + if (!exists (local) && exists (base)) + local = base; + if (!exists (local)) + { + note (IDS_ERR_OPEN_READ, local, "No such file"); + return 1; + } + + char* fname = (type == TY_GENERIC ? + concat (root_dir, XEMACS_PACKAGE_DIR, "pkginfo/MANIFEST.", + name, 0) : + concat (root_dir, XEMACS_SETUP_DIR, "MANIFEST.", name, 0)); + + FILE* lst = fopen (fname, "wb"); + + package_bytes = file_size; + + switch (action) + { + case ACTION_NEW: + SetWindowText (ins_action, "Installing..."); + break; + case ACTION_UPGRADE: + SetWindowText (ins_action, "Upgrading..."); + break; + } + + log (0, "Installing %s", local); + tar_open (local); + while ((fn = tar_next_file ())) + { + char *dest_file; + + if (lst) + fprintf (lst, "%s\n", fn); + + dest_file = map_filename (fn, type); + + SetWindowText (ins_filename, dest_file); + log (LOG_BABBLE, "Installing file %s", dest_file); + if (tar_read_file (dest_file) != 0) + { + log (0, "Unable to install file %s", dest_file); + errors ++; + } + + progress (tar_ftell ()); + num_installs ++; + } + tar_close (); + + total_bytes_sofar += file_size; + progress (0); + + int df = diskfull (root_dir); + SendMessage (ins_diskfull, PBM_SETPOS, (WPARAM) df, 0); + + if (lst) + fclose (lst); + + return errors; +} + +void +do_install (HINSTANCE h) +{ + int i; + int errors = 0; + + num_installs = 0, num_uninstalls = 0; + + next_dialog = IDD_DESKTOP; + + mkdir_p (1, root_dir); + + for (i=0; standard_dirs[i]; i++) + { + char *p = concat (root_dir, standard_dirs[i], 0); + mkdir_p (1, p); + free (p); + } + + dismiss_url_status_dialog (); + + init_dialog (); + + total_bytes = 0; + total_bytes_sofar = 0; + + int df = diskfull (root_dir); + SendMessage (ins_diskfull, PBM_SETPOS, (WPARAM) df, 0); + + LOOP_PACKAGES + { + total_bytes += pi.install_size; + } + + for (i=0; i + * based on work and suggestions of DJ Delorie + * + */ + +/* The purpose of this file is to ask the user where they want the + root of the installation to be, and to ask whether the user prefers + text or binary mounts. */ + +#include "win32.h" +#include +#include +#include +#include + +#include "dialog.h" +#include "resource.h" +#include "state.h" +#include "msg.h" +#include "concat.h" +#include "log.h" + +static void +check_if_enable_next (HWND h) +{ + EnableWindow (GetDlgItem (h, IDOK), local_dir != 0); +} + +static void +load_dialog (HWND h) +{ + eset (h, IDC_LOCAL_DIR, local_dir); + check_if_enable_next (h); +} + +static void +save_dialog (HWND h) +{ + local_dir = eget (h, IDC_LOCAL_DIR, local_dir); +} + + +static int CALLBACK +browse_cb (HWND h, UINT m, LPARAM lp, LPARAM data) +{ + switch (m) + { + case BFFM_INITIALIZED: + if (local_dir) + SendMessage (h, BFFM_SETSELECTION, TRUE, (LPARAM)local_dir); + break; + } + return 0; +} + +static void +browse (HWND h) +{ + BROWSEINFO bi; + CHAR name[MAX_PATH]; + LPITEMIDLIST pidl; + memset (&bi, 0, sizeof (bi)); + bi.hwndOwner = h; + bi.pszDisplayName = name; + bi.lpszTitle = "Select download directory"; + bi.ulFlags = BIF_RETURNONLYFSDIRS; + bi.lpfn = browse_cb; + pidl = SHBrowseForFolder (&bi); + if (pidl) + { + if (SHGetPathFromIDList (pidl, name)) + eset (h, IDC_LOCAL_DIR, name); + } +} + + +static BOOL +dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) +{ + switch (id) + { + + case IDC_LOCAL_DIR: + save_dialog (h); + check_if_enable_next (h); + break; + + case IDC_LOCAL_DIR_BROWSE: + browse (h); + break; + + case IDOK: + save_dialog (h); + if (SetCurrentDirectoryA (local_dir)) + { + switch (source) + { + case IDC_SOURCE_DOWNLOAD: + NEXT (IDD_NET); + break; + case IDC_SOURCE_NETINST: + case IDC_SOURCE_CWD: + NEXT (IDD_ROOT); + break; + default: + NEXT (0); + break; + } + } + else + note (IDS_ERR_CHDIR, local_dir); + + break; + + case IDC_BACK: + save_dialog (h); + NEXT (IDD_SOURCE); + break; + + case IDCANCEL: + NEXT (0); + break; + } + return FALSE; +} + +static BOOL CALLBACK +dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + load_dialog (h); + return FALSE; + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); + } + return FALSE; +} + +extern char cwd[_MAX_PATH]; + +void +do_local_dir (HINSTANCE h) +{ + int rv = 0; + rv = DialogBox (h, MAKEINTRESOURCE (IDD_LOCAL_DIR), 0, dialog_proc); + if (rv == -1) + fatal (IDS_DIALOG_FAILED); + + log (0, "Selected local directory: %s", local_dir); +} + diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/log.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/log.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to centralize all the logging functions. */ + +#include "win32.h" +#include +#include +#include +#include + +#include "resource.h" +#include "msg.h" +#include "log.h" +#include "dialog.h" +#include "state.h" +#include "concat.h" +#include "mkdir.h" + +struct LogEnt { + LogEnt *next; + int flags; + time_t when; + char msg[1]; +}; + +static LogEnt *first_logent = 0; +static LogEnt **next_logent = &first_logent; + +void +log (int flags, char *fmt, ...) +{ + char buf[1000]; + va_list args; + va_start (args, fmt); + vsprintf (buf, fmt, args); + + LogEnt *l = (LogEnt *) malloc (sizeof (LogEnt) + strlen (buf) + 20); + l->next = 0; + l->flags = flags; + time (&(l->when)); + *next_logent = l; + next_logent = &(l->next); + + char *b = l->msg; + if (flags & LOG_TIMESTAMP) + { + struct tm *tm = localtime (&(l->when)); + strftime (b, 1000, "%Y/%m/%d %H:%M:%S ", tm); + b += strlen (b); + } + + strcpy (b, buf); + msg ("LOG: %d %s", l->flags, l->msg); +} + +void +log_save (int babble, char *filename, int append) +{ + static int been_here = 0; + if (been_here) + return; + been_here = 1; + + mkdir_p (0, filename); + + FILE *f = fopen (filename, append ? "at" : "wt"); + if (!f) + { + fatal (IDS_NOLOGFILE, filename); + return; + } + + LogEnt *l; + + for (l=first_logent; l; l=l->next) + { + if (babble || !(l->flags & LOG_BABBLE)) + { + fputs (l->msg, f); + if (l->msg[strlen(l->msg)-1] != '\n') + fputc ('\n', f); + } + } + + fclose (f); + been_here = 0; +} + +void +exit_setup (int exit_code) +{ + static int been_here = 0; + if (been_here) + ExitProcess (1); + been_here = 1; + + if (exit_msg) + note (exit_msg); + + log (LOG_TIMESTAMP, "Ending cygwin install"); + + if (source == IDC_SOURCE_DOWNLOAD || !root_dir) + { + log_save (LOG_BABBLE, "setup.log.full", 0); + log_save (0, "setup.log", 1); + } + else + { + log_save (LOG_BABBLE, concat (root_dir, "/setup.log.full", 0), 0); + log_save (0, concat (root_dir, "/setup.log", 0), 1); + } + + ExitProcess (exit_code); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/log.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/log.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* This is for "printf"-like logging. Messages are stored in memory + until they're written out. "babble" means the message is just idle + babbling; it can be ignored for shorter logs. */ + +#define LOG_BABBLE 1 +#define LOG_TIMESTAMP 2 + +void log (int flags, char *fmt, ...); + +/* Here, "babble" means to write out the babble also. If "append" is + nonzero, the log is appended to any existing file. */ + +void log_save (int babble, char *filename, int append); + +/* This is the only legal way to exit. It writes out all the logs and things */ + +void exit_setup (int exit_code); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/main.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/main.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* OK, here's how this works. Each of the steps needed for install - + dialogs, downloads, installs - are in their own files and have some + "do_*" function (prototype in dialog.h) and a resource id (IDD_* or + IDD_S_* in resource.h) for that step. Each step is responsible for + selecting the next step! See the NEXT macro in dialog.h. Note + that the IDD_S_* ids are fake; those are for steps that don't + really have a controlling dialog (some have progress dialogs, but + those don't count, although they could). Replace the IDD_S_* with + IDD_* if you create a real dialog for those steps. */ + +#include "win32.h" + +#include +#include +#include "resource.h" +#include "dialog.h" +#include "state.h" +#include "msg.h" +#include "netio.h" +#include "find.h" +#include "log.h" + +#include "port.h" + +void netio_test (char *); + +int next_dialog; +int exit_msg = 0; + +HINSTANCE hinstance; + +int WINAPI +WinMain (HINSTANCE h, + HINSTANCE hPrevInstance, + LPSTR command_line, + int cmd_show) +{ + hinstance = h; + + next_dialog = IDD_SPLASH; + + log (LOG_TIMESTAMP, "Starting XEmacs install"); + + char cwd[_MAX_PATH]; + GetCurrentDirectory (sizeof (cwd), cwd); + local_dir = strdup (cwd); + log (0, "Current Directory: %s", cwd); + + while (next_dialog) + { + switch (next_dialog) + { + case IDD_SPLASH: do_splash (h); break; + case IDD_SOURCE: do_source (h); break; + case IDD_LOCAL_DIR: do_local_dir (h); break; + case IDD_ROOT: do_root (h); break; + case IDD_NET: do_net (h); break; + case IDD_SITE: do_site (h); break; + case IDD_OTHER_URL: do_other (h); break; + case IDD_S_LOAD_INI: do_ini (h); break; + case IDD_S_FROM_CWD: do_fromcwd (h); break; + case IDD_CHOOSE: do_choose (h); break; + case IDD_S_DOWNLOAD: do_download (h); break; + case IDD_S_INSTALL: do_install (h); break; + case IDD_DESKTOP: do_desktop (h); break; + case IDD_S_POSTINSTALL: do_postinstall (h); break; + + default: + next_dialog = 0; + break; + } + } + + exit_setup (0); + + return EXIT_SUCCESS; +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/mkdir.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/mkdir.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* see mkdir.h */ + +#include "win32.h" +#include +#include "mkdir.h" + +int +mkdir_p (int isadir, char *path) +{ + char saved_char, *slash = 0; + char *c; + DWORD d, gse; + + d = GetFileAttributes (path); + if (d != 0xffffffff && d & FILE_ATTRIBUTE_DIRECTORY) + return 0; + + if (isadir) + { + if (CreateDirectory (path, 0)) + return 0; + gse = GetLastError (); + if (gse != ERROR_PATH_NOT_FOUND && gse != ERROR_FILE_NOT_FOUND) + { + if (gse == ERROR_ALREADY_EXISTS) + { + fprintf (stderr, "warning: deleting \"%s\" so I can make a directory there\n", + path); + if (DeleteFileA (path)) + return mkdir_p (isadir, path); + } + return 1; + } + } + + for (c=path; *c; c++) + { + if (*c == ':') + slash = 0; + if (*c == '/' || *c == '\\') + slash = c; + } + + if (!slash) + return 0; + + saved_char = *slash; + *slash = 0; + if (mkdir_p (1, path)) + { + *slash = saved_char; + return 1; + } + *slash = saved_char; + + if (!isadir) + return 0; + + return mkdir_p (isadir, path); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/mkdir.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/mkdir.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Create a directory, and any needed parent directories. If "isadir" + is non-zero, "path" is the name of a directory. If "isadir" is + zero, "path" is the name of a *file* that we need a directory + for. */ + +extern int mkdir_p (int isadir, char *path); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/mklink2.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/mklink2.c Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,27 @@ +#include "win32.h" +#include "shlobj.h" + +/* This part of the code must be in C because the C++ interface to COM +doesn't work. */ + +void +make_link_2 (char *exepath, char *args, char *icon, char *lname) +{ + IShellLink *sl; + IPersistFile *pf; + WCHAR widepath [_MAX_PATH]; + + CoCreateInstance (&CLSID_ShellLink, NULL, + CLSCTX_INPROC_SERVER, &IID_IShellLink, (LPVOID *) & sl); + sl->lpVtbl->QueryInterface (sl, &IID_IPersistFile, (void **) &pf); + + sl->lpVtbl->SetPath (sl, exepath); + sl->lpVtbl->SetArguments (sl, args); + sl->lpVtbl->SetIconLocation (sl, icon, 0); + + MultiByteToWideChar (CP_ACP, 0, lname, -1, widepath, _MAX_PATH); + pf->lpVtbl->Save (pf, widepath, TRUE); + + pf->lpVtbl->Release (pf); + sl->lpVtbl->Release (sl); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/msg.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/msg.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to centralize all the message + functions. */ + +static char *cvsid = "\n%%% $Id: msg.cc,v 1.1.2.1 2000/12/11 22:01:36 andyp Exp $\n"; + +#include "win32.h" +#include +#include +#include "dialog.h" +#include "log.h" + +void +msg (char *fmt, ...) +{ + char buf[1000]; + va_list args; + va_start (args, fmt); + vsprintf (buf, fmt, args); + OutputDebugString (buf); +} + +static int +mbox (char *name, int type, int id, va_list args) +{ + char buf[1000], fmt[1000]; + + if (LoadString (hinstance, id, fmt, sizeof (fmt)) <= 0) + ExitProcess (0); + + vsprintf (buf, fmt, args); + log (0, "mbox %s: %s", name, buf); + return MessageBox (0, buf, "XEmacs Setup", type | MB_TOPMOST); +} + +void +note (int id, ...) +{ + va_list args; + va_start (args, id); + mbox ("note", 0, id, args); +} + +void +fatal (int id, ...) +{ + va_list args; + va_start (args, id); + mbox ("fatal", 0, id, args); + exit_setup (1); +} + +int +yesno (int id, ...) +{ + va_list args; + va_start (args, id); + return mbox ("yesno", MB_YESNO, id, args); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/msg.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/msg.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* This is for "printf"-like debugging. Messages go to + OutputDebugString, which can be seen while debugging under GDB or + via a debug message monitor. */ + +void msg(char *fmt, ...); + +/* This pops up a dialog with text from the string table ("id"), which + is interpreted like printf. The program exits when the user + presses OK. */ + +void fatal (int id, ...); + +/* Similar, but the program continues when the user presses OK */ + +void note (int id, ...); + +/* returns IDYES or IDNO, otherwise same as note() */ +int yesno (int id, ...); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/net.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/net.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to get the network configuration + information from the user. */ + +#include "win32.h" +#include +#include +#include "dialog.h" +#include "resource.h" +#include "state.h" +#include "msg.h" +#include "log.h" + +static int rb[] = { IDC_NET_IE5, IDC_NET_DIRECT, IDC_NET_PROXY, 0 }; + +static void +check_if_enable_next (HWND h) +{ + int e = 0, p = 0, pu = 0; + if (net_method == IDC_NET_IE5) + pu = 1; + if (net_method == IDC_NET_IE5 || net_method == IDC_NET_DIRECT) + e = 1; + else if (net_method == IDC_NET_PROXY) + { + p = pu = 1; + if (net_proxy_host && net_proxy_port) + e = 1; + } + EnableWindow (GetDlgItem (h, IDOK), e); + EnableWindow (GetDlgItem (h, IDC_PROXY_HOST), p); + EnableWindow (GetDlgItem (h, IDC_PROXY_PORT), p); +} + +static void +load_dialog (HWND h) +{ + rbset (h, rb, net_method); + eset (h, IDC_PROXY_HOST, net_proxy_host); + if (net_proxy_port == 0) + net_proxy_port = 80; + eset (h, IDC_PROXY_PORT, net_proxy_port); + check_if_enable_next (h); +} + +static void +save_dialog (HWND h) +{ + net_method = rbget (h, rb); + net_proxy_host = eget (h, IDC_PROXY_HOST, net_proxy_host); + net_proxy_port = eget (h, IDC_PROXY_PORT); +} + +static BOOL +dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) +{ + switch (id) + { + + case IDC_NET_IE5: + case IDC_NET_DIRECT: + case IDC_NET_PROXY: + case IDC_PROXY_HOST: + case IDC_PROXY_PORT: + save_dialog (h); + check_if_enable_next (h); + break; + + case IDOK: + save_dialog (h); + switch (source) + { + case IDC_SOURCE_NETINST: + case IDC_SOURCE_DOWNLOAD: + NEXT (IDD_SITE); + break; + case IDC_SOURCE_CWD: + NEXT (0); + break; + default: + msg ("source is default? %d\n", source); + NEXT (0); + } + break; + + case IDC_BACK: + save_dialog (h); + switch (source) + { + case IDC_SOURCE_DOWNLOAD: + NEXT (IDD_LOCAL_DIR); + break; + case IDC_SOURCE_NETINST: + case IDC_SOURCE_CWD: + NEXT (IDD_ROOT); + break; + } + break; + + case IDCANCEL: + NEXT (0); + break; + } + return FALSE; +} + +static BOOL CALLBACK +dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + load_dialog (h); + return FALSE; + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); + } + return FALSE; +} + +void +do_net (HINSTANCE h) +{ + int rv = 0; + + rv = DialogBox (h, MAKEINTRESOURCE (IDD_NET), 0, dialog_proc); + if (rv == -1) + fatal (IDS_DIALOG_FAILED); + + log (0, "net: %s", + (net_method == IDC_NET_IE5) ? "IE5" : + (net_method == IDC_NET_DIRECT) ? "Direct" : "Proxy"); +} + diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/netio.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/netio.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,240 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to coordinate the various access + methods known to setup. To add a new method, create a pair of + nio-*.[ch] files and add the logic to NetIO::open here */ + +#include "win32.h" +#include +#include +#include + +#include "resource.h" +#include "state.h" +#include "msg.h" +#include "netio.h" +#include "nio-file.h" +#include "nio-ie5.h" +#include "nio-http.h" +#include "nio-ftp.h" +#include "dialog.h" +#include "log.h" + +#include "port.h" + +NetIO::NetIO (char *Purl) +{ + set_url (Purl); +} + +NetIO::~NetIO () +{ + if (url) + free (url); + if (proto) + free (proto); + if (host) + free (host); + if (path) + free (path); +} + +void +NetIO::set_url (char *Purl) +{ + char *bp, *ep, c; + + file_size = 0; + url = _strdup (Purl); + proto = 0; + host = 0; + port = 0; + path = 0; + + bp = url; + ep = strstr (bp, "://"); + if (!ep) + { + path = url; + return; + } + + *ep = 0; + proto = _strdup (bp); + *ep = ':'; + bp = ep+3; + + ep = bp + strcspn (bp, ":/"); + c = *ep; + *ep = 0; + host = _strdup (bp); + *ep = c; + + if (*ep == ':') + { + port = atoi (ep+1); + ep = strchr (ep, '/'); + } + + if (*ep) + path = _strdup (ep); +} + +int +NetIO::ok () +{ + return 0; +} + +int +NetIO::read (char *buf, int nbytes) +{ + return 0; +} + +NetIO * +NetIO::open (char *url) +{ + NetIO *rv = 0; + enum {http, ftp, file} proto; + if (strncmp (url, "http://", 7) == 0) + proto = http; + else if (strncmp (url, "ftp://", 6) == 0) + proto = ftp; + else + proto = file; + + if (proto == file) + rv = new NetIO_File (url); + else if (net_method == IDC_NET_IE5) + rv = new NetIO_IE5 (url); + else if (net_method == IDC_NET_PROXY) + rv = new NetIO_HTTP (url); + else if (net_method == IDC_NET_DIRECT) + { + switch (proto) + { + case http: + rv = new NetIO_HTTP (url); + break; + case ftp: + rv = new NetIO_FTP (url); + break; + } + } + + if (!rv->ok ()) + { + delete rv; + return 0; + } + + return rv; +} + + +static char **user, **passwd; +static int loading = 0; + +static void +check_if_enable_ok (HWND h) +{ + int e = 0; + if (*user && *passwd) + e = 1; + EnableWindow (GetDlgItem (h, IDOK), e); +} + +static void +load_dialog (HWND h) +{ + loading = 1; + eset (h, IDC_NET_USER, *user); + eset (h, IDC_NET_PASSWD, *passwd); + check_if_enable_ok (h); + loading = 0; +} + +static void +save_dialog (HWND h) +{ + *user = eget (h, IDC_NET_USER, *user); + *passwd = eget (h, IDC_NET_PASSWD, *passwd); +} + +static BOOL +auth_cmd (HWND h, int id, HWND hwndctl, UINT code) +{ + switch (id) + { + + case IDC_NET_USER: + case IDC_NET_PASSWD: + if (code == EN_CHANGE && !loading) + { + save_dialog (h); + check_if_enable_ok (h); + } + break; + + case IDOK: + save_dialog (h); + EndDialog (h, 0); + break; + + case IDCANCEL: + EndDialog (h, 1); + exit_setup (1); + break; + } + return FALSE; +} + +static BOOL CALLBACK +auth_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + load_dialog (h); + return FALSE; + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, auth_cmd); + } + return FALSE; +} + +static int +auth_common (HINSTANCE h, int id) +{ + return DialogBox (h, MAKEINTRESOURCE (id), 0, auth_proc); +} + +int +NetIO::get_auth () +{ + user = &net_user; + passwd = &net_passwd; + return auth_common (hinstance, IDD_NET_AUTH); +} + +int +NetIO::get_proxy_auth () +{ + user = &net_proxy_user; + passwd = &net_proxy_passwd; + return auth_common (hinstance, IDD_PROXY_AUTH); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/netio.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/netio.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* This is the parent class for all the access methods known to setup + (i.e. ways to download files from the internet or other sources */ + +class NetIO { +protected: + NetIO (char *url); + void set_url (char *url); + +public: + /* if nonzero, this is the estimated total file size */ + int file_size; + /* broken down url FYI */ + char *url; + char *proto; + char *host; + int port; + char *path; + virtual ~NetIO (); + + /* The user calls this function to create a suitable accessor for + the given URL. It uses the network setup state in state.h. If + anything fails, either the return values is NULL or the returned + object is !ok() */ + static NetIO * open (char *url); + + /* If !ok() that means the transfer isn't happening. */ + virtual int ok (); + + /* Read `nbytes' bytes from the file. Returns zero when the file + is complete. */ + virtual int read (char *buf, int nbytes); + + /* Helper functions for http/ftp protocols. Both return nonzero for + "cancel", zero for "ok". They set net_proxy_user, etc, in + state.h */ + int get_auth (); + int get_proxy_auth (); +}; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/nio-file.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/nio-file.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to manage access to files stored on the + local disk (i.e. "downloading" setup.ini). Called from netio.cc */ + +#include +#include +#include +#include +#include "win32.h" +#include "netio.h" +#include "nio-file.h" +#include "resource.h" +#include "msg.h" + +NetIO_File::NetIO_File (char *Purl) + : NetIO (Purl) +{ + struct stat s; + fd = fopen (path, "rb"); + if (fd) + { + stat (path, &s); + file_size = s.st_size; + } + else + { + char *err = strerror (errno); + if (!err) + err = "(unknown error)"; + note (IDS_ERR_OPEN_READ, path, err); + } +} + +NetIO_File::~NetIO_File () +{ + if (fd) + fclose ((FILE *)fd); +} + +int +NetIO_File::ok () +{ + return fd ? 1 : 0; +} + +int +NetIO_File::read (char *buf, int nbytes) +{ + return fread (buf, 1, nbytes, (FILE *)fd); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/nio-file.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/nio-file.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* see nio-file.cc */ + +class NetIO_File : public NetIO { +public: + NetIO_File (char *url); + void *fd; + ~NetIO_File (); + virtual int ok (); + virtual int read (char *buf, int nbytes); +}; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/nio-ftp.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/nio-ftp.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* This file is responsible for implementing all direct FTP protocol + channels. It is intentionally simplistic. */ + +#include "win32.h" +#include "winsock.h" +#include +#include +#include + +#include "resource.h" +#include "state.h" +#include "simpsock.h" +#include "log.h" + +#include "netio.h" +#include "nio-ftp.h" + +static SimpleSocket *cmd = 0; +static char *cmd_host = 0; +static int cmd_port = 0; + +static char *last_line; + +static int +ftp_line (SimpleSocket *s) +{ + do { + last_line = s->gets (); + log (LOG_BABBLE, "ftp > %s", last_line); + } while (last_line && (!isdigit (last_line[0]) || last_line[3] != ' ')); + return atoi (last_line ? last_line : "0"); +} + +NetIO_FTP::NetIO_FTP (char *Purl) + : NetIO (Purl) +{ + s = 0; + int code; + + if (port == 0) + port = 21; + + if (cmd_host && strcmp (host, cmd_host) != 0 || port != cmd_port) + { + if (cmd) + cmd->printf ("QUIT\r\n"); + delete cmd; + free (cmd_host); + cmd = 0; + cmd_host = 0; + } + + if (cmd == 0) + { + SimpleSocket *c = new SimpleSocket (host, port); + code = ftp_line (c); + c->printf ("USER anonymous\r\n"); + code = ftp_line (c); + if (code == 331) + { + c->printf ("PASS cygwin-setup@\r\n"); + code = ftp_line (c); + } + + if (code < 200 || code >= 300) + { + delete c; + return; + } + + cmd = c; + cmd_host = _strdup (host); + cmd_port = port; + + cmd->printf ("TYPE I\r\n"); + code = ftp_line (cmd); + } + + cmd->printf ("PASV\r\n"); + do { + code = ftp_line (cmd); + } while (code == 226); /* previous RETR */ + if (code != 227) + return; + + char *paren = strchr (last_line, '('); + if (!paren) + return; + + int i1, i2, i3, i4, p1, p2; + sscanf (paren+1, "%d,%d,%d,%d,%d,%d", &i1, &i2, &i3, &i4, &p1, &p2); + char tmp[20]; + sprintf (tmp, "%d.%d.%d.%d", i1, i2, i3, i4); + s = new SimpleSocket (tmp, p1*256 + p2); + + cmd->printf ("RETR %s\r\n", path); + code = ftp_line (cmd); + if (code != 150) + { + delete s; + s = 0; + return; + } +} + +NetIO_FTP::~NetIO_FTP () +{ + if (s) + delete s; +} + +int +NetIO_FTP::ok () +{ + if (s) + return 1; + return 0; +} + +int +NetIO_FTP::read (char *buf, int nbytes) +{ + if (!s) + return 0; + return s->read (buf, nbytes); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/nio-ftp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/nio-ftp.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Direct FTP (without proxy) */ + +class SimpleSocket; + +class NetIO_FTP : public NetIO { + SimpleSocket *s; + +public: + NetIO_FTP (char *url); + virtual ~NetIO_FTP (); + + /* If !ok() that means the transfer isn't happening. */ + virtual int ok (); + + /* Read `nbytes' bytes from the file. Returns zero when the file + is complete. */ + virtual int read (char *buf, int nbytes); +}; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/nio-http.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/nio-http.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* This file is responsible for implementing all direct HTTP protocol + channels. It is intentionally simplistic. */ + +#include "win32.h" +#include "winsock.h" +#include +#include + +#include "resource.h" +#include "state.h" +#include "simpsock.h" +#include "msg.h" + +#include "netio.h" +#include "nio-http.h" + +static char six2pr[64] = { + 'A','B','C','D','E','F','G','H','I','J','K','L','M', + 'N','O','P','Q','R','S','T','U','V','W','X','Y','Z', + 'a','b','c','d','e','f','g','h','i','j','k','l','m', + 'n','o','p','q','r','s','t','u','v','w','x','y','z', + '0','1','2','3','4','5','6','7','8','9','+','/' +}; + +static char * +base64_encode (char *username, char *password) +{ + unsigned char *ep; + char *rp; + static char *rv = 0; + if (rv) + free (rv); + rv = (char *) malloc (2 * (strlen (username) + strlen (password)) + 5); + + char *up = (char *) malloc (strlen (username) + strlen (password) + 6); + strcpy (up, username); + strcat (up, ":"); + strcat (up, password); + ep = (unsigned char *)up + strlen (up); + *ep++ = 0; + *ep++ = 0; + *ep++ = 0; + + char block[4]; + + rp = rv; + + for (ep = (unsigned char *)up; *ep; ep += 3) + { + block[0] = six2pr[ep[0] >> 2]; + block[1] = six2pr[((ep[0] << 4) & 0x30) | ((ep[1] >> 4) & 0x0f)]; + block[2] = six2pr[((ep[1] << 2) & 0x3c) | ((ep[2] >> 6) & 0x03)]; + block[3] = six2pr[ep[2] & 0x3f]; + + if (ep[1] == 0) + block[2] = block[3] = '='; + if (ep[2] == 0) + block[3] = '='; + memcpy (rp, block, 4); + rp += 4; + } + *rp = 0; + + free (up); + + return rv; +} + +NetIO_HTTP::NetIO_HTTP (char *Purl) + : NetIO (Purl) +{ + retry_get: + if (port == 0) + port = 80; + + if (net_method == IDC_NET_PROXY) + s = new SimpleSocket (net_proxy_host, net_proxy_port); + else + s = new SimpleSocket (host, port); + + if (!s->ok()) + { + s = 0; + return; + } + + if (net_method == IDC_NET_PROXY) + s->printf ("GET %s HTTP/1.0\r\n", url); + else + s->printf ("GET %s HTTP/1.0\r\n", path); + s->printf ("Host: %s:%d\r\n", host, port); + + if (net_user && net_passwd) + s->printf ("Authorization: Basic %s\r\n", + base64_encode (net_user, net_passwd)); + + if (net_proxy_user && net_proxy_passwd) + s->printf ("Proxy-Authorization: Basic %s\r\n", + base64_encode (net_proxy_user, net_proxy_passwd)); + + s->printf ("\r\n"); + + char *l = s->gets (); + int code; + sscanf (l, "%*s %d", &code); + if (code >= 300 && code < 400) + { + do { + l = s->gets (); + if (_strnicmp (l, "Location:", 9) == 0) + { + char *u = l + 9; + while (*u == ' ' || *u == '\t') + u++; + set_url (u); + delete s; + goto retry_get; + } + } while (*l); + } + if (code == 401) /* authorization required */ + { + get_auth (); + delete s; + goto retry_get; + } + if (code == 407) /* proxy authorization required */ + { + get_proxy_auth (); + delete s; + goto retry_get; + } + if (code >= 300) + { + delete s; + s = 0; + return; + } + do { + l = s->gets (); + if (_strnicmp (l, "Content-Length:", 15) == 0) + sscanf (l, "%*s %d", &file_size); + } while (*l); +} + +NetIO_HTTP::~NetIO_HTTP () +{ + if (s) + delete s; +} + +int +NetIO_HTTP::ok () +{ + if (s) + return 1; + return 0; +} + +int +NetIO_HTTP::read (char *buf, int nbytes) +{ + return s->read (buf, nbytes); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/nio-http.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/nio-http.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Direct HTTP (with or without proxy) */ + +class SimpleSocket; + +class NetIO_HTTP : public NetIO { + SimpleSocket *s; + +public: + NetIO_HTTP (char *url); + virtual ~NetIO_HTTP (); + + /* If !ok() that means the transfer isn't happening. */ + virtual int ok (); + + /* Read `nbytes' bytes from the file. Returns zero when the file + is complete. */ + virtual int read (char *buf, int nbytes); +}; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/nio-ie5.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/nio-ie5.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to manage internet downloads using the + Internet Explorer version 5 DLLs. To use this method, the user + must already have installed and configured IE5. This module is + called from netio.cc, which is called from geturl.cc */ + +static char *cvsid = "\n%%% $Id: nio-ie5.cc,v 1.1.2.1 2000/12/11 22:01:41 andyp Exp $\n"; + +#include "win32.h" + +#include "resource.h" +#include "state.h" +#include "dialog.h" +#include "msg.h" +#include "netio.h" +#include "nio-ie5.h" + +static HINTERNET internet = 0; + +NetIO_IE5::NetIO_IE5 (char *_url) + : NetIO (_url) +{ + int resend = 0; + + if (internet == 0) + { + HINSTANCE h = LoadLibrary ("wininet.dll"); + if (!h) + { + note (IDS_WININET); + connection = 0; + return; + } + InternetAttemptConnect (0); + internet = InternetOpen ("Cygwin Setup", INTERNET_OPEN_TYPE_PRECONFIG, + NULL, NULL, 0); + } + + DWORD flags = + INTERNET_FLAG_DONT_CACHE | + INTERNET_FLAG_KEEP_CONNECTION | + INTERNET_FLAG_PRAGMA_NOCACHE | + INTERNET_FLAG_RELOAD | + INTERNET_FLAG_EXISTING_CONNECT | + INTERNET_FLAG_PASSIVE; + + connection = InternetOpenUrl (internet, url, NULL, 0, flags, 0); + + try_again: + + if (net_user && net_passwd) + { + InternetSetOption (connection, INTERNET_OPTION_USERNAME, + net_user, strlen (net_user)); + InternetSetOption (connection, INTERNET_OPTION_PASSWORD, + net_passwd, strlen (net_passwd)); + } + + if (net_proxy_user && net_proxy_passwd) + { + InternetSetOption (connection, INTERNET_OPTION_PROXY_USERNAME, + net_proxy_user, strlen (net_proxy_user)); + InternetSetOption (connection, INTERNET_OPTION_PROXY_PASSWORD, + net_proxy_passwd, strlen (net_proxy_passwd)); + } + + if (resend) + if (!HttpSendRequest (connection, 0, 0, 0, 0)) + connection = 0; + + if (!connection) + { + if (GetLastError () == ERROR_INTERNET_EXTENDED_ERROR) + { + char buf[2000]; + DWORD e, l=sizeof (buf); + InternetGetLastResponseInfo (&e, buf, &l); + MessageBox (0, buf, "Internet Error", 0); + } + } + + DWORD type, type_s; + type_s = sizeof (type); + InternetQueryOption (connection, INTERNET_OPTION_HANDLE_TYPE, + &type, &type_s); + + switch (type) + { + case INTERNET_HANDLE_TYPE_HTTP_REQUEST: + case INTERNET_HANDLE_TYPE_CONNECT_HTTP: + type_s = sizeof (DWORD); + if (HttpQueryInfo (connection, + HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, + &type, &type_s, NULL)) + { + if (type == 401) /* authorization required */ + { + flush_io(); + get_auth (); + resend = 1; + goto try_again; + } + else if (type == 407) /* proxy authorization required */ + { + flush_io(); + get_proxy_auth (); + resend = 1; + goto try_again; + } + else if (type >= 300) + { + connection = 0; + return; + } + } + } +} + +void +NetIO_IE5::flush_io () +{ + DWORD actual = 0; + char buf[1024]; + do { + InternetReadFile (connection, buf, 1024, &actual); + } while (actual > 0); +} + +NetIO_IE5::~NetIO_IE5 () +{ + if (connection) + InternetCloseHandle (connection); +} + +int +NetIO_IE5::ok () +{ + return (connection == NULL) ? 0 : 1; +} + +int +NetIO_IE5::read (char *buf, int nbytes) +{ + DWORD actual; + if (InternetReadFile (connection, buf, nbytes, &actual)) + return actual; + return -1; +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/nio-ie5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/nio-ie5.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* see nio-ie5.cc */ + +class NetIO_IE5 : public NetIO { + HINTERNET connection; +public: + NetIO_IE5 (char *url); + ~NetIO_IE5 (); + virtual int ok (); + virtual int read (char *buf, int nbytes); + void flush_io(); +}; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/other.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/other.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* This handles the "other URL" option from the mirror site + selection. */ + +#include "win32.h" +#include +#include +#include +#include "dialog.h" +#include "resource.h" +#include "state.h" +#include "msg.h" +#include "log.h" + +/* private shared function, from site.cc */ +void save_site_url (void); + +static void +check_if_enable_next (HWND h) +{ + EnableWindow (GetDlgItem (h, IDOK), other_url ? 1 : 0); +} + +static void +load_dialog (HWND h) +{ + eset (h, IDC_OTHER_URL, other_url); + check_if_enable_next (h); +} + +static void +save_dialog (HWND h) +{ + other_url = eget (h, IDC_OTHER_URL, other_url); +} + +static BOOL +dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) +{ + switch (id) + { + + case IDC_OTHER_URL: + save_dialog (h); + check_if_enable_next (h); + break; + + case IDOK: + save_dialog (h); + save_site_url (); + NEXT (IDD_S_LOAD_INI); + break; + + case IDC_BACK: + save_dialog (h); + NEXT (IDD_SITE); + break; + + case IDCANCEL: + NEXT (0); + break; + } + return FALSE; +} + +static BOOL CALLBACK +dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + load_dialog (h); + return FALSE; + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); + } + return FALSE; +} + +void +do_other (HINSTANCE h) +{ + int rv = 0; + rv = DialogBox (h, MAKEINTRESOURCE (IDD_OTHER_URL), 0, dialog_proc); + if (rv == -1) + fatal (IDS_DIALOG_FAILED); + + log (0, "site: %s", other_url); +} + diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/port.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/port.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* I prefer building a cygwin version of setup for debugging, as I + find that gdb can debug those programs (and the exceptions they + cause) better. This file handles the slight differences between + cygwin and mingw. */ + +#if defined(__CYGWIN__) || defined (__CYGWIN32__) + +#define _MAX_PATH MAX_PATH + +#define _access access +#define _strdup strdup + +#endif diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/postinstall.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/postinstall.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to run all the post-install scripts + in their various forms. */ + +#include "win32.h" + +#include +#include +#include +#ifndef WIN32_NATIVE +#include +#endif + +#include "state.h" +#include "dialog.h" +#include "find.h" +#include "concat.h" +#include "regedit.h" +#include "reginfo.h" +#include "resource.h" +#include "port.h" + +static char *sh = 0; +static char *cmd = 0; +static OSVERSIONINFO verinfo; + +static void +run (char *shscript, char *args, char *file) +{ + BOOL b; + char cmdline [_MAX_PATH]; + STARTUPINFO si; + PROCESS_INFORMATION pi; + + sprintf (cmdline, "%s %s %s", shscript, args, file); + memset (&pi, 0, sizeof (pi)); + memset (&si, 0, sizeof (si)); + si.cb = sizeof (si); + si.lpTitle = "XEmacs Setup Post-Install Script"; + si.dwFlags = STARTF_USEPOSITION; + + b = CreateProcess (0, cmdline, 0, 0, 0, + CREATE_NEW_CONSOLE, 0, root_dir, &si, &pi); + + if (b) + WaitForSingleObject (pi.hProcess, INFINITE); +} + +static void +each (char *fname, unsigned int size) +{ + char *ext = strrchr (fname, '.'); + if (!ext) + return; + + if (sh && strcmp (ext, ".sh") == 0) + { + char *f2 = concat (root_dir, XEMACS_SETUP_DIR, "postinstall/", fname, 0); + run (sh, "-c", f2); + free (f2); + } + else if (cmd && strcmp (ext, ".bat") == 0) + { + char *f2 = backslash (concat (root_dir, XEMACS_SETUP_DIR, "postinstall/", + fname, 0)); + run (cmd, "/c", f2); + free (f2); + } + else + return; + + rename (concat (root_dir, XEMACS_SETUP_DIR, "postinstall/", fname, 0), + concat (root_dir, XEMACS_SETUP_DIR, "postinstall/", fname, ".done", 0)); +} + +static char *shells [] = { + "/bin/sh.exe", + "/usr/bin/sh.exe", + "/bin/bash.exe", + "/usr/bin/bash.exe", + 0 +}; + +void +do_postinstall (HINSTANCE h) +{ + int issystem; + next_dialog = 0; + char* cygroot = find_cygwin_root (&issystem); + int i; + for (i=0; shells[i]; i++) + { + sh = backslash (concat (cygroot, shells[i], 0)); + if (_access (sh, 0) == 0) + break; + free (sh); + sh = 0; + } + + char old_path[_MAX_PATH]; + GetEnvironmentVariable ("PATH", old_path, sizeof (old_path)); +#if 0 + SetEnvironmentVariable ("PATH", + backslash (concat (root_dir, "/bin;", + root_dir, "/usr/bin;", + old_path, 0))); + + SetEnvironmentVariable ("CYGWINROOT", root_dir); +#endif + SetCurrentDirectory (root_dir); + + verinfo.dwOSVersionInfoSize = sizeof (verinfo); + GetVersionEx (&verinfo); + + switch (verinfo.dwPlatformId) + { + case VER_PLATFORM_WIN32_NT: + cmd = "cmd.exe"; + break; + case VER_PLATFORM_WIN32_WINDOWS: + cmd = "command.com"; + break; + default: + cmd = "command.com"; + break; + } + + find (concat (root_dir, XEMACS_SETUP_DIR, "postinstall", 0), each); +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/regedit.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/regedit.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Manipulate the registry for XEmacs. */ + +#include "win32.h" + +#include +#if defined(CYGWIN) || defined(MINGW) +#include +#include +#endif + +#include "reginfo.h" +#include "regedit.h" +#include "msg.h" +#include "resource.h" +#include "dialog.h" + +static char * +find_cygwin_mount (HKEY rkey, int *istext) +{ + char buf[1000]; + char *retval = 0; + HKEY key; + DWORD retvallen = 0; + DWORD flags = 0; + DWORD type; + +#if defined(CYGWIN) || defined(MINGW) + sprintf (buf, "Software\\%s\\%s\\%s\\/", + CYGWIN_INFO_CYGNUS_REGISTRY_NAME, + CYGWIN_INFO_CYGWIN_REGISTRY_NAME, + CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME); + + if (RegOpenKeyEx (rkey, buf, 0, KEY_READ, &key) != ERROR_SUCCESS) + return 0; + + if (RegQueryValueEx (key, "native", 0, &type, 0, &retvallen) + == ERROR_SUCCESS) + { + retval = new char[retvallen+1]; + if (RegQueryValueEx (key, "native", 0, &type, (BYTE *)retval, &retvallen) + != ERROR_SUCCESS) + { + delete retval; + retval = 0; + } + } + + retvallen = sizeof (flags); + RegQueryValueEx (key, "flags", 0, &type, (BYTE *)&flags, &retvallen); + + RegCloseKey (key); + + if (retval) + *istext = (flags & MOUNT_BINARY) ? 0 : 1; + return retval; +#else + return 0; +#endif +} + +static char * +find_xemacs_root (HKEY rkey, int* isnative) +{ + char buf[1000]; + char *retval = 0; + HKEY key; + DWORD retvallen = 0; + DWORD type; + DWORD itype; + + sprintf (buf, "Software\\%s\\%s", + XEMACS_INFO_XEMACS_ORG_REGISTRY_NAME, + XEMACS_INFO_XEMACS_REGISTRY_NAME); + + if (RegOpenKeyEx (rkey, buf, 0, KEY_READ, &key) != ERROR_SUCCESS) + return 0; + + if (RegQueryValueEx (key, XEMACS_INFO_XEMACS_ROOT_KEY, + 0, &type, 0, &retvallen) == ERROR_SUCCESS) + { + retval = new char[retvallen+1]; + if (RegQueryValueEx (key, XEMACS_INFO_XEMACS_ROOT_KEY, + 0, &type, (BYTE *)retval, &retvallen) + != ERROR_SUCCESS) + { + delete retval; + retval = 0; + } + } + + retvallen = sizeof (itype); + RegQueryValueEx (key, XEMACS_INFO_XEMACS_ROOT_TYPE, + 0, &type, (BYTE *)&itype, &retvallen); + + if (itype == 1) + *isnative = 1; + else + *isnative = 0; + + RegCloseKey (key); + + return retval; +} + +char * +find_root_location (int *issystem, int *isnative) +{ + char *rv; + if ((rv = find_xemacs_root (HKEY_CURRENT_USER, isnative))) + { + *issystem = 0; + return rv; + } + else if ((rv = find_xemacs_root (HKEY_LOCAL_MACHINE, isnative))) + { + *issystem = 1; + return rv; + } + return 0; +} + +char * +find_cygwin_root (int *issystem) +{ + char *rv; + int istext; + if ((rv = find_cygwin_mount (HKEY_CURRENT_USER, &istext))) + { + *issystem = 0; + return rv; + } + else if ((rv = find_cygwin_mount (HKEY_LOCAL_MACHINE, &istext))) + { + *issystem = 1; + return rv; + } + return 0; +} + +void +create_xemacs_root (char *path, int issystem, int isnative) +{ + char buf[1000]; + HKEY key; + DWORD disposition; + DWORD itype = isnative ? 1 : 0; + + remove_xemacs_root (); + + sprintf (buf, "Software\\%s\\%s", + XEMACS_INFO_XEMACS_ORG_REGISTRY_NAME, + XEMACS_INFO_XEMACS_REGISTRY_NAME); + + HKEY kr = issystem ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; + if (RegCreateKeyEx (kr, buf, 0, "XEmacs", 0, KEY_ALL_ACCESS, + 0, &key, &disposition) != ERROR_SUCCESS) + fatal ("create_xemacs_root"); + + RegSetValueEx (key, XEMACS_INFO_XEMACS_ROOT_KEY, + 0, REG_SZ, (BYTE *)path, strlen (path)+1); + RegSetValueEx (key, XEMACS_INFO_XEMACS_ROOT_TYPE, + 0, REG_DWORD, (BYTE *)&itype, sizeof (itype)); +} + +void +set_app_path (char *exe, char* path, int issystem) +{ + char buf[1000]; + HKEY key; + DWORD disposition; + + sprintf (buf, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\%s", + exe); + + HKEY kr = issystem ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; + RegDeleteKey (kr, buf); + + if (RegCreateKeyEx (kr, buf, 0, "XEmacs", 0, KEY_ALL_ACCESS, + 0, &key, &disposition) != ERROR_SUCCESS) + fatal ("set_app_path"); + + RegSetValueEx (key, "Path", + 0, REG_SZ, (BYTE *)path, strlen (path)+1); +} + +static void +remove1 (HKEY rkey) +{ + char buf[1000]; + + sprintf (buf, "Software\\%s\\%s", + XEMACS_INFO_XEMACS_ORG_REGISTRY_NAME, + XEMACS_INFO_XEMACS_REGISTRY_NAME); + + RegDeleteKey (rkey, buf); +} + +void +remove_xemacs_root () +{ + remove1 (HKEY_LOCAL_MACHINE); + remove1 (HKEY_CURRENT_USER); +} + diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/regedit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/regedit.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Finds the existing root point, or returns NULL. */ + +char * find_root_location (int *issystem, int *isnative); +char * find_cygwin_root (int *issystem); + +/* Similar to the mount and umount functions, but simplified */ + +void create_xemacs_root (char *posix, int issystem, int isnative); +void remove_xemacs_root (); +void set_app_path (char *exe, char* path, int issystem); + diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/reginfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/reginfo.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,56 @@ +/* reginfo.h -- XEmacs version numbers and accompanying documentation. + +Copyright (C) 2000 Andy Piper. */ + +#define XEMACS_INFO_XEMACS_ORG_REGISTRY_NAME "GNU" +#define XEMACS_INFO_XEMACS_REGISTRY_NAME "XEmacs" +/* Keys */ +#define XEMACS_INFO_XEMACS_ROOT_KEY "emacs_dir" +#define XEMACS_INFO_XEMACS_ROOT_TYPE "install_type" +#define XEMACS_INFO_XEMACS_PACKAGE_KEY "EMACSPACKAGEPATH" +#define XEMACS_INFO_XEMACS_VERSION_KEY "version" + +#define XEMACS_DEFAULT_ROOT "\\Program Files\\XEmacs" +#define XEMACS_CYGWIN_DEFAULT_ROOT "\\usr\\local" + +#define XEMACS_SETUP_DIR \ + ((char*)(install_type == IDC_INSTALL_NATIVE ? "\\setup\\" : "/lib/xemacs/setup/")) +#define XEMACS_RESOURCE_DIR \ + ((char*)(install_type == IDC_INSTALL_NATIVE ? "\\" : "/lib/xemacs/")) +#define XEMACS_PACKAGE_DIR \ + ((char*)(install_type == IDC_INSTALL_NATIVE ? "\\xemacs-packages\\" \ + : "/lib/xemacs/xemacs-packages/")) +#define XEMACS_NATIVE_ARCH_NAME "i586-pc-win32" +#define XEMACS_CYGWIN_ARCH_NAME "i686-pc-cygwin32" + +/* + * Installation hierarchy is: + * C:\Program Files\XEmacs + * \xemacs-packages + * \etc + * \info + * \lib-src + * \lisp + * \man + * \pkginfo + * \site-packages + * \mule-packages + * \XEmacs-21.2 + * \i586-pc-win32 + * \etc + * \info + * \lisp + * Or: + * /usr/local/lib + * /xemacs/xemacs-packages + * /xemacs/site-packages + * /xemacs/mule-packages + * /xemacs-21.2 + * /i686-pc-cygwin32 + * /etc + * /info + * /lisp + * /usr/local/bin/i686-pc-cygwin32 + */ + + diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/res.rc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/res.rc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,513 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SOURCE DIALOG DISCARDABLE 0, 0, 311, 201 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "XEmacs Setup" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Next >",IDOK,199,176,45,15,WS_DISABLED + PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 + LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP + LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP + LTEXT "Setup will use the following installation method.", + IDC_STATIC,112,11,170,17 + LTEXT "To exit setup click Cancel at any time.",IDC_STATIC,112, + 32,166,17 + CONTROL "Download from the Internet",IDC_SOURCE_DOWNLOAD,"Button", + BS_AUTORADIOBUTTON,127,102,152,10 + CONTROL "Install from the Internet",IDC_SOURCE_NETINST,"Button", + BS_AUTORADIOBUTTON,127,121,87,10 + CONTROL "Install from Local Directory",IDC_SOURCE_CWD,"Button", + BS_AUTORADIOBUTTON,127,140,104,10 + GROUPBOX "Installation method",IDC_STATIC,113,84,188,77 + CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 +END + +IDD_LOCAL_DIR DIALOG DISCARDABLE 0, 0, 311, 201 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Local package directory" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Next >",IDOK,199,176,45,15,WS_DISABLED + PUSHBUTTON "< Back",IDC_BACK,154,176,45,15 + PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 + LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP + LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP + EDITTEXT IDC_LOCAL_DIR,120,138,122,12,ES_AUTOHSCROLL + PUSHBUTTON "Browse...",IDC_LOCAL_DIR_BROWSE,252,137,38,14 + LTEXT "Setup will use the following folder to install XEmacs and / or packages from.", + IDC_STATIC,112,10,170,17 + LTEXT "To select a different folder, click Browse and select another folder.", + IDC_STATIC,112,36,170,18 + LTEXT "To exit setup click Cancel at any time.",IDC_STATIC,112, + 63,166,17 + GROUPBOX "Local Package Directory",IDC_STATIC,112,126,186,31 + CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 +END + +IDD_ROOT DIALOG DISCARDABLE 0, 0, 311, 201 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "XEmacs Setup" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Next >",IDOK,199,176,45,15 + PUSHBUTTON "< Back",IDC_BACK,154,176,45,15 + PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 + LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP + LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP + EDITTEXT IDC_ROOT_DIR,120,138,122,12,ES_AUTOHSCROLL + PUSHBUTTON "Browse...",IDC_ROOT_BROWSE,252,137,38,14 + LTEXT "Setup will use the following folder in which to install XEmacs and / or packages.", + IDC_STATIC,112,10,170,17 + LTEXT "To select a different folder, click Browse and select another folder.", + IDC_STATIC,112,35,170,18 + LTEXT "To exit setup click Cancel at any time.",IDC_STATIC,112, + 63,166,17 + GROUPBOX "Installation Root Directory",IDC_STATIC,112,126,186,31 + CONTROL "All",IDC_ROOT_SYSTEM,"Button",BS_AUTORADIOBUTTON | + WS_GROUP,177,110,25,8 + CONTROL "Just Me",IDC_ROOT_USER,"Button",BS_AUTORADIOBUTTON,220, + 110,50,8 + LTEXT "Installation Type :",IDC_STATIC,112,95,60,8 + LTEXT "Install For :",IDC_STATIC,112,110,43,8 + CONTROL "Native",IDC_INSTALL_NATIVE,"Button",BS_AUTORADIOBUTTON, + 177,93,37,10 + CONTROL "Cygwin",IDC_INSTALL_CYGWIN,"Button",BS_AUTORADIOBUTTON, + 220,93,39,10 + CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 +END + +IDD_SITE DIALOG DISCARDABLE 0, 0, 311, 201 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "XEmacs Setup" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Next >",IDOK,199,176,45,15 + PUSHBUTTON "< Back",IDC_BACK,154,176,45,15 + PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 + LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP + LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP + LTEXT "Select Download Site",IDC_STATIC,113,11,135,11 + LISTBOX IDC_URL_LIST,121,24,179,136,LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_HSCROLL | WS_TABSTOP + CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 +END + +IDD_OTHER_URL DIALOG DISCARDABLE 0, 0, 311, 201 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "XEmacs Setup" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Next >",IDOK,199,176,45,15 + PUSHBUTTON "< Back",IDC_BACK,154,176,45,15 + PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 + LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP + LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP + EDITTEXT IDC_OTHER_URL,120,138,170,12,ES_AUTOHSCROLL + LTEXT "Setup will use the following URL to install XEmacs and / or packages from.", + IDC_STATIC,112,10,170,17 + LTEXT "To select a different URL, edit the text.",IDC_STATIC, + 112,36,170,18 + LTEXT "To exit setup click Cancel at any time.",IDC_STATIC,112, + 58,166,17 + GROUPBOX "Select URL to download from",IDC_STATIC,112,126,186,31 + CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 +END + +IDD_NET DIALOGEX 0, 0, 311, 201 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "XEmacs Setup" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Next >",IDOK,199,176,45,15 + PUSHBUTTON "< Back",IDC_BACK,154,176,45,15 + PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 + LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP + LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP + LTEXT "Setup will use the following connection method.", + IDC_STATIC,112,11,170,17 + LTEXT "To exit setup click Cancel at any time.",IDC_STATIC,112, + 32,166,17 + CONTROL "Use IE5 Settings",IDC_NET_IE5,"Button", + BS_AUTORADIOBUTTON,128,93,69,10 + CONTROL "Direct Connection",IDC_NET_DIRECT,"Button", + BS_AUTORADIOBUTTON,128,109,73,10 + CONTROL "Use HTTP/FTP Proxy:",IDC_NET_PROXY,"Button", + BS_AUTORADIOBUTTON,128,124,88,10 + EDITTEXT IDC_PROXY_HOST,128,141,80,12,ES_AUTOHSCROLL | + WS_DISABLED + LTEXT "Proxy",IDC_STATIC,10,55,50,15,SS_CENTERIMAGE, + WS_EX_RIGHT + LTEXT "Port",IDC_STATIC,229,139,20,15,SS_CENTERIMAGE, + WS_EX_RIGHT + EDITTEXT IDC_PROXY_PORT,257,141,30,12,ES_AUTOHSCROLL | + WS_DISABLED + GROUPBOX "Installation method",IDC_STATIC,113,78,188,83 + CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 +END + +IDD_DLSTATUS DIALOG DISCARDABLE 0, 0, 215, 95 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +CAPTION "XEmacs Setup" +FONT 8, "MS Sans Serif" +BEGIN + PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15 + LTEXT "Downloading...",IDC_STATIC,55,15,135,8 + LTEXT "(URL)",IDC_DLS_URL,55,30,150,8 + LTEXT "(RATE)",IDC_DLS_RATE,55,45,155,8 + CONTROL "Progress1",IDC_DLS_PROGRESS,"msctls_progress32", + PBS_SMOOTH | WS_BORDER,55,60,155,10 + ICON IDI_XEMACS,IDC_STATIC,5,5,20,20 +END + +IDD_INSTATUS DIALOG DISCARDABLE 0, 0, 215, 95 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +CAPTION "XEmacs Setup" +FONT 8, "MS Sans Serif" +BEGIN + PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15 + LTEXT "Installing...",IDC_INS_ACTION,55,5,135,8 + LTEXT "(PKG)",IDC_INS_PKG,55,15,150,8 + LTEXT "(FILE)",IDC_INS_FILE,55,25,155,8 + CONTROL "Progress1",IDC_INS_DISKFULL,"msctls_progress32", + PBS_SMOOTH | WS_BORDER,55,60,155,10 + ICON IDI_XEMACS,IDC_STATIC,5,5,20,20 + CONTROL "Progress1",IDC_INS_IPROGRESS,"msctls_progress32", + PBS_SMOOTH | WS_BORDER,55,50,155,10 + CONTROL "Progress1",IDC_INS_PPROGRESS,"msctls_progress32", + PBS_SMOOTH | WS_BORDER,55,40,155,10 + RTEXT "Package",IDC_STATIC,5,40,45,8 + RTEXT "Total",IDC_STATIC,10,50,40,8 + RTEXT "Disk",IDC_STATIC,5,60,45,8 +END + +IDD_PROXY_AUTH DIALOG DISCARDABLE 0, 0, 215, 95 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "XEmacs Setup" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_XEMACS,IDC_STATIC,5,5,20,20 + EDITTEXT IDC_NET_USER,65,28,145,12,ES_AUTOHSCROLL + LTEXT "Proxy User ID",IDC_STATIC,5,28,55,15,SS_CENTERIMAGE, + WS_EX_RIGHT + EDITTEXT IDC_NET_PASSWD,65,43,145,12,ES_PASSWORD | ES_AUTOHSCROLL + LTEXT "Password",IDC_STATIC,10,43,50,15,SS_CENTERIMAGE, + WS_EX_RIGHT + LTEXT "Proxy Authorization Required",IDC_STATIC,65,10,145,10 + DEFPUSHBUTTON "OK",IDOK,100,75,45,15,WS_DISABLED + PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15 +END + +IDD_NET_AUTH DIALOG DISCARDABLE 0, 0, 215, 95 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "XEmacs Setup" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDI_XEMACS,IDC_STATIC,5,5,20,20 + EDITTEXT IDC_NET_USER,65,28,145,12,ES_AUTOHSCROLL + LTEXT "User ID",IDC_STATIC,5,28,55,15,SS_CENTERIMAGE, + WS_EX_RIGHT + EDITTEXT IDC_NET_PASSWD,65,43,145,12,ES_PASSWORD | ES_AUTOHSCROLL + LTEXT "Password",IDC_STATIC,10,43,50,15,SS_CENTERIMAGE, + WS_EX_RIGHT + LTEXT "Server Authorization Required",IDC_STATIC,65,10,145,10 + DEFPUSHBUTTON "OK",IDOK,100,75,45,15,WS_DISABLED + PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15 +END + +IDD_SPLASH DIALOGEX 0, 0, 311, 201 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "XEmacs Setup" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Next >",IDOK,199,176,45,15 + PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 + ICON IDI_XEMACS,IDC_STATIC,107,10,20,20 + LTEXT "Welcome to the XEmacs Net Release Setup Program. This will install XEmacs and/or associated packages on your computer.", + IDC_STATIC,133,10,158,29 + LTEXT "Version (unknown)",IDC_VERSION,112,117,120,10 + LTEXT "Copyright (C) 2000 Red Hat Inc",IDC_STATIC,111,132,135, + 8 + LTEXT "http://www.xemacs.org/",IDC_STATIC,111,147,150,10 + LTEXT "It is strongly recommended that you exit all Windows programs before running this utility.", + IDC_STATIC,110,43,191,19 + LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP + LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP + CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 +END + +IDD_CHOOSE DIALOG DISCARDABLE 0, 0, 311, 239 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "XEmacs Setup" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Next >",IDOK,199,214,45,15 + PUSHBUTTON "< Back",IDC_BACK,154,214,45,15 + PUSHBUTTON "Cancel",IDCANCEL,256,214,45,15 + LTEXT "",IDC_STATIC,10,201,291,1,SS_SUNKEN | NOT WS_GROUP + LTEXT "Select packages to install",IDC_STATIC,55,5,85,8 + ICON IDI_XEMACS,IDC_STATIC,5,5,21,20 + LTEXT "",IDC_LISTVIEW_POS,55,15,230,155,SS_SUNKEN | NOT + WS_VISIBLE | NOT WS_GROUP + CONTROL "SPIN",IDC_STATIC,"Static",SS_BITMAP,55,170,15,13 + LTEXT "= click to choose action, (p) = previous version, (x) = experimental", + IDC_STATIC,65,170,220,8 + PUSHBUTTON "Full/Part",IDC_CHOOSE_FULLPART,250,5,35,10 + PUSHBUTTON "Exp",IDC_CHOOSE_EXP,215,5,25,10 + PUSHBUTTON "Curr",IDC_CHOOSE_CURR,190,5,25,10 + PUSHBUTTON "Prev",IDC_CHOOSE_PREV,165,5,25,10 +END + +IDD_DESKTOP DIALOG DISCARDABLE 0, 0, 311, 201 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "XEmacs Setup" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Finish",IDOK,199,176,45,15 + PUSHBUTTON "< Back",IDC_BACK,154,176,45,15 + PUSHBUTTON "Cancel",IDCANCEL,256,176,45,15 + LTEXT "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP + LTEXT "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP + LTEXT "Setup has now finished. To create desktop shortcuts, please select from the following options.", + IDC_STATIC,112,11,170,17 + LTEXT "To complete setup click Finish.",IDC_STATIC,112,32,166, + 17 + CONTROL "Create Desktop Icon",IDC_ROOT_DESKTOP,"Button", + BS_AUTOCHECKBOX,113,76,100,8 + CONTROL "Add to Start Menu",IDC_ROOT_MENU,"Button", + BS_AUTOCHECKBOX,113,97,100,8 + CONTROL "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62 +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_XEMACS ICON DISCARDABLE "xemacs.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// FILE +// + +XEMACS.ICON FILE DISCARDABLE "xemacs.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_SOURCE, DIALOG + BEGIN + VERTGUIDE, 113 + VERTGUIDE, 127 + END + + IDD_LOCAL_DIR, DIALOG + BEGIN + VERTGUIDE, 112 + HORZGUIDE, 10 + END + + IDD_ROOT, DIALOG + BEGIN + VERTGUIDE, 112 + HORZGUIDE, 103 + HORZGUIDE, 118 + END + + IDD_SITE, DIALOG + BEGIN + HORZGUIDE, 11 + HORZGUIDE, 161 + END + + IDD_NET, DIALOG + BEGIN + VERTGUIDE, 128 + BOTTOMMARGIN, 191 + HORZGUIDE, 153 + END + + IDD_PROXY_AUTH, DIALOG + BEGIN + BOTTOMMARGIN, 49 + END + + IDD_NET_AUTH, DIALOG + BEGIN + BOTTOMMARGIN, 49 + END + + IDD_SPLASH, DIALOG + BEGIN + LEFTMARGIN, 10 + RIGHTMARGIN, 301 + TOPMARGIN, 10 + BOTTOMMARGIN, 191 + END + + IDD_CHOOSE, DIALOG + BEGIN + BOTTOMMARGIN, 229 + HORZGUIDE, 214 + END + + IDD_DESKTOP, DIALOG + BEGIN + VERTGUIDE, 113 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +SPIN BITMAP DISCARDABLE "choose-spin.bmp" +IDB_SPIN BITMAP DISCARDABLE "choose-spin.bmp" +IDB_RTARROW BITMAP DISCARDABLE "choose-rtarrow.bmp" +IDB_CHECK_YES BITMAP DISCARDABLE "check-yes.bmp" +IDB_CHECK_NO BITMAP DISCARDABLE "check-no.bmp" +IDB_CHECK_NA BITMAP DISCARDABLE "check-na.bmp" +GNU BITMAP DISCARDABLE "gnu.bmp" +IDB_GNU BITMAP DISCARDABLE "gnu.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ROOT_SLASH "Warning: we recommend you do NOT use the root of your hard drive as the XEmacs root. Proceed anyway?" + IDS_ROOT_SPACE "You should not choose a root path that include spaces in directory names. Proceed anyway?" + IDS_MIRROR_LST "http://ftp.xemacs.org/pub/xemacs/mirrors.lst" + IDS_DIALOG_FAILED "Unable to create Dialog Box" + IDS_CYGWIN_FUNC_MISSING "Error: unable to find function `%s' in %s" + IDS_DOWNLOAD_SHORT "Download error: %s too short (%d, wanted %d)" + IDS_ERR_OPEN_WRITE "Can't open %s for writing: %s" + IDS_SETUPINI_MISSING "Unable to get setup.ini from %s" + IDS_OLD_SETUPINI "This setup.ini is older than the one you used last time you installed cygwin. Proceed anyway?" + IDS_ERR_RENAME "Can't rename %s to %s: %s" + IDS_NOTHING_INSTALLED "Nothing needed to be installed" + IDS_INSTALL_COMPLETE "Installation Complete" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ERR_OPEN_READ "Can't open %s for reading: %s" + IDS_ROOT_ABSOLUTE "The install directory must be absolute, with both a drive letter and leading slash, like C:\\Cygwin" + IDS_DOWNLOAD_COMPLETE "Download Complete" + IDS_CVSID "\n%%% $Id: res.rc,v 1.1.2.3 2000/12/27 09:35:11 andyp Exp $\n" + IDS_NOLOGFILE "Cannot open log file %s for writing" + IDS_UNINSTALL_COMPLETE "Uninstalls complete." + IDS_WININET "Unable to find or load the Internet Explorer 5 DLLs" + IDS_ERR_CHDIR "Could not change dir to %s" + IDS_OLD_SETUP_VERSION "This setup is version %s, but setup.ini claims version %s is available.\nYou might want to upgrade to get the latest features and bug fixes." + IDS_DOWNLOAD_FAILED "Unable to download %s" + IDS_DOWNLOAD_INCOMPLETE "Download Incomplete. Try again?" + IDS_INSTALL_INCOMPLETE "Installation incomplete. Check /setup.log.full for details" + IDS_ROOT_NOCYGWIN "You should not install the Cygwin version without Cygwin installed. Proceed anyway?" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/resource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/resource.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,113 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by res.rc +// +#define IDS_ROOT_SLASH 1 +#define IDS_ROOT_SPACE 2 +#define IDS_CWD_NONEMPTY 3 +#define IDS_MIRROR_LST 6 +#define IDS_DIALOG_FAILED 7 +#define IDS_CYGWIN_FUNC_MISSING 8 +#define IDS_DOWNLOAD_SHORT 9 +#define IDS_ERR_OPEN_WRITE 10 +#define IDS_SETUPINI_MISSING 11 +#define IDS_OLD_SETUPINI 12 +#define IDS_ERR_RENAME 13 +#define IDS_NOTHING_INSTALLED 14 +#define IDS_INSTALL_COMPLETE 15 +#define IDS_ERR_OPEN_READ 16 +#define IDS_ROOT_ABSOLUTE 17 +#define IDS_DOWNLOAD_COMPLETE 18 +#define IDS_CVSID 19 +#define IDS_NOLOGFILE 20 +#define IDS_UNINSTALL_COMPLETE 21 +#define IDS_WININET 22 +#define IDS_ERR_CHDIR 23 +#define IDS_OLD_SETUP_VERSION 24 +#define IDS_DOWNLOAD_FAILED 25 +#define IDS_DOWNLOAD_INCOMPLETE 26 +#define IDS_INSTALL_INCOMPLETE 27 +#define IDS_ROOT_NOCYGWIN 28 +#define IDD_ROOT 101 +#define IDD_SOURCE 102 +#define IDD_OTHER_URL 103 +#define IDD_SITE 104 +#define IDD_NET 105 +#define IDD_DLSTATUS 106 +#define IDD_S_LOAD_INI 107 +#define IDD_S_FROM_CWD 108 +#define IDD_CHOOSE 109 +#define IDD_S_DOWNLOAD 110 +#define IDD_S_INSTALL 111 +#define IDD_INSTATUS 112 +#define IDD_DESKTOP 113 +#define IDD_PROXY_AUTH 114 +#define IDD_S_POSTINSTALL 115 +#define IDD_NET_AUTH 116 +#define IDD_SPLASH 117 +#define IDB_SPIN 118 +#define IDB_RTARROW 119 +#define IDI_SPIN 120 +#define IDI_XEMACS 121 +#define IDD_LOCAL_DIR 122 +#define IDB_CHECK_YES 123 +#define IDB_CHECK_NO 124 +#define IDB_CHECK_NA 125 +#define IDB_GNU 126 +#define IDC_SOURCE_DOWNLOAD 1000 +#define IDC_SOURCE_NETINST 1001 +#define IDC_SOURCE_CWD 1002 +#define IDC_ROOT_DIR 1003 +#define IDC_ROOT_BROWSE 1004 +#define IDC_ROOT_TEXT 1005 +#define IDC_ROOT_BINARY 1006 +#define IDC_URL_LIST 1007 +#define IDC_SITE_NEXT 1008 +#define IDC_BACK 1009 +#define IDC_OTHER_URL 1010 +#define IDC_NET_IE5 1011 +#define IDC_NET_DIRECT 1012 +#define IDC_NET_PROXY 1013 +#define IDC_PROXY_HOST 1014 +#define IDC_PROXY_PORT 1015 +#define IDC_PROXY_USER 1016 +#define IDC_DLS_PROGRESS 1019 +#define IDC_DLS_URL 1020 +#define IDC_DLS_RATE 1021 +#define IDC_INS_PKG 1022 +#define IDC_INS_FILE 1023 +#define IDC_INS_DISKFULL 1024 +#define IDC_INS_IPROGRESS 1025 +#define IDC_INS_PPROGRESS 1026 +#define IDC_ROOT_SYSTEM 1028 +#define IDC_ROOT_USER 1029 +#define IDC_NET_USER 1030 +#define IDC_NET_PASSWD 1031 +#define IDC_VERSION 1033 +#define IDC_LISTVIEW_POS 1034 +#define IDC_CHOOSE_FULLPART 1035 +#define IDC_CHOOSE_EXP 1036 +#define IDC_CHOOSE_CURR 1037 +#define IDC_CHOOSE_PREV 1038 +#define IDC_CHOOSE_LIST 1039 +#define IDC_INS_ACTION 1040 +#define IDC_ROOT_DESKTOP 1041 +#define IDC_ROOT_MENU 1042 +#define IDC_LOCAL_DIR_BROWSE 1043 +#define IDC_LOCAL_DIR 1044 +#define IDC_INSTALL_NATIVE 1045 +#define IDC_INSTALL_CYGWIN 1046 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_3D_CONTROLS 1 +#define _APS_NEXT_RESOURCE_VALUE 127 +#define _APS_NEXT_COMMAND_VALUE 40003 +#define _APS_NEXT_CONTROL_VALUE 1050 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/root.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/root.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to ask the user where they want the + root of the installation to be, and to ask whether the user prefers + text or binary mounts. */ + +#include "win32.h" +#include +#include +#include +#include + +#include "dialog.h" +#include "resource.h" +#include "state.h" +#include "msg.h" +#include "regedit.h" +#include "reginfo.h" +#include "concat.h" +#include "log.h" + +static int rb[] = { IDC_INSTALL_CYGWIN, IDC_INSTALL_NATIVE, 0 }; +static int su[] = { IDC_ROOT_SYSTEM, IDC_ROOT_USER, 0 }; + +static void +check_if_enable_next (HWND h) +{ + EnableWindow (GetDlgItem (h, IDOK), install_type && root_dir && root_scope); +} + +static void +load_dialog (HWND h) +{ + rbset (h, rb, install_type); + rbset (h, su, root_scope); + eset (h, IDC_ROOT_DIR, root_dir); + check_if_enable_next (h); +} + +static void +save_dialog (HWND h) +{ + install_type = rbget (h, rb); + root_scope = rbget (h, su); + char* new_root_dir = eget (h, IDC_ROOT_DIR, root_dir); + + if (!root_dir || strcmp (new_root_dir, root_dir) != 0) + root_dir_default = 0; + + root_dir = new_root_dir; +} + +/* + * is_admin () determines whether or not the current user is a member of the + * Administrators group. On Windows 9X, the current user is considered an + * Administrator by definition. + */ + +static int +is_admin () +{ + // Windows 9X users are considered Administrators by definition + OSVERSIONINFO verinfo; + verinfo.dwOSVersionInfoSize = sizeof (verinfo); + GetVersionEx (&verinfo); + if (verinfo.dwPlatformId != VER_PLATFORM_WIN32_NT) + return 1; + + // Get the process token for the current process + HANDLE token; + BOOL status = OpenProcessToken (GetCurrentProcess(), TOKEN_QUERY, &token); + if (!status) + return 0; + + // Get the group token information + UCHAR token_info[1024]; + PTOKEN_GROUPS groups = (PTOKEN_GROUPS) token_info; + DWORD token_info_len = sizeof (token_info); + status = GetTokenInformation (token, TokenGroups, token_info, token_info_len, &token_info_len); + CloseHandle(token); + if (!status) + return 0; + + // Create the Administrators group SID + PSID admin_sid; + SID_IDENTIFIER_AUTHORITY authority = SECURITY_NT_AUTHORITY; + status = AllocateAndInitializeSid (&authority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &admin_sid); + if (!status) + return 0; + + // Check to see if the user is a member of the Administrators group + status = 0; + for (UINT i=0; iGroupCount; i++) { + if (EqualSid(groups->Groups[i].Sid, admin_sid)) { + status = 1; + break; + } + } + + // Destroy the Administrators group SID + FreeSid (admin_sid); + + // Return whether or not the user is a member of the Administrators group + return status; +} + +static void +change_default_root (int id) +{ + int issystem; + char* cygroot = find_cygwin_root (&issystem); + if (id == IDC_INSTALL_CYGWIN && cygroot) + { + root_dir = concat (cygroot, XEMACS_CYGWIN_DEFAULT_ROOT, 0); + install_type = IDC_INSTALL_CYGWIN; + } + else if (id == IDC_INSTALL_NATIVE) + { + char windir[_MAX_PATH]; + GetWindowsDirectory (windir, sizeof (windir)); + windir[2] = 0; + root_dir = concat (windir, XEMACS_DEFAULT_ROOT, 0); + install_type = IDC_INSTALL_NATIVE; + } +} + +static void +read_mount_table () +{ + int isnative, issystem; + root_dir = find_root_location (&issystem, &isnative); + if (root_dir) + { + if (isnative) + install_type = IDC_INSTALL_NATIVE; + else + install_type = IDC_INSTALL_CYGWIN; + + if (issystem) + root_scope = IDC_ROOT_SYSTEM; + else + root_scope = IDC_ROOT_USER; + root_dir_default = 0; + } + else + { + change_default_root (IDC_INSTALL_NATIVE); + root_scope = (is_admin()) ? IDC_ROOT_SYSTEM : IDC_ROOT_USER; + root_dir_default = 1; + } +} + +static int CALLBACK +browse_cb (HWND h, UINT m, LPARAM lp, LPARAM data) +{ + switch (m) + { + case BFFM_INITIALIZED: + if (root_dir) + SendMessage (h, BFFM_SETSELECTION, TRUE, (LPARAM)root_dir); + break; + } + return 0; +} + +static void +browse (HWND h) +{ + BROWSEINFO bi; + CHAR name[MAX_PATH]; + LPITEMIDLIST pidl; + memset (&bi, 0, sizeof (bi)); + bi.hwndOwner = h; + bi.pszDisplayName = name; + bi.lpszTitle = "Select an installation root directory"; + bi.ulFlags = BIF_RETURNONLYFSDIRS; + bi.lpfn = browse_cb; + pidl = SHBrowseForFolder (&bi); + if (pidl) + { + if (SHGetPathFromIDList (pidl, name)) + eset (h, IDC_ROOT_DIR, name); + } +} + +#define isslash(c) ((c) == '\\' || (c) == '/') + +static int +directory_is_absolute () +{ + if (isalpha (root_dir[0]) + && root_dir[1] == ':' + && (root_dir[2] == '\\' || root_dir[2] == '/')) + return 1; + return 0; +} + +static int +directory_is_rootdir () +{ + char *c; + for (c = root_dir; *c; c++) + if (isslash (c[0]) && c[1] && !isslash (c[1])) + return 0; + return 1; +} + +static int +cygwin_without_cygwin () +{ + int issystem; + if (install_type == IDC_INSTALL_CYGWIN + && !find_cygwin_root (&issystem)) + return 1; + return 0; +} + +static BOOL +dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) +{ + switch (id) + { + + case IDC_ROOT_DIR: + case IDC_ROOT_SYSTEM: + case IDC_ROOT_USER: + save_dialog (h); + check_if_enable_next (h); + break; + + case IDC_INSTALL_NATIVE: + case IDC_INSTALL_CYGWIN: + if (root_dir_default) + { + change_default_root (id); + eset (h, IDC_ROOT_DIR, root_dir); + } + save_dialog (h); + check_if_enable_next (h); + break; + + case IDC_ROOT_BROWSE: + browse (h); + break; + + case IDOK: + save_dialog (h); + + if (! directory_is_absolute ()) + { + note (IDS_ROOT_ABSOLUTE); + break; + } + + if (directory_is_rootdir ()) + if (IDNO == yesno (IDS_ROOT_SLASH)) + break; + + if (cygwin_without_cygwin ()) + if (IDNO == yesno (IDS_ROOT_NOCYGWIN)) + break; + + create_xemacs_root (root_dir, + root_scope == IDC_ROOT_SYSTEM ? 1 : 0, + install_type == IDC_INSTALL_NATIVE ? 1 : 0); + + switch (source) + { + case IDC_SOURCE_NETINST: + NEXT (IDD_NET); + break; + case IDC_SOURCE_CWD: + NEXT (IDD_S_FROM_CWD); + break; + default: + msg ("source is default? %d\n", source); + NEXT (0); + } + break; + + case IDC_BACK: + save_dialog (h); + NEXT (IDD_LOCAL_DIR); + break; + + case IDCANCEL: + NEXT (0); + break; + } + return FALSE; +} + +static BOOL CALLBACK +dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + load_dialog (h); + return FALSE; + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); + } + return FALSE; +} + +void +do_root (HINSTANCE h) +{ + int rv = 0; + read_mount_table (); + + rv = DialogBox (h, MAKEINTRESOURCE (IDD_ROOT), 0, dialog_proc); + if (rv == -1) + fatal (IDS_DIALOG_FAILED); + + log (0, "root: %s %s %s", root_dir, + (install_type == IDC_INSTALL_NATIVE) ? "native" : "cygwin", + (root_scope == IDC_ROOT_USER) ? "user" : "system"); +} + diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/setup.mak --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/setup.mak Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,247 @@ +# Makefile for Microsoft NMAKE +# Copyright (C) 1995 Board of Trustees, University of Illinois. +# Copyright (C) 1995, 1996, 2000 Ben Wing. +# Copyright (C) 1995 Sun Microsystems, Inc. +# Copyright (C) 1998 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. +# +# Synched up with: Not in FSF. +# + +TARGETOS=BOTH +APPVER=4.0 +!include "c:\Program Files\Microsoft Platform SDK\Include\win32.mak" + +default: all + +# APA: Since there seems to be no way to determine the directory where +# xemacs.mak is located (from within nmake) we just insist on the user +# to invoke nmake in the directory where xemacs.mak is. +!if !exist("$(MAKEDIR)\setup.mak") +!error Please run nmake from the directory of this makefile (xemacs\netinstall). +!endif + +XEMACS=$(MAKEDIR)\.. + +# Define a variable for the 'del' command to use +DEL=-del + +# Configuration from nt subdirectory if needed + +!include "$(XEMACS)\nt\config.inc" + +OUTDIR = obj + +# +# Compiler command echo control. Define VERBOSECC=1 to get verbose compilation. +# +!if !defined(VERBOSECC) +VERBOSECC=0 +!endif +!if $(VERBOSECC) +cc=$(cc) +!else +cc=@$(cc) +!endif + +!if $(DEBUG_XEMACS) +cdebug=-Od -Gr -Zi -Zp8 +!else +cdebug=-Oxsb2 -Oy- -G5rFs -Zi -Zp8 +!endif + +defines = -DWIN32_NATIVE -I$(ZLIBDIR) $(ZLIB_FLAGS) + +# +# Object files +# +OBJS = \ + $(OUTDIR)\choose.obj \ + $(OUTDIR)\concat.obj \ + $(OUTDIR)\desktop.obj \ + $(OUTDIR)\dialog.obj \ + $(OUTDIR)\diskfull.obj \ + $(OUTDIR)\download.obj \ + $(OUTDIR)\find.obj \ + $(OUTDIR)\fromcwd.obj \ + $(OUTDIR)\geturl.obj \ + $(OUTDIR)\hash.obj \ + $(OUTDIR)\ini.obj \ + $(OUTDIR)\inilex.obj \ + $(OUTDIR)\iniparse.obj \ + $(OUTDIR)\install.obj \ + $(OUTDIR)\localdir.obj \ + $(OUTDIR)\log.obj \ + $(OUTDIR)\main.obj \ + $(OUTDIR)\mkdir.obj \ + $(OUTDIR)\mklink2.obj \ + $(OUTDIR)\regedit.obj \ + $(OUTDIR)\msg.obj \ + $(OUTDIR)\net.obj \ + $(OUTDIR)\netio.obj \ + $(OUTDIR)\nio-ie5.obj \ + $(OUTDIR)\nio-file.obj \ + $(OUTDIR)\nio-ftp.obj \ + $(OUTDIR)\nio-http.obj \ + $(OUTDIR)\other.obj \ + $(OUTDIR)\postinstall.obj \ +# $(OUTDIR)\res.obj \ + $(OUTDIR)\root.obj \ + $(OUTDIR)\simpsock.obj \ + $(OUTDIR)\site.obj \ + $(OUTDIR)\source.obj \ + $(OUTDIR)\splash.obj \ + $(OUTDIR)\state.obj \ + $(OUTDIR)\tar.obj \ + $(OUTDIR)\version.obj + +# +# Libraries +# +LIBS = libcmt.lib $(olelibsmt) \ + kernel32.lib shell32.lib \ + wsock32.lib netapi32.lib \ + wininet.lib $(zlib) + +# Rules + +.SUFFIXES: +.SUFFIXES: .c .cc .obj .texi .info + +# nmake rule +.cc{$(OUTDIR)}.obj: + $(cc) /TP $(cflags) $(cdebug) $(cvarsmt) $(defines) -Fo$@ $< +.c{$(OUTDIR)}.obj: + $(cc) $(cflags) $(cdebug) $(cvarsmt) $(defines) -Fo$@ $< + +# +# Main target +# +all: setup.exe + +# +# Link target. setargv.obj is provided in the compiler library directory. +# +setup.exe: $(OUTDIR) $(OBJS) res.res + $(link) /OUT:$@ $(ldebug) $(guilflags) $(OBJS) res.res $(LIBS) + +iniparse.c iniparse.h : iniparse.y + bison -d -o iniparse.c $(srcdir)/iniparse.y + +$(OUTDIR)\inilex.obj: iniparse.h + +inilex.c : inilex.l iniparse.h + flex -t $(srcdir)/inilex.l | sed "/^extern int isatty YY/d" > inilex.c + +version.c : $(srcdir)/ChangeLog version.pl + perl version.pl < ChangeLog > version.c + +res.res: res.rc + $(rc) $(rcvars) $(rcflags) /fo$@ $** + +$(OUTDIR): + -@mkdir $(OUTDIR) + +install:: all + +clean:: + $(DEL) $(OUTDIR)\*.obj *.pdb *.aps res.res lex.yy.c + +distclean:: clean + $(DEL) *~ setup.exe + +# DO NOT DELETE + +$(OUTDIR)/autoload.obj: autoload.c win32.h +$(OUTDIR)/inilex.obj: inilex.c win32.h ini.h iniparse.h \ + +$(OUTDIR)/iniparse.obj: iniparse.c ini.h iniparse.h port.h +$(OUTDIR)/inilex.obj: inilex.c win32.h ini.h iniparse.h +$(OUTDIR)/mklink2.obj: mklink2.c win32.h +$(OUTDIR)/choose.obj: choose.cc win32.h dialog.h resource.h \ + state.h ini.h concat.h msg.h log.h find.h reginfo.h +$(OUTDIR)/concat.obj: concat.cc win32.h +$(OUTDIR)/desktop.obj: desktop.cc win32.h \ + resource.h ini.h msg.h state.h \ + concat.h mkdir.h dialog.h version.h reginfo.h regedit.h port.h +$(OUTDIR)/dialog.obj: dialog.cc win32.h dialog.h msg.h log.h \ + win32.h +$(OUTDIR)/diskfull.obj: diskfull.cc diskfull.h +$(OUTDIR)/download.obj: download.cc win32.h resource.h msg.h \ + ini.h dialog.h concat.h geturl.h state.h mkdir.h log.h +$(OUTDIR)/find.obj: find.cc win32.h port.h +$(OUTDIR)/fromcwd.obj: fromcwd.cc win32.h \ + ini.h resource.h concat.h \ + state.h dialog.h msg.h find.h version.h port.h +$(OUTDIR)/geturl.obj: geturl.cc win32.h dialog.h geturl.h \ + resource.h netio.h msg.h log.h +$(OUTDIR)/hash.obj: hash.cc win32.h hash.h +$(OUTDIR)/ini.obj: ini.cc win32.h ini.h resource.h concat.h \ + state.h geturl.h dialog.h msg.h mkdir.h log.h reginfo.h version.h +$(OUTDIR)/install.obj: install.cc win32.h \ + $(ZLIBDIR)/zlib.h $(ZLIBDIR)/zconf.h \ + resource.h ini.h dialog.h concat.h geturl.h mkdir.h state.h tar.h \ + diskfull.h msg.h regedit.h reginfo.h log.h hash.h port.h +$(OUTDIR)/localdir.obj: localdir.cc win32.h dialog.h resource.h \ + state.h msg.h concat.h log.h +$(OUTDIR)/log.obj: log.cc win32.h resource.h msg.h log.h dialog.h \ + state.h concat.h mkdir.h +$(OUTDIR)/main.obj: main.cc win32.h resource.h dialog.h state.h \ + msg.h netio.h find.h log.h port.h +$(OUTDIR)/mkdir.obj: mkdir.cc win32.h mkdir.h +$(OUTDIR)/msg.obj: msg.cc win32.h dialog.h log.h +$(OUTDIR)/net.obj: net.cc win32.h dialog.h resource.h state.h \ + msg.h log.h +$(OUTDIR)/netio.obj: netio.cc win32.h resource.h state.h msg.h \ + netio.h nio-file.h nio-ie5.h nio-http.h nio-ftp.h dialog.h log.h port.h \ + win32.h +$(OUTDIR)/nio-file.obj: nio-file.cc netio.h nio-file.h resource.h \ + msg.h +$(OUTDIR)/nio-ftp.obj: nio-ftp.cc win32.h resource.h state.h \ + simpsock.h log.h netio.h nio-ftp.h +$(OUTDIR)/nio-http.obj: nio-http.cc win32.h resource.h state.h \ + simpsock.h msg.h netio.h nio-http.h +$(OUTDIR)/nio-ie5.obj: nio-ie5.cc win32.h resource.h state.h \ + dialog.h msg.h netio.h nio-ie5.h +$(OUTDIR)/other.obj: other.cc win32.h dialog.h resource.h state.h \ + msg.h log.h +$(OUTDIR)/postinstall.obj: postinstall.cc win32.h \ + state.h dialog.h find.h \ + concat.h regedit.h reginfo.h resource.h port.h +$(OUTDIR)/regedit.obj: regedit.cc win32.h reginfo.h regedit.h \ + msg.h resource.h dialog.h +$(OUTDIR)/root.obj: root.cc win32.h dialog.h resource.h state.h \ + msg.h regedit.h reginfo.h concat.h log.h +$(OUTDIR)/simpsock.obj: simpsock.cc win32.h simpsock.h msg.h \ + win32.h +$(OUTDIR)/site.obj: site.cc dialog.h resource.h state.h geturl.h \ + msg.h concat.h regedit.h reginfo.h log.h port.h +$(OUTDIR)/source.obj: source.cc win32.h dialog.h resource.h \ + state.h msg.h log.h +$(OUTDIR)/splash.obj: splash.cc win32.h dialog.h resource.h msg.h \ + version.h +$(OUTDIR)/state.obj: state.cc state.h +$(OUTDIR)/tar.obj: tar.cc win32.h \ + $(ZLIBDIR)/zlib.h $(ZLIBDIR)/zconf.h \ + tar.h mkdir.h log.h port.h + +# +# Local Variables: +# mode: makefile +# End: diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/simpsock.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/simpsock.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Simplified socket access functions */ + +#include "win32.h" +#include +#include +#include +#include + +#include "simpsock.h" +#include "msg.h" + +#define SSBUFSZ 1024 + +SimpleSocket::SimpleSocket (char *hostname, int port) +{ + static int initted = 0; + if (!initted) + { + initted = 1; + WSADATA d; + WSAStartup (MAKEWORD (1,1), &d); + } + + s = INVALID_SOCKET; + buf = (char *) malloc (SSBUFSZ + 3); + putp = getp = 0; + + int i1, i2, i3, i4; + unsigned char ip[4]; + + if (sscanf (hostname, "%d.%d.%d.%d", &i1, &i2, &i3, &i4) == 4) + { + ip[0] = i1; + ip[1] = i2; + ip[2] = i3; + ip[3] = i4; + } + else + { + struct hostent *he; + he = gethostbyname (hostname); + if (!he) + { + msg ("Can't resolve `%s'\n", hostname); + return; + } + memcpy (ip, he->h_addr_list[0], 4); + } + + s = socket (AF_INET, SOCK_STREAM, 0); + if (s == INVALID_SOCKET) + { + msg ("Can't create socket, %d", WSAGetLastError ()); + return; + } + + struct sockaddr_in name; + + memset (&name, 0, sizeof (name)); + name.sin_family = AF_INET; + name.sin_port = htons (port); + memcpy (&name.sin_addr, ip, 4); + + if (connect (s, (sockaddr *)&name, sizeof(name))) + { + msg ("Can't connect to %s:%d", hostname, port); + closesocket (s); + s = INVALID_SOCKET; + return; + } + + return; +} + +SimpleSocket::~SimpleSocket () +{ + if (s != INVALID_SOCKET) + closesocket (s); + s = INVALID_SOCKET; + if (buf) + free (buf); + buf = 0; +} + +int +SimpleSocket::ok () +{ + if (s == INVALID_SOCKET) + return 0; + return 1; +} + +int +SimpleSocket::printf (char *fmt, ...) +{ + char localbuf[SSBUFSZ]; + va_list args; + va_start (args, fmt); + vsprintf (localbuf, fmt, args); + return send (s, localbuf, strlen (localbuf), 0); +} + +int +SimpleSocket::write (char *localbuf, int len) +{ + return send (s, localbuf, len, 0); +} + +int +SimpleSocket::fill () +{ + if (putp == getp) + putp = getp = 0; + + int n = SSBUFSZ - putp; + if (n == 0) + return 0; + int r = recv (s, buf + putp, n, 0); + if (r > 0) + { + putp += r; + return r; + } + return 0; +} + +char * +SimpleSocket::gets () +{ + if (getp > 0 && putp > getp) + { + memmove (buf, buf+getp, putp-getp); + putp -= getp; + getp = 0; + } + if (putp == getp) + fill(); + + // getp is zero, always, here, and putp is the count + char *nl; + while ((nl = (char *)memchr (buf, '\n', putp)) == NULL && putp < SSBUFSZ) + if (fill () <= 0) + break; + + if (nl) + { + getp = nl - buf + 1; + while ((*nl == '\n' || *nl == '\r') && nl >= buf) + *nl-- = 0; + } + else + { + getp = putp; + nl = buf + putp; + nl[1] = 0; + } + + return buf; +} + +#define MIN(a,b) ((a) < (b) ? (a) : (b)) + +int +SimpleSocket::read (char *ubuf, int ulen) +{ + int n, rv=0; + if (putp > getp) + { + n = MIN (ulen, putp-getp); + memmove (ubuf, buf+getp, n); + getp += n; + ubuf += n; + ulen -= n; + rv += n; + } + while (ulen > 0) + { + n = recv (s, ubuf, ulen, 0); + if (n <= 0) + return rv; + ubuf += n; + ulen -= n; + rv += n; + } + return rv; +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/simpsock.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/simpsock.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Simplified socket access functions */ + +class SimpleSocket { + + SOCKET s; + char *buf; + int putp, getp; + int fill (); + + public: + SimpleSocket (char *hostname, int port); + ~SimpleSocket (); + + int ok (); + + int printf (char *fmt, ...); + int write (char *buf, int len); + + char *gets (); + int read (char *buf, int len); +}; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/site.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/site.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to get the list of mirror sites and ask + the user which mirror site they want to download from. */ + +#include "win32.h" +#include +#include +#include + +#include "dialog.h" +#include "resource.h" +#include "state.h" +#include "geturl.h" +#include "msg.h" +#include "concat.h" +#include "regedit.h" +#include "reginfo.h" +#include "log.h" + +#include "port.h" + +#define NO_IDX (-1) +#define OTHER_IDX (-2) + +typedef struct { + char *url; + char *displayed_url; + char *sort_key; +} site_list_type; + +static site_list_type *site_list = 0; +static int list_idx = NO_IDX; +static int mirror_idx = NO_IDX; + +static void +check_if_enable_next (HWND h) +{ + EnableWindow (GetDlgItem (h, IDOK), (mirror_idx != NO_IDX) ? 1 : 0); +} + +static void +load_dialog (HWND h) +{ + HWND listbox = GetDlgItem (h, IDC_URL_LIST); + SendMessage (listbox, LB_SETCURSEL, list_idx, 0); + check_if_enable_next (h); +} + +static void +save_dialog (HWND h) +{ + HWND listbox = GetDlgItem (h, IDC_URL_LIST); + list_idx = SendMessage (listbox, LB_GETCURSEL, 0, 0); + if (list_idx == LB_ERR) + { + mirror_site = 0; + mirror_idx = NO_IDX; + list_idx = NO_IDX; + } + else + { + mirror_idx = SendMessage (listbox, LB_GETITEMDATA, list_idx, 0); + if (mirror_idx == OTHER_IDX) + mirror_site = 0; + else + mirror_site = site_list[mirror_idx].url; + } +} + +static void +get_root_dir () +{ + int issystem, isnative; + if (root_dir) + return; + root_dir = find_root_location (&issystem, &isnative); +} + +void +save_site_url () +{ + if (! MIRROR_SITE) + return; + + get_root_dir (); + if (! root_dir) + return; + + FILE *f = fopen (concat (root_dir, XEMACS_SETUP_DIR, "last-mirror", 0), "wb"); + if (!f) + return; + fprintf (f, "%s\n", MIRROR_SITE); + fclose (f); +} + +static BOOL +dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) +{ + switch (id) + { + + case IDC_URL_LIST: + save_dialog (h); + check_if_enable_next (h); + break; + + case IDOK: + save_dialog (h); + if (mirror_idx == OTHER_IDX) + NEXT (IDD_OTHER_URL); + else + { + other_url = 0; + save_site_url (); + NEXT (IDD_S_LOAD_INI); + } + break; + + case IDC_BACK: + save_dialog (h); + NEXT (IDD_NET); + break; + + case IDCANCEL: + NEXT (0); + break; + } + return FALSE; +} + +static BOOL CALLBACK +dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + int i, j; + HWND listbox; + switch (message) + { + case WM_INITDIALOG: + listbox = GetDlgItem (h, IDC_URL_LIST); + for (i=0; site_list[i].url; i++) + { + j = SendMessage (listbox, LB_ADDSTRING, 0, (LPARAM)site_list[i].displayed_url); + SendMessage (listbox, LB_SETITEMDATA, j, i); + } + j = SendMessage (listbox, LB_ADDSTRING, 0, (LPARAM)"Other URL"); + SendMessage (listbox, LB_SETITEMDATA, j, OTHER_IDX); + load_dialog (h); + return FALSE; + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); + } + return FALSE; +} + +static int CDECL +site_sort (const void *va, const void *vb) +{ + site_list_type *a = (site_list_type *)va; + site_list_type *b = (site_list_type *)vb; + return strcmp (a->sort_key, b->sort_key); +} + +static int +get_site_list (HINSTANCE h) +{ + char mirror_url[1000]; + if (LoadString (h, IDS_MIRROR_LST, mirror_url, sizeof (mirror_url)) <= 0) + return 1; + char *mirrors = get_url_to_string (mirror_url); + dismiss_url_status_dialog (); + if (!mirrors) + return 1; + + char *bol, *eol, *nl; + + + /* null plus account for possibly missing NL plus account for "Other + URL" from previous run. */ + int nmirrors = 3; + + for (bol=mirrors; *bol; bol++) + if (*bol == '\n') + nmirrors ++; + + site_list = (site_list_type *) malloc (nmirrors * sizeof (site_list_type)); + nmirrors = 0; + + nl = mirrors; + while (*nl) + { + bol = nl; + for (eol = bol; *eol && *eol != '\n'; eol++) ; + if (*eol) + nl = eol+1; + else + nl = eol; + while (eol > bol && eol[-1] == '\r') + eol--; + *eol = 0; + if (bol[0] != '#' && bol[0] > ' ') + { + char *semi = strchr (bol, ';'); + if (semi) + *semi = 0; + site_list[nmirrors].url = _strdup (bol); + site_list[nmirrors].displayed_url = _strdup (bol); + char *dot = strchr (site_list[nmirrors].displayed_url, '.'); + if (dot) + { + dot = strchr (dot, '/'); + if (dot) + *dot = 0; + } + site_list[nmirrors].sort_key = (char *) malloc (2*strlen (bol) + 3); + + dot = site_list[nmirrors].displayed_url; + dot += strlen (dot); + char *dp = site_list[nmirrors].sort_key; + while (dot != site_list[nmirrors].displayed_url) + { + if (*dot == '.' || *dot == '/') + { + char *sp; + if (dot[3] == 0) + *dp++ = '~'; /* sort .com/.edu/.org together */ + for (sp=dot+1; *sp && *sp != '.' && *sp != '/';) + *dp++ = *sp++; + *dp++ = ' '; + } + dot--; + } + *dp++ = ' '; + strcpy (dp, site_list[nmirrors].displayed_url); + + nmirrors++; + } + } + site_list[nmirrors].url = 0; + + qsort (site_list, nmirrors, sizeof (site_list_type), site_sort); + + return 0; +} + +/* List of machines that should not be used by default when saved + in "last-mirror". */ +#define NOSAVE1 "ftp://ftp.xemacs.org/" +#define NOSAVE1_LEN (sizeof ("ftp://ftp.xemacs.org/") - 1) + +static void +get_initial_list_idx () +{ + get_root_dir (); + if (! root_dir) + return; + + FILE *f = fopen (concat (root_dir, XEMACS_SETUP_DIR, "last-mirror", 0), "rt"); + if (!f) + return; + + char site[1000]; + site[0]='\0'; + char * fg_ret = fgets (site, 1000, f); + fclose (f); + if (! fg_ret) + return; + + char *eos = site + strlen (site) - 1; + while (eos >= site && (*eos == '\n' || *eos == '\r')) + *eos-- = '\0'; + + if (eos < site) + return; + + int i; + for (i = 0; site_list[i].url; i++) + if (strcmp (site_list[i].url, site) == 0) + break; + + if (! site_list[i].url) + { + /* Don't default to certain machines ever since they suffer + from bandwidth limitations. */ + if (strnicmp (site, NOSAVE1, NOSAVE1_LEN) == 0) + return; + site_list[i].displayed_url = + site_list[i].url = _strdup (site); + site_list[i+1].url = 0; + } + + mirror_idx = list_idx = i; +} + +void +do_site (HINSTANCE h) +{ + int rv = 0; + + if (site_list == 0) + if (get_site_list (h)) + { + NEXT (IDD_NET); + return; + } + + get_initial_list_idx (); + + rv = DialogBox (h, MAKEINTRESOURCE (IDD_SITE), 0, dialog_proc); + if (rv == -1) + fatal (IDS_DIALOG_FAILED); + + if (mirror_idx != OTHER_IDX) + log (0, "site: %s", mirror_site); +} + diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/source.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/source.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to manage the dialog box that lets the + user choose the source of the install - from the net, from the + current directory, or to just download files. */ + +#include "win32.h" +#include +#include "dialog.h" +#include "resource.h" +#include "state.h" +#include "msg.h" +#include "log.h" + +static int rb[] = { IDC_SOURCE_DOWNLOAD, IDC_SOURCE_NETINST, IDC_SOURCE_CWD, 0 }; + +static void +check_if_enable_next (HWND h) +{ + EnableWindow (GetDlgItem (h, IDOK), source ? 1 : 0); +} + +static void +load_dialog (HWND h) +{ + rbset (h, rb, source); + check_if_enable_next (h); +} + +static void +save_dialog (HWND h) +{ + source = rbget (h, rb); +} + +static BOOL +dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) +{ + switch (id) + { + + case IDC_SOURCE_DOWNLOAD: + case IDC_SOURCE_NETINST: + case IDC_SOURCE_CWD: + save_dialog (h); + check_if_enable_next (h); + break; + + case IDOK: + save_dialog (h); + NEXT (IDD_LOCAL_DIR); + break; + + case IDC_BACK: + save_dialog (h); + NEXT (0); + break; + + case IDCANCEL: + NEXT (0); + break; + } + return FALSE; +} + +static BOOL CALLBACK +dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + load_dialog (h); + return FALSE; + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); + } + return FALSE; +} + +void +do_source (HINSTANCE h) +{ + int rv = 0; + rv = DialogBox (h, MAKEINTRESOURCE (IDD_SOURCE), 0, dialog_proc); + if (rv == -1) + fatal (IDS_DIALOG_FAILED); + + log (0, "source: %s", + (source == IDC_SOURCE_DOWNLOAD) ? "download" : + (source == IDC_SOURCE_NETINST) ? "network install" : "from cwd"); +} + diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/splash.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/splash.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to display the program name, version, + copyright notice, and project URL. */ + +#include "win32.h" +#include +#include "dialog.h" +#include "resource.h" +#include "msg.h" +#include "version.h" + +static void +load_dialog (HWND h) +{ + char buffer[100]; + HWND v = GetDlgItem (h, IDC_VERSION); + sprintf (buffer, "Setup.exe version %s", + version[0] ? version : "[unknown]"); + SetWindowText (v, buffer); +} + +static BOOL +dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) +{ + switch (id) + { + + case IDOK: + NEXT (IDD_SOURCE); + break; + + case IDCANCEL: + NEXT (0); + break; + } + return FALSE; +} + +static BOOL CALLBACK +dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + load_dialog (h); + return FALSE; + case WM_COMMAND: + return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); + } + return FALSE; +} + +void +do_splash (HINSTANCE h) +{ + int rv = 0; + HANDLE gnu = LoadImage (h, MAKEINTRESOURCE (IDB_GNU), IMAGE_BITMAP, 0, 0, 0); + rv = DialogBox (h, MAKEINTRESOURCE (IDD_SPLASH), 0, dialog_proc); + if (rv == -1) + fatal (IDS_DIALOG_FAILED); +} + diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/state.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/state.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* All we do here is instantiate the extern'd variables from state.h */ + +#define extern +#include "state.h" diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/state.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/state.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to contain all the global variables + that define the "state" of the install, that is, all the + information that the user has provided so far. These are set by + the various dialogs and used by the various actions. */ + +extern int source; + +extern char * local_dir; + +extern char * root_dir; +extern int root_dir_default; +extern int install_type; +extern int root_scope; +extern int root_menu; +extern int root_desktop; + +extern int net_method; +extern char * net_proxy_host; +extern int net_proxy_port; + +extern char * net_user; +extern char * net_passwd; +extern char * net_proxy_user; +extern char * net_proxy_passwd; + +extern char * mirror_site; +extern char * other_url; + +extern int trust_level; + +#define MIRROR_SITE (mirror_site ? mirror_site : other_url) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/tar.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/tar.cc Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,511 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* Built-in tar functionality. See tar.h for usage. */ + +#include +#include +#include +#include + +#include "win32.h" +#include +#include "tar.h" +#include "mkdir.h" +#include "log.h" + +#include "port.h" + +#if defined(CYGWIN) || defined(MINGW) +#define FACTOR (0x19db1ded53ea710LL) +#define NSPERSEC 10000000LL +#else +__int64 FACTOR=0x19db1ded53ea710L; +__int64 NSPERSEC=10000000L; +#endif +#define SYMLINK_COOKIE "!" + +typedef struct { + char name[100]; /* 0 */ + char mode[8]; /* 100 */ + char uid[8]; /* 108 */ + char gid[8]; /* 116 */ + char size[12]; /* 124 */ + char mtime[12]; /* 136 */ + char chksum[8]; /* 148 */ + char typeflag; /* 156 */ + char linkname[100]; /* 157 */ + char magic[6]; /* 257 */ + char version[2]; /* 263 */ + char uname[32]; /* 265 */ + char gname[32]; /* 297 */ + char devmajor[8]; /* 329 */ + char devminor[8]; /* 337 */ + char prefix[155]; /* 345 */ + char junk[12]; /* 500 */ +} tar_header_type; + +typedef struct tar_map_result_type_s { + struct tar_map_result_type_s *next; + char *stored_name; + char *mapped_name; +} tar_map_result_type; + +static tar_map_result_type *tar_map_result = 0; + +static int err; + +static char file_name[_MAX_PATH+512]; +static char have_longname = 0; +static int file_length; + +static tar_header_type tar_header; +static char buf[512]; + +static int _tar_file_size = 0; +int _tar_verbose = 0; +FILE * _tar_vfile = 0; +#define vp if (_tar_verbose) fprintf +#define vp2 if (_tar_verbose>1) fprintf + +static gzFile g = 0; + +static char * +xstrdup (char *c) +{ + char *r = (char *) malloc (strlen (c) + 1); + if (!r) + exit_setup (1); + strcpy (r, c); + return r; +} + +int +tar_open (char *pathname) +{ + struct stat s; + if (_tar_vfile == 0) + _tar_vfile = stderr; + + vp2 (_tar_vfile, "tar: open `%s'\n", pathname); + if (stat (pathname, &s) < 0) + return 1; + _tar_file_size = s.st_size; + + g = gzopen (pathname, "rb"); + if (sizeof (tar_header) != 512) + { + /* drastic, but important */ + fprintf (stderr, "compilation error: tar header struct not 512" + " bytes (it's %d)\n", sizeof (tar_header)); + exit_setup (1); + } + err = 0; + return g ? 0 : 1; +} + +int +tar_ftell () +{ + return gztell (g); +} + +static void +skip_file () +{ + while (file_length > 0) + { + gzread (g, buf, 512); + file_length -= 512; + } +} + +char * +tar_next_file () +{ + int r, n; + char *c; + r = gzread (g, &tar_header, 512); + + /* See if we're at end of file */ + if (r != 512) + return 0; + + /* See if the header is all zeros (i.e. last block) */ + n = 0; + for (r = 512/sizeof (int); r; r--) + n |= ((int *)&tar_header)[r-1]; + if (n == 0) + return 0; + + if (!have_longname && tar_header.typeflag != 'L') + { + memcpy (file_name, tar_header.name, 100); + file_name[100] = 0; + } + + sscanf (tar_header.size, "%o", &file_length); + + vp2 (_tar_vfile, "%c %9d %s\n", tar_header.typeflag, file_length, file_name); + + switch (tar_header.typeflag) + { + case 'L': /* GNU tar long name extension */ + if (file_length > _MAX_PATH) + { + skip_file (); + fprintf (stderr, "error: long file name exceeds %d characters\n", + _MAX_PATH); + err ++; + gzread (g, &tar_header, 512); + sscanf (tar_header.size, "%o", &file_length); + skip_file (); + return tar_next_file (); + } + c = file_name; + while (file_length > 0) + { + int need = file_length > 512 ? 512 : file_length; + if (gzread (g, buf, 512) < 512) + return 0; + memcpy (c, buf, need); + c += need; + file_length -= need; + } + *c = 0; + have_longname = 1; + return tar_next_file (); + + case '3': /* char */ + case '4': /* block */ + case '6': /* fifo */ + fprintf (stderr, "warning: not extracting special file %s\n", + file_name); + err ++; + return tar_next_file (); + + case '0': /* regular file */ + case 0: /* regular file also */ + case '2': /* symbolic link */ + case '5': /* directory */ + case '7': /* contiguous file */ + return file_name; + + case '1': /* hard link, we just copy */ + return file_name; + + default: + fprintf (stderr, "error: unknown (or unsupported) file type `%c'\n", + tar_header.typeflag); + err ++; + skip_file (); + return tar_next_file (); + } +} + +static void +fix_time_stamp (char *path) +{ + int mtime; +#if defined(CYGWIN) || defined(MINGW) + long long ftimev; +#else + __int64 ftimev; +#endif + FILETIME ftime; + HANDLE h; + + sscanf (tar_header.mtime, "%o", &mtime); + ftimev = mtime * NSPERSEC + FACTOR; + ftime.dwHighDateTime = ftimev >> 32; + ftime.dwLowDateTime = ftimev; + h = CreateFileA (path, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, + 0, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, 0); + if (h) + { + SetFileTime (h, 0, 0, &ftime); + CloseHandle (h); + } +} + +static FILE * +common_fopen (char *path) +{ + FILE *out; + out = fopen (path, "wb"); + if (!out) + { + /* maybe we need to create a directory */ + if (mkdir_p (0, path)) + { + skip_file (); + return 0; + } + out = fopen (path, "wb"); + } + if (!out) + { + fprintf (stderr, "unable to write to file %s\n", path); + perror ("The error was"); + skip_file (); + return 0; + } + return out; +} + +static void +prepare_for_file (char *path) +{ + DWORD w; + mkdir_p (0, path); + + w = GetFileAttributes (path); + if (w != 0xffffffff && w & FILE_ATTRIBUTE_DIRECTORY) + { + char *tmp = (char *) malloc (strlen (path) + 10); + int i = 0; + do { + i++; + sprintf (tmp, "%s.old-%d", path, i); + } while (GetFileAttributes (tmp) != 0xffffffff); + fprintf (stderr, "warning: moving directory \"%s\" out of the way.\n", path); + MoveFile (path, tmp); + free (tmp); + } + + DeleteFileA (path); +} + +int +tar_read_file (char *path) +{ + FILE *out, *copy; + HANDLE h; + DWORD w; + int got; + tar_map_result_type *tmr; + + switch (tar_header.typeflag) + { + case '0': /* regular files */ + case 0: + case '7': + vp (_tar_vfile, "F %s\n", path); + prepare_for_file (path); + out = common_fopen (path); + if (!out) + return 1; + + while (file_length > 0) + { + int put; + int want = file_length > 512 ? 512 : file_length; + got = gzread (g, buf, 512); + if (got < 512) + { + fprintf (stderr, "tar: unexpected end of file reading %s\n", path); + fclose (out); + remove (path); + return 1; + } + put = fwrite (buf, 1, want, out); + if (put < want) + { + fprintf (stderr, "tar: out of disk space writing %s\n", path); + fclose (out); + remove (path); + skip_file (); + return 1; + } + file_length -= want; + } + fclose (out); + + fix_time_stamp (path); + + /* we need this to do hard links below */ + tmr = (tar_map_result_type *) malloc (sizeof (tar_map_result_type)); + tmr->next = tar_map_result; + tmr->stored_name = xstrdup (file_name); + tmr->mapped_name = xstrdup (path); + tar_map_result = tmr; + + return 0; + + case '1': /* hard links; we just copy */ + for (tmr = tar_map_result; tmr; tmr=tmr->next) + if (strcmp (tmr->stored_name, tar_header.linkname) == 0) + break; + if (!tmr) + { + fprintf (stderr, "tar: can't find %s to link %s to\n", + tar_header.linkname, path); + return 1; + } + vp (_tar_vfile, "H %s <- %s\n", path, tmr->mapped_name); + prepare_for_file (path); + copy = fopen (tmr->mapped_name, "rb"); + if (!copy) + { + fprintf (stderr, "tar: unable to read %s\n", tmr->mapped_name); + return 1; + } + out = common_fopen (path); + if (!out) + return 1; + + while ((got = fread (buf, 1, 512, copy)) > 0) + { + int put = fwrite (buf, 1, got, out); + if (put < got) + { + fprintf (stderr, "tar: out of disk space writing %s\n", path); + fclose (out); + fclose (copy); + remove (path); + return 1; + } + } + fclose (out); + fclose (copy); + + fix_time_stamp (path); + return 0; + + case '5': /* directories */ + vp (_tar_vfile, "D %s\n", path); + while (path[0] && path[strlen (path)-1] == '/') + path[strlen (path) - 1] = 0; + return mkdir_p (1, path); + + + case '2': /* symbolic links */ + vp (_tar_vfile, "L %s -> %s\n", path, tar_header.linkname); + prepare_for_file (path); + h = CreateFileA (path, GENERIC_WRITE, 0, 0, CREATE_NEW, + FILE_ATTRIBUTE_NORMAL, 0); + if (h == INVALID_HANDLE_VALUE) + { + fprintf (stderr, "error: unable to create symlink \"%s\" -> \"%s\"\n", + path, tar_header.linkname); + return 1; + } + strcpy (buf, SYMLINK_COOKIE); + strcat (buf, tar_header.linkname); + if (WriteFile (h, buf, strlen (buf) + 1, &w, NULL)) + { + CloseHandle (h); + SetFileAttributesA (path, FILE_ATTRIBUTE_SYSTEM); + return 0; + } + CloseHandle (h); + fprintf (stderr, "error: unable to write symlink \"%s\"\n", path); + DeleteFileA (path); + return 1; + } + + return 0; +} + +int +tar_close () +{ +#if 0 + while (tar_map_result) + { + tar_map_result_type *t = tar_map_result->next; + free (tar_map_result->stored_name); + free (tar_map_result->mapped_name); + free (tar_map_result); + tar_map_result = t; + } +#endif + tar_map_result = 0; + + if (gzclose (g)) + err ++; + return err; /* includes errors for skipped files, etc */ +} + +typedef struct { + char *from; + int from_len; + char *to; + int to_len; +} map_type; + +static map_type *map; +static int nmaps; + +int +tar_auto (char *pathname, char **maplist) +{ + char *c; + int errcount = 0; + int i, j; + map_type mtemp; + char newname[_MAX_PATH+512]; + static char twiddles[] = "|\b/\b-\b\\\b"; + int t = 0; + + for (nmaps=0; maplist[nmaps*2]; nmaps++) ; + map = (map_type *) malloc ((nmaps+1) * sizeof (map_type)); + for (nmaps=0; maplist[nmaps*2]; nmaps++) + { + map[nmaps].from = maplist[nmaps*2]; + map[nmaps].from_len = strlen (maplist[nmaps*2]); + map[nmaps].to = maplist[nmaps*2+1]; + map[nmaps].to_len = strlen (maplist[nmaps*2+1]); + } + /* bubble sort - expect the maps to be short */ + for (i=0; i= map[i].from_len + && strncmp (c, map[i].from, map[i].from_len) == 0) + { + strcpy (newname, map[i].to); + strcpy (newname+map[i].to_len, c + map[i].from_len); + c = newname; + break; + } + + t = (t+2) % 8; + fwrite (twiddles+t, 1, 2, stderr); + + if (tar_read_file (c)) + errcount ++; + } + if (tar_close ()) + errcount ++; + + fwrite (" \b", 1, 2, stderr); + + vp2 (_tar_vfile, "tar_auto returns %d\n", errcount); + return errcount; +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/tar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/tar.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +#ifndef __TAR_H_ +#define __TAR_H_ + +/* Only one tarfile may be open at a time. gzipped files handled + automatically */ + +/* returns zero on success, nonzero on failure */ +int tar_open (char *pathname); + +/* returns pointer to static buf containing name of next file */ +char * tar_next_file (); + +/* byte position in [compressed] file */ +int tar_ftell (); + +/* pass adjusted path, returns zero on success, nonzero on failure */ +int tar_read_file (char *path); + +/* closes the file */ +int tar_close (); + +/* pass path to tar file and from/to pairs for path prefix (NULLs at + end , returns zero if completely successful, nonzero (counts + errors) on failure */ +int tar_auto (char *pathname, char **map); + +int tar_mkdir_p (int isadir, char *path); + +/* +extern int _tar_verbose; +extern FILE * _tar_vfile; +*/ + +#endif diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/version.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/version.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* misc version-related things */ + +extern "C" char *version; +extern "C" char *setup_version; +extern "C" unsigned int setup_timestamp; + +extern char *canonicalize_version (char *); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/version.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/version.pl Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,6 @@ +while () { + if (/^\$Revision:\s*([0-9\.]*)/) { + print "char *version = \"$1\";\n"; + print "static char *id = \"\\n%%% setup-version $1\\n\";\n"; + } +} diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/win32.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/netinstall/win32.h Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2000, Red Hat, Inc. + * + * This program 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 of the License, or + * (at your option) any later version. + * + * A copy of the GNU General Public License can be found at + * http://www.gnu.org/ + * + * Written by DJ Delorie + * + */ + +/* The purpose of this file is to limit the number of Win32 headers we + actually have to parse. The Setup program only uses a few of them, + so there's no point in parsing them all (even lean-n-mean). Doing + this cuts compile time in half. */ + +#ifndef _MINI_WIN32_ +#define _MINI_WIN32_ + +#define _UNION_NAME(x) +#define _STRUCT_NAME(x) +#define NOCOMATTRIBUTE + +#include +#ifdef WIN32_NATIVE +/* MSVC is barking with the list above, something else is missing, so + I'm using and lean-n-mean. FP, 2000-23-12 */ +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#include + +/* Cope with native win32 & mingw differences. Written by F. Popineau + */ +#ifdef WIN32_NATIVE +# pragma warning( disable : 4007 4096 4018 4244 ) +# define strdup _strdup +# define stat _stat +# define strnicmp _strnicmp +#endif + +#ifndef CDECL +#define CDECL __cdecl +#endif + +#endif /* _MINI_WIN32_ */ diff -r 4fc5f13f3bd3 -r 3078fd1074e8 netinstall/xemacs.ico Binary file netinstall/xemacs.ico has changed diff -r 4fc5f13f3bd3 -r 3078fd1074e8 nt/ChangeLog --- a/nt/ChangeLog Mon Aug 13 11:37:23 2007 +0200 +++ b/nt/ChangeLog Mon Aug 13 11:38:25 2007 +0200 @@ -1,3 +1,7 @@ +2000-12-31 Martin Buchholz + + * XEmacs 21.2.39 is released. + 2000-12-05 Martin Buchholz * XEmacs 21.2.38 is released. diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/ChangeLog --- a/src/ChangeLog Mon Aug 13 11:37:23 2007 +0200 +++ b/src/ChangeLog Mon Aug 13 11:38:25 2007 +0200 @@ -1,3 +1,148 @@ +2000-12-31 Martin Buchholz + + * XEmacs 21.2.39 is released. + +2000-12-29 Andy Piper + + * menubar.c (menubar_visible_p_changed): signal the frame changed. + + * glyphs-x.c (x_redisplay_widget): Re-calculate widget offsets if + the frame has changed so that we pick up geometry changes such as + menubar visibility. + +2000-12-28 Andy Piper + + * lastfile.c (my_ebss): make a char array so we can pad the + bss. Fixes cygwin unexec. + + * unexcw.c: invert BROKEN_GDB to NO_DEBUG. + +2000-12-26 Andy Piper + + * event-Xt.c (emacs_Xt_force_event_pending): add some verbose + comments and try and be more precise about a non-/SIGIO world. + (emacs_Xt_event_pending_p): use XtAppPending under cygwin and non + SIGIO. + + * redisplay-output.c (redisplay_normalize_glyph_area): make sure + we don't normalize to zero width or height. + +2000-12-24 Andy Piper + + * Makefile.in.in (ldflags): add -mwindows when appropriate. + +2000-08-18 Golubev I. N. + + * s/sco5.h: SCO 5 has pty support. + +2000-07-20 Kazuyuki IENAGA + + * input-method-xlib.c: supports both XIM_XLIB and USE_XFONTSET. + input-method-xlib.c contains whole contents of input-method-xfs.c, + so we can use input-method-xlib.c's code for USE_XFONTSET + using #ifdefs. + * input-method-xfs.c: removed. + +2000-12-20 Stephen Turnbull + + * file-coding.h (enum coding_category_type): reorder enumerators to + make autodetection safer. Make CODING_CATEGORY_LAST an enumerator + (now one greater than largest real coding_category_type enumerator). + * file-coding.c (coding_category_symbol, coding_category_by_priority, + coding_category_system, fcd_descriptihon_1, decode_coding_category, + Fcoding_category_list, Fset_coding_priority_list, + Fcoding_priority_list, coding_system_from_mask, Fdetect_coding_region, + vars_of_file_coding): adjust for change in CODING_CATEGORY_LAST. + +2000-12-18 Yoshiki Hayashi + + * redisplay-output.c (redisplay_clear_top_of_window): Remove static. + * redisplay-output.c (redisplay_output_window): Clear top of window + when face is changed. + * redisplay-x.c (x_redraw_exposed_window): Call + redisplay_clear_top_of_window. + * redisplay.h: Publish redisplay_clear_top_of_window. + +2000-12-18 Yoshiki Hayashi + + * buffer.c (Fkill_buffer): Map over all devices. + * window.c (window_loop): Remove UNSHOW_BUFFER code. + (list_windows): New function. + (list_all_windows): Ditto. + (Freplace_buffer_in_windows): Use them. + +2000-02-02 Daiki Ueno + + * database.c (berkdb_subtype): Recognize new subtype `queue'. + (Fopen_database): Use `db_create' instead of `db_open'. + (syms_of_database): Initialize Qqueue. + +2000-12-13 Yoshiki Hayashi + + * buffer.c (common_init_complex_vars_of_buffer): Initialize + buffer_local_face_property. + * buffer.h (struct buffer): New member buffer_local_face_property. + * window.c (Fset_window_buffer): Mark window's face as changed + when buffer has buffer local face. + * window.h (MARK_WINDOW_FACES_CHANGED): New macro. + * objects.c (color_after_change): Set buffer_local_face_property + when locale of face specifier is buffer. + * objects.c (font_after_change): Ditto. + * objects.c (face_boolean_after_change): Ditto. + * glyphs.c (image_after_change): Ditto. + +2000-12-09 Dan Holmsand + + * nt.c (mswindows_fstat): Report file permissions, volume serial + number, etc. Code adapted from FSF Emacs 20.7. + +2000-12-09 Dan Holmsand + + * sysfile.h (lstat): Make lstat an alias for xemacs_stat instead + of stat when we don't have symbolic links, to make sure + mswindows_stat is called on mswindows. + +2000-12-12 Yoshiki Hayashi + + * alloca.c: Define malloc to xmalloc only when built with XEmacs. + +2000-12-12 Martin Buchholz + + * doprnt.c (emacs_doprnt_1): More printing fixes. + Make printing of numbers compatible with libc and FSF Emacs. + BUG was: (format "%6.3f" 1.2) ==>"1.200000" + Use the system printf to do most of the hard work of formatting, + instead of doprnt_1(). + Calculate memory to allocate for format string. + Remove arbitrary limit on precision, e.g. (format "%.1000f" 3.14) + (doprnt_1): Cleaner code and documentation. + +2000-12-01 Jerry James + + * Makefile.in.in: Use the loop variable to install headers. + +2000-12-04 Yoshiki Hayashi + + * window.c (Fsplit_window): Don't invalidate face cache. + +2000-12-04 Yoshiki Hayashi + + * minibuf.c (Fall_completions): Undo the previous change + which removed checking elements start with space. + +2000-12-06 Stephen Turnbull + + * mule-canna.c: Didier suppression. + +2000-12-06 Stephen Turnbull + + * mule-canna.c: rename static unsigned char buf[] to key_buffer + (warning suppression). Add English comment translations. + +2000-12-05 Martin Buchholz + + * unexelfsgi.c (unexec): Better test for mmap failure. + 2000-12-05 Martin Buchholz * XEmacs 21.2.38 is released. diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/Makefile.in.in --- a/src/Makefile.in.in Mon Aug 13 11:37:23 2007 +0200 +++ b/src/Makefile.in.in Mon Aug 13 11:38:25 2007 +0200 @@ -147,7 +147,11 @@ cppflags = $(CPPFLAGS) -Demacs -I. $(c_switch_all) cflags = $(CFLAGS) $(cppflags) +#if defined (WIN32_NATIVE) || defined (CYGWIN) +ldflags = $(LDFLAGS) -mwindows $(ld_switch_all) $(ld_dynamic_link_flags) +#else ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags) +#endif #ifdef SOLARIS2 %.o : %.c @@ -741,7 +745,7 @@ cd ${srcdir}; hdrdir2=`pwd`; cd $$hdir; \ test "$$hdrdir2" != "$$hdir" && hdir="$$hdir $$hdrdir2"; \ (for thisdir in $$hdir; do \ - cd $$hdir && \ + cd $$thisdir && \ (hdrtars=; \ for hdrfile in *.h; do \ hdrtars="$$hdrtars $$hdrfile"; \ diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/alloca.c --- a/src/alloca.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/alloca.c Mon Aug 13 11:38:25 2007 +0200 @@ -100,7 +100,7 @@ Callers below should use malloc. */ -#ifndef emacs +#ifdef emacs #define malloc xmalloc #endif #ifndef WIN32_NATIVE diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/buffer.c --- a/src/buffer.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/buffer.c Mon Aug 13 11:38:25 2007 +0200 @@ -1259,7 +1259,9 @@ /* #### This is a problem if this buffer is in a dedicated window. Need to undedicate any windows of this buffer first (and delete them?) */ - Freplace_buffer_in_windows (buf, Qnil, Qnil); + GCPRO1 (buf); + Freplace_buffer_in_windows (buf, Qnil, Qall); + UNGCPRO; font_lock_buffer_was_killed (b); @@ -2429,6 +2431,7 @@ defs->auto_save_modified = 0; defs->auto_save_failure_time = -1; defs->invisibility_spec = Qt; + defs->buffer_local_face_property = 0; defs->indirect_children = Qnil; syms->indirect_children = Qnil; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/buffer.h --- a/src/buffer.h Mon Aug 13 11:37:23 2007 +0200 +++ b/src/buffer.h Mon Aug 13 11:38:25 2007 +0200 @@ -137,6 +137,9 @@ int face_change; /* This is set when a change in how the text should be displayed (e.g., font, color) is made. */ + /* Whether buffer specific face is specified. */ + int buffer_local_face_property; + /* change data indicating what portion of the text has changed since the last time this was reset. Used by redisplay. Logically we should keep this with the text structure, but diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/database.c --- a/src/database.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/database.c Mon Aug 13 11:38:25 2007 +0200 @@ -59,6 +59,9 @@ #endif /* DB_VERSION_MAJOR */ Lisp_Object Qberkeley_db; Lisp_Object Qhash, Qbtree, Qrecno, Qunknown; +#if DB_VERSION_MAJOR > 2 +Lisp_Object Qqueue; +#endif #endif /* HAVE_BERKELEY_DB */ #ifdef HAVE_DBM @@ -369,6 +372,9 @@ case DB_BTREE: return Qbtree; case DB_HASH: return Qhash; case DB_RECNO: return Qrecno; +#if DB_VERSION_MAJOR > 2 + case DB_QUEUE: return Qqueue; +#endif default: return Qunknown; } } @@ -644,6 +650,10 @@ real_subtype = DB_BTREE; else if (EQ (subtype, Qrecno)) real_subtype = DB_RECNO; +#if DB_VERSION_MAJOR > 2 + else if (EQ (subtype, Qqueue)) + real_subtype = DB_QUEUE; +#endif else signal_simple_error ("Unsupported subtype", subtype); @@ -669,10 +679,25 @@ if (strchr (acc, 'r') && !strchr (acc, 'w')) accessmask |= DB_RDONLY; } +#if DB_VERSION_MAJOR == 2 status = db_open (filename, real_subtype, accessmask, modemask, NULL , NULL, &dbase); if (status) return Qnil; +#else + status = db_create (&dbase, NULL, 0); + if (status) + return Qnil; + status = dbase->open (dbase, filename, NULL, + real_subtype, accessmask, modemask); + if (status) + { + dbase->close (dbase, 0); + return Qnil; + } +#endif /* DB_VERSION_MAJOR > 2 */ + /* Normalize into system specific file modes. Only for printing */ + accessmask = accessmask & DB_RDONLY ? O_RDONLY : O_RDWR; #endif /* DB_VERSION_MAJOR */ db = allocate_database (); @@ -771,6 +796,9 @@ defsymbol (&Qhash, "hash"); defsymbol (&Qbtree, "btree"); defsymbol (&Qrecno, "recno"); +#if DB_VERSION_MAJOR > 2 + defsymbol (&Qqueue, "queue"); +#endif defsymbol (&Qunknown, "unknown"); #endif diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/depend --- a/src/depend Mon Aug 13 11:37:23 2007 +0200 +++ b/src/depend Mon Aug 13 11:38:25 2007 +0200 @@ -134,11 +134,11 @@ indent.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console-msw.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h keymap.h lstream.h mule-charset.h objects.h opaque.h postgresql.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h syscommctrl.h systime.h syswindows.h toolbar.h tooltalk.h window.h winslots.h xintrinsic.h input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h -input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h casetab.h chartab.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h insdel.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h intl.o: $(LISP_H) bytecode.h conslots.h console.h device.h keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h chartab.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h +lastfile.o: config.h libsst.o: $(LISP_H) libsst.h line-number.o: $(LISP_H) buffer.h bufslots.h casetab.h chartab.h line-number.h mule-charset.h linuxplay.o: $(LISP_H) miscplay.h nativesound.h sysfile.h syssignal.h @@ -201,7 +201,7 @@ unexalpha.o: config.h unexapollo.o: config.h unexconvex.o: config.h getpagesize.h -unexcw.o: config.h sysfile.h +unexcw.o: $(LISP_H) sysfile.h unexec.o: $(LISP_H) getpagesize.h unexelf.o: config.h unexelfsgi.o: config.h diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/doprnt.c --- a/src/doprnt.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/doprnt.c Mon Aug 13 11:38:25 2007 +0200 @@ -87,11 +87,13 @@ Dynarr_declare (union printf_arg); } printf_arg_dynarr; -/* Append STRING (of length LEN) to STREAM. MINLEN is the minimum field - width. If MINUS_FLAG is set, left-justify the string in its field; - otherwise, right-justify. If ZERO_FLAG is set, pad with 0's; otherwise - pad with spaces. If MAXLEN is non-negative, the string is first - truncated to that many character. +/* Append STRING (of length LEN bytes) to STREAM. + MINLEN is the minimum field width. + If MINUS_FLAG is set, left-justify the string in its field; + otherwise, right-justify. + If ZERO_FLAG is set, pad with 0's; otherwise pad with spaces. + If MAXLEN is non-negative, the string is first truncated on the + right to that many characters. Note that MINLEN and MAXLEN are Charcounts but LEN is a Bytecount. */ @@ -99,42 +101,23 @@ doprnt_1 (Lisp_Object stream, const Bufbyte *string, Bytecount len, Charcount minlen, Charcount maxlen, int minus_flag, int zero_flag) { - Charcount cclen; - Bufbyte pad; Lstream *lstr = XLSTREAM (stream); - - cclen = bytecount_to_charcount (string, len); - - if (zero_flag) - pad = '0'; - else - pad = ' '; + Charcount cclen = bytecount_to_charcount (string, len); + int to_add = minlen - cclen; /* Padding at beginning to right-justify ... */ - if (minlen > cclen && !minus_flag) - { - int to_add = minlen - cclen; - while (to_add > 0) - { - Lstream_putc (lstr, pad); - to_add--; - } - } + if (!minus_flag) + while (to_add-- > 0) + Lstream_putc (lstr, zero_flag ? '0' : ' '); - if (maxlen >= 0) - len = charcount_to_bytecount (string, min (maxlen, cclen)); + if (0 <= maxlen && maxlen < cclen) + len = charcount_to_bytecount (string, maxlen); Lstream_write (lstr, string, len); /* Padding at end to left-justify ... */ - if (minlen > cclen && minus_flag) - { - int to_add = minlen - cclen; - while (to_add > 0) - { - Lstream_putc (lstr, pad); - to_add--; - } - } + if (minus_flag) + while (to_add-- > 0) + Lstream_putc (lstr, zero_flag ? '0' : ' '); } static const Bufbyte * @@ -610,34 +593,34 @@ } else { - char text_to_print[500]; + /* ASCII Decimal representation uses 2.4 times as many + bits as machine binary. */ + char *text_to_print = + alloca_array (char, 32 + + max (spec->minwidth, + max (sizeof (double), sizeof (long)) * 3 + + max (spec->precision, 0))); char constructed_spec[100]; char *p = constructed_spec; - /* Partially reconstruct the spec and use sprintf() to + /* Mostly reconstruct the spec and use sprintf() to format the string. */ - /* Make sure nothing stupid happens */ - /* DO NOT REMOVE THE (int) CAST! Incorrect results will - follow! */ - spec->precision = min (spec->precision, - (int) (sizeof (text_to_print) - 50)); - *p++ = '%'; if (spec->plus_flag) *p++ = '+'; if (spec->space_flag) *p++ = ' '; if (spec->number_flag) *p++ = '#'; + if (spec->minus_flag) *p++ = '-'; + if (spec->zero_flag) *p++ = '0'; - if (spec->precision >= 0 && !spec->minwidth) + if (spec->minwidth >= 0) + p = long_to_string (p, spec->minwidth); + if (spec->precision >= 0) { *p++ = '.'; p = long_to_string (p, spec->precision); } - - /* sprintf the mofo */ - /* we have to use separate calls to sprintf(), rather than - a single big conditional, because of the different types - of the arguments */ + if (strchr (double_converters, ch)) { *p++ = ch; @@ -646,10 +629,9 @@ } else { - if (spec->zero_flag && spec->minwidth) - sprintf (p, "0%dl%c", spec->minwidth, ch); - else - sprintf (p, "l%c", ch); + *p++ = 'l'; /* Always use longs with sprintf() */ + *p++ = ch; + *p++ = '\0'; if (strchr (unsigned_int_converters, ch)) sprintf (text_to_print, constructed_spec, arg.ul); @@ -658,8 +640,7 @@ } doprnt_1 (stream, (Bufbyte *) text_to_print, - strlen (text_to_print), - spec->minwidth, -1, spec->minus_flag, spec->zero_flag); + strlen (text_to_print), 0, -1, 0, 0); } } } diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/event-Xt.c --- a/src/event-Xt.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/event-Xt.c Mon Aug 13 11:38:25 2007 +0200 @@ -1763,6 +1763,41 @@ } } +/* #### I'm struggling to understand how the X event loop really works. + Here is the problem: + + When widgets get mapped / changed etc the actual display updates + are done asynchronously via X events being processed - this + normally happens when XtAppProcessEvent() gets called. However, if + we are executing lisp code or even doing redisplay we won't + necessarily process X events for a very long time. This has the + effect of widgets only getting updated when XEmacs only goes into + idle, or some other event causes processing of the X event queue. + + XtAppProcessEvent can get called from the following places: + + emacs_Xt_next_event () - this is normal event processing, almost + any non-X event will take precedence and this means that we + cannot rely on it to do the right thing at the right time for + widget display. + + drain_X_queue () - this happens when SIGIO gets tripped, + processing the event queue allows C-g to be checked for. It gets + called from emacs_Xt_event_pending_p (). + + In order to solve this I have tried introducing a list primitive - + dispatch-non-command-events - which forces processing of X events + related to display. Unfortunately this has a number of problems, + one is that it is possible for event_stream_event_pending_p to + block for ever if there isn't actually an event. I guess this can + happen if we drop the synthetic event for reason. It also relies on + SIGIO processing which makes things rather fragile. + + People have seen behaviour whereby XEmacs blocks until you move the + mouse. This seems to indicate that dispatch-non-command-events is + blocking. It may be that in a SIGIO world forcing SIGIO processing + does the wrong thing. +*/ static void emacs_Xt_force_event_pending (struct frame* f) { @@ -1778,8 +1813,8 @@ /* Send the drop message */ XSendEvent(dpy, XtWindow (FRAME_X_SHELL_WIDGET (f)), True, NoEventMask, &event); - /* Force event pending to check the X queue. */ - quit_check_signal_tick_count++; + /* We rely on SIGIO and friends to realise we have generated an + event. */ } static void @@ -2949,7 +2984,11 @@ /* quit_check_signal_tick_count is volatile so try to avoid race conditions by using a temporary variable */ tick_count_val = quit_check_signal_tick_count; - if (last_quit_check_signal_tick_count != tick_count_val) + if (last_quit_check_signal_tick_count != tick_count_val +#if !defined (SIGIO) || defined (CYGWIN) + || (XtIMXEvent & XtAppPending (Xt_app_con)) +#endif + ) { last_quit_check_signal_tick_count = tick_count_val; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/file-coding.c --- a/src/file-coding.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/file-coding.c Mon Aug 13 11:38:25 2007 +0200 @@ -46,17 +46,17 @@ Lisp_Object Vfile_name_coding_system; /* Table of symbols identifying each coding category. */ -Lisp_Object coding_category_symbol[CODING_CATEGORY_LAST + 1]; +Lisp_Object coding_category_symbol[CODING_CATEGORY_LAST]; struct file_coding_dump { /* Coding system currently associated with each coding category. */ - Lisp_Object coding_category_system[CODING_CATEGORY_LAST + 1]; + Lisp_Object coding_category_system[CODING_CATEGORY_LAST]; /* Table of all coding categories in decreasing order of priority. This describes a permutation of the possible coding categories. */ - int coding_category_by_priority[CODING_CATEGORY_LAST + 1]; + int coding_category_by_priority[CODING_CATEGORY_LAST]; #ifdef MULE Lisp_Object ucs_to_mule_table[65536]; @@ -64,7 +64,7 @@ } *fcd; static const struct lrecord_description fcd_description_1[] = { - { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, coding_category_system), CODING_CATEGORY_LAST + 1 }, + { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, coding_category_system), CODING_CATEGORY_LAST }, #ifdef MULE { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, ucs_to_mule_table), countof (fcd->ucs_to_mule_table) }, #endif @@ -1433,7 +1433,7 @@ int i; CHECK_SYMBOL (symbol); - for (i = 0; i <= CODING_CATEGORY_LAST; i++) + for (i = 0; i < CODING_CATEGORY_LAST; i++) if (EQ (coding_category_symbol[i], symbol)) return i; @@ -1449,7 +1449,7 @@ int i; Lisp_Object list = Qnil; - for (i = CODING_CATEGORY_LAST; i >= 0; i--) + for (i = CODING_CATEGORY_LAST - 1; i >= 0; i--) list = Fcons (coding_category_symbol[i], list); return list; } @@ -1463,13 +1463,13 @@ */ (list)) { - int category_to_priority[CODING_CATEGORY_LAST + 1]; + int category_to_priority[CODING_CATEGORY_LAST]; int i, j; Lisp_Object rest; /* First generate a list that maps coding categories to priorities. */ - for (i = 0; i <= CODING_CATEGORY_LAST; i++) + for (i = 0; i < CODING_CATEGORY_LAST; i++) category_to_priority[i] = -1; /* Highest priority comes from the specified list. */ @@ -1486,7 +1486,7 @@ /* Now go through the existing categories by priority to retrieve the categories not yet specified and preserve their priority order. */ - for (j = 0; j <= CODING_CATEGORY_LAST; j++) + for (j = 0; j < CODING_CATEGORY_LAST; j++) { int cat = fcd->coding_category_by_priority[j]; if (category_to_priority[cat] < 0) @@ -1496,7 +1496,7 @@ /* Now we need to construct the inverse of the mapping we just constructed. */ - for (i = 0; i <= CODING_CATEGORY_LAST; i++) + for (i = 0; i < CODING_CATEGORY_LAST; i++) fcd->coding_category_by_priority[category_to_priority[i]] = i; /* Phew! That was confusing. */ @@ -1511,7 +1511,7 @@ int i; Lisp_Object list = Qnil; - for (i = CODING_CATEGORY_LAST; i >= 0; i--) + for (i = CODING_CATEGORY_LAST - 1; i >= 0; i--) list = Fcons (coding_category_symbol[fcd->coding_category_by_priority[i]], list); return list; @@ -1761,7 +1761,7 @@ #endif /* Look through the coding categories by priority and find the first one that is allowed. */ - for (i = 0; i <= CODING_CATEGORY_LAST; i++) + for (i = 0; i < CODING_CATEGORY_LAST; i++) { cat = fcd->coding_category_by_priority[i]; if ((mask & (1 << cat)) && @@ -1959,7 +1959,7 @@ #ifdef MULE decst.mask = postprocess_iso2022_mask (decst.mask); #endif - for (i = CODING_CATEGORY_LAST; i >= 0; i--) + for (i = CODING_CATEGORY_LAST - 1; i >= 0; i--) { int sys = fcd->coding_category_by_priority[i]; if (decst.mask & (1 << sys)) @@ -4282,7 +4282,48 @@ If CHECK_INVALID_CHARSETS is non-zero, check for designation or invocation of an invalid character set and treat that as - an unrecognized escape sequence. */ + an unrecognized escape sequence. + + ******************************************************************** + + #### Strategies for error annotation and coding orthogonalization + + We really want to separate out a number of things. Conceptually, + there is a nested syntax. + + At the top level is the ISO 2022 extension syntax, including charset + designation and invocation, and certain auxiliary controls such as the + ISO 6429 direction specification. These are octet-oriented, with the + single exception (AFAIK) of the "exit Unicode" sequence which uses the + UTF's natural width (1 byte for UTF-7 and UTF-8, 2 bytes for UCS-2 and + UTF-16, and 4 bytes for UCS-4 and UTF-32). This will be treated as a + (deprecated) special case in Unicode processing. + + The middle layer is ISO 2022 character interpretation. This will depend + on the current state of the ISO 2022 registers, and assembles octets + into the character's internal representation. + + The lowest level is translating system control conventions. At present + this is restricted to newline translation, but one could imagine doing + tab conversion or line wrapping here. "Escape from Unicode" processing + would be done at this level. + + At each level the parser will verify the syntax. In the case of a + syntax error or warning (such as a redundant escape sequence that affects + no characters), the parser will take some action, typically inserting the + erroneous octets directly into the output and creating an annotation + which can be used by higher level I/O to mark the affected region. + + This should make it possible to do something sensible about separating + newline convention processing from character construction, and about + preventing ISO 2022 escape sequences from being recognized + inappropriately. + + The basic strategy will be to have octet classification tables, and + switch processing according to the table entry. + + It's possible that, by doing the processing with tables of functions or + the like, the parser can be used for both detection and translation. */ static int parse_iso2022_esc (Lisp_Object codesys, struct iso2022_decoder *iso, @@ -5700,7 +5741,7 @@ dumpstruct (&fcd, &fcd_description); /* Initialize to something reasonable ... */ - for (i = 0; i <= CODING_CATEGORY_LAST; i++) + for (i = 0; i < CODING_CATEGORY_LAST; i++) { fcd->coding_category_system[i] = Qnil; fcd->coding_category_by_priority[i] = i; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/file-coding.h --- a/src/file-coding.h Mon Aug 13 11:37:23 2007 +0200 +++ b/src/file-coding.h Mon Aug 13 11:38:25 2007 +0200 @@ -408,32 +408,50 @@ #define ISO_CODE_CSI 0x9B /* control-sequence-introduce */ #endif /* MULE */ -/* For detecting the encoding of text */ +/* Distinguishable categories of encodings. + + This list determines the initial priority of the categories. + + For better or worse, currently Mule files are encoded in 7-bit ISO 2022. + For this reason, under Mule ISO_7 gets highest priority. + + Putting NO_CONVERSION second prevents "binary corruption" in the + default case in all but the (presumably) extremely rare case of a + binary file which contains redundant escape sequences but no 8-bit + characters. + + The remaining priorities are based on perceived "internationalization + political correctness." An exception is UCS-4 at the bottom, since + basically everything is compatible with UCS-4, but it is likely to + be very rare as an external encoding. */ + enum coding_category_type { + /* must be a contiguous range of values 0 -- CODING_CATEGORY_LAST - 1 */ #ifdef MULE - CODING_CATEGORY_SHIFT_JIS, CODING_CATEGORY_ISO_7, /* ISO2022 system using only seven-bit bytes, no locking shift */ - CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes, - no locking shift, no single shift, - using designation to switch charsets */ + CODING_CATEGORY_NO_CONVERSION, + CODING_CATEGORY_UTF8, CODING_CATEGORY_ISO_8_1, /* ISO2022 system using eight-bit bytes, no locking shift, no designation sequences, one-dimension characters in the upper half. */ CODING_CATEGORY_ISO_8_2, /* ISO2022 system using eight-bit bytes, no locking shift, no designation sequences, two-dimension characters in the upper half. */ + CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes, + no locking shift, no single shift, + using designation to switch charsets */ CODING_CATEGORY_ISO_LOCK_SHIFT, /* ISO2022 system using locking shift */ + CODING_CATEGORY_SHIFT_JIS, CODING_CATEGORY_BIG5, CODING_CATEGORY_UCS4, - CODING_CATEGORY_UTF8, +#else /* not MULE */ + CODING_CATEGORY_NO_CONVERSION, #endif /* MULE */ - CODING_CATEGORY_NO_CONVERSION + CODING_CATEGORY_LAST /* not a real coding category */ }; -#define CODING_CATEGORY_LAST CODING_CATEGORY_NO_CONVERSION - #ifdef MULE #define CODING_CATEGORY_SHIFT_JIS_MASK \ (1 << CODING_CATEGORY_SHIFT_JIS) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/glyphs-x.c --- a/src/glyphs-x.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/glyphs-x.c Mon Aug 13 11:38:25 2007 +0200 @@ -2140,6 +2140,7 @@ x_map_subwindow (Lisp_Image_Instance *p, int x, int y, struct display_glyph_area* dga) { + assert (dga->width > 0 && dga->height > 0); if (IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW) { Window subwindow = IMAGE_INSTANCE_X_SUBWINDOW_ID (p); @@ -2259,6 +2260,16 @@ (Dimension)IMAGE_INSTANCE_HEIGHT (p)); } + /* Adjust offsets within the frame. */ + if (XFRAME (IMAGE_INSTANCE_FRAME (p))->frame_changed) + { + Arg al[2]; + XtSetArg (al [0], XtNx, &IMAGE_INSTANCE_X_WIDGET_XOFFSET (p)); + XtSetArg (al [1], XtNy, &IMAGE_INSTANCE_X_WIDGET_YOFFSET (p)); + XtGetValues (FRAME_X_TEXT_WIDGET + (XFRAME (IMAGE_INSTANCE_FRAME (p))), al, 2); + } + /* now modify the widget */ lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), wv, True); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/glyphs.c --- a/src/glyphs.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/glyphs.c Mon Aug 13 11:38:25 2007 +0200 @@ -3346,7 +3346,11 @@ Lisp_Object property = IMAGE_SPECIFIER_ATTACHEE_PROPERTY (XIMAGE_SPECIFIER (specifier)); if (FACEP (attachee)) - face_property_was_changed (attachee, property, locale); + { + face_property_was_changed (attachee, property, locale); + if (BUFFERP (locale)) + XBUFFER (locale)->buffer_local_face_property = 1; + } else if (GLYPHP (attachee)) glyph_property_was_changed (attachee, property, locale); } diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/input-method-xfs.c --- a/src/input-method-xfs.c Mon Aug 13 11:37:23 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* input-method-xfs.c provides just only locale initialize - for non Motif people. (stoled from input-method-xlib.c) - Why I made this code is to initialize X locale environment for - the purpose of use XFontSet correctly in lwlib/xlwmenu.c. - And this code donot provides input methods under Xlib while they - prefer to use Canna, Wnn, skk or something like that. - This code has been tested on FreeBSD 2.2.1 and Solaris2.5. - - Copyright (C) 1997 Kazuyuki IENAGA. - -This file is a 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. */ - -#include -#include /* More portable than ? */ -#include "lisp.h" -#include "frame.h" -#include "device.h" -#include "window.h" -#include "buffer.h" -#include "console-x.h" -#include "EmacsFrame.h" -#include "events.h" - -#ifdef USE_XFONTSET -void -Initialize_Locale (void) -{ - char *locale; - - /* dverna - Nov. 98: #### DON'T DO THIS !!! The default XtLanguageProc - routine calls setlocale(LC_ALL, lang) which fucks up our lower-level - locale management, and especially the value of LC_NUMERIC. Anyway, since - at this point, we don't know yet whether we're gonna need an X11 frame, - we should really do it manually and not use Xlib's dumb default routine */ - /*XtSetLanguageProc (NULL, (XtLanguageProc) NULL, NULL);*/ - if ((locale = setlocale (LC_ALL, "")) == NULL) - { - stderr_out ("Can't set locale.\n"); - stderr_out ("Using C locale instead.\n"); - putenv ("LANG=C"); - putenv ("LC_ALL=C"); - if ((locale = setlocale (LC_ALL, "C")) == NULL) - { - stderr_out ("Can't even set locale to `C'!\n"); - return; - } - } - - if (!XSupportsLocale ()) - { - stderr_out ("X Windows does not support locale `%s'\n", locale); - stderr_out ("Using C Locale instead\n"); - putenv ("LANG=C"); - putenv ("LC_ALL=C"); - if ((locale = setlocale (LC_ALL, "C")) == NULL) - { - stderr_out ("Can't even set locale to `C'!\n"); - return; - } - if (!XSupportsLocale ()) - { - stderr_out ("X Windows does not even support locale `C'!\n"); - return; - } - } - - setlocale(LC_NUMERIC, "C"); - setlocale(LC_CTYPE, ""); /* take back CTYPE to previous state */ - - if (XSetLocaleModifiers ("") == NULL) - { - stderr_out ("XSetLocaleModifiers(\"\") failed\n"); - stderr_out ("Check the value of the XMODIFIERS environment variable.\n"); - } -} -#endif /* USE_XFONTSET */ diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/input-method-xlib.c --- a/src/input-method-xlib.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/input-method-xlib.c Mon Aug 13 11:38:25 2007 +0200 @@ -80,8 +80,8 @@ #include "EmacsFrame.h" #include "events.h" -#ifndef XIM_XLIB -#error XIM_XLIB is not defined?? +#if !defined (XIM_XLIB) && !defined (USE_XFONTSET) +#error neither XIM_XLIB nor USE_XFONTSET is defined?? #endif Lisp_Object Qxim_xlib; @@ -89,6 +89,7 @@ #define xim_warn1(fmt, str) warn_when_safe (Qxim_xlib, Qwarning, fmt, str); #define xim_info(str) warn_when_safe (Qxim_xlib, Qinfo, str); +#ifdef XIM_XLIB /* XIM_XLIB specific */ /* Get/Set IC values for just one attribute */ #ifdef DEBUG_XEMACS #define XIC_Value(Get_Set, xic, name, attr, value) \ @@ -120,6 +121,7 @@ "XIMPreeditNone|XIMStatusNone"; static XIMStyle best_style (XIMStyles *user, XIMStyles *xim); +#endif /* XIM_XLIB only */ /* This function is documented, but no prototype in the header files */ EXTERN_C char * XSetIMValues(XIM, ...); @@ -175,6 +177,8 @@ } } +#ifdef XIM_XLIB /* starting XIM specific codes */ + /* Callbacks for IM are supported from X11R6 or later. */ #ifdef HAVE_XREGISTERIMINSTANTIATECALLBACK @@ -1113,6 +1117,7 @@ } } #endif +#endif /* XIM_XLIB only */ #if 0 /* Get a fontset for IM to use */ diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/lastfile.c --- a/src/lastfile.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/lastfile.c Mon Aug 13 11:38:25 2007 +0200 @@ -38,6 +38,16 @@ coming from libraries. */ +#include + char my_edata[] = "End of Emacs initialized data"; -int my_ebss; +/* Ensure there is enough slack in the .bss to pad with. */ +#ifdef HEAP_IN_DATA +#define BSS_PADDING 0x1000 +#else +#define BSS_PADDING 1 +#endif + +char my_ebss [BSS_PADDING]; + diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/menubar.c --- a/src/menubar.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/menubar.c Mon Aug 13 11:38:25 2007 +0200 @@ -115,6 +115,9 @@ Lisp_Object oldval) { MARK_MENUBAR_CHANGED; + /* This is to force subwindow offsets to be recalculated - see + x_redisplay_widget (). */ + MARK_FRAME_CHANGED (WINDOW_XFRAME (w)); } static void diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/minibuf.c --- a/src/minibuf.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/minibuf.c Mon Aug 13 11:38:25 2007 +0200 @@ -618,7 +618,12 @@ if (STRINGP (eltstring) && (slength <= XSTRING_CHAR_LENGTH (eltstring)) - && (0 > scmp (XSTRING_DATA (eltstring), + /* Reject alternatives that start with space + unless the input starts with space. */ + && ((XSTRING_CHAR_LENGTH (string) > 0 && + string_char (XSTRING (string), 0) == ' ') + || string_char (XSTRING (eltstring), 0) != ' ') + && (0 > scmp (XSTRING_DATA (eltstring), XSTRING_DATA (string), slength))) { diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/mule-canna.c --- a/src/mule-canna.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/mule-canna.c Mon Aug 13 11:38:25 2007 +0200 @@ -22,9 +22,11 @@ /* Synched up with: Mule 2.3. Not in FSF. */ -/* #### The comments in this file are mostly in EUC-formatted Japanese. - It would be ***soooo*** much nicer if someone could translate - them ... */ +/* Japanese comments were translated 2000-12-06 by Stephen Turnbull + . I haven't verified that the Japanese comments + were correct. YMMV, NO WARRANTY, not even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. (^^;;; as the + Japanese say. */ /* @@ -165,8 +167,9 @@ #endif /* !CANNA2 */ extern char *jrKanjiError; +/* #### is this global really necessary? */ #define KEYTOSTRSIZE 2048 -static unsigned char buf[KEYTOSTRSIZE]; +static unsigned char key_buffer[KEYTOSTRSIZE]; static char **warning; static int canna_empty_info, canna_through_info; @@ -214,8 +217,8 @@ int len; CHECK_CHAR_COERCE_INT (ch); - len = jrKanjiString (0, XCHAR (ch), buf, KEYTOSTRSIZE, &ks); - return storeResults (buf, len, &ks); + len = jrKanjiString (0, XCHAR (ch), key_buffer, KEYTOSTRSIZE, &ks); + return storeResults (key_buffer, len, &ks); } static Lisp_Object @@ -229,10 +232,11 @@ } else { - /* 確定した文字列 */ + /* 確定した文字列 (the confirmed string) */ Vcanna_kakutei_string = make_string (buf, len); val = make_int (len); - /* 確定した文字列の読みの情報... */ + /* 確定した文字列の読みの情報... + (info about the reading of the confirmed string) */ Vcanna_kakutei_yomi = Vcanna_kakutei_romaji = Qnil; if (ks->info & KanjiYomiInfo) { @@ -243,18 +247,21 @@ { int yomilen2; - Vcanna_kakutei_yomi = make_string (p, yomilen); /* 読み */ + Vcanna_kakutei_yomi = make_string (p, yomilen); /* 読み + (reading) */ p += yomilen + 1; yomilen2 = strlen (p); if (len + yomilen + yomilen2 + 2 < KEYTOSTRSIZE) { - Vcanna_kakutei_romaji = make_string (p, yomilen2); /* ローマ字 */ + Vcanna_kakutei_romaji = make_string (p, yomilen2); + /* ローマ字 (romanization) */ } } } - /* 候補表示の文字列です。*/ + /* 候補表示の文字列です。 + (string for displaying candidate translations) */ Vcanna_henkan_string = Qnil; if (ks->length >= 0) { @@ -268,7 +275,8 @@ { canna_henkan_length = mule_strlen (ks->echoStr,ks->length); canna_henkan_revPos = mule_strlen (ks->echoStr,ks->revPos); - canna_henkan_revLen = mule_strlen (ks->echoStr+ks->revPos,ks->revLen); + canna_henkan_revLen = mule_strlen (ks->echoStr+ks->revPos, + ks->revLen); } else { @@ -279,30 +287,32 @@ #endif /* CANNA_MULE */ } - /* 一覧の情報 */ + /* 一覧の情報 (information about the echo area menu) */ Vcanna_ichiran_string = Qnil; if (ks->info & KanjiGLineInfo && ks->gline.length >= 0) { - Vcanna_ichiran_string = make_string (ks->gline.line, ks->gline.length); + Vcanna_ichiran_string = make_string (ks->gline.line, + ks->gline.length); #ifndef CANNA_MULE canna_ichiran_length = ks->gline.length; canna_ichiran_revPos = ks->gline.revPos; canna_ichiran_revLen = ks->gline.revLen; #else /* CANNA_MULE */ count_char (ks->gline.line, ks->gline.length, - ks->gline.revPos, ks->gline.revLen, &canna_ichiran_length, + ks->gline.revPos, ks->gline.revLen, + &canna_ichiran_length, &canna_ichiran_revPos, &canna_ichiran_revLen); #endif /* CANNA_MULE */ } - /* モードの情報 */ + /* モードの情報 (mode information) */ Vcanna_mode_string = Qnil; if (ks->info & KanjiModeInfo) { Vcanna_mode_string = make_string (ks->mode, strlen (ks->mode)); } - /* その他の情報 */ + /* その他の情報 (other information) */ canna_empty_info = (ks->info & KanjiEmptyInfo) ? 1 : 0; canna_through_info = (ks->info & KanjiThroughInfo) ? 1 : 0; } @@ -317,7 +327,7 @@ */ (num)) { - int kugiri; /* 文節区切りをするか? */ + int kugiri; /* 文節区切りをするか? (display clause separator?) */ kugiri = NILP (num) ? 0 : 1; @@ -348,7 +358,7 @@ int res; unsigned char **p, **q; - int kugiri; /* 文節区切りをするか? */ + int kugiri; /* 文節区切りをするか? (display clause separator?) */ IRCP_context = -1; @@ -416,7 +426,7 @@ { val = Fcons (make_string ((unsigned char*) jrKanjiError, strlen (jrKanjiError)), val); - /* イニシャライズで失敗した場合。 */ + /* イニシャライズで失敗した場合。 (on initialization failure) */ return Fcons (Qnil, val); } else @@ -438,11 +448,14 @@ #ifndef CANNA_MULE jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1); #else - /* mule だったら半角カタカナも使える */ + /* mule だったら半角カタカナも使える + (Mule can use half-width katakana) */ if (canna_inhibit_hankakukana) jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1); #endif - jrKanjiControl (0, KC_YOMIINFO, (char *) 2); /* ※2: ローマ字まで返す */ + jrKanjiControl (0, KC_YOMIINFO, (char *) 2); /* ※2: ローマ字まで返す + (*2: return to + romanized form) */ val = Fcons (Qnil, val); return Fcons (CANNA_mode_keys (), val); } @@ -486,7 +499,7 @@ #endif CHECK_STRING (str); - ksv.buffer = (unsigned char *) buf; + ksv.buffer = (unsigned char *) key_buffer; ksv.bytes_buffer = KEYTOSTRSIZE; #ifndef CANNA_MULE ks.echoStr = XSTRING_DATA (str); @@ -498,7 +511,7 @@ #endif /* CANNA_MULE */ ksv.ks = &ks; len = jrKanjiControl (0, KC_DEFINEKANJI, (char *)&ksv); - val = storeResults (buf, ksv.val, ksv.ks); + val = storeResults (key_buffer, ksv.val, ksv.ks); return val; } @@ -525,12 +538,12 @@ CHECK_INT (num); - ksv.buffer = (unsigned char *) buf; + ksv.buffer = (unsigned char *) key_buffer; ksv.bytes_buffer = KEYTOSTRSIZE; ksv.ks = &ks; ksv.val = XINT (num); jrKanjiControl (0, KC_CHANGEMODE, (char *)&ksv); - val = storeResults (buf, ksv.val, ksv.ks); + val = storeResults (key_buffer, ksv.val, ksv.ks); return val; } @@ -563,12 +576,12 @@ CHECK_STRING (yomi); #ifndef CANNA_MULE - strncpy (buf, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi)); + strncpy (key_buffer, XSTRING_DATA (yomi), XSTRING_LENGTH (yomi)); ks.length = XSTRING_LENGTH (yomi); - buf[ks.length] = '\0'; + key_buffer[ks.length] = '\0'; #else /* CANNA_MULE */ - m2c (XSTRING_DATA (yomi), XSTRING_LENGTH (yomi), buf); - ks.length = strlen (buf); + m2c (XSTRING_DATA (yomi), XSTRING_LENGTH (yomi), key_buffer); + ks.length = strlen (key_buffer); #endif /* CANNA_MULE */ if (NILP (roma)) @@ -580,24 +593,24 @@ CHECK_STRING (roma); #ifndef CANNA_MULE - strncpy (buf + XSTRING_LENGTH (yomi) + 1, XSTRING_DATA (roma), + strncpy (key_buffer + XSTRING_LENGTH (yomi) + 1, XSTRING_DATA (roma), XSTRING_LENGTH (roma)); - buf[XSTRING_LENGTH (yomi) + 1 + XSTRING_LENGTH (roma)] = '\0'; - ks.mode = (unsigned char *)(buf + XSTRING_LENGTH (yomi) + 1); + key_buffer[XSTRING_LENGTH (yomi) + 1 + XSTRING_LENGTH (roma)] = '\0'; + ks.mode = (unsigned char *)(key_buffer + XSTRING_LENGTH (yomi) + 1); #else /* CANNA_MULE */ - ks.mode = (unsigned char *)(buf + ks.length + 1); + ks.mode = (unsigned char *)(key_buffer + ks.length + 1); m2c (XSTRING_DATA (roma), XSTRING_LENGTH (roma), ks.mode); #endif /* CANNA_MULE */ } - ks.echoStr = (unsigned char *) buf; - ksv.buffer = (unsigned char *) buf; /* 返値用 */ + ks.echoStr = (unsigned char *) key_buffer; + ksv.buffer = (unsigned char *) key_buffer; /* 返値用 (return value) */ ksv.bytes_buffer = KEYTOSTRSIZE; ksv.ks = &ks; jrKanjiControl (0, KC_STOREYOMI, (char *)&ksv); - return storeResults (buf, ksv.val, ksv.ks); + return storeResults (key_buffer, ksv.val, ksv.ks); } DEFUN ("canna-do-function", Fcanna_do_function, 1, 2, 0, /* @@ -613,20 +626,20 @@ if (NILP (ch)) { - *buf = '@'; + *key_buffer = '@'; } else { CHECK_CHAR (ch); - *buf = XCHAR (ch); + *key_buffer = XCHAR (ch); } - ksv.buffer = (unsigned char *) buf; + ksv.buffer = (unsigned char *) key_buffer; ksv.bytes_buffer = KEYTOSTRSIZE; ksv.ks = &ks; ksv.val = XINT (num); jrKanjiControl (0, KC_DO, (char *) &ksv); - val = storeResults (buf, ksv.val, ksv.ks); + val = storeResults (key_buffer, ksv.val, ksv.ks); return val; } @@ -642,12 +655,12 @@ CHECK_STRING (str); #ifndef CANNA_MULE - strncpy (buf, XSTRING_DATA (str), XSTRING_LENGTH (str)); - buf[XSTRING_LENGTH (str)] = '\0'; + strncpy (key_buffer, XSTRING_DATA (str), XSTRING_LENGTH (str)); + key_buffer[XSTRING_LENGTH (str)] = '\0'; #else /* CANNA_MULE */ - m2c (XSTRING_DATA (str), XSTRING_LENGTH (str), buf); + m2c (XSTRING_DATA (str), XSTRING_LENGTH (str), key_buffer); #endif /* CANNA_MULE */ - p = (unsigned char**) buf; + p = (unsigned char**) key_buffer; n = jrKanjiControl (0, KC_PARSE, (char *) &p); val = Qnil; while (n > 0) @@ -853,7 +866,9 @@ { return Qnil; } - RkEndBun (IRCP_context, 1); /* 学習はいつでも行って良いものなのか? */ + RkEndBun (IRCP_context, 1); /* 学習はいつでも行って良いものなのか? + (is it OK to invoke learning function + at arbitrary times?) */ return Qt; } diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/nt.c --- a/src/nt.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/nt.c Mon Aug 13 11:38:25 2007 +0200 @@ -1378,37 +1378,92 @@ a compatibility test. --kkm */ /* Since stat is encapsulated on Windows NT, we need to encapsulate - the equally broken fstat as well. */ + the equally broken fstat as well. FSFmacs also provides its own + utime. Is that necessary here too? */ int -mswindows_fstat (int handle, struct stat *buffer) +mswindows_fstat (int desc, struct stat * buf) { - int ret; - BY_HANDLE_FILE_INFORMATION lpFileInfo; - /* Initialize values */ - buffer->st_mode = 0; - buffer->st_size = 0; - buffer->st_dev = 0; - buffer->st_rdev = 0; - buffer->st_atime = 0; - buffer->st_ctime = 0; - buffer->st_mtime = 0; - buffer->st_nlink = 0; - ret = GetFileInformationByHandle((HANDLE) _get_osfhandle(handle), &lpFileInfo); - if (!ret) + HANDLE fh = (HANDLE) _get_osfhandle (desc); + BY_HANDLE_FILE_INFORMATION info; + DWORD fake_inode; + int permission; + + switch (GetFileType (fh) & ~FILE_TYPE_REMOTE) { - return -1; + case FILE_TYPE_DISK: + buf->st_mode = _S_IFREG; + if (!GetFileInformationByHandle (fh, &info)) + { + errno = EACCES; + return -1; + } + break; + case FILE_TYPE_PIPE: + buf->st_mode = _S_IFIFO; + goto non_disk; + case FILE_TYPE_CHAR: + case FILE_TYPE_UNKNOWN: + default: + buf->st_mode = _S_IFCHR; + non_disk: + memset (&info, 0, sizeof (info)); + info.dwFileAttributes = 0; + info.ftCreationTime = utc_base_ft; + info.ftLastAccessTime = utc_base_ft; + info.ftLastWriteTime = utc_base_ft; + } + + if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + buf->st_mode = _S_IFDIR; + buf->st_nlink = 2; /* doesn't really matter */ + fake_inode = 0; /* this doesn't either I think */ } else { - buffer->st_mtime = convert_time (lpFileInfo.ftLastWriteTime); - buffer->st_atime = convert_time (lpFileInfo.ftLastAccessTime); - if (buffer->st_atime == 0) buffer->st_atime = buffer->st_mtime; - buffer->st_ctime = convert_time (lpFileInfo.ftCreationTime); - if (buffer->st_ctime == 0) buffer->st_ctime = buffer->st_mtime; - buffer->st_size = lpFileInfo.nFileSizeLow; - buffer->st_nlink = (short) lpFileInfo.nNumberOfLinks; - return 0; + buf->st_nlink = info.nNumberOfLinks; + /* Might as well use file index to fake inode values, but this + is not guaranteed to be unique unless we keep a handle open + all the time (even then there are situations where it is + not unique). Reputedly, there are at most 48 bits of info + (on NTFS, presumably less on FAT). */ + fake_inode = info.nFileIndexLow ^ info.nFileIndexHigh; } + + /* MSVC defines _ino_t to be short; other libc's might not. */ + if (sizeof (buf->st_ino) == 2) + buf->st_ino = fake_inode ^ (fake_inode >> 16); + else + buf->st_ino = fake_inode; + + /* consider files to belong to current user */ + buf->st_uid = 0; + buf->st_gid = 0; + + buf->st_dev = info.dwVolumeSerialNumber; + buf->st_rdev = info.dwVolumeSerialNumber; + + buf->st_size = info.nFileSizeLow; + + /* Convert timestamps to Unix format. */ + buf->st_mtime = convert_time (info.ftLastWriteTime); + buf->st_atime = convert_time (info.ftLastAccessTime); + if (buf->st_atime == 0) buf->st_atime = buf->st_mtime; + buf->st_ctime = convert_time (info.ftCreationTime); + if (buf->st_ctime == 0) buf->st_ctime = buf->st_mtime; + + /* determine rwx permissions */ + if (info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) + permission = _S_IREAD; + else + permission = _S_IREAD | _S_IWRITE; + + if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + permission |= _S_IEXEC; + + buf->st_mode |= permission | (permission >> 3) | (permission >> 6); + + return 0; } /* MSVC stat function can't cope with UNC names and has other bugs, so diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/objects.c --- a/src/objects.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/objects.c Mon Aug 13 11:38:25 2007 +0200 @@ -616,7 +616,11 @@ Lisp_Object property = COLOR_SPECIFIER_FACE_PROPERTY (XCOLOR_SPECIFIER (specifier)); if (!NILP (face)) - face_property_was_changed (face, property, locale); + { + face_property_was_changed (face, property, locale); + if (BUFFERP (locale)) + XBUFFER (locale)->buffer_local_face_property = 1; + } } void @@ -814,7 +818,11 @@ Lisp_Object property = FONT_SPECIFIER_FACE_PROPERTY (XFONT_SPECIFIER (specifier)); if (!NILP (face)) - face_property_was_changed (face, property, locale); + { + face_property_was_changed (face, property, locale); + if (BUFFERP (locale)) + XBUFFER (locale)->buffer_local_face_property = 1; + } } void @@ -949,7 +957,11 @@ Lisp_Object property = FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY (XFACE_BOOLEAN_SPECIFIER (specifier)); if (!NILP (face)) - face_property_was_changed (face, property, locale); + { + face_property_was_changed (face, property, locale); + if (BUFFERP (locale)) + XBUFFER (locale)->buffer_local_face_property = 1; + } } void diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/redisplay-output.c --- a/src/redisplay-output.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/redisplay-output.c Mon Aug 13 11:38:25 2007 +0200 @@ -182,7 +182,7 @@ /***************************************************************************** compare_runes - Compare to runes to see if each of their fields is equal. If so, + Compare two runes to see if each of their fields is equal. If so, return true otherwise return false. ****************************************************************************/ static int @@ -1162,8 +1162,9 @@ Remove subwindows from the area in the box defined by the given parameters. ****************************************************************************/ -static void redisplay_unmap_subwindows (struct frame* f, int x, int y, int width, int height, - Lisp_Object ignored_window) +static void +redisplay_unmap_subwindows (struct frame* f, int x, int y, int width, int height, + Lisp_Object ignored_window) { Lisp_Object rest; @@ -1757,7 +1758,17 @@ || -glyphsrc->xoffset >= glyphsrc->width || - -glyphsrc->yoffset >= glyphsrc->height) + -glyphsrc->yoffset >= glyphsrc->height + || + /* #### Not sure why this wasn't coped with before but normalizing + to zero width or height is definitely wrong. */ + (dest->xpos + glyphsrc->xoffset + glyphsrc->width > dest->xpos + dest->width + && + dest->width - glyphsrc->xoffset <= 0) + || + (dest->ypos + glyphsrc->yoffset + glyphsrc->height > dest->ypos + dest->height + && + dest->height - glyphsrc->yoffset <= 0)) { /* It's all clipped out */ return 0; @@ -1904,7 +1915,7 @@ If window is topmost, clear the internal border above it. ****************************************************************************/ -static void +void redisplay_clear_top_of_window (struct window *w) { Lisp_Object window; @@ -2269,7 +2280,7 @@ /* If the window's structure has changed clear the internal border above it if it is topmost (the function will check). */ - if (f->windows_structure_changed) + if (f->windows_structure_changed || f->faces_changed) redisplay_clear_top_of_window (w); /* Output each line. */ diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/redisplay-x.c --- a/src/redisplay-x.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/redisplay-x.c Mon Aug 13 11:38:25 2007 +0200 @@ -1706,6 +1706,7 @@ f->windows_structure_changed = 1; } + redisplay_clear_top_of_window (w); if (window_needs_vertical_divider (w)) { x_output_vertical_divider (w, 0); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/redisplay.c --- a/src/redisplay.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/redisplay.c Mon Aug 13 11:38:25 2007 +0200 @@ -9366,7 +9366,7 @@ maybe a caret cursor, etc. */ DEFVAR_LISP ("bar-cursor", &Vbar_cursor /* -Use vertical bar cursor if non-nil. If t width is 1 pixel, otherwise 2. +*Use vertical bar cursor if non-nil. If t width is 1 pixel, otherwise 2. */ ); Vbar_cursor = Qnil; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/redisplay.h --- a/src/redisplay.h Mon Aug 13 11:37:23 2007 +0200 +++ b/src/redisplay.h Mon Aug 13 11:38:25 2007 +0200 @@ -776,6 +776,7 @@ void redisplay_clear_to_window_end (struct window *w, int ypos1, int ypos2); void redisplay_clear_region (Lisp_Object window, face_index findex, int x, int y, int width, int height); +void redisplay_clear_top_of_window (struct window *w); void redisplay_clear_bottom_of_window (struct window *w, display_line_dynarr *ddla, int min_start, int max_end); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/s/sco5.h --- a/src/s/sco5.h Mon Aug 13 11:37:23 2007 +0200 +++ b/src/s/sco5.h Mon Aug 13 11:38:25 2007 +0200 @@ -37,6 +37,7 @@ #define SYSTEM_TYPE "SCO 3.2v5" /* SCO has ptys, but with weird names */ +#define HAVE_PTYS #define PTY_ITERATION \ for (i = 0; ; i++) #define PTY_NAME_SPRINTF \ diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/sysfile.h --- a/src/sysfile.h Mon Aug 13 11:37:23 2007 +0200 +++ b/src/sysfile.h Mon Aug 13 11:38:25 2007 +0200 @@ -170,7 +170,7 @@ In that case, use ordinary stat instead. */ #ifndef S_IFLNK -#define lstat stat +#define lstat xemacs_stat #endif #if !S_IRUSR diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/unexcw.c --- a/src/unexcw.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/unexcw.c Mon Aug 13 11:38:25 2007 +0200 @@ -23,11 +23,13 @@ /* This is a complete rewrite, some code snarfed from unexnt.c and unexec.c, Andy Piper (andy@xemacs.org) 13-1-98 */ +#include +#include "lisp.h" + #include #include #include #include -#include #include #define DONT_ENCAPSULATE /* filenames are external in unex*.c */ @@ -53,7 +55,7 @@ ((((unsigned long)addr) + ALLOC_UNIT) & ALLOC_MASK) /* Note that all sections must be aligned on a 0x1000 boundary so this is the minimum size that our dummy bss can be. */ -#ifdef BROKEN_GDB +#ifndef NO_DEBUG #define BSS_PAD_SIZE 0x1000 #else #define BSS_PAD_SIZE 0 @@ -92,12 +94,10 @@ exit(-1); \ } -void -unexec (char *out_name, char *in_name, void *start_data, - void * d1, void * d2); /* Dump out .data and .bss sections into a new executable. */ -void unexec (char *out_name, char *in_name, void *start_data, - void * d1, void * d2) +int +unexec (char *out_name, char *in_name, uintptr_t start_data, + uintptr_t d1, uintptr_t d2) { /* ugly nt hack - should be in lisp */ int a_new, a_out = -1; @@ -137,12 +137,13 @@ close(a_out); close(a_new); + return 0; } /* Flip through the executable and cache the info necessary for dumping. */ static void get_section_info (int a_out, char* a_name) { - extern int my_ebss; + extern char my_ebss[]; /* From lastfile.c */ extern char my_edata[]; @@ -291,6 +292,11 @@ data_padding = (f_bss.s_vaddr - f_data.s_vaddr) - f_data.s_size; } + if ((new_bss_size - bss_size) < BSS_PAD_SIZE) + { + PERROR (".bss free space too small"); + } + file_sz_change=(new_bss_size + data_padding) - BSS_PAD_SIZE; new_data_size=f_ohdr.dsize + file_sz_change; @@ -310,7 +316,7 @@ lseek (a_new, 0, SEEK_SET); /* write file header */ f_hdr.f_symptr += file_sz_change; -#ifndef BROKEN_GDB +#ifdef NO_DEBUG f_hdr.f_nscns--; #endif @@ -340,7 +346,7 @@ { PERROR("failed to write text header"); } -#ifdef BROKEN_GDB +#ifndef NO_DEBUG /* Write small bss section. */ if (!sections_reversed) { @@ -360,7 +366,7 @@ { PERROR("failed to write data header"); } -#ifdef BROKEN_GDB +#ifndef NO_DEBUG /* Write small bss section. */ if (sections_reversed) { @@ -399,7 +405,7 @@ PERROR("failed to write data header"); } } -#ifndef BROKEN_GDB +#ifdef NO_DEBUG /* dump bss to maintain offsets */ memset(&f_bss, 0, sizeof(f_bss)); if (write(a_new, &f_bss, sizeof(f_bss)) != sizeof(f_bss)) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/unexelfsgi.c --- a/src/unexelfsgi.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/unexelfsgi.c Mon Aug 13 11:38:25 2007 +0200 @@ -226,9 +226,10 @@ fatal ("Can't fstat (%s): errno %d\n", old_name, errno); /* map old file into the address space. */ - if ( (old_base = (caddr_t) mmap ((caddr_t) 0, stat_buf.st_size, - PROT_READ, MAP_SHARED, old_file, 0)) < 0 ) - fatal ("Can't mmap (%s): errno %d\n", old_name, errno); + old_base = (caddr_t) mmap ((caddr_t) 0, stat_buf.st_size, + PROT_READ, MAP_SHARED, old_file, 0); + if (old_base == (caddr_t) MAP_FAILED) + fatal ("Can't mmap (%s): errno %d\n", old_name, errno); old_file_h = (ElfW(Ehdr) *) old_base; old_program_h = (ElfW(Phdr) *) ((byte *) old_base + old_file_h->e_phoff); diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/window.c --- a/src/window.c Mon Aug 13 11:37:23 2007 +0200 +++ b/src/window.c Mon Aug 13 11:38:25 2007 +0200 @@ -2132,7 +2132,7 @@ By default, only the windows in the selected frame are considered. The optional argument WHICH-FRAMES changes this behavior: WHICH-FRAMES = `visible' means search windows on all visible frames. -WHICH-FRAMES = 0 means search windows on all visible and iconified frames. +WHICH-FRAMES = 0 means search windows on all visible and iconified frames. WHICH-FRAMES = t means search windows on all frames including invisible frames. WHICH-FRAMES = a frame means search only windows on that frame. Anything else means restrict to the selected frame. @@ -2278,7 +2278,7 @@ By default, only the windows in the selected frame are considered. The optional argument WHICH-FRAMES changes this behavior: WHICH-FRAMES = `visible' means search windows on all visible frames. -WHICH-FRAMES = 0 means search windows on all visible and iconified frames. +WHICH-FRAMES = 0 means search windows on all visible and iconified frames. WHICH-FRAMES = t means search windows on all frames including invisible frames. WHICH-FRAMES = a frame means search only windows on that frame. Anything else means restrict to the selected frame. @@ -2481,7 +2481,7 @@ By default, only the windows in the selected frame are considered. The optional argument WHICH-FRAMES changes this behavior: WHICH-FRAMES = `visible' means search windows on all visible frames. -WHICH-FRAMES = 0 means search windows on all visible and iconified frames. +WHICH-FRAMES = 0 means search windows on all visible and iconified frames. WHICH-FRAMES = t means search windows on all frames including invisible frames. WHICH-FRAMES = a frame means search only windows on that frame. Anything else means restrict to the selected frame. @@ -2536,7 +2536,6 @@ DELETE_OTHER_WINDOWS, /* Arg is window not to delete */ DELETE_BUFFER_WINDOWS, /* Arg is buffer */ GET_LARGEST_WINDOW, - UNSHOW_BUFFER, /* Arg is buffer */ GET_BUFFER_WINDOW_COUNT, /* Arg is buffer */ GET_BUFFER_MRU_WINDOW /* Arg is buffer */ }; @@ -2549,7 +2548,7 @@ int dedicated_too, Lisp_Object which_devices) { - /* This function can GC if type == DELETE_BUFFER_WINDOWS or UNSHOW_BUFFER */ + /* This function can GC if type == DELETE_BUFFER_WINDOWS */ Lisp_Object w; Lisp_Object best_window = Qnil; Lisp_Object next_window; @@ -2621,7 +2620,6 @@ for (;;) { struct window *p = XWINDOW (w); - struct frame *w_frame = XFRAME (WINDOW_FRAME (p)); /* Pick the next window now, since some operations will delete the current window. */ @@ -2771,57 +2769,6 @@ break; } - case UNSHOW_BUFFER: - { - if (EQ (p->buffer, obj)) - { - /* Find another buffer to show in this window. */ - Lisp_Object another_buffer = - Fother_buffer (obj, Qnil, Qnil); - if (NILP (another_buffer)) - another_buffer - = Fget_buffer_create (QSscratch); - /* If this window is dedicated, and in a frame - of its own, kill the frame. */ - if (EQ (w, FRAME_ROOT_WINDOW (w_frame)) - && !NILP (p->dedicated) - && other_visible_frames (w_frame)) - { - /* Skip the other windows on this frame. - There might be one, the minibuffer! */ - if (! EQ (w, last_window)) - while (w_frame == XFRAME (WINDOW_FRAME - (XWINDOW (next_window)))) - { - /* As we go, check for the end of the - loop. We mustn't start going - around a second time. */ - if (EQ (next_window, last_window)) - { - last_window = w; - break; - } - next_window = Fnext_window (next_window, - mini ? Qt : Qnil, - frame_arg, Qt); - } - /* Now we can safely delete the frame. */ - delete_frame_internal (XFRAME (WINDOW_FRAME (p)), - 0, 0, 0); - } - else - { - /* Otherwise show a different buffer in the - window. */ - p->dedicated = Qnil; - Fset_window_buffer (w, another_buffer, Qnil); - if (EQ (w, Fselected_window (Qnil))) - Fset_buffer (p->buffer); - } - } - break; - } - default: abort (); } @@ -3099,6 +3046,63 @@ return Qnil; } +static Lisp_Object +list_windows (struct window *w, Lisp_Object value) +{ + for (;;) + { + if (!NILP (w->hchild)) + value = list_windows (XWINDOW (w->hchild), value); + else if (!NILP (w->vchild)) + value = list_windows (XWINDOW (w->vchild), value); + else + { + Lisp_Object window; + XSETWINDOW (window, w); + value = Fcons (window, value); + } + if (NILP (w->next)) + break; + w = XWINDOW (w->next); + } + return value; +} + +static Lisp_Object +list_all_windows (Lisp_Object frame_spec, Lisp_Object device_spec) +{ + Lisp_Object devcons, concons; + Lisp_Object retval = Qnil; + + DEVICE_LOOP_NO_BREAK (devcons, concons) + { + Lisp_Object frame_list, the_window; + Lisp_Object device, tail; + + device = XCAR (devcons); + frame_list = DEVICE_FRAME_LIST (XDEVICE (device)); + + LIST_LOOP (tail, frame_list) + { + if ((NILP (frame_spec) + && !EQ (XCAR (tail), DEVICE_SELECTED_FRAME (XDEVICE (device)))) + || (EQ (frame_spec, Qvisible) + && !FRAME_VISIBLE_P (XFRAME (XCAR (tail)))) + || (FRAMEP (frame_spec) + && !EQ (frame_spec, XCAR (tail))) + || (!NILP (frame_spec) + && !device_matches_device_spec (device, + NILP (device_spec) ? + Vselected_console : + device_spec))) + continue; + the_window = FRAME_ROOT_WINDOW (XFRAME (XCAR (tail))); + retval = list_windows (XWINDOW (the_window), retval); + } + } + return Fnreverse (retval); +} + DEFUN ("replace-buffer-in-windows", Freplace_buffer_in_windows, 1, 3, "bReplace buffer in windows: ", /* Replace BUFFER with some other buffer in all windows showing it. @@ -3124,18 +3128,46 @@ (buffer, which_frames, which_devices)) { /* This function can GC */ - buffer = Fget_buffer (buffer); - CHECK_BUFFER (buffer); - - /* WHICH-FRAMES values t and nil mean the opposite of what - window_loop expects. */ + Lisp_Object window_list; + Lisp_Object tail; + struct gcpro gcpro1, gcpro2; + if (EQ (which_frames, Qnil)) which_frames = Qt; else if (EQ (which_frames, Qt)) which_frames = Qnil; - - /* Ignore dedicated windows. */ - window_loop (UNSHOW_BUFFER, buffer, 0, which_frames, 0, which_devices); + window_list = list_all_windows (which_frames, which_devices); + + buffer = Fget_buffer (buffer); + CHECK_BUFFER (buffer); + + GCPRO2 (window_list, buffer); + LIST_LOOP (tail, window_list) + { + Lisp_Object window = XCAR (tail); + if (!MINI_WINDOW_P (XWINDOW (window)) + && EQ (XWINDOW (window)->buffer, buffer)) + { + Lisp_Object another_buffer = Fother_buffer (buffer, Qnil, Qnil); + Lisp_Object frame = WINDOW_FRAME (XWINDOW (window)); + if (NILP (another_buffer)) + another_buffer = Fget_buffer_create (QSscratch); + if (!NILP (XWINDOW (window)->dedicated) + && EQ (window, + FRAME_ROOT_WINDOW (XFRAME (frame))) + && other_visible_frames (XFRAME (frame))) + { + delete_frame_internal (XFRAME (frame), 0, 0, 0); /* GC */ + } + else + { + Fset_window_buffer (window, another_buffer, Qnil); + if (EQ (window, Fselected_window (Qnil))) + Fset_buffer (XWINDOW (window)->buffer); + } + } + } + UNGCPRO; return Qnil; } @@ -3352,6 +3384,7 @@ { Lisp_Object tem; struct window *w = decode_window (window); + int old_buffer_local_face_property = 0; buffer = Fget_buffer (buffer); CHECK_BUFFER (buffer); @@ -3383,6 +3416,8 @@ error ("Window is dedicated to buffer %s", XSTRING_DATA (XBUFFER (tem)->name)); + old_buffer_local_face_property = + XBUFFER (w->buffer)->buffer_local_face_property; unshow_buffer (w); } @@ -3404,6 +3439,14 @@ SET_LAST_MODIFIED (w, 1); SET_LAST_FACECHANGE (w); MARK_WINDOWS_CHANGED (w); + { + int new_buffer_local_face_property = + XBUFFER (w->buffer)->buffer_local_face_property; + + if (new_buffer_local_face_property + || new_buffer_local_face_property != old_buffer_local_face_property) + MARK_WINDOW_FACES_CHANGED (w); + } recompute_all_cached_specifiers_in_window (w); if (EQ (window, Fselected_window (Qnil))) { @@ -3649,7 +3692,12 @@ || NILP (XWINDOW (o->parent)->vchild)) { make_dummy_parent (window); +#if 0 + /* #### I can't understand why you have to reset face + cachels here. This can cause crash so let's disable it + and see the difference. See redisplay-tests.el --yh */ reset_face_cachels (XWINDOW (window)); +#endif new = o->parent; XWINDOW (new)->vchild = window; XFRAME (o->frame)->mirror_dirty = 1; @@ -3666,7 +3714,10 @@ || NILP (XWINDOW (o->parent)->hchild)) { make_dummy_parent (window); +#if 0 + /* #### See above. */ reset_face_cachels (XWINDOW (window)); +#endif new = o->parent; XWINDOW (new)->hchild = window; XFRAME (o->frame)->mirror_dirty = 1; diff -r 4fc5f13f3bd3 -r 3078fd1074e8 src/window.h --- a/src/window.h Mon Aug 13 11:37:23 2007 +0200 +++ b/src/window.h Mon Aug 13 11:38:25 2007 +0200 @@ -300,6 +300,13 @@ windows_changed = 1; \ } while (0) +/* #### This should be fixed not to call MARK_FRAME_CHANGED because + faces are cached per window. Also, other code which changes window's + face should use this macro. +*/ +#define MARK_WINDOW_FACES_CHANGED(w) \ + MARK_FRAME_FACES_CHANGED (XFRAME ((w)->frame)) + #define WINDOW_TTY_P(w) FRAME_TTY_P (XFRAME ((w)->frame)) #define WINDOW_X_P(w) FRAME_X_P (XFRAME ((w)->frame)) #define WINDOW_NS_P(w) FRAME_NS_P (XFRAME ((w)->frame)) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 tests/ChangeLog --- a/tests/ChangeLog Mon Aug 13 11:37:23 2007 +0200 +++ b/tests/ChangeLog Mon Aug 13 11:38:25 2007 +0200 @@ -1,3 +1,30 @@ +2000-12-31 Martin Buchholz + + * XEmacs 21.2.39 is released. + +2000-12-28 Martin Buchholz + + * automated/lisp-tests.el: + Avoid triggering Solaris printf buffer overflow from (format). + +2000-12-04 Yoshiki Hayashi + + * redisplay-tests.el: New file. + +2000-12-12 Martin Buchholz + + * automated/lisp-tests.el: Add/Change (format) tests. + +2000-12-04 Yoshiki Hayashi + + * automated/lisp-test.el: Test if all-completions ignore + elements start with space. + +2000-12-04 Yoshiki Hayashi + + * automated/regexp-tests.el: Test unmatched search doesn't + alter match-string. + 2000-12-05 Martin Buchholz * XEmacs 21.2.38 is released. diff -r 4fc5f13f3bd3 -r 3078fd1074e8 tests/automated/lisp-tests.el --- a/tests/automated/lisp-tests.el Mon Aug 13 11:37:23 2007 +0200 +++ b/tests/automated/lisp-tests.el Mon Aug 13 11:38:25 2007 +0200 @@ -998,6 +998,10 @@ (Assert (string= (format "%e" 100) "1.000000e+02")) (Assert (string= (format "%E" 100) "1.000000E+02")) (Assert (string= (format "%f" 100) "100.000000")) +(Assert (string= (format "%7.3f" 12.12345) " 12.123")) +(Assert (string= (format "%07.3f" 12.12345) "012.123")) +(Assert (string= (format "%-7.3f" 12.12345) "12.123 ")) +(Assert (string= (format "%-07.3f" 12.12345) "12.123 ")) (Assert (string= (format "%g" 100.0) "100")) (Assert (string= (format "%g" 0.000001) "1e-06")) (Assert (string= (format "%g" 0.0001) "0.0001")) @@ -1039,7 +1043,7 @@ (Assert (string= (format "%.1d" 10) "10")) (Assert (string= (format "%.4d" 10) "0010")) ;; Combination of `-', `+', ` ', `0', `#', `.', `*' -(Assert (string= (format "%-04d" 10) "0010")) +(Assert (string= (format "%-04d" 10) "10 ")) (Assert (string= (format "%-*d" 4 10) "10 ")) ;; #### Correctness of this behavior is questionable. ;; It might be better to signal error. @@ -1052,11 +1056,16 @@ ;; (format "%-.1d" 10) (Assert (string= (format "%01.1d" 10) "10")) -(Assert (string= (format "%03.1d" 10) "010")) -(Assert (string= (format "%01.3d" 10) "10")) -(Assert (string= (format "%1.3d" 10) "10")) +(Assert (string= (format "%03.1d" 10) " 10")) +(Assert (string= (format "%01.3d" 10) "010")) +(Assert (string= (format "%1.3d" 10) "010")) (Assert (string= (format "%3.1d" 10) " 10")) +;;; The following two tests used to use 1000 instead of 100, +;;; but that merely found buffer overflow bugs in Solaris sprintf(). +(Assert (= 102 (length (format "%.100f" 3.14)))) +(Assert (= 100 (length (format "%100f" 3.14)))) + ;;; Check for 64-bit cleanness on LP64 platforms. (Assert (= (read (format "%d" most-positive-fixnum)) most-positive-fixnum)) (Assert (= (read (format "%ld" most-positive-fixnum)) most-positive-fixnum)) @@ -1071,3 +1080,7 @@ ;;; The printed value might be useful to a human, if not to Emacs Lisp. (Check-Error invalid-read-syntax (read (format "%u" most-negative-fixnum))) (Check-Error invalid-read-syntax (read (format "%u" -1))) + +;; Check all-completions ignore element start with space. +(Assert (not (all-completions "" '((" hidden" . "object"))))) +(Assert (all-completions " " '((" hidden" . "object")))) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 tests/automated/regexp-tests.el --- a/tests/automated/regexp-tests.el Mon Aug 13 11:37:23 2007 +0200 +++ b/tests/automated/regexp-tests.el Mon Aug 13 11:38:25 2007 +0200 @@ -204,3 +204,12 @@ (setq i (1+ i)))))) ;; (test-regex-charset-mule-paranoid) + +;; Test replace-match +(with-temp-buffer + (insert "This is a test buffer.") + (goto-char (point-min)) + (search-forward "this is a test ") + (looking-at "Unmatchable text") + (replace-match "") + (Assert (looking-at "^buffer.$"))) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 tests/redisplay-tests.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/redisplay-tests.el Mon Aug 13 11:38:25 2007 +0200 @@ -0,0 +1,42 @@ +;; Copyright (C) 2000 Free Software Foundation, Inc. + +;; Author: Yoshiki Hayashi +;; Maintainer: Yoshiki Hayashi +;; Created: 2000 +;; Keywords: tests + +;; 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. + +;;; Commentary: + +;; Redisplay related tests. + +;; This used to crash XEmacs. +(when (featurep 'mule) + (let ((buffer (generate-new-buffer "*split test*"))) + (set-window-buffer (selected-window) buffer) + (split-window-vertically) + (insert (make-char 'japanese-jisx0208 36 44)) + (backward-char) + (redraw-frame) + (delete-other-windows) + (split-window) + (kill-buffer buffer) + (delete-other-windows))) diff -r 4fc5f13f3bd3 -r 3078fd1074e8 version.sh --- a/version.sh Mon Aug 13 11:37:23 2007 +0200 +++ b/version.sh Mon Aug 13 11:38:25 2007 +0200 @@ -2,8 +2,8 @@ emacs_is_beta=t emacs_major_version=21 emacs_minor_version=2 -emacs_beta_version=38 -xemacs_codename="Peisino,Ak(B" +emacs_beta_version=39 +xemacs_codename="Millennium" infodock_major_version=4 infodock_minor_version=0 infodock_build_version=8