Mercurial > hg > xemacs-beta
changeset 2367:ecf1ebac70d8
[xemacs-hg @ 2004-11-04 23:05:23 by ben]
commit mega-patch
configure.in: Turn off -Winline and -Wchar-subscripts.
Use the right set of cflags when compiling modules.
Rewrite ldap configuration to separate the inclusion of lber
(needed in recent Cygwin) from the basic checks for the
needed libraries.
add a function for MAKE_JUNK_C; initially code was added to
generate xemacs.def using this, but it will need to be rewritten.
add an rm -f for junk.c to avoid weird Cygwin bug with cp -f onto
an existing file.
Sort list of auto-detected functions and eliminate unused checks for
stpcpy, setlocale and getwd.
Add autodetection of Cygwin scanf problems
BETA: Rewrite section on configure to indicate what flags are important
and what not.
digest-doc.c, make-dump-id.c, profile.c, sorted-doc.c: Add proper decls for main().
make-msgfile.c: Document that this is old junk.
Move proposal to text.c.
make-msgfile.lex: Move proposal to text.c.
make-mswin-unicode.pl: Convert error-generating code so that the entire message will
be seen as a single unrecognized token.
mule/mule-ccl.el: Update docs.
lispref/mule.texi: Update CCL docs.
ldap/eldap.c: Mule-ize.
Use EXTERNAL_LIST_LOOP_2 instead of deleted EXTERNAL_LIST_LOOP.
* XEmacs 21.5.18 "chestnut" is released.
---------------------------------------------------------------
MULE-RELATED WORK:
---------------------------------------------------------------
---------------------------
byte-char conversion
---------------------------
buffer.c, buffer.h, insdel.c, text.c: Port FSF algorithm for byte-char conversion, replacing broken
previous version. Track the char position of the gap. Add
functions to do char-byte conversion downwards as well as upwards.
Move comments about algorithm workings to internals manual.
---------------------------
work on types
---------------------------
alloc.c, console-x-impl.h, dump-data.c, dump-data.h, dumper.c, dialog-msw.c, dired-msw.c, doc.c, editfns.c, esd.c, event-gtk.h, event-msw.c, events.c, file-coding.c, file-coding.h, fns.c, glyphs-eimage.c, glyphs-gtk.c, glyphs-msw.c, glyphs-shared.c, glyphs-x.c, glyphs.c, glyphs.h, gui.c, hpplay.c, imgproc.c, intl-win32.c, lrecord.h, lstream.c, keymap.c, lisp.h, libsst.c, linuxplay.c, miscplay.c, miscplay.h, mule-coding.c, nas.c, nt.c, ntheap.c, ntplay.c, objects-msw.c, objects-tty.c, objects-x.c, print.c, process-nt.c, process.c, redisplay.h, select-common.h, select-gtk.c, select-x.c, sgiplay.c, sound.c, sound.h, sunplay.c, sysfile.h, sysdep.c, syswindows.h, text.c, unexnt.c, win32.c, xgccache.c: Further work on types. This creates a full set of types for all
the basic semantics of `char' that I have so far identified, so that
its semantics can always be identified for the purposes of proper
Mule-safe code, and the raw use of `char' always avoided.
(1) More type renaming, for consistency of naming.
Char_ASCII -> Ascbyte
UChar_ASCII -> UAscbyte
Char_Binary -> CBinbyte
UChar_Binary -> Binbyte
SChar_Binary -> SBinbyte
(2) Introduce Rawbyte, CRawbyte, Boolbyte, Chbyte, UChbyte, and
Bitbyte and use them.
(3) New types Itext, Wexttext and Textcount for separating out
the concepts of bytes and textual units (different under UTF-16
and UTF-32, which are potential internal encodings).
(4) qxestr*_c -> qxestr*_ascii.
lisp.h: New; goes with other qxe() functions. #### Maybe goes in a
different section.
lisp.h: Group generic int-type defs together with EMACS_INT defs.
lisp.h: * lisp.h (WEXTTEXT_IS_WIDE)
New defns.
lisp.h: New type to replace places where int occurs as a boolean.
It's signed because occasionally people may want to use -1 as
an error value, and because unsigned ints are viral -- see comments
in the internals manual against using them.
dynarr.c: int -> Bytecount.
---------------------------
Mule-izing
---------------------------
device-x.c: Partially Mule-ize.
dumper.c, dumper.h: Mule-ize. Use Rawbyte. Use stderr_out not printf. Use wext_*().
sysdep.c, syswindows.h, text.c: New Wexttext API for manipulation of external text that may be
Unicode (e.g. startup code under Windows).
emacs.c: Mule-ize. Properly deal with argv in external encoding.
Use wext_*() and Wexttext. Use Rawbyte.
#if 0 some old junk on SCO that is unlikely to be correct.
Rewrite allocation code in run-temacs.
emacs.c, symsinit.h, win32.c: Rename win32 init function and call it even earlier, to
initialize mswindows_9x_p even earlier, for use in startup code
(XEUNICODE_P).
process.c: Use _wenviron not environ under Windows, to get Unicode environment
variables.
event-Xt.c: Mule-ize drag-n-drop related stuff.
dragdrop.c, dragdrop.h, frame-x.c: Mule-ize.
text.h: Add some more stand-in defines for particular kinds of conversion;
use in Mule-ization work in frame-x.c etc.
---------------------------
Freshening
---------------------------
intl-auto-encap-win32.c, intl-auto-encap-win32.h: Regenerate.
---------------------------
Unicode-work
---------------------------
intl-win32.c, syswindows.h: Factor out common options to MultiByteToWideChar and
WideCharToMultiByte. Add convert_unicode_to_multibyte_malloc()
and convert_unicode_to_multibyte_dynarr() and use. Add stuff for
alloca() conversion of multibyte/unicode.
alloc.c: Use dfc_external_data_len() in case of unicode coding system.
alloc.c, mule-charset.c: Don't zero out and reinit charset Unicode tables. This fucks up
dump-time loading. Anyway, either we load them at dump time or
run time, never both.
unicode.c: Dump the blank tables as well.
---------------------------------------------------------------
DOCUMENTATION, MOSTLY MULE-RELATED:
---------------------------------------------------------------
EmacsFrame.c, emodules.c, event-Xt.c, fileio.c, input-method-xlib.c, mule-wnnfns.c, redisplay-gtk.c, redisplay-tty.c, redisplay-x.c, regex.c, sysdep.c: Add comment about Mule work needed.
text.h: Add more documentation describing why DFC routines were not written
to return their value. Add some other DFC documentation.
console-msw.c, console-msw.h: Add pointer to docs in win32.c.
emacs.c: Add comments on sources of doc info.
text.c, charset.h, unicode.c, intl-win32.c, intl-encap-win32.c, text.h, file-coding.c, mule-coding.c: Collect background comments and related to text matters and
internationalization, and proposals for work to be done, in text.c
or Internals manual, stuff related to specific textual API's in
text.h, and stuff related to internal implementation of Unicode
conversion in unicode.c. Put lots of pointers to the comments to
make them easier to find.
s/mingw32.h, s/win32-common.h, s/win32-native.h, s/windowsnt.h, win32.c: Add bunches of new documentation on the different kinds of
builds and environments under Windows and how they work.
Collect this info in win32.c. Add pointers to these docs in
the relevant s/* files.
emacs.c: Document places with long comments.
Remove comment about exiting, move to internals manual, put
in pointer.
event-stream.c: Move docs about event queues and focus to internals manual, put
in pointer.
events.h: Move docs about event stream callbacks to internals manual, put
in pointer.
profile.c, redisplay.c, signal.c: Move documentation to the Internals manual.
process-nt.c: Add pointer to comment in win32-native.el.
lisp.h: Add comments about some comment conventions.
lisp.h: Add comment about the second argument.
device-msw.c, redisplay-msw.c: @@#### comments are out-of-date.
---------------------------------------------------------------
PDUMP WORK (MOTIVATED BY UNICODE CHANGES)
---------------------------------------------------------------
alloc.c, buffer.c, bytecode.c, console-impl.h, console.c, device.c, dumper.c, lrecord.h, elhash.c, emodules.h, events.c, extents.c, frame.c, glyphs.c, glyphs.h, mule-charset.c, mule-coding.c, objects.c, profile.c, rangetab.c, redisplay.c, specifier.c, specifier.h, window.c, lstream.c, file-coding.h, file-coding.c: PDUMP:
Properly implement dump_add_root_block(), which never worked before,
and is necessary for dumping Unicode tables.
Pdump name changes for accuracy:
XD_STRUCT_PTR -> XD_BLOCK_PTR.
XD_STRUCT_ARRAY -> XD_BLOCK_ARRAY.
XD_C_STRING -> XD_ASCII_STRING.
*_structure_* -> *_block_*.
lrecord.h: some comments added about
dump_add_root_block() vs dump_add_root_block_ptr().
extents.c: remove incorrect comment about pdump problems with gap array.
---------------------------------------------------------------
ALLOCATION
---------------------------------------------------------------
abbrev.c, alloc.c, bytecode.c, casefiddle.c, device-msw.c, device-x.c, dired-msw.c, doc.c, doprnt.c, dragdrop.c, editfns.c, emodules.c, file-coding.c, fileio.c, filelock.c, fns.c, glyphs-eimage.c, glyphs-gtk.c, glyphs-msw.c, glyphs-x.c, gui-msw.c, gui-x.c, imgproc.c, intl-win32.c, lread.c, menubar-gtk.c, menubar.c, nt.c, objects-msw.c, objects-x.c, print.c, process-nt.c, process-unix.c, process.c, realpath.c, redisplay.c, search.c, select-common.c, symbols.c, sysdep.c, syswindows.h, text.c, text.h, ui-byhand.c: New macros {alloca,xnew}_{itext,{i,ext,raw,bin,asc}bytes} for
more convenient allocation of these commonly requested items.
Modify functions to use alloca_ibytes, alloca_array, alloca_extbytes,
xnew_ibytes, etc. also XREALLOC_ARRAY, xnew.
alloc.c: Rewrite the allocation functions to factor out repeated code.
Add assertions for freeing dumped data.
lisp.h: Moved down and consolidated with other allocation stuff.
lisp.h, dynarr.c: New functions for allocation that's very efficient when mostly in
LIFO order.
lisp.h, text.c, text.h: Factor out some stuff for general use by alloca()-conversion funs.
text.h, lisp.h: Fill out convenience routines for allocating various kinds of
bytes and put them in lisp.h. Use them in place of xmalloc(),
ALLOCA().
text.h: Fill out the convenience functions so the _MALLOC() kinds match
the alloca() kinds.
---------------------------------------------------------------
ERROR-CHECKING
---------------------------------------------------------------
text.h: Create ASSERT_ASCTEXT_ASCII() and ASSERT_ASCTEXT_ASCII_LEN()
from similar Eistring checkers and change the Eistring checkers to
use them instead.
---------------------------------------------------------------
MACROS IN LISP.H
---------------------------------------------------------------
lisp.h: Redo GCPRO declarations. Create a "base" set of functions that can
be used to generate any kind of gcpro sets -- regular, ngcpro,
nngcpro, private ones used in GC_EXTERNAL_LIST_LOOP_2.
buffer.c, callint.c, chartab.c, console-msw.c, device-x.c, dialog-msw.c, dired.c, extents.c, ui-gtk.c, rangetab.c, nt.c, mule-coding.c, minibuf.c, menubar-msw.c, menubar.c, menubar-gtk.c, lread.c, lisp.h, gutter.c, glyphs.c, glyphs-widget.c, fns.c, fileio.c, file-coding.c, specifier.c: Eliminate EXTERNAL_LIST_LOOP, which does not check for circularities.
Use EXTERNAL_LIST_LOOP_2 instead or EXTERNAL_LIST_LOOP_3
or EXTERNAL_PROPERTY_LIST_LOOP_3 or GC_EXTERNAL_LIST_LOOP_2
(new macro). Removed/redid comments on EXTERNAL_LIST_LOOP.
---------------------------------------------------------------
SPACING FIXES
---------------------------------------------------------------
callint.c, hftctl.c, number-gmp.c, process-unix.c: Spacing fixes.
---------------------------------------------------------------
FIX FOR GEOMETRY PROBLEM IN FIRST FRAME
---------------------------------------------------------------
unicode.c: Add workaround for newlib bug in sscanf() [should be fixed by
release 1.5.12 of Cygwin].
toolbar.c: bug fix for problem of initial frame being 77 chars wide on Windows.
will be overridden by my other ws.
---------------------------------------------------------------
FIX FOR LEAKING PROCESS HANDLES:
---------------------------------------------------------------
process-nt.c: Fixes for leaking handles. Inspired by work done by Adrian Aichner
<adrian@xemacs.org>.
---------------------------------------------------------------
FIX FOR CYGWIN BUG (Unicode-related):
---------------------------------------------------------------
unicode.c: Add workaround for newlib bug in sscanf() [should be fixed by
release 1.5.12 of Cygwin].
---------------------------------------------------------------
WARNING FIXES:
---------------------------------------------------------------
console-stream.c: `reinit' is unused.
compiler.h, event-msw.c, frame-msw.c, intl-encap-win32.c, text.h: Add stuff to deal with ANSI-aliasing warnings I got.
regex.c: Gather includes together to avoid warning.
---------------------------------------------------------------
CHANGES TO INITIALIZATION ROUTINES:
---------------------------------------------------------------
buffer.c, emacs.c, console.c, debug.c, device-x.c, device.c, dragdrop.c, emodules.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-tty.c, events.c, extents.c, faces.c, file-coding.c, fileio.c, font-lock.c, frame-msw.c, glyphs-widget.c, glyphs.c, gui-x.c, insdel.c, lread.c, lstream.c, menubar-gtk.c, menubar-x.c, minibuf.c, mule-wnnfns.c, objects-msw.c, objects.c, print.c, scrollbar-x.c, search.c, select-x.c, text.c, undo.c, unicode.c, window.c, symsinit.h: Call reinit_*() functions directly from emacs.c, for clarity.
Factor out some redundant init code. Move disallowed stuff
that had crept into vars_of_glyphs() into complex_vars_of_glyphs().
Call init_eval_semi_early() from eval.c not in the middle of
vars_of_() in emacs.c since there should be no order dependency
in the latter calls.
---------------------------------------------------------------
ARMAGEDDON:
---------------------------------------------------------------
alloc.c, emacs.c, lisp.h, print.c: Rename inhibit_non_essential_printing_operations to
inhibit_non_essential_conversion_operations.
text.c: Assert on !inhibit_non_essential_conversion_operations.
console-msw.c, print.c: Don't do conversion in SetConsoleTitle or FindWindow to avoid
problems during armageddon. Put #errors for NON_ASCII_INTERNAL_FORMAT
in places where problems would arise.
---------------------------------------------------------------
CHANGES TO THE BUILD PROCEDURE:
---------------------------------------------------------------
config.h.in, s/cxux.h, s/usg5-4-2.h, m/powerpc.h: Add comment about correct ordering of this file.
Rearrange everything to follow this -- put all #undefs together
and before the s&m files. Add undefs for HAVE_ALLOCA, C_ALLOCA,
BROKEN_ALLOCA_IN_FUNCTION_CALLS, STACK_DIRECTION. Remove unused
HAVE_STPCPY, HAVE_GETWD, HAVE_SETLOCALE.
m/gec63.h: Deleted; totally broken, not used at all, not in FSF.
m/7300.h, m/acorn.h, m/alliant-2800.h, m/alliant.h, m/altos.h, m/amdahl.h, m/apollo.h, m/att3b.h, m/aviion.h, m/celerity.h, m/clipper.h, m/cnvrgnt.h, m/convex.h, m/cydra5.h, m/delta.h, m/delta88k.h, m/dpx2.h, m/elxsi.h, m/ews4800r.h, m/gould.h, m/hp300bsd.h, m/hp800.h, m/hp9000s300.h, m/i860.h, m/ibmps2-aix.h, m/ibmrs6000.h, m/ibmrt-aix.h, m/ibmrt.h, m/intel386.h, m/iris4d.h, m/iris5d.h, m/iris6d.h, m/irist.h, m/isi-ov.h, m/luna88k.h, m/m68k.h, m/masscomp.h, m/mg1.h, m/mips-nec.h, m/mips-siemens.h, m/mips.h, m/news.h, m/nh3000.h, m/nh4000.h, m/ns32000.h, m/orion105.h, m/pfa50.h, m/plexus.h, m/pmax.h, m/powerpc.h, m/pyrmips.h, m/sequent-ptx.h, m/sequent.h, m/sgi-challenge.h, m/symmetry.h, m/tad68k.h, m/tahoe.h, m/targon31.h, m/tekxd88.h, m/template.h, m/tower32.h, m/tower32v3.h, m/ustation.h, m/vax.h, m/wicat.h, m/xps100.h: Delete C_ALLOCA, HAVE_ALLOCA, STACK_DIRECTION,
BROKEN_ALLOCA_IN_FUNCTION_CALLS. All of this is auto-detected.
When in doubt, I followed recent FSF sources, which also have
these things deleted.
line wrap: on
line diff
--- a/ChangeLog Thu Nov 04 22:51:31 2004 +0000 +++ b/ChangeLog Thu Nov 04 23:08:28 2004 +0000 @@ -1,3 +1,21 @@ +2004-10-26 Ben Wing <ben@xemacs.org> + + * configure.in (AC_INIT_NOTICE): + * configure.in (TAB): + * configure.in (XE_COMPUTE_RUNPATH): + Turn off -Winline and -Wchar-subscripts. + Use the right set of cflags when compiling modules. + Rewrite ldap configuration to separate the inclusion of lber + (needed in recent Cygwin) from the basic checks for the + needed libraries. + add a function for MAKE_JUNK_C; initially code was added to + generate xemacs.def using this, but it will need to be rewritten. + add an rm -f for junk.c to avoid weird Cygwin bug with cp -f onto + an existing file. + Sort list of auto-detected functions and eliminate unused checks for + stpcpy, setlocale and getwd. + Add autodetection of Cygwin scanf problems + 2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.18 "chestnut" is released.
--- a/configure Thu Nov 04 22:51:31 2004 +0000 +++ b/configure Thu Nov 04 23:08:28 2004 +0000 @@ -6,7 +6,7 @@ #### Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois. #### Copyright (C) 1996, 1997 Sun Microsystems, Inc. -#### Copyright (C) 1995, 1996, 2002, 2003 Ben Wing. +#### Copyright (C) 1995, 1996, 2002, 2003, 2004 Ben Wing. #### Copyright (C) 2000, 2001 Martin Buchholz. #### Copyright (C) 1998, 1999 J. Kean Johnston. @@ -2927,9 +2927,9 @@ elif test "$CC" = "xlc"; then cflags_warning="-qinfo" elif test "$GCC" = "yes"; then - cflags_warning="-Wall -Wno-switch -Winline -Wmissing-prototypes" - - cflags_warning="$cflags_warning -Wsign-compare" + cflags_warning="-Wall -Wno-switch -Wmissing-prototypes" + + cflags_warning="$cflags_warning -Wsign-compare -Wno-char-subscripts" cflags_warning="$cflags_warning -Wundef -Wstrict-prototypes" test "$__GCC3" = "yes" && cflags_warning="$cflags_warning -Wpacked" test "$have_glibc" != "yes" && \ @@ -4781,7 +4781,6 @@ #line 4782 "configure" #include "confdefs.h" #include <stdio.h> -#include <sys/types.h> main() { FILE *f=fopen("conftestval", "w"); @@ -4790,7 +4789,7 @@ exit(0); } EOF -if { (eval echo configure:4794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_short=`cat conftestval` else @@ -4818,13 +4817,12 @@ exit 1 fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:4822: checking size of int" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4825 "configure" +echo "configure:4821: checking size of int" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4824 "configure" #include "confdefs.h" #include <stdio.h> -#include <sys/types.h> main() { FILE *f=fopen("conftestval", "w"); @@ -4833,7 +4831,7 @@ exit(0); } EOF -if { (eval echo configure:4837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_int=`cat conftestval` else @@ -4855,13 +4853,12 @@ echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:4859: checking size of long" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4862 "configure" +echo "configure:4857: checking size of long" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4860 "configure" #include "confdefs.h" #include <stdio.h> -#include <sys/types.h> main() { FILE *f=fopen("conftestval", "w"); @@ -4870,7 +4867,7 @@ exit(0); } EOF -if { (eval echo configure:4874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_long=`cat conftestval` else @@ -4892,13 +4889,12 @@ echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:4896: checking size of long long" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4899 "configure" +echo "configure:4893: checking size of long long" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4896 "configure" #include "confdefs.h" #include <stdio.h> -#include <sys/types.h> main() { FILE *f=fopen("conftestval", "w"); @@ -4907,7 +4903,7 @@ exit(0); } EOF -if { (eval echo configure:4911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_long_long=`cat conftestval` else @@ -4929,13 +4925,12 @@ echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:4933: checking size of void *" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4936 "configure" +echo "configure:4929: checking size of void *" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4932 "configure" #include "confdefs.h" #include <stdio.h> -#include <sys/types.h> main() { FILE *f=fopen("conftestval", "w"); @@ -4944,7 +4939,7 @@ exit(0); } EOF -if { (eval echo configure:4948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_void_p=`cat conftestval` else @@ -4966,13 +4961,12 @@ echo $ac_n "checking size of double""... $ac_c" 1>&6 -echo "configure:4970: checking size of double" >&5 - -cat > conftest.$ac_ext <<EOF -#line 4973 "configure" +echo "configure:4965: checking size of double" >&5 + +cat > conftest.$ac_ext <<EOF +#line 4968 "configure" #include "confdefs.h" #include <stdio.h> -#include <sys/types.h> main() { FILE *f=fopen("conftestval", "w"); @@ -4981,7 +4975,7 @@ exit(0); } EOF -if { (eval echo configure:4985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:4979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_sizeof_double=`cat conftestval` else @@ -5004,7 +4998,7 @@ echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:5008: checking for long file names" >&5 +echo "configure:5002: checking for long file names" >&5 ac_cv_sys_long_file_names=yes # Test for long file names in all the places we know might matter: @@ -5050,10 +5044,10 @@ echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:5054: checking for sin" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5057 "configure" +echo "configure:5048: checking for sin" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5051 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sin(); below. */ @@ -5076,7 +5070,7 @@ ; return 0; } EOF -if { (eval echo configure:5080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sin=yes" else @@ -5094,12 +5088,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:5098: checking for sin in -lm" >&5 +echo "configure:5092: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` xe_check_libs=" -lm " cat > conftest.$ac_ext <<EOF -#line 5103 "configure" +#line 5097 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5110,7 +5104,7 @@ sin() ; return 0; } EOF -if { (eval echo configure:5114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5108: \"$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 @@ -5145,14 +5139,14 @@ cat > conftest.$ac_ext <<EOF -#line 5149 "configure" +#line 5143 "configure" #include "confdefs.h" #include <math.h> int main() { return atanh(1.0) + asinh(1.0) + acosh(1.0); ; return 0; } EOF -if { (eval echo configure:5156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_INVERSE_HYPERBOLIC @@ -5171,10 +5165,10 @@ for ac_func in mkstemp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5175: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5178 "configure" +echo "configure:5169: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5172 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5197,7 +5191,7 @@ ; return 0; } EOF -if { (eval echo configure:5201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5195: \"$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 @@ -5226,14 +5220,14 @@ echo "checking type of mail spool file locking" 1>&6 -echo "configure:5230: checking type of mail spool file locking" >&5 +echo "configure:5224: checking type of mail spool file locking" >&5 for ac_func in lockf flock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5234: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5237 "configure" +echo "configure:5228: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5231 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5256,7 +5250,7 @@ ; return 0; } EOF -if { (eval echo configure:5260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5254: \"$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 @@ -5338,12 +5332,12 @@ case "$opsys" in decosf*) echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:5342: checking for cma_open in -lpthreads" >&5 +echo "configure:5336: checking for cma_open in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lpthreads " cat > conftest.$ac_ext <<EOF -#line 5347 "configure" +#line 5341 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5354,7 +5348,7 @@ cma_open() ; return 0; } EOF -if { (eval echo configure:5358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5352: \"$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 @@ -5391,7 +5385,7 @@ echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6 -echo "configure:5395: checking whether the -xildoff compiler flag is required" >&5 +echo "configure:5389: checking whether the -xildoff compiler flag is required" >&5 if ${CC-cc} '-###' -xildon no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then echo "$ac_t""no" 1>&6; @@ -5403,7 +5397,7 @@ if test "$opsys" = "sol2"; then if test "$os_release" -ge 506; then echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6 -echo "configure:5407: checking for \"-z ignore\" linker flag" >&5 +echo "configure:5401: checking for \"-z ignore\" linker flag" >&5 case "`ld -h 2>&1`" in *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6 ld_switch_site="-z ignore $ld_switch_site" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-z ignore\" to \$ld_switch_site"; fi ;; @@ -5414,7 +5408,7 @@ echo "checking "for specified window system"" 1>&6 -echo "configure:5418: checking "for specified window system"" >&5 +echo "configure:5412: checking "for specified window system"" >&5 GNOME_CONFIG=no @@ -5422,7 +5416,7 @@ if test "$with_gnome" != "no"; then echo $ac_n "checking for GNOME configuration script""... $ac_c" 1>&6 -echo "configure:5426: checking for GNOME configuration script" >&5 +echo "configure:5420: checking for GNOME configuration script" >&5 for possible in gnome-config do possible_version=`${possible} --version 2> /dev/null` @@ -5453,7 +5447,7 @@ if test "$with_gtk" != "no";then echo $ac_n "checking for GTK configuration script""... $ac_c" 1>&6 -echo "configure:5457: checking for GTK configuration script" >&5 +echo "configure:5451: checking for GTK configuration script" >&5 for possible in gtk12-config gtk14-config gtk-config do possible_version=`${possible} --version 2> /dev/null` @@ -5475,18 +5469,18 @@ if test "${GTK_CONFIG}" != "no"; then echo $ac_n "checking gtk version""... $ac_c" 1>&6 -echo "configure:5479: checking gtk version" >&5 +echo "configure:5473: checking gtk version" >&5 GTK_VERSION=`${GTK_CONFIG} --version` echo "$ac_t""${GTK_VERSION}" 1>&6 echo $ac_n "checking gtk libs""... $ac_c" 1>&6 -echo "configure:5484: checking gtk libs" >&5 +echo "configure:5478: checking gtk libs" >&5 GTK_LIBS=`${GTK_CONFIG} --libs` libs_gtk="$libs_gtk ${GTK_LIBS}" && if test "$extra_verbose" = "yes"; then echo " Appending \"${GTK_LIBS}\" to \$libs_gtk"; fi echo "$ac_t""${GTK_LIBS}" 1>&6 echo $ac_n "checking gtk cflags""... $ac_c" 1>&6 -echo "configure:5490: checking gtk cflags" >&5 +echo "configure:5484: checking gtk cflags" >&5 GTK_CFLAGS=`${GTK_CONFIG} --cflags` if test "$GCC" = "yes"; then GTK_CFLAGS="${GTK_CFLAGS} -Wno-shadow" @@ -5496,19 +5490,19 @@ echo $ac_n "checking for main in -lgdk_imlib""... $ac_c" 1>&6 -echo "configure:5500: checking for main in -lgdk_imlib" >&5 +echo "configure:5494: checking for main in -lgdk_imlib" >&5 ac_lib_var=`echo gdk_imlib'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdk_imlib " cat > conftest.$ac_ext <<EOF -#line 5505 "configure" +#line 5499 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5506: \"$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 @@ -5530,12 +5524,12 @@ echo $ac_n "checking for Imlib_init in -lImlib""... $ac_c" 1>&6 -echo "configure:5534: checking for Imlib_init in -lImlib" >&5 +echo "configure:5528: checking for Imlib_init in -lImlib" >&5 ac_lib_var=`echo Imlib'_'Imlib_init | sed 'y%./+-%__p_%'` xe_check_libs=" -lImlib " cat > conftest.$ac_ext <<EOF -#line 5539 "configure" +#line 5533 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5546,7 +5540,7 @@ Imlib_init() ; return 0; } EOF -if { (eval echo configure:5550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5544: \"$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 @@ -5569,10 +5563,10 @@ for ac_func in gdk_imlib_init do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5573: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5576 "configure" +echo "configure:5567: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5570 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5595,7 +5589,7 @@ ; return 0; } EOF -if { (eval echo configure:5599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5593: \"$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 @@ -5679,15 +5673,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5683: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 5686 "configure" +echo "configure:5677: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 5680 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5685: \"$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* @@ -5718,19 +5712,19 @@ echo $ac_n "checking for main in -lxml""... $ac_c" 1>&6 -echo "configure:5722: checking for main in -lxml" >&5 +echo "configure:5716: checking for main in -lxml" >&5 ac_lib_var=`echo xml'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lxml " cat > conftest.$ac_ext <<EOF -#line 5727 "configure" +#line 5721 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5728: \"$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 @@ -5752,19 +5746,19 @@ echo $ac_n "checking for main in -lglade""... $ac_c" 1>&6 -echo "configure:5756: checking for main in -lglade" >&5 +echo "configure:5750: checking for main in -lglade" >&5 ac_lib_var=`echo glade'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lglade " cat > conftest.$ac_ext <<EOF -#line 5761 "configure" +#line 5755 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5762: \"$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 @@ -5786,19 +5780,19 @@ echo $ac_n "checking for main in -lglade-gnome""... $ac_c" 1>&6 -echo "configure:5790: checking for main in -lglade-gnome" >&5 +echo "configure:5784: checking for main in -lglade-gnome" >&5 ac_lib_var=`echo glade-gnome'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lglade-gnome " cat > conftest.$ac_ext <<EOF -#line 5795 "configure" +#line 5789 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5796: \"$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 @@ -5819,7 +5813,7 @@ cat > conftest.$ac_ext <<EOF -#line 5823 "configure" +#line 5817 "configure" #include "confdefs.h" #include <glade/glade-xml.h> EOF @@ -5878,7 +5872,7 @@ # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:5882: checking for X" >&5 +echo "configure:5876: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -5938,12 +5932,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF -#line 5942 "configure" +#line 5936 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5941: \"$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* @@ -6012,14 +6006,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF -#line 6016 "configure" +#line 6010 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF -if { (eval echo configure:6023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -6128,17 +6122,17 @@ case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:6132: checking whether -R must be followed by a space" >&5 +echo "configure:6126: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <<EOF -#line 6135 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:6142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +#line 6129 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:6136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -6154,14 +6148,14 @@ else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <<EOF -#line 6158 "configure" -#include "confdefs.h" - -int main() { - -; return 0; } -EOF -if { (eval echo configure:6165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +#line 6152 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:6159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -6197,12 +6191,12 @@ else echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:6201: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:6195: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet " cat > conftest.$ac_ext <<EOF -#line 6206 "configure" +#line 6200 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6213,7 +6207,7 @@ dnet_ntoa() ; return 0; } EOF -if { (eval echo configure:6217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6211: \"$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 @@ -6237,12 +6231,12 @@ if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:6241: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:6235: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` xe_check_libs=" -ldnet_stub " cat > conftest.$ac_ext <<EOF -#line 6246 "configure" +#line 6240 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6253,7 +6247,7 @@ dnet_ntoa() ; return 0; } EOF -if { (eval echo configure:6257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6251: \"$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 @@ -6282,10 +6276,10 @@ # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:6286: checking for gethostbyname" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6289 "configure" +echo "configure:6280: checking for gethostbyname" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6283 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname(); below. */ @@ -6308,7 +6302,7 @@ ; return 0; } EOF -if { (eval echo configure:6312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -6329,12 +6323,12 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:6333: checking for gethostbyname in -lnsl" >&5 +echo "configure:6327: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` xe_check_libs=" -lnsl " cat > conftest.$ac_ext <<EOF -#line 6338 "configure" +#line 6332 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6345,7 +6339,7 @@ gethostbyname() ; return 0; } EOF -if { (eval echo configure:6349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6343: \"$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 @@ -6375,10 +6369,10 @@ # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:6379: checking for connect" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6382 "configure" +echo "configure:6373: checking for connect" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6376 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect(); below. */ @@ -6401,7 +6395,7 @@ ; return 0; } EOF -if { (eval echo configure:6405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -6424,12 +6418,12 @@ xe_msg_checking="for connect in -lsocket" test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6428: checking "$xe_msg_checking"" >&5 +echo "configure:6422: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocket $X_EXTRA_LIBS" cat > conftest.$ac_ext <<EOF -#line 6433 "configure" +#line 6427 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6440,7 +6434,7 @@ connect() ; return 0; } EOF -if { (eval echo configure:6444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6438: \"$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 @@ -6464,10 +6458,10 @@ # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:6468: checking for remove" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6471 "configure" +echo "configure:6462: checking for remove" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6465 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove(); below. */ @@ -6490,7 +6484,7 @@ ; return 0; } EOF -if { (eval echo configure:6494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -6511,12 +6505,12 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:6515: checking for remove in -lposix" >&5 +echo "configure:6509: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` xe_check_libs=" -lposix " cat > conftest.$ac_ext <<EOF -#line 6520 "configure" +#line 6514 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6527,7 +6521,7 @@ remove() ; return 0; } EOF -if { (eval echo configure:6531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6525: \"$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 @@ -6551,10 +6545,10 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:6555: checking for shmat" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6558 "configure" +echo "configure:6549: checking for shmat" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6552 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat(); below. */ @@ -6577,7 +6571,7 @@ ; return 0; } EOF -if { (eval echo configure:6581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -6598,12 +6592,12 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:6602: checking for shmat in -lipc" >&5 +echo "configure:6596: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` xe_check_libs=" -lipc " cat > conftest.$ac_ext <<EOF -#line 6607 "configure" +#line 6601 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6614,7 +6608,7 @@ shmat() ; return 0; } EOF -if { (eval echo configure:6618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6612: \"$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 @@ -6650,12 +6644,12 @@ xe_msg_checking="for IceConnectionNumber in -lICE" test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:6654: checking "$xe_msg_checking"" >&5 +echo "configure:6648: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` xe_check_libs=" -lICE $X_EXTRA_LIBS" cat > conftest.$ac_ext <<EOF -#line 6659 "configure" +#line 6653 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6666,7 +6660,7 @@ IceConnectionNumber() ; return 0; } EOF -if { (eval echo configure:6670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6664: \"$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 @@ -6712,15 +6706,15 @@ ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:6716: checking for Xm/Xm.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6719 "configure" +echo "configure:6710: checking for Xm/Xm.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6713 "configure" #include "confdefs.h" #include <Xm/Xm.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6718: \"$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* @@ -6737,12 +6731,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:6741: checking for XmStringFree in -lXm" >&5 +echo "configure:6735: checking for XmStringFree in -lXm" >&5 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <<EOF -#line 6746 "configure" +#line 6740 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -6753,7 +6747,7 @@ XmStringFree() ; return 0; } EOF -if { (eval echo configure:6757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6751: \"$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 @@ -6905,7 +6899,7 @@ echo "checking for X defines extracted by xmkmf" 1>&6 -echo "configure:6909: checking for X defines extracted by xmkmf" >&5 +echo "configure:6903: checking for X defines extracted by xmkmf" >&5 rm -fr conftestdir if mkdir conftestdir; then cd conftestdir @@ -6954,15 +6948,15 @@ ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6 -echo "configure:6958: checking for X11/Intrinsic.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 6961 "configure" +echo "configure:6952: checking for X11/Intrinsic.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 6955 "configure" #include "confdefs.h" #include <X11/Intrinsic.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6960: \"$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* @@ -6986,12 +6980,12 @@ echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:6990: checking for XOpenDisplay in -lX11" >&5 +echo "configure:6984: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <<EOF -#line 6995 "configure" +#line 6989 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7002,7 +6996,7 @@ XOpenDisplay() ; return 0; } EOF -if { (eval echo configure:7006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7000: \"$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 @@ -7027,12 +7021,12 @@ xe_msg_checking="for XGetFontProperty in -lX11" test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:7031: checking "$xe_msg_checking"" >&5 +echo "configure:7025: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 -b i486-linuxaout" cat > conftest.$ac_ext <<EOF -#line 7036 "configure" +#line 7030 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7043,7 +7037,7 @@ XGetFontProperty() ; return 0; } EOF -if { (eval echo configure:7047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7041: \"$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 @@ -7070,12 +7064,12 @@ echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6 -echo "configure:7074: checking for XShapeSelectInput in -lXext" >&5 +echo "configure:7068: checking for XShapeSelectInput in -lXext" >&5 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'` xe_check_libs=" -lXext " cat > conftest.$ac_ext <<EOF -#line 7079 "configure" +#line 7073 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7086,7 +7080,7 @@ XShapeSelectInput() ; return 0; } EOF -if { (eval echo configure:7090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7084: \"$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 @@ -7109,12 +7103,12 @@ echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6 -echo "configure:7113: checking for XtOpenDisplay in -lXt" >&5 +echo "configure:7107: checking for XtOpenDisplay in -lXt" >&5 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'` xe_check_libs=" -lXt " cat > conftest.$ac_ext <<EOF -#line 7118 "configure" +#line 7112 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7125,7 +7119,7 @@ XtOpenDisplay() ; return 0; } EOF -if { (eval echo configure:7129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7123: \"$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 @@ -7148,14 +7142,14 @@ echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6 -echo "configure:7152: checking the version of X11 being used" >&5 +echo "configure:7146: checking the version of X11 being used" >&5 cat > conftest.$ac_ext <<EOF -#line 7154 "configure" +#line 7148 "configure" #include "confdefs.h" #include <X11/Intrinsic.h> int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; } EOF -if { (eval echo configure:7159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:7153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ./conftest foobar; x11_release=$? else @@ -7186,10 +7180,10 @@ for ac_func in XConvertCase do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7190: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7193 "configure" +echo "configure:7184: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7187 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7212,7 +7206,7 @@ ; return 0; } EOF -if { (eval echo configure:7216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7210: \"$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 @@ -7244,15 +7238,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7248: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7251 "configure" +echo "configure:7242: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7245 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7250: \"$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* @@ -7285,10 +7279,10 @@ for ac_func in XRegisterIMInstantiateCallback do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7289: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7292 "configure" +echo "configure:7283: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7286 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7311,7 +7305,7 @@ ; return 0; } EOF -if { (eval echo configure:7315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7309: \"$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 @@ -7339,9 +7333,9 @@ done echo $ac_n "checking for standard XRegisterIMInstantiateCallback prototype""... $ac_c" 1>&6 -echo "configure:7343: checking for standard XRegisterIMInstantiateCallback prototype" >&5 +echo "configure:7337: checking for standard XRegisterIMInstantiateCallback prototype" >&5 cat > conftest.$ac_ext <<EOF -#line 7345 "configure" +#line 7339 "configure" #include "confdefs.h" #define NeedFunctionPrototypes 1 @@ -7353,7 +7347,7 @@ ; return 0; } EOF -if { (eval echo configure:7357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -7374,12 +7368,12 @@ test -z "$with_xmu" && { echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6 -echo "configure:7378: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 +echo "configure:7372: checking for XmuReadBitmapDataFromFile in -lXmu" >&5 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'` xe_check_libs=" -lXmu " cat > conftest.$ac_ext <<EOF -#line 7383 "configure" +#line 7377 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7390,7 +7384,7 @@ XmuReadBitmapDataFromFile() ; return 0; } EOF -if { (eval echo configure:7394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7388: \"$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 @@ -7429,19 +7423,19 @@ echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:7433: checking for main in -lXbsd" >&5 +echo "configure:7427: checking for main in -lXbsd" >&5 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lXbsd " cat > conftest.$ac_ext <<EOF -#line 7438 "configure" +#line 7432 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:7445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7439: \"$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 @@ -7478,22 +7472,22 @@ fi if test "$with_msw" != "no"; then echo "checking for MS-Windows" 1>&6 -echo "configure:7482: checking for MS-Windows" >&5 +echo "configure:7476: checking for MS-Windows" >&5 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6 -echo "configure:7485: checking for main in -lgdi32" >&5 +echo "configure:7479: checking for main in -lgdi32" >&5 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdi32 " cat > conftest.$ac_ext <<EOF -#line 7490 "configure" +#line 7484 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:7497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7491: \"$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 @@ -7544,12 +7538,12 @@ test "$with_widgets" != "no" && with_widgets=msw fi cat > conftest.$ac_ext <<EOF -#line 7548 "configure" +#line 7542 "configure" #include "confdefs.h" #include <fcntl.h> int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; } EOF -if { (eval echo configure:7553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:7547: \"$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 @@ -7610,15 +7604,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:7614: checking for X11/extensions/shape.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7617 "configure" +echo "configure:7608: checking for X11/extensions/shape.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7611 "configure" #include "confdefs.h" #include <X11/extensions/shape.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7616: \"$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* @@ -7668,7 +7662,7 @@ esac echo "checking for WM_COMMAND option" 1>&6 -echo "configure:7672: checking for WM_COMMAND option" >&5; +echo "configure:7666: checking for WM_COMMAND option" >&5; if test "$with_wmcommand" != "no"; then { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_WMCOMMAND @@ -7683,15 +7677,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:7687: checking for X11/Xauth.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7690 "configure" +echo "configure:7681: checking for X11/Xauth.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7684 "configure" #include "confdefs.h" #include <X11/Xauth.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7689: \"$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* @@ -7714,12 +7708,12 @@ } test -z "$with_xauth" && { echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6 -echo "configure:7718: checking for XauGetAuthByAddr in -lXau" >&5 +echo "configure:7712: checking for XauGetAuthByAddr in -lXau" >&5 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'` xe_check_libs=" -lXau " cat > conftest.$ac_ext <<EOF -#line 7723 "configure" +#line 7717 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7730,7 +7724,7 @@ XauGetAuthByAddr() ; return 0; } EOF -if { (eval echo configure:7734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7728: \"$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 @@ -7781,7 +7775,7 @@ if test "$with_modules" != "no"; then echo "checking for module support" 1>&6 -echo "configure:7785: checking for module support" >&5 +echo "configure:7779: checking for module support" >&5 case "$opsys" in mingw* | cygwin* ) have_dl=yes ;; @@ -7798,15 +7792,15 @@ * ) ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:7802: checking for dlfcn.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7805 "configure" +echo "configure:7796: checking for dlfcn.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7799 "configure" #include "confdefs.h" #include <dlfcn.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7804: \"$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* @@ -7823,16 +7817,16 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 -echo "configure:7827: checking for dlopen in -lc" >&5 +echo "configure:7821: checking for dlopen in -lc" >&5 cat > conftest.$ac_ext <<EOF -#line 7829 "configure" +#line 7823 "configure" #include "confdefs.h" #include <dlfcn.h> int main() { dlopen ("", 0); ; return 0; } EOF -if { (eval echo configure:7836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -7841,18 +7835,18 @@ rm -rf conftest* echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:7845: checking for dlopen in -ldl" >&5 +echo "configure:7839: checking for dlopen in -ldl" >&5 ac_save_LIBS="$LIBS" LIBS="$LIBS -ldl" cat > conftest.$ac_ext <<EOF -#line 7849 "configure" +#line 7843 "configure" #include "confdefs.h" #include <dlfcn.h> int main() { dlopen ("", 0); ; return 0; } EOF -if { (eval echo configure:7856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -7861,17 +7855,17 @@ rm -rf conftest* echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 -echo "configure:7865: checking for dlopen in -lsvld" >&5 +echo "configure:7859: checking for dlopen in -lsvld" >&5 LIBS="$ac_save_LIBS -lsvld" cat > conftest.$ac_ext <<EOF -#line 7868 "configure" +#line 7862 "configure" #include "confdefs.h" #include <dlfcn.h> int main() { dlopen ("", 0); ; return 0; } EOF -if { (eval echo configure:7875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -7901,15 +7895,15 @@ else ac_safe=`echo "dl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dl.h""... $ac_c" 1>&6 -echo "configure:7905: checking for dl.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7908 "configure" +echo "configure:7899: checking for dl.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7902 "configure" #include "confdefs.h" #include <dl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7907: \"$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* @@ -7926,16 +7920,16 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for shl_load in -lc""... $ac_c" 1>&6 -echo "configure:7930: checking for shl_load in -lc" >&5 +echo "configure:7924: checking for shl_load in -lc" >&5 cat > conftest.$ac_ext <<EOF -#line 7932 "configure" +#line 7926 "configure" #include "confdefs.h" #include <dl.h> int main() { shl_load ("", 0, 0); ; return 0; } EOF -if { (eval echo configure:7939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -7944,18 +7938,18 @@ rm -rf conftest* echo $ac_n "checking for shl_load in -ldl""... $ac_c" 1>&6 -echo "configure:7948: checking for shl_load in -ldl" >&5 +echo "configure:7942: checking for shl_load in -ldl" >&5 ac_save_LIBS="$LIBS" LIBS="$LIBS -ldld" cat > conftest.$ac_ext <<EOF -#line 7952 "configure" +#line 7946 "configure" #include "confdefs.h" #include <dl.h> int main() { shl_load ("", 0, 0); ; return 0; } EOF -if { (eval echo configure:7959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -7983,15 +7977,15 @@ else ac_safe=`echo "ltdl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ltdl.h""... $ac_c" 1>&6 -echo "configure:7987: checking for ltdl.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 7990 "configure" +echo "configure:7981: checking for ltdl.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 7984 "configure" #include "confdefs.h" #include <ltdl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7995: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7989: \"$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* @@ -8008,18 +8002,18 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6 -echo "configure:8012: checking for lt_dlinit in -lltdl" >&5 +echo "configure:8006: checking for lt_dlinit in -lltdl" >&5 ac_save_LIBS="$LIBS" LIBS="$LIBS -lltdl" cat > conftest.$ac_ext <<EOF -#line 8016 "configure" +#line 8010 "configure" #include "confdefs.h" #include <ltdl.h> int main() { lt_dlinit (); ; return 0; } EOF -if { (eval echo configure:8023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -8060,7 +8054,7 @@ xealias=$internal_configuration echo "checking how to build dynamic libraries for ${xehost}" 1>&6 -echo "configure:8064: checking how to build dynamic libraries for ${xehost}" >&5 +echo "configure:8058: checking how to build dynamic libraries for ${xehost}" >&5 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts. case "$xehost" in *-*-linux-gnu*) ;; @@ -8088,9 +8082,9 @@ XEGCC=yes else echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:8092: checking checking whether we are using GNU C" >&5 +echo "configure:8086: checking checking whether we are using GNU C" >&5 cat > conftest.$ac_ext <<EOF -#line 8094 "configure" +#line 8088 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -8112,7 +8106,7 @@ fi echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6 -echo "configure:8116: checking how to produce PIC code" >&5 +echo "configure:8110: checking how to produce PIC code" >&5 wl= can_build_shared=yes @@ -8216,18 +8210,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:8220: checking if PIC flag ${dll_cflags} really works" >&5 +echo "configure:8214: checking if PIC flag ${dll_cflags} really works" >&5 save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $dll_cflags -DPIC" cat > conftest.$ac_ext <<EOF -#line 8224 "configure" +#line 8218 "configure" #include "confdefs.h" int main() { int x=0; ; return 0; } EOF -if { (eval echo configure:8231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8225: \"$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 @@ -8258,7 +8252,7 @@ xldf= xcldf= echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6 -echo "configure:8262: checking if C compiler can produce shared libraries" >&5 +echo "configure:8256: checking if C compiler can produce shared libraries" >&5 if test "$XEGCC" = yes -o "$__ICC" = yes; then case "$xehost_os" in *darwin*) @@ -8317,14 +8311,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 <<EOF -#line 8321 "configure" +#line 8315 "configure" #include "confdefs.h" int main() { int x=0; ; return 0; } EOF -if { (eval echo configure:8328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cc_produces_so=yes else @@ -8349,7 +8343,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:8353: checking for ld used by GCC" >&5 +echo "configure:8347: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -8375,7 +8369,7 @@ esac else echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:8379: checking for GNU ld" >&5 +echo "configure:8373: checking for GNU ld" >&5 fi if test -z "$LTLD"; then @@ -8413,7 +8407,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:8417: checking if the linker is GNU ld" >&5 +echo "configure:8411: 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 </dev/null | egrep '(GNU|with BFD)' 1>&5; then xe_gnu_ld=yes @@ -8448,7 +8442,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:8452: checking whether the linker supports shared libraries" >&5 +echo "configure:8446: checking whether the linker supports shared libraries" >&5 dll_ld=$CC dll_ldflags=$LDFLAGS ld_shlibs=yes @@ -8661,10 +8655,10 @@ for ac_func in dlerror _dlerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8665: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8668 "configure" +echo "configure:8659: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8662 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -8687,7 +8681,7 @@ ; return 0; } EOF -if { (eval echo configure:8691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8685: \"$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 @@ -8731,7 +8725,7 @@ fi if test "$with_modules" != "yes"; then MOD_CC="$XEMACS_CC" - MODCFLAGS="\$(CFLAGS) -I../../src -I\$(srcdir)/../../src" + MODCFLAGS="\$(XE_CFLAGS) -I../../src -I\$(srcdir)/../../src" INSTALLPATH="" MOD_INSTALL_PROGRAM="true" OBJECT_TO_BUILD="\$(MODNAME).o" @@ -8751,15 +8745,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:8755: checking for ${dir}tt_c.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8758 "configure" +echo "configure:8749: checking for ${dir}tt_c.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8752 "configure" #include "confdefs.h" #include <${dir}tt_c.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8757: \"$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* @@ -8795,12 +8789,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:8799: checking "$xe_msg_checking"" >&5 +echo "configure:8793: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'` xe_check_libs=" -ltt $extra_libs" cat > conftest.$ac_ext <<EOF -#line 8804 "configure" +#line 8798 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -8811,7 +8805,7 @@ tt_message_create() ; return 0; } EOF -if { (eval echo configure:8815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8809: \"$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 @@ -8865,15 +8859,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:8869: checking for Dt/Dt.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 8872 "configure" +echo "configure:8863: checking for Dt/Dt.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 8866 "configure" #include "confdefs.h" #include <Dt/Dt.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8871: \"$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* @@ -8896,12 +8890,12 @@ } test -z "$with_cde" && { echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6 -echo "configure:8900: checking for DtDndDragStart in -lDtSvc" >&5 +echo "configure:8894: checking for DtDndDragStart in -lDtSvc" >&5 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lDtSvc " cat > conftest.$ac_ext <<EOF -#line 8905 "configure" +#line 8899 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -8912,7 +8906,7 @@ DtDndDragStart() ; return 0; } EOF -if { (eval echo configure:8916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8910: \"$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 @@ -8993,7 +8987,7 @@ if test "$with_dragndrop" != "no" ; then echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6 -echo "configure:8997: checking if drag and drop API is needed" >&5 +echo "configure:8991: 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 @@ -9013,19 +9007,19 @@ fi echo "checking for LDAP" 1>&6 -echo "configure:9017: checking for LDAP" >&5 +echo "configure:9011: checking for LDAP" >&5 ldap_libs= 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:9021: checking for ldap.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9024 "configure" +echo "configure:9015: checking for ldap.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9018 "configure" #include "confdefs.h" #include <ldap.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9023: \"$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* @@ -9048,15 +9042,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:9052: checking for lber.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9055 "configure" +echo "configure:9046: checking for lber.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9049 "configure" #include "confdefs.h" #include <lber.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9054: \"$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* @@ -9080,12 +9074,12 @@ if test "$with_ldap" != "no"; then echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6 -echo "configure:9084: checking for ldap_search in -lldap" >&5 +echo "configure:9078: 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 <<EOF -#line 9089 "configure" +#line 9083 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9096,37 +9090,76 @@ ldap_search() ; return 0; } EOF -if { (eval echo configure:9100: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -xe_check_libs="" - -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then - echo "$ac_t""yes" 1>&6 - with_ldap_nolber=yes -else - echo "$ac_t""no" 1>&6 -with_ldap_nolber=no -fi - - - test "$with_ldap_nolber" = "no" && { +if { (eval echo configure:9094: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + with_ldap=yes +else + echo "$ac_t""no" 1>&6 +fi + + + test "$with_ldap" != "yes" && { 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:9125: checking "$xe_msg_checking"" >&5 +echo "configure:9118: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lldap -llber" cat > conftest.$ac_ext <<EOF -#line 9130 "configure" +#line 9123 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char ldap_open(); + +int main() { +ldap_open() +; return 0; } +EOF +if { (eval echo configure:9134: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + with_ldap=yes with_ldap_lber=yes +else + echo "$ac_t""no" 1>&6 +fi + + } + test "$with_ldap" != "yes" && { +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:9158: 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 <<EOF +#line 9163 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9137,7 +9170,85 @@ ldap_open() ; return 0; } EOF -if { (eval echo configure:9141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9174: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes +else + echo "$ac_t""no" 1>&6 +fi + + } + test "$with_ldap" != "yes" && { +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:9198: 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 <<EOF +#line 9203 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char ldap_open(); + +int main() { +ldap_open() +; return 0; } +EOF +if { (eval echo configure:9214: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +xe_check_libs="" + +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then + echo "$ac_t""yes" 1>&6 + with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes with_ldap_des=yes +else + echo "$ac_t""no" 1>&6 +fi + + } + test "$with_ldap_lber" != "yes" && { +echo $ac_n "checking for ber_pvt_opt_on in -llber""... $ac_c" 1>&6 +echo "configure:9236: checking for ber_pvt_opt_on in -llber" >&5 +ac_lib_var=`echo lber'_'ber_pvt_opt_on | sed 'y%./+-%__p_%'` + +xe_check_libs=" -llber " +cat > conftest.$ac_ext <<EOF +#line 9241 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char ber_pvt_opt_on(); + +int main() { +ber_pvt_opt_on() +; return 0; } +EOF +if { (eval echo configure:9252: \"$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 @@ -9154,93 +9265,9 @@ with_ldap_lber=yes else echo "$ac_t""no" 1>&6 -with_ldap_lber=no fi } - test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { -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:9166: 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 <<EOF -#line 9171 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char ldap_open(); - -int main() { -ldap_open() -; return 0; } -EOF -if { (eval echo configure:9182: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -xe_check_libs="" - -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then - echo "$ac_t""yes" 1>&6 - with_ldap_krb=yes -else - echo "$ac_t""no" 1>&6 -with_ldap_krb=no -fi - - } - test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { -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:9207: 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 <<EOF -#line 9212 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char ldap_open(); - -int main() { -ldap_open() -; return 0; } -EOF -if { (eval echo configure:9223: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -xe_check_libs="" - -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then - echo "$ac_t""yes" 1>&6 - with_ldap_krbdes=yes -else - echo "$ac_t""no" 1>&6 -with_ldap_krbdes=no -fi - - } - test -z "$with_ldap" -a \( "$with_ldap_lber" = "yes" -o "$with_ldap_nolber" = "yes" -o "$with_ldap_krb" = "yes" -o "$with_ldap_krbdes" = "yes" \) && with_ldap=yes fi if test "$with_ldap" = "yes"; then { test "$extra_verbose" = "yes" && cat << \EOF @@ -9251,27 +9278,24 @@ EOF } - if test "$with_ldap_nolber" = "yes" ; then - ldap_libs="-lldap $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap\" to \$ldap_libs"; fi - else - if test "$with_ldap_krb" = "yes" ; then - ldap_libs="-lkrb $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lkrb\" to \$ldap_libs"; fi - fi - if test "$with_ldap_krbdes" = "yes" ; then - ldap_libs="-ldes $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ldes\" to \$ldap_libs"; fi - ldap_libs="-lkrb $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lkrb\" to \$ldap_libs"; fi - fi + if test "$with_ldap_des" = "yes" ; then + ldap_libs="-ldes $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-ldes\" to \$ldap_libs"; fi + fi + if test "$with_ldap_krb" = "yes" ; then + ldap_libs="-lkrb $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lkrb\" to \$ldap_libs"; fi + fi + if test "$with_ldap_lber" = "yes" ; then ldap_libs="-llber $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-llber\" to \$ldap_libs"; fi - ldap_libs="-lldap $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap\" to \$ldap_libs"; fi - fi + fi + ldap_libs="-lldap $ldap_libs" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lldap\" to \$ldap_libs"; fi save_LIBS="$LIBS" LIBS="$LIBS $ldap_libs" 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:9272: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9275 "configure" +echo "configure:9296: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9299 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -9294,7 +9318,7 @@ ; return 0; } EOF -if { (eval echo configure:9298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9322: \"$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 @@ -9333,20 +9357,20 @@ postgresql_libs= if test "$with_postgresql" != "no"; then echo "checking for PostgreSQL" 1>&6 -echo "configure:9337: checking for PostgreSQL" >&5 +echo "configure:9361: 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:9342: checking for ${header_dir}libpq-fe.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9345 "configure" +echo "configure:9366: checking for ${header_dir}libpq-fe.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9369 "configure" #include "confdefs.h" #include <${header_dir}libpq-fe.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9350: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9374: \"$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* @@ -9370,12 +9394,12 @@ test -n "$libpq_fe_h_file" && { echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6 -echo "configure:9374: checking for PQconnectdb in -lpq" >&5 +echo "configure:9398: checking for PQconnectdb in -lpq" >&5 ac_lib_var=`echo pq'_'PQconnectdb | sed 'y%./+-%__p_%'` xe_check_libs=" -lpq " cat > conftest.$ac_ext <<EOF -#line 9379 "configure" +#line 9403 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9386,7 +9410,7 @@ PQconnectdb() ; return 0; } EOF -if { (eval echo configure:9390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9414: \"$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 @@ -9419,12 +9443,12 @@ echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6 -echo "configure:9423: checking for PQconnectStart in -lpq" >&5 +echo "configure:9447: checking for PQconnectStart in -lpq" >&5 ac_lib_var=`echo pq'_'PQconnectStart | sed 'y%./+-%__p_%'` xe_check_libs=" -lpq " cat > conftest.$ac_ext <<EOF -#line 9428 "configure" +#line 9452 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9435,7 +9459,7 @@ PQconnectStart() ; return 0; } EOF -if { (eval echo configure:9439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9463: \"$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 @@ -9486,7 +9510,7 @@ if test "$window_system" != "none"; then echo "checking for graphics libraries" 1>&6 -echo "configure:9490: checking for graphics libraries" >&5 +echo "configure:9514: checking for graphics libraries" >&5 libpath_xpm= incpath_xpm= @@ -9512,10 +9536,10 @@ CFLAGS=""$incpath_xpm" $CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$incpath_xpm"\" to \$CFLAGS"; fi LDFLAGS=""$libpath_xpm" $LDFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$libpath_xpm"\" to \$LDFLAGS"; fi echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6 -echo "configure:9516: checking for Xpm - no older than 3.4f" >&5 +echo "configure:9540: checking for Xpm - no older than 3.4f" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext <<EOF -#line 9519 "configure" +#line 9543 "configure" #include "confdefs.h" #define XPM_NUMBERS #include <X11/xpm.h> @@ -9524,7 +9548,7 @@ XpmIncludeVersion != XpmLibraryVersion() ? 1 : XpmIncludeVersion < 30406 ? 2 : 0 ;} EOF -if { (eval echo configure:9528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:9552: \"$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 @@ -9568,17 +9592,17 @@ libs_x="-lXpm $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lXpm\" to \$libs_x"; fi CFLAGS=""$incpath_xpm" $CFLAGS" && if test "$extra_verbose" = "yes"; then echo " Prepending \""$incpath_xpm"\" to \$CFLAGS"; fi echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6 -echo "configure:9572: checking for \"FOR_MSW\" xpm" >&5 +echo "configure:9596: checking for \"FOR_MSW\" xpm" >&5 xe_check_libs=-lXpm cat > conftest.$ac_ext <<EOF -#line 9575 "configure" +#line 9599 "configure" #include "confdefs.h" int main() { XpmCreatePixmapFromData() ; return 0; } EOF -if { (eval echo configure:9582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* xpm_for_msw=no else @@ -9604,15 +9628,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:9608: checking for compface.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9611 "configure" +echo "configure:9632: checking for compface.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9635 "configure" #include "confdefs.h" #include <compface.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9616: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9640: \"$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* @@ -9635,12 +9659,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:9639: checking for UnGenFace in -lcompface" >&5 +echo "configure:9663: checking for UnGenFace in -lcompface" >&5 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` xe_check_libs=" -lcompface " cat > conftest.$ac_ext <<EOF -#line 9644 "configure" +#line 9668 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9651,7 +9675,7 @@ UnGenFace() ; return 0; } EOF -if { (eval echo configure:9655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9679: \"$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 @@ -9700,12 +9724,12 @@ if test "$with_png $with_tiff" != "no no"; then echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6 -echo "configure:9704: checking for inflate in -lc" >&5 +echo "configure:9728: checking for inflate in -lc" >&5 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lc " cat > conftest.$ac_ext <<EOF -#line 9709 "configure" +#line 9733 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9716,7 +9740,7 @@ inflate() ; return 0; } EOF -if { (eval echo configure:9720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9744: \"$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 @@ -9735,12 +9759,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 -echo "configure:9739: checking for inflate in -lz" >&5 +echo "configure:9763: checking for inflate in -lz" >&5 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lz " cat > conftest.$ac_ext <<EOF -#line 9744 "configure" +#line 9768 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9751,7 +9775,7 @@ inflate() ; return 0; } EOF -if { (eval echo configure:9755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9779: \"$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 @@ -9770,12 +9794,12 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6 -echo "configure:9774: checking for inflate in -lgz" >&5 +echo "configure:9798: checking for inflate in -lgz" >&5 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'` xe_check_libs=" -lgz " cat > conftest.$ac_ext <<EOF -#line 9779 "configure" +#line 9803 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9786,7 +9810,7 @@ inflate() ; return 0; } EOF -if { (eval echo configure:9790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9814: \"$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 @@ -9816,15 +9840,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:9820: checking for jpeglib.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9823 "configure" +echo "configure:9844: checking for jpeglib.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9847 "configure" #include "confdefs.h" #include <jpeglib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9852: \"$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* @@ -9847,12 +9871,12 @@ } test -z "$with_jpeg" && { echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6 -echo "configure:9851: checking for jpeg_destroy_decompress in -ljpeg" >&5 +echo "configure:9875: checking for jpeg_destroy_decompress in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'` xe_check_libs=" -ljpeg " cat > conftest.$ac_ext <<EOF -#line 9856 "configure" +#line 9880 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9863,7 +9887,7 @@ jpeg_destroy_decompress() ; return 0; } EOF -if { (eval echo configure:9867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9891: \"$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 @@ -9899,10 +9923,10 @@ png_problem="" test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6 -echo "configure:9903: checking for pow" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9906 "configure" +echo "configure:9927: checking for pow" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9930 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char pow(); below. */ @@ -9925,7 +9949,7 @@ ; return 0; } EOF -if { (eval echo configure:9929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9953: \"$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 @@ -9946,15 +9970,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:9950: checking for png.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 9953 "configure" +echo "configure:9974: checking for png.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 9977 "configure" #include "confdefs.h" #include <png.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9982: \"$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* @@ -9977,12 +10001,12 @@ } test -z "$with_png" && { echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:9981: checking for png_read_image in -lpng" >&5 +echo "configure:10005: 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 <<EOF -#line 9986 "configure" +#line 10010 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9993,7 +10017,7 @@ png_read_image() ; return 0; } EOF -if { (eval echo configure:9997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10021: \"$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 @@ -10016,10 +10040,10 @@ } if test -z "$with_png"; then echo $ac_n "checking for workable png version information""... $ac_c" 1>&6 -echo "configure:10020: checking for workable png version information" >&5 +echo "configure:10044: checking for workable png version information" >&5 xe_check_libs="-lpng -lz" cat > conftest.$ac_ext <<EOF -#line 10023 "configure" +#line 10047 "configure" #include "confdefs.h" #include <png.h> int main(int c, char **v) { @@ -10027,7 +10051,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:10031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:10055: \"$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 @@ -10070,15 +10094,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:10074: checking for tiffio.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10077 "configure" +echo "configure:10098: checking for tiffio.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10101 "configure" #include "confdefs.h" #include <tiffio.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10106: \"$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* @@ -10101,12 +10125,12 @@ } test -z "$with_tiff" && { echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6 -echo "configure:10105: checking for TIFFClientOpen in -ltiff" >&5 +echo "configure:10129: checking for TIFFClientOpen in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'` xe_check_libs=" -ltiff " cat > conftest.$ac_ext <<EOF -#line 10110 "configure" +#line 10134 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10117,7 +10141,7 @@ TIFFClientOpen() ; return 0; } EOF -if { (eval echo configure:10121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10145: \"$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 @@ -10156,15 +10180,15 @@ if test "$with_gtk" = "yes"; then 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:10160: checking for compface.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10163 "configure" +echo "configure:10184: checking for compface.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10187 "configure" #include "confdefs.h" #include <compface.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10192: \"$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* @@ -10187,12 +10211,12 @@ } test -z "$with_xface" && { echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6 -echo "configure:10191: checking for UnGenFace in -lcompface" >&5 +echo "configure:10215: checking for UnGenFace in -lcompface" >&5 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'` xe_check_libs=" -lcompface " cat > conftest.$ac_ext <<EOF -#line 10196 "configure" +#line 10220 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10203,7 +10227,7 @@ UnGenFace() ; return 0; } EOF -if { (eval echo configure:10207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10231: \"$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 @@ -10242,7 +10266,7 @@ if test "$with_x11" = "yes"; then echo "checking for X11 graphics libraries" 1>&6 -echo "configure:10246: checking for X11 graphics libraries" >&5 +echo "configure:10270: checking for X11 graphics libraries" >&5 fi case "$with_widgets" in @@ -10252,7 +10276,7 @@ if test "$with_x11" = "yes" -a "$detect_athena" = "yes" ; then echo "checking for the Athena widgets" 1>&6 -echo "configure:10256: checking for the Athena widgets" >&5 +echo "configure:10280: checking for the Athena widgets" >&5 case "$with_athena" in "xaw" | "") athena_variant=Xaw athena_3d=no ;; @@ -10266,12 +10290,12 @@ if test "$athena_3d" = "no"; then echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:10270: checking for XawScrollbarSetThumb in -l$athena_variant" >&5 +echo "configure:10294: 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 <<EOF -#line 10275 "configure" +#line 10299 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10282,7 +10306,7 @@ XawScrollbarSetThumb() ; return 0; } EOF -if { (eval echo configure:10286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10310: \"$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 @@ -10298,12 +10322,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:10302: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:10326: 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 <<EOF -#line 10307 "configure" +#line 10331 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10314,7 +10338,7 @@ threeDClassRec() ; return 0; } EOF -if { (eval echo configure:10318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10342: \"$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 @@ -10345,12 +10369,12 @@ else echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6 -echo "configure:10349: checking for threeDClassRec in -l$athena_variant" >&5 +echo "configure:10373: 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 <<EOF -#line 10354 "configure" +#line 10378 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10361,7 +10385,7 @@ threeDClassRec() ; return 0; } EOF -if { (eval echo configure:10365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10389: \"$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 @@ -10379,12 +10403,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6 -echo "configure:10383: checking for threeDClassRec in -lXaw" >&5 +echo "configure:10407: checking for threeDClassRec in -lXaw" >&5 ac_lib_var=`echo Xaw'_'threeDClassRec | sed 'y%./+-%__p_%'` xe_check_libs=" -lXaw " cat > conftest.$ac_ext <<EOF -#line 10388 "configure" +#line 10412 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10395,7 +10419,7 @@ threeDClassRec() ; return 0; } EOF -if { (eval echo configure:10399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10423: \"$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 @@ -10426,15 +10450,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:10430: checking for X11/Xaw/ThreeD.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10433 "configure" +echo "configure:10454: checking for X11/Xaw/ThreeD.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10457 "configure" #include "confdefs.h" #include <X11/Xaw/ThreeD.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10462: \"$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* @@ -10454,15 +10478,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:10458: checking for X11/Xaw/XawInit.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10461 "configure" +echo "configure:10482: checking for X11/Xaw/XawInit.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10485 "configure" #include "confdefs.h" #include <X11/Xaw/XawInit.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10466: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10490: \"$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* @@ -10488,15 +10512,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:10492: checking for X11/$athena_variant/XawInit.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10495 "configure" +echo "configure:10516: checking for X11/$athena_variant/XawInit.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10519 "configure" #include "confdefs.h" #include <X11/$athena_variant/XawInit.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10524: \"$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* @@ -10513,15 +10537,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:10517: checking for X11/$athena_variant/ThreeD.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10520 "configure" +echo "configure:10541: checking for X11/$athena_variant/ThreeD.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10544 "configure" #include "confdefs.h" #include <X11/$athena_variant/ThreeD.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10549: \"$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* @@ -10549,15 +10573,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:10553: checking for $athena_variant/XawInit.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10556 "configure" +echo "configure:10577: checking for $athena_variant/XawInit.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10580 "configure" #include "confdefs.h" #include <$athena_variant/XawInit.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10585: \"$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* @@ -10574,15 +10598,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:10578: checking for $athena_variant/ThreeD.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10581 "configure" +echo "configure:10602: checking for $athena_variant/ThreeD.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10605 "configure" #include "confdefs.h" #include <$athena_variant/ThreeD.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10610: \"$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* @@ -10611,15 +10635,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:10615: checking for X11/Xaw3d/XawInit.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10618 "configure" +echo "configure:10639: checking for X11/Xaw3d/XawInit.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10642 "configure" #include "confdefs.h" #include <X11/Xaw3d/XawInit.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10647: \"$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* @@ -10636,15 +10660,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:10640: checking for X11/Xaw3d/ThreeD.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10643 "configure" +echo "configure:10664: checking for X11/Xaw3d/ThreeD.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10667 "configure" #include "confdefs.h" #include <X11/Xaw3d/ThreeD.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10672: \"$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* @@ -10676,15 +10700,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:10680: checking for Xaw3d/XawInit.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10683 "configure" +echo "configure:10704: checking for Xaw3d/XawInit.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10707 "configure" #include "confdefs.h" #include <Xaw3d/XawInit.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10712: \"$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* @@ -10701,15 +10725,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:10705: checking for Xaw3d/ThreeD.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10708 "configure" +echo "configure:10729: checking for Xaw3d/ThreeD.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10732 "configure" #include "confdefs.h" #include <Xaw3d/ThreeD.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10713: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10737: \"$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* @@ -10741,15 +10765,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:10745: checking for X11/Xaw/ThreeD.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10748 "configure" +echo "configure:10769: checking for X11/Xaw/ThreeD.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10772 "configure" #include "confdefs.h" #include <X11/Xaw/ThreeD.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10777: \"$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* @@ -10788,15 +10812,15 @@ if test "$with_x11" = "yes"; then ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6 -echo "configure:10792: checking for Xm/Xm.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 10795 "configure" +echo "configure:10816: checking for Xm/Xm.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 10819 "configure" #include "confdefs.h" #include <Xm/Xm.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10824: \"$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* @@ -10813,12 +10837,12 @@ echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6 -echo "configure:10817: checking for XmStringFree in -lXm" >&5 +echo "configure:10841: checking for XmStringFree in -lXm" >&5 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <<EOF -#line 10822 "configure" +#line 10846 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -10829,7 +10853,7 @@ XmStringFree() ; return 0; } EOF -if { (eval echo configure:10833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10857: \"$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 @@ -10858,9 +10882,9 @@ if test "$have_motif" = "yes"; then echo $ac_n "checking for Lesstif""... $ac_c" 1>&6 -echo "configure:10862: checking for Lesstif" >&5 +echo "configure:10886: checking for Lesstif" >&5 cat > conftest.$ac_ext <<EOF -#line 10864 "configure" +#line 10888 "configure" #include "confdefs.h" #include <Xm/Xm.h> #ifdef LESSTIF_VERSION @@ -11233,7 +11257,7 @@ if test "$with_mule" = "yes" ; then echo "checking for Mule-related features" 1>&6 -echo "configure:11237: checking for Mule-related features" >&5 +echo "configure:11261: checking for Mule-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining MULE EOF @@ -11247,15 +11271,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11251: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 11254 "configure" +echo "configure:11275: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 11278 "configure" #include "confdefs.h" #include <$ac_hdr> 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:11283: \"$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* @@ -11286,12 +11310,12 @@ echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6 -echo "configure:11290: checking for strerror in -lintl" >&5 +echo "configure:11314: checking for strerror in -lintl" >&5 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'` xe_check_libs=" -lintl " cat > conftest.$ac_ext <<EOF -#line 11295 "configure" +#line 11319 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -11302,7 +11326,7 @@ strerror() ; return 0; } EOF -if { (eval echo configure:11306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11330: \"$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 @@ -11335,18 +11359,18 @@ echo "checking for Mule input methods" 1>&6 -echo "configure:11339: checking for Mule input methods" >&5 +echo "configure:11363: checking for Mule input methods" >&5 case "$with_xim" in "" | "yes" ) echo "checking for XIM" 1>&6 -echo "configure:11342: checking for XIM" >&5 +echo "configure:11366: checking for XIM" >&5 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6 -echo "configure:11345: checking for XOpenIM in -lX11" >&5 +echo "configure:11369: checking for XOpenIM in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <<EOF -#line 11350 "configure" +#line 11374 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -11357,7 +11381,7 @@ XOpenIM() ; return 0; } EOF -if { (eval echo configure:11361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11385: \"$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 @@ -11381,12 +11405,12 @@ if test "$have_motif $have_lesstif" = "yes no"; then echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6 -echo "configure:11385: checking for XmImMbLookupString in -lXm" >&5 +echo "configure:11409: checking for XmImMbLookupString in -lXm" >&5 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'` xe_check_libs=" -lXm " cat > conftest.$ac_ext <<EOF -#line 11390 "configure" +#line 11414 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -11397,7 +11421,7 @@ XmImMbLookupString() ; return 0; } EOF -if { (eval echo configure:11401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11425: \"$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 @@ -11462,15 +11486,15 @@ if test "$with_xfs" = "yes" ; then echo "checking for XFontSet" 1>&6 -echo "configure:11466: checking for XFontSet" >&5 +echo "configure:11490: checking for XFontSet" >&5 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6 -echo "configure:11469: checking for XmbDrawString in -lX11" >&5 +echo "configure:11493: checking for XmbDrawString in -lX11" >&5 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'` xe_check_libs=" -lX11 " cat > conftest.$ac_ext <<EOF -#line 11474 "configure" +#line 11498 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -11481,7 +11505,7 @@ XmbDrawString() ; return 0; } EOF -if { (eval echo configure:11485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11509: \"$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 @@ -11521,15 +11545,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:11525: checking for wnn/jllib.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 11528 "configure" +echo "configure:11549: checking for wnn/jllib.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 11552 "configure" #include "confdefs.h" #include <wnn/jllib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11557: \"$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* @@ -11552,15 +11576,15 @@ } test -z "$with_wnn" && { ac_safe=`echo "wnn/commonhd.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for wnn/commonhd.h""... $ac_c" 1>&6 -echo "configure:11556: checking for wnn/commonhd.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 11559 "configure" +echo "configure:11580: checking for wnn/commonhd.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 11583 "configure" #include "confdefs.h" #include <wnn/commonhd.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11588: \"$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* @@ -11585,10 +11609,10 @@ for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11589: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 11592 "configure" +echo "configure:11613: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 11616 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -11611,7 +11635,7 @@ ; return 0; } EOF -if { (eval echo configure:11615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11639: \"$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 @@ -11640,12 +11664,12 @@ test "$ac_cv_func_crypt" != "yes" && { echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:11644: checking for crypt in -lcrypt" >&5 +echo "configure:11668: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` xe_check_libs=" -lcrypt " cat > conftest.$ac_ext <<EOF -#line 11649 "configure" +#line 11673 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -11656,7 +11680,7 @@ crypt() ; return 0; } EOF -if { (eval echo configure:11660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11684: \"$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 @@ -11691,12 +11715,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:11695: checking for jl_dic_list_e in -lwnn" >&5 +echo "configure:11719: checking for jl_dic_list_e in -lwnn" >&5 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'` xe_check_libs=" -lwnn " cat > conftest.$ac_ext <<EOF -#line 11700 "configure" +#line 11724 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -11707,7 +11731,7 @@ jl_dic_list_e() ; return 0; } EOF -if { (eval echo configure:11711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11735: \"$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 @@ -11725,12 +11749,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:11729: checking for jl_dic_list_e in -lwnn4" >&5 +echo "configure:11753: 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 <<EOF -#line 11734 "configure" +#line 11758 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -11741,7 +11765,7 @@ jl_dic_list_e() ; return 0; } EOF -if { (eval echo configure:11745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11769: \"$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 @@ -11759,12 +11783,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:11763: checking for jl_dic_list_e in -lwnn6" >&5 +echo "configure:11787: 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 <<EOF -#line 11768 "configure" +#line 11792 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -11775,7 +11799,7 @@ jl_dic_list_e() ; return 0; } EOF -if { (eval echo configure:11779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11803: \"$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 @@ -11793,12 +11817,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:11797: checking for dic_list_e in -lwnn6_fromsrc" >&5 +echo "configure:11821: 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 <<EOF -#line 11802 "configure" +#line 11826 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -11809,7 +11833,7 @@ dic_list_e() ; return 0; } EOF -if { (eval echo configure:11813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11837: \"$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 @@ -11854,12 +11878,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:11858: checking for jl_fi_dic_list in -l$libwnn" >&5 +echo "configure:11882: 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 <<EOF -#line 11863 "configure" +#line 11887 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -11870,7 +11894,7 @@ jl_fi_dic_list() ; return 0; } EOF -if { (eval echo configure:11874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11898: \"$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 @@ -11905,15 +11929,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:11909: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 11912 "configure" +echo "configure:11933: checking for canna/jrkanji.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 11936 "configure" #include "confdefs.h" #include <canna/jrkanji.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11941: \"$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* @@ -11940,15 +11964,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:11944: checking for canna/jrkanji.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 11947 "configure" +echo "configure:11968: checking for canna/jrkanji.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 11971 "configure" #include "confdefs.h" #include <canna/jrkanji.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11952: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11976: \"$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* @@ -11976,15 +12000,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:11980: checking for canna/RK.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 11983 "configure" +echo "configure:12004: checking for canna/RK.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12007 "configure" #include "confdefs.h" #include <canna/RK.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12012: \"$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* @@ -12007,12 +12031,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6 -echo "configure:12011: checking for RkBgnBun in -lRKC" >&5 +echo "configure:12035: checking for RkBgnBun in -lRKC" >&5 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'` xe_check_libs=" -lRKC " cat > conftest.$ac_ext <<EOF -#line 12016 "configure" +#line 12040 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -12023,7 +12047,7 @@ RkBgnBun() ; return 0; } EOF -if { (eval echo configure:12027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12051: \"$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 @@ -12046,12 +12070,12 @@ } test -z "$with_canna" && { echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6 -echo "configure:12050: checking for jrKanjiControl in -lcanna" >&5 +echo "configure:12074: checking for jrKanjiControl in -lcanna" >&5 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'` xe_check_libs=" -lcanna " cat > conftest.$ac_ext <<EOF -#line 12055 "configure" +#line 12079 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -12062,7 +12086,7 @@ jrKanjiControl() ; return 0; } EOF -if { (eval echo configure:12066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12090: \"$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 @@ -12108,12 +12132,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:12112: checking for layout_object_getvalue in -li18n" >&5 +echo "configure:12136: checking for layout_object_getvalue in -li18n" >&5 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'` xe_check_libs=" -li18n " cat > conftest.$ac_ext <<EOF -#line 12117 "configure" +#line 12141 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -12124,7 +12148,7 @@ layout_object_getvalue() ; return 0; } EOF -if { (eval echo configure:12128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12152: \"$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 @@ -12208,13 +12232,13 @@ fi -for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize getrlimit gettimeofday getcwd getwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror strlwr strupr symlink tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask wcslen wcscmp vlimit +for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp fsync ftime ftruncate getaddrinfo gethostname getnameinfo getpagesize getrlimit gettimeofday getcwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setsid sigblock sighold sigprocmask snprintf strerror strlwr strupr symlink tzset ulimit umask usleep vlimit vsnprintf waitpid wcscmp wcslen do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12215: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12218 "configure" +echo "configure:12239: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12242 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -12237,7 +12261,7 @@ ; return 0; } EOF -if { (eval echo configure:12241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12265: \"$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 @@ -12278,10 +12302,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:12282: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12285 "configure" +echo "configure:12306: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12309 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -12304,7 +12328,7 @@ ; return 0; } EOF -if { (eval echo configure:12308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12332: \"$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 @@ -12333,10 +12357,10 @@ echo $ac_n "checking for openpty""... $ac_c" 1>&6 -echo "configure:12337: checking for openpty" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12340 "configure" +echo "configure:12361: checking for openpty" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12364 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char openpty(); below. */ @@ -12359,7 +12383,7 @@ ; return 0; } EOF -if { (eval echo configure:12363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12387: \"$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 @@ -12378,12 +12402,12 @@ echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6 -echo "configure:12382: checking for openpty in -lutil" >&5 +echo "configure:12406: checking for openpty in -lutil" >&5 ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'` xe_check_libs=" -lutil " cat > conftest.$ac_ext <<EOF -#line 12387 "configure" +#line 12411 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -12394,7 +12418,7 @@ openpty() ; return 0; } EOF -if { (eval echo configure:12398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12422: \"$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 @@ -12429,15 +12453,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12433: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12436 "configure" +echo "configure:12457: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12460 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12465: \"$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* @@ -12474,15 +12498,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12478: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12481 "configure" +echo "configure:12502: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12505 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12510: \"$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* @@ -12515,15 +12539,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12519: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12522 "configure" +echo "configure:12543: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12546 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12551: \"$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* @@ -12556,15 +12580,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12560: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12563 "configure" +echo "configure:12584: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12587 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12592: \"$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* @@ -12600,15 +12624,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12604: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12607 "configure" +echo "configure:12628: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12631 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12636: \"$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* @@ -12641,10 +12665,10 @@ for ac_func in isastream do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12645: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12648 "configure" +echo "configure:12669: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12672 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -12667,7 +12691,7 @@ ; return 0; } EOF -if { (eval echo configure:12671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12695: \"$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 @@ -12698,15 +12722,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12702: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12705 "configure" +echo "configure:12726: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12729 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12710: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12734: \"$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* @@ -12739,10 +12763,10 @@ for ac_func in getloadavg do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12743: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12746 "configure" +echo "configure:12767: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12770 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -12765,7 +12789,7 @@ ; return 0; } EOF -if { (eval echo configure:12769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12793: \"$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 @@ -12798,15 +12822,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12802: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12805 "configure" +echo "configure:12826: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12829 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12834: \"$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* @@ -12842,12 +12866,12 @@ echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6 -echo "configure:12846: checking for kstat_open in -lkstat" >&5 +echo "configure:12870: checking for kstat_open in -lkstat" >&5 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lkstat " cat > conftest.$ac_ext <<EOF -#line 12851 "configure" +#line 12875 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -12858,7 +12882,7 @@ kstat_open() ; return 0; } EOF -if { (eval echo configure:12862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12886: \"$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 @@ -12893,15 +12917,15 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12897: checking for $ac_hdr" >&5 - -cat > conftest.$ac_ext <<EOF -#line 12900 "configure" +echo "configure:12921: checking for $ac_hdr" >&5 + +cat > conftest.$ac_ext <<EOF +#line 12924 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12929: \"$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* @@ -12933,12 +12957,12 @@ echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6 -echo "configure:12937: checking for kvm_read in -lkvm" >&5 +echo "configure:12961: checking for kvm_read in -lkvm" >&5 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'` xe_check_libs=" -lkvm " cat > conftest.$ac_ext <<EOF -#line 12942 "configure" +#line 12966 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -12949,7 +12973,7 @@ kvm_read() ; return 0; } EOF -if { (eval echo configure:12953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12977: \"$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 @@ -12983,16 +13007,16 @@ fi echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:12987: checking whether netdb declares h_errno" >&5 -cat > conftest.$ac_ext <<EOF -#line 12989 "configure" +echo "configure:13011: checking whether netdb declares h_errno" >&5 +cat > conftest.$ac_ext <<EOF +#line 13013 "configure" #include "confdefs.h" #include <netdb.h> int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:12996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13020: \"$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 @@ -13012,16 +13036,16 @@ rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:13016: checking for sigsetjmp" >&5 -cat > conftest.$ac_ext <<EOF -#line 13018 "configure" +echo "configure:13040: checking for sigsetjmp" >&5 +cat > conftest.$ac_ext <<EOF +#line 13042 "configure" #include "confdefs.h" #include <setjmp.h> int main() { sigjmp_buf bar; sigsetjmp (bar, 0); ; return 0; } EOF -if { (eval echo configure:13025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13049: \"$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 @@ -13041,11 +13065,11 @@ rm -f conftest* echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:13045: checking whether localtime caches TZ" >&5 +echo "configure:13069: checking whether localtime caches TZ" >&5 if test "$ac_cv_func_tzset" = "yes"; then cat > conftest.$ac_ext <<EOF -#line 13049 "configure" +#line 13073 "configure" #include "confdefs.h" #include <time.h> #if STDC_HEADERS @@ -13080,7 +13104,7 @@ exit (0); } EOF -if { (eval echo configure:13084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then emacs_cv_localtime_cache=no else @@ -13110,9 +13134,9 @@ if test "$HAVE_TIMEVAL" = "yes"; then echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6 -echo "configure:13114: checking whether gettimeofday accepts one or two arguments" >&5 -cat > conftest.$ac_ext <<EOF -#line 13116 "configure" +echo "configure:13138: checking whether gettimeofday accepts one or two arguments" >&5 +cat > conftest.$ac_ext <<EOF +#line 13140 "configure" #include "confdefs.h" #ifdef TIME_WITH_SYS_TIME @@ -13133,7 +13157,7 @@ ; return 0; } EOF -if { (eval echo configure:13137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13161: \"$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 @@ -13155,19 +13179,19 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:13159: checking for inline" >&5 +echo "configure:13183: checking for inline" >&5 ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 13164 "configure" +#line 13188 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:13171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -13204,16 +13228,16 @@ fi echo $ac_n "checking for typeof""... $ac_c" 1>&6 -echo "configure:13208: checking for typeof" >&5 -cat > conftest.$ac_ext <<EOF -#line 13210 "configure" +echo "configure:13232: checking for typeof" >&5 +cat > conftest.$ac_ext <<EOF +#line 13234 "configure" #include "confdefs.h" int main() { int i; __typeof__(i) j; ; return 0; } EOF -if { (eval echo configure:13217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* typeofname="__typeof__" else @@ -13221,14 +13245,14 @@ cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 13225 "configure" +#line 13249 "configure" #include "confdefs.h" int main() { int i; typeof(i) j; ; return 0; } EOF -if { (eval echo configure:13232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* typeofname="typeof" else @@ -13257,17 +13281,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:13261: checking for working alloca.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 13264 "configure" +echo "configure:13285: checking for working alloca.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 13288 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:13271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13295: \"$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 @@ -13291,10 +13315,10 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:13295: checking for alloca" >&5 - -cat > conftest.$ac_ext <<EOF -#line 13298 "configure" +echo "configure:13319: checking for alloca" >&5 + +cat > conftest.$ac_ext <<EOF +#line 13322 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -13322,7 +13346,7 @@ char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:13326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13350: \"$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 @@ -13361,10 +13385,10 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:13365: checking whether alloca needs Cray hooks" >&5 - -cat > conftest.$ac_ext <<EOF -#line 13368 "configure" +echo "configure:13389: checking whether alloca needs Cray hooks" >&5 + +cat > conftest.$ac_ext <<EOF +#line 13392 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -13388,10 +13412,10 @@ if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13392: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 13395 "configure" +echo "configure:13416: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 13419 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -13414,7 +13438,7 @@ ; return 0; } EOF -if { (eval echo configure:13418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13442: \"$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 @@ -13444,10 +13468,10 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:13448: checking stack direction for C alloca" >&5 - -cat > conftest.$ac_ext <<EOF -#line 13451 "configure" +echo "configure:13472: checking stack direction for C alloca" >&5 + +cat > conftest.$ac_ext <<EOF +#line 13475 "configure" #include "confdefs.h" find_stack_direction () { @@ -13466,7 +13490,7 @@ exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:13470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_c_stack_direction=1 else @@ -13495,9 +13519,9 @@ fi echo $ac_n "checking for working alloca in function calls""... $ac_c" 1>&6 -echo "configure:13499: checking for working alloca in function calls" >&5 -cat > conftest.$ac_ext <<EOF -#line 13501 "configure" +echo "configure:13523: checking for working alloca in function calls" >&5 +cat > conftest.$ac_ext <<EOF +#line 13525 "configure" #include "confdefs.h" #if defined (__CYGWIN__) @@ -13550,7 +13574,7 @@ } EOF -if { (eval echo configure:13554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then working_alloca_in_function_calls=yes else @@ -13572,11 +13596,51 @@ } +echo $ac_n "checking for working scanf""... $ac_c" 1>&6 +echo "configure:13601: checking for working scanf" >&5 +cat > conftest.$ac_ext <<EOF +#line 13603 "configure" +#include "confdefs.h" + +int +main (int argc, char **argv) +{ + int ret, cp1, cp2, endcount; + char *p = "0x7d 0x000E "; + ret = sscanf (p, "%i %i%n", &cp1, &cp2, &endcount); + /* endcount should be 13 but it's 11 in Cygwin newlib after 6/04; + this breaks unicode.c */ + return endcount != 13; +} + +EOF +if { (eval echo configure:13618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +then + working_scanf=yes +else + conftest_rc="$?" + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + working_scanf=no +fi +rm -fr conftest* +echo "$ac_t""$working_scanf" 1>&6 +test "$working_scanf" != "yes" && \ + { test "$extra_verbose" = "yes" && cat << \EOF + Defining CYGWIN_SCANF_BUG +EOF +cat >> confdefs.h <<\EOF +#define CYGWIN_SCANF_BUG 1 +EOF +} + + echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:13577: checking for working strcoll" >&5 - -cat > conftest.$ac_ext <<EOF -#line 13580 "configure" +echo "configure:13641: checking for working strcoll" >&5 + +cat > conftest.$ac_ext <<EOF +#line 13644 "configure" #include "confdefs.h" #include <string.h> main () @@ -13586,7 +13650,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:13590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_strcoll_works=yes else @@ -13614,10 +13678,10 @@ for ac_func in getpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13618: checking for $ac_func" >&5 - -cat > conftest.$ac_ext <<EOF -#line 13621 "configure" +echo "configure:13682: checking for $ac_func" >&5 + +cat > conftest.$ac_ext <<EOF +#line 13685 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -13640,7 +13704,7 @@ ; return 0; } EOF -if { (eval echo configure:13644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13708: \"$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 @@ -13668,10 +13732,10 @@ done echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:13672: checking whether getpgrp takes no argument" >&5 - -cat > conftest.$ac_ext <<EOF -#line 13675 "configure" +echo "configure:13736: checking whether getpgrp takes no argument" >&5 + +cat > conftest.$ac_ext <<EOF +#line 13739 "configure" #include "confdefs.h" /* @@ -13726,7 +13790,7 @@ } EOF -if { (eval echo configure:13730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then ac_cv_func_getpgrp_void=yes else @@ -13753,10 +13817,10 @@ echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:13757: checking for working mmap" >&5 +echo "configure:13821: checking for working mmap" >&5 case "$opsys" in ultrix* ) have_mmap=no ;; *) cat > conftest.$ac_ext <<EOF -#line 13760 "configure" +#line 13824 "configure" #include "confdefs.h" #include <stdio.h> #include <unistd.h> @@ -13789,7 +13853,7 @@ return 1; } EOF -if { (eval echo configure:13793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:13857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then have_mmap=yes else @@ -13818,9 +13882,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:13822: checking for M_MMAP_THRESHOLD" >&5 +echo "configure:13886: checking for M_MMAP_THRESHOLD" >&5 cat > conftest.$ac_ext <<EOF -#line 13824 "configure" +#line 13888 "configure" #include "confdefs.h" #include <malloc.h> int main() { @@ -13832,7 +13896,7 @@ ; return 0; } EOF -if { (eval echo configure:13836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rel_alloc=no; echo "$ac_t""yes" 1>&6; else @@ -13857,15 +13921,15 @@ ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for termios.h""... $ac_c" 1>&6 -echo "configure:13861: checking for termios.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 13864 "configure" +echo "configure:13925: checking for termios.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 13928 "configure" #include "confdefs.h" #include <termios.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13933: \"$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* @@ -13908,15 +13972,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:13912: checking for termio.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 13915 "configure" +echo "configure:13976: checking for termio.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 13979 "configure" #include "confdefs.h" #include <termio.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13984: \"$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* @@ -13948,10 +14012,10 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:13952: checking for socket" >&5 - -cat > conftest.$ac_ext <<EOF -#line 13955 "configure" +echo "configure:14016: checking for socket" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14019 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char socket(); below. */ @@ -13974,7 +14038,7 @@ ; return 0; } EOF -if { (eval echo configure:13978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14042: \"$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 @@ -13989,15 +14053,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:13993: checking for netinet/in.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 13996 "configure" +echo "configure:14057: checking for netinet/in.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14060 "configure" #include "confdefs.h" #include <netinet/in.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14065: \"$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* @@ -14014,15 +14078,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:14018: checking for arpa/inet.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14021 "configure" +echo "configure:14082: checking for arpa/inet.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14085 "configure" #include "confdefs.h" #include <arpa/inet.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14090: \"$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* @@ -14047,9 +14111,9 @@ } echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6 -echo "configure:14051: checking "for sun_len member in struct sockaddr_un"" >&5 +echo "configure:14115: checking "for sun_len member in struct sockaddr_un"" >&5 cat > conftest.$ac_ext <<EOF -#line 14053 "configure" +#line 14117 "configure" #include "confdefs.h" #include <sys/types.h> @@ -14060,7 +14124,7 @@ static struct sockaddr_un x; x.sun_len = 1; ; return 0; } EOF -if { (eval echo configure:14064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14128: \"$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 @@ -14078,9 +14142,9 @@ fi rm -f conftest* echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6 -echo "configure:14082: checking "for ip_mreq struct in netinet/in.h"" >&5 +echo "configure:14146: checking "for ip_mreq struct in netinet/in.h"" >&5 cat > conftest.$ac_ext <<EOF -#line 14084 "configure" +#line 14148 "configure" #include "confdefs.h" #include <sys/types.h> @@ -14090,7 +14154,7 @@ static struct ip_mreq x; ; return 0; } EOF -if { (eval echo configure:14094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14158: \"$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 @@ -14121,10 +14185,10 @@ echo $ac_n "checking for msgget""... $ac_c" 1>&6 -echo "configure:14125: checking for msgget" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14128 "configure" +echo "configure:14189: checking for msgget" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14192 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char msgget(); below. */ @@ -14147,7 +14211,7 @@ ; return 0; } EOF -if { (eval echo configure:14151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14215: \"$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 @@ -14162,15 +14226,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:14166: checking for sys/ipc.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14169 "configure" +echo "configure:14230: checking for sys/ipc.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14233 "configure" #include "confdefs.h" #include <sys/ipc.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14238: \"$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* @@ -14187,15 +14251,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:14191: checking for sys/msg.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14194 "configure" +echo "configure:14255: checking for sys/msg.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14258 "configure" #include "confdefs.h" #include <sys/msg.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14263: \"$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* @@ -14233,15 +14297,15 @@ ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dirent.h""... $ac_c" 1>&6 -echo "configure:14237: checking for dirent.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14240 "configure" +echo "configure:14301: checking for dirent.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14304 "configure" #include "confdefs.h" #include <dirent.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14309: \"$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* @@ -14268,15 +14332,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:14272: checking for sys/dir.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14275 "configure" +echo "configure:14336: checking for sys/dir.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14339 "configure" #include "confdefs.h" #include <sys/dir.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14344: \"$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* @@ -14309,15 +14373,15 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:14313: checking for nlist.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14316 "configure" +echo "configure:14377: checking for nlist.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14380 "configure" #include "confdefs.h" #include <nlist.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14385: \"$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* @@ -14347,22 +14411,22 @@ echo "checking "for sound support"" 1>&6 -echo "configure:14351: checking "for sound support"" >&5 +echo "configure:14415: 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:14358: checking for multimedia/audio_device.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14361 "configure" +echo "configure:14422: checking for multimedia/audio_device.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14425 "configure" #include "confdefs.h" #include <multimedia/audio_device.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14430: \"$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* @@ -14418,12 +14482,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6 -echo "configure:14422: checking for ALopenport in -laudio" >&5 +echo "configure:14486: checking for ALopenport in -laudio" >&5 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <<EOF -#line 14427 "configure" +#line 14491 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -14434,7 +14498,7 @@ ALopenport() ; return 0; } EOF -if { (eval echo configure:14438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14502: \"$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 @@ -14465,12 +14529,12 @@ if test -z "$native_sound_lib"; then echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6 -echo "configure:14469: checking for AOpenAudio in -lAlib" >&5 +echo "configure:14533: checking for AOpenAudio in -lAlib" >&5 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'` xe_check_libs=" -lAlib " cat > conftest.$ac_ext <<EOF -#line 14474 "configure" +#line 14538 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -14481,7 +14545,7 @@ AOpenAudio() ; return 0; } EOF -if { (eval echo configure:14485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14549: \"$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 @@ -14529,15 +14593,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:14533: checking for ${dir}/soundcard.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14536 "configure" +echo "configure:14597: checking for ${dir}/soundcard.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14600 "configure" #include "confdefs.h" #include <${dir}/soundcard.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14605: \"$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* @@ -14591,15 +14655,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:14595: checking for audio/audiolib.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14598 "configure" +echo "configure:14659: checking for audio/audiolib.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14662 "configure" #include "confdefs.h" #include <audio/audiolib.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14667: \"$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* @@ -14617,12 +14681,12 @@ echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6 -echo "configure:14621: checking for AuOpenServer in -laudio" >&5 +echo "configure:14685: checking for AuOpenServer in -laudio" >&5 ac_lib_var=`echo audio'_'AuOpenServer | sed 'y%./+-%__p_%'` xe_check_libs=" -laudio " cat > conftest.$ac_ext <<EOF -#line 14626 "configure" +#line 14690 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -14633,7 +14697,7 @@ AuOpenServer() ; return 0; } EOF -if { (eval echo configure:14637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14701: \"$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 @@ -14672,7 +14736,7 @@ fi libs_x="-laudio $libs_x" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-laudio\" to \$libs_x"; fi cat > conftest.$ac_ext <<EOF -#line 14676 "configure" +#line 14740 "configure" #include "confdefs.h" #include <audio/Xtutil.h> EOF @@ -14703,7 +14767,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:14707: checking for $ac_word" >&5 +echo "configure:14771: 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. @@ -14732,10 +14796,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:14736: checking for esd_play_stream" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14739 "configure" +echo "configure:14800: checking for esd_play_stream" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14803 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char esd_play_stream(); below. */ @@ -14758,7 +14822,7 @@ ; return 0; } EOF -if { (eval echo configure:14762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14826: \"$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 @@ -14809,7 +14873,7 @@ if test "$with_tty" = "yes" ; then echo "checking for TTY-related features" 1>&6 -echo "configure:14813: checking for TTY-related features" >&5 +echo "configure:14877: checking for TTY-related features" >&5 { test "$extra_verbose" = "yes" && cat << \EOF Defining HAVE_TTY EOF @@ -14822,12 +14886,12 @@ if test -z "$with_ncurses"; then echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:14826: checking for tgetent in -lncurses" >&5 +echo "configure:14890: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lncurses " cat > conftest.$ac_ext <<EOF -#line 14831 "configure" +#line 14895 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -14838,7 +14902,7 @@ tgetent() ; return 0; } EOF -if { (eval echo configure:14842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14906: \"$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 @@ -14871,15 +14935,15 @@ ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6 -echo "configure:14875: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14878 "configure" +echo "configure:14939: checking for ncurses/curses.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14942 "configure" #include "confdefs.h" #include <ncurses/curses.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14947: \"$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* @@ -14901,15 +14965,15 @@ ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6 -echo "configure:14905: checking for ncurses/term.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14908 "configure" +echo "configure:14969: checking for ncurses/term.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 14972 "configure" #include "confdefs.h" #include <ncurses/term.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:14977: \"$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* @@ -14939,15 +15003,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:14943: checking for ncurses/curses.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 14946 "configure" +echo "configure:15007: checking for ncurses/curses.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 15010 "configure" #include "confdefs.h" #include <ncurses/curses.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:14951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:15015: \"$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* @@ -14982,12 +15046,12 @@ for lib in curses termlib termcap; do echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6 -echo "configure:14986: checking for tgetent in -l$lib" >&5 +echo "configure:15050: checking for tgetent in -l$lib" >&5 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -l$lib " cat > conftest.$ac_ext <<EOF -#line 14991 "configure" +#line 15055 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -14998,7 +15062,7 @@ tgetent() ; return 0; } EOF -if { (eval echo configure:15002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15066: \"$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 @@ -15029,12 +15093,12 @@ else echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:15033: checking for tgetent in -lcurses" >&5 +echo "configure:15097: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -lcurses " cat > conftest.$ac_ext <<EOF -#line 15038 "configure" +#line 15102 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -15045,7 +15109,7 @@ tgetent() ; return 0; } EOF -if { (eval echo configure:15049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15113: \"$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 @@ -15063,12 +15127,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:15067: checking for tgetent in -ltermcap" >&5 +echo "configure:15131: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` xe_check_libs=" -ltermcap " cat > conftest.$ac_ext <<EOF -#line 15072 "configure" +#line 15136 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -15079,7 +15143,7 @@ tgetent() ; return 0; } EOF -if { (eval echo configure:15083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15147: \"$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 @@ -15128,15 +15192,15 @@ if test "$with_gpm" != "no"; then ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for gpm.h""... $ac_c" 1>&6 -echo "configure:15132: checking for gpm.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 15135 "configure" +echo "configure:15196: checking for gpm.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 15199 "configure" #include "confdefs.h" #include <gpm.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:15140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:15204: \"$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* @@ -15154,12 +15218,12 @@ echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6 -echo "configure:15158: checking for Gpm_Open in -lgpm" >&5 +echo "configure:15222: checking for Gpm_Open in -lgpm" >&5 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgpm " cat > conftest.$ac_ext <<EOF -#line 15163 "configure" +#line 15227 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -15170,7 +15234,7 @@ Gpm_Open() ; return 0; } EOF -if { (eval echo configure:15174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15238: \"$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 @@ -15222,20 +15286,20 @@ test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \ != "no no no" && echo "checking for database support" 1>&6 -echo "configure:15226: checking for database support" >&5 +echo "configure:15290: 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:15231: checking for ndbm.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 15234 "configure" +echo "configure:15295: checking for ndbm.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 15298 "configure" #include "confdefs.h" #include <ndbm.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:15239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:15303: \"$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* @@ -15265,12 +15329,12 @@ if test "$with_database_gdbm" != "no"; then echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:15269: checking for dbm_open in -lgdbm" >&5 +echo "configure:15333: checking for dbm_open in -lgdbm" >&5 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -lgdbm " cat > conftest.$ac_ext <<EOF -#line 15274 "configure" +#line 15338 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -15281,7 +15345,7 @@ dbm_open() ; return 0; } EOF -if { (eval echo configure:15285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15349: \"$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 @@ -15309,10 +15373,10 @@ if test "$with_database_dbm" != "no"; then echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:15313: checking for dbm_open" >&5 - -cat > conftest.$ac_ext <<EOF -#line 15316 "configure" +echo "configure:15377: checking for dbm_open" >&5 + +cat > conftest.$ac_ext <<EOF +#line 15380 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dbm_open(); below. */ @@ -15335,7 +15399,7 @@ ; return 0; } EOF -if { (eval echo configure:15339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15403: \"$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 @@ -15354,12 +15418,12 @@ echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:15358: checking for dbm_open in -ldbm" >&5 +echo "configure:15422: checking for dbm_open in -ldbm" >&5 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'` xe_check_libs=" -ldbm " cat > conftest.$ac_ext <<EOF -#line 15363 "configure" +#line 15427 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -15370,7 +15434,7 @@ dbm_open() ; return 0; } EOF -if { (eval echo configure:15374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15438: \"$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 @@ -15411,10 +15475,10 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6 -echo "configure:15415: checking for Berkeley db.h" >&5 +echo "configure:15479: checking for Berkeley db.h" >&5 for header in "db/db.h" "db.h"; do cat > conftest.$ac_ext <<EOF -#line 15418 "configure" +#line 15482 "configure" #include "confdefs.h" #include <stdlib.h> @@ -15436,7 +15500,7 @@ ; return 0; } EOF -if { (eval echo configure:15440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:15504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* db_h_file="$header"; break else @@ -15452,9 +15516,9 @@ if test "$with_database_berkdb" != "no"; then echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6 -echo "configure:15456: checking for Berkeley DB version" >&5 +echo "configure:15520: checking for Berkeley DB version" >&5 cat > conftest.$ac_ext <<EOF -#line 15458 "configure" +#line 15522 "configure" #include "confdefs.h" #include <$db_h_file> #if DB_VERSION_MAJOR > 1 @@ -15466,7 +15530,7 @@ egrep "yes" >/dev/null 2>&1; then rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 15470 "configure" +#line 15534 "configure" #include "confdefs.h" #include <$db_h_file> #if DB_VERSION_MAJOR > 2 @@ -15478,7 +15542,7 @@ egrep "yes" >/dev/null 2>&1; then rm -rf conftest* cat > conftest.$ac_ext <<EOF -#line 15482 "configure" +#line 15546 "configure" #include "confdefs.h" #include <$db_h_file> #if DB_VERSION_MAJOR > 3 @@ -15512,10 +15576,10 @@ rm -f conftest* echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6 -echo "configure:15516: checking for $dbfunc" >&5 - -cat > conftest.$ac_ext <<EOF -#line 15519 "configure" +echo "configure:15580: checking for $dbfunc" >&5 + +cat > conftest.$ac_ext <<EOF +#line 15583 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $dbfunc(); below. */ @@ -15538,7 +15602,7 @@ ; return 0; } EOF -if { (eval echo configure:15542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15606: \"$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 @@ -15557,12 +15621,12 @@ echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6 -echo "configure:15561: checking for $dbfunc in -ldb" >&5 +echo "configure:15625: checking for $dbfunc in -ldb" >&5 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'` xe_check_libs=" -ldb " cat > conftest.$ac_ext <<EOF -#line 15566 "configure" +#line 15630 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -15573,7 +15637,7 @@ $dbfunc() ; return 0; } EOF -if { (eval echo configure:15577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15641: \"$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 @@ -15607,12 +15671,12 @@ echo "configure: warning: "db_create is really $dbfunc"" 1>&2 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6 -echo "configure:15611: checking for $dbfunc in -ldb" >&5 +echo "configure:15675: checking for $dbfunc in -ldb" >&5 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'` xe_check_libs=" -ldb " cat > conftest.$ac_ext <<EOF -#line 15616 "configure" +#line 15680 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -15623,7 +15687,7 @@ $dbfunc() ; return 0; } EOF -if { (eval echo configure:15627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15691: \"$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 @@ -15682,12 +15746,12 @@ if test "$with_socks" = "yes"; then echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6 -echo "configure:15686: checking for SOCKSinit in -lsocks" >&5 +echo "configure:15750: checking for SOCKSinit in -lsocks" >&5 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocks " cat > conftest.$ac_ext <<EOF -#line 15691 "configure" +#line 15755 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -15698,7 +15762,7 @@ SOCKSinit() ; return 0; } EOF -if { (eval echo configure:15702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15766: \"$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 @@ -15754,15 +15818,15 @@ if test "$use_number_lib" = "gmp"; then ac_safe=`echo "gmp.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for gmp.h""... $ac_c" 1>&6 -echo "configure:15758: checking for gmp.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 15761 "configure" +echo "configure:15822: checking for gmp.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 15825 "configure" #include "confdefs.h" #include <gmp.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:15766: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:15830: \"$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* @@ -15780,12 +15844,12 @@ echo $ac_n "checking for __gmpz_init in -lgmp""... $ac_c" 1>&6 -echo "configure:15784: checking for __gmpz_init in -lgmp" >&5 +echo "configure:15848: checking for __gmpz_init in -lgmp" >&5 ac_lib_var=`echo gmp'_'__gmpz_init | sed 'y%./+-%__p_%'` xe_check_libs=" -lgmp " cat > conftest.$ac_ext <<EOF -#line 15789 "configure" +#line 15853 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -15796,7 +15860,7 @@ __gmpz_init() ; return 0; } EOF -if { (eval echo configure:15800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15864: \"$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 @@ -15845,15 +15909,15 @@ for library in "" "-lcrypto"; do ac_safe=`echo "mp.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for mp.h""... $ac_c" 1>&6 -echo "configure:15849: checking for mp.h" >&5 - -cat > conftest.$ac_ext <<EOF -#line 15852 "configure" +echo "configure:15913: checking for mp.h" >&5 + +cat > conftest.$ac_ext <<EOF +#line 15916 "configure" #include "confdefs.h" #include <mp.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:15857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:15921: \"$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* @@ -15873,12 +15937,12 @@ xe_msg_checking="for mp_mfree in -lmp" test -n "$library" && xe_msg_checking="$xe_msg_checking using extra libs $library" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:15877: checking "$xe_msg_checking"" >&5 +echo "configure:15941: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo mp'_'mp_mfree | sed 'y%./+-%__p_%'` xe_check_libs=" -lmp $library" cat > conftest.$ac_ext <<EOF -#line 15882 "configure" +#line 15946 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -15889,7 +15953,7 @@ mp_mfree() ; return 0; } EOF -if { (eval echo configure:15893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15957: \"$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 @@ -15910,12 +15974,12 @@ xe_msg_checking="for mfree in -lmp" test -n "$library" && xe_msg_checking="$xe_msg_checking using extra libs $library" echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6 -echo "configure:15914: checking "$xe_msg_checking"" >&5 +echo "configure:15978: checking "$xe_msg_checking"" >&5 ac_lib_var=`echo mp'_'mfree | sed 'y%./+-%__p_%'` xe_check_libs=" -lmp $library" cat > conftest.$ac_ext <<EOF -#line 15919 "configure" +#line 15983 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -15926,7 +15990,7 @@ mfree() ; return 0; } EOF -if { (eval echo configure:15930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15994: \"$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 @@ -15968,10 +16032,10 @@ LIBS="$LIBS $library" && if test "$extra_verbose" = "yes"; then echo " Appending \"$library\" to \$LIBS"; fi fi echo $ac_n "checking for mp_move""... $ac_c" 1>&6 -echo "configure:15972: checking for mp_move" >&5 - -cat > conftest.$ac_ext <<EOF -#line 15975 "configure" +echo "configure:16036: checking for mp_move" >&5 + +cat > conftest.$ac_ext <<EOF +#line 16039 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char mp_move(); below. */ @@ -15994,7 +16058,7 @@ ; return 0; } EOF -if { (eval echo configure:15998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_mp_move=yes" else @@ -16025,10 +16089,10 @@ LIBS="$LIBS $library" && if test "$extra_verbose" = "yes"; then echo " Appending \"$library\" to \$LIBS"; fi fi echo $ac_n "checking for move""... $ac_c" 1>&6 -echo "configure:16029: checking for move" >&5 - -cat > conftest.$ac_ext <<EOF -#line 16032 "configure" +echo "configure:16093: checking for move" >&5 + +cat > conftest.$ac_ext <<EOF +#line 16096 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char move(); below. */ @@ -16051,7 +16115,7 @@ ; return 0; } EOF -if { (eval echo configure:16055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_move=yes" else @@ -16098,11 +16162,11 @@ fi cat > conftest.$ac_ext <<EOF -#line 16102 "configure" +#line 16166 "configure" #include "confdefs.h" int main(int c,char *v[]){return 0;} EOF -if { (eval echo configure:16106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:16170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else @@ -17370,6 +17434,12 @@ for dir in . $MAKE_SUBDIR; do ( cd $dir + + + + + + rm -f junk.c < Makefile.in \ sed -e '/^# Generated/d' \ @@ -17386,8 +17456,6 @@ s/$/"/ }' > junk.c; - - echo creating $dir/Makefile $CPP -I. -I${top_srcdir}/src junk.c \ | sed -e 's/^\#.*//' \ @@ -17417,7 +17485,8 @@ mv -f Makefile.new GNUmakefile if test -r "xemacs.def.in"; then - cp -f xemacs.def.in junk.c + rm -f junk.c + cp xemacs.def.in junk.c echo creating $dir/xemacs.def $CPP -I. -I${top_srcdir}/src junk.c \ | sed -e 's/^\#.*//' \
--- a/configure.in Thu Nov 04 22:51:31 2004 +0000 +++ b/configure.in Thu Nov 04 23:08:28 2004 +0000 @@ -6,7 +6,7 @@ #### Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois. #### Copyright (C) 1996, 1997 Sun Microsystems, Inc. -#### Copyright (C) 1995, 1996, 2002, 2003 Ben Wing. +#### Copyright (C) 1995, 1996, 2002, 2003, 2004 Ben Wing. #### Copyright (C) 2000, 2001 Martin Buchholz. #### Copyright (C) 1998, 1999 J. Kean Johnston. @@ -2054,10 +2054,16 @@ elif test "$CC" = "xlc"; then cflags_warning="-qinfo" elif test "$GCC" = "yes"; then - cflags_warning="-Wall -Wno-switch -Winline -Wmissing-prototypes" + cflags_warning="-Wall -Wno-switch -Wmissing-prototypes" + dnl This is not very useful, as it issues warnings that may appear + dnl or disappear rather randomly, cannot easily be fixed, and are + dnl not a big deal. If you want it, add it yourself. + dnl cflags_warning="$cflags_warning -Winline" dnl Yuck, bad compares have been worth at least 3 crashes! - cflags_warning="$cflags_warning -Wsign-compare" + dnl Warnings about char subscripts are pretty pointless, though, + dnl and we use them in various places. + cflags_warning="$cflags_warning -Wsign-compare -Wno-char-subscripts" cflags_warning="$cflags_warning -Wundef -Wstrict-prototypes" test "$__GCC3" = "yes" && cflags_warning="$cflags_warning -Wpacked" dnl glibc is intentionally not `-Wpointer-arith'-clean. @@ -3459,7 +3465,7 @@ fi if test "$with_modules" != "yes"; then MOD_CC="$XEMACS_CC" - MODCFLAGS="\$(CFLAGS) -I../../src -I\$(srcdir)/../../src" + MODCFLAGS="\$(XE_CFLAGS) -I../../src -I\$(srcdir)/../../src" INSTALLPATH="" MOD_INSTALL_PROGRAM="true" OBJECT_TO_BUILD="\$(MODNAME).o" @@ -3581,27 +3587,31 @@ test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) } test -z "$with_ldap" && { AC_CHECK_HEADER(lber.h, ,with_ldap=no) } if test "$with_ldap" != "no"; then - AC_CHECK_LIB(ldap, ldap_search, with_ldap_nolber=yes, with_ldap_nolber=no) - test "$with_ldap_nolber" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_lber=yes, with_ldap_lber=no, -llber) } - test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_krb=yes, with_ldap_krb=no, -llber -lkrb) } - test "$with_ldap_nolber" = "no" -a "$with_ldap_lber" = "no" -a "$with_ldap_krb" = "no" && { AC_CHECK_LIB(ldap, ldap_open, with_ldap_krbdes=yes, with_ldap_krbdes=no, -llber -lkrb -ldes) } - test -z "$with_ldap" -a \( "$with_ldap_lber" = "yes" -o "$with_ldap_nolber" = "yes" -o "$with_ldap_krb" = "yes" -o "$with_ldap_krbdes" = "yes" \) && with_ldap=yes + AC_CHECK_LIB(ldap, ldap_search, with_ldap=yes) + dnl Check for other libraries we need to link with to get the main routines. + test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes], , -llber) } + test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes], , -llber -lkrb) } + test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes with_ldap_des=yes], , -llber -lkrb -ldes) } + dnl Recently, we need -lber even though the main routines are elsewhere, + dnl because otherwise be get link errors w.r.t. ber_pvt_opt_on. So just + dnl check for that (it's a variable not a fun but that doesn't seem to + dnl matter in these checks) and stick in -lber if so. Can't hurt (even to + dnl stick it in always shouldn't hurt, I don't think) ... #### Someone who + dnl #### understands LDAP needs to fix this properly. + test "$with_ldap_lber" != "yes" && { AC_CHECK_LIB(lber, ber_pvt_opt_on, with_ldap_lber=yes) } fi if test "$with_ldap" = "yes"; then AC_DEFINE(HAVE_LDAP) - if test "$with_ldap_nolber" = "yes" ; then - XE_PREPEND(-lldap, ldap_libs) - else - if test "$with_ldap_krb" = "yes" ; then - XE_PREPEND(-lkrb, ldap_libs) - fi - if test "$with_ldap_krbdes" = "yes" ; then - XE_PREPEND(-ldes, ldap_libs) - XE_PREPEND(-lkrb, ldap_libs) - fi + if test "$with_ldap_des" = "yes" ; then + XE_PREPEND(-ldes, ldap_libs) + fi + if test "$with_ldap_krb" = "yes" ; then + XE_PREPEND(-lkrb, ldap_libs) + fi + if test "$with_ldap_lber" = "yes" ; then XE_PREPEND(-llber, ldap_libs) - XE_PREPEND(-lldap, ldap_libs) fi + XE_PREPEND(-lldap, ldap_libs) save_LIBS="$LIBS" LIBS="$LIBS $ldap_libs" AC_CHECK_FUNCS(ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result) LIBS="$save_LIBS" @@ -4226,7 +4236,7 @@ dnl Check for POSIX functions. dnl ---------------------------------------------------------------- -AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize getrlimit gettimeofday getcwd getwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror strlwr strupr symlink tzset ulimit usleep waitpid vsnprintf fsync ftruncate umask wcslen wcscmp vlimit) +AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp fsync ftime ftruncate getaddrinfo gethostname getnameinfo getpagesize getrlimit gettimeofday getcwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setsid sigblock sighold sigprocmask snprintf strerror strlwr strupr symlink tzset ulimit umask usleep vlimit vsnprintf waitpid wcscmp wcslen) dnl getaddrinfo() is borked under hpux11 if test "$ac_cv_func_getaddrinfo" != "no" ; then @@ -4464,6 +4474,23 @@ test "$working_alloca_in_function_calls" != "yes" && \ AC_DEFINE(BROKEN_ALLOCA_IN_FUNCTION_CALLS) +AC_MSG_CHECKING(for working scanf) +AC_TRY_RUN([ +int +main (int argc, char **argv) +{ + int ret, cp1, cp2, endcount; + char *p = "0x7d 0x000E "; + ret = sscanf (p, "%i %i%n", &cp1, &cp2, &endcount); + /* endcount should be 13 but it's 11 in Cygwin newlib after 6/04; + this breaks unicode.c */ + return endcount != 13; +} +], working_scanf=yes, working_scanf=no) +AC_MSG_RESULT($working_scanf) +test "$working_scanf" != "yes" && \ + AC_DEFINE(CYGWIN_SCANF_BUG) + dnl Check whether strcoll exists and works correctly. (This does more dnl than just check for its existence.) If so, it defines HAVE_STRCOLL. AC_FUNC_STRCOLL @@ -5638,8 +5665,26 @@ [for dir in . $MAKE_SUBDIR; do ( cd $dir + +dnl Normally []'s are used for quoting but this will cause problems +dnl since we use brackets in sed. When not inside of a macro definition, +dnl two brackets become one, but inside of a macro definition you need +dnl more, or something -- I don't understand, but Martin probably does. +dnl We put the brackets back later. +dnl [ben] +changequote(<<,>>)dnl + +dnl MAKE_JUNK_C(filename): +dnl Copy a .in file to junk.c in preparation for passing through the +dnl C preprocessor. Delete comment lines, pass lines that will be +dnl interpreted by cpp through directly, and put quotes around remaining +dnl lines, to avoid problems from overly helpful preprocessors that +dnl "helpfully" put extra quotes in various places for later use by the +dnl compiler. Later, the quotes will be removed. + +define(<<MAKE_JUNK_C>>, rm -f junk.c - < Makefile.in \ + < <<$1>> \ sed -e '/^# Generated/d' \ -e 's%/\*\*/#.*%%' \ -e 's/^ *# */#/' \ @@ -5652,15 +5697,15 @@ }' \ dnl Quote other lines to protect from CPP substitution -e '/./ { -s/\([[\"]]\)/\\\1/g +s/\([\"]\)/\\\1/g s/^/"/ s/$/"/ }' > junk.c; - -dnl Create a GNUmakefile and Makefile from Makefile.in. - -changequote(<<,>>)dnl -dnl CPP_MAKEFILE(CPPFLAGS,filename) +)dnl MAKE_JUNK_C + +dnl CPP_MAKEFILE(CPPFLAGS,filename): +dnl Pass junk.c through the preprocessor and put the result in FILENAME. + define(<<CPP_MAKEFILE>>, echo creating $dir/<<$2>> $CPP -I. -I${top_srcdir}/src <<$1>> junk.c \ @@ -5681,10 +5726,18 @@ mv -f Makefile.new <<$2>> )dnl CPP_MAKEFILE +dnl Create a GNUmakefile and Makefile from Makefile.in. +dnl Create xemacs.def from xemacs.def.in in the same fashion, +dnl if it exists (i.e. in the src/ directory). + MAKE_JUNK_C(Makefile.in) CPP_MAKEFILE(,Makefile) CPP_MAKEFILE(-DUSE_GNU_MAKE,GNUmakefile) if test -r "xemacs.def.in"; then - cp -f xemacs.def.in junk.c +dnl #### We should be using MAKE_JUNK_C instead of the next two lines. +dnl #### But the comments in xemacs.def.in need to be converted from C-style +dnl #### to lines beginning with ##. + rm -f junk.c + cp xemacs.def.in junk.c CPP_MAKEFILE(,xemacs.def) fi changequote([,])dnl
--- a/etc/BETA Thu Nov 04 22:51:31 2004 +0000 +++ b/etc/BETA Thu Nov 04 23:08:28 2004 +0000 @@ -179,27 +179,75 @@ ** Building XEmacs from a full distribution =========================================== -Locate a convenient place where you have at least 100MB of free space +[1] Locate a convenient place where you have at least 100MB of free space and issue the command $ gunzip -c /tmp/xemacs-21.5.10.tar.gz | tar xvf - (or simply `tar zxvf /tmp/xemacs-21.5.10.tar.gz' if you use GNU tar). -cd to the top level directory and issue an appropriate configure -command. One maintainer uses the following at the time of this -writing: +[2] cd to the top level directory and issue an appropriate configure +command. + +[3] Run `configure'. If you are new, just consider running it with no +options, to see if you can get a succesful build. When you are more +experienced, you should put various flags in. Here is what we suggest: + +[a] It's a good idea to use + +--extra-verbose +--debug +--memory-usage-stats +--error-checking=all + +These turn on extra debugging info and checks. The last one in particular +will add a great deal of extra error-checking -- which will slow your XEmacs +down somewhat but is likely to catch bugs much sooner and make your bug +reports much more useful. + +[b] You should also strongly consider + +--with-mule +--use-pkcc +--pdump +--with-clash-detection +--with-wmcommand +--with-xfs + +These turn on optional features, which can always use testing. -./configure \ - --extra-verbose \ - --site-prefixes=/usr/local/pgsql:/usr/local/BerkeleyDB.4.1 \ - --dynamic=yes --with-gtk=no --with-gnome=no --with-toolbars \ - --with-wmcommand --with-athena=next --with-menubars=lucid \ - --with-scrollbars=athena --with-dialogs=athena --with-widgets=athena \ - --with-gif --with-sound=native,noesd --with-site-lisp=no \ - --with-site-modules --pdump --with-mule --with-xfs --debug \ - --error-checking=all --memory-usage-stats --use-kkcc \ - --with-clash-detection +[c] If you have gcc, consider using + +--compiler=gcc +--xemacs-compiler=g++ + +This will compile XEmacs using g++, which will turn on a lot of additional +error-checking. + +[d] If your packages are not installed under /usr/local, you should add a +line like + +--package-path=~/.xemacs::/xemacs/site-packages:/xemacs/xemacs-packages:/xemacs/mule-packages + +[e] If you want to build multiple configurations from the same source tree, +make separate build directories for each configuration, run `configure' from +the top level of these (currently empty) directories and use an option like + +--srcdir=/xemacs/source-tree + +(or wherever your source tree is). This will magically create symlinks and +populate your build directory. + +[f] Use --site-prefixes (or --site-includes and --site-libraries) if you have +some packages that XEmacs can compile with that are located in an unusual +place. For example: + +--site-prefixes=/usr/local/pgsql:/usr/local/BerkeleyDB.4.1 + +[g] Depending on your build environment, consuder setting or not setting +options for menubars, scrollbars, window systems, native sound, etc. If +you're not sure, leave them out and let configure do the auto-detection. +(If you get bugs compiling GTK, use `--with-gtk=no --with-gnome=no'.) Part of the configure output is a summary that looks something like the following. (this summary is also available as the file @@ -282,14 +330,14 @@ -Then... +[4] Then... $ make > ./beta.err 2>&1 $ make check > ./xemacs-make-check.err 2>&1 ...and you should have a working XEmacs. -After you have verified that you have a functional editor, fire up +[5] After you have verified that you have a functional editor, fire up your favorite mail program and send a build report to <xemacs-buildreports@xemacs.org>.
--- a/etc/ChangeLog Thu Nov 04 22:51:31 2004 +0000 +++ b/etc/ChangeLog Thu Nov 04 23:08:28 2004 +0000 @@ -1,3 +1,17 @@ +2004-10-26 Ben Wing <ben@xemacs.org> + + * BETA: + * BETA (writing): Removed. + * BETA (--error-checking): New. + * BETA (--compiler): New. + * BETA (--xemacs-compiler): New. + * BETA (--package-path): New. + * BETA (--srcdir): New. + * BETA (--site-prefixes): New. + * BETA (Mail): + Rewrite section on configure to indicate what flags are important + and what not. + 2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.18 "chestnut" is released.
--- a/lib-src/ChangeLog Thu Nov 04 22:51:31 2004 +0000 +++ b/lib-src/ChangeLog Thu Nov 04 23:08:28 2004 +0000 @@ -1,3 +1,24 @@ +2004-10-14 Ben Wing <ben@xemacs.org> + + * digest-doc.c (main): + * make-dump-id.c (main): + * profile.c: + * profile.c (main): + * sorted-doc.c (main): + Add proper decls for main(). + + * make-msgfile.c: + Document that this is old junk. + Move proposal to text.c. + + * make-msgfile.lex: + Move proposal to text.c. + + * make-mswin-unicode.pl: + Convert error-generating code so that the entire message will + be seen as a single unrecognized token. + + 2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.18 "chestnut" is released.
--- a/lib-src/digest-doc.c Thu Nov 04 22:51:31 2004 +0000 +++ b/lib-src/digest-doc.c Thu Nov 04 23:08:28 2004 +0000 @@ -11,7 +11,7 @@ #include <stdio.h> int -main () +main (int argc, char **argv) { register int ch; register int notfirst = 0;
--- a/lib-src/make-dump-id.c Thu Nov 04 22:51:31 2004 +0000 +++ b/lib-src/make-dump-id.c Thu Nov 04 23:08:28 2004 +0000 @@ -54,7 +54,7 @@ } int -main () +main (int argc, char **argv) { FILE *f;
--- a/lib-src/make-msgfile.c Thu Nov 04 22:51:31 2004 +0000 +++ b/lib-src/make-msgfile.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,196 +1,4 @@ -/* - - - PROPOSAL FOR HOW THIS ALL OUGHT TO WORK - this isn't implemented yet, but this is the plan-in-progress - - - In general, it's accepted that the best way to internationalize is for all - messages to be referred to by a symbolic name (or number) and come out of a - table or tables, which are easy to change. - - However, with Emacs, we've got the task of internationalizing a huge body - of existing code, which already contains messages internally. - - For the C code we've got two options: - - - Use a Sun-like gettext() form, which takes an "english" string which - appears literally in the source, and uses that as a hash key to find - a translated string; - - Rip all of the strings out and put them in a table. - - In this case, it's desirable to make as few changes as possible to the C - code, to make it easier to merge the code with the FSF version of emacs - which won't ever have these changes made to it. So we should go with the - former option. - - The way it has been done (between 19.8 and 19.9) was to use gettext(), but - *also* to make massive changes to the source code. The goal now is to use - gettext() at run-time and yet not require a textual change to every line - in the C code which contains a string constant. A possible way to do this - is described below. - - (gettext() can be implemented in terms of catgets() for non-Sun systems, so - that in itself isn't a problem.) - - For the Lisp code, we've got basically the same options: put everything in - a table, or translate things implicitly. - - Another kink that lisp code introduces is that there are thousands of third- - party packages, so changing the source for all of those is simply not an - option. - - Is it a goal that if some third party package displays a message which is - one we know how to translate, then we translate it? I think this is a - worthy goal. It remains to be seen how well it will work in practice. - - So, we should endeavor to minimize the impact on the lisp code. Certain - primitive lisp routines (the stuff in lisp/prim/, and especially in - cmdloop.el and minibuf.el) may need to be changed to know about translation, - but that's an ideologically clean thing to do because those are considered - a part of the emacs substrate. - - However, if we find ourselves wanting to make changes to, say, RMAIL, then - something has gone wrong. (Except to do things like remove assumptions - about the order of words within a sentence, or how pluralization works.) - - There are two parts to the task of displaying translated strings to the - user: the first is to extract the strings which need to be translated from - the sources; and the second is to make some call which will translate those - strings before they are presented to the user. - - The old way was to use the same form to do both, that is, GETTEXT() was both - the tag that we searched for to build a catalog, and was the form which did - the translation. The new plan is to separate these two things more: the - tags that we search for to build the catalog will be stuff that was in there - already, and the translation will get done in some more centralized, lower - level place. - - This program (make-msgfile.c) addresses the first part, extracting the - strings. - - For the emacs C code, we need to recognize the following patterns: - - message ("string" ... ) - error ("string") - report_file_error ("string" ... ) - signal_simple_error ("string" ... ) - signal_simple_error_2 ("string" ... ) - - build_translated_string ("string") - #### add this and use it instead of build_string() in some places. - - yes_or_no_p ("string" ... ) - #### add this instead of funcalling Qyes_or_no_p directly. - - barf_or_query_if_file_exists #### restructure this - check all callers of Fsignal #### restructure these - signal_error (Qerror ... ) #### change all of these to error() - - And we also parse out the `interactive' prompts from DEFUN() forms. - - #### When we've got a string which is a candidate for translation, we - should ignore it if it contains only format directives, that is, if - there are no alphabetic characters in it that are not a part of a `%' - directive. (Careful not to translate either "%s%s" or "%s: ".) - - For the emacs Lisp code, we need to recognize the following patterns: - - (message "string" ... ) - (error "string" ... ) - (format "string" ... ) - (read-from-minibuffer "string" ... ) - (read-shell-command "string" ... ) - (y-or-n-p "string" ... ) - (yes-or-no-p "string" ... ) - (read-file-name "string" ... ) - (temp-minibuffer-message "string") - (query-replace-read-args "string" ... ) - - I expect there will be a lot like the above; basically, any function which - is a commonly used wrapper around an eventual call to `message' or - `read-from-minibuffer' needs to be recognized by this program. - - - (dgettext "domain-name" "string") #### do we still need this? - - things that should probably be restructured: - `princ' in cmdloop.el - `insert' in debug.el - face-interactive - help.el, syntax.el all messed up - - - Menu descriptors: one way to extract the strings in menu labels would be - to teach this program about "^(defvar .*menu\n" forms; that's probably - kind of hard, though, so perhaps a better approach would be to make this - program recognize lines of the form - - "string" ... ;###translate - - where the magic token ";###translate" on a line means that the string - constant on this line should go into the message catalog. This is analogous - to the magic ";###autoload" comments, and to the magic comments used in the - EPSF structuring conventions. - - ----- - So this program manages to build up a catalog of strings to be translated. - To address the second part of the problem, of actually looking up the - translations, there are hooks in a small number of low level places in - emacs. - - Assume the existence of a C function gettext(str) which returns the - translation of `str' if there is one, otherwise returns `str'. - - - message() takes a char* as its argument, and always filters it through - gettext() before displaying it. - - - errors are printed by running the lisp function `display-error' which - doesn't call `message' directly (it princ's to streams), so it must be - carefully coded to translate its arguments. This is only a few lines - of code. - - - Fread_minibuffer_internal() is the lowest level interface to all minibuf - interactions, so it is responsible for translating the value that will go - into Vminibuf_prompt. - - - Fpopup_menu filters the menu titles through gettext(). - - The above take care of 99% of all messages the user ever sees. - - - The lisp function temp-minibuffer-message translates its arg. - - - query-replace-read-args is funny; it does - (setq from (read-from-minibuffer (format "%s: " string) ... )) - (setq to (read-from-minibuffer (format "%s %s with: " string from) ... )) - - What should we do about this? We could hack query-replace-read-args to - translate its args, but might this be a more general problem? I don't - think we ought to translate all calls to format. We could just change - the calling sequence, since this is odd in that the first %s wants to be - translated but the second doesn't. - - - Solving the "translating too much" problem: - The concern has been raised that in this situation: - - "Help" is a string for which we know a translation; - - someone visits a file called Help, and someone does something - contrived like (error buffer-file-name) - then we would display the translation of Help, which would not be correct. - We can solve this by adding a bit to Lisp_String objects which identifies - them as having been read as literal constants from a .el or .elc file (as - opposed to having been constructed at run time as it would in the above - case.) To solve this: - - - Fmessage() takes a lisp string as its first argument. - If that string is a constant, that is, was read from a source file - as a literal, then it calls message() with it, which translates. - Otherwise, it calls message_no_translate(), which does not translate. - - - Ferror() (actually, Fsignal() when condition is Qerror) works similarly. -*/ - - +/* #### Old code! Replaced with make-msgfile.lex. */ /* Scan specified C and Lisp files, extracting the following messages:
--- a/lib-src/make-msgfile.lex Thu Nov 04 22:51:31 2004 +0000 +++ b/lib-src/make-msgfile.lex Thu Nov 04 23:08:28 2004 +0000 @@ -25,6 +25,8 @@ /* Written by Ben Wing, November 1994. Some code based on earlier make-msgfile.c. */ +/* See text.c for a proposal about how this whole system should work. */ + /* Note: there is still much work to be done on this. 1) Definition of Arg below won't handle a generalized argument @@ -60,230 +62,6 @@ */ -/* Long comment from jwz: - - (much of this comment is outdated, and a lot of it is actually - implemented) - - - PROPOSAL FOR HOW THIS ALL OUGHT TO WORK - this isn't implemented yet, but this is the plan-in-progress - - - In general, it's accepted that the best way to internationalize is for all - messages to be referred to by a symbolic name (or number) and come out of a - table or tables, which are easy to change. - - However, with Emacs, we've got the task of internationalizing a huge body - of existing code, which already contains messages internally. - - For the C code we've got two options: - - - Use a Sun-like gettext() form, which takes an "english" string which - appears literally in the source, and uses that as a hash key to find - a translated string; - - Rip all of the strings out and put them in a table. - - In this case, it's desirable to make as few changes as possible to the C - code, to make it easier to merge the code with the FSF version of emacs - which won't ever have these changes made to it. So we should go with the - former option. - - The way it has been done (between 19.8 and 19.9) was to use gettext(), but - *also* to make massive changes to the source code. The goal now is to use - gettext() at run-time and yet not require a textual change to every line - in the C code which contains a string constant. A possible way to do this - is described below. - - (gettext() can be implemented in terms of catgets() for non-Sun systems, so - that in itself isn't a problem.) - - For the Lisp code, we've got basically the same options: put everything in - a table, or translate things implicitly. - - Another kink that lisp code introduces is that there are thousands of third- - party packages, so changing the source for all of those is simply not an - option. - - Is it a goal that if some third party package displays a message which is - one we know how to translate, then we translate it? I think this is a - worthy goal. It remains to be seen how well it will work in practice. - - So, we should endeavor to minimize the impact on the lisp code. Certain - primitive lisp routines (the stuff in lisp/prim/, and especially in - cmdloop.el and minibuf.el) may need to be changed to know about translation, - but that's an ideologically clean thing to do because those are considered - a part of the emacs substrate. - - However, if we find ourselves wanting to make changes to, say, RMAIL, then - something has gone wrong. (Except to do things like remove assumptions - about the order of words within a sentence, or how pluralization works.) - - There are two parts to the task of displaying translated strings to the - user: the first is to extract the strings which need to be translated from - the sources; and the second is to make some call which will translate those - strings before they are presented to the user. - - The old way was to use the same form to do both, that is, GETTEXT() was both - the tag that we searched for to build a catalog, and was the form which did - the translation. The new plan is to separate these two things more: the - tags that we search for to build the catalog will be stuff that was in there - already, and the translation will get done in some more centralized, lower - level place. - - This program (make-msgfile.c) addresses the first part, extracting the - strings. - - For the emacs C code, we need to recognize the following patterns: - - message ("string" ... ) - error ("string") - report_file_error ("string" ... ) - signal_simple_error ("string" ... ) - signal_simple_error_2 ("string" ... ) - - build_translated_string ("string") - #### add this and use it instead of build_string() in some places. - - yes_or_no_p ("string" ... ) - #### add this instead of funcalling Qyes_or_no_p directly. - - barf_or_query_if_file_exists #### restructure this - check all callers of Fsignal #### restructure these - signal_error (Qerror ... ) #### change all of these to error() - - And we also parse out the `interactive' prompts from DEFUN() forms. - - #### When we've got a string which is a candidate for translation, we - should ignore it if it contains only format directives, that is, if - there are no alphabetic characters in it that are not a part of a `%' - directive. (Careful not to translate either "%s%s" or "%s: ".) - - For the emacs Lisp code, we need to recognize the following patterns: - - (message "string" ... ) - (error "string" ... ) - (format "string" ... ) - (read-from-minibuffer "string" ... ) - (read-shell-command "string" ... ) - (y-or-n-p "string" ... ) - (yes-or-no-p "string" ... ) - (read-file-name "string" ... ) - (temp-minibuffer-message "string") - (query-replace-read-args "string" ... ) - - I expect there will be a lot like the above; basically, any function which - is a commonly used wrapper around an eventual call to `message' or - `read-from-minibuffer' needs to be recognized by this program. - - - (dgettext "domain-name" "string") #### do we still need this? - - things that should probably be restructured: - `princ' in cmdloop.el - `insert' in debug.el - face-interactive - help.el, syntax.el all messed up - - BPW: (format) is a tricky case. If I use format to create a string - that I then send to a file, I probably don't want the string translated. - On the other hand, If the string gets used as an argument to (y-or-n-p) - or some such function, I do want it translated, and it needs to be - translated before the %s and such are replaced. The proper solution - here is for (format) and other functions that call gettext but don't - immediately output the string to the user to add the translated (and - formatted) string as a string property of the object, and have - functions that output potentially translated strings look for a - "translated string" property. Of course, this will fail if someone - does something like - - (y-or-n-p (concat (if you-p "Do you " "Does he ") - (format "want to delete %s? " filename)))) - - But you shouldn't be doing things like this anyway. - - BPW: Also, to avoid excessive translating, strings should be marked - as translated once they get translated, and further calls to gettext - don't do any more translating. Otherwise, a call like - - (y-or-n-p (format "Delete %s? " filename)) - - would cause translation on both the pre-formatted and post-formatted - strings, which could lead to weird results in some cases (y-or-n-p - has to translate its argument because someone could pass a string to - it directly). Note that the "translating too much" solution outlined - below could be implemented by just marking all strings that don't - come from a .el or .elc file as already translated. - - Menu descriptors: one way to extract the strings in menu labels would be - to teach this program about "^(defvar .*menu\n" forms; that's probably - kind of hard, though, so perhaps a better approach would be to make this - program recognize lines of the form - - "string" ... ;###translate - - where the magic token ";###translate" on a line means that the string - constant on this line should go into the message catalog. This is analogous - to the magic ";###autoload" comments, and to the magic comments used in the - EPSF structuring conventions. - - ----- - So this program manages to build up a catalog of strings to be translated. - To address the second part of the problem, of actually looking up the - translations, there are hooks in a small number of low level places in - emacs. - - Assume the existence of a C function gettext(str) which returns the - translation of `str' if there is one, otherwise returns `str'. - - - message() takes a char* as its argument, and always filters it through - gettext() before displaying it. - - - errors are printed by running the lisp function `display-error' which - doesn't call `message' directly (it princ's to streams), so it must be - carefully coded to translate its arguments. This is only a few lines - of code. - - - Fread_minibuffer_internal() is the lowest level interface to all minibuf - interactions, so it is responsible for translating the value that will go - into Vminibuf_prompt. - - - Fpopup_menu filters the menu titles through gettext(). - - The above take care of 99% of all messages the user ever sees. - - - The lisp function temp-minibuffer-message translates its arg. - - - query-replace-read-args is funny; it does - (setq from (read-from-minibuffer (format "%s: " string) ... )) - (setq to (read-from-minibuffer (format "%s %s with: " string from) ... )) - - What should we do about this? We could hack query-replace-read-args to - translate its args, but might this be a more general problem? I don't - think we ought to translate all calls to format. We could just change - the calling sequence, since this is odd in that the first %s wants to be - translated but the second doesn't. - - - Solving the "translating too much" problem: - The concern has been raised that in this situation: - - "Help" is a string for which we know a translation; - - someone visits a file called Help, and someone does something - contrived like (error buffer-file-name) - then we would display the translation of Help, which would not be correct. - We can solve this by adding a bit to Lisp_String objects which identifies - them as having been read as literal constants from a .el or .elc file (as - opposed to having been constructed at run time as it would in the above - case.) To solve this: - - - Fmessage() takes a lisp string as its first argument. - If that string is a constant, that is, was read from a source file - as a literal, then it calls message() with it, which translates. - Otherwise, it calls message_no_translate(), which does not translate. - - - Ferror() (actually, Fsignal() when condition is Qerror) works similarly. -*/ - /* Some notes: -- {Arg} below could get confused by commas inside of quotes.
--- a/lib-src/make-mswin-unicode.pl Thu Nov 04 22:51:31 2004 +0000 +++ b/lib-src/make-mswin-unicode.pl Thu Nov 04 23:08:28 2004 +0000 @@ -2,7 +2,7 @@ ### make-mswin-unicode --- generate Unicode-encapsulation code for MS Windows -## Copyright (C) 2001, 2002 Ben Wing. +## Copyright (C) 2001, 2002, 2004 Ben Wing. ## Author: Ben Wing <ben@xemacs.org> ## Maintainer: Ben Wing <ben@xemacs.org> @@ -269,7 +269,8 @@ } print HOUT "#undef $fun\n"; - print HOUT "#define $fun error $reason\n"; + (my $munged_reason = $reason) =~ s/[^A-Za-z0-9]/_/g; + print HOUT "#define $fun error_$munged_reason\n"; print COUT "/* Error if $fun used: $reason */\n\n"; } elsif ($command eq "skip") @@ -333,7 +334,7 @@ } print HOUT "#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED\n"; print HOUT "#undef $fun\n"; - print HOUT "#define $fun error use qxe$fun or ${fun}A/${fun}W\n"; + print HOUT "#define $fun error_use_qxe${fun}_or_${fun}A_and_${fun}W\n"; print HOUT "#endif\n"; if (defined ($reason)) {
--- a/lib-src/profile.c Thu Nov 04 22:51:31 2004 +0000 +++ b/lib-src/profile.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,5 +1,6 @@ /* profile.c --- generate periodic events for profiling of Emacs Lisp code. Copyright (C) 1992, 1994 Free Software Foundation, Inc. + Copyright (C) 2004 Ben Wing. Author: Boaz Ben-Zvi <boaz@lcs.mit.edu> @@ -91,7 +92,7 @@ } int -main () +main (int argc, char **argv) { int c; while ((c = getchar ()) != EOF)
--- a/lib-src/sorted-doc.c Thu Nov 04 22:51:31 2004 +0000 +++ b/lib-src/sorted-doc.c Thu Nov 04 23:08:28 2004 +0000 @@ -99,7 +99,7 @@ }; int -main () +main (int argc, char **argv) { register DOCSTR *dp = NULL; /* allocated DOCSTR */ register LINE *lp = NULL; /* allocated line */
--- a/lisp/ChangeLog Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/ChangeLog Thu Nov 04 23:08:28 2004 +0000 @@ -1,3 +1,60 @@ +2004-11-04 Ben Wing <ben@xemacs.org> + + * mule/mule-ccl.el (define-ccl-program): + * mule/mule-ccl.el (TRANSLATE): New. + * mule/mule-ccl.el (MAP): New. + * mule/mule-ccl.el (MAP-IDs): New. + * mule/mule-ccl.el (MAP-SET): New. + * mule/mule-ccl.el (MAP-ID): New. + * mule/mule-ccl.el (INT-OR-CHAR): New. + Update docs. + +2004-10-26 Ben Wing <ben@xemacs.org> + + * cl-extra.el (coerce): + * cl.el (cl-random-time): + * wid-edit.el (widget-url-link-action): + * widgets-gtk.el (gtk-widget-instantiate-notebook-internal): + * dialog-gtk.el: + * frame.el (frame-notice-user-settings): + * frame.el (display-mouse-p): + * frame.el (display-visual-class): + * package-ui.el (pui-display-maintainer): + Fix compile warnings. + +2004-10-14 Ben Wing <ben@xemacs.org> + + * dumped-lisp.el: + Put in comment about extended chars in dumped files. + + * font-lock.el: + * font-lock.el (lisp-font-lock-keywords-2): + * font-lock.el (c-font-lock-keywords-2): New. + * font-lock.el (c-font-lock-keywords-3): New. + Add versions of C keywords for editing XEmacs source code, + recognizing many basic XEmacs types. + + * loadup.el (really-early-error-handler): + * unicode.el: + * unicode.el (load-unicode-tables-at-dump-time): New. + * unicode.el (init-unicode-at-startup): Removed. + * mule/mule-cmds.el (init-mule-at-startup): + Define and implement load-unicode-tables-at-dump-time. Set this + to true on Windows systems. This will increase the size of the + dumped XEmacs but allow XEmacs to be run when in a non-ASCII + directory or with non-ASCII command-line arguments. + + * update-elc.el: + * update-elc.el (unbytecompiled-lisp-files): + * update-elc.el (additional-dump-dependencies): New. + * update-elc.el ((preloaded-file-list site-load-packages files-to-process)): + Add loadup.el, loadup-el.el and update-elc.el as additional + dependencies, forcing a redump if they are changed. + + * win32-native.el: + Add stuff snipped from Microsoft docs concerning how quoting + conventions are supposed to work. + 2004-10-28 Stephen J. Turnbull <stephen@xemacs.org> * code-process.el (call-process-region): Fix region deletion bug.
--- a/lisp/cl-extra.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/cl-extra.el Thu Nov 04 23:08:28 2004 +0000 @@ -71,9 +71,9 @@ ((and (eq type 'integer) (characterp x)) (char-int x)) ((eq type 'float) (float x)) ;; XEmacs addition: enhanced numeric type coercions - ((and (featurep 'number-types) - (memq type '(integer ratio bigfloat)) - (coerce-number x type))) + ((and-fboundp 'coerce-number + (memq type '(integer ratio bigfloat)) + (coerce-number x type))) ;; XEmacs addition: bit-vector coercion ((eq type 'bit-vector) (if (bit-vector-p x) x (apply 'bit-vector (append x nil))))
--- a/lisp/cl.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/cl.el Thu Nov 04 23:08:28 2004 +0000 @@ -308,7 +308,7 @@ (let* ((time (copy-sequence (current-time-string))) (i (length time)) (v 0)) (while (>= (decf i) 0) (setq v (+ (* v 3) (aref time i)))) (if (featurep 'bignum) - (coerce-number v 'fixnum) + (declare-fboundp (coerce-number v 'fixnum)) v))) (defvar *gensym-counter* (* (logand (cl-random-time) 1023) 100))
--- a/lisp/dialog-gtk.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/dialog-gtk.el Thu Nov 04 23:08:28 2004 +0000 @@ -45,7 +45,8 @@ gtk-box-set-spacing gtk-dialog-vbox gtk-container-add gtk-label-new gtk-button-new-with-label gtk-widget-set-sensitive gtk-widget-show gtk-dialog-action-area - gtk-label-parse-uline gtk-widget-add-accelerator gtk-accel-group-new)) + gtk-label-parse-uline gtk-widget-add-accelerator gtk-accel-group-new + gtk-misc-set-alignment gtk-button-new gtk-window-add-accel-group)) (defun gtk-popup-convert-underscores (str) ;; Convert the XEmacs button accelerator representation to Gtk mnemonic
--- a/lisp/dumped-lisp.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/dumped-lisp.el Thu Nov 04 23:08:28 2004 +0000 @@ -6,6 +6,17 @@ This includes every package that is loaded directly by a package listed in dumped-lisp.el and is not itself listed.") + +;; WARNING WARNING WARNING: None of the files below, until where it says +;; "All files after this can have extended characters in them", can have +;; extended (non-ASCII characters) of any sort in them! Unfortunately, you +;; will not get any error at load-time; however, you may get a later very +;; cryptic error "Invalid opcode"! This is caused by the byte-code data +;; being encoded as escape-quoted, when we can't handle that yet. +;; +;; #### We should resurrect the check for the coding-system magic cookie in +;; fileio.c and put in an abort if we are not able to handle it yet. + (setq preloaded-file-list (list ;; do not defcustom any variables in these files
--- a/lisp/font-lock.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/font-lock.el Thu Nov 04 23:08:28 2004 +0000 @@ -2,7 +2,7 @@ ;; Copyright (C) 1992-1995, 1997 Free Software Foundation, Inc. ;; Copyright (C) 1995 Amdahl Corporation. -;; Copyright (C) 1996, 2000, 2001, 2002 Ben Wing. +;; Copyright (C) 1996, 2000, 2001, 2002, 2004 Ben Wing. ;; Author: Jamie Zawinski <jwz@jwz.org>, for the LISPM Preservation Society. ;; Minimally merged with FSF 19.34 by Barry Warsaw <bwarsaw@python.org> @@ -2027,7 +2027,7 @@ ;; "when" "unless" "do" "dolist" "dotimes" "flet" "labels" ;; "lambda" "block" "return" "return-from" "loop") t) ;; (setq last-kbd-macro - ;; (read-kbd-macro "\" C-7 C-1 <right> C-r \\\\| 3*<right> \" RET")) + ;; (read-kbd-macro "\" C-6 C-9 <right> C-r \\\\| 3*<right> \" RET")) "autoload\\|block\\|c\\(?:a\\(?:ll-with-condition-handler\\|tch\\)\\|" "ond\\(?:ition-case\\)?\\)\\|do\\(?:list\\|times\\)?\\|" "eval-\\(?:a\\(?:fter-load\\|nd-compile\\)\\|when-compile\\)\\|flet\\|" @@ -2174,6 +2174,12 @@ (defconst c-font-lock-keywords-3 nil "Gaudy level highlighting for C modes.") +(defconst c-font-lock-keywords-2 nil + "Medium level highlighting for XEmacs C source code.") + +(defconst c-font-lock-keywords-3 nil + "Gaudy level highlighting for XEmacs C source code.") + (defconst c++-font-lock-keywords-1 nil "Subdued level highlighting for C++ modes.") @@ -2205,14 +2211,35 @@ (let ((c-keywords ; ("break" "continue" "do" "else" "for" "if" "return" "switch" "while") "break\\|continue\\|do\\|else\\|for\\|if\\|return\\|switch\\|while") + (xemacs-c-type-types + ;(regexp-opt '("Ibyte" "CIbyte" "Extbyte" "UExtbyte" "WExtbyte" + ; "Ascbyte" "UAscbyte" "Rawbyte" "CRawbyte" "Binbyte" "CBinbyte" + ; "SBinbyte" "Boolbyte" "Ichar" "Raw_Ichar" "Itext" "Textcount" + ; "Bytecount" "Charcount" "Charbpos" "Bytebpos" "Membpos" "Charxpos" + ; "Bytexpos" "Memxpos" "Elemcount" "Hashcode" "EMACS_INT" "USID" + ; "face_index" "glyph_index" "Lisp_Object")) + ;; see below (search for last-kbd-macro) for how to auto-generate + ;; what's below from what's above. + (concat + "Ascbyte\\|B\\(?:inbyte\\|oolbyte\\|yte\\(?:bpos\\|count\\|" + "xpos\\)\\)\\|C\\(?:Binbyte\\|Ibyte\\|Rawbyte\\|har\\(?:bpos\\|" + "count\\|xpos\\)\\)\\|E\\(?:MACS_INT\\|lemcount\\|xtbyte\\)\\|" + "Hashcode\\|I\\(?:byte\\|char\\|text\\)\\|Lisp_Object\\|" + "Mem\\(?:bpos\\|xpos\\)\\|Raw\\(?:_Ichar\\|byte\\)\\|SBinbyte\\|" + "Textcount\\|U\\(?:Ascbyte\\|Extbyte\\|SID\\)\\|WExtbyte\\|" + "face_index\\|glyph_index")) (c-type-types ; ("auto" "extern" "register" "static" "typedef" "struct" "union" "enum" -; "signed" "unsigned" "short" "long" "int" "char" "float" "double" -; "void" "volatile" "const") +; "signed" "unsigned" "short" "long" "int" "char" "wchar_t" "float" +; "double" "void" "volatile" "const") + ;; This regexp is (just) 6 parens deep ... + ;; This regexp is (just) 6 parens deep ... + ;; This regexp is (just) 6 parens deep ... + ;; repeat ad nauseum (concat "auto\\|c\\(har\\|onst\\)\\|double\\|e\\(num\\|xtern\\)\\|" "float\\|int\\|long\\|register\\|" "s\\(hort\\|igned\\|t\\(atic\\|ruct\\)\\)\\|typedef\\|" - "un\\(ion\\|signed\\)\\|vo\\(id\\|latile\\)")) ; 6 ()s deep. + "un\\(ion\\|signed\\)\\|vo\\(id\\|latile\\)\\|wchar_t")) (c++-keywords ; ("break" "continue" "do" "else" "for" "if" "return" "switch" "while" ; "asm" "catch" "delete" "new" "operator" "sizeof" "this" "throw" "try" @@ -2317,62 +2344,110 @@ (1 font-lock-preprocessor-face) (2 font-lock-variable-name-face nil t)) )) - (setq c-font-lock-keywords-2 - (append c-font-lock-keywords-1 - (list - ;; - ;; Simple regexps for speed. - ;; - ;; Fontify all type specifiers. - (cons (concat "\\<\\(" c-type-types "\\)\\>") 'font-lock-type-face) - ;; - ;; Fontify all builtin keywords (except case, default and goto; see below). - (cons (concat "\\<\\(" c-keywords "\\)\\>") 'font-lock-keyword-face) - ;; - ;; Fontify case/goto keywords and targets, and case default/goto tags. - '("\\<\\(case\\|goto\\)\\>[ \t]*\\([^ \t\n:;]+\\)?" - (1 font-lock-keyword-face) (2 font-lock-reference-face nil t)) - '("^[ \t]*\\(\\sw+\\)[ \t]*:" 1 font-lock-reference-face) - ))) - - (setq c-font-lock-keywords-3 - (append c-font-lock-keywords-2 - ;; - ;; More complicated regexps for more complete highlighting for types. - ;; We still have to fontify type specifiers individually, as C is so hairy. - (list - ;; - ;; Fontify all storage classes and type specifiers, plus their items. - (list (concat "\\<\\(" c-type-types "\\)\\>" - "\\([ \t*&]+\\sw+\\>\\)*") - ;; Fontify each declaration item. - '(font-lock-match-c++-style-declaration-item-and-skip-to-next - ;; Start with point after all type specifiers. - (goto-char (or (match-beginning 8) (match-end 1))) - ;; Finish with point after first type specifier. - (goto-char (match-end 1)) - ;; Fontify as a variable or function name. + (let ((cflk2-part-1 + (list + ;; + ;; Simple regexps for speed. + ;; + ;; Fontify all type specifiers. + (cons (concat "\\<\\(" c-type-types "\\)\\>") 'font-lock-type-face))) + (cflk2-part-2 + (list + ;; Fontify all builtin keywords (except case, default and goto; + ;; see below). + (cons (concat "\\<\\(" c-keywords "\\)\\>") 'font-lock-keyword-face) + ;; + ;; Fontify case/goto keywords and targets, and case default/goto tags. + '("\\<\\(case\\|goto\\)\\>[ \t]*\\([^ \t\n:;]+\\)?" + (1 font-lock-keyword-face) (2 font-lock-reference-face nil t)) + '("^[ \t]*\\(\\sw+\\)[ \t]*:" 1 font-lock-reference-face))) + (cflk3-part-1 + ;; + ;; More complicated regexps for more complete highlighting for + ;; types. We still have to fontify type specifiers individually, + ;; as C is so hairy. + (list + ;; + ;; Fontify all storage classes and type specifiers, plus their items. + (list (concat "\\<\\(" c-type-types "\\)\\>" + "\\([ \t*&]+\\sw+\\>\\)*") + ;; Fontify each declaration item. + '(font-lock-match-c++-style-declaration-item-and-skip-to-next + ;; Start with point after all type specifiers. + (goto-char (or (match-beginning 8) (match-end 1))) + ;; Finish with point after first type specifier. + (goto-char (match-end 1)) + ;; Fontify as a variable or function name. + (1 (if (match-beginning 4) + font-lock-function-name-face + font-lock-variable-name-face)))))) + (cflk3-part-2 + (list + ;; + ;; Fontify structures, or typedef names, plus their items. + '("\\(}\\)[ \t*]*\\sw" + (font-lock-match-c++-style-declaration-item-and-skip-to-next + (goto-char (match-end 1)) nil (1 (if (match-beginning 4) font-lock-function-name-face font-lock-variable-name-face)))) - ;; - ;; Fontify structures, or typedef names, plus their items. - '("\\(}\\)[ \t*]*\\sw" - (font-lock-match-c++-style-declaration-item-and-skip-to-next - (goto-char (match-end 1)) nil - (1 (if (match-beginning 4) - font-lock-function-name-face - font-lock-variable-name-face)))) - ;; - ;; Fontify anything at beginning of line as a declaration or definition. - '("^\\(\\sw+\\)\\>\\([ \t*]+\\sw+\\>\\)*" - (1 font-lock-type-face) - (font-lock-match-c++-style-declaration-item-and-skip-to-next - (goto-char (or (match-beginning 2) (match-end 1))) nil - (1 (if (match-beginning 4) - font-lock-function-name-face - font-lock-variable-name-face)))) - ))) + ;; + ;; Fontify anything at beginning of line as a declaration or + ;; definition. + '("^\\(\\sw+\\)\\>\\([ \t*]+\\sw+\\>\\)*" + (1 font-lock-type-face) + (font-lock-match-c++-style-declaration-item-and-skip-to-next + (goto-char (or (match-beginning 2) (match-end 1))) nil + (1 (if (match-beginning 4) + font-lock-function-name-face + font-lock-variable-name-face)))))) + (xcflk2-part-1 + (list + ;; Fontify all simple type specifiers used in XEmacs code. + (cons (concat "\\<\\(" xemacs-c-type-types "\\)\\>") + 'font-lock-type-face))) + (xcflk3-part-1 + ;; + ;; More complicated regexps for more complete highlighting for + ;; types. We still have to fontify type specifiers individually, + ;; as C is so hairy. + (list + ;; + ;; Fontify all storage classes and type specifiers, plus their items. + (list (concat "\\<\\(" xemacs-c-type-types "\\)\\>" + "\\([ \t*&]+\\sw+\\>\\)*") + ;; Fontify each declaration item. + '(font-lock-match-c++-style-declaration-item-and-skip-to-next + ;; Start with point after all type specifiers. + (goto-char (or (match-beginning 8) (match-end 1))) + ;; Finish with point after first type specifier. + (goto-char (match-end 1)) + ;; Fontify as a variable or function name. + (1 (if (match-beginning 4) + font-lock-function-name-face + font-lock-variable-name-face))))))) + + (setq c-font-lock-keywords-2 + (append c-font-lock-keywords-1 + cflk2-part-1 + cflk2-part-2)) + + (setq c-font-lock-keywords-3 + (append c-font-lock-keywords-2 + cflk3-part-1 + cflk3-part-2)) + + (setq xemacs-c-font-lock-keywords-2 + (append c-font-lock-keywords-1 + cflk2-part-1 + xcflk2-part-1 + cflk2-part-2)) + + (setq xemacs-c-font-lock-keywords-3 + (append xemacs-c-font-lock-keywords-2 + cflk3-part-1 + xcflk3-part-1 + cflk3-part-2))) (setq c++-font-lock-keywords-1 (append
--- a/lisp/frame.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/frame.el Thu Nov 04 23:08:28 2004 +0000 @@ -415,7 +415,8 @@ '(t))) t)) ;; Create the new frame. - (let (props new) + (let (props ;new + ) ;; If the frame isn't visible yet, wait till it is. ;; If the user has to position the window, ;; Emacs doesn't know its real position until @@ -454,13 +455,14 @@ (if (lax-plist-member frame-initial-geometry-arguments 'top) (laxremf props 'top)) ;; Now create the replacement initial frame. - (setq new - (make-frame - ;; Use the geometry args that created the existing - ;; frame, rather than the props we get for it. - (append '(user-size t user-position t) - frame-initial-geometry-arguments - props))) + ;(setq new + (make-frame + ;; Use the geometry args that created the existing + ;; frame, rather than the props we get for it. + (append '(user-size t user-position t) + frame-initial-geometry-arguments + props)) + ;) ;; The initial frame, which we are about to delete, may be ;; the only frame with a minibuffer. If it is, create a ;; new one. @@ -1186,9 +1188,8 @@ ((x ns gtk) t) (mswindows (> mswindows-num-mouse-buttons 0)) (tty - (and - (fboundp 'gpm-is-supported-p) - (gpm-is-supported-p (display-device display)))) + (and-fboundp 'gpm-is-supported-p + (gpm-is-supported-p (display-device display)))) (t nil))) (defun display-popup-menus-p (&optional display) @@ -1273,8 +1274,8 @@ The value is one of the symbols `static-gray', `gray-scale', `static-color', `pseudo-color', `true-color', or `direct-color'." (case (framep-on-display display) - (x (x-display-visual-class (display-device display))) - (gtk (gtk-display-visual-class (display-device display))) + (x (declare-fboundp (x-display-visual-class (display-device display)))) + (gtk (declare-fboundp (gtk-display-visual-class (display-device display)))) (mswindows (let ((planes (display-planes display))) (cond ((eq planes 1) 'static-gray) ((eq planes 4) 'static-color)
--- a/lisp/loadup.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/loadup.el Thu Nov 04 23:08:28 2004 +0000 @@ -159,6 +159,13 @@ (defun toolbar-specifier-p (obj) "No toolbar support." nil)) (fmakunbound 'pureload)) + ;; We cannot do this in mule-cmds.el because not all the + ;; appropriate charsets are loaded yet. + (when (and (featurep 'mule) + load-unicode-tables-at-dump-time) + (let ((data-directory (expand-file-name "etc" source-root))) + (load-unicode-tables))) + (packages-load-package-dumped-lisps late-package-load-path) )) ;; end of call-with-condition-handler
--- a/lisp/mule/mule-ccl.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/mule/mule-ccl.el Thu Nov 04 23:08:28 2004 +0000 @@ -1267,18 +1267,18 @@ STATEMENT := SET | IF | BRANCH | LOOP | REPEAT | BREAK | READ | WRITE | CALL - | TRANSLATE | END + | TRANSLATE | MAP | END SET := (REG = EXPRESSION) | (REG ASSIGNMENT_OPERATOR EXPRESSION) - ;; The following form is the same as (r0 = integer). - | integer + ;; The following form is the same as (r0 = INT-OR-CHAR). + | INT-OR-CHAR EXPRESSION := ARG | (EXPRESSION OPERATOR ARG) ;; Evaluate EXPRESSION. If the result is nonzeor, execute ;; CCL_BLOCK_0. Otherwise, execute CCL_BLOCK_1. -IF := (if EXPRESSION CCL_BLOCK_0 CCL_BLOCK_1) +IF := (if EXPRESSION CCL_BLOCK_0 [CCL_BLOCK_1]) ;; Evaluate EXPRESSION. Provided that the result is N, execute ;; CCL_BLOCK_N. @@ -1293,24 +1293,24 @@ REPEAT := ;; Jump to the head of the most inner loop. (repeat) - ;; Same as: ((write [REG | integer | string]) + ;; Same as: ((write [REG | INT-OR-CHAR | string]) ;; (repeat)) - | (write-repeat [REG | integer | string]) + | (write-repeat [REG | INT-OR-CHAR | string]) ;; Same as: ((write REG [ARRAY]) ;; (read REG) ;; (repeat)) | (write-read-repeat REG [ARRAY]) - ;; Same as: ((write integer) + ;; Same as: ((write INT-OR-CHAR) ;; (read REG) ;; (repeat)) - | (write-read-repeat REG integer) + | (write-read-repeat REG INT-OR-CHAR) READ := ;; Set REG_0 to a byte read from the input text, set REG_1 ;; to the next byte read, and so on. (read REG_0 [REG_1 ...]) ;; Same as: ((read REG) ;; (if (REG OPERATOR ARG) CCL_BLOCK_0 CCL_BLOCK_1)) - | (read-if (REG OPERATOR ARG) CCL_BLOCK_0 CCL_BLOCK_1) + | (read-if (REG OPERATOR ARG) CCL_BLOCK_0 [CCL_BLOCK_1]) ;; Same as: ((read REG) ;; (branch REG CCL_BLOCK_0 [CCL_BLOCK_1 ...])) | (read-branch REG CCL_BLOCK_0 [CCL_BLOCK_1 ...]) @@ -1330,10 +1330,10 @@ ;; Same as: ((r7 = EXPRESSION) ;; (write r7)) | (write EXPRESSION) - ;; Write the value of `integer' to the output buffer. If it + ;; Write the value of `INT-OR-CHAR' to the output buffer. If it ;; is a multibyte character, write the corresponding multibyte ;; representation. - | (write integer) + | (write INT-OR-CHAR) ;; Write the byte sequence of `string' as is to the output ;; buffer. It is encoded by binary coding system, thus, ;; by this operation, you cannot write multibyte string @@ -1356,6 +1356,17 @@ ;; Call CCL program whose name is ccl-program-name. CALL := (call ccl-program-name) +TRANSLATE := + (translate-character REG(table) REG(charset) REG(codepoint)) + | (translate-character SYMBOL REG(charset) REG(codepoint)) +MAP := + (iterate-multiple-map REG REG MAP-IDs) + | (map-multiple REG REG (MAP-SET)) + | (map-single REG REG MAP-ID) +MAP-IDs := MAP-ID ... +MAP-SET := MAP-IDs | (MAP-IDs) MAP-SET +MAP-ID := INT-OR-CHAR + ;; Terminate the CCL program. END := (end) @@ -1363,7 +1374,7 @@ ;; used by CCL interpreter, its value is changed unexpectedly. REG := r0 | r1 | r2 | r3 | r4 | r5 | r6 | r7 -ARG := REG | integer +ARG := REG | INT-OR-CHAR OPERATOR := ;; Normal arithmethic operators (same meaning as C code). @@ -1429,19 +1440,9 @@ ;; (REG /= ARG)) | //= -ARRAY := `[' integer ... `]' - +ARRAY := `[' INT-OR-CHAR ... `]' -TRANSLATE := - (translate-character REG(table) REG(charset) REG(codepoint)) - | (translate-character SYMBOL REG(charset) REG(codepoint)) -MAP := - (iterate-multiple-map REG REG MAP-IDs) - | (map-multiple REG REG (MAP-SET)) - | (map-single REG REG MAP-ID) -MAP-IDs := MAP-ID ... -MAP-SET := MAP-IDs | (MAP-IDs) MAP-SET -MAP-ID := integer +INT-OR-CHAR := integer | character " `(let ((prog ,(ccl-compile (eval ccl-program)))) (defconst ,name prog ,doc)
--- a/lisp/mule/mule-cmds.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/mule/mule-cmds.el Thu Nov 04 23:08:28 2004 +0000 @@ -1348,47 +1348,16 @@ (defun init-mule-at-startup () "Initialize MULE environment at startup. Don't call this." - ;; Fill up the Unicode translation tables for the standard charsets. - ;; Currently this needs to happen after data-directory gets - ;; initialized, which is not long in the startup process before we - ;; are called. However, in reality this is WAY TOO LATE for this to - ;; be happening. All manner of stuff involving paths happens - ;; beforehand, and eventually we want to be able to invoke XEmacs - ;; from a path with Japanese in it without problem. Everything else - ;; is carefully set up to get the coding systems ready before we - ;; have to consult any paths or similarly interact with the system - ;; (except possibly finding the dump file). We need to find a way - ;; of dumping the data that we use to build the tables along with - ;; the rest of the dump data, i.e. in the same file as it or ideally - ;; as a resource attached to the executable itself, so we have - ;; access to it extremely early; then, we call - ;; init-unicode-at-startup from init_intl(), which should (perhaps) - ;; be soon enough. + (when (not load-unicode-tables-at-dump-time) + (load-unicode-tables)) - ;; An alternative is to resurrect my attempts to actually dump the - ;; created tables, which would completely solve things, although - ;; they're somewhat big (HOW BIG? INVESTIGATE) and this would - ;; preclude demand-loading the data. Another possibility would be - ;; to load the tables into memory at dump time (after writing them - ;; out in some super-compressed binary form). Yet another is to - ;; spit out the table data out in C code, which is then compiled in. - - ;; We need to go through these, compile a list of what sorts of - ;; multilingual things we want to do early at startup (start XEmacs - ;; from a Japanese or other multilingual directory? Can we then - ;; find the dump file? If the dump file is elsewhere in a Japanese - ;; directory? etc.) and see what we get with the different - ;; possibilities, and what are their strengths and weaknesses. - - (init-unicode-at-startup) - - ;; This is called (currently; might be moved earlier) from startup.el, after - ;; the basic GUI systems have been initialized, and just before the - ;; init file gets read in. It needs to finish up initializing the current - ;; language environment. Very early in the startup procedure we determined - ;; the default language environment from the locale, and bootstrapped the - ;; native, file-name and process I/O coding systems. Now we need to do it - ;; over `the right away'. + ;; This is called (currently; might be moved earlier) from startup.el, + ;; after the basic GUI systems have been initialized, and just before the + ;; init file gets read in. It needs to finish up initializing the + ;; current language environment. Very early in the startup procedure we + ;; determined the default language environment from the locale, and + ;; bootstrapped the native, file-name and process I/O coding systems. + ;; Now we need to do it over `the right away'. (finish-set-language-environment current-language-environment) ;; Load a (localizable) locale-specific init file, if it exists.
--- a/lisp/package-ui.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/package-ui.el Thu Nov 04 23:08:28 2004 +0000 @@ -509,14 +509,15 @@ (defun pui-display-maintainer (&optional no-error event) "Display a package's maintainer in the minibuffer." (interactive) - (let (extent pkg-sym info maintainer) + (let (extent ;pkg-sym + info maintainer) (save-excursion (beginning-of-line) (if (setq extent (extent-at (point) (current-buffer) 'pui)) (progn - (setq pkg-sym (extent-property extent 'pui-package) - info (extent-property extent 'pui-info) - maintainer (package-get-info-prop info 'maintainer)) + (setq ;pkg-sym (extent-property extent 'pui-package) + info (extent-property extent 'pui-info) + maintainer (package-get-info-prop info 'maintainer)) (message (format "Maintainer: %s" maintainer))) (if no-error (clear-message nil)
--- a/lisp/unicode.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/unicode.el Thu Nov 04 23:08:28 2004 +0000 @@ -77,6 +77,11 @@ ; )) +;; accessed in loadup.el, mule-cmds.el; see discussion in unicode.c +(defvar load-unicode-tables-at-dump-time (eq system-type 'windows-nt) + "[INTERNAL] Whether to load the Unicode tables at dump time. +Setting this at run-time does nothing.") + ;; NOTE: This takes only a fraction of a second on my Pentium III ;; 700Mhz even with a totally optimization-disabled XEmacs. (defun load-unicode-tables () @@ -173,9 +178,6 @@ (cdr tables)))) parse-args))) -(defun init-unicode-at-startup () - (load-unicode-tables)) - (make-coding-system 'utf-16 'unicode "UTF-16"
--- a/lisp/update-elc.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/update-elc.el Thu Nov 04 23:08:28 2004 +0000 @@ -117,7 +117,15 @@ "dumped-pkg-lisp.el" "raw-process.el" "version.el") - "Lisp files that should not be byte compiled.") + "Lisp files that should not be byte compiled. +Files in `additional-dump-dependencies' do not need to be listed here.") + +(defvar additional-dump-dependencies + '("loadup.el" + "loadup-el.el" + "update-elc.el") + "Lisp files that are not dumped but which the dump depends on. +If any of these files are changed, we need to redump.") (defvar lisp-files-ignored-when-checking-for-autoload-updating '("custom-load.el" @@ -187,10 +195,13 @@ ;; in the lisp-files-need* variables. (setq files-to-process (append lisp-files-needed-for-byte-compilation lisp-files-needing-early-byte-compilation + additional-dump-dependencies preloaded-file-list)) (while files-to-process (let* ((arg (car files-to-process)) - (arg-is-preloaded (member arg preloaded-file-list)) + (arg-is-dump-dependency + (or (member arg preloaded-file-list) + (member arg additional-dump-dependencies))) (arg-sans-extension (update-elc-chop-extension arg)) (full-arg (locate-library arg-sans-extension)) (full-arg-sans-extension @@ -209,11 +220,11 @@ (full-arg-elc (concat full-arg-sans-extension ".elc")) (full-arg-dir (file-name-directory full-arg-el))) - ;; (print full-arg-el) + ; (print full-arg-el) ;; now check if .el or .elc is newer than the dumped exe. ;; if so, need to redump. - (when (and dump-target arg-is-preloaded + (when (and dump-target arg-is-dump-dependency ;; no need to check for existence of either of the files ;; because of the definition of file-newer-than-file-p. (or (file-newer-than-file-p full-arg-el dump-target) @@ -222,6 +233,8 @@ (if (and (not (member (file-name-nondirectory arg) unbytecompiled-lisp-files)) + (not (member (file-name-nondirectory arg) + additional-dump-dependencies)) (not (member full-arg-el processed)) ;; no need to check for existence of either of the files ;; because of the definition of file-newer-than-file-p.
--- a/lisp/wid-edit.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/wid-edit.el Thu Nov 04 23:08:28 2004 +0000 @@ -2131,7 +2131,7 @@ (defun widget-url-link-action (widget &optional event) "Open the url specified by WIDGET." - (if (fboundp 'browse-url) + (if-fboundp 'browse-url (browse-url (widget-value widget)) (error 'missing-package "Cannot browse URLs in this XEmacs" 'browse-url)))
--- a/lisp/widgets-gtk.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/widgets-gtk.el Thu Nov 04 23:08:28 2004 +0000 @@ -89,7 +89,8 @@ (defun gtk-widget-instantiate-notebook-internal (plist instance) (let ((widget (gtk-notebook-new)) - (items (plist-get plist :items))) + ;(items (plist-get plist :items)) + ) ; (while items ; (gtk-notebook-append-page widget ; (gtk-vbox-new nil 3)
--- a/lisp/win32-native.el Thu Nov 04 22:51:31 2004 +0000 +++ b/lisp/win32-native.el Thu Nov 04 23:08:28 2004 +0000 @@ -1,7 +1,7 @@ ;;; win32-native.el --- Lisp routines when running on native MS Windows. ;; Copyright (C) 1994 Free Software Foundation, Inc. -;; Copyright (C) 2000 Ben Wing. +;; Copyright (C) 2000, 2004 Ben Wing. ;; Maintainer: XEmacs Development Team ;; Keywords: mouse, dumped @@ -81,9 +81,125 @@ (if (mswindows-system-shell-p shell-file-name) (setq shell-command-switch "/c"))) -;;---------------------------------------------------------------------- -;; Quoting process args -;;-------------------- +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; Quoting process args ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Converting a bunch of args into a single command line or vice-versa is +;; extremely hairy due to the quoting conventions needed. There is in fact +;; code that does this in the CRT, and perhaps we should look at it and +;; follow the logic. + +;; Here is some further info from MSDN, discovered *AFTER* the actual code +;; below was written, and hence the code may not follow what it should. +;; !!#### But this is definitely something to be fixed up. The article is +;; called "Parsing C++ Command-Line Arguments", Visual Tools and Langs -> +;; Visual Studio -> Visual C++ -> Reference -> C/C++ Lang and ... -> C++ +;; Lang Ref -> Basic Concepts -> Startup and Termination -> Program +;; Startup: the main Function. + +;; Microsoft Specific +;; +;; Microsoft C/C++ startup code uses the following rules when interpreting +;; arguments given on the operating system command line: +;; +;; Arguments are delimited by white space, which is either a space or a tab. +;; +;; The caret character (^) is not recognized as an escape character or +;; delimiter. The character is handled completely by the command-line parser +;; in the operating system before being passed to the argv array in the +;; program. +;; +;; A string surrounded by double quotation marks ("string") is interpreted as +;; a single argument, regardless of white space contained within. A quoted +;; string can be embedded in an argument. +;; +;; A double quotation mark preceded by a backslash ( \") is interpreted as a +;; literal double quotation mark character ("). +;; +;; Backslashes are interpreted literally, unless they immediately precede a +;; double quotation mark. +;; +;; If an even number of backslashes is followed by a double quotation mark, +;; one backslash is placed in the argv array for every pair of backslashes, +;; and the double quotation mark is interpreted as a string delimiter. +;; +;; If an odd number of backslashes is followed by a double quotation mark, one +;; backslash is placed in the argv array for every pair of backslashes, and +;; the double quotation mark is "escaped" by the remaining backslash, +;; causing a literal double quotation mark (") to be placed in argv. +;; +;; The following program demonstrates how command-line arguments are passed: +;; +;; include <iostream.h> +;; +;; void main( int argc, // Number of strings in array argv +;; char *argv[], // Array of command-line argument strings +;; char *envp[] ) // Array of environment variable strings +;; { +;; int count; +;; +;; // Display each command-line argument. +;; cout << "\nCommand-line arguments:\n"; +;; for( count = 0; count < argc; count++ ) +;; cout << " argv[" << count << "] " +;; << argv[count] << "\n"; +;; } +;; +;; Table 2.2 shows example input and expected output, demonstrating the rules +;; in the preceding list. +;; +;; Table 2.2 +;; +;; Command-Line Input argv[1] argv[2] argv[3] +;; ------------------------------------------ +;; "abc" d e abc d e +;; +;; a\\\b d"e f"g h a\\\b de fg h +;; +;; a\\\"b c d a\"b c d +;; +;; a\\\\"b c" d e a\\b c d e +;; +;; END Microsoft Specific +;; +;; note: for pulling apart an arg: +;; each arg consists of either + +;; something surrounded by single quotes + +;; or + +;; one or more of + +;; 1. a non-ws, non-" char +;; 2. a section of double-quoted text +;; 3. a section of double-quoted text with end-of-string instead of the final +;; quote. + +;; 2 and 3 get handled together. + +;; quoted text is one of +;; +;; 1. quote + even number of backslashes + quote, or +;; 2. quote + non-greedy anything + non-backslash + even number of +;; backslashes + quote. + +;; we need to separate the two because we unfortunately have no non-greedy +;; ? operator. (urk! we actually do, but it wasn't documented.) --ben + +;; if you want to mess around, keep this test case in mind: + +;; this string + +;; " as'f 'FOO BAR' '' \"\" \"asdf \\ \\\" \\\\\\\" asdfasdf\\\\\" foo\" " + +;; should tokenize into this: + +;; (" " "as'f" " " "'FOO BAR' " "'' " "\"\"" " " "\"asdf \\ \\\" \\\\\\\" asdfasdf\\\\\"" " " "foo" "\" ") + (defvar debug-mswindows-process-command-lines nil "If non-nil, output debug information about the command lines constructed. @@ -131,41 +247,6 @@ (defun mswindows-construct-vc-runtime-command-line (program args) (mapconcat #'mswindows-quote-one-vc-runtime-arg args " ")) -;; note: for pulling apart an arg: -;; each arg consists of either - -;; something surrounded by single quotes - -;; or - -;; one or more of - -;; 1. a non-ws, non-" char -;; 2. a section of double-quoted text -;; 3. a section of double-quoted text with end-of-string instead of the final -;; quote. - -;; 2 and 3 get handled together. - -;; quoted text is one of -;; -;; 1. quote + even number of backslashes + quote, or -;; 2. quote + non-greedy anything + non-backslash + even number of -;; backslashes + quote. - -;; we need to separate the two because we unfortunately have no non-greedy -;; ? operator. (urk! we actually do, but it wasn't documented.) --ben - -;; if you want to mess around, keep this test case in mind: - -;; this string - -;; " as'f 'FOO BAR' '' \"\" \"asdf \\ \\\" \\\\\\\" asdfasdf\\\\\" foo\" " - -;; should tokenize into this: - -;; (" " "as'f" " " "'FOO BAR' " "'' " "\"\"" " " "\"asdf \\ \\\" \\\\\\\" asdfasdf\\\\\"" " " "foo" "\" ") - ;; this regexp actually separates the arg into individual args, like a ;; shell (such as sh) does, but using vc-runtime rules. it's easy to ;; derive the tokenizing regexp from it, and that's exactly what i did.
--- a/man/ChangeLog Thu Nov 04 22:51:31 2004 +0000 +++ b/man/ChangeLog Thu Nov 04 23:08:28 2004 +0000 @@ -1,3 +1,310 @@ +2004-11-04 Ben Wing <ben@xemacs.org> + + * lispref/mule.texi (CCL Syntax): + * lispref/mule.texi (INT-OR-CHAR): New. + * lispref/mule.texi (CCL Statements): + Update CCL docs. + +2004-11-04 Ben Wing <ben@xemacs.org> + + * internals/internals.texi (Top): + * internals/internals.texi (NOTE): New. + * internals/internals.texi (list-to-texinfo): New. + * internals/internals.texi (remove-spacing): New. + * internals/internals.texi (table-to-texinfo): New. + * internals/internals.texi (convert-text-to-texinfo): New. + * internals/internals.texi ('make-future): New. + * internals/internals.texi ('make-discussion): New. + * internals/internals.texi ('make-old-future): New. + * internals/internals.texi ('make-section): New. + * internals/internals.texi ('make-subsection): New. + * internals/internals.texi (Introduction): + * internals/internals.texi (divisions): New. + * internals/internals.texi (Authorship of XEmacs): + * internals/internals.texi (XEmacs): + * internals/internals.texi (The XEmacs Split): + * internals/internals.texi (Author): New. + * internals/internals.texi (XEmacs from the Outside): + * internals/internals.texi (The Lisp Language): + * internals/internals.texi (XEmacs from the Perspective of Building): + * internals/internals.texi (Build-Time Dependencies): + * internals/internals.texi (The Modules of XEmacs): + * internals/internals.texi (A Summary of the Various XEmacs Modules): + * internals/internals.texi (ways): Removed. + * internals/internals.texi (Low-Level Modules): + * internals/internals.texi (Basic Lisp Modules): + * internals/internals.texi (Modules for Standard Editing Operations): + * internals/internals.texi (files): Removed. + * internals/internals.texi (Modules for Interfacing with the File System): + * internals/internals.texi (some_variable): Removed. + * internals/internals.texi (Modules for Other Aspects of the Lisp Interpreter and Object System): + * internals/internals.texi (Modules for Interfacing with the Operating System): + * internals/internals.texi (character): Removed. + * internals/internals.texi (Major Textual Changes): + * internals/internals.texi (Great Integral Type Renaming): + * internals/internals.texi (commands): Removed. + * internals/internals.texi (Text/Char Type Renaming): + * internals/internals.texi (pattern): Removed. + * internals/internals.texi (Rules When Writing New C Code): + * internals/internals.texi (A Reader's Guide to XEmacs Coding Conventions): + * internals/internals.texi (General Coding Rules): + * internals/internals.texi (examples): Removed. + * internals/internals.texi (Object-Oriented Techniques for C): + * internals/internals.texi (Writing Lisp Primitives): + * internals/internals.texi (Writing Good Comments): + * internals/internals.texi (Adding Global Lisp Variables): + * internals/internals.texi (Writing Macros): + * internals/internals.texi (Proper Use of Unsigned Types): + * internals/internals.texi (Techniques for XEmacs Developers): + * internals/internals.texi (Regression Testing XEmacs): + * internals/internals.texi (How to Regression-Test): + * internals/internals.texi (Modules for Regression Testing): + * internals/internals.texi (CVS Techniques): + * internals/internals.texi (Merging a Branch into the Trunk): + * internals/internals.texi (XEmacs from the Inside): + * internals/internals.texi (The XEmacs Object System (Abstractly Speaking)): + * internals/internals.texi (How Lisp Objects Are Represented in C): + * internals/internals.texi (Allocation of Objects in XEmacs Lisp): + * internals/internals.texi (Introduction to Allocation): + * internals/internals.texi (Garbage Collection): + * internals/internals.texi (GCPROing): + * internals/internals.texi (Garbage Collection - Step by Step): + * internals/internals.texi (Invocation): + * internals/internals.texi (garbage_collect_1): + * internals/internals.texi (mark_object): + * internals/internals.texi (gc_sweep): + * internals/internals.texi (sweep_lcrecords_1): + * internals/internals.texi (compact_string_chars): + * internals/internals.texi (sweep_strings): + * internals/internals.texi (sweep_bit_vectors_1): + * internals/internals.texi (Integers and Characters): + * internals/internals.texi (Allocation from Frob Blocks): + * internals/internals.texi (lrecords): + * internals/internals.texi (Low-level allocation): + * internals/internals.texi (Cons): + * internals/internals.texi (Vector): + * internals/internals.texi (Bit Vector): + * internals/internals.texi (Symbol): + * internals/internals.texi (Marker): + * internals/internals.texi (String): + * internals/internals.texi (Compiled Function): + * internals/internals.texi (The Lisp Reader and Compiler): + * internals/internals.texi (Evaluation; Stack Frames; Bindings): + * internals/internals.texi (Evaluation): + * internals/internals.texi (Dynamic Binding; The specbinding Stack; Unwind-Protects): + * internals/internals.texi (Simple Special Forms): + * internals/internals.texi (Catch and Throw): + * internals/internals.texi (Error Trapping): + * internals/internals.texi (Symbols and Variables): + * internals/internals.texi (Introduction to Symbols): + * internals/internals.texi (Obarrays): + * internals/internals.texi (Symbol Values): + * internals/internals.texi (Buffers): + * internals/internals.texi (Introduction to Buffers): + * internals/internals.texi (Buffer Lists): + * internals/internals.texi (Markers and Extents): + * internals/internals.texi (The Buffer Object): + * internals/internals.texi (Text): + * internals/internals.texi (The Text in a Buffer): + * internals/internals.texi (Ibytes and Ichars): + * internals/internals.texi (Byte-Char Position Conversion): + * internals/internals.texi (Searching and Matching): + * internals/internals.texi (Multilingual Support): + * internals/internals.texi (Introduction to Multilingual Issues #1): + * internals/internals.texi (Introduction to Multilingual Issues #2): + * internals/internals.texi (Introduction to Multilingual Issues #3): + * internals/internals.texi (Introduction to Multilingual Issues #4): + * internals/internals.texi (Character Sets): + * internals/internals.texi (Encodings): + * internals/internals.texi (Japanese EUC (Extended Unix Code)): + * internals/internals.texi (JIS7): + * internals/internals.texi (Internal Mule Encodings): + * internals/internals.texi (Internal String Encoding): + * internals/internals.texi (Internal Character Encoding): + * internals/internals.texi (Byte/Character Types; Buffer Positions; Other Typedefs): + * internals/internals.texi (Byte Types): + * internals/internals.texi (Different Ways of Seeing Internal Text): + * internals/internals.texi (Buffer Positions): + * internals/internals.texi (Other Typedefs): + * internals/internals.texi (Usage of the Various Representations): + * internals/internals.texi (Working With the Various Representations): + * internals/internals.texi (Internal Text API's): + * internals/internals.texi (Basic internal-format API's): + * internals/internals.texi (The DFC API): + * internals/internals.texi (The Eistring API): + * internals/internals.texi (Coding for Mule): + * internals/internals.texi (Character-Related Data Types): + * internals/internals.texi (Working With Character and Byte Positions): + * internals/internals.texi (Conversion to and from External Data): + * internals/internals.texi (General Guidelines for Writing Mule-Aware Code): + * internals/internals.texi (An Example of Mule-Aware Code): + * internals/internals.texi (Mule-izing Code): + * internals/internals.texi (CCL): + * internals/internals.texi (Microsoft Windows-Related Multilingual Issues): + * internals/internals.texi (Microsoft Documentation): + * internals/internals.texi (Locales): + * internals/internals.texi (More about code pages): + * internals/internals.texi (More about locales): + * internals/internals.texi (Unicode support under Windows): + * internals/internals.texi (The golden rules of writing Unicode-safe code): + * internals/internals.texi (The format of the locale in setlocale()): + * internals/internals.texi (Random other Windows I18N docs): + * internals/internals.texi (Modules for Internationalization): + * internals/internals.texi (Consoles; Devices; Frames; Windows): + * internals/internals.texi (Introduction to Consoles; Devices; Frames; Windows): + * internals/internals.texi (Point): + * internals/internals.texi (Window Hierarchy): + * internals/internals.texi (The Window Object): + * internals/internals.texi (Modules for the Basic Displayable Lisp Objects): + * internals/internals.texi (The Redisplay Mechanism): + * internals/internals.texi (Critical Redisplay Sections): + * internals/internals.texi (Line Start Cache): + * internals/internals.texi (Redisplay Piece by Piece): + * internals/internals.texi (Modules for the Redisplay Mechanism): + * internals/internals.texi (Modules for other Display-Related Lisp Objects): + * internals/internals.texi (Extents): + * internals/internals.texi (Introduction to Extents): + * internals/internals.texi (Extent Ordering): + * internals/internals.texi (Format of the Extent Info): + * internals/internals.texi (Zero-Length Extents): + * internals/internals.texi (Mathematics of Extent Ordering): + * internals/internals.texi (Extent Fragments): + * internals/internals.texi (Faces): + * internals/internals.texi (Glyphs): + * internals/internals.texi (Specifiers): + * internals/internals.texi (Menus): + * internals/internals.texi (Events and the Event Loop): + * internals/internals.texi (Introduction to Events): + * internals/internals.texi (Main Loop): + * internals/internals.texi (Specifics of the Event Gathering Mechanism): + * internals/internals.texi (Specifics About the Emacs Event): + * internals/internals.texi (Event Queues): + * internals/internals.texi (Event Stream Callback Routines): + * internals/internals.texi (Other Event Loop Functions): + * internals/internals.texi (Stream Pairs): + * internals/internals.texi (Converting Events): + * internals/internals.texi (Dispatching Events; The Command Builder): + * internals/internals.texi (Focus Handling): + * internals/internals.texi (Editor-Level Control Flow Modules): + * internals/internals.texi (Asynchronous Events; Quit Checking): + * internals/internals.texi (Signal Handling): + * internals/internals.texi (Control-G (Quit) Checking): + * internals/internals.texi (Profiling): + * internals/internals.texi (Asynchronous Timeouts): + * internals/internals.texi (Exiting): + * internals/internals.texi (Lstreams): + * internals/internals.texi (Creating an Lstream): + * internals/internals.texi (Lstream Types): + * internals/internals.texi (Lstream Functions): + * internals/internals.texi (Lstream Methods): + * internals/internals.texi (Subprocesses): + * internals/internals.texi (Interface to MS Windows): + * internals/internals.texi (Different kinds of Windows environments): + * internals/internals.texi (Windows Build Flags): + * internals/internals.texi (Windows I18N Introduction): + * internals/internals.texi (Modules for Interfacing with MS Windows): + * internals/internals.texi (Interface to the X Window System): + * internals/internals.texi (Lucid Widget Library): + * internals/internals.texi (Generic Widget Interface): + * internals/internals.texi (dependencies): New. + * internals/internals.texi (routines): New. + * internals/internals.texi (Summary): New. + * internals/internals.texi (Scrollbars): + * internals/internals.texi (Menubars): + * internals/internals.texi (Checkboxes and Radio Buttons): + * internals/internals.texi (Progress Bars): + * internals/internals.texi (Tab Controls): + * internals/internals.texi (Modules for Interfacing with X Windows): + * internals/internals.texi (Dumping): + * internals/internals.texi (Dumping Justification): + * internals/internals.texi (Overview): + * internals/internals.texi (Data descriptions): + * internals/internals.texi (Dumping phase): + * internals/internals.texi (Object inventory): + * internals/internals.texi (Address allocation): + * internals/internals.texi (The header): + * internals/internals.texi (Data dumping): + * internals/internals.texi (Pointers dumping): + * internals/internals.texi (Reloading phase): + * internals/internals.texi (Abstract): New. + * internals/internals.texi (Remaining issues): + * internals/internals.texi (Future Work): + * internals/internals.texi (Future Work -- General Suggestions): + * internals/internals.texi (Future Work -- Elisp Compatibility Package): + * internals/internals.texi (Future Work -- Drag-n-Drop): + * internals/internals.texi (Future Work -- Standard Interface for Enabling Extensions): + * internals/internals.texi (Future Work -- Better Initialization File Scheme): + * internals/internals.texi (Future Work -- Keyword Parameters): + * internals/internals.texi (Future Work -- Property Interface Changes): + * internals/internals.texi (Future Work -- Toolbars): + * internals/internals.texi (Future Work -- Easier Toolbar Customization): + * internals/internals.texi (Future Work -- Toolbar Interface Changes): + * internals/internals.texi (Future Work -- Menu API Changes): + * internals/internals.texi (Future Work -- Removal of Misc-User Event Type): + * internals/internals.texi (Future Work -- Mouse Pointer): + * internals/internals.texi (Future Work -- Abstracted Mouse Pointer Interface): + * internals/internals.texi (Future Work -- Busy Pointer): + * internals/internals.texi (Future Work -- Extents): + * internals/internals.texi (Future Work -- Everything should obey duplicable extents): + * internals/internals.texi (Future Work -- Version Number and Development Tree Organization): + * internals/internals.texi (Future Work -- Improvements to the @code{xemacs.org} Website): + * internals/internals.texi (Future Work -- Keybindings): + * internals/internals.texi (Future Work -- Keybinding Schemes): + * internals/internals.texi (Future Work -- Better Support for Windows Style Key Bindings): + * internals/internals.texi (Future Work -- Misc Key Binding Ideas): + * internals/internals.texi (Future Work -- Byte Code Snippets): + * internals/internals.texi (Future Work -- Autodetection): + * internals/internals.texi (Future Work -- Conversion Error Detection): + * internals/internals.texi (Future Work -- Unicode): + * internals/internals.texi (Future Work -- BIDI Support): + * internals/internals.texi (Future Work -- Localized Text/Messages): + * internals/internals.texi (Future Work -- Lisp Stream API): + * internals/internals.texi (Future Work -- Multiple Values): + * internals/internals.texi (Future Work -- Macros): + * internals/internals.texi (Future Work -- Specifiers): + * internals/internals.texi (Future Work -- Display Tables): + * internals/internals.texi (Future Work -- Making Elisp Function Calls Faster): + * internals/internals.texi (Future Work -- Lisp Engine Replacement): + * internals/internals.texi (Future Work -- Lisp Engine Discussion): + * internals/internals.texi (Future Work -- Lisp Engine Replacement -- Implementation): + * internals/internals.texi (Future Work -- Startup File Modification by Packages): + * internals/internals.texi (Future Work Discussion): + * internals/internals.texi (Discussion -- garbage collection): + * internals/internals.texi (Discussion -- glyphs): + * internals/internals.texi (Discussion -- Dialog Boxes): + * internals/internals.texi (Discussion -- Multilingual Issues): + * internals/internals.texi (Discussion -- Windows External Widget): + * internals/internals.texi (Discussion -- Packages): + * internals/internals.texi (Discussion -- Distribution Layout): + * internals/internals.texi (Old Future Work): + * internals/internals.texi (Old Future Work -- A Portable Unexec Replacement): + * internals/internals.texi (backtrace): New. + * internals/internals.texi (Old Future Work -- Indirect Buffers): + * internals/internals.texi (emacs-lisp): New. + * internals/internals.texi (Old Future Work -- Improvements in support for non-ASCII (European) keysyms under X): + * internals/internals.texi (Newsgroups): New. + * internals/internals.texi (Old Future Work -- RTF Clipboard Support): + * internals/internals.texi (own-selection): New. + * internals/internals.texi (Old Future Work -- xemacs.org Mailing Address Changes): + * internals/internals.texi (COMMENT): New. + * internals/internals.texi (Old Future Work -- Lisp callbacks from critical areas of the C code): + * internals/internals.texi (Now): Removed. + * internals/internals.texi (Proof): Removed. + * internals/internals.texi (Note): Removed. + * internals/internals.texi (Date): New. + * internals/internals.texi (ben): Removed. + * internals/internals.texi (importance): New. + * internals/internals.texi (From): New. + Major work on internals manual. Rearranged many chapters so as to + lie in coherent divisions. + Add tons of stuff to Future Work, Old Future Work, Discussions. + Add lots of stuff to Mule section (Multilingual ...). + Remove index.texi, incorporate into internals.texi. + Section on early history and an introduction. + Section on XEmacs split. Lots of new MS Windows docs + Mostly recently: Windows-I18N docs. Lots if new I18N docs. + Loads of other stuff. + 2004-11-02 Ben Wing <ben@xemacs.org> * internals/index.texi:
--- a/man/lispref/mule.texi Thu Nov 04 22:51:31 2004 +0000 +++ b/man/lispref/mule.texi Thu Nov 04 23:08:28 2004 +0000 @@ -1787,13 +1787,13 @@ CCL_BLOCK := STATEMENT | (STATEMENT [STATEMENT ...]) STATEMENT := - SET | IF | BRANCH | LOOP | REPEAT | BREAK | READ | WRITE - | CALL | END + SET | IF | BRANCH | LOOP | REPEAT | BREAK | READ | WRITE | CALL + | TRANSLATE | MAP | END SET := (REG = EXPRESSION) | (REG ASSIGNMENT_OPERATOR EXPRESSION) - | integer + | INT-OR-CHAR EXPRESSION := ARG | (EXPRESSION OPERATOR ARG) @@ -1803,28 +1803,30 @@ BREAK := (break) REPEAT := (repeat) - | (write-repeat [REG | integer | string]) - | (write-read-repeat REG [integer | ARRAY]) + | (write-repeat [REG | INT-OR-CHAR | string]) + | (write-read-repeat REG [INT-OR-CHAR | ARRAY]) READ := (read REG ...) - | (read-if (REG OPERATOR ARG) CCL_BLOCK CCL_BLOCK) + | (read-if (REG OPERATOR ARG) CCL_BLOCK [CCL_BLOCK]) | (read-branch REG CCL_BLOCK [CCL_BLOCK ...]) WRITE := (write REG ...) | (write EXPRESSION) - | (write integer) | (write string) | (write REG ARRAY) + | (write INT-OR-CHAR) | (write string) | (write REG ARRAY) | string CALL := (call ccl-program-name) END := (end) REG := r0 | r1 | r2 | r3 | r4 | r5 | r6 | r7 -ARG := REG | integer +ARG := REG | INT-OR-CHAR OPERATOR := + | - | * | / | % | & | '|' | ^ | << | >> | <8 | >8 | // | < | > | == | <= | >= | != | de-sjis | en-sjis ASSIGNMENT_OPERATOR := += | -= | *= | /= | %= | &= | '|=' | ^= | <<= | >>= -ARRAY := '[' integer ... ']' +ARRAY := '[' INT-OR-CHAR ... ']' +INT-OR-CHAR := integer | character + @end format @node CCL Statements, CCL Expressions, CCL Syntax, CCL @@ -1856,7 +1858,7 @@ The @dfn{write} takes several forms. In the form @samp{(write @var{reg} ...)} it takes one or more registers as arguments and writes each in turn to the output. The integer in a register (interpreted as an -Emchar) is encoded to multibyte form (ie, Bufbytes) and written to the +Ichar) is encoded to multibyte form (ie, Ibytes) and written to the current output buffer. If it is less than 256, it is written as is. The forms @samp{(write @var{expression})} and @samp{(write @var{integer})} are treated analogously. The form @samp{(write
--- a/modules/ChangeLog Thu Nov 04 22:51:31 2004 +0000 +++ b/modules/ChangeLog Thu Nov 04 23:08:28 2004 +0000 @@ -1,3 +1,14 @@ +2004-10-27 Ben Wing <ben@xemacs.org> + + * ldap/eldap.c: + * ldap/eldap.c (Fldap_open): + * ldap/eldap.c (Fldap_search_basic): + * ldap/eldap.c (Fldap_add): + * ldap/eldap.c (Fldap_modify): + * ldap/eldap.c (Fldap_delete): + Mule-ize. + Use EXTERNAL_LIST_LOOP_2 instead of deleted EXTERNAL_LIST_LOOP. + 2004-10-22 Stephen J. Turnbull <stephen@xemacs.org> * XEmacs 21.5.18 "chestnut" is released.
--- a/modules/ldap/eldap.c Thu Nov 04 22:51:31 2004 +0000 +++ b/modules/ldap/eldap.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,5 +1,7 @@ /* LDAP client interface for XEmacs. Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 2004 Ben Wing. + This file is part of XEmacs. @@ -97,7 +99,7 @@ #endif } invalid_operation ("LDAP error", - build_string (ldap_err2string (ldap_err))); + build_ext_string (ldap_err2string (ldap_err), Qnative)); } @@ -223,8 +225,8 @@ LDAP *ld; int ldap_port = 0; int ldap_auth = LDAP_AUTH_SIMPLE; - char *ldap_binddn = NULL; - char *ldap_password = NULL; + Extbyte *ldap_binddn = NULL; + Extbyte *ldap_password = NULL; int ldap_deref = LDAP_DEREF_NEVER; int ldap_timelimit = 0; int ldap_sizelimit = 0; @@ -305,7 +307,7 @@ /* Connect to the server and bind */ slow_down_interrupts (); - ld = ldap_open ((char *) XSTRING_DATA (host), ldap_port); + ld = ldap_open (NEW_LISP_STRING_TO_EXTERNAL (host, Qnative), ldap_port); speed_up_interrupts (); if (ld == NULL ) @@ -343,10 +345,8 @@ err = ldap_bind_s (ld, ldap_binddn, ldap_password, ldap_auth); if (err != LDAP_SUCCESS) { - Ibyte *interrmess; - EXTERNAL_TO_C_STRING (ldap_err2string (err), interrmess, Qnative); signal_error (Qprocess_error, "Failed binding to the server", - build_intstring (interrmess)); + build_ext_string (ldap_err2string (err), Qnative)); } ldap = allocate_ldap (); @@ -425,13 +425,13 @@ LDAP *ld; LDAPMessage *e; BerElement *ptr; - char *a, *dn; + Extbyte *a, *dn; int i, rc; int matches; struct ldap_unwind_struct unwind; int ldap_scope = LDAP_SCOPE_SUBTREE; - char **ldap_attributes = NULL; + Extbyte **ldap_attributes = NULL; int speccount = specpdl_depth (); @@ -482,13 +482,14 @@ ldap_attributes = alloca_array (char *, 1 + XINT (Flength (attrs))); i = 0; - EXTERNAL_LIST_LOOP (attrs, attrs) - { - Lisp_Object current = XCAR (attrs); - CHECK_STRING (current); - LISP_STRING_TO_EXTERNAL (current, ldap_attributes[i], Qnative); - ++i; - } + { + EXTERNAL_LIST_LOOP_2 (current, attrs) + { + CHECK_STRING (current); + LISP_STRING_TO_EXTERNAL (current, ldap_attributes[i], Qnative); + ++i; + } + } ldap_attributes[i] = NULL; } @@ -497,9 +498,11 @@ /* Perform the search */ if (ldap_search (ld, - NILP (base) ? (char *) "" : (char *) XSTRING_DATA (base), + NILP (base) ? "" : + NEW_LISP_STRING_TO_EXTERNAL (base, Qnative), ldap_scope, - NILP (filter) ? (char *) "" : (char *) XSTRING_DATA (filter), + NILP (filter) ? "" : + NEW_LISP_STRING_TO_EXTERNAL (filter, Qnative), ldap_attributes, NILP (attrsonly) ? 0 : 1) == -1) @@ -536,9 +539,9 @@ signal_ldap_error (ld, e, 0); entry = Fcons (build_ext_string (dn, Qnative), Qnil); } - for (a= ldap_first_attribute (ld, e, &ptr); + for (a = ldap_first_attribute (ld, e, &ptr); a != NULL; - a = ldap_next_attribute (ld, e, ptr) ) + a = ldap_next_attribute (ld, e, ptr)) { list = Fcons (build_ext_string (a, Qnative), Qnil); unwind.vals = ldap_get_values_len (ld, e, a); @@ -618,9 +621,9 @@ Lisp_Object current = Qnil; Lisp_Object values = Qnil; - struct gcpro gcpro1, gcpro2; + struct gcpro gcpro1; - GCPRO2 (current, values); + GCPRO1 (values); /* Do all the parameter checking */ CHECK_LIVE_LDAP (ldap); @@ -639,51 +642,57 @@ ldap_mods = alloca_array (LDAPMod, len); ldap_mods_ptrs = alloca_array (LDAPMod *, 1 + len); i = 0; - EXTERNAL_LIST_LOOP (entry, entry) - { - current = XCAR (entry); - CHECK_CONS (current); - CHECK_STRING (XCAR (current)); - ldap_mods_ptrs[i] = &(ldap_mods[i]); - LISP_STRING_TO_EXTERNAL (XCAR (current), ldap_mods[i].mod_type, Qnative); - ldap_mods[i].mod_op = LDAP_MOD_ADD | LDAP_MOD_BVALUES; - values = XCDR (current); - if (CONSP (values)) - { - len = (Elemcount) XINT (Flength (values)); - bervals = alloca_array (struct berval, len); - ldap_mods[i].mod_vals.modv_bvals = - alloca_array (struct berval *, 1 + len); - j = 0; - EXTERNAL_LIST_LOOP (values, values) - { - current = XCAR (values); - CHECK_STRING (current); - ldap_mods[i].mod_vals.modv_bvals[j] = &(bervals[j]); - TO_EXTERNAL_FORMAT (LISP_STRING, current, - ALLOCA, (bervals[j].bv_val, - bervals[j].bv_len), - Qnative); - j++; - } - ldap_mods[i].mod_vals.modv_bvals[j] = NULL; - } - else - { - CHECK_STRING (values); - bervals = alloca_array (struct berval, 1); - ldap_mods[i].mod_vals.modv_bvals = alloca_array (struct berval *, 2); - ldap_mods[i].mod_vals.modv_bvals[0] = &(bervals[0]); - TO_EXTERNAL_FORMAT (LISP_STRING, values, - ALLOCA, (bervals[0].bv_val, - bervals[0].bv_len), - Qnative); - ldap_mods[i].mod_vals.modv_bvals[1] = NULL; - } - i++; - } + + { + EXTERNAL_LIST_LOOP_2 (current, entry) + { + CHECK_CONS (current); + CHECK_STRING (XCAR (current)); + ldap_mods_ptrs[i] = &(ldap_mods[i]); + LISP_STRING_TO_EXTERNAL (XCAR (current), ldap_mods[i].mod_type, + Qnative); + ldap_mods[i].mod_op = LDAP_MOD_ADD | LDAP_MOD_BVALUES; + values = XCDR (current); + if (CONSP (values)) + { + len = (Elemcount) XINT (Flength (values)); + bervals = alloca_array (struct berval, len); + ldap_mods[i].mod_vals.modv_bvals = + alloca_array (struct berval *, 1 + len); + j = 0; + { + EXTERNAL_LIST_LOOP_2 (cur2, values) + { + CHECK_STRING (cur2); + ldap_mods[i].mod_vals.modv_bvals[j] = &(bervals[j]); + TO_EXTERNAL_FORMAT (LISP_STRING, cur2, + ALLOCA, (bervals[j].bv_val, + bervals[j].bv_len), + Qnative); + j++; + } + } + ldap_mods[i].mod_vals.modv_bvals[j] = NULL; + } + else + { + CHECK_STRING (values); + bervals = alloca_array (struct berval, 1); + ldap_mods[i].mod_vals.modv_bvals = alloca_array (struct berval *, + 2); + ldap_mods[i].mod_vals.modv_bvals[0] = &(bervals[0]); + TO_EXTERNAL_FORMAT (LISP_STRING, values, + ALLOCA, (bervals[0].bv_val, + bervals[0].bv_len), + Qnative); + ldap_mods[i].mod_vals.modv_bvals[1] = NULL; + } + i++; + } + } ldap_mods_ptrs[i] = NULL; - rc = ldap_add_s (ld, (char *) XSTRING_DATA (dn), ldap_mods_ptrs); + rc = ldap_add_s (ld, NEW_LISP_STRING_TO_EXTERNAL (dn, Qnative), + ldap_mods_ptrs); if (rc != LDAP_SUCCESS) signal_ldap_error (ld, NULL, rc); @@ -710,7 +719,6 @@ Lisp_Object mod_op; Elemcount len; - Lisp_Object current = Qnil; Lisp_Object values = Qnil; struct gcpro gcpro1, gcpro2; @@ -732,48 +740,50 @@ ldap_mods_ptrs = alloca_array (LDAPMod *, 1 + len); i = 0; - GCPRO2 (current, values); - EXTERNAL_LIST_LOOP (mods, mods) - { - current = XCAR (mods); - CHECK_CONS (current); - CHECK_SYMBOL (XCAR (current)); - mod_op = XCAR (current); - ldap_mods_ptrs[i] = &(ldap_mods[i]); - ldap_mods[i].mod_op = LDAP_MOD_BVALUES; - if (EQ (mod_op, Qadd)) - ldap_mods[i].mod_op |= LDAP_MOD_ADD; - else if (EQ (mod_op, Qdelete)) - ldap_mods[i].mod_op |= LDAP_MOD_DELETE; - else if (EQ (mod_op, Qreplace)) - ldap_mods[i].mod_op |= LDAP_MOD_REPLACE; - else - invalid_constant ("Invalid LDAP modification type", mod_op); - current = XCDR (current); - CHECK_STRING (XCAR (current)); - LISP_STRING_TO_EXTERNAL (XCAR (current), ldap_mods[i].mod_type, Qnative); - values = XCDR (current); - len = (Elemcount) XINT (Flength (values)); - bervals = alloca_array (struct berval, len); - ldap_mods[i].mod_vals.modv_bvals = - alloca_array (struct berval *, 1 + len); - j = 0; - EXTERNAL_LIST_LOOP (values, values) - { - current = XCAR (values); - CHECK_STRING (current); - ldap_mods[i].mod_vals.modv_bvals[j] = &(bervals[j]); - TO_EXTERNAL_FORMAT (LISP_STRING, current, - ALLOCA, (bervals[j].bv_val, - bervals[j].bv_len), - Qnative); - j++; - } - ldap_mods[i].mod_vals.modv_bvals[j] = NULL; - i++; - } + GCPRO1 (values); + { + EXTERNAL_LIST_LOOP_2 (current, mods) + { + CHECK_CONS (current); + CHECK_SYMBOL (XCAR (current)); + mod_op = XCAR (current); + ldap_mods_ptrs[i] = &(ldap_mods[i]); + ldap_mods[i].mod_op = LDAP_MOD_BVALUES; + if (EQ (mod_op, Qadd)) + ldap_mods[i].mod_op |= LDAP_MOD_ADD; + else if (EQ (mod_op, Qdelete)) + ldap_mods[i].mod_op |= LDAP_MOD_DELETE; + else if (EQ (mod_op, Qreplace)) + ldap_mods[i].mod_op |= LDAP_MOD_REPLACE; + else + invalid_constant ("Invalid LDAP modification type", mod_op); + current = XCDR (current); + CHECK_STRING (XCAR (current)); + LISP_STRING_TO_EXTERNAL (XCAR (current), ldap_mods[i].mod_type, + Qnative); + values = XCDR (current); + len = (Elemcount) XINT (Flength (values)); + bervals = alloca_array (struct berval, len); + ldap_mods[i].mod_vals.modv_bvals = + alloca_array (struct berval *, 1 + len); + j = 0; + EXTERNAL_LIST_LOOP_2 (cur2, values) + { + CHECK_STRING (cur2); + ldap_mods[i].mod_vals.modv_bvals[j] = &(bervals[j]); + TO_EXTERNAL_FORMAT (LISP_STRING, cur2, + ALLOCA, (bervals[j].bv_val, + bervals[j].bv_len), + Qnative); + j++; + } + ldap_mods[i].mod_vals.modv_bvals[j] = NULL; + i++; + } + } ldap_mods_ptrs[i] = NULL; - rc = ldap_modify_s (ld, (char *) XSTRING_DATA (dn), ldap_mods_ptrs); + rc = ldap_modify_s (ld, NEW_LISP_STRING_TO_EXTERNAL (dn, Qnative), + ldap_mods_ptrs); if (rc != LDAP_SUCCESS) signal_ldap_error (ld, NULL, rc); @@ -797,7 +807,7 @@ ld = XLDAP (ldap)->ld; CHECK_STRING (dn); - rc = ldap_delete_s (ld, (char *) XSTRING_DATA (dn)); + rc = ldap_delete_s (ld, NEW_LISP_STRING_TO_EXTERNAL (dn, Qnative)); if (rc != LDAP_SUCCESS) signal_ldap_error (ld, NULL, rc);
--- a/src/ChangeLog Thu Nov 04 22:51:31 2004 +0000 +++ b/src/ChangeLog Thu Nov 04 23:08:28 2004 +0000 @@ -1,3 +1,1481 @@ +2004-10-27 Ben Wing <ben@xemacs.org> + + --------------------------------------------------------------- + MULE-RELATED WORK: + --------------------------------------------------------------- + + --------------------------- + byte-char conversion + --------------------------- + + * buffer.c: + * buffer.h (BUFFER_TEXT_LOOP): + * buffer.h (BYTE_BUF_CEILING_OF_IGNORE_ACCESSIBLE): + * buffer.h (BYTE_BUF_FLOOR_OF): + * buffer.h (NUM_CACHED_POSITIONS): + * buffer.h (struct buffer_text): + * buffer.h: + * insdel.c (BUF_GPT_ADDR): + * insdel.c (SET_BOTH_BUF_GPT): + * insdel.c (SET_BOTH_BUF_Z): + * insdel.c (buffer_delete_range): + * insdel.c (buffer_insert_string_1): + * insdel.c (gap_left): + * insdel.c (gap_right): + * insdel.c (init_buffer_text): + * insdel.c (make_gap): + * insdel.c (merge_gap_with_end_gap): + * insdel.c (move_gap): + * insdel.c: + * text.c (buffer_mule_signal_deleted_region): + * text.c (buffer_mule_signal_inserted_region): + * text.c (bytebpos_to_charbpos_func): + * text.c (charbpos_to_bytebpos_func): + * text.c (skip_ascii): + * text.c (skip_ascii_down): + Port FSF algorithm for byte-char conversion, replacing broken + previous version. Track the char position of the gap. Add + functions to do char-byte conversion downwards as well as upwards. + Move comments about algorithm workings to internals manual. + + --------------------------- + work on types + --------------------------- + + * alloc.c: + * alloc.c (gc_plist_hack): + * console-x-impl.h (struct x_frame): + * dump-data.c: + * dump-data.c (dumped_data_size): + * dump-data.c (dumped_data_max_size): + * dump-data.c (dumped_data_align_offset): + * dump-data.c (dumped_data_get): + * dump-data.h: + * dump-data.h (dumped_data_get): + * dumper.c: + * dumper.c (struct): + * dumper.c (PDUMP_READ): + * dumper.c (PDUMP_READ_ALIGNED): + * dumper.c (pdump_objects_unmark): + * dumper.c (pdump_register_sub): + * dumper.c (pdump_register_struct_contents): + * dumper.c (pdump_store_new_pointer_offsets): + * dumper.c (pdump_reloc_one): + * dumper.c (pdump_dump_root_struct_ptrs): + * dumper.c (pdump_dump_root_lisp_objects): + * dumper.c (pdump): + * dumper.c (pdump_load_check): + * dumper.c (pdump_load_finish): + * dialog-msw.c: + * dired-msw.c (mswindows_format_file): + * doc.c (get_doc_string): + * doc.c (Fsnarf_documentation): + * doc.c (kludgily_ignore_lost_doc_p): + * editfns.c: + * esd.c (esd_play_sound_data): + * event-gtk.h (emacs_shell_event_handler): + * event-msw.c (mswindows_dde_callback): + * events.c (format_event_object): + * file-coding.c (struct subsidiary_type): + * file-coding.c (setup_eol_coding_systems): + * file-coding.c (make_coding_system_1): + * file-coding.c (make_internal_coding_system): + * file-coding.h: + * fns.c (add_suffix_to_symbol): + * fns.c (add_prefix_to_symbol): + * glyphs-eimage.c (struct jpeg_unwind_data): + * glyphs-eimage.c (jpeg_instantiate_unwind): + * glyphs-eimage.c (jpeg_instantiate): + * glyphs-eimage.c (struct gif_unwind_data): + * glyphs-eimage.c (gif_instantiate_unwind): + * glyphs-eimage.c (gif_memory_storage): + * glyphs-eimage.c (gif_instantiate): + * glyphs-eimage.c (struct png_memory_storage): + * glyphs-eimage.c (struct png_unwind_data): + * glyphs-eimage.c (png_instantiate_unwind): + * glyphs-eimage.c (png_instantiate): + * glyphs-eimage.c (struct tiff_unwind_data): + * glyphs-eimage.c (tiff_instantiate_unwind): + * glyphs-eimage.c (tiff_memory_storage): + * glyphs-eimage.c (tiff_instantiate): + * glyphs-gtk.c (gtk_xpm_instantiate): + * glyphs-msw.c (convert_EImage_to_DIBitmap): + * glyphs-msw.c (mswindows_init_image_instance_from_eimage): + * glyphs-msw.c (set_mono_pixel): + * glyphs-msw.c (mswindows_initialize_image_instance_mask): + * glyphs-msw.c (xpm_to_eimage): + * glyphs-msw.c (mswindows_xpm_instantiate): + * glyphs-msw.c (xbm_create_bitmap_from_data): + * glyphs-msw.c (init_image_instance_from_xbm_inline): + * glyphs-msw.c (xbm_instantiate_1): + * glyphs-msw.c (mswindows_xbm_instantiate): + * glyphs-msw.c (mswindows_xface_instantiate): + * glyphs-shared.c (read_bitmap_data): + * glyphs-shared.c (read_bitmap_data_from_file): + * glyphs-x.c (convert_EImage_to_XImage): + * glyphs-x.c (x_init_image_instance_from_eimage): + * glyphs-x.c (pixmap_from_xbm_inline): + * glyphs-x.c (init_image_instance_from_xbm_inline): + * glyphs-x.c (xbm_instantiate_1): + * glyphs-x.c (x_xbm_instantiate): + * glyphs-x.c (x_xface_instantiate): + * glyphs.c (bitmap_to_lisp_data): + * glyphs.h: + * gui.c (gui_error): + * gui.c (gui_error_2): + * hpplay.c (player_error_internal): + * hpplay.c (play_sound_data): + * imgproc.c (get_histogram): + * imgproc.c (build_EImage_quantable): + * intl-win32.c (lang_to_langcode): + * intl-win32.c (sublang_to_langcode): + * intl-win32.c (int_from_hex): + * intl-win32.c (enum_locale_fn): + * lrecord.h (DECLARE_LRECORD): + * lrecord.h (DECLARE_MODULE_API_LRECORD): + * lrecord.h (DECLARE_EXTERNAL_LRECORD): + * lrecord.h (DECLARE_NONRECORD): + * lrecord.h (copy_sized_lcrecord): + * lrecord.h (zero_sized_lcrecord): + * lrecord.h (DUMPEDP): + * lstream.c (make_lisp_buffer_stream_1): + * keymap.c (define_key_check_and_coerce_keysym): + * lisp.h: + * libsst.c: + * linuxplay.c: + * linuxplay.c (linux_play_data_or_file): + * linuxplay.c (play_sound_data): + * miscplay.c: + * miscplay.c (waverequire): + * miscplay.c (parsewave): + * miscplay.c (parsesundecaudio): + * miscplay.c (sndcnv8U_2mono): + * miscplay.c (sndcnv8S_2mono): + * miscplay.c (sndcnv2monounsigned): + * miscplay.c (sndcnv2unsigned): + * miscplay.c (int2ulaw): + * miscplay.c (sndcnvULaw_2linear): + * miscplay.c (sndcnvULaw_2mono): + * miscplay.c (sndcnv16_2monoLE): + * miscplay.c (sndcnv16_2monoBE): + * miscplay.c (sndcnv2byteLE): + * miscplay.c (sndcnv2byteBE): + * miscplay.c (sndcnv2monobyteLE): + * miscplay.c (sndcnv2monobyteBE): + * miscplay.c (analyze_format): + * miscplay.h (parse_wave_complete): + * mule-coding.c (ccl_putprop): + * nas.c: + * nas.c (nas_play_sound_data): + * nas.c (SndOpenDataForReading): + * nas.c (cmpID): + * nas.c (dread): + * nas.c (dgetc): + * nas.c (readChunk): + * nas.c (WaveOpenDataForReading): + * nas.c (SoundOpenDataForReading): + * nt.c: + * nt.c (init_mswindows_environment): + * nt.c (mswindows_is_executable): + * nt.c (mswindows_executable_type): + * ntheap.c: + * ntheap.c (round_to_next): + * ntheap.c (get_data_start): + * ntheap.c (get_data_end): + * ntheap.c (allocate_heap): + * ntheap.c (sbrk): + * ntheap.c (recreate_heap): + * ntplay.c: + * ntplay.c (play_sound_file): + * ntplay.c (play_sound_data_1): + * ntplay.c (play_sound_data): + * objects-msw.c (colormap_t): + * objects-msw.c (fontmap_t): + * objects-msw.c (mswindows_string_to_color): + * objects-msw.c (mswindows_color_to_string): + * objects-msw.c (match_font): + * objects-msw.c (font_enum_callback_2): + * objects-msw.c (sort_font_list_function): + * objects-msw.c (parse_font_spec): + * objects-msw.c (mswindows_font_spec_matches_charset_stage_1): + * objects-tty.c (tty_initialize_font_instance): + * objects-x.c (x_font_instance_properties): + * print.c (printing_major_badness): + * process-nt.c (mswindows_compare_env): + * process-nt.c (get_internet_address): + * process.c: + * process.c (handle_signal): + * process.c (deactivate_process): + * redisplay.h: + * select-common.h (selection_data_to_lisp_data): + * select-common.h (lisp_data_to_selection_data): + * select-gtk.c (emacs_gtk_selection_handle): + * select-x.c (x_reply_selection_request): + * select-x.c (x_handle_selection_request): + * select-x.c (x_get_window_property): + * select-x.c (receive_incremental_selection): + * select-x.c (x_get_window_property_as_lisp_data): + * select-x.c (Fx_get_cutbuffer_internal): + * sgiplay.c: + * sgiplay.c (play_sound_file): + * sgiplay.c (play_sound_data): + * sgiplay.c (audio_initialize): + * sgiplay.c (play_internal): + * sgiplay.c (write_mulaw_8_chunk): + * sgiplay.c (write_linear_chunk): + * sgiplay.c (struct): + * sgiplay.c (parse_snd_header): + * sound.c: + * sound.c (report_sound_error): + * sound.c (Fplay_sound): + * sound.h: + * sunplay.c (init_device): + * sunplay.c (play_sound_file): + * sunplay.c (play_sound_data): + * sysfile.h: + * sysdep.c (retry_fopen): + * sysdep.c (qxe_fopen): + * sysdep.c (wcslen): + * syswindows.h (LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR): + * text.c (ascii_strcasecmp): + * text.c (qxestrcasecmp_ascii): + * text.c (ascii_strncasecmp): + * text.c (qxestrncasecmp_ascii): + * text.c (convert_ibyte_string_into_ichar_dynarr): + * text.c (convert_ibyte_string_into_ichar_string): + * text.c (eicmp_1): + * unexnt.c (unexec): + * unexnt.c (get_section_info): + * unexnt.c (copy_executable_and_dump_data_section): + * unexnt.c (dump_bss_and_heap): + * win32.c (urlify_filename): + * win32.c (mswindows_lisp_error_1): + * xgccache.c (gc_cache_lookup): + * text.c (qxesprintf): + Further work on types. This creates a full set of types for all + the basic semantics of `char' that I have so far identified, so that + its semantics can always be identified for the purposes of proper + Mule-safe code, and the raw use of `char' always avoided. + + (1) More type renaming, for consistency of naming. + + Char_ASCII -> Ascbyte + UChar_ASCII -> UAscbyte + Char_Binary -> CBinbyte + UChar_Binary -> Binbyte + SChar_Binary -> SBinbyte + + (2) Introduce Rawbyte, CRawbyte, Boolbyte, Chbyte, UChbyte, and + Bitbyte and use them. + + (3) New types Itext, Wexttext and Textcount for separating out + the concepts of bytes and textual units (different under UTF-16 + and UTF-32, which are potential internal encodings). + + (4) qxestr*_c -> qxestr*_ascii. + + * lisp.h (qxesscanf_ascii_1): + New; goes with other qxe() functions. #### Maybe goes in a + different section. + + * lisp.h: + Group generic int-type defs together with EMACS_INT defs. + + * lisp.h (EXTTEXT_ZTERM_SIZE): + * lisp.h (ITEXT_SIZE): + * lisp.h (NON_ASCII_INTERNAL_FORMAT): + * lisp.h (UTF16_IBYTE_FORMAT): + * lisp.h (WEXTTEXT_IS_WIDE) + New defns. + + * lisp.h (Boolean): + New type to replace places where int occurs as a boolean. + It's signed because occasionally people may want to use -1 as + an error value, and because unsigned ints are viral -- see comments + in the internals manual against using them. + + * dynarr.c: + * dynarr.c (Dynarr_realloc): + * dynarr.c (Dynarr_resize): + int -> Bytecount. + + --------------------------- + Mule-izing + --------------------------- + + * device-x.c: + * device-x.c (Fx_server_vendor): + * device-x.c (Fx_valid_keysym_name_p): + * device-x.c (Fx_get_font_path): + * device-x.c (Fx_set_font_path): + * device-x.c (reinit_console_type_create_device_x): + Partially Mule-ize. + + * dumper.c (see above): + * dumper.c (pdump_file_get): + * dumper.c (pdump_resource_get): + * dumper.c (pdump_file_free): + * dumper.c (pdump_ram_try): + * dumper.c (pdump_file_try): + * dumper.c (pdump_load): + * dumper.h: + Mule-ize. Use Rawbyte. Use stderr_out not printf. Use wext_*(). + + * sysdep.c: + * sysdep.c (retry_open_1): + * sysdep.c (retry_open): + * sysdep.c (wext_retry_open): + * syswindows.h: + * text.c (wcscmp_ascii): + * text.c (wcsncmp_ascii): + New Wexttext API for manipulation of external text that may be + Unicode (e.g. startup code under Windows). + + * emacs.c (make_arg_list_1): + * emacs.c (make_arg_list): + * emacs.c (make_argc_argv): + * emacs.c (free_argc_argv): + * emacs.c (init_cmdargs): + * emacs.c (argmatch): + * emacs.c (check_compatible_window_system): + * emacs.c (struct standard_args): + * emacs.c (sort_args): + * emacs.c (main): + * emacs.c (debug_can_access_memory): + * emacs.c (shut_down_emacs): + * emacs.c (guts_of_fatal_error_signal): + * emacs.c (assert_failed): + Mule-ize. Properly deal with argv in external encoding. + Use wext_*() and Wexttext. Use Rawbyte. + + #if 0 some old junk on SCO that is unlikely to be correct. + + Rewrite allocation code in run-temacs. + + * emacs.c: + * symsinit.h: + * win32.c (init_win32_very_very_early): + Rename win32 init function and call it even earlier, to + initialize mswindows_9x_p even earlier, for use in startup code + (XEUNICODE_P). + + * process.c (init_xemacs_process): + Use _wenviron not environ under Windows, to get Unicode environment + variables. + + * event-Xt.c (x_event_to_emacs_event): + Mule-ize drag-n-drop related stuff. + + * dragdrop.c (dnd_url_hexify_string): + * dragdrop.h: + * frame-x.c: + * frame-x.c (x_wm_set_cell_size): + * frame-x.c (x_wm_set_variable_size): + * frame-x.c (x_wm_hack_wm_protocols): + * frame-x.c (x_wm_store_class_hints): + * frame-x.c (x_wm_maybe_store_wm_command): + * frame-x.c (x_frame_window_state): + * frame-x.c (x_set_frame_text_value): + * frame-x.c (x_set_initial_frame_size): + * frame-x.c (x_set_frame_properties): + * frame-x.c (maybe_set_frame_title_format): + * frame-x.c (start_drag_internal_1): + * frame-x.c (x_cde_destroy_callback): + * frame-x.c (x_cde_convert_callback): + * frame-x.c (abort_current_drag): + * frame-x.c (Fcde_start_drag_internal): + * frame-x.c (x_cde_transfer_callback): + * frame-x.c (Foffix_start_drag_internal): + * frame-x.c (x_initialize_frame_size): + * frame-x.c (x_create_widgets): + * frame-x.c (xemacs_XtPopup): + * frame-x.c (x_popup_frame): + * frame-x.c (x_set_frame_icon): + * frame-x.c (x_set_frame_position): + * frame-x.c (x_delete_frame): + * frame-x.c (x_update_frame_external_traits): + Mule-ize. + + * text.h: + Add some more stand-in defines for particular kinds of conversion; + use in Mule-ization work in frame-x.c etc. + + --------------------------- + Freshening + --------------------------- + + * intl-auto-encap-win32.c: + * intl-auto-encap-win32.c (qxePeekConsoleInput): + * intl-auto-encap-win32.c (qxeReadConsoleInput): + * intl-auto-encap-win32.c (qxeWriteConsoleInput): + * intl-auto-encap-win32.c (qxeExtractAssociatedIcon): + * intl-auto-encap-win32.c (qxeShellExecuteEx): + * intl-auto-encap-win32.c (qxeSHQueryRecycleBin): + * intl-auto-encap-win32.c (qxeSHEmptyRecycleBin): + * intl-auto-encap-win32.c (qxeSHGetNewLinkInfo): + * intl-auto-encap-win32.c (qxeSHInvokePrinterCommand): + * intl-auto-encap-win32.c (qxewvsprintf): + * intl-auto-encap-win32.c (qxeLoadKeyboardLayout): + * intl-auto-encap-win32.c (qxeGetKeyboardLayoutName): + * intl-auto-encap-win32.c (qxeOpenDesktop): + * intl-auto-encap-win32.c (qxeEnumDesktops): + * intl-auto-encap-win32.c (qxeCreateWindowStation): + * intl-auto-encap-win32.c (qxeOpenWindowStation): + * intl-auto-encap-win32.c (qxeEnumWindowStations): + * intl-auto-encap-win32.c (qxeGetUserObjectInformation): + * intl-auto-encap-win32.c (qxeSetUserObjectInformation): + * intl-auto-encap-win32.c (qxeRegisterWindowMessage): + * intl-auto-encap-win32.c (qxeGetMessage): + * intl-auto-encap-win32.c (qxeDispatchMessage): + * intl-auto-encap-win32.c (qxePeekMessage): + * intl-auto-encap-win32.c (qxeSendMessageTimeout): + * intl-auto-encap-win32.c (qxeSendNotifyMessage): + * intl-auto-encap-win32.c (qxeSendMessageCallback): + * intl-auto-encap-win32.c (qxePostMessage): + * intl-auto-encap-win32.c (qxePostThreadMessage): + * intl-auto-encap-win32.c (qxeGetClassInfoEx): + * intl-auto-encap-win32.c (qxeCreateWindowEx): + * intl-auto-encap-win32.c (qxeCreateDialogParam): + * intl-auto-encap-win32.c (qxeCreateDialogIndirectParam): + * intl-auto-encap-win32.c (qxeDialogBoxParam): + * intl-auto-encap-win32.c (qxeDialogBoxIndirectParam): + * intl-auto-encap-win32.c (qxeSetDlgItemText): + * intl-auto-encap-win32.c (qxeGetDlgItemText): + * intl-auto-encap-win32.c (qxeSendDlgItemMessage): + * intl-auto-encap-win32.c (qxeCallMsgFilter): + * intl-auto-encap-win32.c (qxeRegisterClipboardFormat): + * intl-auto-encap-win32.c (qxeGetClipboardFormatName): + * intl-auto-encap-win32.c (qxeCharToOem): + * intl-auto-encap-win32.c (qxeOemToChar): + * intl-auto-encap-win32.c (qxeCharToOemBuff): + * intl-auto-encap-win32.c (qxeOemToCharBuff): + * intl-auto-encap-win32.c (qxeCharUpper): + * intl-auto-encap-win32.c (qxeCharUpperBuff): + * intl-auto-encap-win32.c (qxeCharLower): + * intl-auto-encap-win32.c (qxeCharLowerBuff): + * intl-auto-encap-win32.c (qxeCharNext): + * intl-auto-encap-win32.c (qxeCharPrev): + * intl-auto-encap-win32.c (qxeMapVirtualKey): + * intl-auto-encap-win32.c (qxeMapVirtualKeyEx): + * intl-auto-encap-win32.c (qxeLoadAccelerators): + * intl-auto-encap-win32.c (qxeCreateAcceleratorTable): + * intl-auto-encap-win32.c (qxeCopyAcceleratorTable): + * intl-auto-encap-win32.c (qxeTranslateAccelerator): + * intl-auto-encap-win32.c (qxeLoadMenu): + * intl-auto-encap-win32.c (qxeLoadMenuIndirect): + * intl-auto-encap-win32.c (qxeChangeMenu): + * intl-auto-encap-win32.c (qxeGetMenuString): + * intl-auto-encap-win32.c (qxeInsertMenu): + * intl-auto-encap-win32.c (qxeAppendMenu): + * intl-auto-encap-win32.c (qxeModifyMenu): + * intl-auto-encap-win32.c (qxeInsertMenuItem): + * intl-auto-encap-win32.c (qxeGetMenuItemInfo): + * intl-auto-encap-win32.c (qxeSetMenuItemInfo): + * intl-auto-encap-win32.c (qxeDrawText): + * intl-auto-encap-win32.c (qxeDrawTextEx): + * intl-auto-encap-win32.c (qxeGrayString): + * intl-auto-encap-win32.c (qxeDrawState): + * intl-auto-encap-win32.c (qxeTabbedTextOut): + * intl-auto-encap-win32.c (qxeGetTabbedTextExtent): + * intl-auto-encap-win32.c (qxeSetProp): + * intl-auto-encap-win32.c (qxeGetProp): + * intl-auto-encap-win32.c (qxeRemoveProp): + * intl-auto-encap-win32.c (qxeEnumPropsEx): + * intl-auto-encap-win32.c (qxeEnumProps): + * intl-auto-encap-win32.c (qxeSetWindowText): + * intl-auto-encap-win32.c (qxeGetWindowText): + * intl-auto-encap-win32.c (qxeGetWindowTextLength): + * intl-auto-encap-win32.c (qxeMessageBox): + * intl-auto-encap-win32.c (qxeMessageBoxEx): + * intl-auto-encap-win32.c (qxeMessageBoxIndirect): + * intl-auto-encap-win32.c (qxeGetWindowLong): + * intl-auto-encap-win32.c (qxeSetWindowLong): + * intl-auto-encap-win32.c (qxeGetClassLong): + * intl-auto-encap-win32.c (qxeSetClassLong): + * intl-auto-encap-win32.c (qxeFindWindow): + * intl-auto-encap-win32.c (qxeFindWindowEx): + * intl-auto-encap-win32.c (qxeGetClassName): + * intl-auto-encap-win32.c (qxeSetWindowsHookEx): + * intl-auto-encap-win32.c (qxeLoadBitmap): + * intl-auto-encap-win32.c (qxeLoadCursor): + * intl-auto-encap-win32.c (qxeLoadCursorFromFile): + * intl-auto-encap-win32.c (qxeLoadIcon): + * intl-auto-encap-win32.c (qxeLoadImage): + * intl-auto-encap-win32.c (qxeLoadString): + * intl-auto-encap-win32.c (qxeIsDialogMessage): + * intl-auto-encap-win32.c (qxeDlgDirList): + * intl-auto-encap-win32.c (qxeDlgDirSelectEx): + * intl-auto-encap-win32.c (qxeDlgDirListComboBox): + * intl-auto-encap-win32.c (qxeDlgDirSelectComboBoxEx): + * intl-auto-encap-win32.c (qxeDefFrameProc): + * intl-auto-encap-win32.c (qxeCreateMDIWindow): + * intl-auto-encap-win32.c (qxeWinHelp): + * intl-auto-encap-win32.c (qxeRegLoadKey): + * intl-auto-encap-win32.c (qxeRegOpenKey): + * intl-auto-encap-win32.c (qxeSetLocaleInfo): + * intl-auto-encap-win32.c (qxeCopyMetaFile): + * intl-auto-encap-win32.c (qxeCreateScalableFontResource): + * intl-auto-encap-win32.c (qxeGetCharWidth): + * intl-auto-encap-win32.c (qxeGetCharWidth32): + * intl-auto-encap-win32.c (qxeGetCharWidthFloat): + * intl-auto-encap-win32.c (qxeGetCharABCWidths): + * intl-auto-encap-win32.c (qxeGetCharABCWidthsFloat): + * intl-auto-encap-win32.c (qxeGetGlyphOutline): + * intl-auto-encap-win32.c (qxeGetMetaFile): + * intl-auto-encap-win32.c (qxeGetTextExtentPoint): + * intl-auto-encap-win32.c (qxeGetTextExtentPoint32): + * intl-auto-encap-win32.c (qxeGetTextExtentExPoint): + * intl-auto-encap-win32.c (qxeGetCharacterPlacement): + * intl-auto-encap-win32.c (qxeCopyEnhMetaFile): + * intl-auto-encap-win32.c (qxeCreateEnhMetaFile): + * intl-auto-encap-win32.c (qxeGetEnhMetaFile): + * intl-auto-encap-win32.c (qxeGetEnhMetaFileDescription): + * intl-auto-encap-win32.c (qxeTextOut): + * intl-auto-encap-win32.c (qxeExtTextOut): + * intl-auto-encap-win32.c (qxePolyTextOut): + * intl-auto-encap-win32.c (qxeGetTextFace): + * intl-auto-encap-win32.c (qxeGetKerningPairs): + * intl-auto-encap-win32.c (qxeEnumICMProfiles): + * intl-auto-encap-win32.c (qxeGetOpenFileName): + * intl-auto-encap-win32.c (qxeGetSaveFileName): + * intl-auto-encap-win32.c (qxeGetFileTitle): + * intl-auto-encap-win32.c (qxeChooseColor): + * intl-auto-encap-win32.c (qxeFindText): + * intl-auto-encap-win32.c (qxeReplaceText): + * intl-auto-encap-win32.c (qxeImmGetDescription): + * intl-auto-encap-win32.c (qxeImmGetIMEFileName): + * intl-auto-encap-win32.c (qxeMoveFile): + * intl-auto-encap-win32.c (qxeMoveFileEx): + * intl-auto-encap-win32.c (qxeGetNamedPipeHandleState): + * intl-auto-encap-win32.c (qxeCallNamedPipe): + * intl-auto-encap-win32.c (qxeWaitNamedPipe): + * intl-auto-encap-win32.c (qxeSetVolumeLabel): + * intl-auto-encap-win32.c (qxeGetVolumeInformation): + * intl-auto-encap-win32.c (qxeClearEventLog): + * intl-auto-encap-win32.c (qxeBackupEventLog): + * intl-auto-encap-win32.c (qxeOpenEventLog): + * intl-auto-encap-win32.c (qxeRegisterEventSource): + * intl-auto-encap-win32.c (qxeOpenBackupEventLog): + * intl-auto-encap-win32.c (qxeReadEventLog): + * intl-auto-encap-win32.c (qxeReportEvent): + * intl-auto-encap-win32.c (qxeAccessCheckAndAuditAlarm): + * intl-auto-encap-win32.c (qxeObjectOpenAuditAlarm): + * intl-auto-encap-win32.c (qxeObjectPrivilegeAuditAlarm): + * intl-auto-encap-win32.c (qxeObjectCloseAuditAlarm): + * intl-auto-encap-win32.c (qxeObjectDeleteAuditAlarm): + * intl-auto-encap-win32.c (qxePrivilegedServiceAuditAlarm): + * intl-auto-encap-win32.c (qxeSetFileSecurity): + * intl-auto-encap-win32.c (qxeGetFileSecurity): + * intl-auto-encap-win32.c (qxeFindFirstChangeNotification): + * intl-auto-encap-win32.c (qxeIsBadStringPtr): + * intl-auto-encap-win32.c (qxeLookupAccountSid): + * intl-auto-encap-win32.c (qxeLookupAccountName): + * intl-auto-encap-win32.c (qxeLookupPrivilegeValue): + * intl-auto-encap-win32.c (qxeLookupPrivilegeName): + * intl-auto-encap-win32.c (qxeLookupPrivilegeDisplayName): + * intl-auto-encap-win32.c (qxeBuildCommDCB): + * intl-auto-encap-win32.c (qxeBuildCommDCBAndTimeouts): + * intl-auto-encap-win32.c (qxeCommConfigDialog): + * intl-auto-encap-win32.c (qxeGetDefaultCommConfig): + * intl-auto-encap-win32.c (qxeSetDefaultCommConfig): + * intl-auto-encap-win32.c (qxeGetComputerName): + * intl-auto-encap-win32.c (qxeSetComputerName): + * intl-auto-encap-win32.c (qxeGetUserName): + * intl-auto-encap-win32.c (qxeLogonUser): + * intl-auto-encap-win32.c (qxeCreateProcessAsUser): + * intl-auto-encap-win32.c (qxesndPlaySound): + * intl-auto-encap-win32.c (qxePlaySound): + * intl-auto-encap-win32.c (qxemidiInGetErrorText): + * intl-auto-encap-win32.c (qxemmioInstallIOProc): + * intl-auto-encap-win32.c (qxemmioOpen): + * intl-auto-encap-win32.c (qxemmioRename): + * intl-auto-encap-win32.c (qxemciSendCommand): + * intl-auto-encap-win32.c (qxemciSendString): + * intl-auto-encap-win32.c (qxemciGetDeviceID): + * intl-auto-encap-win32.h: + * intl-auto-encap-win32.h (EnumPrinters): + * intl-auto-encap-win32.h (ResetPrinter): + * intl-auto-encap-win32.h (SetJob): + * intl-auto-encap-win32.h (GetJob): + * intl-auto-encap-win32.h (EnumJobs): + * intl-auto-encap-win32.h (AddPrinter): + * intl-auto-encap-win32.h (SetPrinter): + * intl-auto-encap-win32.h (GetPrinter): + * intl-auto-encap-win32.h (AddPrinterDriver): + * intl-auto-encap-win32.h (AddPrinterDriverEx): + * intl-auto-encap-win32.h (EnumPrinterDrivers): + * intl-auto-encap-win32.h (GetPrinterDriver): + * intl-auto-encap-win32.h (GetPrinterDriverDirectory): + * intl-auto-encap-win32.h (DeletePrinterDriver): + * intl-auto-encap-win32.h (DeletePrinterDriverEx): + * intl-auto-encap-win32.h (AddPerMachineConnection): + * intl-auto-encap-win32.h (DeletePerMachineConnection): + * intl-auto-encap-win32.h (EnumPerMachineConnections): + * intl-auto-encap-win32.h (AddPrintProcessor): + * intl-auto-encap-win32.h (EnumPrintProcessors): + * intl-auto-encap-win32.h (GetPrintProcessorDirectory): + * intl-auto-encap-win32.h (EnumPrintProcessorDatatypes): + * intl-auto-encap-win32.h (DeletePrintProcessor): + * intl-auto-encap-win32.h (StartDocPrinter): + * intl-auto-encap-win32.h (AddJob): + * intl-auto-encap-win32.h (AdvancedDocumentProperties): + * intl-auto-encap-win32.h (GetPrinterData): + * intl-auto-encap-win32.h (GetPrinterDataEx): + * intl-auto-encap-win32.h (EnumPrinterData): + * intl-auto-encap-win32.h (EnumPrinterDataEx): + * intl-auto-encap-win32.h (EnumPrinterKey): + * intl-auto-encap-win32.h (SetPrinterData): + * intl-auto-encap-win32.h (SetPrinterDataEx): + * intl-auto-encap-win32.h (DeletePrinterData): + * intl-auto-encap-win32.h (DeletePrinterDataEx): + * intl-auto-encap-win32.h (DeletePrinterKey): + * intl-auto-encap-win32.h (PrinterMessageBox): + * intl-auto-encap-win32.h (AddForm): + * intl-auto-encap-win32.h (DeleteForm): + * intl-auto-encap-win32.h (GetForm): + * intl-auto-encap-win32.h (SetForm): + * intl-auto-encap-win32.h (EnumForms): + * intl-auto-encap-win32.h (EnumMonitors): + * intl-auto-encap-win32.h (AddMonitor): + * intl-auto-encap-win32.h (DeleteMonitor): + * intl-auto-encap-win32.h (EnumPorts): + * intl-auto-encap-win32.h (AddPort): + * intl-auto-encap-win32.h (ConfigurePort): + * intl-auto-encap-win32.h (DeletePort): + * intl-auto-encap-win32.h (XcvData): + * intl-auto-encap-win32.h (SetPort): + * intl-auto-encap-win32.h (AddPrinterConnection): + * intl-auto-encap-win32.h (DeletePrinterConnection): + * intl-auto-encap-win32.h (AddPrintProvidor): + * intl-auto-encap-win32.h (DeletePrintProvidor): + * intl-auto-encap-win32.h (SetPrinterHTMLView): + * intl-auto-encap-win32.h (GetPrinterHTMLView): + * intl-auto-encap-win32.h (WNetAddConnection): + * intl-auto-encap-win32.h (WNetAddConnection2): + * intl-auto-encap-win32.h (WNetAddConnection3): + * intl-auto-encap-win32.h (WNetCancelConnection): + * intl-auto-encap-win32.h (WNetCancelConnection2): + * intl-auto-encap-win32.h (WNetGetConnection): + * intl-auto-encap-win32.h (WNetUseConnection): + * intl-auto-encap-win32.h (WNetConnectionDialog1): + * intl-auto-encap-win32.h (WNetDisconnectDialog1): + * intl-auto-encap-win32.h (WNetOpenEnum): + * intl-auto-encap-win32.h (WNetEnumResource): + * intl-auto-encap-win32.h (WNetGetUniversalName): + * intl-auto-encap-win32.h (WNetGetUser): + * intl-auto-encap-win32.h (WNetGetProviderName): + * intl-auto-encap-win32.h (WNetGetNetworkInformation): + * intl-auto-encap-win32.h (WNetGetLastError): + * intl-auto-encap-win32.h (MultinetGetConnectionPerformance): + * intl-auto-encap-win32.h (GetBinaryType): + * intl-auto-encap-win32.h (GetShortPathName): + * intl-auto-encap-win32.h (GetLongPathName): + * intl-auto-encap-win32.h (FreeEnvironmentStrings): + * intl-auto-encap-win32.h (FormatMessage): + * intl-auto-encap-win32.h (CreateMailslot): + * intl-auto-encap-win32.h (EncryptFile): + * intl-auto-encap-win32.h (DecryptFile): + * intl-auto-encap-win32.h (OpenRaw): + * intl-auto-encap-win32.h (QueryRecoveryAgents): + * intl-auto-encap-win32.h (lstrcmp): + * intl-auto-encap-win32.h (lstrcmpi): + * intl-auto-encap-win32.h (lstrcpyn): + * intl-auto-encap-win32.h (lstrcpy): + * intl-auto-encap-win32.h (lstrcat): + * intl-auto-encap-win32.h (lstrlen): + * intl-auto-encap-win32.h (CreateMutex): + * intl-auto-encap-win32.h (OpenMutex): + * intl-auto-encap-win32.h (CreateEvent): + * intl-auto-encap-win32.h (OpenEvent): + * intl-auto-encap-win32.h (CreateSemaphore): + * intl-auto-encap-win32.h (OpenSemaphore): + * intl-auto-encap-win32.h (CreateWaitableTimer): + * intl-auto-encap-win32.h (OpenWaitableTimer): + * intl-auto-encap-win32.h (CreateFileMapping): + * intl-auto-encap-win32.h (OpenFileMapping): + * intl-auto-encap-win32.h (GetLogicalDriveStrings): + * intl-auto-encap-win32.h (LoadLibrary): + * intl-auto-encap-win32.h (LoadLibraryEx): + * intl-auto-encap-win32.h (GetModuleFileName): + * intl-auto-encap-win32.h (GetModuleHandle): + * intl-auto-encap-win32.h (CreateProcess): + * intl-auto-encap-win32.h (FatalAppExit): + * intl-auto-encap-win32.h (GetStartupInfo): + * intl-auto-encap-win32.h (GetCommandLine): + * intl-auto-encap-win32.h (GetEnvironmentVariable): + * intl-auto-encap-win32.h (SetEnvironmentVariable): + * intl-auto-encap-win32.h (ExpandEnvironmentStrings): + * intl-auto-encap-win32.h (OutputDebugString): + * intl-auto-encap-win32.h (FindResource): + * intl-auto-encap-win32.h (FindResourceEx): + * intl-auto-encap-win32.h (EnumResourceTypes): + * intl-auto-encap-win32.h (EnumResourceNames): + * intl-auto-encap-win32.h (EnumResourceLanguages): + * intl-auto-encap-win32.h (BeginUpdateResource): + * intl-auto-encap-win32.h (UpdateResource): + * intl-auto-encap-win32.h (EndUpdateResource): + * intl-auto-encap-win32.h (GlobalAddAtom): + * intl-auto-encap-win32.h (GlobalFindAtom): + * intl-auto-encap-win32.h (GlobalGetAtomName): + * intl-auto-encap-win32.h (AddAtom): + * intl-auto-encap-win32.h (FindAtom): + * intl-auto-encap-win32.h (GetAtomName): + * intl-auto-encap-win32.h (GetProfileInt): + * intl-auto-encap-win32.h (GetProfileString): + * intl-auto-encap-win32.h (WriteProfileString): + * intl-auto-encap-win32.h (GetProfileSection): + * intl-auto-encap-win32.h (WriteProfileSection): + * intl-auto-encap-win32.h (GetPrivateProfileInt): + * intl-auto-encap-win32.h (GetPrivateProfileString): + * intl-auto-encap-win32.h (WritePrivateProfileString): + * intl-auto-encap-win32.h (GetPrivateProfileSection): + * intl-auto-encap-win32.h (WritePrivateProfileSection): + * intl-auto-encap-win32.h (GetPrivateProfileSectionNames): + * intl-auto-encap-win32.h (GetPrivateProfileStruct): + * intl-auto-encap-win32.h (WritePrivateProfileStruct): + * intl-auto-encap-win32.h (GetDriveType): + * intl-auto-encap-win32.h (GetSystemDirectory): + * intl-auto-encap-win32.h (GetTempPath): + * intl-auto-encap-win32.h (GetTempFileName): + * intl-auto-encap-win32.h (GetWindowsDirectory): + * intl-auto-encap-win32.h (SetCurrentDirectory): + * intl-auto-encap-win32.h (GetCurrentDirectory): + * intl-auto-encap-win32.h (GetDiskFreeSpace): + * intl-auto-encap-win32.h (GetDiskFreeSpaceEx): + * intl-auto-encap-win32.h (CreateDirectory): + * intl-auto-encap-win32.h (CreateDirectoryEx): + * intl-auto-encap-win32.h (RemoveDirectory): + * intl-auto-encap-win32.h (GetFullPathName): + * intl-auto-encap-win32.h (DefineDosDevice): + * intl-auto-encap-win32.h (QueryDosDevice): + * intl-auto-encap-win32.h (CreateFile): + * intl-auto-encap-win32.h (SetFileAttributes): + * intl-auto-encap-win32.h (GetFileAttributes): + * intl-auto-encap-win32.h (GetFileAttributesEx): + * intl-auto-encap-win32.h (GetCompressedFileSize): + * intl-auto-encap-win32.h (DeleteFile): + * intl-auto-encap-win32.h (FindFirstFileEx): + * intl-auto-encap-win32.h (SearchPath): + * intl-auto-encap-win32.h (CopyFile): + * intl-auto-encap-win32.h (CopyFileEx): + * intl-auto-encap-win32.h (MoveFile): + * intl-auto-encap-win32.h (MoveFileEx): + * intl-auto-encap-win32.h (MoveFileWithProgress): + * intl-auto-encap-win32.h (CreateHardLink): + * intl-auto-encap-win32.h (CreateNamedPipe): + * intl-auto-encap-win32.h (GetNamedPipeHandleState): + * intl-auto-encap-win32.h (CallNamedPipe): + * intl-auto-encap-win32.h (WaitNamedPipe): + * intl-auto-encap-win32.h (SetVolumeLabel): + * intl-auto-encap-win32.h (GetVolumeInformation): + * intl-auto-encap-win32.h (ClearEventLog): + * intl-auto-encap-win32.h (BackupEventLog): + * intl-auto-encap-win32.h (OpenEventLog): + * intl-auto-encap-win32.h (RegisterEventSource): + * intl-auto-encap-win32.h (OpenBackupEventLog): + * intl-auto-encap-win32.h (ReadEventLog): + * intl-auto-encap-win32.h (ReportEvent): + * intl-auto-encap-win32.h (AccessCheckAndAuditAlarm): + * intl-auto-encap-win32.h (AccessCheckByTypeAndAuditAlarm): + * intl-auto-encap-win32.h (AccessCheckByTypeResultListAndAuditAlarm): + * intl-auto-encap-win32.h (ObjectOpenAuditAlarm): + * intl-auto-encap-win32.h (ObjectPrivilegeAuditAlarm): + * intl-auto-encap-win32.h (ObjectCloseAuditAlarm): + * intl-auto-encap-win32.h (ObjectDeleteAuditAlarm): + * intl-auto-encap-win32.h (PrivilegedServiceAuditAlarm): + * intl-auto-encap-win32.h (SetFileSecurity): + * intl-auto-encap-win32.h (GetFileSecurity): + * intl-auto-encap-win32.h (FindFirstChangeNotification): + * intl-auto-encap-win32.h (ReadDirectoryChanges): + * intl-auto-encap-win32.h (IsBadStringPtr): + * intl-auto-encap-win32.h (LookupAccountSid): + * intl-auto-encap-win32.h (LookupAccountName): + * intl-auto-encap-win32.h (LookupPrivilegeValue): + * intl-auto-encap-win32.h (LookupPrivilegeName): + * intl-auto-encap-win32.h (LookupPrivilegeDisplayName): + * intl-auto-encap-win32.h (BuildCommDCB): + * intl-auto-encap-win32.h (BuildCommDCBAndTimeouts): + * intl-auto-encap-win32.h (CommConfigDialog): + * intl-auto-encap-win32.h (GetDefaultCommConfig): + * intl-auto-encap-win32.h (SetDefaultCommConfig): + * intl-auto-encap-win32.h (GetComputerName): + * intl-auto-encap-win32.h (SetComputerName): + * intl-auto-encap-win32.h (GetUserName): + * intl-auto-encap-win32.h (LogonUser): + * intl-auto-encap-win32.h (CreateProcessAsUser): + * intl-auto-encap-win32.h (GetCurrentHwProfile): + * intl-auto-encap-win32.h (GetVersionEx): + * intl-auto-encap-win32.h (CreateJobObject): + * intl-auto-encap-win32.h (OpenJobObject): + * intl-auto-encap-win32.h (qxemciGetErrorString): + Regenerate. + + --------------------------- + Unicode-work + --------------------------- + + * intl-win32.c (convert_multibyte_to_unicode_malloc): + * intl-win32.c (convert_unicode_to_multibyte_malloc): + * intl-win32.c (unicode_multibyte_convert_now_damn_it): + * intl-win32.c (unicode_multibyte_convert_size): + * intl-win32.c (unicode_multibyte_convert_copy_data): + * intl-win32.c (convert_multibyte_to_unicode_dynarr): + * intl-win32.c (convert_unicode_to_multibyte_dynarr): + * intl-win32.c (mswindows_multibyte_to_unicode_convert): + * syswindows.h: + Factor out common options to MultiByteToWideChar and + WideCharToMultiByte. Add convert_unicode_to_multibyte_malloc() + and convert_unicode_to_multibyte_dynarr() and use. Add stuff for + alloca() conversion of multibyte/unicode. + + * alloc.c (build_ext_string): + Use dfc_external_data_len() in case of unicode coding system. + + * alloc.c: + * mule-charset.c: + * mule-charset.c (make_charset): + * mule-charset.c (syms_of_mule_charset): + Don't zero out and reinit charset Unicode tables. This fucks up + dump-time loading. Anyway, either we load them at dump time or + run time, never both. + + * unicode.c (init_charset_unicode_tables): + * unicode.c (vars_of_unicode): + Dump the blank tables as well. + + --------------------------------------------------------------- + DOCUMENTATION, MOSTLY MULE-RELATED: + --------------------------------------------------------------- + + * EmacsFrame.c (Xt_StringToScrollBarPlacement): + * emodules.c: + * event-Xt.c (x_to_emacs_keysym): + * fileio.c (Fencrypt_string): + * input-method-xlib.c (EmacsXtCvtStringToXIMStyles): + * mule-wnnfns.c (Fwnn_open): + * redisplay-gtk.c (gtk_output_string): + * redisplay-gtk.c (gtk_text_width): + * redisplay-tty.c (init_tty_for_redisplay): + * redisplay-x.c (x_text_width): + * regex.c: + * sysdep.c (init_system_name): + Add comment about Mule work needed. + + * text.h (NEW_DFC_CONVERT_1_ALLOCA): + Add more documentation describing why DFC routines were not written + to return their value. Add some other DFC documentation. + + * console-msw.c: + * console-msw.h: + Add pointer to docs in win32.c. + + * emacs.c: + Add comments on sources of doc info. + + * text.c: + * text.c (NOTE): New. + * text.c (Note): New. + * charset.h (struct Lisp_Charset): + * unicode.c: + * intl-win32.c: + * intl-win32.c (NOTE): New. + * intl-win32.c (Abstract): New. + * intl-encap-win32.c: + * text.h: + * text.h (internal_format): + * file-coding.c (encode_decode_coding_region): + * file-coding.c: + * mule-coding.c (parse_iso2022_esc): + Collect background comments and related to text matters and + internationalization, and proposals for work to be done, in text.c + or Internals manual, stuff related to specific textual API's in + text.h, and stuff related to internal implementation of Unicode + conversion in unicode.c. Put lots of pointers to the comments to + make them easier to find. + + * s/mingw32.h: + * s/win32-common.h: + * s/win32-native.h: + * s/windowsnt.h: + * win32.c: + * win32.c (console-msw.h): New. + * win32.c (process-nt.c): New. + * win32.c (nt.c): New. + * win32.c (win32.c): New. + * win32.c (syswindows.h): New. + * win32.c (intl-win32.c): New. + * win32.c (intl-encap-win32.c): New. + * win32.c (intl-auto-encap-win32.c): New. + * win32.c (intl-auto-encap-win32.h): New. + Add bunches of new documentation on the different kinds of + builds and environments under Windows and how they work. + Collect this info in win32.c. Add pointers to these docs in + the relevant s/* files. + + * emacs.c (mswindows_handle_hardware_exceptions_1): + * emacs.c: + Document places with long comments. + Remove comment about exiting, move to internals manual, put + in pointer. + + * event-stream.c: + Move docs about event queues and focus to internals manual, put + in pointer. + + * events.h: + Move docs about event stream callbacks to internals manual, put + in pointer. + + * profile.c: + * redisplay.c (create_text_block): + * signal.c: + Move documentation to the Internals manual. + + * process-nt.c: + Add pointer to comment in win32-native.el. + + * lisp.h: + Add comments about some comment conventions. + + * lisp.h (xfree): + Add comment about the second argument. + + * device-msw.c (msprinter_init_device): + * redisplay-msw.c (mswindows_text_width_single_run): + @@#### comments are out-of-date. + + --------------------------------------------------------------- + PDUMP WORK (MOTIVATED BY UNICODE CHANGES) + --------------------------------------------------------------- + + * alloc.c (lispdesc_block_size_1): + * alloc.c (lispdesc_one_description_line_size): + * alloc.c (mark_struct_contents): + * buffer.c: + * buffer.c (complex_vars_of_buffer): + * buffer.c (vars_of_buffer): + * bytecode.c: + * console-impl.h (INITIALIZE_CONSOLE_TYPE): + * console.c (complex_vars_of_console): + * console.c (console_type_create): + * console.c: + * device.c: + * dumper.c (dump_add_root_block): + * dumper.c (dump_add_root_block_ptr): + * dumper.c (dump_add_root_lisp_object): + * dumper.c (dump_add_weak_object_chain): + * dumper.c (pdump_add_block): + * dumper.c (pdump_allocate_offset): + * dumper.c (pdump_block_list_elt): + * dumper.c (pdump_desc_list_elt): + * dumper.c (pdump_dump_data): + * dumper.c (pdump_dump_root_blocks): + * dumper.c (pdump_dump_rtables): + * dumper.c (pdump_get_block_list): + * dumper.c (pdump_register_block): + * dumper.c (pdump_register_block_contents): + * dumper.c (pdump_register_object): + * dumper.c (pdump_scan_by_alignment): + * alloc.c (lispdesc_one_description_line_size): + * alloc.c (kkcc_marking): + * dumper.c (pdump_register_sub): + * lrecord.h: + * lrecord.h (struct lrecord_implementation): + * lrecord.h (memory_description_type): + * elhash.c: + * emodules.h: + * events.c: + * extents.c: + * frame.c: + * glyphs.c: + * glyphs.h (INITIALIZE_DEVICE_IIFORMAT): + * glyphs.h (INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM): + * mule-charset.c (vars_of_mule_charset): + * mule-coding.c: + * objects.c: + * profile.c (vars_of_profile): + * rangetab.c: + * redisplay.c: + * specifier.c (specifier_type_create): + * specifier.c: + * specifier.h (INITIALIZE_SPECIFIER_TYPE): + * window.c: + * lstream.c (lstream_description): + * file-coding.h (INITIALIZE_CODING_SYSTEM_TYPE): + * file-coding.c (coding_system_description): + * file-coding.c (coding_system_type_create): + * lrecord.h (XD_DYNARR_DESC): + PDUMP: + + Properly implement dump_add_root_block(), which never worked before, + and is necessary for dumping Unicode tables. + + Pdump name changes for accuracy: + XD_STRUCT_PTR -> XD_BLOCK_PTR. + XD_STRUCT_ARRAY -> XD_BLOCK_ARRAY. + XD_C_STRING -> XD_ASCII_STRING. + *_structure_* -> *_block_*. + + * lrecord.h (XD_DYNARR_DESC): some comments added about + dump_add_root_block() vs dump_add_root_block_ptr(). + + * extents.c: + remove incorrect comment about pdump problems with gap array. + + --------------------------------------------------------------- + ALLOCATION + --------------------------------------------------------------- + + * abbrev.c (abbrev_oblookup): + * alloc.c (MALLOC_BEGIN): + * bytecode.c (compiled_function_instructions): + * casefiddle.c (casify_object): + * device-msw.c (Fmswindows_printer_list): + * device-x.c: + * dired-msw.c (mswindows_get_files): + * doc.c (Fsubstitute_command_keys): + * doc.c (unparesseuxify_doc_string): + * doc.c: + * doprnt.c (emacs_vsprintf_malloc): + * doprnt.c (emacs_vsprintf_malloc_lisp): + * dragdrop.c (dnd_url_hexify_string): + * dragdrop.c: + * editfns.c (Fformat_time_string): + * editfns.c (Finsert_char): + * editfns.c (get_home_directory): + * emodules.c (emodules_load): + * file-coding.c (setup_eol_coding_systems): + * fileio.c (Fdirectory_file_name): + * fileio.c (Ffile_name_directory): + * fileio.c (Fsubstitute_in_file_name): + * fileio.c (Fexpand_file_name): + * filelock.c (MAKE_LOCK_NAME): + * filelock.c (current_lock_owner): + * filelock.c (lock_file): + * filelock.c (lock_file_1): + * fns.c (mapcar1): + * glyphs-eimage.c (jpeg_instantiate): + * glyphs-eimage.c (gif_instantiate): + * glyphs-eimage.c (tiff_instantiate): + * glyphs-gtk.c (gtk_xpm_instantiate): + * glyphs-msw.c (mswindows_combo_box_property): + * glyphs-msw.c (mswindows_widget_property): + * glyphs-msw.c (convert_EImage_to_DIBitmap): + * glyphs-msw.c (mswindows_initialize_image_instance_mask): + * glyphs-msw.c (xbm_create_bitmap_from_data): + * glyphs-x.c (convert_EImage_to_XImage): + * glyphs-x.c (x_xface_instantiate): + * gui-msw.c (mswindows_translate_menu_or_dialog_item): + * gui-x.c (add_accel_and_to_external): + * imgproc.c (create_colorcell): + * imgproc.c (build_EImage_quantable): + * intl-win32.c (Fmswindows_get_valid_keyboard_layouts): + * intl-win32.c (convert_multibyte_to_unicode_malloc): + * intl-win32.c (wcsdup): + * lread.c (Fload_internal): + * lread.c (locate_file_map_suffixes): + * menubar-gtk.c (menu_descriptor_to_widget_1): + * menubar.c (Fnormalize_menu_item_name): + * nt.c (init_mswindows_environment): + * nt.c (get_cached_volume_information): + * nt.c (get_volume_info): + * nt.c (nt_get_resource): + * objects-msw.c (mswindows_string_to_color): + * objects-x.c (truename_via_random_props): + * print.c (output_string): + * process-nt.c (nt_create_process): + * process-unix.c (child_setup): + * process.c (init_xemacs_process): + * realpath.c (readlink_and_correct_case): + * redisplay.c (add_disp_table_entry_runes_1): + * search.c (Fregexp_quote): + * search.c (search_buffer): + * search.c (wordify): + * select-common.c (receive_incremental_selection): + * symbols.c (check_module_subr): + * sysdep.c (sys_subshell): + * syswindows.h (LOCAL_TO_WIN32_FILE_FORMAT): + * syswindows.h (WIN32_TO_LOCAL_FILE_FORMAT): + * text.c (convert_ichar_string_into_malloced_string): + * text.c (eito_malloc_1): + * text.h (EI_CASECHANGE): + * text.h (EI_ALLOC): + * text.h (eicpy_c): + * text.h (eicpyout_alloca_fmt): + * text.h (eito_alloca): + * text.h (LISP_STRING_TO_ALLOCA): + * ui-byhand.c (Fgtk_curve_get_vector): + * ui-byhand.c (Fgtk_curve_set_vector): + * text.h: + New macros {alloca,xnew}_{itext,{i,ext,raw,bin,asc}bytes} for + more convenient allocation of these commonly requested items. + Modify functions to use alloca_ibytes, alloca_array, alloca_extbytes, + xnew_ibytes, etc. also XREALLOC_ARRAY, xnew. + + * alloc.c (FREE_FIXED_TYPE): + * alloc.c (Fstring): + * alloc.c (MALLOC_BEGIN): + * alloc.c (free_managed_lcrecord): + * alloc.c (garbage_collect_1): + * alloc.c (init_alloc_once_early): + * alloc.c (xcalloc): + * alloc.c (xfree_1): + * alloc.c (xrealloc): + * alloc.c: + Rewrite the allocation functions to factor out repeated code. + Add assertions for freeing dumped data. + + * lisp.h (xmalloc_and_record_unwind): + * lisp.h (xfree): + Moved down and consolidated with other allocation stuff. + + * lisp.h: + * dynarr.c (stack_like_malloc): + * dynarr.c (stack_like_free): + New functions for allocation that's very efficient when mostly in + LIFO order. + + * lisp.h: + * text.c (find_pos_of_existing_active_alloca_convert): + * text.h (NEW_DFC_CONVERT_1_ALLOCA): + * text.c (new_dfc_convert_now_damn_it): + * text.c (new_dfc_convert_size): + * text.c (new_dfc_convert_copy_data): + * text.c (new_dfc_convert_malloc): + * text.h: + Factor out some stuff for general use by alloca()-conversion funs. + + * text.h (xmalloc_ibytes): + * lisp.h: + Fill out convenience routines for allocating various kinds of + bytes and put them in lisp.h. Use them in place of xmalloc(), + ALLOCA(). + + * text.h (SIZED_C_STRING_TO_EXTERNAL_MALLOC): + * text.h (C_STRING_TO_SIZED_EXTERNAL_MALLOC): + Fill out the convenience functions so the _MALLOC() kinds match + the alloca() kinds. + + --------------------------------------------------------------- + ERROR-CHECKING + --------------------------------------------------------------- + + * text.h (eicpy_c): + * text.h (eicpy_c_len): + * text.h (eicat_c): + * text.h (eisub_c): + Create ASSERT_ASCTEXT_ASCII() and ASSERT_ASCTEXT_ASCII_LEN() + from similar Eistring checkers and change the Eistring checkers to + use them instead. + + + --------------------------------------------------------------- + MACROS IN LISP.H + --------------------------------------------------------------- + + * lisp.h (GCDECL1): + * lisp.h (NNUNGCPRO): + * lisp.h (XGCDECL1): + * lisp.h (XGCPRO1): + * lisp.h (XUNGCPRO): + Redo GCPRO declarations. Create a "base" set of functions that can + be used to generate any kind of gcpro sets -- regular, ngcpro, + nngcpro, private ones used in GC_EXTERNAL_LIST_LOOP_2. + + * buffer.c (Fkill_buffer): + * callint.c (quotify_args): + * chartab.c (chartab_data_validate): + * console-msw.c: + * device-x.c: + * dialog-msw.c (handle_question_dialog_box): + * dired.c (file_name_completion): + * dired.c (Fdirectory_files): + * dired.c (file_name_completion_stat): + * extents.c (memoize_extent_face_internal): + * extents.c (report_extent_modification_mapper): + * ui-gtk.c (Fgtk_call_function): + * ui-gtk.c (Fgtk_import_function_internal): + * rangetab.c (rangetab_data_validate): + * nt.c (init_mswindows_environment): + * mule-coding.c (parse_charset_conversion_specs): + * minibuf.c (regexp_ignore_completion_p): + * menubar-msw.c (populate_or_checksum_helper): + * menubar.c (Fmenu_find_real_submenu): + * menubar-gtk.c (menu_create_menubar): + * lread.c (locate_file_without_hash): + * lread.c (Flocate_file): + * lread.c (Flocate_file_clear_hashing): + * lread.c (decode_mode): + * lread.c (locate_file): + * lisp.h (PROPERTY_LIST_LOOP): + * lisp.h (GC_EXTERNAL_LIST_LOOP_2): New. + * lisp.h (END_GC_EXTERNAL_LIST_LOOP): New. + * lisp.h (EXTERNAL_LIST_LOOP): Deleted. + * gutter.c (gutter_visible_validate): + * glyphs.c (decode_image_instance_type_list): + * glyphs.c (Fset_console_type_image_conversion_list): + * glyphs-widget.c (check_valid_instantiator_list): + * glyphs-widget.c (check_valid_item_list): + * fns.c (Freplace_list): + * fileio.c (Finsert_file_contents_internal): + * fileio.c (Ffind_file_name_handler): + * file-coding.c (Fset_coding_priority_list): + * file-coding.c (chain_putprop): + * specifier.c (display_table_validate): + Eliminate EXTERNAL_LIST_LOOP, which does not check for circularities. + Use EXTERNAL_LIST_LOOP_2 instead or EXTERNAL_LIST_LOOP_3 + or EXTERNAL_PROPERTY_LIST_LOOP_3 or GC_EXTERNAL_LIST_LOOP_2 + (new macro). Removed/redid comments on EXTERNAL_LIST_LOOP. + + + --------------------------------------------------------------- + SPACING FIXES + --------------------------------------------------------------- + + * callint.c (Fcall_interactively): + * hftctl.c (WR_REQ): + * number-gmp.c (init_number_gmp): + * process-unix.c (unix_deactivate_process): + Spacing fixes. + + + --------------------------------------------------------------- + FIX FOR GEOMETRY PROBLEM IN FIRST FRAME + --------------------------------------------------------------- + + * unicode.c (init_charset_unicode_tables): + Add workaround for newlib bug in sscanf() [should be fixed by + release 1.5.12 of Cygwin]. + * toolbar.c (update_frame_toolbars_geometry): + bug fix for problem of initial frame being 77 chars wide on Windows. + will be overridden by my other ws. + + --------------------------------------------------------------- + FIX FOR LEAKING PROCESS HANDLES: + --------------------------------------------------------------- + + + * process-nt.c (free_process_memory): + * process-nt.c (alloc_process_memory): + * process-nt.c (run_in_other_process): + * process-nt.c (send_signal_the_nt_way): + * process-nt.c (nt_finalize_process_data): + * process-nt.c (nt_create_process): + * process-nt.c (nt_deactivate_process): + * process-nt.c (process_type_create_nt): + Fixes for leaking handles. Inspired by work done by Adrian Aichner + <adrian@xemacs.org>. + + --------------------------------------------------------------- + FIX FOR CYGWIN BUG (Unicode-related): + --------------------------------------------------------------- + + * unicode.c (init_charset_unicode_tables): + Add workaround for newlib bug in sscanf() [should be fixed by + release 1.5.12 of Cygwin]. + + --------------------------------------------------------------- + WARNING FIXES: + --------------------------------------------------------------- + + * console-stream.c (init_console_stream): + `reinit' is unused. + + * compiler.h: + * event-msw.c (mswindows_wnd_proc): + * frame-msw.c (mswindows_frame_totally_visible_p): + * intl-encap-win32.c (qxeRegisterClass): + * intl-encap-win32.c (qxeRegisterClassEx): + * text.h (DFC_ALLOCA_USE_CONVERTED_DATA): + Add stuff to deal with ANSI-aliasing warnings I got. + + * regex.c: + * regex.c (itext_ichar): + Gather includes together to avoid warning. + + --------------------------------------------------------------- + CHANGES TO INITIALIZATION ROUTINES: + --------------------------------------------------------------- + + * buffer.c (vars_of_buffer): + * emacs.c (main_1): + * console.c (vars_of_console): + * debug.c (vars_of_debug): + * device-x.c (vars_of_device_x): + * device.c (vars_of_device): + * dragdrop.c (vars_of_dragdrop): + * emodules.c (vars_of_module): + * eval.c (vars_of_eval): + * eval.c (reinit_vars_of_eval): + * event-Xt.c (vars_of_event_Xt): + * event-gtk.c (vars_of_event_gtk): + * event-msw.c (vars_of_event_mswindows): + * event-stream.c (vars_of_event_stream): + * event-tty.c (vars_of_event_tty): + * events.c (vars_of_events): + * extents.c (vars_of_extents): + * faces.c (complex_vars_of_faces): + * file-coding.c (vars_of_file_coding): + * fileio.c (vars_of_fileio): + * font-lock.c (vars_of_font_lock): + * frame-msw.c (vars_of_frame_mswindows): + * glyphs-widget.c (vars_of_glyphs_widget): + * glyphs.c (vars_of_glyphs): + * glyphs.c (complex_vars_of_glyphs): + * gui-x.c (vars_of_gui_x): + * insdel.c (vars_of_insdel): + * lread.c (vars_of_lread): + * lstream.c (vars_of_lstream): + * menubar-gtk.c (vars_of_menubar_gtk): + * menubar-x.c (vars_of_menubar_x): + * minibuf.c (vars_of_minibuf): + * mule-wnnfns.c (vars_of_mule_wnn): + * objects-msw.c (vars_of_objects_mswindows): + * objects.c (vars_of_objects): + * print.c (vars_of_print): + * scrollbar-x.c (vars_of_scrollbar_x): + * search.c (vars_of_search): + * select-x.c (vars_of_select_x): + * text.c (reinit_vars_of_text): + * text.c (vars_of_text): + * undo.c (vars_of_undo): + * unicode.c (vars_of_unicode): + * window.c (vars_of_window): + * symsinit.h: + Call reinit_*() functions directly from emacs.c, for clarity. + Factor out some redundant init code. Move disallowed stuff + that had crept into vars_of_glyphs() into complex_vars_of_glyphs(). + Call init_eval_semi_early() from eval.c not in the middle of + vars_of_() in emacs.c since there should be no order dependency + in the latter calls. + + --------------------------------------------------------------- + ARMAGEDDON: + --------------------------------------------------------------- + + * alloc.c: + * emacs.c: + * lisp.h: + * print.c (debug_backtrace): + * print.c (debug_p3): + * print.c (debug_p4): + * print.c (debug_prin1): + * print.c (print_internal): + * print.c (printing_major_badness): + * print.c (struct debug_bindings ): + * print.c (write_string_to_stdio_stream_1): + * print.c (write_string_to_external_output_va): + * print.c (debug_prin1_exit): + * print.c (write_string_to_alternate_debugging_output): + Rename inhibit_non_essential_printing_operations to + inhibit_non_essential_conversion_operations. + + * text.c (dfc_convert_to_external_format): + * text.c (dfc_convert_to_internal_format): + Assert on !inhibit_non_essential_conversion_operations. + + * console-msw.c (Fmswindows_message_box): + * console-msw.c (GetConsoleHwnd): + * console-msw.c (mswindows_output_console_string): + * console-msw.c (write_string_to_mswindows_debugging_output): + * print.c (write_string_to_stdio_stream_1): + Don't do conversion in SetConsoleTitle or FindWindow to avoid + problems during armageddon. Put #errors for NON_ASCII_INTERNAL_FORMAT + in places where problems would arise. + + --------------------------------------------------------------- + CHANGES TO THE BUILD PROCEDURE: + --------------------------------------------------------------- + + * config.h.in: + * s/cxux.h: + * s/usg5-4-2.h: + * m/powerpc.h: + Add comment about correct ordering of this file. + Rearrange everything to follow this -- put all #undefs together + and before the s&m files. Add undefs for HAVE_ALLOCA, C_ALLOCA, + BROKEN_ALLOCA_IN_FUNCTION_CALLS, STACK_DIRECTION. Remove unused + HAVE_STPCPY, HAVE_GETWD, HAVE_SETLOCALE. + + * m/gec63.h: Deleted; totally broken, not used at all, not in FSF. + + * m/7300.h: + * m/acorn.h: + * m/alliant-2800.h: + * m/alliant.h: + * m/altos.h: + * m/altos.h (SWITCH_ENUM_BUG): + * m/amdahl.h: + * m/apollo.h: + * m/att3b.h: + * m/aviion.h: + * m/celerity.h: + * m/clipper.h: + * m/cnvrgnt.h: + * m/convex.h: + * m/cydra5.h: + * m/cydra5.h (DATA_START): + * m/delta.h: + * m/delta88k.h: + * m/dpx2.h: + * m/elxsi.h: + * m/ews4800r.h: + * m/gould.h: + * m/hp300bsd.h (LOAD_AVE_TYPE): + * m/hp800.h: + * m/hp9000s300.h: + * m/i860.h: + * m/ibmps2-aix.h: + * m/ibmps2-aix.h (LIBS_MACHINE): + * m/ibmrs6000.h: + * m/ibmrt-aix.h: + * m/ibmrt.h: + * m/intel386.h: + * m/intel386.h (SEGMENT_MASK): + * m/iris4d.h: + * m/iris5d.h: + * m/iris6d.h: + * m/irist.h: + * m/isi-ov.h: + * m/luna88k.h: + * m/m68k.h (ASSERT_VALID_POINTER): + * m/masscomp.h: + * m/mg1.h: + * m/mips-nec.h: + * m/mips-siemens.h: + * m/mips.h: + * m/news.h: + * m/nh3000.h: + * m/nh4000.h: + * m/ns32000.h: + * m/orion105.h: + * m/pfa50.h: + * m/plexus.h: + * m/pmax.h: + * m/powerpc.h: + * m/pyrmips.h (CANNOT_DUMP): + * m/sequent-ptx.h: + * m/sequent.h: + * m/sgi-challenge.h: + * m/symmetry.h: + * m/tad68k.h: + * m/tahoe.h: + * m/targon31.h: + * m/tekxd88.h: + * m/template.h: + * m/tower32.h: + * m/tower32v3.h: + * m/ustation.h: + * m/vax.h: + * m/wicat.h: + * m/xps100.h: + * m/xps100.h (TERMINFO): + Delete C_ALLOCA, HAVE_ALLOCA, STACK_DIRECTION, + BROKEN_ALLOCA_IN_FUNCTION_CALLS. All of this is auto-detected. + When in doubt, I followed recent FSF sources, which also have + these things deleted. + + 2002-04-05 Golubev I. N. <gin@mo.msk.ru> * .gdbinit (pptype):
--- a/src/EmacsFrame.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/EmacsFrame.c Thu Nov 04 23:08:28 2004 +0000 @@ -563,6 +563,7 @@ XrmValuePtr fromVal, XrmValuePtr toVal) { + /* !!#### needs work */ XrmQuark q; char *lowerName = (char *) ALLOCA (strlen ((char *) fromVal->addr) + 1);
--- a/src/abbrev.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/abbrev.c Thu Nov 04 23:08:28 2004 +0000 @@ -231,7 +231,7 @@ if (wordend <= wordstart) return 0; - p = word = (Ibyte *) ALLOCA (MAX_ICHAR_LEN * (wordend - wordstart)); + p = word = alloca_ibytes (MAX_ICHAR_LEN * (wordend - wordstart)); for (idx = wordstart; idx < wordend; idx++) { Ichar c = BUF_FETCH_CHAR (buf, idx);
--- a/src/alloc.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/alloc.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,7 +1,7 @@ /* Storage allocation and gc for XEmacs Lisp interpreter. Copyright (C) 1985-1998 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996, 2001, 2002, 2003 Ben Wing. + Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004 Ben Wing. This file is part of XEmacs. @@ -196,7 +196,7 @@ /* "Garbage collecting" */ Lisp_Object Vgc_message; Lisp_Object Vgc_pointer_glyph; -static const Char_ASCII gc_default_message[] = "Garbage collecting"; +static const Ascbyte gc_default_message[] = "Garbage collecting"; Lisp_Object Qgarbage_collecting; static Lisp_Object QSin_garbage_collection; @@ -311,29 +311,74 @@ minimum_address_seen = (char *) val; } -/* like malloc and realloc but check for no memory left. */ - #ifdef ERROR_CHECK_MALLOC static int in_malloc; extern int regex_malloc_disallowed; -#endif + +#define MALLOC_BEGIN() \ +do \ +{ \ + assert (!in_malloc); \ + assert (!regex_malloc_disallowed); \ + in_malloc = 1; \ +} \ +while (0) + +#define FREE_OR_REALLOC_BEGIN(block) \ +do \ +{ \ + /* Unbelievably, calling free() on 0xDEADBEEF doesn't cause an \ + error until much later on for many system mallocs, such as \ + the one that comes with Solaris 2.3. FMH!! */ \ + assert (block != (void *) 0xDEADBEEF); \ + /* You cannot free something within dumped space, because there is \ + no longer any sort of malloc structure associated with the block. \ + If you are tripping this, you may need to conditionalize on \ + DUMPEDP. */ \ + assert (!DUMPEDP (block)); \ + MALLOC_BEGIN (); \ +} \ +while (0) + +#define MALLOC_END() \ +do \ +{ \ + in_malloc = 0; \ +} \ +while (0) + +#else /* ERROR_CHECK_MALLOC */ + +#define MALLOC_BEGIN(block) +#define FREE_OR_REALLOC_BEGIN(block) +#define MALLOC_END() + +#endif /* ERROR_CHECK_MALLOC */ + +static void +malloc_after (void *val, Bytecount size) +{ + if (!val && size != 0) + memory_full (); + set_alloc_mins_and_maxes (val, size); +} + +/* like malloc, calloc, realloc, free but: + + -- check for no memory left + -- set internal mins and maxes + -- with error-checking on, check for reentrancy, invalid freeing, etc. +*/ #undef xmalloc void * xmalloc (Bytecount size) { void *val; -#ifdef ERROR_CHECK_MALLOC - assert (!in_malloc); - assert (!regex_malloc_disallowed); - in_malloc = 1; -#endif + MALLOC_BEGIN (); val = malloc (size); -#ifdef ERROR_CHECK_MALLOC - in_malloc = 0; -#endif - if (!val && (size != 0)) memory_full (); - set_alloc_mins_and_maxes (val, size); + MALLOC_END (); + malloc_after (val, size); return val; } @@ -342,18 +387,10 @@ xcalloc (Elemcount nelem, Bytecount elsize) { void *val; -#ifdef ERROR_CHECK_MALLOC - assert (!in_malloc); - assert (!regex_malloc_disallowed); - in_malloc = 1; -#endif + MALLOC_BEGIN (); val= calloc (nelem, elsize); -#ifdef ERROR_CHECK_MALLOC - in_malloc = 0; -#endif - - if (!val && (nelem != 0)) memory_full (); - set_alloc_mins_and_maxes (val, nelem * elsize); + MALLOC_END (); + malloc_after (val, nelem * elsize); return val; } @@ -367,18 +404,10 @@ void * xrealloc (void *block, Bytecount size) { -#ifdef ERROR_CHECK_MALLOC - assert (!in_malloc); - assert (!regex_malloc_disallowed); - in_malloc = 1; -#endif + FREE_OR_REALLOC_BEGIN (block); block = realloc (block, size); -#ifdef ERROR_CHECK_MALLOC - in_malloc = 0; -#endif - - if (!block && (size != 0)) memory_full (); - set_alloc_mins_and_maxes (block, size); + MALLOC_END (); + malloc_after (block, size); return block; } @@ -386,19 +415,11 @@ xfree_1 (void *block) { #ifdef ERROR_CHECK_MALLOC - /* Unbelievably, calling free() on 0xDEADBEEF doesn't cause an - error until much later on for many system mallocs, such as - the one that comes with Solaris 2.3. FMH!! */ - assert (block != (void *) 0xDEADBEEF); assert (block); - assert (!in_malloc); - assert (!regex_malloc_disallowed); - in_malloc = 1; #endif /* ERROR_CHECK_MALLOC */ + FREE_OR_REALLOC_BEGIN (block); free (block); -#ifdef ERROR_CHECK_MALLOC - in_malloc = 0; -#endif + MALLOC_END (); } #ifdef ERROR_CHECK_GC @@ -953,6 +974,7 @@ #define FREE_FIXED_TYPE(type, structtype, ptr) do { \ structtype *FFT_ptr = (ptr); \ gc_checking_assert (!LRECORD_FREE_P (FFT_ptr)); \ + gc_checking_assert (!DUMPEDP (FFT_ptr)); \ ADDITIONAL_FREE_##type (FFT_ptr); \ deadbeef_memory (FFT_ptr, sizeof (structtype)); \ PUT_FIXED_TYPE_ON_FREE_LIST (type, structtype, FFT_ptr); \ @@ -2498,7 +2520,7 @@ */ (int nargs, Lisp_Object *args)) { - Ibyte *storage = alloca_array (Ibyte, nargs * MAX_ICHAR_LEN); + Ibyte *storage = alloca_ibytes (nargs * MAX_ICHAR_LEN); Ibyte *p = storage; for (; nargs; nargs--, args++) @@ -2583,7 +2605,9 @@ build_ext_string (const Extbyte *str, Lisp_Object coding_system) { /* Some strlen's crash and burn if passed null. */ - return make_ext_string ((const Extbyte *) str, (str ? strlen(str) : 0), + return make_ext_string ((const Extbyte *) str, + (str ? dfc_external_data_len (str, coding_system) : + 0), coding_system); } @@ -2792,6 +2816,9 @@ gc_checking_assert (detagged_lisp_object_size (lheader) == list->size); /* Make sure the object isn't already freed. */ gc_checking_assert (!free_header->lcheader.free); + /* Freeing stuff in dumped memory is bad. If you trip this, you + may need to check for this before freeing. */ + gc_checking_assert (!OBJECT_DUMPED_P (lcrecord)); if (implementation->finalizer) implementation->finalizer (lheader, 0); @@ -2891,7 +2918,7 @@ #ifdef DEBUG_XEMACS static const struct memory_description staticpro_one_name_description_1[] = { - { XD_C_STRING, 0 }, + { XD_ASCII_STRING, 0 }, { XD_END } }; @@ -3114,17 +3141,17 @@ return sizeof (Lisp_Object); case XD_OPAQUE_PTR: return sizeof (void *); - case XD_STRUCT_PTR: + case XD_BLOCK_PTR: { EMACS_INT val = lispdesc_indirect_count (desc1->data1, desc, obj); return val * sizeof (void *); } - case XD_STRUCT_ARRAY: + case XD_BLOCK_ARRAY: { EMACS_INT val = lispdesc_indirect_count (desc1->data1, desc, obj); return (val * - lispdesc_structure_size + lispdesc_block_size (rdata, lispdesc_indirect_description (obj, desc1->data2))); } case XD_OPAQUE_DATA_PTR: @@ -3173,7 +3200,7 @@ return max_size; } } - case XD_C_STRING: + case XD_ASCII_STRING: return sizeof (void *); case XD_DOC_STRING: return sizeof (void *); @@ -3217,18 +3244,15 @@ i.e. by trapping SIGSEGV and SIGBUS.) */ Bytecount -lispdesc_structure_size (const void *obj, - const struct sized_memory_description *sdesc) +lispdesc_block_size_1 (const void *obj, Bytecount size, + const struct memory_description *desc) { EMACS_INT max_offset = -1; int max_offset_pos = -1; int pos; - const struct memory_description *desc; - - if (sdesc->size) - return sdesc->size; - - desc = sdesc->description; + + if (size) + return size; for (pos = 0; desc[pos].type != XD_END; pos++) { @@ -3405,7 +3429,7 @@ { int i; Bytecount elsize; - elsize = lispdesc_structure_size (data, sdesc); + elsize = lispdesc_block_size (data, sdesc); for (i = 0; i < count; i++) { @@ -3454,7 +3478,7 @@ case XD_LO_LINK: case XD_OPAQUE_PTR: case XD_OPAQUE_DATA_PTR: - case XD_C_STRING: + case XD_ASCII_STRING: case XD_DOC_STRING: break; case XD_LISP_OBJECT: @@ -3491,7 +3515,7 @@ } break; } - case XD_STRUCT_PTR: + case XD_BLOCK_PTR: { EMACS_INT count = lispdesc_indirect_count (desc1->data1, desc, data); @@ -3502,7 +3526,7 @@ mark_struct_contents (dobj, sdesc, count); break; } - case XD_STRUCT_ARRAY: + case XD_BLOCK_ARRAY: { EMACS_INT count = lispdesc_indirect_count (desc1->data1, desc, data); @@ -4669,7 +4693,7 @@ /***** Now we actually start the garbage collection. */ gc_in_progress = 1; - inhibit_non_essential_printing_operations = 1; + inhibit_non_essential_conversion_operations = 1; gc_generation_number[0]++; @@ -4833,7 +4857,7 @@ #endif recompute_need_to_garbage_collect (); - inhibit_non_essential_printing_operations = 0; + inhibit_non_essential_conversion_operations = 0; gc_in_progress = 0; run_post_gc_actions (); @@ -4887,7 +4911,7 @@ /* Debugging aids. */ static Lisp_Object -gc_plist_hack (const Char_ASCII *name, int value, Lisp_Object tail) +gc_plist_hack (const Ascbyte *name, int value, Lisp_Object tail) { /* C doesn't have local functions (or closures, or GC, or readable syntax, or portable numeric datatypes, or bit-vectors, or characters, or @@ -5394,11 +5418,11 @@ staticpros = Dynarr_new2 (Lisp_Object_ptr_dynarr, Lisp_Object *); Dynarr_resize (staticpros, 1410); /* merely a small optimization */ - dump_add_root_struct_ptr (&staticpros, &staticpros_description); + dump_add_root_block_ptr (&staticpros, &staticpros_description); #ifdef DEBUG_XEMACS staticpro_names = Dynarr_new2 (char_ptr_dynarr, char *); Dynarr_resize (staticpro_names, 1410); /* merely a small optimization */ - dump_add_root_struct_ptr (&staticpro_names, &staticpro_names_description); + dump_add_root_block_ptr (&staticpro_names, &staticpro_names_description); #endif init_lcrecord_lists ();
--- a/src/buffer.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/buffer.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,7 +1,7 @@ /* Buffer manipulation primitives for XEmacs. Copyright (C) 1985-1989, 1992-1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -244,9 +244,9 @@ { XD_LISP_OBJECT, offsetof (struct buffer, extent_info) }, - { XD_STRUCT_PTR, offsetof (struct buffer, text), + { XD_BLOCK_PTR, offsetof (struct buffer, text), 1, &buffer_text_description }, - { XD_STRUCT_PTR, offsetof (struct buffer, syntax_cache), + { XD_BLOCK_PTR, offsetof (struct buffer, syntax_cache), 1, &syntax_cache_description }, { XD_LISP_OBJECT, offsetof (struct buffer, indirect_children) }, @@ -1139,7 +1139,7 @@ /* This function can call lisp */ Lisp_Object buf; REGISTER struct buffer *b; - struct gcpro gcpro1, gcpro2; + struct gcpro gcpro1; if (NILP (buffer)) buf = Fcurrent_buffer (); @@ -1190,22 +1190,23 @@ if (BUFFER_LIVE_P (b)) { int speccount = specpdl_depth (); - Lisp_Object tail = Qnil; - - GCPRO2 (buf, tail); + + GCPRO1 (buf); record_unwind_protect (save_excursion_restore, save_excursion_save ()); Fset_buffer (buf); - /* First run the query functions; if any query is answered no, - don't kill the buffer. */ - EXTERNAL_LIST_LOOP (tail, Vkill_buffer_query_functions) - { - if (NILP (call0 (Fcar (tail)))) - { - UNGCPRO; - return unbind_to (speccount); - } - } + { + /* First run the query functions; if any query is answered no, + don't kill the buffer. */ + EXTERNAL_LIST_LOOP_2 (arg, Vkill_buffer_query_functions) + { + if (NILP (call0 (arg))) + { + UNGCPRO; + return unbind_to (speccount); + } + } + } /* Then run the hooks. */ run_hook (Qkill_buffer_hook); @@ -1829,25 +1830,33 @@ intern_converting_underscores_to_dashes (#field), plist) ADD_INT (bufz); ADD_INT (z); +#ifdef OLD_BYTE_CHAR ADD_INT (mule_bufmin); ADD_INT (mule_bufmax); ADD_INT (mule_bytmin); ADD_INT (mule_bytmax); ADD_INT (mule_shifter); ADD_BOOL (mule_three_p); +#endif ADD_BOOL (entirely_one_byte_p); ADD_INT (num_ascii_chars); ADD_INT (num_8_bit_fixed_chars); ADD_INT (num_16_bit_fixed_chars); + ADD_INT (cached_charpos); + ADD_INT (cached_bytepos); + ADD_INT (next_cache_pos); + { - Lisp_Object pos[16]; + Lisp_Object pos[NUM_CACHED_POSITIONS]; int i; - for (i = 0; i < 16; i++) + for (i = 0; i < b->text->next_cache_pos; i++) pos[i] = make_int (b->text->mule_charbpos_cache[i]); - plist = cons3 (Flist (16, pos), intern ("mule-charbpos-cache"), plist); - for (i = 0; i < 16; i++) + plist = cons3 (Flist (b->text->next_cache_pos, pos), + intern ("mule-charbpos-cache"), plist); + for (i = 0; i < b->text->next_cache_pos; i++) pos[i] = make_int (b->text->mule_bytebpos_cache[i]); - plist = cons3 (Flist (16, pos), intern ("mule-bytebpos-cache"), plist); + plist = cons3 (Flist (b->text->next_cache_pos, pos), + intern ("mule-bytebpos-cache"), plist); } #undef ADD_INT #undef ADD_BOOL @@ -1963,8 +1972,6 @@ vars_of_buffer (void) { /* This function can GC */ - reinit_vars_of_buffer (); - staticpro (&QSFundamental); staticpro (&QSscratch); @@ -2331,8 +2338,8 @@ syms = XBUFFER (Vbuffer_local_symbols); buffer_defaults_saved_slots = &defs->BUFFER_SLOTS_FIRST_NAME; buffer_local_symbols_saved_slots = &syms->BUFFER_SLOTS_FIRST_NAME; - dump_add_root_struct_ptr (&buffer_defaults_saved_slots, &buffer_slots_description); - dump_add_root_struct_ptr (&buffer_local_symbols_saved_slots, &buffer_slots_description); + dump_add_root_block_ptr (&buffer_defaults_saved_slots, &buffer_slots_description); + dump_add_root_block_ptr (&buffer_local_symbols_saved_slots, &buffer_slots_description); DEFVAR_BUFFER_DEFAULTS ("default-modeline-format", modeline_format /* Default value of `modeline-format' for buffers that don't override it.
--- a/src/buffer.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/buffer.h Thu Nov 04 23:08:28 2004 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1985, 1986, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2001, 2002 Ben Wing. + Copyright (C) 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -74,12 +74,16 @@ extent-parent and extent-children. */ +#define NUM_CACHED_POSITIONS 50 +#define NUM_MOVED_POSITIONS 10 + struct buffer_text { Ibyte *beg; /* Actual address of buffer contents. */ Bytebpos gpt; /* Index of gap in buffer. */ + Charbpos bufgpt; /* Equivalent as a Charbpos. */ Bytebpos z; /* Index of end of buffer. */ - Charbpos bufz; /* Equivalent as a Charbpos. */ + Charbpos bufz; /* Equivalent as a Charbpos. */ Bytecount gap_size;/* Size of buffer's gap */ Bytecount end_gap_size;/* Size of buffer's end gap */ long modiff; /* This counts buffer-modification events @@ -90,6 +94,8 @@ time buffer visited or saved a file. */ #ifdef MULE + +#ifdef OLD_BYTE_CHAR /* We keep track of a "known" region for very fast access. This information is text-only so it goes here. We update this at each change to the buffer, so if it's entirely ASCII, these will always @@ -97,11 +103,16 @@ Charbpos mule_bufmin, mule_bufmax; Bytebpos mule_bytmin, mule_bytmax; int mule_shifter, mule_three_p; +#endif - /* And we also cache 16 positions for fairly fast access near those - positions. */ - Charbpos mule_charbpos_cache[16]; - Bytebpos mule_bytebpos_cache[16]; + /* And we also cache NUM_CACHED_POSITIONS positions for fairly fast + access near those positions. */ + Charbpos mule_charbpos_cache[NUM_CACHED_POSITIONS]; + Bytebpos mule_bytebpos_cache[NUM_CACHED_POSITIONS]; + int next_cache_pos; + + Charbpos cached_charpos; + Bytebpos cached_bytepos; /* True if all chars fit into one byte; == (format == FORMAT_8_BIT_FIXED || @@ -117,7 +128,7 @@ /* Currently we only handle 8 bit fixed and default */ Internal_Format format; -#endif +#endif /* MULE */ /* Similar to the above, we keep track of positions for which line number has last been calculated. See line-number.c. */ @@ -312,6 +323,10 @@ #define BYTE_BUF_Z(buf) ((buf)->text->z + 0) #define BUF_Z(buf) ((buf)->text->bufz + 0) +/* Gap location. */ +#define BYTE_BUF_GPT(buf) ((buf)->text->gpt + 0) +#define BUF_GPT(buf) ((buf)->text->bufgpt + 0) + /* Point. */ #define BYTE_BUF_PT(buf) ((buf)->pt + 0) #define BUF_PT(buf) ((buf)->bufpt + 0) @@ -536,69 +551,14 @@ /* Converting between byte and character positions */ /*----------------------------------------------------------------------*/ -#ifdef MULE - -/* The basic algorithm we use is to keep track of a known region of - characters in each buffer, all of which are of the same width. We keep - track of the boundaries of the region in both Charbpos and Bytebpos - coordinates and also keep track of the char width, which is 1 - 4 bytes. - If the position we're translating is not in the known region, then we - invoke a function to update the known region to surround the position in - question. This assumes locality of reference, which is usually the - case. +/* - Note that the function to update the known region can be simple or - complicated depending on how much information we cache. In addition to - the known region, we always cache the correct conversions for point, - BEGV, and ZV, and in addition to this we cache 16 positions where the - conversion is known. We only look in the cache or update it when we - need to move the known region more than a certain amount (currently 50 - chars), and then we throw away a "random" value and replace it with the - newly calculated value. - - Finally, we maintain an extra flag that tracks whether the buffer is - entirely ASCII, to speed up the conversions even more. This flag is - actually of dubious value because in an entirely-ASCII buffer the known - region will always span the entire buffer (in fact, we update the flag - based on this fact), and so all we're saving is a few machine cycles. +Info on Byte-Char conversion: - A potentially smarter method than what we do with known regions and - cached positions would be to keep some sort of pseudo-extent layer over - the buffer; maybe keep track of the charbpos/bytebpos correspondence at the - beginning of each line, which would allow us to do a binary search over - the pseudo-extents to narrow things down to the correct line, at which - point you could use a linear movement method. This would also mesh well - with efficiently implementing a line-numbering scheme. However, you - have to weigh the amount of time spent updating the cache vs. the - savings that result from it. In reality, we modify the buffer far less - often than we access it, so a cache of this sort that provides - guaranteed LOG (N) performance (or perhaps N * LOG (N), if we set a - maximum on the cache size) would indeed be a win, particularly in very - large buffers. If we ever implement this, we should probably set a - reasonably high minimum below which we use the old method, because the - time spent updating the fancy cache would likely become dominant when - making buffer modifications in smaller buffers. + (Info-goto-node "(internals)Byte-Char Position Conversion") +*/ - Note also that we have to multiply or divide by the char width in order - to convert the positions. We do some tricks to avoid ever actually - having to do a multiply or divide, because that is typically an - expensive operation (esp. divide). Multiplying or dividing by 1, 2, or - 4 can be implemented simply as a shift left or shift right, and we keep - track of a shifter value (0, 1, or 2) indicating how much to shift. - Multiplying by 3 can be implemented by doubling and then adding the - original value. Dividing by 3, alas, cannot be implemented in any - simple shift/subtract method, as far as I know; so we just do a table - lookup. For simplicity, we use a table of size 128K, which indexes the - "divide-by-3" values for the first 64K non-negative numbers. (Note that - we can increase the size up to 384K, i.e. indexing the first 192K - non-negative numbers, while still using shorts in the array.) This also - means that the size of the known region can be at most 64K for - width-three characters. - - !!#### We should investigate the algorithm in GNU Emacs. I think it - does something similar, but it may differ in some details, and it's - worth seeing if anything can be gleaned. - */ +#ifdef MULE Bytebpos charbpos_to_bytebpos_func (struct buffer *buf, Charbpos x); Charbpos bytebpos_to_charbpos_func (struct buffer *buf, Bytebpos x); @@ -623,11 +583,13 @@ retval = (Bytebpos) (x << 1); else if (BUF_FORMAT (buf) == FORMAT_32_BIT_FIXED) retval = (Bytebpos) (x << 2); +#ifdef OLD_BYTE_CHAR else if (x >= buf->text->mule_bufmin && x <= buf->text->mule_bufmax) retval = (buf->text->mule_bytmin + ((x - buf->text->mule_bufmin) << buf->text->mule_shifter) + (buf->text->mule_three_p ? (x - buf->text->mule_bufmin) : (Bytebpos) 0)); +#endif /* OLD_BYTE_CHAR */ else retval = charbpos_to_bytebpos_func (buf, x); #else @@ -654,11 +616,13 @@ retval = (Charbpos) (x >> 1); else if (BUF_FORMAT (buf) == FORMAT_32_BIT_FIXED) retval = (Charbpos) (x >> 2); +#ifdef OLD_BYTE_CHAR else if (x >= buf->text->mule_bytmin && x <= buf->text->mule_bytmax) retval = (buf->text->mule_bufmin + ((buf->text->mule_three_p ? three_to_one_table[x - buf->text->mule_bytmin] : (x - buf->text->mule_bytmin) >> buf->text->mule_shifter))); +#endif /* OLD_BYTE_CHAR */ else retval = bytebpos_to_charbpos_func (buf, x); #else @@ -1071,41 +1035,42 @@ representation is changed to have multiple gaps in it. */ - /* Return the maximum position in the buffer it is safe to scan forwards past N to. This is used to prevent buffer scans from running into the gap (e.g. search.c). All characters between N and CEILING_OF(N) are located contiguous in memory. Note that the character *at* CEILING_OF(N) is not contiguous in memory. */ #define BYTE_BUF_CEILING_OF(b, n) \ - ((n) < (b)->text->gpt && (b)->text->gpt < BYTE_BUF_ZV (b) ? \ - (b)->text->gpt : BYTE_BUF_ZV (b)) -#define BUF_CEILING_OF(b, n) \ - bytebpos_to_charbpos (b, BYTE_BUF_CEILING_OF (b, charbpos_to_bytebpos (b, n))) + ((n) < BYTE_BUF_GPT (b) && BYTE_BUF_GPT (b) < BYTE_BUF_ZV (b) ? \ + BYTE_BUF_GPT (b) : BYTE_BUF_ZV (b)) +#define BUF_CEILING_OF(b, n) \ + ((n) < BUF_GPT (b) && BUF_GPT (b) < BUF_ZV (b) ? \ + BUF_GPT (b) : BUF_ZV (b)) /* Return the minimum position in the buffer it is safe to scan backwards past N to. All characters between FLOOR_OF(N) and N are located contiguous in memory. Note that the character *at* N may not be contiguous in memory. */ -#define BYTE_BUF_FLOOR_OF(b, n) \ - (BYTE_BUF_BEGV (b) < (b)->text->gpt && (b)->text->gpt < (n) ? \ - (b)->text->gpt : BYTE_BUF_BEGV (b)) -#define BUF_FLOOR_OF(b, n) \ - bytebpos_to_charbpos (b, BYTE_BUF_FLOOR_OF (b, charbpos_to_bytebpos (b, n))) +#define BYTE_BUF_FLOOR_OF(b, n) \ + (BYTE_BUF_BEGV (b) < BYTE_BUF_GPT (b) && BYTE_BUF_GPT (b) < (n) ? \ + BYTE_BUF_GPT (b) : BYTE_BUF_BEGV (b)) +#define BUF_FLOOR_OF(b, n) \ + (BUF_BEGV (b) < BUF_GPT (b) && BUF_GPT (b) < (n) ? \ + BUF_GPT (b) : BUF_BEGV (b)) #define BYTE_BUF_CEILING_OF_IGNORE_ACCESSIBLE(b, n) \ - ((n) < (b)->text->gpt && (b)->text->gpt < BYTE_BUF_Z (b) ? \ - (b)->text->gpt : BYTE_BUF_Z (b)) -#define BUF_CEILING_OF_IGNORE_ACCESSIBLE(b, n) \ - bytebpos_to_charbpos \ - (b, BYTE_BUF_CEILING_OF_IGNORE_ACCESSIBLE (b, charbpos_to_bytebpos (b, n))) + ((n) < BYTE_BUF_GPT (b) && BYTE_BUF_GPT (b) < BYTE_BUF_Z (b) ? \ + BYTE_BUF_GPT (b) : BYTE_BUF_Z (b)) +#define BUF_CEILING_OF_IGNORE_ACCESSIBLE(b, n) \ + ((n) < BUF_GPT (b) && BUF_GPT (b) < BUF_Z (b) ? \ + BUF_GPT (b) : BUF_Z (b)) -#define BYTE_BUF_FLOOR_OF_IGNORE_ACCESSIBLE(b, n) \ - (BYTE_BUF_BEG (b) < (b)->text->gpt && (b)->text->gpt < (n) ? \ - (b)->text->gpt : BYTE_BUF_BEG (b)) -#define BUF_FLOOR_OF_IGNORE_ACCESSIBLE(b, n) \ - bytebpos_to_charbpos \ - (b, BYTE_BUF_FLOOR_OF_IGNORE_ACCESSIBLE (b, charbpos_to_bytebpos (b, n))) +#define BYTE_BUF_FLOOR_OF_IGNORE_ACCESSIBLE(b, n) \ + (BYTE_BUF_BEG (b) < BYTE_BUF_GPT (b) && BYTE_BUF_GPT (b) < (n) ? \ + BYTE_BUF_GPT (b) : BYTE_BUF_BEG (b)) +#define BUF_FLOOR_OF_IGNORE_ACCESSIBLE(b, n) \ + (BUF_BEG (b) < BUF_GPT (b) && BUF_GPT (b) < (n) ? \ + BUF_GPT (b) : BUF_BEG (b)) /* Iterate over contiguous chunks of text in buffer BUF, starting at POS, of length LEN. Evaluates POS and LEN only once, but BUF multiply. In @@ -1117,7 +1082,7 @@ NOTE: This must be surrounded with braces! */ #define BUFFER_TEXT_LOOP(buf, pos, len, runptr, runlen) \ -Ibyte *runptr; \ +Ibyte *runptr; \ Bytecount runlen; \ Bytebpos BTL_pos = (pos); \ Bytebpos BTL_len = (len); \
--- a/src/bytecode.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/bytecode.c Thu Nov 04 23:08:28 2004 +0000 @@ -2178,7 +2178,7 @@ static const struct memory_description compiled_function_description[] = { { XD_INT, offsetof (Lisp_Compiled_Function, args_in_array) }, - { XD_STRUCT_PTR, offsetof (Lisp_Compiled_Function, args), + { XD_BLOCK_PTR, offsetof (Lisp_Compiled_Function, args), XD_INDIRECT (0, 0), &lisp_object_description }, { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, instructions) }, { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, constants) }, @@ -2228,7 +2228,7 @@ Lisp_Opaque *opaque = XOPAQUE (f->instructions); Ibyte * const buffer = - alloca_array (Ibyte, OPAQUE_SIZE (opaque) * MAX_ICHAR_LEN); + alloca_ibytes (OPAQUE_SIZE (opaque) * MAX_ICHAR_LEN); Ibyte *bp = buffer; const Opbyte * const program = (const Opbyte *) OPAQUE_DATA (opaque);
--- a/src/callint.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/callint.c Thu Nov 04 23:08:28 2004 +0000 @@ -236,9 +236,8 @@ static Lisp_Object quotify_args (Lisp_Object expr) { - Lisp_Object tail; - EXTERNAL_LIST_LOOP (tail, expr) - XSETCAR (tail, Fquote_maybe (XCAR (tail))); + EXTERNAL_LIST_LOOP_3 (elt, expr, tail) + XSETCAR (tail, Fquote_maybe (elt)); return expr; } @@ -387,7 +386,7 @@ goto lose; } - /* FSFmacs makes an ALLOCA () copy of prompt_data here. + /* FSFmacs makes an ALLOCA() copy of prompt_data here. We're more intelligent about this and just reset prompt_data as necessary. */ /* If either specs or prompt_data is set to a string, use it. */
--- a/src/casefiddle.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/casefiddle.c Thu Nov 04 23:08:28 2004 +0000 @@ -51,8 +51,7 @@ { Lisp_Object syntax_table = buf->mirror_syntax_table; Ibyte *storage = - alloca_array (Ibyte, XSTRING_LENGTH (string_or_char) * - MAX_ICHAR_LEN); + alloca_ibytes (XSTRING_LENGTH (string_or_char) * MAX_ICHAR_LEN); Ibyte *newp = storage; Ibyte *oldp = XSTRING_DATA (string_or_char); Ibyte *endp = oldp + XSTRING_LENGTH (string_or_char);
--- a/src/charset.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/charset.h Thu Nov 04 23:08:28 2004 +0000 @@ -194,40 +194,15 @@ Lisp_Object ccl_program; - /* Unicode translation tables. See unicode.c for the format of these tables. - - NOTE ABOUT DUMPING: We don't currently dump these tables. For one - thing, they're big, and it's very fast to recreate them (a fraction of - a second on modern processors); for another, there isn't currently - support in pdump for this. (At one point I started writing it, in the - form of XD_UNION, but thought better of it.) In order to avoid pdump - problems (and to make the dump data smaller), we free all the tables - at dump time (using the disksave finalization method), set them to - zero, and reinit them to blank when we start up again; they will be - reloaded when `init-mule-at-startup' is called. - - #### This creates a problem w.r.t. user-defined charsets. It would be - inconvenient to require all dumped user-defined charsets to be - reloaded at init time, but that's what currently needs to be done. - The solution is either to go ahead and create pdump support for - dumping the tables, and use it just for these; or to copy the data in - them into a compressed format, write it out to pdump as a single - opaque block, and undo the operation at startup. - - #### There's another problem, having to do with starting up in a - non-ISO-8859-1 directory. We don't load the tables until after we've - parsed the current directories, and we run into a real bootstrapping - problem trying to solve this. Either we'll have to dump all the - tables as-is or make some special provisions for writing extra binary - data into the pdump data, and do the compressed trick mentioned above - for all the tables. */ + /* Unicode translation tables. See unicode.c for the format of these + tables, and discussion of how they are initialized. + */ void *to_unicode_table; void *from_unicode_table; int from_unicode_levels; - unsigned char unicode_table_loaded; - - /* Final byte of this character set in ISO2022 designating escape sequence */ + /* Final byte of this character set in ISO2022 designating escape + sequence */ Ibyte final; /* Number of bytes (1 - 4) required in the internal representation
--- a/src/chartab.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/chartab.c Thu Nov 04 23:08:28 2004 +0000 @@ -1499,17 +1499,11 @@ chartab_data_validate (Lisp_Object UNUSED (keyword), Lisp_Object value, Error_Behavior UNUSED (errb)) { - Lisp_Object rest; - /* #### should deal with ERRB */ - EXTERNAL_LIST_LOOP (rest, value) + EXTERNAL_PROPERTY_LIST_LOOP_3 (range, data, value) { - Lisp_Object range = XCAR (rest); struct chartab_range dummy; - rest = XCDR (rest); - if (!CONSP (rest)) - signal_error (Qlist_formation_error, "Invalid list format", value); if (CONSP (range)) { if (!CONSP (XCDR (range))
--- a/src/compiler.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/compiler.h Thu Nov 04 23:08:28 2004 +0000 @@ -1,6 +1,7 @@ /* Compiler-specific definitions for XEmacs. Copyright (C) 1998-1999, 2003 Free Software Foundation, Inc. Copyright (C) 1994 Richard Mlynarik. + Copyright (C) 1995, 1996, 2000-2004 Ben Wing. This file is part of XEmacs. @@ -233,4 +234,44 @@ # define MODULE_API #endif +/* Under "strict-aliasing" assumptions, you're not necessarily allowed to + access the same memory address as two different types. The proper way + around that is with a union. The macros below help out, e.g. the + definition of XE_MAKEPOINTS(val) is + + ANSI_ALIASING_TYPEDEF (POINTS, POINTS); + #define XE_MAKEPOINTS(l) ANSI_ALIASING_CAST (POINTS, l) + + replacing + + BAD!!! #define XE_MAKEPOINTS(l) (* (POINTS *) &(l)) + + On the other hand, if you are just casting from one pointer to the other + in order to pass a pointer to another function, it's probably OK to just + trick GCC by inserting an intermediate cast to (void *), to avoid + warnings about "dereferencing type-punned pointer". #### I don't know + how kosher this is, but do strict-aliasing rules really apply across + functions? + + Note that the input to e.g. VOIDP_CAST must be an lvalue (i.e. not + &(something)), but the value of the macro is also an lvalue, so in place + of `(void **) &foo' you could write `& VOIDP_CAST (foo)' if you are + subsequently dereferencing the value or don't feel comfortable doing a + trick like `(void **) (void *) &foo'. + + Unfortunately, it does not work to just define the union type on the fly in + the cast -- otherwise, we could avoid the need for a typedef. Or rather, + it does work under gcc but not under Visual C++. + + --ben + */ + +#define ANSI_ALIASING_TYPEDEF(name, type) typedef union { char c; type p; } *ANSI_ALIASING_##name +#define ANSI_ALIASING_CAST(name, val) (((ANSI_ALIASING_##name) &(val))->p) +ANSI_ALIASING_TYPEDEF (voidp, void *); +/* VOIDP_CAST: Cast an lvalue to (void *) in a way that is ANSI-aliasing + safe and will not result in GCC warnings. The result is still an + lvalue, so you can assign to it or take its address. */ +#define VOIDP_CAST(l) ANSI_ALIASING_CAST (voidp, l) + #endif /* INCLUDED_compiler_h */
--- a/src/config.h.in Thu Nov 04 22:51:31 2004 +0000 +++ b/src/config.h.in Thu Nov 04 23:08:28 2004 +0000 @@ -1,6 +1,6 @@ /* XEmacs site configuration template file. -*- C -*- Copyright (C) 1986, 1991-1994, 1998, 1999 Free Software Foundation, Inc. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -27,6 +27,21 @@ #ifndef _SRC_CONFIG_H_ #define _SRC_CONFIG_H_ +/* The proper format of this file: + +1. All #undef statements that are changed by configure should go together, + BEFORE the inclusion of the s&m files, and need to be bracketed by + #ifndef WIN32_NO_CONFIGURE. There is currently only one exception to + this: SYSTEM_TYPE. + +2. All other code, except for the things that may be referenced in s&m + files (there is very very little of this) need to go AFTER the inclusion + of s&m files. + +Together, this ensures that the s&m files can override configure +determinations as necessary, and we will properly notice this. +*/ + /* This file now serves both as config.h.in and simply as config.h under Windows NT. Under Windows NT, there is no configure script that @@ -133,12 +148,6 @@ /* Allow the configurer to specify if she wants site-modules. */ #undef INHIBIT_SITE_MODULES -/* This will be removed in 19.15. */ -/* Hah! Try 20.3 ... */ -/* Hah! Try never ... */ -/* If at first you don't succeed, try, try again. */ -/* #define LOSING_BYTECODE */ - /* Undefine on systems which don't have processes */ #undef HAVE_UNIX_PROCESSES @@ -160,6 +169,30 @@ /* Use a debugging malloc? -- experimental */ #undef USE_DEBUG_MALLOC +/* Use the relocating allocator for buffer space? */ +#undef REL_ALLOC + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Is alloca() broken when part of an argument to a function call? */ +#undef BROKEN_ALLOCA_IN_FUNCTION_CALLS + +/* Define to 1 if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + /* Compile in TTY support? */ #undef HAVE_TTY @@ -185,18 +218,6 @@ #undef NARROWPROTO #endif /* HAVE_X_WINDOWS */ -#endif /* WIN32_NO_CONFIGURE */ - -#ifdef HAVE_X_WINDOWS -/* The following should always be defined, no matter what xmkmf thinks. */ -#ifndef NeedFunctionPrototypes -#define NeedFunctionPrototypes 1 -#endif -#ifndef FUNCPROTO -#define FUNCPROTO 15 -#endif -#endif /* HAVE_X_WINDOWS */ - /* Defines for building Gtk applications */ #undef HAVE_GNOME #undef HAVE_GTK @@ -205,22 +226,6 @@ #undef HAVE_GLADE_H #undef LIBGLADE_XML_TXTDOMAIN -/* Define HAVE_WINDOW_SYSTEM if any windowing system is available. */ -#if defined (HAVE_GTK) || defined (HAVE_X_WINDOWS) || defined (HAVE_MS_WINDOWS) /* || defined (HAVE_NEXTSTEP) */ -#define HAVE_WINDOW_SYSTEM -#endif - -#if defined (HAVE_GTK) || defined (HAVE_X_WINDOWS) -#define HAVE_XLIKE -#endif - -/* Define HAVE_UNIXOID_EVENT_LOOP if we use select() to wait for events. */ -#if defined (HAVE_X_WINDOWS) || defined (HAVE_TTY) || defined (HAVE_MSG_SELECT) -#define HAVE_UNIXOID_EVENT_LOOP -#endif - -#ifndef WIN32_NO_CONFIGURE /* Defined in xemacs.mak or s/windowsnt.h: */ - /* XFree86 has a different prototype for this function */ #undef HAVE_XREGISTERIMINSTANTIATECALLBACK #undef XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE @@ -343,6 +348,9 @@ /* Can `gettimeofday' accept two arguments? */ #undef GETTIMEOFDAY_ONE_ARGUMENT +/* Is scanf() broken? (Under certain versions of Cygwin) */ +#undef CYGWIN_SCANF_BUG + #undef HAVE_MMAP #undef HAVE_STRCOLL #undef HAVE_GETPGRP @@ -350,6 +358,7 @@ #undef HAVE_INVERSE_HYPERBOLIC +/* Functions in the big list of functions checked for */ #undef HAVE_CBRT #undef HAVE_CLOSEDIR #undef HAVE_DUP2 @@ -357,14 +366,15 @@ #undef HAVE_FMOD #undef HAVE_FPATHCONF #undef HAVE_FREXP +#undef HAVE_FSYNC #undef HAVE_FTIME +#undef HAVE_FTRUNCATE #undef HAVE_GETADDRINFO #undef HAVE_GETHOSTNAME #undef HAVE_GETNAMEINFO #undef HAVE_GETPAGESIZE #undef HAVE_GETRLIMIT #undef HAVE_GETTIMEOFDAY -#undef HAVE_GETWD #undef HAVE_GETCWD #undef HAVE_LINK #undef HAVE_LOGB @@ -376,7 +386,6 @@ #undef HAVE_POLL #undef HAVE_RANDOM #undef HAVE_READLINK -#undef HAVE_REALPATH #undef HAVE_RENAME #undef HAVE_RES_INIT #undef HAVE_RINT @@ -388,21 +397,24 @@ #undef HAVE_SIGBLOCK #undef HAVE_SIGHOLD #undef HAVE_SIGPROCMASK -#undef HAVE_SIGSETJMP #undef HAVE_SNPRINTF -#undef HAVE_STPCPY #undef HAVE_STRERROR #undef HAVE_STRLWR #undef HAVE_STRUPR #undef HAVE_SYMLINK #undef HAVE_TZSET #undef HAVE_ULIMIT +#undef HAVE_UMASK #undef HAVE_USLEEP +#undef HAVE_VLIMIT +#undef HAVE_VSNPRINTF +#undef HAVE_WAITPID +#undef HAVE_WCSCMP +#undef HAVE_WCSLEN + #undef HAVE_UTIME #undef HAVE_UTIMES -#undef HAVE_WAITPID -#undef HAVE_VSNPRINTF -#undef HAVE_VLIMIT +#undef HAVE_SIGSETJMP /* Many flavors of PTY support */ #undef HAVE_GETPT /* glibc's easy pty allocation function */ @@ -428,9 +440,6 @@ #undef HAVE_SYSVIPC #undef HAVE_LOCKF #undef HAVE_FLOCK -#undef HAVE_FSYNC -#undef HAVE_FTRUNCATE -#undef HAVE_UMASK #undef SYSV_SYSTEM_DIR #undef NONSYSTEM_DIR_LIBRARY @@ -667,116 +676,58 @@ #undef gid_t #undef socklen_t -#endif /* WIN32_NO_CONFIGURE */ - -/* USER_FULL_NAME returns a string that is the user's full name. - It can assume that the variable `pw' points to the password file - entry for this user. - - At some sites, the pw_gecos field contains the user's full name. - If neither this nor any other field contains the right thing, use - pw_name, giving the user's login name, since that is better than - nothing. */ -#define USER_FULL_NAME pw->pw_gecos - -#if (defined (QUANTIFY) || defined (PURIFY)) && !defined (XLIB_ILLEGAL_ACCESS) -#define XLIB_ILLEGAL_ACCESS 1 -#endif - -#define XEMACS_WANTS_C_ALLOCA - -/* alloca twiddling. - Because we might be #including alloca.h here, feature test macros - such as _XOPEN_SOURCE must be defined above. */ +/* Enhanced numeric support */ +#undef WITH_NUMBER_TYPES +#undef WITH_GMP +#undef WITH_MP +#undef MP_PREFIX +#undef HAVE_MP_MOVE -#undef HAVE_ALLOCA_H -#ifndef NOT_C_CODE -#if defined (__CYGWIN__) -/* We get complaints about redefinitions if we just use the __GNUC__ - definition: stdlib.h also includes alloca.h, which defines it slightly - differently */ -#include <alloca.h> -#elif defined (__GNUC__) -#define alloca __builtin_alloca -#elif defined (WIN32_NO_CONFIGURE) -/* Defines size_t and alloca (). */ -#include <malloc.h> -#elif defined (__DECC) -#include <alloca.h> -#pragma intrinsic(alloca) -#elif defined (HAVE_ALLOCA_H) -#include <alloca.h> -#elif defined (_AIX) -/* AIX requires this before any "real" code in the translation unit. */ -#pragma alloca -#elif ! defined (alloca) -#ifdef C_ALLOCA -#define alloca xemacs_c_alloca -#else -void *alloca (); -#endif /* C_ALLOCA */ -#endif /* !defined (alloca) */ -#endif /* C code */ +#undef SIZEOF_SHORT +#undef SIZEOF_INT +#undef SIZEOF_LONG +#undef SIZEOF_LONG_LONG +#undef SIZEOF_VOID_P +#undef SIZEOF_DOUBLE -/* The configuration script may define `opsysfile' to be the name of - the s/...h file that describes your operating system. - The file name is chosen based on the configuration name. */ +/* some systems (Cygwin) typedef u?intptr_t in <sys/types.h> + but the standard is <inttypes.h> + ugliness due to last-resort conditional typedef'ing in lisp.h */ +#undef HAVE_INTPTR_T_IN_SYS_TYPES_H + +/* Does the keyword `inline' exist? */ +#undef inline -#if defined (__cplusplus) && !defined (NOT_C_CODE) -extern "C" { -#endif - -#undef config_opsysfile -#ifdef WIN32_NO_CONFIGURE -#include "s/windowsnt.h" -#elif defined (config_opsysfile) -#include config_opsysfile -#endif - -/* The configuration script may define `machfile' to be the name of - the m/...h file that describes the machine you are using. - The file name is chosen based on the configuration name. */ - -#undef config_machfile -#ifdef WIN32_NO_CONFIGURE -#include "m/windowsnt.h" -#elif defined (config_machfile) -#include config_machfile -#endif - -#if defined (__cplusplus) && !defined (NOT_C_CODE) -} -#endif +/* movemail options */ +/* Should movemail use POP3 for mail access? */ +#undef MAIL_USE_POP +/* Should movemail use kerberos for POP authentication? */ +#undef KERBEROS +/* Should movemail use hesiod for getting POP server host? */ +#undef HESIOD +/* Determine type of mail locking. */ +#undef MAIL_LOCK_LOCKF +#undef MAIL_LOCK_FLOCK +#undef MAIL_LOCK_DOT +#undef MAIL_LOCK_LOCKING +#undef MAIL_LOCK_MMDF -/* s&m files shouldn't be required to define anything, or even to exist. - If the s&m files don't define SYSTEM_TYPE, configure will select an - appropriate default value. */ -#ifndef SYSTEM_TYPE -#undef SYSTEM_TYPE -#endif - -#if defined (USE_SYSTEM_MALLOC) && !defined (SYSTEM_MALLOC) -#define SYSTEM_MALLOC -#endif - -/* Define the return type of signal handlers if the s/xxx.h file - did not already do so. */ -#define RETSIGTYPE void +#undef HAVE_MKSTEMP -#ifndef XCDECL -#define XCDECL -#endif +#undef PREFIX_USER_DEFINED +#undef EXEC_PREFIX_USER_DEFINED +#undef MODULEDIR_USER_DEFINED +#undef SITEMODULEDIR_USER_DEFINED +#undef DOCDIR_USER_DEFINED +#undef LISPDIR_USER_DEFINED +#undef PACKAGE_PATH_USER_DEFINED +#undef SITELISPDIR_USER_DEFINED +#undef ARCHLIBDIR_USER_DEFINED +#undef ETCDIR_USER_DEFINED +#undef INFODIR_USER_DEFINED +#undef INFOPATH_USER_DEFINED -/* SIGTYPE is the macro we actually use. */ -#ifndef SIGTYPE -#define SIGTYPE RETSIGTYPE XCDECL -#define SIGRETURN return -#endif - -#ifndef WIN32_NO_CONFIGURE /* Defined in xemacs.mak or s/windowsnt.h: */ - -/* Use the relocating allocator for buffer space? */ -#undef REL_ALLOC +#undef PDUMP /* Define DYNODUMP if it is necessary to properly dump on this system. Currently this is only Solaris 2.x, for x < 6. */ @@ -838,10 +789,131 @@ #endif /* WIN32_NO_CONFIGURE */ +/* alloca twiddling. + Because we might be #including alloca.h here, feature test macros + such as _XOPEN_SOURCE must be defined above. + + #### This really should go below the inclusion of s&m files, like + everything else. */ + +#ifndef NOT_C_CODE +#if defined (__CYGWIN__) +/* We get complaints about redefinitions if we just use the __GNUC__ + definition: stdlib.h also includes alloca.h, which defines it slightly + differently */ +#include <alloca.h> +#elif defined (__GNUC__) +#define alloca __builtin_alloca +#elif defined (WIN32_NO_CONFIGURE) +/* Defines size_t and alloca (). */ +#include <malloc.h> +#elif defined (__DECC) +#include <alloca.h> +#pragma intrinsic(alloca) +#elif defined (HAVE_ALLOCA_H) +#include <alloca.h> +#elif defined (_AIX) +/* AIX requires this before any "real" code in the translation unit. */ +#pragma alloca +#elif ! defined (alloca) +#ifdef C_ALLOCA +#define alloca xemacs_c_alloca +#else +void *alloca (); +#endif /* C_ALLOCA */ +#endif /* !defined (alloca) */ +#endif /* C code */ + +/* The configuration script may define `opsysfile' to be the name of + the s/...h file that describes your operating system. + The file name is chosen based on the configuration name. */ + +#if defined (__cplusplus) && !defined (NOT_C_CODE) +extern "C" { +#endif + +#undef config_opsysfile +#ifdef WIN32_NO_CONFIGURE +#include "s/windowsnt.h" +#elif defined (config_opsysfile) +#include config_opsysfile +#endif + +/* The configuration script may define `machfile' to be the name of + the m/...h file that describes the machine you are using. + The file name is chosen based on the configuration name. */ + +#undef config_machfile +#ifdef WIN32_NO_CONFIGURE +#include "m/windowsnt.h" +#elif defined (config_machfile) +#include config_machfile +#endif + +#if defined (__cplusplus) && !defined (NOT_C_CODE) +} +#endif + +/* This will be removed in 19.15. */ +/* Hah! Try 20.3 ... */ +/* Hah! Try never ... */ +/* If at first you don't succeed, try, try again. */ +/* #define LOSING_BYTECODE */ + +/* USER_FULL_NAME returns a string that is the user's full name. + It can assume that the variable `pw' points to the password file + entry for this user. + + At some sites, the pw_gecos field contains the user's full name. + If neither this nor any other field contains the right thing, use + pw_name, giving the user's login name, since that is better than + nothing. */ +#define USER_FULL_NAME pw->pw_gecos + +#define XEMACS_WANTS_C_ALLOCA + +/* s&m files shouldn't be required to define anything, or even to exist. + If the s&m files don't define SYSTEM_TYPE, configure will select an + appropriate default value. */ +#ifndef SYSTEM_TYPE +#undef SYSTEM_TYPE +#endif + +#if defined (USE_SYSTEM_MALLOC) && !defined (SYSTEM_MALLOC) +#define SYSTEM_MALLOC +#endif + +/* Define the return type of signal handlers if the s/xxx.h file + did not already do so. */ +#define RETSIGTYPE void + +#ifndef XCDECL +#define XCDECL +#endif + +/* SIGTYPE is the macro we actually use. */ +#ifndef SIGTYPE +#define SIGTYPE RETSIGTYPE XCDECL +#define SIGRETURN return +#endif + +/* Define HAVE_WINDOW_SYSTEM if any windowing system is available. */ +#if defined (HAVE_GTK) || defined (HAVE_X_WINDOWS) || defined (HAVE_MS_WINDOWS) /* || defined (HAVE_NEXTSTEP) */ +#define HAVE_WINDOW_SYSTEM +#endif + #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS) || defined (HAVE_WIDGETS) #define HAVE_GUI_OBJECTS #endif +#if defined (HAVE_MENUBARS) || defined (HAVE_DIALOGS) +#define HAVE_POPUPS +#endif + +#if defined (HAVE_GTK) || defined (HAVE_X_WINDOWS) +#define HAVE_XLIKE +#endif + /* For the moment, Athena widgets and dialogs may be very unstable and not working well, but things under Windows work much better. configure by default tries to turn Windows widgets and dialogs on, but the Athena @@ -854,8 +926,23 @@ #define HAVE_X_DIALOGS #endif -#if defined (HAVE_MENUBARS) || defined (HAVE_DIALOGS) -#define HAVE_POPUPS +#ifdef HAVE_X_WINDOWS +/* The following should always be defined, no matter what xmkmf thinks. */ +#ifndef NeedFunctionPrototypes +#define NeedFunctionPrototypes 1 +#endif +#ifndef FUNCPROTO +#define FUNCPROTO 15 +#endif +#endif /* HAVE_X_WINDOWS */ + +#if (defined (QUANTIFY) || defined (PURIFY)) && !defined (XLIB_ILLEGAL_ACCESS) +#define XLIB_ILLEGAL_ACCESS 1 +#endif + +/* Define HAVE_UNIXOID_EVENT_LOOP if we use select() to wait for events. */ +#if defined (HAVE_X_WINDOWS) || defined (HAVE_TTY) || defined (HAVE_MSG_SELECT) +#define HAVE_UNIXOID_EVENT_LOOP #endif /* If you are using SunOS 4.1.1 and X11r5, then you need this patch. @@ -891,25 +978,6 @@ #define listen Rlisten #endif /* HAVE_SOCKS && !DO_NOT_SOCKSIFY */ -#ifndef WIN32_NO_CONFIGURE /* Defined in xemacs.mak or s/windowsnt.h: */ - -#undef SIZEOF_SHORT -#undef SIZEOF_INT -#undef SIZEOF_LONG -#undef SIZEOF_LONG_LONG -#undef SIZEOF_VOID_P -#undef SIZEOF_DOUBLE - -/* some systems (Cygwin) typedef u?intptr_t in <sys/types.h> - but the standard is <inttypes.h> - ugliness due to last-resort conditional typedef'ing in lisp.h */ -#undef HAVE_INTPTR_T_IN_SYS_TYPES_H - -/* Does the keyword `inline' exist? */ -#undef inline - -#endif /* WIN32_NO_CONFIGURE */ - #ifndef BITS_PER_CHAR #define BITS_PER_CHAR 8 #endif @@ -920,13 +988,6 @@ #define VOID_P_BITS (SIZEOF_VOID_P * BITS_PER_CHAR) #define DOUBLE_BITS (SIZEOF_DOUBLE * BITS_PER_CHAR) -/* Enhanced numeric support */ -#undef WITH_NUMBER_TYPES -#undef WITH_GMP -#undef WITH_MP -#undef MP_PREFIX -#undef HAVE_MP_MOVE - /* Use `INLINE_HEADER' to define inline functions in .h files. Use `inline static' to define inline functions in .c files. See the Internals manual for examples and more information. */ @@ -988,41 +1049,6 @@ # define JMP_BUF jmp_buf #endif -#ifndef WIN32_NO_CONFIGURE /* Defined in xemacs.mak or s/windowsnt.h: */ - -/* movemail options */ -/* Should movemail use POP3 for mail access? */ -#undef MAIL_USE_POP -/* Should movemail use kerberos for POP authentication? */ -#undef KERBEROS -/* Should movemail use hesiod for getting POP server host? */ -#undef HESIOD -/* Determine type of mail locking. */ -#undef MAIL_LOCK_LOCKF -#undef MAIL_LOCK_FLOCK -#undef MAIL_LOCK_DOT -#undef MAIL_LOCK_LOCKING -#undef MAIL_LOCK_MMDF - -#undef HAVE_MKSTEMP - -#undef PREFIX_USER_DEFINED -#undef EXEC_PREFIX_USER_DEFINED -#undef MODULEDIR_USER_DEFINED -#undef SITEMODULEDIR_USER_DEFINED -#undef DOCDIR_USER_DEFINED -#undef LISPDIR_USER_DEFINED -#undef PACKAGE_PATH_USER_DEFINED -#undef SITELISPDIR_USER_DEFINED -#undef ARCHLIBDIR_USER_DEFINED -#undef ETCDIR_USER_DEFINED -#undef INFODIR_USER_DEFINED -#undef INFOPATH_USER_DEFINED - -#undef PDUMP - -#endif /* WIN32_NO_CONFIGURE */ - /* For the moment, we go ahead and keep this, since it's used in mouse.el. #### font-lock does its own version using parse-partial-sexp. We should merge the two. */
--- a/src/console-impl.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/console-impl.h Thu Nov 04 23:08:28 2004 +0000 @@ -382,7 +382,7 @@ add_entry_to_console_type_list (Q##type, type##_console_methods); \ type##_console_methods->image_conversion_list = Qnil; \ staticpro_nodump (&type##_console_methods->image_conversion_list); \ - dump_add_root_struct_ptr (&type##_console_methods, &console_methods_description); \ + dump_add_root_block_ptr (&type##_console_methods, &console_methods_description); \ } while (0) #define REINITIALIZE_CONSOLE_TYPE(type) do { \
--- a/src/console-msw.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/console-msw.c Thu Nov 04 23:08:28 2004 +0000 @@ -29,6 +29,8 @@ Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0 */ +/* See win32.c for info about the different Windows files in XEmacs. */ + #include <config.h> #include "lisp.h" @@ -92,8 +94,7 @@ GetConsoleHwnd (void) { HWND hwndFound; - Ibyte newtitleint[200]; - Extbyte *newtitle; + Ascbyte newtitle[100]; Extbyte *oldtitle; int numchars; @@ -112,14 +113,12 @@ /* format a "unique" new title */ - qxesprintf (newtitleint, "%ld/%ld", GetTickCount (), - GetCurrentProcessId ()); + sprintf (newtitle, "%ld/%ld", GetTickCount (), GetCurrentProcessId ()); - C_STRING_TO_TSTR (newtitleint, newtitle); + /* change current window title; we may be called during armageddon + so don't do any conversion */ - /* change current window title */ - - qxeSetConsoleTitle (newtitle); + SetConsoleTitleA (newtitle); /* ensure window title has been updated */ @@ -127,7 +126,7 @@ /* look for NewWindowTitle */ - hwndFound = qxeFindWindow (NULL, newtitle); + hwndFound = FindWindowA (NULL, newtitle); /* restore original window title */ @@ -242,7 +241,7 @@ mswindows_ensure_console_buffered (); mswindows_show_console (); - if (initialized && !inhibit_non_essential_printing_operations) + if (initialized && !inhibit_non_essential_conversion_operations) { const Extbyte *extptr; Bytecount extlen; @@ -253,7 +252,10 @@ extlen / XETCHAR_SIZE, &num_written, NULL); } else - return WriteConsoleA (mswindows_console_buffer, (char *) ptr, len, +#ifdef NON_ASCII_INTERNAL_FORMAT +#error Do something here +#endif + return WriteConsoleA (mswindows_console_buffer, (Chbyte *) ptr, len, &num_written, NULL); } @@ -285,7 +287,7 @@ write_string_to_mswindows_debugging_output (const Ibyte *str, Bytecount len) { const Extbyte *extptr; - if (initialized && !inhibit_non_essential_printing_operations) + if (initialized && !inhibit_non_essential_conversion_operations) { TO_EXTERNAL_FORMAT (DATA, (str, len), C_STRING_ALLOCA, extptr, @@ -294,6 +296,9 @@ } else { +#ifdef NON_ASCII_INTERNAL_FORMAT +#error Do something here +#endif /* STR may not be null-terminated so make it that way. */ Extbyte *ext = alloca_extbytes (len + 1); memcpy (ext, str, len); @@ -505,7 +510,6 @@ no effect. */ (message_, flags, title)) { - Lisp_Object tail; Extbyte *msgout; Extbyte *titleout = 0; UINT sty = 0; @@ -525,44 +529,45 @@ LISP_STRING_TO_TSTR (title, titleout); } - EXTERNAL_LIST_LOOP (tail, flags) - { - Lisp_Object st = XCAR (tail); - CHECK_SYMBOL (st); - if (0) - ; + { + EXTERNAL_LIST_LOOP_2 (st, flags) + { + CHECK_SYMBOL (st); + if (0) + ; #define FROB(sym, val) else if (EQ (st, sym)) sty |= val - FROB (Qabortretryignore, MB_ABORTRETRYIGNORE); - FROB (Qapplmodal, MB_APPLMODAL); - FROB (Qdefault_desktop_only, MB_DEFAULT_DESKTOP_ONLY); - FROB (Qdefbutton1, MB_DEFBUTTON1); - FROB (Qdefbutton2, MB_DEFBUTTON2); - FROB (Qdefbutton3, MB_DEFBUTTON3); - FROB (Qdefbutton4, MB_DEFBUTTON4); - FROB (Qhelp, MB_HELP); - FROB (Qiconasterisk, MB_ICONASTERISK); - FROB (Qiconexclamation, MB_ICONEXCLAMATION); - FROB (Qiconhand, MB_ICONHAND); - FROB (Qiconinformation, MB_ICONINFORMATION); - FROB (Qiconquestion, MB_ICONQUESTION); - FROB (Qiconstop, MB_ICONSTOP); - FROB (Qok, MB_OK); - FROB (Qokcancel, MB_OKCANCEL); - FROB (Qretrycancel, MB_RETRYCANCEL); - FROB (Qright, MB_RIGHT); - FROB (Qrtlreading, MB_RTLREADING); - FROB (Qservice_notification, MB_SERVICE_NOTIFICATION); - FROB (Qsetforeground, MB_SETFOREGROUND); - FROB (Qsystemmodal, MB_SYSTEMMODAL); - FROB (Qtaskmodal, MB_TASKMODAL); - FROB (Qtopmost, MB_TOPMOST); - FROB (Qyesno, MB_YESNO); - FROB (Qyesnocancel, MB_YESNOCANCEL); + FROB (Qabortretryignore, MB_ABORTRETRYIGNORE); + FROB (Qapplmodal, MB_APPLMODAL); + FROB (Qdefault_desktop_only, MB_DEFAULT_DESKTOP_ONLY); + FROB (Qdefbutton1, MB_DEFBUTTON1); + FROB (Qdefbutton2, MB_DEFBUTTON2); + FROB (Qdefbutton3, MB_DEFBUTTON3); + FROB (Qdefbutton4, MB_DEFBUTTON4); + FROB (Qhelp, MB_HELP); + FROB (Qiconasterisk, MB_ICONASTERISK); + FROB (Qiconexclamation, MB_ICONEXCLAMATION); + FROB (Qiconhand, MB_ICONHAND); + FROB (Qiconinformation, MB_ICONINFORMATION); + FROB (Qiconquestion, MB_ICONQUESTION); + FROB (Qiconstop, MB_ICONSTOP); + FROB (Qok, MB_OK); + FROB (Qokcancel, MB_OKCANCEL); + FROB (Qretrycancel, MB_RETRYCANCEL); + FROB (Qright, MB_RIGHT); + FROB (Qrtlreading, MB_RTLREADING); + FROB (Qservice_notification, MB_SERVICE_NOTIFICATION); + FROB (Qsetforeground, MB_SETFOREGROUND); + FROB (Qsystemmodal, MB_SYSTEMMODAL); + FROB (Qtaskmodal, MB_TASKMODAL); + FROB (Qtopmost, MB_TOPMOST); + FROB (Qyesno, MB_YESNO); + FROB (Qyesnocancel, MB_YESNOCANCEL); #undef FROB - else - invalid_constant ("Unrecognized flag", st); - } + else + invalid_constant ("Unrecognized flag", st); + } + } { int retval = qxeMessageBox (NULL, msgout, titleout, sty);
--- a/src/console-msw.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/console-msw.h Thu Nov 04 23:08:28 2004 +0000 @@ -35,6 +35,8 @@ #ifndef INCLUDED_console_msw_h_ #define INCLUDED_console_msw_h_ +/* See win32.c for info about the different Windows files in XEmacs. */ + #include "console.h" #include "syswindows.h" @@ -82,6 +84,9 @@ int height; } XEMACS_RECT_WH; +ANSI_ALIASING_TYPEDEF (POINTS, POINTS); +#define XE_MAKEPOINTS(l) ANSI_ALIASING_CAST (POINTS, l) + /* * Random globals */
--- a/src/console-x-impl.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/console-x-impl.h Thu Nov 04 23:08:28 2004 +0000 @@ -260,7 +260,7 @@ /* This flag tells us if the menubar contents are up-to-date with respect to the current menubar structure. If we want to actually pull down a menu and this is false, then we need to update things. */ - char menubar_contents_up_to_date; + Boolbyte menubar_contents_up_to_date; /* The icon pixmaps; these are Lisp_Image_Instance objects, or Qnil. */ Lisp_Object icon_pixmap; @@ -279,7 +279,7 @@ #endif /* HAVE_TOOLBARS */ /* geometry string that ought to be freed. */ - char *geom_free_me_please; + Ascbyte *geom_free_me_please; #ifdef HAVE_XIM XPoint xic_spot; /* Spot Location cache */
--- a/src/console.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/console.c Thu Nov 04 23:08:28 2004 +0000 @@ -115,9 +115,9 @@ static const struct memory_description console_data_description_1 []= { #ifdef HAVE_TTY - { XD_STRUCT_PTR, tty_console, 1, &tty_console_data_description}, + { XD_BLOCK_PTR, tty_console, 1, &tty_console_data_description}, #endif - { XD_STRUCT_PTR, stream_console, 1, &stream_console_data_description}, + { XD_BLOCK_PTR, stream_console, 1, &stream_console_data_description}, { XD_END } }; @@ -129,7 +129,7 @@ { XD_INT, offsetof (struct console, contype) }, #define MARKED_SLOT(x) { XD_LISP_OBJECT, offsetof (struct console, x) }, #include "conslots.h" - { XD_STRUCT_PTR, offsetof (struct console, conmeths), 1, + { XD_BLOCK_PTR, offsetof (struct console, conmeths), 1, &console_methods_description }, { XD_UNION, offsetof (struct console, console_data), XD_INDIRECT (0, 0), &console_data_description }, @@ -1227,7 +1227,7 @@ static const struct memory_description cte_description_1[] = { { XD_LISP_OBJECT, offsetof (console_type_entry, symbol) }, - { XD_STRUCT_PTR, offsetof (console_type_entry, meths), 1, &console_methods_description }, + { XD_BLOCK_PTR, offsetof (console_type_entry, meths), 1, &console_methods_description }, { XD_END } }; @@ -1263,7 +1263,7 @@ console_type_create (void) { the_console_type_entry_dynarr = Dynarr_new (console_type_entry); - dump_add_root_struct_ptr (&the_console_type_entry_dynarr, &cted_description); + dump_add_root_block_ptr (&the_console_type_entry_dynarr, &cted_description); Vconsole_type_list = Qnil; staticpro (&Vconsole_type_list); @@ -1289,8 +1289,6 @@ void vars_of_console (void) { - reinit_vars_of_console (); - DEFVAR_LISP ("create-console-hook", &Vcreate_console_hook /* Function or functions to call when a console is created. One argument, the newly-created console. @@ -1474,8 +1472,8 @@ syms = XCONSOLE (Vconsole_local_symbols); console_defaults_saved_slots = &defs->CONSOLE_SLOTS_FIRST_NAME; console_local_symbols_saved_slots = &syms->CONSOLE_SLOTS_FIRST_NAME; - dump_add_root_struct_ptr (&console_defaults_saved_slots, &console_slots_description); - dump_add_root_struct_ptr (&console_local_symbols_saved_slots, &console_slots_description); + dump_add_root_block_ptr (&console_defaults_saved_slots, &console_slots_description); + dump_add_root_block_ptr (&console_local_symbols_saved_slots, &console_slots_description); DEFVAR_CONSOLE_DEFAULTS ("default-function-key-map", function_key_map /* Default value of `function-key-map' for consoles that don't override it.
--- a/src/debug.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/debug.c Thu Nov 04 23:08:28 2004 +0000 @@ -207,5 +207,4 @@ void vars_of_debug (void) { - reinit_vars_of_debug (); }
--- a/src/depend Thu Nov 04 22:51:31 2004 +0000 +++ b/src/depend Thu Nov 04 23:08:28 2004 +0000 @@ -203,9 +203,9 @@ offix.o: offix-cursors.h offix-types.h offix.h xintrinsic.h opaque.o: $(LISP_H) opaque.h print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h extents.h frame.h insdel.h intl-auto-encap-win32.h lstream.h opaque.h redisplay.h sysfile.h systty.h syswindows.h -process-nt.o: $(LISP_H) console-msw.h console.h hash.h intl-auto-encap-win32.h lstream.h process-slots.h process.h procimpl.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h +process-nt.o: $(LISP_H) console-msw.h console.h events.h hash.h intl-auto-encap-win32.h lstream.h process-slots.h process.h procimpl.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h process-unix.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h console.h events.h file-coding.h frame.h hash.h lstream.h ndir.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h window.h -process.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h console.h device.h events.h file-coding.h frame.h hash.h insdel.h lstream.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h window.h +process.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h console.h device.h events.h file-coding.h frame.h hash.h insdel.h intl-auto-encap-win32.h lstream.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h window.h profile.o: $(LISP_H) backtrace.h bytecode.h elhash.h hash.h profile.h syssignal.h systime.h ralloc.o: $(LISP_H) getpagesize.h rangetab.o: $(LISP_H) rangetab.h
--- a/src/device-msw.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/device-msw.c Thu Nov 04 23:08:28 2004 +0000 @@ -501,7 +501,7 @@ DEVICE_MSPRINTER_DEVMODE (d) = Qnil; DEVICE_MSPRINTER_NAME (d) = Qnil; -#if 0 /* @@#### deleted in new ikeyama ws */ +#if 0 /* #### deleted in new ikeyama ws */ /* We do not use printer font list as we do with the display device. Rather, we allow GDI to pick the closest match to the display font. */ @@ -1298,7 +1298,7 @@ if (GetLastError () != ERROR_INSUFFICIENT_BUFFER) signal_enum_printer_error (); - data_buf = (BYTE *) ALLOCA (bytes_needed); + data_buf = alloca_array (BYTE, bytes_needed); ok = qxeEnumPrinters (enum_flags, NULL, enum_level, data_buf, bytes_needed, &bytes_needed, &num_printers); if (!ok)
--- a/src/device-x.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/device-x.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,7 +1,7 @@ /* Device functions for X windows. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. Copyright (C) 1994, 1995 Free Software Foundation, Inc. - Copyright (C) 2001, 2002 Ben Wing. + Copyright (C) 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -494,6 +494,7 @@ static void x_init_device (struct device *d, Lisp_Object UNUSED (props)) { + /* !!#### */ Lisp_Object display; Display *dpy; Widget app_shell; @@ -651,8 +652,7 @@ { LISP_STRING_TO_EXTERNAL (Vx_app_defaults_directory, data_dir, Qfile_name); - path = (Extbyte *) ALLOCA (strlen (data_dir) + strlen (locale) + - 7); + path = alloca_extbytes (strlen (data_dir) + strlen (locale) + 7); sprintf (path, "%s%s/Emacs", data_dir, locale); if (!access (path, R_OK)) XrmCombineFileDatabase (path, &db, False); @@ -660,8 +660,7 @@ else if (STRINGP (Vdata_directory) && XSTRING_LENGTH (Vdata_directory) > 0) { LISP_STRING_TO_EXTERNAL (Vdata_directory, data_dir, Qfile_name); - path = (Extbyte *) ALLOCA (strlen (data_dir) + 13 + strlen (locale) + - 7); + path = alloca_extbytes (strlen (data_dir) + 13 + strlen (locale) + 7); sprintf (path, "%sapp-defaults/%s/Emacs", data_dir, locale); if (!access (path, R_OK)) XrmCombineFileDatabase (path, &db, False); @@ -1721,9 +1720,9 @@ (device)) { Display *dpy = get_x_display (device); - char *vendor = ServerVendor (dpy); + Extbyte *vendor = ServerVendor (dpy); - return build_string (vendor ? vendor : ""); + return build_ext_string (vendor ? vendor : "", Qx_hpc_encoding); } DEFUN ("x-server-version", Fx_server_version, 0, 1, 0, /* @@ -1748,7 +1747,7 @@ */ (keysym)) { - const char *keysym_ext; + const Extbyte *keysym_ext; CHECK_STRING (keysym); LISP_STRING_TO_EXTERNAL (keysym, keysym_ext, Qctext); @@ -1952,7 +1951,8 @@ { Display *dpy = get_x_display (device); int ndirs_return; - const char **directories = (const char **) XGetFontPath (dpy, &ndirs_return); + const Extbyte **directories = + (const Extbyte **) XGetFontPath (dpy, &ndirs_return); Lisp_Object font_path = Qnil; if (!directories) @@ -1983,25 +1983,29 @@ (font_path, device)) { Display *dpy = get_x_display (device); - Lisp_Object path_entry; - const char **directories; + Extbyte **directories; int i=0,ndirs=0; - EXTERNAL_LIST_LOOP (path_entry, font_path) - { - CHECK_STRING (XCAR (path_entry)); - ndirs++; - } + { + EXTERNAL_LIST_LOOP_2 (path_entry, font_path) + { + CHECK_STRING (path_entry); + ndirs++; + } + } - directories = alloca_array (const char *, ndirs); + directories = alloca_array (Extbyte *, ndirs); - EXTERNAL_LIST_LOOP (path_entry, font_path) - { - LISP_STRING_TO_EXTERNAL (XCAR (path_entry), directories[i++], Qfile_name); - } + { + EXTERNAL_LIST_LOOP_2 (path_entry, font_path) + { + LISP_STRING_TO_EXTERNAL (path_entry, directories[i++], + Qfile_name); + } + } expect_x_error (dpy); - XSetFontPath (dpy, (char **) directories, ndirs); + XSetFontPath (dpy, directories, ndirs); signal_if_x_error (dpy, 1/*resumable_p*/); return Qnil; @@ -2051,7 +2055,7 @@ reinit_console_type_create_device_x (void) { /* Initialize variables to speed up X resource interactions */ - const Char_ASCII *valid_resource_chars = + const Ascbyte *valid_resource_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; while (*valid_resource_chars) valid_resource_char_p[(unsigned int) (*valid_resource_chars++)] = 1; @@ -2083,8 +2087,6 @@ void vars_of_device_x (void) { - reinit_vars_of_device_x (); - DEFVAR_LISP ("x-emacs-application-class", &Vx_emacs_application_class /* The X application class of the XEmacs process. This controls, among other things, the name of the `app-defaults' file
--- a/src/device.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/device.c Thu Nov 04 23:08:28 2004 +0000 @@ -93,14 +93,14 @@ static const struct memory_description device_data_description_1 []= { #ifdef HAVE_GTK - { XD_STRUCT_PTR, gtk_console, 1, >k_device_data_description}, + { XD_BLOCK_PTR, gtk_console, 1, >k_device_data_description}, #endif #ifdef HAVE_MS_WINDOWS - { XD_STRUCT_PTR, mswindows_console, 1, &mswindows_device_data_description}, - { XD_STRUCT_PTR, msprinter_console, 1, &msprinter_device_data_description}, + { XD_BLOCK_PTR, mswindows_console, 1, &mswindows_device_data_description}, + { XD_BLOCK_PTR, msprinter_console, 1, &msprinter_device_data_description}, #endif #ifdef HAVE_X_WINDOWS - { XD_STRUCT_PTR, x_console, 1, &x_device_data_description}, + { XD_BLOCK_PTR, x_console, 1, &x_device_data_description}, #endif { XD_END } }; @@ -114,7 +114,7 @@ #define MARKED_SLOT(x) { XD_LISP_OBJECT, offsetof (struct device, x) }, #include "devslots.h" - { XD_STRUCT_PTR, offsetof (struct device, devmeths), 1, + { XD_BLOCK_PTR, offsetof (struct device, devmeths), 1, &console_methods_description }, { XD_UNION, offsetof (struct device, device_data), XD_INDIRECT (0, 0), &device_data_description }, @@ -1477,8 +1477,6 @@ void vars_of_device (void) { - reinit_vars_of_device (); - DEFVAR_LISP ("create-device-hook", &Vcreate_device_hook /* Function or functions to call when a device is created. One argument, the newly-created device.
--- a/src/dialog-msw.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/dialog-msw.c Thu Nov 04 23:08:28 2004 +0000 @@ -297,7 +297,7 @@ static struct { DWORD errmess; - Char_ASCII *errname; + Ascbyte *errname; } common_dialog_errors[] = { { CDERR_DIALOGFAILURE, "CDERR_DIALOGFAILURE" }, @@ -565,17 +565,14 @@ } else if (EQ (key, Q_buttons)) { - Lisp_Object item_cons; - /* Parse each item in the dialog into gui_item structs, and stuff a dynarr of these. Calculate button row width in this loop too */ - EXTERNAL_LIST_LOOP (item_cons, value) + EXTERNAL_LIST_LOOP_2 (item, value) { - if (!NILP (XCAR (item_cons))) + if (!NILP (item)) { - Lisp_Object gitem = - gui_parse_item_keywords (XCAR (item_cons)); + Lisp_Object gitem = gui_parse_item_keywords (item); Dynarr_add (dialog_items, gitem); button_row_width += button_width (XGUI_ITEM (gitem)->name) + X_BUTTON_MARGIN;
--- a/src/dired-msw.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/dired-msw.c Thu Nov 04 23:08:28 2004 +0000 @@ -285,8 +285,7 @@ eigetch_char (filename, 2) == '\0'))) || hide_dot))) { - file.cFileName = - (Ibyte *) xmalloc (sizeof (Ibyte) * (1 + len)); + file.cFileName = xnew_ibytes (len + ITEXT_ZTERM_SIZE); memcpy (file.cFileName, eidata (filename), len); file.cFileName[len] = '\0'; Dynarr_add (files, file); @@ -341,11 +340,11 @@ DEC_IBYTEPTR (end); DEC_IBYTEPTR (end); DEC_IBYTEPTR (end); - if (qxestrcasecmp_c (end, ".exe") == 0 - || qxestrcasecmp_c (end, ".com") == 0 - || qxestrcasecmp_c (end, ".bat") == 0 + if (qxestrcasecmp_ascii (end, ".exe") == 0 + || qxestrcasecmp_ascii (end, ".com") == 0 + || qxestrcasecmp_ascii (end, ".bat") == 0 #if 0 - || qxestrcasecmp_c (end, ".pif") == 0 + || qxestrcasecmp_ascii (end, ".pif") == 0 #endif ) is_executable = 1;
--- a/src/dired.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/dired.c Thu Nov 04 23:08:28 2004 +0000 @@ -104,7 +104,7 @@ directory = Ffile_name_as_directory (directory); directorylen = XSTRING_LENGTH (directory); - statbuf = (Ibyte *) ALLOCA (directorylen + MAXNAMLEN + 1); + statbuf = alloca_ibytes (directorylen + MAXNAMLEN + 1); memcpy (statbuf, XSTRING_DATA (directory), directorylen); statbuf_tail = statbuf + directorylen; @@ -251,7 +251,7 @@ Bytecount len = NAMLEN (dp); Bytecount pos = XSTRING_LENGTH (directory); int value; - Ibyte *fullname = (Ibyte *) ALLOCA (len + pos + 2); + Ibyte *fullname = alloca_ibytes (len + pos + 2); memcpy (fullname, XSTRING_DATA (directory), pos); if (!IS_DIRECTORY_SEP (fullname[pos - 1])) @@ -391,11 +391,9 @@ /* if name is not an exact match against specified string. */ if (!passcount && cclen > file_name_length) { - Lisp_Object tem; /* and exit this for loop if a match is found */ - EXTERNAL_LIST_LOOP (tem, Vcompletion_ignored_extensions) + EXTERNAL_LIST_LOOP_2 (elt, Vcompletion_ignored_extensions) { - Lisp_Object elt = XCAR (tem); Charcount skip; CHECK_STRING (elt);
--- a/src/doc.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/doc.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,7 +1,7 @@ /* Record indices of function doc strings stored in a file. Copyright (C) 1985, 1986, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. - Copyright (C) 2001, 2002 Ben Wing. + Copyright (C) 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -100,11 +100,11 @@ Ibyte *old_buffer = buffer; if (buffer == buf) { - buffer = (Ibyte *) xmalloc (buffer_size *= 2); + buffer = xnew_ibytes (buffer_size *= 2); memcpy (buffer, old_buffer, p - old_buffer); } else - buffer = (Ibyte *) xrealloc (buffer, buffer_size *= 2); + XREALLOC_ARRAY (buffer, Ibyte, buffer_size *= 2); p += buffer - old_buffer; space_left = buffer_size - (p - buffer); } @@ -248,10 +248,10 @@ if (purify_flag) { /* sizeof ("../lib-src/") == 12 */ - name_nonreloc = (Ibyte *) ALLOCA (12 + XSTRING_LENGTH (file) + 8); + name_nonreloc = alloca_ibytes (12 + XSTRING_LENGTH (file) + 8); /* Preparing to dump; DOC file is probably not installed. So check in ../lib-src. */ - qxestrcpy (name_nonreloc, (Ibyte *) "../lib-src/"); + qxestrcpy_ascii (name_nonreloc, "../lib-src/"); qxestrcat (name_nonreloc, XSTRING_DATA (file)); fd = qxe_open (name_nonreloc, O_RDONLY | OPEN_BINARY, 0); @@ -461,7 +461,7 @@ { name = alloca_ibytes (XSTRING_LENGTH (filename) + 14); - qxestrcpy (name, (Ibyte *) "../lib-src/"); + qxestrcpy_ascii (name, "../lib-src/"); } qxestrcat (name, XSTRING_DATA (filename)); @@ -679,7 +679,7 @@ # define kludge_prefix "ad-Orig-" Lisp_Object name = XSYMBOL (sym)->name; return (XSTRING_LENGTH (name) > (Bytecount) (sizeof (kludge_prefix)) && - !qxestrncmp_c (XSTRING_DATA (name), kludge_prefix, + !qxestrncmp_ascii (XSTRING_DATA (name), kludge_prefix, sizeof (kludge_prefix) - 1)); # undef kludge_prefix } @@ -831,8 +831,8 @@ #endif strlength = XSTRING_LENGTH (string); - bsize = 1 + strlength; - buf = (Ibyte *) xmalloc (bsize); + bsize = ITEXT_ZTERM_SIZE + strlength; + buf = xnew_ibytes (bsize); bufp = buf; /* Have to reset strdata every time GC might be called */
--- a/src/doprnt.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/doprnt.c Thu Nov 04 23:08:28 2004 +0000 @@ -948,7 +948,7 @@ format_reloc, nargs, largs); Lstream_flush (XLSTREAM (stream)); len = Lstream_byte_count (XLSTREAM (stream)); - retval = (Ibyte *) xmalloc (len + 1); + retval = xnew_ibytes (len + 1); memcpy (retval, resizing_buffer_stream_ptr (XLSTREAM (stream)), len); retval[len] = '\0'; Lstream_delete (XLSTREAM (stream)); @@ -1032,7 +1032,7 @@ vargs); Lstream_flush (XLSTREAM (stream)); len = Lstream_byte_count (XLSTREAM (stream)); - retval = (Ibyte *) xmalloc (len + 1); + retval = xnew_ibytes (len + 1); memcpy (retval, resizing_buffer_stream_ptr (XLSTREAM (stream)), len); retval[len] = '\0'; end_gc_forbidden (count);
--- a/src/dragdrop.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/dragdrop.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,6 +1,7 @@ /* Drag'n'Drop definitions created 03-may-98 by Oliver Graf <ograf@fga.de> Copyright (C) 1998 Oliver Graf <ograf@fga.de> + Copyright (C) 2004 Ben Wing. This file is part of XEmacs. @@ -74,12 +75,12 @@ /* Encodes the unsafe characters (listed in URL_UNSAFE) in a given string, returning a malloc-ed %XX encoded string. if method is != NULL it is prepended to the string. */ -char * -dnd_url_hexify_string (const char *s, const char *m) +Ibyte * +dnd_url_hexify_string (const Ibyte *s, const Ibyte *m) { - const char *b; - char *p, *res; - int i; + const Ibyte *b; + Ibyte *p, *res; + Bytecount i; b = s; for (i = 0; *s; s++, i++) @@ -87,19 +88,19 @@ i += 2; /* Two more characters (hex digits) */ if (m) { - res = (char *)xmalloc (i + 1 + strlen (m)); - strcpy (res, m); - p = res + strlen (m); + res = xnew_ibytes (i + ITEXT_ZTERM_SIZE + qxestrlen (m)); + qxestrcpy (res, m); + p = res + qxestrlen (m); } else { - res = (char *)xmalloc (i + 1); + res = xnew_ibytes (i + ITEXT_ZTERM_SIZE); p = res; } for (s = b; *s; s++) if (strchr (URL_UNSAFE, *s)) { - const unsigned char c = *s; + const Ibyte c = *s; *p++ = '%'; *p++ = HEXD2ASC (c >> 4); *p++ = HEXD2ASC (c & 0xf); @@ -131,15 +132,15 @@ Vdragdrop_protocols = Qnil; #ifdef HAVE_MS_WINDOWS - Vdragdrop_protocols = Fcons ( Qmswindows , Vdragdrop_protocols ); + Vdragdrop_protocols = Fcons (Qmswindows, Vdragdrop_protocols); #endif #ifdef HAVE_CDE - Vdragdrop_protocols = Fcons ( intern ("cde") , Vdragdrop_protocols ); + Vdragdrop_protocols = Fcons (intern ("cde"), Vdragdrop_protocols); #endif #ifdef HAVE_OFFIX_DND - Vdragdrop_protocols = Fcons ( intern ("offix") , Vdragdrop_protocols ); + Vdragdrop_protocols = Fcons (intern ("offix"), Vdragdrop_protocols); #endif #ifdef HAVE_GTK - Vdragdrop_protocols = Fcons ( Qgtk , Vdragdrop_protocols ); + Vdragdrop_protocols = Fcons (Qgtk, Vdragdrop_protocols); #endif }
--- a/src/dragdrop.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/dragdrop.h Thu Nov 04 23:08:28 2004 +0000 @@ -32,7 +32,7 @@ extern Lisp_Object Qdragdrop_drop_dispatch; /* some utility functions */ -char *dnd_url_hexify_string (const char *s, const char *m); +Ibyte *dnd_url_hexify_string (const Ibyte *s, const Ibyte *m); /* emacs interface */ void syms_of_dragdrop (void);
--- a/src/dump-data.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/dump-data.c Thu Nov 04 23:08:28 2004 +0000 @@ -33,7 +33,7 @@ /* 4 bytes for the data size, 4096 for alignment */ -static unsigned char dumped_data[MAX_SIZE+4096+4] = { +static Rawbyte dumped_data[MAX_SIZE+4096+4] = { 255, 6, 1, @@ -52,32 +52,33 @@ }; size_t -dumped_data_size(void) +dumped_data_size (void) { - return dumped_data[0] | (dumped_data[1] << 8) | (dumped_data[2] << 16) | (dumped_data[3] << 24); + return dumped_data[0] | (dumped_data[1] << 8) | (dumped_data[2] << 16) | + (dumped_data[3] << 24); } size_t -dumped_data_max_size(void) +dumped_data_max_size (void) { return MAX_SIZE; } size_t -dumped_data_align_offset(void) +dumped_data_align_offset (void) { - EMACS_INT iptr = (EMACS_INT)dumped_data; + EMACS_INT iptr = (EMACS_INT) dumped_data; EMACS_INT iptr2; - iptr2 = (iptr+4+4095) & ~(EMACS_INT)4095; + iptr2 = (iptr + 4 + 4095) & ~(EMACS_INT) 4095; - return iptr2-iptr; + return iptr2 - iptr; } -char * -dumped_data_get(void) +Rawbyte * +dumped_data_get (void) { - EMACS_INT iptr = (EMACS_INT)dumped_data; - iptr = (iptr+4+4095) & ~(EMACS_INT)4095; - return (char *)iptr; + EMACS_INT iptr = (EMACS_INT) dumped_data; + iptr = (iptr + 4 + 4095) & ~(EMACS_INT) 4095; + return (Rawbyte *) iptr; }
--- a/src/dump-data.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/dump-data.h Thu Nov 04 23:08:28 2004 +0000 @@ -24,15 +24,15 @@ #define INCLUDED_dump_data_h_ /* inline dumped data size */ -size_t dumped_data_size(void); +size_t dumped_data_size (void); /* maximum space available for inline data */ -size_t dumped_data_max_size(void); +size_t dumped_data_max_size (void); /* alignment offset for data inclusion */ -size_t dumped_data_align_offset(void); +size_t dumped_data_align_offset (void); /* inline data */ -char *dumped_data_get(void); +Rawbyte *dumped_data_get (void); #endif
--- a/src/dumper.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/dumper.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,7 +1,7 @@ /* Portable data dumper for XEmacs. Copyright (C) 1999-2000 Olivier Galibert Copyright (C) 2001 Martin Buchholz - Copyright (C) 2001, 2002, 2003 Ben Wing. + Copyright (C) 2001, 2002, 2003, 2004 Ben Wing. This file is part of XEmacs. @@ -22,7 +22,17 @@ /* Synched up with: Not in FSF. */ -/* !!#### Not yet Mule-ized */ +/* This file has been Mule-ized, Ben Wing, 10-10-04. */ + +/* #### Put in much more assertions. Whenever we store fixups in the + process or writing out data, make sure the fixups (offsets) point to the + beginning of an object, i.e. are registered. Same whenever we read in + -- verify offsets as registered, and when compute a fixup, verify the + pointer is pointing within the pdump area. registered and check within + pdump area. For specific types of pointers (e.g. to Lisp_Objects), + check if they're pointing to the right kinds of types. It should be + possible to check that a putative Lisp_Object is really a Lisp_Object + since it will follow a strict format in its header. */ #include <config.h> #include "lisp.h" @@ -45,7 +55,7 @@ typedef struct { - const void *varaddress; + const void *blockaddr; Bytecount size; const struct memory_description *desc; } pdump_root_block; @@ -59,12 +69,12 @@ { void **ptraddress; const struct sized_memory_description *desc; -} pdump_root_struct_ptr; +} pdump_root_block_ptr; typedef struct { - Dynarr_declare (pdump_root_struct_ptr); -} pdump_root_struct_ptr_dynarr; + Dynarr_declare (pdump_root_block_ptr); +} pdump_root_block_ptr_dynarr; typedef struct { @@ -74,23 +84,24 @@ typedef struct { - char **address; /* char * for ease of doing relocation */ - char * value; + Rawbyte **address; /* Rawbyte * for ease of doing relocation */ + Rawbyte * value; } pdump_static_pointer; static pdump_root_block_dynarr *pdump_root_blocks; -static pdump_root_struct_ptr_dynarr *pdump_root_struct_ptrs; +static pdump_root_block_ptr_dynarr *pdump_root_block_ptrs; static Lisp_Object_ptr_dynarr *pdump_root_lisp_objects; static Lisp_Object_ptr_dynarr *pdump_weak_object_chains; -/* Mark SIZE bytes at non-heap address VARADDRESS for dumping, described - by DESC. */ +/* Mark SIZE bytes at non-heap address BLOCKADDR for dumping, described + by DESC. Called by outside callers during XEmacs initialization. */ + void -dump_add_root_block (const void *varaddress, Bytecount size, +dump_add_root_block (const void *blockaddr, Bytecount size, const struct memory_description *desc) { pdump_root_block info; - info.varaddress = varaddress; + info.blockaddr = blockaddr; info.size = size; info.desc = desc; if (pdump_root_blocks == NULL) @@ -98,23 +109,25 @@ Dynarr_add (pdump_root_blocks, info); } -/* Mark the struct described by DESC and pointed to by the pointer at - non-heap address VARADDRESS for dumping. - All the objects reachable from this pointer will also be dumped. */ +/* Mark the block described by DESC and pointed to by the pointer at + non-heap address PTRADDRESS for dumping. + All the objects reachable from this pointer will also be dumped. + Called by outside callers during XEmacs initialization. */ void -dump_add_root_struct_ptr (void *ptraddress, - const struct sized_memory_description *desc) +dump_add_root_block_ptr (void *ptraddress, + const struct sized_memory_description *desc) { - pdump_root_struct_ptr info; + pdump_root_block_ptr info; info.ptraddress = (void **) ptraddress; info.desc = desc; - if (pdump_root_struct_ptrs == NULL) - pdump_root_struct_ptrs = Dynarr_new (pdump_root_struct_ptr); - Dynarr_add (pdump_root_struct_ptrs, info); + if (pdump_root_block_ptrs == NULL) + pdump_root_block_ptrs = Dynarr_new (pdump_root_block_ptr); + Dynarr_add (pdump_root_block_ptrs, info); } /* Mark the Lisp_Object at non-heap address VARADDRESS for dumping. - All the objects reachable from this var will also be dumped. */ + All the objects reachable from this var will also be dumped. + Called by outside callers during XEmacs initialization. */ void dump_add_root_lisp_object (Lisp_Object *varaddress) { @@ -123,7 +136,8 @@ Dynarr_add (pdump_root_lisp_objects, varaddress); } -/* Mark the list pointed to by the Lisp_Object at VARADDRESS for dumping. */ +/* Mark the list pointed to by the Lisp_Object at VARADDRESS for dumping. + Called by outside callers during XEmacs initialization. */ void dump_add_weak_object_chain (Lisp_Object *varaddress) { @@ -153,10 +167,10 @@ } while (0) #define PDUMP_READ(ptr, type) \ -(((type *) (ptr = (char*) (((type *) ptr) + 1)))[-1]) +(((type *) (ptr = (Rawbyte *) (((type *) ptr) + 1)))[-1]) #define PDUMP_READ_ALIGNED(ptr, type) \ -((ptr = (char *) ALIGN_PTR (ptr, type)), PDUMP_READ (ptr, type)) +((ptr = (Rawbyte *) ALIGN_PTR (ptr, type)), PDUMP_READ (ptr, type)) @@ -166,13 +180,13 @@ int count; } pdump_reloc_table; -static char *pdump_rt_list = 0; +static Rawbyte *pdump_rt_list = 0; void pdump_objects_unmark (void) { int i; - char *p = pdump_rt_list; + Rawbyte *p = pdump_rt_list; if (p) for (;;) { @@ -196,10 +210,10 @@ /* The structure of the dump file looks like this: 0 - header - dumped objects - stab_offset - nb_root_struct_ptrs*struct(void *, adr) - for global pointers to structures + stab_offset - nb_root_block_ptrs*struct(void *, adr) + for global pointers to heap blocks - nb_root_blocks*struct(void *, size, info) for global - objects to restore + data-segment blocks to restore - relocation table - root lisp object address/value couples with the count preceding the list @@ -215,12 +229,12 @@ unsigned int id; EMACS_UINT stab_offset; EMACS_UINT reloc_address; - int nb_root_struct_ptrs; + int nb_root_block_ptrs; int nb_root_blocks; } pdump_header; -char *pdump_start; -char *pdump_end; +Rawbyte *pdump_start; +Rawbyte *pdump_end; static Bytecount pdump_length; #ifdef WIN32_NATIVE @@ -246,38 +260,87 @@ return pdump_align_table[size % countof (pdump_align_table)]; } -typedef struct pdump_entry_list_elt +/************************************************************************/ +/* Registering memory blocks */ +/************************************************************************/ + +/* "Registering" or recording a heap memory block (which will need to be + written out, reloaded and relocated, and to which there may be pointers + from other heap blocks or from the data segment) happens both in a list + and in a hash table. There is a single hash table covering all + registered blocks, but different lists for different kinds of blocks. + There is one list for "opaque data" (stuff identified as + XD_OPAQUE_DATA_PTR, XD_ASCII_STRING, XD_DOC_STRING), one list for each + type of Lisp object, and one list for each different memory descriptor. + This lets similar-sized and aligned objects be grouped together when + they are written out, to save space. + + pdump_block_list is a list keeping track of registered memory blocks. + pdump_block_list_elt is a single entry through the list, and the list is + threaded through the NEXT pointer. The information in this list + associated with a particular block of memory is + + -- address of the beginning + -- number of elements at that address + -- size of each element + -- offset to this block in the dumped data + + pdump_desc_list is a list keeping track of the various descriptions + that we've seen. The primary purpose of this is so that memory blocks + can be grouped depending on the particular memory description + appropriate for them. The format of the list is different from + pdump_block_list -- a single array is used. (#### Dynarr should have + been used!!!). The information in this list associated with a + description is + + -- pointer to the description + -- a pdump_block_list of blocks using that description + + Functions for working with lists of memory blocks: + + -- Add a memory block to a list using pdump_add_block() + + -- Get a memory block from a pointer to its beginning using + pdump_get_block(). This uses the hash table, which lists everything. + + -- Return the memory-block list (pdump_block_list) associated with a + descriptor, using pdump_get_block_list(). If no entry found in the + pdump_desc_list, add a new one. + +*/ + +typedef struct pdump_block_list_elt { - struct pdump_entry_list_elt *next; + struct pdump_block_list_elt *next; const void *obj; Bytecount size; int count; EMACS_INT save_offset; -} pdump_entry_list_elt; +} pdump_block_list_elt; typedef struct { - pdump_entry_list_elt *first; + pdump_block_list_elt *first; int align; int count; -} pdump_entry_list; +} pdump_block_list; -typedef struct pdump_struct_list_elt +typedef struct pdump_desc_list_elt { - pdump_entry_list list; + pdump_block_list list; const struct memory_description *desc; -} pdump_struct_list_elt; +} pdump_desc_list_elt; typedef struct { - pdump_struct_list_elt *list; + pdump_desc_list_elt *list; int count; int size; -} pdump_struct_list; +} pdump_desc_list; -static pdump_entry_list *pdump_object_table; -static pdump_entry_list pdump_opaque_data_list; -static pdump_struct_list pdump_struct_table; +static pdump_block_list *pdump_object_table; +static pdump_block_list pdump_opaque_data_list; +static pdump_desc_list pdump_desc_table; static int *pdump_alert_undump_object; @@ -289,7 +352,7 @@ #define PDUMP_HASHSIZE 200001 -static pdump_entry_list_elt **pdump_hash; +static pdump_block_list_elt **pdump_hash; /* Since most pointers are eight bytes aligned, the >>3 allows for a better hash */ static int @@ -298,11 +361,14 @@ return ((unsigned long)(obj)>>3) % PDUMP_HASHSIZE; } -static pdump_entry_list_elt * -pdump_get_entry (const void *obj) +/* Return the entry for an already-registered memory block at OBJ, + or NULL if none. */ + +static pdump_block_list_elt * +pdump_get_block (const void *obj) { int pos = pdump_make_hash (obj); - pdump_entry_list_elt *e; + pdump_block_list_elt *e; assert (obj != 0); @@ -318,11 +384,14 @@ return 0; } +/* Register a new memory block on Return the entry for an already-registered heap (?) memory block at OBJ, + or NULL if none. */ + static void -pdump_add_entry (pdump_entry_list *list, const void *obj, Bytecount size, +pdump_add_block (pdump_block_list *list, const void *obj, Bytecount size, int count) { - pdump_entry_list_elt *e; + pdump_block_list_elt *e; int pos = pdump_make_hash (obj); while ((e = pdump_hash[pos]) != 0) @@ -335,7 +404,7 @@ pos = 0; } - e = xnew (pdump_entry_list_elt); + e = xnew (pdump_block_list_elt); e->next = list->first; e->obj = obj; @@ -354,30 +423,30 @@ } } -static pdump_entry_list * -pdump_get_entry_list (const struct memory_description *desc) +static pdump_block_list * +pdump_get_block_list (const struct memory_description *desc) { int i; - for (i=0; i<pdump_struct_table.count; i++) - if (pdump_struct_table.list[i].desc == desc) - return &pdump_struct_table.list[i].list; + for (i=0; i<pdump_desc_table.count; i++) + if (pdump_desc_table.list[i].desc == desc) + return &pdump_desc_table.list[i].list; - if (pdump_struct_table.size <= pdump_struct_table.count) + if (pdump_desc_table.size <= pdump_desc_table.count) { - if (pdump_struct_table.size == -1) - pdump_struct_table.size = 10; + if (pdump_desc_table.size == -1) + pdump_desc_table.size = 10; else - pdump_struct_table.size = pdump_struct_table.size * 2; - pdump_struct_table.list = (pdump_struct_list_elt *) - xrealloc (pdump_struct_table.list, - pdump_struct_table.size * sizeof (pdump_struct_list_elt)); + pdump_desc_table.size = pdump_desc_table.size * 2; + pdump_desc_table.list = (pdump_desc_list_elt *) + xrealloc (pdump_desc_table.list, + pdump_desc_table.size * sizeof (pdump_desc_list_elt)); } - pdump_struct_table.list[pdump_struct_table.count].list.first = 0; - pdump_struct_table.list[pdump_struct_table.count].list.align = ALIGNOF (max_align_t); - pdump_struct_table.list[pdump_struct_table.count].list.count = 0; - pdump_struct_table.list[pdump_struct_table.count].desc = desc; + pdump_desc_table.list[pdump_desc_table.count].list.first = 0; + pdump_desc_table.list[pdump_desc_table.count].list.align = ALIGNOF (max_align_t); + pdump_desc_table.list[pdump_desc_table.count].list.count = 0; + pdump_desc_table.list[pdump_desc_table.count].desc = desc; - return &pdump_struct_table.list[pdump_struct_table.count++].list; + return &pdump_desc_table.list[pdump_desc_table.count++].list; } static struct @@ -439,13 +508,15 @@ } static void pdump_register_object (Lisp_Object obj); -static void pdump_register_struct_contents (const void *data, - const struct sized_memory_description * - sdesc, - int count); -static void pdump_register_struct (const void *data, - const struct sized_memory_description *sdesc, - int count); +static void pdump_register_block_contents (const void *data, + Bytecount size, + const struct memory_description * + desc, + int count); +static void pdump_register_block (const void *data, + Bytecount size, + const struct memory_description *desc, + int count); static void pdump_register_sub (const void *data, const struct memory_description *desc) @@ -458,7 +529,7 @@ const struct memory_description *desc1 = &desc[pos]; EMACS_INT offset = lispdesc_indirect_count (desc1->offset, desc, data); - const void *rdata = (const char *) data + offset; + const void *rdata = (const Rawbyte *) data + offset; backtrace[me].position = pos; backtrace[me].offset = offset; @@ -484,23 +555,23 @@ EMACS_INT count = lispdesc_indirect_count (desc1->data1, desc, data); - pdump_add_entry (&pdump_opaque_data_list, + pdump_add_block (&pdump_opaque_data_list, *(void **)rdata, count, 1); break; } - case XD_C_STRING: + case XD_ASCII_STRING: { - const char *str = * (const char **) rdata; + const Ascbyte *str = * (const Ascbyte **) rdata; if (str) - pdump_add_entry (&pdump_opaque_data_list, str, strlen (str) + 1, + pdump_add_block (&pdump_opaque_data_list, str, strlen (str) + 1, 1); break; } case XD_DOC_STRING: { - const char *str = * (const char **) rdata; + const Ascbyte *str = * (const Ascbyte **) rdata; if ((EMACS_INT) str > 0) - pdump_add_entry (&pdump_opaque_data_list, str, strlen (str) + 1, + pdump_add_block (&pdump_opaque_data_list, str, strlen (str) + 1, 1); break; } @@ -510,7 +581,8 @@ assert (desc1->data1 == 0); - backtrace[me].offset = (const char *) pobj - (const char *) data; + backtrace[me].offset = + (const Rawbyte *) pobj - (const Rawbyte *) data; pdump_register_object (*pobj); break; } @@ -526,30 +598,32 @@ Lisp_Object dobj = *pobj; backtrace[me].offset = - (const char *) pobj - (const char *) data; + (const Rawbyte *) pobj - (const Rawbyte *) data; pdump_register_object (dobj); } break; } - case XD_STRUCT_PTR: + case XD_BLOCK_PTR: { EMACS_INT count = lispdesc_indirect_count (desc1->data1, desc, data); const struct sized_memory_description *sdesc = lispdesc_indirect_description (data, desc1->data2); - const char *dobj = *(const char **)rdata; + const Rawbyte *dobj = *(const Rawbyte **)rdata; if (dobj) - pdump_register_struct (dobj, sdesc, count); + pdump_register_block (dobj, sdesc->size, sdesc->description, + count); break; } - case XD_STRUCT_ARRAY: + case XD_BLOCK_ARRAY: { EMACS_INT count = lispdesc_indirect_count (desc1->data1, desc, data); const struct sized_memory_description *sdesc = lispdesc_indirect_description (data, desc1->data2); - pdump_register_struct_contents (rdata, sdesc, count); + pdump_register_block_contents (rdata, sdesc->size, + sdesc->description, count); break; } case XD_UNION: @@ -578,7 +652,7 @@ if (!objh) return; - if (pdump_get_entry (objh)) + if (pdump_get_block (objh)) return; imp = LHEADER_IMPLEMENTATION (objh); @@ -588,7 +662,7 @@ { pdump_bump_depth (); backtrace[pdump_depth - 1].obj = objh; - pdump_add_entry (pdump_object_table + objh->type, + pdump_add_block (pdump_object_table + objh->type, objh, detagged_lisp_object_size (objh), 1); pdump_register_sub (objh, imp->description); --pdump_depth; @@ -601,54 +675,54 @@ } } -/* Register the referenced objects in the array of COUNT objects of - located at DATA; each object is described by SDESC. "Object" here - simply means any block of memory; it need not actually be a C - "struct". It could be a single integer or Lisp_Object, for - example, as long as the description is accurate. +/* Register the referenced objects in the array of COUNT blocks located at + DATA; each block is described by SIZE and DESC. "Block" here simply + means any block of memory. This does not register the block of memory itself; it may, for example, be an array of structures inlined in another memory block - and thus should not be registered. See pdump_register_struct(), + and thus should not be registered. See pdump_register_block(), which does register the memory block. */ static void -pdump_register_struct_contents (const void *data, - const struct sized_memory_description *sdesc, - int count) - +pdump_register_block_contents (const void *data, + Bytecount size, + const struct memory_description *desc, + int count) { int i; Bytecount elsize; pdump_bump_depth (); - elsize = lispdesc_structure_size (data, sdesc); + elsize = lispdesc_block_size_1 (data, size, desc); for (i = 0; i < count; i++) { - pdump_register_sub (((char *) data) + elsize * i, sdesc->description); + pdump_register_sub (((Rawbyte *) data) + elsize * i, desc); } --pdump_depth; } -/* Register the array of COUNT objects of located at DATA; each object is - described by SDESC. "Object" here simply means any block of memory; - it need not actually be a C "struct". It could be a single integer - or Lisp_Object, for example, as long as the description is accurate. +/* Register the array of COUNT blocks located at DATA; each block is + described by SDESC. "Block" here simply means any block of memory, + which is more accurate and less confusing than terms like `struct' and + `object'. A `block' need not actually be a C "struct". It could be a + single integer or Lisp_Object, for example, as long as the description + is accurate. - This is like pdump_register_struct_contents() but also registers + This is like pdump_register_block_contents() but also registers the memory block itself. */ static void -pdump_register_struct (const void *data, - const struct sized_memory_description *sdesc, - int count) +pdump_register_block (const void *data, + Bytecount size, + const struct memory_description *desc, + int count) { - if (data && !pdump_get_entry (data)) + if (data && !pdump_get_block (data)) { - pdump_add_entry (pdump_get_entry_list (sdesc->description), data, - lispdesc_structure_size (data, sdesc), count); - - pdump_register_struct_contents (data, sdesc, count); + pdump_add_block (pdump_get_block_list (desc), data, + lispdesc_block_size_1 (data, size, desc), count); + pdump_register_block_contents (data, size, desc, count); } } @@ -656,7 +730,7 @@ COUNT contiguous blocks of memory, each described by DESC and of size SIZE, whose original is located at ORIG_DATA and the modifiable copy at DATA. We examine the description to figure out where the pointers are, - and then look up the replacement values using pdump_get_entry(). + and then look up the replacement values using pdump_get_block(). This is done just before writing the modified block of memory to the dump file. The new pointer offsets have been carefully calculated so @@ -688,7 +762,7 @@ for (i = 0; i < count; i++) { /* CUR points to the beginning of each block in the new data. */ - char *cur = ((char *)data) + i*size; + Rawbyte *cur = ((Rawbyte *)data) + i * size; /* Scan each line of the description for relocatable pointers */ for (pos = 0; desc[pos].type != XD_END; pos++) { @@ -719,12 +793,12 @@ break; } case XD_OPAQUE_DATA_PTR: - case XD_C_STRING: - case XD_STRUCT_PTR: + case XD_ASCII_STRING: + case XD_BLOCK_PTR: { void *ptr = * (void **) rdata; if (ptr) - * (EMACS_INT *) rdata = pdump_get_entry (ptr)->save_offset; + * (EMACS_INT *) rdata = pdump_get_block (ptr)->save_offset; break; } case XD_LO_LINK: @@ -738,7 +812,7 @@ referenced one. (The Qnil or Qunbound that ends the chain will always be a referenced object.) */ Lisp_Object obj = * (Lisp_Object *) rdata; - pdump_entry_list_elt *elt1; + pdump_block_list_elt *elt1; /* #### Figure out how to handle indirect offsets here. #### In general, when computing indirect counts, do we really need to use the orig_data pointer? Why not just @@ -752,11 +826,12 @@ assert (!XD_IS_INDIRECT (desc1->offset)); for (;;) { - elt1 = pdump_get_entry (XRECORD_LHEADER (obj)); + elt1 = pdump_get_block (XRECORD_LHEADER (obj)); if (elt1) break; obj = * (Lisp_Object *) (desc1->offset + - (char *)(XRECORD_LHEADER (obj))); + (Rawbyte *) + (XRECORD_LHEADER (obj))); } * (EMACS_INT *) rdata = elt1->save_offset; break; @@ -769,7 +844,7 @@ if (POINTER_TYPE_P (XTYPE (*pobj)) && XRECORD_LHEADER (*pobj)) * (EMACS_INT *) pobj = - pdump_get_entry (XRECORD_LHEADER (*pobj))->save_offset; + pdump_get_block (XRECORD_LHEADER (*pobj))->save_offset; break; } case XD_LISP_OBJECT_ARRAY: @@ -784,7 +859,7 @@ if (POINTER_TYPE_P (XTYPE (*pobj)) && XRECORD_LHEADER (*pobj)) * (EMACS_INT *) pobj = - pdump_get_entry (XRECORD_LHEADER (*pobj))->save_offset; + pdump_get_block (XRECORD_LHEADER (*pobj))->save_offset; } break; } @@ -793,10 +868,10 @@ EMACS_INT str = *(EMACS_INT *)rdata; if (str > 0) * (EMACS_INT *) rdata = - pdump_get_entry ((void *)str)->save_offset; + pdump_get_block ((void *)str)->save_offset; break; } - case XD_STRUCT_ARRAY: + case XD_BLOCK_ARRAY: { EMACS_INT num = lispdesc_indirect_count (desc1->data1, desc, orig_data); @@ -805,11 +880,12 @@ pdump_store_new_pointer_offsets (num, rdata, - ((char *) rdata - (char *) data) + (char *) orig_data, + ((Rawbyte *) rdata - (Rawbyte *) data) + + (Rawbyte *) orig_data, sdesc->description, - lispdesc_structure_size - (((char *) rdata - (char *) data) + (char *) orig_data, - sdesc)); + lispdesc_block_size + (((Rawbyte *) rdata - (Rawbyte *) data) + + (Rawbyte *) orig_data, sdesc)); break; } case XD_UNION: @@ -834,7 +910,7 @@ the dump file. */ static void -pdump_dump_data (pdump_entry_list_elt *elt, +pdump_dump_data (pdump_block_list_elt *elt, const struct memory_description *desc) { Bytecount size = elt->size; @@ -855,8 +931,9 @@ in the block. Does not recursively relocate any other memory blocks pointed to. (We already have a list of all memory blocks in the dump file.) This is used once the dump data has been loaded back in, both - for blocks sitting in the dumped data and in global data objects whose - contents have been restored from the dumped data. */ + for blocks sitting in the dumped data (former heap blocks) and in global + data-sgment blocks whose contents have been restored from the dumped + data. */ static void pdump_reloc_one (void *data, EMACS_INT delta, @@ -867,8 +944,9 @@ for (pos = 0; desc[pos].type != XD_END; pos++) { const struct memory_description *desc1 = &desc[pos]; - void *rdata = (char *) data + lispdesc_indirect_count (desc1->offset, - desc, data); + void *rdata = + (Rawbyte *) data + lispdesc_indirect_count (desc1->offset, + desc, data); union_switcheroo: @@ -886,8 +964,8 @@ case XD_INT_RESET: break; case XD_OPAQUE_DATA_PTR: - case XD_C_STRING: - case XD_STRUCT_PTR: + case XD_ASCII_STRING: + case XD_BLOCK_PTR: case XD_LO_LINK: { EMACS_INT ptr = *(EMACS_INT *)rdata; @@ -903,7 +981,7 @@ if (POINTER_TYPE_P (XTYPE (*pobj)) && ! EQ (*pobj, Qnull_pointer)) - *pobj = wrap_pointer_1 ((char *) XPNTR (*pobj) + delta); + *pobj = wrap_pointer_1 ((Rawbyte *) XPNTR (*pobj) + delta); break; } @@ -919,7 +997,8 @@ if (POINTER_TYPE_P (XTYPE (*pobj)) && ! EQ (*pobj, Qnull_pointer)) - *pobj = wrap_pointer_1 ((char *) XPNTR (*pobj) + delta); + *pobj = wrap_pointer_1 ((Rawbyte *) XPNTR (*pobj) + + delta); } break; } @@ -930,18 +1009,18 @@ *(EMACS_INT *)rdata = str + delta; break; } - case XD_STRUCT_ARRAY: + case XD_BLOCK_ARRAY: { EMACS_INT num = lispdesc_indirect_count (desc1->data1, desc, data); int j; const struct sized_memory_description *sdesc = lispdesc_indirect_description (data, desc1->data2); - Bytecount size = lispdesc_structure_size (rdata, sdesc); + Bytecount size = lispdesc_block_size (rdata, sdesc); /* Note: We are recursing over data in the block itself */ for (j = 0; j < num; j++) - pdump_reloc_one ((char *) rdata + j * size, delta, + pdump_reloc_one ((Rawbyte *) rdata + j * size, delta, sdesc->description); break; @@ -960,18 +1039,48 @@ } static void -pdump_allocate_offset (pdump_entry_list_elt *elt, +pdump_allocate_offset (pdump_block_list_elt *elt, const struct memory_description *UNUSED (desc)) { Bytecount size = elt->count * elt->size; elt->save_offset = cur_offset; - if (size>max_size) + if (size > max_size) max_size = size; cur_offset += size; } +/* Traverse through all the heap blocks, once the "register" stage of + dumping has finished. To compress space as much as possible, we + logically sort all blocks by alignment, hitting all blocks with + alignment == the maximum (which may be 8 bytes, for doubles), then + all blocks with the next lower alignment (4 bytes), etc. + + Within each alignment we hit + + -- first the Lisp objects, type-by-type + + -- then the heap memory blocks that are not Lisp objects, description-by- + description -- i.e. all blocks with the same description will be + placed together + + -- then the "opaque" data objects declared as XD_OPAQUE_DATA_PTR, + XD_ASCII_STRING and XD_DOC_STRING. + + The idea is to have as little blank space as possible in the laid-out + data. + + For each item that we have hit, we process it by calling F, the function + passed it. In dumper.c, pdump_scan_by_alignment() is called twice with + two different functions -- pdump_allocate_offset() in stage 2 to compute + the offset to each block, and pdump_dump_data() in stage 3 to + successively write each block to disk. + + It's extremely important that the SAME traversal order gets invoked + in both stage 2 and 3. +*/ + static void -pdump_scan_by_alignment (void (*f)(pdump_entry_list_elt *, +pdump_scan_by_alignment (void (*f)(pdump_block_list_elt *, const struct memory_description *)) { int align; @@ -979,16 +1088,16 @@ for (align = ALIGNOF (max_align_t); align; align>>=1) { int i; - pdump_entry_list_elt *elt; + pdump_block_list_elt *elt; for (i=0; i<lrecord_type_count; i++) if (pdump_object_table[i].align == align) for (elt = pdump_object_table[i].first; elt; elt = elt->next) f (elt, lrecord_implementations_table[i]->description); - for (i=0; i<pdump_struct_table.count; i++) + for (i=0; i<pdump_desc_table.count; i++) { - pdump_struct_list_elt list = pdump_struct_table.list[i]; + pdump_desc_list_elt list = pdump_desc_table.list[i]; if (list.list.align == align) for (elt = list.list.first; elt; elt = elt->next) f (elt, list.desc); @@ -1000,32 +1109,53 @@ } } +/* Dump out the root block pointers, part of stage 3 (the "WRITE" stage) of + dumping. For each pointer we dump out a structure containing the + location of the pointer and its value, replaced by the appropriate + offset into the dumped data. */ + static void -pdump_dump_root_struct_ptrs (void) +pdump_dump_root_block_ptrs (void) { int i; - Elemcount count = Dynarr_length (pdump_root_struct_ptrs); + Elemcount count = Dynarr_length (pdump_root_block_ptrs); pdump_static_pointer *data = alloca_array (pdump_static_pointer, count); for (i = 0; i < count; i++) { data[i].address = - (char **) Dynarr_atp (pdump_root_struct_ptrs, i)->ptraddress; + (Rawbyte **) Dynarr_atp (pdump_root_block_ptrs, i)->ptraddress; data[i].value = - (char *) pdump_get_entry (* data[i].address)->save_offset; + (Rawbyte *) pdump_get_block (* data[i].address)->save_offset; } PDUMP_ALIGN_OUTPUT (pdump_static_pointer); retry_fwrite (data, sizeof (pdump_static_pointer), count, pdump_out); } +/* Dump out the root blocks, part of stage 3 (the "WRITE" stage) of + dumping. For each block we dump a structure containing info about the + block (its location, size and description) and then the block itself, + with its pointers replaced with offsets into the dump data. */ + static void pdump_dump_root_blocks (void) { int i; for (i = 0; i < Dynarr_length (pdump_root_blocks); i++) { - pdump_root_block *info = Dynarr_atp (pdump_root_blocks, i); - PDUMP_WRITE_ALIGNED (pdump_root_block, *info); - retry_fwrite (info->varaddress, info->size, 1, pdump_out); + pdump_root_block info = Dynarr_at (pdump_root_blocks, i); + PDUMP_WRITE_ALIGNED (pdump_root_block, info); + + if (info.desc) + { + /* Copy to temporary buffer */ + memcpy (pdump_buf, info.blockaddr, info.size); + + /* Store new offsets into all pointers in block */ + pdump_store_new_pointer_offsets (1, pdump_buf, info.blockaddr, + info.desc, info.size); + } + retry_fwrite (info.desc ? pdump_buf : info.blockaddr, + info.size, 1, pdump_out); } } @@ -1033,7 +1163,7 @@ pdump_dump_rtables (void) { int i; - pdump_entry_list_elt *elt; + pdump_block_list_elt *elt; pdump_reloc_table rt; for (i=0; i<lrecord_type_count; i++) @@ -1046,7 +1176,7 @@ PDUMP_WRITE_ALIGNED (pdump_reloc_table, rt); while (elt) { - EMACS_INT rdata = pdump_get_entry (elt->obj)->save_offset; + EMACS_INT rdata = pdump_get_block (elt->obj)->save_offset; PDUMP_WRITE_ALIGNED (EMACS_INT, rdata); elt = elt->next; } @@ -1056,15 +1186,15 @@ rt.count = 0; PDUMP_WRITE_ALIGNED (pdump_reloc_table, rt); - for (i=0; i<pdump_struct_table.count; i++) + for (i=0; i<pdump_desc_table.count; i++) { - elt = pdump_struct_table.list[i].list.first; - rt.desc = pdump_struct_table.list[i].desc; - rt.count = pdump_struct_table.list[i].list.count; + elt = pdump_desc_table.list[i].list.first; + rt.desc = pdump_desc_table.list[i].desc; + rt.count = pdump_desc_table.list[i].list.count; PDUMP_WRITE_ALIGNED (pdump_reloc_table, rt); while (elt) { - EMACS_INT rdata = pdump_get_entry (elt->obj)->save_offset; + EMACS_INT rdata = pdump_get_block (elt->obj)->save_offset; int j; for (j=0; j<elt->count; j++) { @@ -1097,15 +1227,15 @@ if (POINTER_TYPE_P (XTYPE (obj.value))) obj.value = - wrap_pointer_1 ((void *) pdump_get_entry (XRECORD_LHEADER + wrap_pointer_1 ((void *) pdump_get_block (XRECORD_LHEADER (obj.value))->save_offset); PDUMP_WRITE (pdump_static_Lisp_Object, obj); } - for (i=0; i<Dynarr_length (pdump_weak_object_chains); i++) + for (i = 0; i < Dynarr_length (pdump_weak_object_chains); i++) { - pdump_entry_list_elt *elt; + pdump_block_list_elt *elt; pdump_static_Lisp_Object obj; obj.address = Dynarr_at (pdump_weak_object_chains, i); @@ -1115,7 +1245,7 @@ { const struct memory_description *desc; int pos; - elt = pdump_get_entry (XRECORD_LHEADER (obj.value)); + elt = pdump_get_block (XRECORD_LHEADER (obj.value)); if (elt) break; desc = XRECORD_LHEADER_IMPLEMENTATION (obj.value)->description; @@ -1126,7 +1256,7 @@ assert (!XD_IS_INDIRECT (desc[pos].offset)); obj.value = * (Lisp_Object *) (desc[pos].offset + - (char *) (XRECORD_LHEADER (obj.value))); + (Rawbyte *) (XRECORD_LHEADER (obj.value))); } obj.value = wrap_pointer_1 ((void *) elt->save_offset); @@ -1134,6 +1264,123 @@ } } + +/*######################################################################## + # Pdump # + ######################################################################## + + [ben] + + DISCUSSION OF DUMPING: + + The idea of dumping is to record the state of XEmacs in a file, so that + it can be reloaded later. This avoids having to reload all of the basic + Lisp code each time XEmacs is run, which is a rather time-consuming + process. (Less so on new machines, but still noticeable. As an example + of a program with similar issues but which does not have a dumping + process and as a result has a slow startup time, consider Adobe Photoshop + 5.0 or Adobe Photoshop Elements 2.0.) + + We don't actually record ALL the state of XEmacs (some of it, for example, + is dependent on the run-time environment and needs to be initialized + whenever XEmacs is run), but whatever state we don't record needs to be + reinitialized every time XEmacs is run. + + The old way of dumping was to make a new executable file with the data + segment expanded to contain the heap and written out from memory. This + is what the unex* files do. Unfortunately this process is extremely + system-specific and breaks easily with OS changes. + + Another simple, more portable trick, the "static heap" method, involves + replacing the allocator with our own allocator which allocates all space + out of a very large array declared in our data segment until we run out, + then uses the underlying malloc() to start allocating on the heap. If we + ensure that the large array is big enough to hold all data allocated + during the dump stage, then all of the data we need to save is in the + data segment, and it's easy to calculate the location and size of the + data segment we want to save (we don't want to record and reinitialize + the data segment of library functions) by using appropriately declared + variables in the first and last file linked. This method is known as the + "static heap" method, and is used by the non-pdump version of the dumper + under Cygwin, and was also used under VMS and in Win-Emacs. + + The "static heap" method works well in practice. Nonetheless, a more + complex method of dumping was written by Olivier Galibert, which requires + that structural descriptions of all data allocated in the heap be provided + and the roots of all pointers into the heap be noted through function calls + to the pdump API. This way, all the heap data can be traversed and written + out to a file, and then reloaded at run-time and the pointers relocated to + point at the new location of the loaded data. This is the "pdump" method + used in this file. + + There are two potential advantages of "pdump" over the "static heap": + + (1) It doesn't require any tricks to calculate the beginning and end of + the data segment, or even that the XEmacs section of the data segment + be contiguous. (It's not clear whether this is an issue in practice.) + (2) Potentially, it could handle an OS that does not always load the + static data segment at a predictable location. The "static heap" + method by its nature needs the data segment to stay in the same place + from invocation to invocation, since it simply dumps out memory and + reloads it, without any pointer relocation. I say "potentially" + because as it is currently written pdump does assume that the data + segment is never relocated. However, changing pdump to remove this + assumption is probably not difficult, as all the mechanism to handle + pointer relocation is already present. + + + DISCUSSION OF PDUMP WORKINGS: + + See man/internals/internals.texi for more information. + + NOTE that we have two kinds of memory to handle: memory on the heap + (i.e. allocated through malloc()) or the like, and static memory in the + data segment of the program, i.e. stuff declared as global or static. + All heap memory needs to be written out to the dump file and reproduced + (i.e. reloaded and any necessary relocations performed). Data-segment + memory that is not statically initialized (i.e. through declarations in + the C code) needs either to be written out and reloaded, or + reinitialized. In addition, any pointers in data-segment memory to heap + memory must be written out, reloaded and relocated. + + NOTE that we currently don't handle relocation of pointers into data- + segment memory. (See overview discussion above.) These are treated in + the descriptions as opaque data not needing relocation. If this becomes a + problem, it can be fixed through new kinds of types in + enum memory_description_type. + + Three basic steps to dumping out: + + (1) "REGISTER": + Starting with all sources of relocatable memory (currently this means + all data-segment pointers to heap memory -- see above about pointers + to data-segment memory), recursively traverse the tree of pointers + and "register" (make a note of) every memory block seen. + + (2) "LAYOUT": + Go through all of the registered blocks and compute the location of + each one in the dump data (i.e. the "offset" that will be added to + the address corresponding to start of the loaded-in data to get the + new pointer referring to this block). The blocks will be laid out + sequentially according to the order we traverse them. Also note the + maximum-sized block for use in step 3. + + (3) "WRITE": + After writing some header stuff, go through all of the registered + blocks and write out each one to the dump file. Note that we are + simply writing out the blocks sequentially as we see them, and our + traversal path is identical to that in step 2, so blocks will end up + at the locations computed for them. In order to write out a block, + first copy it to a temporary location (hence the maximum-block-size + computation in the previous step), then for each relocatable pointer + in the block, write in its place the offset to the heap block in the + dump data. When the dump data is loaded, the address of the + beginning of the dump data will be added to the offset in each + pointer, and thence become accurate. + + --ben +*/ + void pdump (void) { @@ -1144,7 +1391,7 @@ in_pdump = 1; - pdump_object_table = xnew_array (pdump_entry_list, lrecord_type_count); + pdump_object_table = xnew_array (pdump_block_list, lrecord_type_count); pdump_alert_undump_object = xnew_array (int, lrecord_type_count); assert (ALIGNOF (max_align_t) <= pdump_align_table[0]); @@ -1172,35 +1419,42 @@ lrecord_type_count * sizeof (lrecord_markers[0])); #endif /* not USE_KKCC */ - pdump_hash = xnew_array_and_zero (pdump_entry_list_elt *, PDUMP_HASHSIZE); + pdump_hash = xnew_array_and_zero (pdump_block_list_elt *, PDUMP_HASHSIZE); - for (i=0; i<lrecord_type_count; i++) + for (i = 0; i<lrecord_type_count; i++) { pdump_object_table[i].first = 0; pdump_object_table[i].align = ALIGNOF (max_align_t); pdump_object_table[i].count = 0; pdump_alert_undump_object[i] = 0; } - pdump_struct_table.count = 0; - pdump_struct_table.size = -1; + pdump_desc_table.count = 0; + pdump_desc_table.size = -1; pdump_opaque_data_list.first = 0; pdump_opaque_data_list.align = ALIGNOF (max_align_t); pdump_opaque_data_list.count = 0; pdump_depth = 0; + /* (I) The "register" stage: Note all heap memory blocks to be relocated + */ + + /* Try various roots of accessibility: */ + + /* (1) Lisp objects, both those declared using DEFVAR_LISP*() and those + staticpro()d. */ for (i = 0; i < Dynarr_length (pdump_root_lisp_objects); i++) pdump_register_object (* Dynarr_at (pdump_root_lisp_objects, i)); none = 1; - for (i=0; i<lrecord_type_count; i++) + for (i = 0; i < lrecord_type_count; i++) if (pdump_alert_undump_object[i]) { if (none) - printf ("Undumpable types list :\n"); + stderr_out ("Undumpable types list :\n"); none = 0; - printf (" - %s (%d)\n", lrecord_implementations_table[i]->name, - pdump_alert_undump_object[i]); + stderr_out (" - %s (%d)\n", lrecord_implementations_table[i]->name, + pdump_alert_undump_object[i]); } if (!none) { @@ -1208,26 +1462,68 @@ return; } - for (i=0; i<Dynarr_length (pdump_root_struct_ptrs); i++) + /* (2) Register out the data-segment pointer variables to heap blocks */ + for (i = 0; i < Dynarr_length (pdump_root_block_ptrs); i++) { - pdump_root_struct_ptr info = Dynarr_at (pdump_root_struct_ptrs, i); - pdump_register_struct (*(info.ptraddress), info.desc, 1); + pdump_root_block_ptr info = Dynarr_at (pdump_root_block_ptrs, i); + pdump_register_block (*(info.ptraddress), info.desc->size, + info.desc->description, 1); } + /* (3) Register out the data-segment blocks, maybe with pointers to heap + blocks */ + for (i = 0; i < Dynarr_length (pdump_root_blocks); i++) + { + pdump_root_block *info = Dynarr_atp (pdump_root_blocks, i); + if (info->desc) + { + /* Size may have been given as 0 meaning "compute later". + Compute now and update. If no DESC, size must always be + correct as there is no other way of computing it. */ + info->size = lispdesc_block_size_1 (info->blockaddr, info->size, + info->desc); + pdump_register_block_contents (info->blockaddr, info->size, + info->desc, 1); + } + } + + /* (II) The "layout" stage: Compute the offsets and max-size */ + + /* (1) Determine header size */ memcpy (header.signature, PDUMP_SIGNATURE, PDUMP_SIGNATURE_LEN); header.id = dump_id; header.reloc_address = 0; - header.nb_root_struct_ptrs = Dynarr_length (pdump_root_struct_ptrs); + header.nb_root_block_ptrs = Dynarr_length (pdump_root_block_ptrs); header.nb_root_blocks = Dynarr_length (pdump_root_blocks); cur_offset = MAX_ALIGN_SIZE (sizeof (header)); max_size = 0; + /* (2) Traverse all heap blocks and compute their offsets; keep track + of maximum block size seen */ pdump_scan_by_alignment (pdump_allocate_offset); cur_offset = MAX_ALIGN_SIZE (cur_offset); header.stab_offset = cur_offset; + /* (3) Update maximum size based on root (data-segment) blocks */ + for (i = 0; i < Dynarr_length (pdump_root_blocks); i++) + { + pdump_root_block info = Dynarr_at (pdump_root_blocks, i); + + /* If no DESC, no relocation needed and we copy directly instead of + into a temp buffer. */ + if (info.desc) + { + if (info.size > max_size) + max_size = info.size; + } + } + + /* (III) The "write "stage: Dump out the data, storing the offsets in + place of pointers whenever we write out memory blocks */ + pdump_buf = xmalloc (max_size); + /* EMACS_PROGNAME is entirely ASCII so this should be Mule-safe */ pdump_fd = open (EMACS_PROGNAME ".dmp", O_WRONLY | O_CREAT | O_TRUNC | OPEN_BINARY, 0666); if (pdump_fd < 0) @@ -1245,7 +1541,7 @@ fseek (pdump_out, header.stab_offset, SEEK_SET); - pdump_dump_root_struct_ptrs (); + pdump_dump_root_block_ptrs (); pdump_dump_root_blocks (); pdump_dump_rtables (); pdump_dump_root_lisp_objects (); @@ -1266,7 +1562,7 @@ static int pdump_load_check (void) { - return (!memcmp (((pdump_header *)pdump_start)->signature, + return (!memcmp (((pdump_header *) pdump_start)->signature, PDUMP_SIGNATURE, PDUMP_SIGNATURE_LEN) && ((pdump_header *)pdump_start)->id == dump_id); } @@ -1278,7 +1574,7 @@ pdump_load_finish (void) { int i; - char *p; + Rawbyte *p; EMACS_INT delta; EMACS_INT count; pdump_header *header = (pdump_header *) pdump_start; @@ -1288,9 +1584,9 @@ delta = ((EMACS_INT) pdump_start) - header->reloc_address; p = pdump_start + header->stab_offset; - /* Put back the pdump_root_struct_ptrs */ - p = (char *) ALIGN_PTR (p, pdump_static_pointer); - for (i = 0; i < header->nb_root_struct_ptrs; i++) + /* Put back the pdump_root_block_ptrs */ + p = (Rawbyte *) ALIGN_PTR (p, pdump_static_pointer); + for (i = 0; i < header->nb_root_block_ptrs; i++) { pdump_static_pointer ptr = PDUMP_READ (p, pdump_static_pointer); (* ptr.address) = ptr.value + delta; @@ -1300,9 +1596,9 @@ for (i = 0; i < header->nb_root_blocks; i++) { pdump_root_block info = PDUMP_READ_ALIGNED (p, pdump_root_block); - memcpy ((void *) info.varaddress, p, info.size); + memcpy ((void *) info.blockaddr, p, info.size); if (info.desc) - pdump_reloc_one ((void *) info.varaddress, delta, info.desc); + pdump_reloc_one ((void *) info.blockaddr, delta, info.desc); p += info.size; } @@ -1312,16 +1608,16 @@ for (;;) { pdump_reloc_table rt = PDUMP_READ_ALIGNED (p, pdump_reloc_table); - p = (char *) ALIGN_PTR (p, char *); + p = (Rawbyte *) ALIGN_PTR (p, Rawbyte *); if (rt.desc) { - char **reloc = (char **) p; + Rawbyte **reloc = (Rawbyte **) p; for (i = 0; i < rt.count; i++) { reloc[i] += delta; pdump_reloc_one (reloc[i], delta, rt.desc); } - p += rt.count * sizeof (char *); + p += rt.count * sizeof (Rawbyte *); } else if (!(--count)) break; @@ -1329,13 +1625,13 @@ /* Put the pdump_root_lisp_objects variables in place */ i = PDUMP_READ_ALIGNED (p, Elemcount); - p = (char *) ALIGN_PTR (p, pdump_static_Lisp_Object); + p = (Rawbyte *) ALIGN_PTR (p, pdump_static_Lisp_Object); while (i--) { pdump_static_Lisp_Object obj = PDUMP_READ (p, pdump_static_Lisp_Object); if (POINTER_TYPE_P (XTYPE (obj.value))) - obj.value = wrap_pointer_1 ((char *) XPNTR (obj.value) + delta); + obj.value = wrap_pointer_1 ((Rawbyte *) XPNTR (obj.value) + delta); (* obj.address) = obj.value; } @@ -1346,7 +1642,7 @@ for (;;) { pdump_reloc_table rt = PDUMP_READ_ALIGNED (p, pdump_reloc_table); - p = (char *) ALIGN_PTR (p, Lisp_Object); + p = (Rawbyte *) ALIGN_PTR (p, Lisp_Object); if (!rt.desc) break; if (rt.desc == hash_table_description) @@ -1373,34 +1669,43 @@ } static int -pdump_file_get (const char *path) +pdump_file_get (const Wexttext *wpath) { + Extbyte *path; + if (XEUNICODE_P) + path = (Extbyte *) wpath; + else + path = WEXTTEXT_TO_MULTIBYTE (wpath); - pdump_hFile = CreateFileA (path, - GENERIC_READ + GENERIC_WRITE, /* Required for copy on write */ - 0, /* Not shared */ - NULL, /* Not inheritable */ - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); /* No template file */ + pdump_hFile = + qxeCreateFile (path, + GENERIC_READ + GENERIC_WRITE, /* Required for copy on + write */ + 0, /* Not shared */ + NULL, /* Not inheritable */ + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); /* No template file */ if (pdump_hFile == INVALID_HANDLE_VALUE) return 0; pdump_length = GetFileSize (pdump_hFile, NULL); - pdump_hMap = CreateFileMappingA (pdump_hFile, - NULL, /* No security attributes */ - PAGE_WRITECOPY, /* Copy on write */ - 0, /* Max size, high half */ - 0, /* Max size, low half */ - NULL); /* Unnamed */ + pdump_hMap = + qxeCreateFileMapping (pdump_hFile, + NULL, /* No security attributes */ + PAGE_WRITECOPY, /* Copy on write */ + 0, /* Max size, high half */ + 0, /* Max size, low half */ + NULL); /* Unnamed */ if (pdump_hMap == INVALID_HANDLE_VALUE) return 0; - pdump_start = (char *) MapViewOfFile (pdump_hMap, - FILE_MAP_COPY, /* Copy on write */ - 0, /* Start at zero */ - 0, - 0); /* Map all of it */ + pdump_start = + (Rawbyte *) MapViewOfFile (pdump_hMap, + FILE_MAP_COPY, /* Copy on write */ + 0, /* Start at zero */ + 0, + 0); /* Map all of it */ pdump_free = pdump_file_unmap; return 1; } @@ -1439,7 +1744,7 @@ if (hResLoad == NULL) return 0; - pdump_start = (char *) LockResource (hResLoad); + pdump_start = (Rawbyte *) LockResource (hResLoad); if (pdump_start == NULL) return 0; @@ -1459,7 +1764,7 @@ static void pdump_file_free (void) { - xfree (pdump_start, char *); + xfree (pdump_start, Rawbyte *); } #ifdef HAVE_MMAP @@ -1471,10 +1776,10 @@ #endif static int -pdump_file_get (const char *path) +pdump_file_get (const Wexttext *path) { - int fd = open (path, O_RDONLY | OPEN_BINARY); - if (fd<0) + int fd = wext_retry_open (path, O_RDONLY | OPEN_BINARY); + if (fd < 0) return 0; pdump_length = lseek (fd, 0, SEEK_END); @@ -1492,8 +1797,10 @@ # ifndef MAP_FAILED # define MAP_FAILED ((void *) -1L) # endif - pdump_start = (char *) mmap (0, pdump_length, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); - if (pdump_start != (char *) MAP_FAILED) + pdump_start = + (Rawbyte *) mmap (0, pdump_length, PROT_READ|PROT_WRITE, MAP_PRIVATE, + fd, 0); + if (pdump_start != (Rawbyte *) MAP_FAILED) { pdump_free = pdump_file_unmap; retry_close (fd); @@ -1501,7 +1808,7 @@ } #endif /* HAVE_MMAP */ - pdump_start = xnew_array (char, pdump_length); + pdump_start = xnew_array (Rawbyte, pdump_length); pdump_free = pdump_file_free; retry_read (fd, pdump_start, pdump_length); @@ -1512,23 +1819,24 @@ static int pdump_ram_try (void) { - pdump_start = dumped_data_get(); - pdump_length = dumped_data_size(); + pdump_start = dumped_data_get (); + pdump_length = dumped_data_size (); - return pdump_load_check(); + return pdump_load_check (); } #endif /* !WIN32_NATIVE */ static int -pdump_file_try (char *exe_path) +pdump_file_try (Wexttext *exe_path) { - char *w = exe_path + strlen (exe_path); + Wexttext *w = exe_path + wext_strlen (exe_path); do { - sprintf (w, "-%s-%08x.dmp", EMACS_VERSION, dump_id); + wext_sprintf (w, WEXTSTRING ("-%s-%08x.dmp"), WEXTSTRING (EMACS_VERSION), + dump_id); if (pdump_file_get (exe_path)) { if (pdump_load_check ()) @@ -1536,7 +1844,7 @@ pdump_free (); } - sprintf (w, "-%08x.dmp", dump_id); + wext_sprintf (w, WEXTSTRING ("-%08x.dmp"), dump_id); if (pdump_file_get (exe_path)) { if (pdump_load_check ()) @@ -1544,7 +1852,7 @@ pdump_free (); } - sprintf (w, ".dmp"); + wext_sprintf (w, WEXTSTRING (".dmp")); if (pdump_file_get (exe_path)) { if (pdump_load_check ()) @@ -1554,50 +1862,65 @@ do w--; - while (w>exe_path && !IS_DIRECTORY_SEP (*w) && (*w != '-') && (*w != '.')); + /* !!#### See comment below about how this is unsafe. */ + while (w > exe_path && !IS_DIRECTORY_SEP (*w) && (*w != '-') && + (*w != '.')); } - while (w>exe_path && !IS_DIRECTORY_SEP (*w)); + while (w > exe_path && !IS_DIRECTORY_SEP (*w)); return 0; } int -pdump_load (const Extbyte *argv0) +pdump_load (const Wexttext *argv0) { - Extbyte exe_path[PATH_MAX]; - + Wexttext exe_path[PATH_MAX]; #ifdef WIN32_NATIVE - GetModuleFileNameA (NULL, exe_path, PATH_MAX); + qxeGetModuleFileName (NULL, (Extbyte *) exe_path, PATH_MAX); + if (!XEUNICODE_P) + { + Wexttext *wexe = MULTIBYTE_TO_WEXTTEXT ((Extbyte *) exe_path); + wext_strcpy (exe_path, wexe); + } #else /* !WIN32_NATIVE */ - Extbyte *w; - const Extbyte *dir, *p; + Wexttext *w; + const Wexttext *dir, *p; - if(pdump_ram_try()) { - pdump_load_finish(); - in_pdump = 0; - return 1; - } + if (pdump_ram_try ()) + { + pdump_load_finish (); + in_pdump = 0; + return 1; + } in_pdump = 1; dir = argv0; if (dir[0] == '-') { /* XEmacs as a login shell, oh goody! */ - dir = getenv ("SHELL"); /* not egetenv -- not yet initialized */ + dir = wext_getenv ("SHELL"); /* not egetenv -- not yet initialized and we + want external-format data */ } - p = dir + strlen (dir); - while (p != dir && !IS_ANY_SEP (p[-1])) p--; + p = dir + wext_strlen (dir); + /* !!#### This is bad as it may fail with certain non-ASCII-compatible + external formats such as JIS. Maybe we should be using the mb*() + routines in libc? But can we reliably trust them on all Unix + platforms? (We can't convert to internal since those conversion + routines aren't yet initialized) */ + while (p != dir && !IS_ANY_SEP (p[-1])) + p--; if (p != dir) { /* invocation-name includes a directory component -- presumably it is relative to cwd, not $PATH */ - strcpy (exe_path, dir); + wext_strcpy (exe_path, dir); } else { - const Extbyte *path = getenv ("PATH"); /* not egetenv -- not yet init. */ - const Extbyte *name = p; + const Wexttext *path = wext_getenv ("PATH"); /* not egetenv -- + not yet init. */ + const Wexttext *name = p; for (;;) { p = path; @@ -1610,22 +1933,17 @@ } else { - memcpy (exe_path, path, p - path); + memcpy (exe_path, path, (p - path) * sizeof (Wexttext)); w = exe_path + (p - path); } if (!IS_DIRECTORY_SEP (w[-1])) - { - *w++ = '/'; - } - strcpy (w, name); - -#undef access /* avoid !@#$%^& encapsulated access */ -#undef stat /* avoid !@#$%^& encapsulated stat */ + *w++ = '/'; + wext_strcpy (w, name); { struct stat statbuf; - if (access (exe_path, X_OK) == 0 - && stat (exe_path, &statbuf) == 0 + if (wext_access (exe_path, X_OK) == 0 + && wext_stat (exe_path, &statbuf) == 0 && ! S_ISDIR (statbuf.st_mode)) break; } @@ -1633,7 +1951,7 @@ if (!*p) { /* Oh well, let's have some kind of default */ - sprintf (exe_path, "./%s", name); + wext_sprintf (exe_path, "./%s", name); break; } path = p+1;
--- a/src/dumper.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/dumper.h Thu Nov 04 23:08:28 2004 +0000 @@ -20,6 +20,8 @@ /* Synched up with: Not in FSF. */ +/* This file has been Mule-ized, Ben Wing, 10-7-04. */ + #ifndef INCLUDED_dumper_h #define INCLUDED_dumper_h @@ -27,10 +29,10 @@ void pdump_objects_unmark (void); void pdump (void); -int pdump_load (const char *argv0); +int pdump_load (const Wexttext *argv0); void pdump_backtrace (void); extern unsigned int dump_id; -extern char *pdump_start, *pdump_end; +extern Rawbyte *pdump_start, *pdump_end; END_C_DECLS
--- a/src/dynarr.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/dynarr.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,6 +1,6 @@ /* Support for dynamic arrays. Copyright (C) 1993 Sun Microsystems, Inc. - Copyright (C) 2002, 2003 Ben Wing. + Copyright (C) 2002, 2003, 2004 Ben Wing. This file is part of XEmacs. @@ -45,10 +45,10 @@ This is a container object. Declare a dynamic array of a specific type as follows: -typedef struct -{ - Dynarr_declare (mytype); -} mytype_dynarr; + typedef struct + { + Dynarr_declare (mytype); + } mytype_dynarr; Use the following functions/macros: @@ -129,7 +129,7 @@ static int Dynarr_min_size = 8; static void -Dynarr_realloc (Dynarr *dy, int new_size) +Dynarr_realloc (Dynarr *dy, Bytecount new_size) { if (DUMPEDP (dy->base)) { @@ -151,7 +151,7 @@ } void -Dynarr_resize (void *d, int size) +Dynarr_resize (void *d, Elemcount size) { int newsize; double multiplier; @@ -271,3 +271,70 @@ } #endif /* MEMORY_USAGE_STATS */ + +/* Version of malloc() that will be extremely efficient when allocation + nearly always occurs in LIFO (stack) order. + + #### Perhaps shouldn't be in this file, but where else? */ + +typedef struct +{ + Dynarr_declare (char_dynarr *); +} char_dynarr_dynarr; + +char_dynarr_dynarr *stack_like_free_list; +char_dynarr_dynarr *stack_like_in_use_list; + +void * +stack_like_malloc (Bytecount size) +{ + char_dynarr *this_one; + if (!stack_like_free_list) + { + stack_like_free_list = Dynarr_new2 (char_dynarr_dynarr, + char_dynarr *); + stack_like_in_use_list = Dynarr_new2 (char_dynarr_dynarr, + char_dynarr *); + } + + if (Dynarr_length (stack_like_free_list) > 0) + this_one = Dynarr_pop (stack_like_free_list); + else + this_one = Dynarr_new (char); + Dynarr_add (stack_like_in_use_list, this_one); + Dynarr_resize (this_one, size); + return Dynarr_atp (this_one, 0); +} + +void +stack_like_free (void *val) +{ + int len = Dynarr_length (stack_like_in_use_list); + assert (len > 0); + /* The vast majority of times, we will be called in a last-in first-out + order, and the item at the end of the list will be the one we're + looking for, so just check for this first and avoid any function + calls. */ + if (Dynarr_atp (Dynarr_at (stack_like_in_use_list, len - 1), 0) == val) + { + char_dynarr *this_one = Dynarr_pop (stack_like_in_use_list); + Dynarr_add (stack_like_free_list, this_one); + } + else + { + /* Find the item and delete it. */ + int i; + assert (len >= 2); + for (i = len - 2; i >= 0; i--) + if (Dynarr_atp (Dynarr_at (stack_like_in_use_list, i), 0) == + val) + { + char_dynarr *this_one = Dynarr_at (stack_like_in_use_list, i); + Dynarr_add (stack_like_free_list, this_one); + Dynarr_delete (stack_like_in_use_list, i); + return; + } + + abort (); + } +}
--- a/src/editfns.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/editfns.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,7 +1,7 @@ /* Lisp functions pertaining to editing. Copyright (C) 1985-1987, 1989, 1992-1995 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems and INS Engineering Corp. - Copyright (C) 1996, 2001, 2002 Ben Wing. + Copyright (C) 1996, 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -851,8 +851,8 @@ (homepath = egetenv ("HOMEPATH")) != NULL) { cached_home_directory = - (Ibyte *) xmalloc (qxestrlen (homedrive) + - qxestrlen (homepath) + 1); + xnew_ibytes (qxestrlen (homedrive) + qxestrlen (homepath) + + ITEXT_ZTERM_SIZE); qxesprintf (cached_home_directory, "%s%s", homedrive, homepath); @@ -1061,7 +1061,7 @@ while (1) { - Extbyte *buf = (Extbyte *) ALLOCA (size); + Extbyte *buf = alloca_extbytes (size); Extbyte *formext; *buf = 1; @@ -1339,8 +1339,8 @@ See Sun bugs 1113095 and 1114114, ``Timezone routines improperly modify environment''. */ -static Char_ASCII set_time_zone_rule_tz1[] = "TZ=GMT+0"; -static Char_ASCII set_time_zone_rule_tz2[] = "TZ=GMT+1"; +static Ascbyte set_time_zone_rule_tz1[] = "TZ=GMT+0"; +static Ascbyte set_time_zone_rule_tz2[] = "TZ=GMT+1"; #endif @@ -1579,7 +1579,7 @@ if (n <= 0) return Qnil; slen = min (n, (Bytecount) 768); - string = alloca_array (Ibyte, slen); + string = alloca_ibytes (slen); /* Write as many copies of the character into the temp string as will fit. */ for (i = 0; i + charlen <= slen; i += charlen) for (j = 0; j < charlen; j++)
--- a/src/elhash.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/elhash.c Thu Nov 04 23:08:28 2004 +0000 @@ -453,9 +453,9 @@ static const struct memory_description htentry_union_description_1[] = { /* Note: XD_INDIRECT in this table refers to the surrounding table, and so this will work. */ - { XD_STRUCT_PTR, HASH_TABLE_NON_WEAK, XD_INDIRECT (0, 1), + { XD_BLOCK_PTR, HASH_TABLE_NON_WEAK, XD_INDIRECT (0, 1), &htentry_description }, - { XD_STRUCT_PTR, 0, XD_INDIRECT (0, 1), &htentry_description, + { XD_BLOCK_PTR, 0, XD_INDIRECT (0, 1), &htentry_description, XD_FLAG_UNION_DEFAULT_ENTRY | XD_FLAG_NO_KKCC }, { XD_END } };
--- a/src/emacs.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/emacs.c Thu Nov 04 23:08:28 2004 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003, 2004 Ben Wing. This file is part of XEmacs. @@ -23,6 +23,8 @@ /* Synched up with: Mule 2.0, FSF 19.28. */ +/* This file has been Mule-ized, Ben Wing, 10-7-04. */ + /* Capsule summary of the various releases of Lucid Emacs/XEmacs and FSF/GNU Emacs. (Copied from the Internals Manual, where the canonical version lives.) Provided here for use in cross-referencing @@ -234,6 +236,139 @@ */ +/* Sources for further information: + +----------------------------------- +1. Using XEmacs, Programming Elisp: +----------------------------------- + +;;; -- the XEmacs User's Manual (Access using the online Info browser: +;;; Use `Help->Info (Online Docs)->XEmacs User's Manual' (if +;;; there is such an entry); or get to the Info contents page +;;; using `Help->Info Contents' or `C-h i', and then +;;; *middle-click* the XEmacs link or move the cursor into the +;;; link and hit ENTER. This manual contains a great deal of +;;; documentation on customization: Scroll down to the +;;; Customization link and select it in the same fashion as for +;;; the XEmacs link just mentioned.) + +;;; -- the XEmacs FAQ (`C-h F' for the local version; get either the +;;; local version or the very latest version off the net using +;;; the Help menu) + +;;; -- the XEmacs Lisp Reference Manual, containing detailed +;;; documentation on Elisp. (Access using Info, just like for the +;;; XEmacs User's Manual.) + +;;; -- the documentation strings for specific commands, functions, +;;; key sequences, and variables. NOTE: This is *not* the same +;;; information as in the XEmacs User's Manual or XEmacs Lisp +;;; Reference Manual! In general, the doc strings are more +;;; terse and more up-to-date than what is found in the manuals. +;;; Once you understand the general concepts, these doc strings +;;; should be your first point of reference for further +;;; info. (Access using menu entries under `Help->Commands, +;;; Variables, Keys' or using the keyboard: `C-h k' for a key +;;; sequence, `C-h f' for a named command or Elisp function, +;;; `C-h v' for a variable. There is various other useful +;;; information accessible similarly, such as `C-h a' +;;; ["Apropos", i.e. search for a command, function, or variable +;;; by name]; `C-h C-a' ["Apropos Docs", i.e. search through the +;;; text of the doc strings]; `C-h b' to list all key bindings; +;;; `C-h m' to describe the current major and minor modes; etc. +;;; Type `C-h ? ?' for a complete list.) + +;;; -- Getting Started with XEmacs [aka the "New User's Guide"], a +;;; more introductory manual than the XEmacs User's Manual. +;;; (Access using Info, just like for the XEmacs User's Manual. +;;; There are some sections on customization here.) + +;;; -- the XEmacs tutorial, a very simple introduction to XEmacs for +;;; total beginners. (`C-h t' for English; get the version in +;;; various languages from the Help menu) + +;;; -- the XEmacs web site, www.xemacs.org. + +;;; -- the XEmacs mailing lists (xemacs-FOO@xemacs.org; +;;; see http://www.xemacs.org/Lists/ for more info. Before +;;; posting, consider looking through the archives -- they go back +;;; years and there is a powerful searching interface. Currently +;;; the archives are at http://list-archive.xemacs.org/, but if +;;; this doesn't work, you can always access them through +;;; www.xemacs.org.) + +;;; -- the XEmacs newsgroup, comp.emacs.xemacs. This is +;;; bi-directionally gatewayed with xemacs@xemacs.org. WARNING: +;;; The developers do not normally hang out on this newsgroup. If +;;; you need to contact them, use xemacs-beta@xemacs.org. + +;;; -- the XEmacs internals manual, for those interested in working on +;;; the XEmacs C code. (Available through Info.) + +;;; -- `Help->About XEmacs' to find out who the maintainers are. + +--------------------- +2. Developing XEmacs: +--------------------- + +-- the internals manual, man/internals/internals.texi + +-- long comments at the head of certain files: + + emacs.c + extents.c + text.c + text.h + lisp.h + redisplay.h + dynarr.c + blocktype.c + eval.c + event-Xt.c (sort of) + event-stream.c (command event queue) + frame.c + intl-encap-win32.c + keymap.c + line-number.c (a little bit) + menubar-msw.c (sort of) + menubar-x.c (sort of) + mule-canna.c (sort of) + mule-ccl.c + mule-coding.c (scattered in the file) + mule-wnn.c (in japanese) + ntheap.c (near the top) + redisplay.c (various scattered) + regex.c (various scattered) + sysdep.c (maybe; wait_for_termination) + unexec.c + unicode.c + xgccache.c (a bit) + + #### review .h files; write a perl program to look for long comments + throughout the files, ignoring stuff inside of DEFUN's. + + #### elsewhere? + +-- comments scattered throughout the sources (#### should be grouped + together if feasible). For example, lrecord.h (pdump and object- + creation), alloc.c (fixed-type allocation), etc. #### fill in. + +-- Ben's Architecting XEmacs web site. + (http://www.xemacs.org/Architecting-XEmacs/index.html; #### should be + integrated into the sources) + +-- Back discussions on xemacs-beta (#### The juiciest tidbits, esp. + those with specific proposals, should be extracted and stuck in + the source) + +-- README.* in the src/ directory (and maybe other directories) + +-- The ChangeLog files, sometimes. + +*/ + + + /* Note: It is necessary to specify <config.h> and not "config.h" in order for the --srcdir type of compilation to work properly. Otherwise the config.h from the srcdir, rather than the one from @@ -383,7 +518,7 @@ /* Type of display specified. We cannot use a Lisp symbol here because Lisp symbols may not initialized at the time that we set this variable. */ -const Char_ASCII *display_use; +const Ascbyte *display_use; /* If non-zero, then the early error handler will only print the error message and exit. */ @@ -391,7 +526,7 @@ /* An address near the bottom of the stack. Tells GC how to save a copy of the stack. */ -char *stack_bottom; +Rawbyte *stack_bottom; #ifdef USG_SHARED_LIBRARIES /* If nonzero, this is the place to put the end of the writable segment @@ -462,10 +597,10 @@ int debug_paths; /* Save argv and argc. */ -static Extbyte **initial_argv; /* #### currently unused */ +static Wexttext **initial_argv; /* #### currently unused */ static int initial_argc; /* #### currently unused */ -static void sort_args (int argc, char **argv); +static void sort_args (int argc, Wexttext **argv); Lisp_Object Qkill_emacs_hook; Lisp_Object Qsave_buffers_kill_emacs; @@ -480,16 +615,14 @@ int preparing_for_armageddon; /* Nonzero means we're in an unstable situation and need to skip - i18n conversions and such during printing. */ -int inhibit_non_essential_printing_operations; + i18n conversions and such. During printing we check for this, + and during conversion we abort if we see this. */ +int inhibit_non_essential_conversion_operations; static JMP_BUF run_temacs_catch; static int run_temacs_argc; -static Extbyte **run_temacs_argv; -static Extbyte *run_temacs_args; -static int run_temacs_argv_size; -static int run_temacs_args_size; +static Wexttext **run_temacs_argv; #ifdef _MSC_VER static DWORD mswindows_handle_hardware_exceptions (DWORD code); @@ -507,7 +640,7 @@ /* Code for dealing with Lisp access to the Unix command line */ static Lisp_Object -make_arg_list_1 (int argc, Extbyte **argv, int skip_args) +make_arg_list_1 (int argc, Wexttext **argv, int skip_args) { Lisp_Object result = Qnil; REGISTER int i; @@ -531,8 +664,8 @@ } else #endif - result = Fcons (build_ext_string (argv[i], - Qcommand_argument_encoding), + result = Fcons (build_wext_string (argv[i], + Qcommand_argument_encoding), result); } } @@ -540,7 +673,7 @@ } Lisp_Object -make_arg_list (int argc, Extbyte **argv) +make_arg_list (int argc, Wexttext **argv) { return make_arg_list_1 (argc, argv, 0); } @@ -548,40 +681,39 @@ /* Calling functions are also responsible for calling free_argc_argv when they are done with the generated list. */ void -make_argc_argv (Lisp_Object argv_list, int *argc, Extbyte ***argv) +make_argc_argv (Lisp_Object argv_list, int *argc, Wexttext ***argv) { Lisp_Object next; int n = XINT (Flength (argv_list)); REGISTER int i; - *argv = (Extbyte**) xmalloc ((n+1) * sizeof (Extbyte*)); + *argv = xnew_array (Wexttext *, n + 1); for (i = 0, next = argv_list; i < n; i++, next = XCDR (next)) { - const Extbyte *temp; CHECK_STRING (XCAR (next)); - LISP_STRING_TO_EXTERNAL (XCAR (next), temp, Qcommand_argument_encoding); - (*argv) [i] = xstrdup (temp); + LISP_STRING_TO_EXTERNAL_MALLOC (XCAR (next), (*argv) [i], + Qcommand_argument_encoding); } (*argv) [n] = 0; *argc = i; } void -free_argc_argv (Extbyte **argv) +free_argc_argv (Wexttext **argv) { int elt = 0; while (argv[elt]) { - xfree (argv[elt], Extbyte *); + xfree (argv[elt], Wexttext *); elt++; } - xfree (argv, Extbyte **); + xfree (argv, Wexttext **); } static void -init_cmdargs (int argc, Extbyte **argv, int skip_args) +init_cmdargs (int argc, Wexttext **argv, int skip_args) { initial_argv = argv; initial_argc = argc; @@ -619,12 +751,12 @@ enough information to do it right. */ static int -argmatch (char **argv, int argc, char *sstr, char *lstr, - int minlen, char **valptr, int *skipptr) +argmatch (Wexttext **argv, int argc, Ascbyte *sstr, Ascbyte *lstr, + int minlen, Wexttext **valptr, int *skipptr) { - char *p = NULL; - int arglen; - char *arg; + Wexttext *p = NULL; + Charcount arglen; + Wexttext *arg; /* Don't access argv[argc]; give up in advance. */ if (argc <= *skipptr + 1) @@ -633,7 +765,7 @@ arg = argv[*skipptr+1]; if (arg == NULL) return 0; - if (strcmp (arg, sstr) == 0) + if (wext_strcmp_ascii (arg, sstr) == 0) { if (valptr != NULL) { @@ -644,11 +776,12 @@ *skipptr += 1; return 1; } - arglen = (valptr != NULL && (p = strchr (arg, '=')) != NULL - ? p - arg : (int) strlen (arg)); + arglen = (valptr != NULL && (p = wext_strchr (arg, '=')) != NULL + ? p - arg : (Charcount) wext_strlen (arg)); if (lstr && !minlen) minlen = strlen (lstr); - if (lstr == 0 || arglen < minlen || strncmp (arg, lstr, arglen) != 0) + if (lstr == 0 || arglen < minlen || + wext_strncmp_ascii (arg, lstr, arglen) != 0) return 0; else if (valptr == NULL) { @@ -657,13 +790,13 @@ } else if (p != NULL) { - *valptr = p+1; + *valptr = p + 1; *skipptr += 1; return 1; } - else if (argv[*skipptr+2] != NULL) + else if (argv[*skipptr + 2] != NULL) { - *valptr = argv[*skipptr+2]; + *valptr = argv[*skipptr + 2]; *skipptr += 2; return 1; } @@ -674,7 +807,7 @@ } static void -check_compatible_window_system (char *must) +check_compatible_window_system (Ascbyte *must) { if (display_use && strcmp (display_use, must)) fatal ("Incompatible window system type `%s': `%s' already specified", @@ -700,33 +833,17 @@ the conventional dumper or `xemacs -nd' with the pdumper). See Frun_emacs_from_temacs(). */ -DECLARE_DOESNT_RETURN (main_1 (int, Extbyte **, Extbyte **, int)); +DECLARE_DOESNT_RETURN (main_1 (int, Wexttext **, Wexttext **, int)); DOESNT_RETURN -main_1 (int argc, Extbyte **argv, -#if defined (WIN32_NATIVE) || defined (_SCO_DS) - Extbyte **envp, -#else - Extbyte **UNUSED (envp), -#endif - int restart) +main_1 (int argc, Wexttext **argv, Wexttext **UNUSED (envp), int restart) { - char stack_bottom_variable; + Rawbyte stack_bottom_variable; int skip_args = 0; Lisp_Object load_me; #ifdef NeXT extern int malloc_cookie; #endif - /* !!#### Under MS Windows, this should all be rewritten to deal with - Unicode arguments and environment. We need to retrieve the command - line with GetCommandLine and convert to argv format with - CommandLineToArgvW. Unfortunately we have a bootstrapping problem - currently because we can't initialize the Unicode tables until we've - computed the location of data-directory, which doesn't happen till - startup.el, which is way late. We need to be dumping the Unicode - data, which means we need to fix pdump to correctly dump the "union" - format used by the tables. */ - #if (!defined (SYSTEM_MALLOC) && !defined (HAVE_LIBMCHECK) \ && !defined (DOUG_LEA_MALLOC)) /* Make sure that any libraries we link against haven't installed a @@ -740,7 +857,7 @@ noninteractive = 0; display_use = 0; - inhibit_non_essential_printing_operations = 1; + inhibit_non_essential_conversion_operations = 1; #ifdef NeXT /* 19-Jun-1995 -baw @@ -770,7 +887,9 @@ sort_args (argc, argv); -#if defined (WIN32_NATIVE) || defined (_SCO_DS) +#if 0 /* defined (_SCO_DS) + #### Turn this off, we already have another SCO_DS hack in main(). + */ environ = envp; #endif @@ -834,8 +953,8 @@ alignment and max size of the inline data and quit */ if (argmatch (argv, argc, "-si", "--show-inline-info", 0, NULL, &skip_args)) { -#if defined(PDUMP) && !defined(WIN32_NATIVE) - printf ("%u %u\n", dumped_data_max_size(), dumped_data_align_offset()); +#if defined (PDUMP) && !defined (WIN32_NATIVE) + printf ("%u %u\n", dumped_data_max_size (), dumped_data_align_offset ()); #else printf ("Portable dumper not configured or windows native; -si just forces exit.\n"); #endif @@ -869,11 +988,11 @@ makes (e.g.) the "Stop Build" command from VC++ correctly terminate XEmacs. */ - char *heventstr; + Wexttext *heventstr; if (argmatch (argv, argc, "-mswindows-termination-handle", 0, 0, &heventstr, &skip_args)) { - HANDLE hevent = (HANDLE) atol (heventstr); + HANDLE hevent = (HANDLE) wext_atol (heventstr); DWORD unused; HANDLE h_thread = CreateThread (NULL, 0, wait_for_termination_signal, (void *) hevent, 0, &unused); @@ -982,9 +1101,11 @@ /* Handle the -t switch, which specifies filename to use as terminal */ { - Extbyte *term; + Wexttext *term; if (argmatch (argv, argc, "-t", "--terminal", 0, &term, &skip_args)) { + int fd; + check_compatible_window_system ("tty"); #ifndef HAVE_TTY fatal ("Sorry, this XEmacs was not compiled with TTY support"); @@ -992,16 +1113,20 @@ retry_close (0); retry_close (1); - if (open (term, O_RDWR | OPEN_BINARY, 2) < 0) - fatal ("%s: %s", term, strerror (errno)); + + fd = wext_retry_open (term, O_RDWR | OPEN_BINARY, 2); + /* Conversions are not possible yet, and printing will be in + external format, so strerror() and ttyname() are OK. */ + if (fd < 0) + fatal ("%s: %s", WEXTTEXT_TO_8_BIT (term), strerror (errno)); dup (0); if (! isatty (0)) - fatal ("%s: not a tty", term); + fatal ("%s: not a tty", WEXTTEXT_TO_8_BIT (term)); #if 0 stderr_out ("Using %s", ttyname (0)); #endif - stderr_out ("Using %s", term); + stderr_out ("Using %s", WEXTTEXT_TO_8_BIT (term)); } } @@ -1011,7 +1136,7 @@ to run until we've recognized this argument. */ { #ifdef HAVE_X_WINDOWS - char *dpy = 0; + Wexttext *dpy = 0; int count_before = skip_args; if (argmatch (argv, argc, "-d", "--display", 3, &dpy, &skip_args) || @@ -1025,12 +1150,12 @@ This requires inserting a new element into argv. */ if (dpy != 0 && skip_args - count_before == 1) { - char **new = (char **) xmalloc (sizeof (char *) * (argc + 2)); + Wexttext **new = xnew_array (Wexttext *, argc + 2); int j; for (j = 0; j < count_before + 1; j++) new[j] = argv[j]; - new[count_before + 1] = "-d"; + new[count_before + 1] = WEXTSTRING ("-d"); new[count_before + 2] = dpy; for (j = count_before + 2; j <argc; j++) new[j + 1] = argv[j]; @@ -1040,7 +1165,7 @@ /* Change --display to -d, when its arg is separate. */ else if (dpy != 0 && skip_args > count_before && argv[count_before + 1][1] == '-') - argv[count_before + 1] = "-d"; + argv[count_before + 1] = WEXTSTRING ("-d"); /* Don't actually discard this arg. */ skip_args = count_before; @@ -1053,11 +1178,11 @@ #if defined (HAVE_X_WINDOWS) || defined (HAVE_GTK) if (!display_use) { - char *dpy; + Wexttext *dpy; /* If there is a non-empty environment var DISPLAY, assume X or GTK, but don't set `display_arg', which is only to be set if the display was specified on the command line. */ - if ((dpy = getenv ("DISPLAY")) && dpy[0]) + if ((dpy = wext_getenv (WEXTSTRING ("DISPLAY"))) && dpy[0]) #ifdef HAVE_X_WINDOWS /* #### Who gets precedence? X or GTK? For the moment, GTK support is unstable so use X. Maybe eventually we will switch this. */ @@ -1126,11 +1251,8 @@ As early as possible, of course, so we can be fairly accurate. */ -#ifdef WIN32_ANY - init_win32_very_early (); -#endif #ifdef HAVE_MS_WINDOWS - /* Depends on XEUNICODE_P, only accurate after the previous call */ + /* Depends on XEUNICODE_P */ init_mswindows_dde_very_early (); /* DDE needs to be initialized early so that the client doesn't give up waiting. */ @@ -1201,7 +1323,7 @@ else purify_flag = 1; } -#else +#else /* not PDUMP */ if (!initialized) purify_flag = 1; #endif @@ -1626,22 +1748,6 @@ coding_system_type_create_mule_coding (); #endif - /* Now initialize the structure types and associated symbols. - Other than the first function below, the functions may - make exactly the following function/macro calls: - - define_structure_type() - define_structure_type_keyword() - - */ - - structure_type_create (); - - structure_type_create_chartab (); - structure_type_create_faces (); - structure_type_create_rangetab (); - structure_type_create_hash_table (); - /* Now initialize the image instantiator formats and associated symbols. Other than the first function below, the functions may make exactly the following function/macro calls: @@ -1668,6 +1774,71 @@ #ifdef HAVE_GTK image_instantiator_format_create_glyphs_gtk (); #endif + } +#ifdef PDUMP + else if (!restart) /* after successful pdump_load() + (note, we are inside ifdef PDUMP) */ + { + reinit_alloc_early (); + reinit_symbols_early (); + reinit_opaque_early (); + reinit_eistring_early (); + + reinit_console_type_create_stream (); +#ifdef HAVE_TTY + reinit_console_type_create_tty (); +#endif +#ifdef HAVE_X_WINDOWS + reinit_console_type_create_x (); + reinit_console_type_create_device_x (); +#endif +#ifdef HAVE_MS_WINDOWS + reinit_console_type_create_mswindows (); +#endif +#ifdef HAVE_GTK + reinit_console_type_create_gtk (); +#endif + + reinit_specifier_type_create (); + reinit_specifier_type_create_image (); + reinit_specifier_type_create_gutter (); + reinit_specifier_type_create_objects (); +#ifdef HAVE_TOOLBARS + reinit_specifier_type_create_toolbar (); +#endif + + reinit_coding_system_type_create (); + reinit_coding_system_type_create_unicode (); +#ifdef WIN32_ANY + reinit_coding_system_type_create_intl_win32 (); +#endif +#ifdef MULE + reinit_coding_system_type_create_mule_coding (); +#endif + } +#endif /* PDUMP */ + + if (!initialized +#ifdef PDUMP + || !restart +#endif + ) + { + /* Now initialize the structure types and associated symbols. + Other than the first function below, the functions may + make exactly the following function/macro calls: + + define_structure_type() + define_structure_type_keyword() + + */ + + structure_type_create (); + + structure_type_create_chartab (); + structure_type_create_faces (); + structure_type_create_rangetab (); + structure_type_create_hash_table (); /* Now initialize the lstream types and associated symbols. Other than the first function below, the functions may @@ -1694,7 +1865,10 @@ #ifdef HAVE_WIN32_PROCESSES process_type_create_nt (); #endif - + } + + if (!initialized) + { /* Now initialize most variables. These functions may do exactly the following: @@ -1744,6 +1918,8 @@ variables settable from the command line. See the comment above the call to pdump_load() in main_1(). This caveat should only apply to vars_of_emacs(). + + Order should not matter in these functions. */ /* Now allow Fprovide() statements to be made. */ @@ -1779,7 +1955,6 @@ vars_of_editfns (); vars_of_emacs (); vars_of_eval (); - init_eval_semi_early (); #ifdef HAVE_X_WINDOWS vars_of_event_Xt (); @@ -1986,7 +2161,86 @@ #ifdef HAVE_GPM vars_of_gpmevent (); #endif - + } + + if (!initialized +#ifdef PDUMP + || !restart +#endif + ) + { + /* Now do additional vars_of_*() initialization that happens both + at dump time and after pdump load. */ + reinit_vars_of_buffer (); + reinit_vars_of_console (); +#ifdef DEBUG_XEMACS + reinit_vars_of_debug (); +#endif + reinit_vars_of_device (); + reinit_vars_of_eval (); +#if defined (HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS)) + reinit_vars_of_event_tty (); +#endif + reinit_vars_of_event_stream (); + reinit_vars_of_events (); + reinit_vars_of_extents (); + reinit_vars_of_file_coding (); + reinit_vars_of_fileio (); +#ifdef USE_C_FONT_LOCK + reinit_vars_of_font_lock (); +#endif /* USE_C_FONT_LOCK */ + reinit_vars_of_glyphs (); + reinit_vars_of_glyphs_widget (); + reinit_vars_of_insdel (); + reinit_vars_of_lread (); + reinit_vars_of_lstream (); + reinit_vars_of_minibuf (); +#ifdef HAVE_SHLIB + reinit_vars_of_module (); +#endif + reinit_vars_of_objects (); + reinit_vars_of_print (); + reinit_vars_of_search (); + reinit_vars_of_text (); + reinit_vars_of_undo (); + reinit_vars_of_window (); + +#ifdef HAVE_MS_WINDOWS + reinit_vars_of_event_mswindows (); + reinit_vars_of_frame_mswindows (); + reinit_vars_of_object_mswindows (); +#endif + +#ifdef HAVE_GTK + reinit_vars_of_event_gtk (); + reinit_vars_of_menubar_gtk (); +#endif + +#ifdef HAVE_X_WINDOWS + reinit_vars_of_device_x (); + reinit_vars_of_event_Xt (); +#ifdef HAVE_SCROLLBARS + reinit_vars_of_scrollbar_x (); +#endif +#ifdef HAVE_MENUBARS + reinit_vars_of_menubar_x (); +#endif + reinit_vars_of_select_x (); +#if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_X_DIALOGS) || defined (HAVE_TOOLBARS) + reinit_vars_of_gui_x (); +#endif +#endif /* HAVE_X_WINDOWS */ + +#ifdef MULE + reinit_vars_of_mule_coding (); +#endif +#if defined (MULE) && defined (HAVE_WNN) + reinit_vars_of_mule_wnn (); +#endif + } + + if (!initialized) + { /* Now initialize any specifier variables. We do this later because it has some dependence on the vars initialized above. @@ -2035,6 +2289,13 @@ complex_vars_of_intl_win32 (); #endif + /* At this point we should be able to do conversion operations. + We have initialized things to the point that we can create Lisp + objects and we have defined the basic coding systems (in the + just-previous complex-vars calls). We will in fact do conversion + quite soon, e.g. in complex_vars_of_glyphs_x(). */ + inhibit_non_essential_conversion_operations = 0; + /* Depends on specifiers. */ complex_vars_of_faces (); @@ -2116,158 +2377,40 @@ } #endif } + else + { + /* We are at the equivalent place where we reset this in the + non-initialized case. */ + inhibit_non_essential_conversion_operations = 0; #ifdef PDUMP - if (initialized && !restart) /* after successful pdump_load() - (note, we are inside ifdef PDUMP) */ - { - reinit_alloc_early (); - reinit_symbols_early (); - reinit_opaque_early (); - reinit_eistring_early (); - - reinit_console_type_create_stream (); -#ifdef HAVE_TTY - reinit_console_type_create_tty (); -#endif -#ifdef HAVE_X_WINDOWS - reinit_console_type_create_x (); - reinit_console_type_create_device_x (); -#endif -#ifdef HAVE_MS_WINDOWS - reinit_console_type_create_mswindows (); -#endif -#ifdef HAVE_GTK - reinit_console_type_create_gtk (); -#endif - - reinit_specifier_type_create (); - reinit_specifier_type_create_image (); - reinit_specifier_type_create_gutter (); - reinit_specifier_type_create_objects (); -#ifdef HAVE_TOOLBARS - reinit_specifier_type_create_toolbar (); -#endif - - structure_type_create (); - - reinit_coding_system_type_create (); - reinit_coding_system_type_create_unicode (); -#ifdef WIN32_ANY - reinit_coding_system_type_create_intl_win32 (); -#endif -#ifdef MULE - reinit_coding_system_type_create_mule_coding (); -#endif - - structure_type_create_chartab (); - structure_type_create_faces (); - structure_type_create_rangetab (); - structure_type_create_hash_table (); - - lstream_type_create (); - lstream_type_create_file_coding (); -#if defined (HAVE_MS_WINDOWS) && !defined (HAVE_MSG_SELECT) - lstream_type_create_mswindows_selectable (); -#endif -#ifdef HAVE_UNIX_PROCESSES - process_type_create_unix (); -#endif -#ifdef HAVE_WIN32_PROCESSES - process_type_create_nt (); -#endif - - reinit_vars_of_buffer (); - reinit_vars_of_console (); -#ifdef DEBUG_XEMACS - reinit_vars_of_debug (); -#endif - reinit_vars_of_device (); - reinit_vars_of_eval (); -#if defined (HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS)) - reinit_vars_of_event_tty (); -#endif - reinit_vars_of_event_stream (); - reinit_vars_of_events (); - reinit_vars_of_extents (); - reinit_vars_of_file_coding (); - reinit_vars_of_fileio (); -#ifdef USE_C_FONT_LOCK - reinit_vars_of_font_lock (); -#endif /* USE_C_FONT_LOCK */ - reinit_vars_of_glyphs (); - reinit_vars_of_glyphs_widget (); - reinit_vars_of_insdel (); - reinit_vars_of_lread (); - reinit_vars_of_lstream (); - reinit_vars_of_minibuf (); -#ifdef HAVE_SHLIB - reinit_vars_of_module (); -#endif - reinit_vars_of_objects (); - reinit_vars_of_print (); - reinit_vars_of_search (); - reinit_vars_of_text (); - reinit_vars_of_undo (); - reinit_vars_of_unicode (); - reinit_vars_of_window (); - -#ifdef HAVE_MS_WINDOWS - reinit_vars_of_event_mswindows (); - reinit_vars_of_frame_mswindows (); - reinit_vars_of_object_mswindows (); -#endif - -#ifdef HAVE_GTK - reinit_vars_of_event_gtk (); - reinit_vars_of_menubar_gtk (); -#endif - -#ifdef HAVE_X_WINDOWS - reinit_vars_of_device_x (); - reinit_vars_of_event_Xt (); -#ifdef HAVE_SCROLLBARS - reinit_vars_of_scrollbar_x (); -#endif -#ifdef HAVE_MENUBARS - reinit_vars_of_menubar_x (); -#endif - reinit_vars_of_select_x (); -#if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_X_DIALOGS) || defined (HAVE_TOOLBARS) - reinit_vars_of_gui_x (); -#endif -#endif /* HAVE_X_WINDOWS */ - -#ifdef MULE - reinit_vars_of_mule_coding (); -#endif -#if defined (MULE) && defined (HAVE_WNN) - reinit_vars_of_mule_wnn (); -#endif - - reinit_complex_vars_of_buffer_runtime_only (); - reinit_complex_vars_of_console_runtime_only (); - reinit_complex_vars_of_minibuf (); + if (!restart) /* after successful pdump_load() + (note, we are inside ifdef PDUMP) */ + { + reinit_complex_vars_of_buffer_runtime_only (); + reinit_complex_vars_of_console_runtime_only (); + reinit_complex_vars_of_minibuf (); + } +#endif /* PDUMP */ } -#endif /* PDUMP */ + + if (initialized) + init_eval_semi_early (); /* CONGRATULATIONS!!! We have successfully initialized the Lisp engine. */ - if (initialized) - init_eval_semi_early (); - -#ifdef MULE - init_mule_charset (); -#endif - /* Now do further initialization/setup of stuff that is not needed by the syms_of_() routines. This involves stuff that only is enabled in an interactive run (redisplay, user input, etc.) and stuff that is not needed until we start loading Lisp code (the reader). A lot of this stuff involves querying the current environment and needs to be done both at dump time and at run time. Some will be done - only at run time, by querying the `initialized' variable. */ + only at run time, by querying the `initialized' variable. + + The ordering of these functions is critical, especially the early ones, + where there is typically a dependency from each to the previous. + */ #ifdef WIN32_ANY init_intl_win32 (); /* Under Windows, determine whether we use Unicode @@ -2310,8 +2453,7 @@ #endif init_lread (); /* Set up the Lisp reader. */ - init_cmdargs (argc, (Extbyte **) argv, - skip_args); /* Create list Vcommand_line_args */ + init_cmdargs (argc, argv, skip_args); /* Create list Vcommand_line_args */ init_buffer_2 (); /* Set default directory of *scratch* buffer */ #ifdef WIN32_NATIVE @@ -2390,9 +2532,10 @@ if (!initialized) { /* Handle -l loadup-and-dump, args passed by Makefile. */ - if (argc > 2 + skip_args && !strcmp (argv[1 + skip_args], "-l")) - /* !!#### need to be Mule-translating this, but later */ - load_me = build_string (argv[2 + skip_args]); + if (argc > 2 + skip_args && + !wext_strcmp_ascii (argv[1 + skip_args], "-l")) + load_me = build_wext_string (argv[2 + skip_args], + Qcommand_argument_encoding); } #ifdef QUANTIFY @@ -2401,7 +2544,6 @@ #endif /* QUANTIFY */ initialized = 1; - inhibit_non_essential_printing_operations = 0; /* This never returns. */ initial_command_loop (load_me); @@ -2416,8 +2558,8 @@ struct standard_args { - const char *name; - const char *longname; + const Ascbyte *name; + const Ascbyte *longname; int priority; int nargs; }; @@ -2512,9 +2654,9 @@ If an option takes an argument, keep it and its argument together. */ static void -sort_args (int argc, char **argv) +sort_args (int argc, Wexttext **argv) { - char **new_argv = xnew_array (char *, argc); + Wexttext **new_argv = xnew_array (Wexttext *, argc); /* For each element of argv, the corresponding element of options is: 0 for an option that takes no arguments, @@ -2534,22 +2676,24 @@ options[from] = -1; priority[from] = 0; /* Pseudo options "--" and "run-temacs" indicate end of options */ - if (!strcmp (argv[from], "--") || - !strcmp (argv[from], "run-temacs")) + if (!wext_strcmp_ascii (argv[from], "--") || + !wext_strcmp_ascii (argv[from], "run-temacs")) end_of_options_p = 1; if (!end_of_options_p && argv[from][0] == '-') { - int match, thislen; - char *equals; + int match; + Charcount thislen; + Wexttext *equals; /* Look for a match with a known old-fashioned option. */ for (i = 0; i < countof (standard_args); i++) - if (!strcmp (argv[from], standard_args[i].name)) + if (!wext_strcmp_ascii (argv[from], standard_args[i].name)) { options[from] = standard_args[i].nargs; priority[from] = standard_args[i].priority; if (from + standard_args[i].nargs >= argc) - fatal ("Option `%s' requires an argument\n", argv[from]); + fatal ("Option `%s' requires an argument\n", + WEXTTEXT_TO_8_BIT (argv[from])); from += standard_args[i].nargs; goto done; } @@ -2560,15 +2704,16 @@ if (argv[from][1] == '-') { match = -1; - thislen = strlen (argv[from]); - equals = strchr (argv[from], '='); + thislen = wext_strlen (argv[from]); + equals = wext_strchr (argv[from], '='); if (equals != 0) thislen = equals - argv[from]; for (i = 0; i < countof (standard_args); i++) if (standard_args[i].longname - && !strncmp (argv[from], standard_args[i].longname, - thislen)) + && !wext_strncmp_ascii (argv[from], + standard_args[i].longname, + thislen)) { if (match == -1) match = i; @@ -2586,7 +2731,8 @@ if (equals != 0) options[from] = 0; if (from + options[from] >= argc) - fatal ("Option `%s' requires an argument\n", argv[from]); + fatal ("Option `%s' requires an argument\n", + WEXTTEXT_TO_8_BIT (argv[from])); from += options[from]; } } @@ -2630,8 +2776,8 @@ argv[best + i + 1] = 0; } - memcpy (argv, new_argv, sizeof (char *) * argc); - xfree (new_argv, char **); + memcpy (argv, new_argv, sizeof (Wexttext *) * argc); + xfree (new_argv, Wexttext **); xfree (options, int *); xfree (priority, int *); } @@ -2704,54 +2850,32 @@ tools like Purify or tcov that get confused by XEmacs' dumping. */ (int nargs, Lisp_Object *args)) { - int ac; - const Extbyte *wampum; - int namesize; - int total_len; - Lisp_Object orig_invoc_name = Fcar (Vcommand_line_args); - const Extbyte **wampum_all = alloca_array (const Extbyte *, nargs); - int *wampum_all_len = alloca_array (int, nargs); + int i; assert (!gc_in_progress); if (run_temacs_argc < 0) - invalid_operation ("I've lost my temacs-hood.", Qunbound); - - /* Need to convert the orig_invoc_name and all of the arguments - to external format. */ - - TO_EXTERNAL_FORMAT (LISP_STRING, orig_invoc_name, - ALLOCA, (wampum, namesize), - Qnative); - namesize++; - - for (ac = 0, total_len = namesize; ac < nargs; ac++) + invalid_operation ("I've lost my temacs-hood", Qunbound); + + run_temacs_argc = nargs + 1; + run_temacs_argv = xnew_array (Wexttext *, nargs + 2); + + LISP_STRING_TO_EXTERNAL_MALLOC (Fcar (Vcommand_line_args), + run_temacs_argv[0], + Qcommand_argument_encoding); + for (i = 0; i < nargs; i++) { - CHECK_STRING (args[ac]); - TO_EXTERNAL_FORMAT (LISP_STRING, args[ac], - ALLOCA, (wampum_all[ac], wampum_all_len[ac]), - Qnative); - wampum_all_len[ac]++; - total_len += wampum_all_len[ac]; + CHECK_STRING (args[i]); + + LISP_STRING_TO_EXTERNAL_MALLOC (args[i], run_temacs_argv[i + 1], + Qcommand_argument_encoding); } - DO_REALLOC (run_temacs_args, run_temacs_args_size, total_len, char); - DO_REALLOC (run_temacs_argv, run_temacs_argv_size, nargs+2, char *); - - memcpy (run_temacs_args, wampum, namesize); - run_temacs_argv [0] = run_temacs_args; - for (ac = 0; ac < nargs; ac++) - { - memcpy (run_temacs_args + namesize, - wampum_all[ac], wampum_all_len[ac]); - run_temacs_argv [ac + 1] = run_temacs_args + namesize; - namesize += wampum_all_len[ac]; - } - run_temacs_argv [nargs + 1] = 0; + run_temacs_argv[nargs + 1] = 0; + catchlist = NULL; /* Important! Otherwise free_cons() calls in condition_case_unwind() may lead to GC death. */ unbind_to (0); /* this closes loadup.el */ purify_flag = 0; - run_temacs_argc = nargs + 1; #if defined (HEAP_IN_DATA) && !defined (PDUMP) report_sheap_usage (0); #endif @@ -2767,7 +2891,7 @@ /* ARGSUSED */ int -main (int argc, char **argv, char **envp) +main (int argc, Extbyte **argv, Extbyte **UNUSED (envp)) { #ifdef _MSC_VER @@ -2780,8 +2904,7 @@ #endif int volatile vol_argc = argc; - char ** volatile vol_argv = argv; - char ** volatile vol_envp = envp; + Wexttext ** volatile vol_argv; /* This is hairy. We need to compute where the XEmacs binary was invoked from because temacs initialization requires it to find the lisp directories. The code that recomputes the path is guarded by the @@ -2815,7 +2938,7 @@ quantify_clear_data (); #endif /* QUANTIFY */ - inhibit_non_essential_printing_operations = 1; + inhibit_non_essential_conversion_operations = 1; suppress_early_error_handler_backtrace = 0; lim_data = 0; /* force reinitialization of this variable */ @@ -2826,6 +2949,35 @@ sbrk (1); #endif +#ifdef WIN32_ANY + /* Figure out which version we're running so XEUNICODE_P works */ + init_win32_very_very_early (); +#endif + +#ifdef WIN32_NATIVE +#if 0 + /* !!#### We should be doing something like this, but this messes up + globbing. I tried using wmain() and linking with WSETARGV, but the + routines for WSETARGV are left out of MSVCRT.DLL! + + To fix this we need to copy the argument-expanding and globbing code + from Cygwin and Unicode-ize it. Yuck. */ + if (XEUNICODE_P) + /* Set up Unicode versions of the arguments. */ + vol_argv = CommandLineToArgvW (GetCommandLineW (), &vol_argc); +#else + { + int i; + + vol_argv = alloca_array (Wexttext *, argc); + for (i = 0; i < argc; i++) + vol_argv[i] = MULTIBYTE_TO_WEXTTEXT (argv[i]); + } +#endif +#else + vol_argv = (Wexttext **) argv; +#endif /* WIN32_NATIVE */ + if (!initialized) { #ifdef DOUG_LEA_MALLOC @@ -2834,7 +2986,7 @@ run_temacs_argc = 0; if (! SETJMP (run_temacs_catch)) { - main_1 (vol_argc, vol_argv, vol_envp, 0); + main_1 (vol_argc, vol_argv, NULL, 0); } /* run-emacs-from-temacs called */ restarted = 1; @@ -2855,12 +3007,11 @@ 06/20/96 robertl@dgii.com */ { - extern char **_environ; - if ((unsigned) environ == 0) + extern Extbyte *_environ; + if (environ == NULL) environ = _environ; } #endif /* _SCO_DS */ - vol_envp = environ; } #if defined (RUN_TIME_REMAP) && ! defined (PDUMP) else @@ -2896,7 +3047,7 @@ run_temacs_argc = -2; - main_1 (vol_argc, vol_argv, vol_envp, restarted); + main_1 (vol_argc, vol_argv, NULL, restarted); #ifdef _MSC_VER } @@ -2914,7 +3065,7 @@ /************************************************************************/ #if !defined (PDUMP) || !defined (SYSTEM_MALLOC) -extern Char_Binary my_edata[]; +extern Rawbyte my_edata[]; #endif extern void disable_free_hook (void); @@ -3022,53 +3173,11 @@ /* exiting XEmacs (intended or not) */ /************************************************************************/ -/* Ben's capsule summary about expected and unexpected exits from XEmacs. - - Expected exits occur when the user directs XEmacs to exit, for example - by pressing the close button on the only frame in XEmacs, or by typing - C-x C-c. This runs `save-buffers-kill-emacs', which saves any necessary - buffers, and then exits using the primitive `kill-emacs'. - - However, unexpected exits occur in a few different ways: - - -- a memory access violation or other hardware-generated exception - occurs. This is the worst possible problem to deal with, because - the fault can occur while XEmacs is in any state whatsoever, even - quite unstable ones. As a result, we need to be *extremely* careful - what we do. - -- we are using one X display (or if we've used more, we've closed the - others already), and some hardware or other problem happens and - suddenly we've lost our connection to the display. In this situation, - things are not so dire as in the last one; our code itself isn't - trashed, so we can continue execution as normal, after having set - things up so that we can exit at the appropriate time. Our exit - still needs to be of the emergency nature; we have no displays, so - any attempts to use them will fail. We simply want to auto-save - (the single most important thing to do during shut-down), do minimal - cleanup of stuff that has an independent existence outside of XEmacs, - and exit. - - Currently, both unexpected exit scenarios described above set - preparing_for_armageddon to indicate that nonessential and possibly - dangerous things should not be done, specifically: - - -- no garbage collection. - -- no hooks are run. - -- no messages of any sort from autosaving. - -- autosaving tries harder, ignoring certain failures. - -- existing frames are not deleted. - - (Also, all places that set preparing_for_armageddon also - set dont_check_for_quit. This happens separately because it's - also necessary to set other variables to make absolutely sure - no quitting happens.) - - In the first scenario above (the access violation), we also set - fatal_error_in_progress. This causes more things to not happen: - - -- assertion failures do not abort. - -- printing code does not do code conversion or gettext when - printing to stdout/stderr. +/* + +Info on intended/unintended exits: + + (Info-goto-node "(internals)Exiting") */ /* ------------------------------- */ @@ -3131,7 +3240,7 @@ /* If we can, try to avoid problems with super-optimizing compilers that might decide that memcmp (ptr, ptr, len) can be optimized away since its result is always 1. */ - memcmp (ptr, (char *) ptr + 1, len - 1); + memcmp (ptr, (Rawbyte *) ptr + 1, len - 1); else memcmp (ptr, ptr, len); } @@ -3315,21 +3424,21 @@ ); #ifndef _MSC_VER { - const char *name; - char *dir = 0; + const Ibyte *name; + Ibyte *dir = 0; /* Now try to determine the actual path to the executable, to try to make the backtrace-determination process as foolproof as possible. */ if (STRINGP (Vinvocation_name)) - name = (char *) XSTRING_DATA (Vinvocation_name); + name = XSTRING_DATA (Vinvocation_name); else - name = "xemacs"; + name = (const Ibyte *) "xemacs"; if (STRINGP (Vinvocation_directory)) - dir = (char *) XSTRING_DATA (Vinvocation_directory); + dir = XSTRING_DATA (Vinvocation_directory); if (!dir || dir[0] != '/') stderr_out ("`which %s`", name); - else if (dir[strlen (dir) - 1] != '/') + else if (dir[qxestrlen (dir) - 1] != '/') stderr_out ("%s/%s", dir, name); else stderr_out ("%s%s", dir, name); @@ -3476,7 +3585,7 @@ guts_of_fatal_error_signal (int sig) { fatal_error_in_progress++; - inhibit_non_essential_printing_operations = 1; + inhibit_non_essential_conversion_operations = 1; preparing_for_armageddon = 1; ensure_no_quitting_from_now_on (); @@ -3511,13 +3620,13 @@ # if 0 /* This is evil, rarely useful, and causes grief in some cases. */ /* Check for Sun-style stack printing via /proc */ { - const Char_ASCII *pstack = "/usr/proc/bin/pstack"; + const Ascbyte *pstack = "/usr/proc/bin/pstack"; if (access (pstack, X_OK) == 0) { - Char_ASCII buf[100]; + Ascbyte buf[100]; stderr_out ("\nC backtrace follows:\n" "(A real debugger may provide better information)\n\n"); - sprintf (buf, "%s %d >&2", pstack, (int)getpid()); + sprintf (buf, "%s %d >&2", pstack, (int) getpid()); system (buf); } } @@ -3557,7 +3666,7 @@ static DWORD mswindows_handle_hardware_exceptions_1 (void) { - inhibit_non_essential_printing_operations = 1; + inhibit_non_essential_conversion_operations = 1; preparing_for_armageddon = 1; #if !defined (USER_IS_DEVELOPING_XEMACS) pause_so_user_can_read_messages (0); @@ -3644,9 +3753,9 @@ we recursively hit such a failure.) */ static int in_assert_failed; -static const char *assert_failed_file; +static const Ascbyte *assert_failed_file; static int assert_failed_line; -static const char *assert_failed_expr; +static const Ascbyte *assert_failed_expr; #ifdef fprintf #undef fprintf @@ -3656,7 +3765,7 @@ of those are defined in the preprocessor to an expansion involving assert_failed(). */ void -assert_failed (const char *file, int line, const char *expr) +assert_failed (const Ascbyte *file, int line, const Ascbyte *expr) { /* If we're already crashing, let's not crash again. This might be critical to getting auto-saving working properly. */ @@ -3666,7 +3775,7 @@ /* We are extremely paranoid so we sensibly deal with recursive assertion failures. */ in_assert_failed++; - inhibit_non_essential_printing_operations = 1; + inhibit_non_essential_conversion_operations = 1; if (in_assert_failed >= 4) _exit (-1); @@ -3734,7 +3843,7 @@ really_abort (); #endif /* defined (_MSC_VER) || defined (CYGWIN) */ #endif /* !defined (ASSERTIONS_DONT_ABORT) */ - inhibit_non_essential_printing_operations = 0; + inhibit_non_essential_conversion_operations = 0; in_assert_failed = 0; } #endif /* USE_ASSERTIONS */ @@ -4222,7 +4331,7 @@ */ ); #ifdef PATH_MULELOADSEARCH Vconfigure_mule_lisp_directory = Ffile_name_as_directory - (build_string ((char *) PATH_MULELOADSEARCH)); + (build_ext_string (PATH_MULELOADSEARCH, Qfile_name); #else Vconfigure_mule_lisp_directory = Qnil; #endif
--- a/src/emodules.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/emodules.c Thu Nov 04 23:08:28 2004 +0000 @@ -239,12 +239,12 @@ * not previously loaded. */ if (modules == NULL) - modules = (emodules_list *) xmalloc (sizeof (emodules_list)); + modules = xnew (emodules_list); modnum++; - modules = (emodules_list *) xrealloc (modules, modnum * sizeof (emodules_list)); + XREALLOC_ARRAY (modules, emodules_list, modnum); fs = modnum - 1; - memset (&modules[fs], 0, sizeof(emodules_list)); + memset (&modules[fs], 0, sizeof (emodules_list)); return fs; } @@ -333,6 +333,7 @@ emodules_load (const CIbyte *module, const CIbyte *modname, const CIbyte *modver) { + /* !!#### Needs serious work */ Lisp_Object old_load_list; Lisp_Object filename; Lisp_Object foundname, lisp_modname; @@ -588,8 +589,6 @@ #ifdef HAVE_SHLIB Fprovide (intern ("modules")); - reinit_vars_of_module (); - #ifdef HAVE_LTDL lt_dlinit (); lt_dlmalloc = (lt_ptr (*) (size_t)) xmalloc;
--- a/src/emodules.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/emodules.h Thu Nov 04 23:08:28 2004 +0000 @@ -81,8 +81,8 @@ /* We should not expose module entities to the portable dumper. */ #if defined(PDUMP) && defined(EMACS_MODULE) -#undef dump_add_root_struct_ptr -#define dump_add_root_struct_ptr(varaddr,descaddr) DO_NOTHING +#undef dump_add_root_block_ptr +#define dump_add_root_block_ptr(varaddr,descaddr) DO_NOTHING #undef dump_add_opaque #define dump_add_opaque(varaddr,size) DO_NOTHING #undef dump_add_root_block
--- a/src/esd.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/esd.c Thu Nov 04 23:08:28 2004 +0000 @@ -42,9 +42,9 @@ return esd_play_file(ESD_NAME, file, 0); } -int esd_play_sound_data (UChar_Binary *data, size_t length, int vol); +int esd_play_sound_data (Binbyte *data, size_t length, int vol); int -esd_play_sound_data (UChar_Binary *data, size_t length, int UNUSED (vol)) +esd_play_sound_data (Binbyte *data, size_t length, int UNUSED (vol)) { /* #### FIXME: vol is ignored */ size_t (*parsesndfile)(void **dayta,size_t *sz,void **outbuf); size_t (*sndcnv)(void **dayta,size_t *sz,void **);
--- a/src/eval.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/eval.c Thu Nov 04 23:08:28 2004 +0000 @@ -4979,7 +4979,7 @@ `throw' out of the function being called are trapped, and a warning issued. (Again, WARNING_STRING should be given.) - (If FLAGS contains INHIBIT_WARNING_ISSUE, no warnings are issued; + If FLAGS contains INHIBIT_WARNING_ISSUE, no warnings are issued; this applies to recursive invocations of call_trapping_problems, too. If FLAGS contains POSTPONE_WARNING_ISSUE, no warnings are issued; @@ -6519,13 +6519,12 @@ #ifdef DEFEND_AGAINST_THROW_RECURSION throw_level = 0; #endif + init_eval_semi_early (); } void vars_of_eval (void) { - reinit_vars_of_eval (); - DEFVAR_INT ("max-specpdl-size", &max_specpdl_size /* Limit on number of Lisp variable bindings & unwind-protects before error. */ );
--- a/src/event-Xt.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/event-Xt.c Thu Nov 04 23:08:28 2004 +0000 @@ -1089,6 +1089,7 @@ } case XLookupNone: return Qnil; case XBufferOverflow: + /* !!#### needs work */ bufptr = (char *) ALLOCA (len+1); bufsiz = len+1; goto Lookup_String; @@ -1344,7 +1345,7 @@ explicitly prohibits. */ XClientMessageEvent *ev = &x_event->xclient; #ifdef HAVE_OFFIX_DND - if (DndIsDropMessage(x_event)) + if (DndIsDropMessage (x_event)) { unsigned int state; int modifiers = 0; @@ -1362,7 +1363,8 @@ GCPRO4 (l_type, l_data, l_dndlist, l_item); set_event_type (emacs_event, misc_user_event); SET_EVENT_CHANNEL (emacs_event, wrap_frame (frame)); - SET_EVENT_TIMESTAMP (emacs_event, DEVICE_X_LAST_SERVER_TIMESTAMP (d)); + SET_EVENT_TIMESTAMP (emacs_event, + DEVICE_X_LAST_SERVER_TIMESTAMP (d)); state=DndDragButtons (x_event); if (state & ShiftMask) modifiers |= XEMACS_MOD_SHIFT; @@ -1389,35 +1391,36 @@ DndDropCoordinates (FRAME_X_TEXT_WIDGET (frame), x_event, &(EVENT_MISC_USER_X (emacs_event)), &(EVENT_MISC_USER_Y (emacs_event))); - DndGetData (x_event,&data,&size); - - dtype=DndDataType (x_event); + DndGetData (x_event, &data, &size); + + dtype = DndDataType (x_event); switch (dtype) { case DndFiles: /* null terminated strings, end null */ { int len; - char *hurl = NULL; + Ibyte *hurl = NULL; while (*data) { - len = strlen ((char*)data); - hurl = dnd_url_hexify_string ((char *)data, "file:"); - l_item = make_string ((Ibyte *)hurl, strlen (hurl)); + Ibyte *dataint; + len = strlen (data); + EXTERNAL_TO_C_STRING (data, dataint, Qfile_name); + hurl = dnd_url_hexify_string (dataint, "file:"); + l_item = build_intstring (hurl); l_dndlist = Fcons (l_item, l_dndlist); data += len + 1; - xfree (hurl, char *); + xfree (hurl, Ibyte *); } l_type = Qdragdrop_URL; } break; case DndText: l_type = Qdragdrop_MIME; - l_dndlist = list1 ( list3 ( list1 ( make_string ((Ibyte *)"text/plain", 10) ), - make_string ((Ibyte *)"8bit", 4), - make_ext_string ((Extbyte *)data, - strlen((char *)data), - Qctext) ) ); + l_dndlist = list1 (list3 (list1 (build_string ("text/plain")), + build_string ("8bit"), + build_ext_string (data, + Qctext))); break; case DndMIME: /* we have to parse this in some way to extract @@ -1428,44 +1431,41 @@ to tm... */ l_type = Qdragdrop_MIME; - l_dndlist = list1 ( make_ext_string ((Extbyte *)data, - strlen((char *)data), - Qbinary) ); + l_dndlist = list1 (build_ext_string (data, Qbinary)); break; case DndFile: case DndDir: case DndLink: case DndExe: { - char *hurl = dnd_url_hexify_string ((char *) data, "file:"); - - l_dndlist = list1 ( make_string ((Ibyte *)hurl, - strlen (hurl)) ); - l_type = Qdragdrop_URL; - - xfree (hurl, char *); + Ibyte *dataint, *hurl; + EXTERNAL_TO_C_STRING (data, dataint, Qfile_name); + hurl = dnd_url_hexify_string (dataint, "file:"); + l_dndlist = list1 (build_intstring (hurl)); + xfree (hurl, Ibyte *); } break; case DndURL: /* as it is a real URL it should already be escaped and escaping again will break them (cause % is unsave) */ - l_dndlist = list1 ( make_ext_string ((Extbyte *)data, - strlen ((char *)data), - Qfile_name) ); + l_dndlist = list1 (build_ext_string (data, + Qfile_name)); l_type = Qdragdrop_URL; break; default: /* Unknown, RawData and any other type */ - l_dndlist = list1 ( list3 ( list1 ( make_string ((Ibyte *)"application/octet-stream", 24) ), - make_string ((Ibyte *)"8bit", 4), - make_ext_string ((Extbyte *)data, - size, - Qbinary) ) ); + l_dndlist = list1 (list3 (list1 (build_string + ("application/octet-stream")), + build_string ("8bit"), + make_ext_string (data, size, + Qbinary))); l_type = Qdragdrop_MIME; break; } - SET_EVENT_MISC_USER_FUNCTION (emacs_event, Qdragdrop_drop_dispatch); - SET_EVENT_MISC_USER_OBJECT (emacs_event, Fcons (l_type, l_dndlist)); + SET_EVENT_MISC_USER_FUNCTION (emacs_event, + Qdragdrop_drop_dispatch); + SET_EVENT_MISC_USER_OBJECT (emacs_event, + Fcons (l_type, l_dndlist)); UNGCPRO; @@ -3214,8 +3214,6 @@ void vars_of_event_Xt (void) { - reinit_vars_of_event_Xt (); - DEFVAR_BOOL ("x-allow-sendevents", &x_allow_sendevents /* *Non-nil means to allow synthetic events. Nil means they are ignored. Beware: allowing emacs to process SendEvents opens a big security hole.
--- a/src/event-gtk.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/event-gtk.c Thu Nov 04 23:08:28 2004 +0000 @@ -1648,8 +1648,6 @@ void vars_of_event_gtk (void) { - reinit_vars_of_event_gtk (); - DEFVAR_BOOL ("gtk-allow-sendevents", >k_allow_sendevents /* *Non-nil means to allow synthetic events. Nil means they are ignored. Beware: allowing emacs to process SendEvents opens a big security hole.
--- a/src/event-gtk.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/event-gtk.h Thu Nov 04 23:08:28 2004 +0000 @@ -32,6 +32,5 @@ gboolean emacs_shell_event_handler (GtkWidget *wid /* unused */, GdkEvent *event, gpointer closure); -void reinit_vars_of_event_gtk (void); #endif /* __EVENT-GTK_H__ */
--- a/src/event-msw.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/event-msw.c Thu Nov 04 23:08:28 2004 +0000 @@ -2065,7 +2065,7 @@ else if (!DdeCmpStringHandles (hszTopic, mswindows_dde_topic_system)) { DWORD len = DdeGetData (hdata, NULL, 0, 0); - LPBYTE extcmd = (LPBYTE) ALLOCA (len + 1); + Extbyte *extcmd = alloca_extbytes (len + 1); Ibyte *cmd; Ibyte *end; struct gcpro gcpro1, gcpro2; @@ -2074,7 +2074,7 @@ Lisp_Object frmcons, devcons, concons; Lisp_Event *event = XEVENT (emacs_event); - DdeGetData (hdata, extcmd, len, 0); + DdeGetData (hdata, (LPBYTE) extcmd, len, 0); DdeFreeDataHandle (hdata); TO_INTERNAL_FORMAT (DATA, (extcmd, len), @@ -2085,7 +2085,7 @@ * treat like a file drop */ if (*cmd == '[') cmd++; - if (qxestrncasecmp_c (cmd, MSWINDOWS_DDE_ITEM_OPEN, + if (qxestrncasecmp_ascii (cmd, MSWINDOWS_DDE_ITEM_OPEN, strlen (MSWINDOWS_DDE_ITEM_OPEN))) return DDE_FNOTPROCESSED; cmd += strlen (MSWINDOWS_DDE_ITEM_OPEN); @@ -2946,7 +2946,7 @@ if one wants to exercise fingers playing chords on the mouse, he is allowed to do that! */ mswindows_enqueue_mouse_button_event (hwnd, message_, - MAKEPOINTS (lParam), + XE_MAKEPOINTS (lParam), wParam &~ MK_MBUTTON, GetMessageTime()); break; @@ -2966,7 +2966,7 @@ msframe->button2_is_down = 0; msframe->ignore_next_rbutton_up = 1; mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONUP, - MAKEPOINTS (lParam), + XE_MAKEPOINTS (lParam), wParam &~ (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON), @@ -2978,12 +2978,12 @@ { msframe->button2_need_rbutton = 0; mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, - MAKEPOINTS (lParam), + XE_MAKEPOINTS (lParam), wParam &~ MK_LBUTTON, GetMessageTime()); } mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONUP, - MAKEPOINTS (lParam), + XE_MAKEPOINTS (lParam), wParam &~ MK_LBUTTON, GetMessageTime()); } @@ -3004,7 +3004,7 @@ msframe->button2_is_down = 0; msframe->ignore_next_lbutton_up = 1; mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONUP, - MAKEPOINTS (lParam), + XE_MAKEPOINTS (lParam), wParam &~ (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON), @@ -3016,12 +3016,12 @@ { msframe->button2_need_lbutton = 0; mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, - MAKEPOINTS (lParam), + XE_MAKEPOINTS (lParam), wParam &~ MK_RBUTTON, GetMessageTime()); } mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONUP, - MAKEPOINTS (lParam), + XE_MAKEPOINTS (lParam), wParam &~ MK_RBUTTON, GetMessageTime()); } @@ -3036,10 +3036,10 @@ msframe->button2_need_lbutton = 0; msframe->button2_need_rbutton = 0; if (mswindows_button2_near_enough (msframe->last_click_point, - MAKEPOINTS (lParam))) + XE_MAKEPOINTS (lParam))) { mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, - MAKEPOINTS (lParam), + XE_MAKEPOINTS (lParam), wParam &~ (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON), @@ -3054,7 +3054,7 @@ &~ MK_RBUTTON, msframe->last_click_time); mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN, - MAKEPOINTS (lParam), + XE_MAKEPOINTS (lParam), wParam &~ MK_LBUTTON, GetMessageTime()); } @@ -3063,7 +3063,7 @@ { mswindows_set_chord_timer (hwnd); msframe->button2_need_rbutton = 1; - msframe->last_click_point = MAKEPOINTS (lParam); + msframe->last_click_point = XE_MAKEPOINTS (lParam); msframe->last_click_mods = wParam; } msframe->last_click_time = GetMessageTime(); @@ -3078,10 +3078,10 @@ msframe->button2_need_lbutton = 0; msframe->button2_need_rbutton = 0; if (mswindows_button2_near_enough (msframe->last_click_point, - MAKEPOINTS (lParam))) + XE_MAKEPOINTS (lParam))) { mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN, - MAKEPOINTS (lParam), + XE_MAKEPOINTS (lParam), wParam &~ (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON), @@ -3096,7 +3096,7 @@ &~ MK_LBUTTON, msframe->last_click_time); mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN, - MAKEPOINTS (lParam), + XE_MAKEPOINTS (lParam), wParam &~ MK_RBUTTON, GetMessageTime()); } @@ -3105,7 +3105,7 @@ { mswindows_set_chord_timer (hwnd); msframe->button2_need_lbutton = 1; - msframe->last_click_point = MAKEPOINTS (lParam); + msframe->last_click_point = XE_MAKEPOINTS (lParam); msframe->last_click_mods = wParam; } msframe->last_click_time = GetMessageTime(); @@ -3151,7 +3151,7 @@ as if timer has expired. This improves drag-select feedback */ if ((msframe->button2_need_lbutton || msframe->button2_need_rbutton) && !mswindows_button2_near_enough (msframe->last_click_point, - MAKEPOINTS (lParam))) + XE_MAKEPOINTS (lParam))) { KillTimer (hwnd, BUTTON_2_TIMER_ID); qxeSendMessage (hwnd, WM_TIMER, BUTTON_2_TIMER_ID, 0); @@ -3163,8 +3163,8 @@ XSET_EVENT_CHANNEL (emacs_event, mswindows_find_frame(hwnd)); XSET_EVENT_TIMESTAMP (emacs_event, GetMessageTime()); XSET_EVENT_TYPE (emacs_event, pointer_motion_event); - XSET_EVENT_MOTION_X (emacs_event,MAKEPOINTS (lParam).x); - XSET_EVENT_MOTION_Y (emacs_event,MAKEPOINTS (lParam).y); + XSET_EVENT_MOTION_X (emacs_event, XE_MAKEPOINTS (lParam).x); + XSET_EVENT_MOTION_Y (emacs_event, XE_MAKEPOINTS (lParam).y); XSET_EVENT_MOTION_MODIFIERS (emacs_event, mswindows_modifier_state (NULL, wParam, 0)); @@ -3558,9 +3558,9 @@ displayed */ if (!mswindows_handle_mousewheel_event (mswindows_find_frame (hwnd), keys, delta, - MAKEPOINTS (lParam))) + XE_MAKEPOINTS (lParam))) mswindows_enqueue_mouse_button_event (hwnd, message_, - MAKEPOINTS (lParam), + XE_MAKEPOINTS (lParam), wParam, GetMessageTime()); /* We are not in a modal loop so no pumping is necessary. */ @@ -3716,7 +3716,7 @@ * 3.10 of rfc1738 because they're missing the //<host>/ part and * because they may contain reserved characters. But that's OK - * they just need to be good enough to keep dragdrop.el happy. */ - fname_ext = (Extbyte *) ALLOCA ((len + 1) * XETCHAR_SIZE); + fname_ext = alloca_extbytes ((len + 1) * XETCHAR_SIZE); qxeDragQueryFile ((HDROP) wParam, i, fname_ext, len + 1); TO_INTERNAL_FORMAT (DATA, (fname_ext, len * XETCHAR_SIZE), @@ -3725,7 +3725,7 @@ /* May be a shell link aka "shortcut" - replace fname if so */ #if !defined (NO_CYGWIN_COM_SUPPORT) - if (!qxestrcasecmp_c (fname + fnamelen - 4, ".LNK")) + if (!qxestrcasecmp_ascii (fname + fnamelen - 4, ".LNK")) { /* #### @@ -3771,14 +3771,13 @@ NULL, CLSCTX_INPROC_SERVER, XECOMID (IID_IShellLinkW), - (void **) &psl) == S_OK) + &VOIDP_CAST (psl)) == S_OK) { IPersistFile *ppf; if (XECOMCALL2 (psl, QueryInterface, XECOMID (IID_IPersistFile), - (void **) &ppf) == - S_OK) + &VOIDP_CAST (ppf)) == S_OK) { Extbyte *fname_unicode; WIN32_FIND_DATAW wfd; @@ -3832,14 +3831,13 @@ NULL, CLSCTX_INPROC_SERVER, XECOMID (IID_IShellLinkA), - (void **) &psl) == S_OK) + &VOIDP_CAST (psl)) == S_OK) { IPersistFile *ppf; if (XECOMCALL2 (psl, QueryInterface, XECOMID (IID_IPersistFile), - (void **) &ppf) == - S_OK) + &VOIDP_CAST (ppf)) == S_OK) { Extbyte *fname_unicode; WIN32_FIND_DATAA wfd; @@ -3916,7 +3914,7 @@ ImmGetCompositionStringW is supported even on Windows 9x, and allows us to handle multiple languages. */ len = ImmGetCompositionStringW (imc, GCS_RESULTSTR, NULL, 0); - result = alloca_array (Extbyte, len); + result = alloca_extbytes (len); ImmGetCompositionStringW (imc, GCS_RESULTSTR, (WCHAR *) result, len); ImmReleaseContext (hwnd, imc); @@ -5180,8 +5178,6 @@ void vars_of_event_mswindows (void) { - reinit_vars_of_event_mswindows (); - mswindows_s_dispatch_event_queue = Qnil; staticpro (&mswindows_s_dispatch_event_queue); mswindows_s_dispatch_event_queue_tail = Qnil;
--- a/src/event-stream.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/event-stream.c Thu Nov 04 23:08:28 2004 +0000 @@ -277,52 +277,13 @@ /* The callback routines for the window system or terminal driver */ struct event_stream *event_stream; -/* There are two event queues here -- the command event queue (#### which - should be called "deferred event queue" and is in my glyph ws) and the - dispatch event queue. (MS Windows actually has an extra dispatch - queue for non-user events and uses the generic one only for user events. - This is because user and non-user events in Windows come through the - same place -- the window procedure -- but under X, it's possible to - selectively process events such that we take all the user events before - the non-user ones. #### In fact, given the way we now drain the queue, - we might need two separate queues, like under Windows. Need to think - carefully exactly how this works, and should certainly generalize the - two different queues. - - The dispatch queue (which used to occur duplicated inside of each event - implementation) is used for events that have been read from the - window-system event queue(s) and not yet process by - next_event_internal(). It exists for two reasons: (1) because in many - implementations, events often come from the window system by way of - callbacks, and need to push the event to be returned onto a queue; (2) - in order to handle QUIT in a guaranteed correct fashion without - resorting to weird implementation-specific hacks that may or may not - work well, we need to drain the window-system event queues and then look - through to see if there's an event matching quit-char (usually ^G). the - drained events need to go onto a queue. (There are other, similar cases - where we need to drain the pending events so we can look ahead -- for - example, checking for pending expose events under X to avoid excessive - server activity.) - - The command event queue is used *AFTER* an event has been read from - next_event_internal(), when it needs to be pushed back. This includes, - for example, accept-process-output, sleep-for and - wait_delaying_user_input(). Eval events and the like, generated by - enqueue-eval-event, enqueue_magic_eval_event(), etc. are also pushed - onto this queue. Some events generated by callbacks are also pushed - onto this queue, #### although maybe shouldn't be. - - The command queue takes precedence over the dispatch queue. - - #### It is worth investigating to see whether both queues are really - needed, and how exactly they should be used. enqueue-eval-event, for - example, could certainly push onto the dispatch queue, and all callbacks - maybe should. wait_delaying_user_input() seems to need both queues, - since it can take events from the dispatch queue and push them onto the - command queue; but it perhaps could be rewritten to avoid this. #### - In general we need to review the handling of these two queues, figure - out exactly what ought to be happening, and document it. - */ + +/* + +See also + + (Info-goto-node "(internals)Event Stream Callback Routines") +*/ static Lisp_Object command_event_queue; static Lisp_Object command_event_queue_tail; @@ -1554,76 +1515,12 @@ /* -Ben's capsule lecture on focus: - -In FSFmacs `select-frame' never changes the window-manager frame -focus. All it does is change the "selected frame". This is similar -to what happens when we call `select-device' or `select-console'. -Whenever an event comes in (including a keyboard event), its frame is -selected; therefore, evaluating `select-frame' in *scratch* won't -cause any effects because the next received event (in the same frame) -will cause a switch back to the frame displaying *scratch*. - -Whenever a focus-change event is received from the window manager, it -generates a `switch-frame' event, which causes the Lisp function -`handle-switch-frame' to get run. This basically just runs -`select-frame' (see below, however). - -In FSFmacs, if you want to have an operation run when a frame is -selected, you supply an event binding for `switch-frame' (and then -maybe call `handle-switch-frame', or something ...). - -In XEmacs, we *do* change the window-manager frame focus as a result -of `select-frame', but not until the next time an event is received, -so that a function that momentarily changes the selected frame won't -cause WM focus flashing. (#### There's something not quite right here; -this is causing the wrong-cursor-focus problems that you occasionally -see. But the general idea is correct.) This approach is winning for -people who use the explicit-focus model, but is trickier to implement. - -We also don't make the `switch-frame' event visible but instead have -`select-frame-hook', which is a better approach. - -There is the problem of surrogate minibuffers, where when we enter the -minibuffer, you essentially want to temporarily switch the WM focus to -the frame with the minibuffer, and switch it back when you exit the -minibuffer. - -FSFmacs solves this with the crockish `redirect-frame-focus', which -says "for keyboard events received from FRAME, act like they're -coming from FOCUS-FRAME". I think what this means is that, when -a keyboard event comes in and the event manager is about to select the -event's frame, if that frame has its focus redirected, the redirected-to -frame is selected instead. That way, if you're in a minibufferless -frame and enter the minibuffer, then all Lisp functions that run see -the selected frame as the minibuffer's frame rather than the minibufferless -frame you came from, so that (e.g.) your typing actually appears in -the minibuffer's frame and things behave sanely. - -There's also some weird logic that switches the redirected frame focus -from one frame to another if Lisp code explicitly calls `select-frame' -\(but not if `handle-switch-frame' is called), and saves and restores -the frame focus in window configurations, etc. etc. All of this logic -is heavily #if 0'd, with lots of comments saying "No, this approach -doesn't seem to work, so I'm trying this ... is it reasonable? -Well, I'm not sure ..." that are a red flag indicating crockishness. - -Because of our way of doing things, we can avoid all this crock. -Keyboard events never cause a select-frame (who cares what frame -they're associated with? They come from a console, only). We change -the actual WM focus to a surrogate minibuffer frame, so we don't have -to do any internal redirection. In order to get the focus back, -I took the approach in minibuf.el of just checking to see if the -frame we moved to is still the selected frame, and move back to the -old one if so. Conceivably we might have to do the weird "tracking" -that FSFmacs does when `select-frame' is called, but I don't think -so. If the selected frame moved from the minibuffer frame, then -we just leave it there, figuring that someone knows what they're -doing. Because we don't have any redirection recorded anywhere, -it's safe to do this, and we don't end up with unwanted redirection. - +See also + + (Info-goto-node "(internals)Focus Handling") */ + static void run_select_frame_hook (void) { @@ -4863,7 +4760,6 @@ void vars_of_event_stream (void) { - reinit_vars_of_event_stream (); Vrecent_keys_ring = Qnil; staticpro (&Vrecent_keys_ring);
--- a/src/event-tty.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/event-tty.c Thu Nov 04 23:08:28 2004 +0000 @@ -299,7 +299,6 @@ void vars_of_event_tty (void) { - reinit_vars_of_event_tty (); } void
--- a/src/events.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/events.c Thu Nov 04 23:08:28 2004 +0000 @@ -189,16 +189,16 @@ }; static const struct memory_description event_data_description_1 [] = { - { XD_STRUCT_ARRAY, key_press_event, 1, &key_data_description }, - { XD_STRUCT_ARRAY, button_press_event, 1, &button_data_description }, - { XD_STRUCT_ARRAY, button_release_event, 1, &button_data_description }, - { XD_STRUCT_ARRAY, pointer_motion_event, 1, &motion_data_description }, - { XD_STRUCT_ARRAY, process_event, 1, &process_data_description }, - { XD_STRUCT_ARRAY, timeout_event, 1, &timeout_data_description }, - { XD_STRUCT_ARRAY, magic_event, 1, &magic_data_description }, - { XD_STRUCT_ARRAY, magic_eval_event, 1, &magic_eval_data_description }, - { XD_STRUCT_ARRAY, eval_event, 1, &eval_data_description }, - { XD_STRUCT_ARRAY, misc_user_event, 1, &misc_user_data_description }, + { XD_BLOCK_ARRAY, key_press_event, 1, &key_data_description }, + { XD_BLOCK_ARRAY, button_press_event, 1, &button_data_description }, + { XD_BLOCK_ARRAY, button_release_event, 1, &button_data_description }, + { XD_BLOCK_ARRAY, pointer_motion_event, 1, &motion_data_description }, + { XD_BLOCK_ARRAY, process_event, 1, &process_data_description }, + { XD_BLOCK_ARRAY, timeout_event, 1, &timeout_data_description }, + { XD_BLOCK_ARRAY, magic_event, 1, &magic_data_description }, + { XD_BLOCK_ARRAY, magic_eval_event, 1, &magic_eval_data_description }, + { XD_BLOCK_ARRAY, eval_event, 1, &eval_data_description }, + { XD_BLOCK_ARRAY, misc_user_event, 1, &misc_user_data_description }, { XD_END } }; @@ -1574,7 +1574,7 @@ eicat_ch (buf, XCHAR (key)); else if (SYMBOLP (key)) { - const Char_ASCII *str = 0; + const Ascbyte *str = 0; if (brief) { if (EQ (key, QKlinefeed)) str = "LFD"; @@ -2634,8 +2634,6 @@ void vars_of_events (void) { - reinit_vars_of_events (); - DEFVAR_LISP ("character-set-property", &Vcharacter_set_property /* This is used to map e.g. `ocircumflex' to the appropriate character under X. This value of this variable (a symbol, normally `x-iso8859-1' if not nil)
--- a/src/events.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/events.h Thu Nov 04 23:08:28 2004 +0000 @@ -27,164 +27,13 @@ #include "systime.h" -/* There is one object called an event_stream. This object contains - callback functions for doing the window-system-dependent operations - that XEmacs requires. - - If XEmacs is compiled with support for X11 and the X Toolkit, then this - event_stream structure will contain functions that can cope with input - on XEmacs windows on multiple displays, as well as input from dumb tty - frames. - - If it is desired to have XEmacs able to open frames on the displays of - multiple heterogeneous machines, X11 and SunView, or X11 and NeXT, for - example, then it will be necessary to construct an event_stream structure - that can cope with the given types. Currently, the only implemented - event_streams are for dumb-ttys, and for X11 plus dumb-ttys, - and for mswindows. - - To implement this for one window system is relatively simple. - To implement this for multiple window systems is trickier and may - not be possible in all situations, but it's been done for X and TTY. - - Note that these callbacks are *NOT* console methods; that's because - the routines are not specific to a particular console type but must - be able to simultaneously cope with all allowable console types. - - The slots of the event_stream structure: - - next_event_cb A function which fills in an XEmacs_event structure - with the next event available. If there is no event - available, then this should block. - - IMPORTANT: timer events and especially process - events *must not* be returned if there are - events of other types available; otherwise you - can end up with an infinite loop in Fdiscard_input(). +/* - event_pending_cb A function which says whether there are events to be - read. If called with an argument of 0, then this - should say whether calling the next_event_cb will - block. If called with a non-zero argument, then this - should say whether there are that many user-generated - events pending (that is, keypresses, mouse-clicks, - dialog-box selection events, etc.). (This is used for - redisplay optimization, among other things.) The - difference is that the former includes process events - and timer events, but the latter doesn't. - - If this function is not sure whether there are events - to be read, it *must* return 0. Otherwise various - undesirable effects will occur, such as redisplay - not occurring until the next event occurs. - - handle_magic_event_cb XEmacs calls this with an event structure which - contains window-system dependent information that - XEmacs doesn't need to know about, but which must - happen in order. If the next_event_cb never returns - an event of type "magic", this will never be used. - - format_magic_event_cb Called with a magic event; print a representation of - the innards of the event to PSTREAM. - - compare_magic_event_cb Called with two magic events; return non-zero if - the innards of the two are equal, zero otherwise. - - hash_magic_event_cb Called with a magic event; return a hash of the - innards of the event. - - add_timeout_cb Called with an EMACS_TIME, the absolute time at - which a wakeup event should be generated; and a - void *, which is an arbitrary value that will be - returned in the timeout event. The timeouts - generated by this function should be one-shots: - they fire once and then disappear. This callback - should return an int id-number which uniquely - identifies this wakeup. If an implementation - doesn't have microseconds or millisecond - granularity, it should round up to the closest - value it can deal with. +See also - remove_timeout_cb Called with an int, the id number of a wakeup to - discard. This id number must have been returned by - the add_timeout_cb. If the given wakeup has - already expired, this should do nothing. - - select_process_cb These callbacks tell the underlying implementation to - unselect_process_cb add or remove a file descriptor from the list of fds - which are polled for inferior-process input. When - input becomes available on the given process - connection, an event of type "process" should be - generated. - - select_console_cb These callbacks tell the underlying implementation - unselect_console_cb to add or remove a console from the list of consoles - which are polled for user-input. - - select_device_cb These callbacks are used by Unixoid event loops - unselect_device_cb (those that use select() and file descriptors and - have a separate input fd per device). - - create_io_streams_cb These callbacks are called by process code to - delete_io_streams_cb create the input and output lstreams which are used - for subprocess I/O. - - quitp_cb A handler function called from the `QUIT' macro which - should check whether the quit character has been - typed. On systems with SIGIO, this will not be called - unless the `sigio_happened' flag is true (it is set - from the SIGIO handler). - - XEmacs has its own event structures, which are distinct from the event - structures used by X or any other window system. It is the job of the - event_stream layer to translate to this format. -*/ - -/* - Stream pairs description - ------------------------ + (Info-goto-node "(internals)Event Stream Callback Routines") + (Info-goto-node "(internals)Stream Pairs") - Since there are many possible processes/event loop combinations, the - event code is responsible for creating an appropriate lstream type. The - process implementation does not care about that implementation. - - The Create stream pair function is passed two void* values, which - identify process-dependent 'handles'. The process implementation uses - these handles to communicate with child processes. The function must be - prepared to receive handle types of any process implementation. Since - only one process implementation exists in a particular XEmacs - configuration, preprocessing is a means of compiling in the support for - the code which deals with particular handle types. - - For example, a unixoid type loop, which relies on file descriptors, may be - asked to create a pair of streams by a unix-style process implementation. - In this case, the handles passed are unix file descriptors, and the code - may deal with these directly. Although, the same code may be used on Win32 - system with X-Windows. In this case, Win32 process implementation passes - handles of type HANDLE, and the create_io_streams function must call - appropriate function to get file descriptors given HANDLEs, so that these - descriptors may be passed to XtAddInput. - - The handle given may have special denying value, in which case the - corresponding lstream should not be created. - - The return value of the function is a unique stream identifier. It is used - by processes implementation, in its platform-independent part. There is - the get_process_from_usid function, which returns process object given its - USID. The event stream is responsible for converting its internal handle - type into USID. - - Example is the TTY event stream. When a file descriptor signals input, the - event loop must determine process to which the input is destined. Thus, - the implementation uses process input stream file descriptor as USID, by - simply casting the fd value to USID type. - - There are two special USID values. One, USID_ERROR, indicates that the stream - pair cannot be created. The second, USID_DONTHASH, indicates that streams are - created, but the event stream does not wish to be able to find the process - by its USID. Specifically, if an event stream implementation never calls - get_process_from_usid, this value should always be returned, to prevent - accumulating useless information on USID to process relationship. */ /* typedef unsigned int USID; in lisp.h */
--- a/src/extents.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/extents.c Thu Nov 04 23:08:28 2004 +0000 @@ -264,14 +264,6 @@ offset_past_gap = elsize * (gap + gapsize) els_past_gap = numels - gap - - #### The current layout will not cut it for dumping purposes. If we - need to dump one of these structures, we will have to rearrange things - so that the gap array data and other fields are in one single memory - block. Either this is a pointer off of struct gap_array, or it is - struct gap_array itself; in the latter case, the interface below has to - be modified so that functions that change the array pass in a ** rather - than a *, since the pointer may move. */ @@ -1036,7 +1028,7 @@ extern const struct sized_memory_description gap_array_marker_description; static const struct memory_description gap_array_marker_description_1[] = { - { XD_STRUCT_PTR, offsetof (Gap_Array_Marker, next), 1, + { XD_BLOCK_PTR, offsetof (Gap_Array_Marker, next), 1, &gap_array_marker_description }, { XD_END } }; @@ -1050,11 +1042,11 @@ { XD_INT, offsetof (Gap_Array, gap) }, { XD_INT, offsetof (Gap_Array, offset_past_gap) }, { XD_INT, offsetof (Gap_Array, els_past_gap) }, - { XD_STRUCT_PTR, offsetof (Gap_Array, markers), 1, + { XD_BLOCK_PTR, offsetof (Gap_Array, markers), 1, &gap_array_marker_description, XD_FLAG_NO_KKCC }, - { XD_STRUCT_ARRAY, offsetof (Gap_Array, array), XD_INDIRECT (0, 0), + { XD_BLOCK_ARRAY, offsetof (Gap_Array, array), XD_INDIRECT (0, 0), &lisp_object_description }, - { XD_STRUCT_ARRAY, XD_INDIRECT (1, offsetof (Gap_Array, array)), + { XD_BLOCK_ARRAY, XD_INDIRECT (1, offsetof (Gap_Array, array)), XD_INDIRECT (2, 0), &lisp_object_description }, { XD_END } }; @@ -1067,9 +1059,9 @@ extern const struct sized_memory_description extent_list_marker_description; static const struct memory_description extent_list_marker_description_1[] = { - { XD_STRUCT_PTR, offsetof (Extent_List_Marker, m), 1, + { XD_BLOCK_PTR, offsetof (Extent_List_Marker, m), 1, &gap_array_marker_description }, - { XD_STRUCT_PTR, offsetof (Extent_List_Marker, next), 1, + { XD_BLOCK_PTR, offsetof (Extent_List_Marker, next), 1, &extent_list_marker_description }, { XD_END } }; @@ -1080,9 +1072,9 @@ }; static const struct memory_description extent_list_description_1[] = { - { XD_STRUCT_PTR, offsetof (Extent_List, start), 1, &lispobj_gap_array_description }, - { XD_STRUCT_PTR, offsetof (Extent_List, end), 1, &lispobj_gap_array_description, XD_FLAG_NO_KKCC }, - { XD_STRUCT_PTR, offsetof (Extent_List, markers), 1, &extent_list_marker_description, XD_FLAG_NO_KKCC }, + { XD_BLOCK_PTR, offsetof (Extent_List, start), 1, &lispobj_gap_array_description }, + { XD_BLOCK_PTR, offsetof (Extent_List, end), 1, &lispobj_gap_array_description, XD_FLAG_NO_KKCC }, + { XD_BLOCK_PTR, offsetof (Extent_List, markers), 1, &extent_list_marker_description, XD_FLAG_NO_KKCC }, { XD_END } }; @@ -1092,7 +1084,7 @@ }; static const struct memory_description stack_of_extents_description_1[] = { - { XD_STRUCT_PTR, offsetof (Stack_Of_Extents, extents), 1, &extent_list_description }, + { XD_BLOCK_PTR, offsetof (Stack_Of_Extents, extents), 1, &extent_list_description }, { XD_END } }; @@ -1102,9 +1094,9 @@ }; static const struct memory_description extent_info_description [] = { - { XD_STRUCT_PTR, offsetof (struct extent_info, extents), 1, + { XD_BLOCK_PTR, offsetof (struct extent_info, extents), 1, &extent_list_description }, - { XD_STRUCT_PTR, offsetof (struct extent_info, soe), 1, + { XD_BLOCK_PTR, offsetof (struct extent_info, soe), 1, &stack_of_extents_description, XD_FLAG_NO_KKCC }, { XD_END } }; @@ -4977,11 +4969,10 @@ call3 (hook, exobj, startobj, endobj); else { - Lisp_Object tail; - EXTERNAL_LIST_LOOP (tail, hook) + EXTERNAL_LIST_LOOP_2 (elt, hook) /* #### Shouldn't this perform the same Fset_buffer() check as above? */ - call3 (XCAR (tail), exobj, startobj, endobj); + call3 (elt, exobj, startobj, endobj); } return 0; } @@ -5092,13 +5083,15 @@ } thecons = Vextent_face_reusable_list; - EXTERNAL_LIST_LOOP (cons, list) - { - Lisp_Object face = Fget_face (XCAR (cons)); - - XCAR (thecons) = Fface_name (face); - thecons = XCDR (thecons); - } + { + EXTERNAL_LIST_LOOP_2 (face, list) + { + face = Fget_face (face); + + XCAR (thecons) = Fface_name (face); + thecons = XCDR (thecons); + } + } list = Fgethash (Vextent_face_reusable_list, Vextent_face_memoize_hash_table, Qnil); @@ -7392,8 +7385,6 @@ void vars_of_extents (void) { - reinit_vars_of_extents (); - DEFVAR_INT ("mouse-highlight-priority", &mouse_highlight_priority /* The priority to use for the mouse-highlighting pseudo-extent that is used to highlight extents with the `mouse-face' attribute set.
--- a/src/faces.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/faces.c Thu Nov 04 23:08:28 2004 +0000 @@ -1974,7 +1974,7 @@ #if defined (HAVE_X_WINDOWS) || defined (HAVE_GTK) - const Char_ASCII *fonts[] = + const Ascbyte *fonts[] = { /************** ISO-8859 fonts *************/ @@ -2104,7 +2104,7 @@ "-*-*-*-*-*-*-*-*-*-*-*-*-*-*", "*" }; - const Char_ASCII **fontptr; + const Ascbyte **fontptr; #ifdef HAVE_X_WINDOWS for (fontptr = fonts + countof(fonts) - 1; fontptr >= fonts; fontptr--) @@ -2126,13 +2126,13 @@ #ifdef HAVE_MS_WINDOWS { - const Char_ASCII *mswfonts[] = + const Ascbyte *mswfonts[] = { "Courier New:Regular:10::", "Courier:Regular:10::", ":Regular:10::" }; - const Char_ASCII **mswfontptr; + const Ascbyte **mswfontptr; for (mswfontptr = mswfonts + countof (mswfonts) - 1; mswfontptr >= mswfonts; mswfontptr--)
--- a/src/file-coding.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/file-coding.c Thu Nov 04 23:08:28 2004 +0000 @@ -69,359 +69,6 @@ Removed the conditionals. */ -/* sjt sez: - -There should be no elementary coding systems in the Lisp API, only chains. -Chains should be declared, not computed, as a sequence of coding formats. -(Probably the internal representation can be a vector for efficiency but -programmers would probably rather work with lists.) A stream has a token -type. Most streams are octet streams. Text is a stream of characters (in -_internal_ format; a file on disk is not text!) An octet-stream has no -implicit semantics, so its format must always be specified. The only type -currently having semantics is characters. This means that the chain [euc-jp --> internal -> shift_jis) may be specified (euc-jp, shift_jis), and if no -euc-jp -> shift_jis converter is available, then the chain is automatically -constructed. (N.B. I f we have fixed width buffers in the future, then we -could have ASCII -> 8-bit char -> 16-bit char -> ISO-2022-JP (with escape -sequences). - -EOL handling is a char <-> char coding. It should not be part of another -coding system except as a convenience for users. For text coding, -automatically insert EOL handlers between char <-> octet boundaries. -*/ - -/* Comments about future work - ------------------------------------------------------------------- - ABOUT DETECTION ------------------------------------------------------------------- - - however, in general the detection code has major problems and needs lots - of work: - - -- instead of merely "yes" or "no" for particular categories, we need a - more flexible system, with various levels of likelihood. Currently - I've created a system with six levels, as follows: - - [see file-coding.h] - - Let's consider what this might mean for an ASCII text detector. (In - order to have accurate detection, especially given the iteration I - proposed below, we need active detectors for *all* types of data we - might reasonably encounter, such as ASCII text files, binary files, - and possibly other sorts of ASCII files, and not assume that simply - "falling back to no detection" will work at all well.) - - An ASCII text detector DOES NOT report ASCII text as level 0, since - that's what the detector is looking for. Such a detector ideally - wants all bytes in the range 0x20 - 0x7E (no high bytes!), except for - whitespace control chars and perhaps a few others; LF, CR, or CRLF - sequences at regular intervals (where "regular" might mean an average - < 100 chars and 99% < 300 for code and other stuff of the "text file - w/line breaks" variety, but for the "text file w/o line breaks" - variety, excluding blank lines, averages could easily be 600 or more - with 2000-3000 char "lines" not so uncommon); similar statistical - variance between odds and evens (not Unicode); frequent occurrences of - the space character; letters more common than non-letters; etc. Also - checking for too little variability between frequencies of characters - and for exclusion of particular characters based on character ranges - can catch ASCII encodings like base-64, UUEncode, UTF-7, etc. - Granted, this doesn't even apply to everything called "ASCII", and we - could potentially distinguish off ASCII for code, ASCII for text, - etc. as separate categories. However, it does give us a lot to work - off of, in deciding what likelihood to choose -- and it shows there's - in fact a lot of detectable patterns to look for even in something - seemingly so generic as ASCII. The detector would report most text - files in level 1 or level 2. EUC encodings, Shift-JIS, etc. probably - go to level -1 because they also pass the EOL test and all other tests - for the ASCII part of the text, but have lots of high bytes, which in - essence turn them into binary. Aberrant text files like something in - BASE64 encoding might get placed in level 0, because they pass most - tests but fail dramatically the frequency test; but they should not be - reported as any lower, because that would cause explicit prompting, - and the user should be able any valid text file without prompting. - The escape sequences and the base-64-type checks might send 7-bit - iso2022 to 0, but probably not -1, for similar reasons. - - -- The assumed algorithm for the above detection levels is to in essence - sort categories first by detection level and then by priority. - Perhaps, however, we would want smarter algorithms, or at least - something user-controllable -- in particular, when (other than no - category at level 0 or greater) do we prompt the user to pick a - category? - - -- Improvements in how the detection algorithm works: we want to handle - lots of different ways something could be encoded, including multiple - stacked encodings. trying to specify a series of detection levels - (check for base64 first, then check for gzip, then check for an i18n - decoding, then for crlf) won't generally work. for example, what - about the same encoding appearing more than once? for example, take - euc-jp, base64'd, then gzip'd, then base64'd again: this could well - happen, and you could specify the encodings specifically as - base64|gzip|base64|euc-jp, but we'd like to autodetect it without - worrying about exactly what order these things appear in. we should - allow for iterating over detection/decoding cycles until we reach - some maximum (we got stuck in a loop, due to incorrect category - tables or detection algorithms), have no reported detection levels - over -1, or we end up with no change after a decoding pass (i.e. the - coding system associated with a chosen category was `no-conversion' - or something equivalent). it might make sense to divide things into - two phases (internal and external), where the internal phase has a - separate category list and would probably mostly end up handling EOL - detection; but the i think about it, the more i disagree. with - properly written detectors, and properly organized tables (in - general, those decodings that are more "distinctive" and thus - detectable with greater certainty go lower on the list), we shouldn't - need two phases. for example, let's say the example above was also - in CRLF format. The EOL detector (which really detects *plain text* - with a particular EOL type) would return at most level 0 for all - results until the text file is reached, whereas the base64, gzip or - euc-jp decoders will return higher. Once the text file is reached, - the EOL detector will return 0 or higher for the CRLF encoding, and - all other detectors will return 0 or lower; thus, we will successfully - proceed through CRLF decoding, or at worst prompt the user. (The only - external-vs-internal distinction that might make sense here is to - favor coding systems of the correct source type over those that - require conversion between external and internal; if done right, this - could allow the CRLF detector to return level 1 for all CRLF-encoded - text files, even those that look like Base-64 or similar encoding, so - that CRLF encoding will always get decoded without prompting, but not - interfere with other decoders. On the other hand, this - external-vs-internal distinction may not matter at all -- with - automatic internal-external conversion, CRLF decoding can occur - before or after decoding of euc-jp, base64, iso2022, or similar, - without any difference in the final results.) - - #### What are we trying to say? In base64, the CRLF decoding before - base64 decoding is irrelevant, they will be thrown out as whitespace - is not significant in base64. - - [sjt considers all of this to be rather bogus. Ideas like "greater - certainty" and "distinctive" can and should be quantified. The issue - of proper table organization should be a question of optimization.] - - [sjt wonders if it might not be a good idea to use Unicode's newline - character as the internal representation so that (for non-Unicode - coding systems) we can catch EOL bugs on Unix too.] - - -- There need to be two priority lists and two - category->coding-system lists. Once is general, the other - category->langenv-specific. The user sets the former, the langenv - category->the latter. The langenv-specific entries take precedence - category->over the others. This works similarly to the - category->category->Unicode charset priority list. - - -- The simple list of coding categories per detectors is not enough. - Instead of coding categories, we need parameters. For example, - Unicode might have separate detectors for UTF-8, UTF-7, UTF-16, - and perhaps UCS-4; or UTF-16/UCS-4 would be one detection type. - UTF-16 would have parameters such as "little-endian" and "needs BOM", - and possibly another one like "collapse/expand/leave alone composite - sequences" once we add this support. Usually these parameters - correspond directly to a coding system parameter. Different - likelihood values can be specified for each parameter as well as for - the detection type as a whole. The user can specify particular - coding systems for a particular combination of detection type and - parameters, or can give "default parameters" associated with a - detection type. In the latter case, we create a new coding system as - necessary that corresponds to the detected type and parameters. - - -- a better means of presentation. rather than just coming up - with the new file decoded according to the detected coding - system, allow the user to browse through the file and - conveniently reject it if it looks wrong; then detection - starts again, but with that possibility removed. in cases where - certainty is low and thus more than one possibility is presented, - the user can browse each one and select one or reject them all. - - -- fail-safe: even after the user has made a choice, if they - later on realize they have the wrong coding system, they can - go back, and we've squirreled away the original data so they - can start the process over. this may be tricky. - - -- using a larger buffer for detection. we use just a small - piece, which can give quite random results. we may need to - buffer up all the data we look through because we can't - necessarily rewind. the idea is we proceed until we get a - result that's at least at a certain level of certainty - (e.g. "probable") or we reached a maximum limit of how much - we want to buffer. - - -- dealing with interactive systems. we might need to go ahead - and present the data before we've finished detection, and - then re-decode it, perhaps multiple times, as we get better - detection results. - - -- Clearly some of these are more important than others. at the - very least, the "better means of presentation" should be - implemented as soon as possible, along with a very simple means - of fail-safe whenever the data is readibly available, e.g. it's - coming from a file, which is the most common scenario. - ---ben [at least that's what sjt thinks] - -***** - -While this is clearly something of an improvement over earlier designs, -it doesn't deal with the most important issue: to do better than categories -(which in the medium term is mostly going to mean "which flavor of Unicode -is this?"), we need to look at statistical behavior rather than ruling out -categories via presence of specific sequences. This means the stream -processor should - - (1) keep octet distributions (octet, 2-, 3-, 4- octet sequences) - (2) in some kind of compressed form - (3) look for "skip features" (eg, characteristic behavior of leading - bytes for UTF-7, UTF-8, UTF-16, Mule code) - (4) pick up certain "simple" regexps - (5) provide "triggers" to determine when statistical detectors should be - invoked, such as octet count - (6) and "magic" like Unicode signatures or file(1) magic. - ---sjt - - ------------------------------------------------------------------- - ABOUT FORMATS ------------------------------------------------------------------- - -when calling make-coding-system, the name can be a cons of (format1 . -format2), specifying that it decodes format1->format2 and encodes the other -way. if only one name is given, that is assumed to be format1, and the -other is either `external' or `internal' depending on the end type. -normally the user when decoding gives the decoding order in formats, but -can leave off the last one, `internal', which is assumed. a multichain -might look like gzip|multibyte|unicode, using the coding systems named -`gzip', `(unicode . multibyte)' and `unicode'. the way this actually works -is by searching for gzip->multibyte; if not found, look for gzip->external -or gzip->internal. (In general we automatically do conversion between -internal and external as necessary: thus gzip|crlf does the expected, and -maps to gzip->external, external->internal, crlf->internal, which when -fully specified would be gzip|external:external|internal:crlf|internal -- -see below.) To forcibly fit together two converters that have explicitly -specified and incompatible names (say you have unicode->multibyte and -iso8859-1->ebcdic and you know that the multibyte and iso8859-1 in this -case are compatible), you can force-cast using :, like this: -ebcdic|iso8859-1:multibyte|unicode. (again, if you force-cast between -internal and external formats, the conversion happens automatically.) - --------------------------------------------------------------------------- -ABOUT PDUMP, UNICODE, AND RUNNING XEMACS FROM A DIRECTORY WITH WEIRD CHARS --------------------------------------------------------------------------- - --- there's the problem that XEmacs can't be run in a directory with - non-ASCII/Latin-1 chars in it, since it will be doing Unicode - processing before we've had a chance to load the tables. In fact, - even finding the tables in such a situation is problematic using - the normal commands. my idea is to eventually load the stuff - extremely extremely early, at the same time as the pdump data gets - loaded. in fact, the unicode table data (stored in an efficient - binary format) can even be stuck into the pdump file (which would - mean as a resource to the executable, for windows). we'd need to - extend pdump a bit: to allow for attaching extra data to the pdump - file. (something like pdump_attach_extra_data (addr, length) - returns a number of some sort, an index into the file, which you - can then retrieve with pdump_load_extra_data(), which returns an - addr (mmap()ed or loaded), and later you pdump_unload_extra_data() - when finished. we'd probably also need - pdump_attach_extra_data_append(), which appends data to the data - just written out with pdump_attach_extra_data(). this way, - multiple tables in memory can be written out into one contiguous - table. (we'd use the tar-like trick of allowing new blocks to be - written without going back to change the old blocks -- we just rely - on the end of file/end of memory.) this same mechanism could be - extracted out of pdump and used to handle the non-pdump situation - (or alternatively, we could just dump either the memory image of - the tables themselves or the compressed binary version). in the - case of extra unicode tables not known about at compile time that - get loaded before dumping, we either just dump them into the image - (pdump and all) or extract them into the compressed binary format, - free the original tables, and treat them like all other tables. - --------------------------------------------------------------------------- - HANDLING WRITING A FILE SAFELY, WITHOUT DATA LOSS --------------------------------------------------------------------------- - - -- When writing a file, we need error detection; otherwise somebody - will create a Unicode file without realizing the coding system - of the buffer is Raw, and then lose all the non-ASCII/Latin-1 - text when it's written out. We need two levels - - 1. first, a "safe-charset" level that checks before any actual - encoding to see if all characters in the document can safely - be represented using the given coding system. FSF has a - "safe-charset" property of coding systems, but it's stupid - because this information can be automatically derived from - the coding system, at least the vast majority of the time. - What we need is some sort of - alternative-coding-system-precedence-list, langenv-specific, - where everything on it can be checked for safe charsets and - then the user given a list of possibilities. When the user - does "save with specified encoding", they should see the same - precedence list. Again like with other precedence lists, - there's also a global one, and presumably all coding systems - not on other list get appended to the end (and perhaps not - checked at all when doing safe-checking?). safe-checking - should work something like this: compile a list of all - charsets used in the buffer, along with a count of chars - used. that way, "slightly unsafe" coding systems can perhaps - be presented at the end, which will lose only a few characters - and are perhaps what the users were looking for. - - [sjt sez this whole step is a crock. If a universal coding system - is unacceptable, the user had better know what he/she is doing, - and explicitly specify a lossy encoding. - In principle, we can simply check for characters being writable as - we go along. Eg, via an "unrepresentable character handler." We - still have the buffer contents. If we can't successfully save, - then ask the user what to do. (Do we ever simply destroy previous - file version before completing a write?)] - - 2. when actually writing out, we need error checking in case an - individual char in a charset can't be written even though the - charsets are safe. again, the user gets the choice of other - reasonable coding systems. - - [sjt -- something is very confused, here; safe charsets should be - defined as those charsets all of whose characters can be encoded.] - - 3. same thing (error checking, list of alternatives, etc.) needs - to happen when reading! all of this will be a lot of work! - - - --ben - - I don't much like Ben's scheme. First, this isn't an issue of I/O, - it's a coding issue. It can happen in many places, not just on stream - I/O. Error checking should take place on all translations. Second, - the two-pass algorithm should be avoided if possible. In some cases - (eg, output to a tty) we won't be able to go back and change the - previously output data. Third, the whole idea of having a buffer full - of arbitrary characters which we're going to somehow shoehorn into a - file based on some twit user's less than informed idea of a coding system - is kind of laughable from the start. If we're going to say that a buffer - has a coding system, shouldn't we enforce restrictions on what you can - put into it? Fourth, what's the point of having safe charsets if some - of the characters in them are unsafe? Fifth, what makes you think we're - going to have a list of charsets? It seems to me that there might be - reasons to have user-defined charsets (eg, "German" vs "French" subsets - of ISO 8859/15). Sixth, the idea of having language environment determine - precedence doesn't seem very useful to me. Users who are working with a - language that corresponds to the language environment are not going to - run into safe charsets problems. It's users who are outside of their - usual language environment who run into trouble. Also, the reason for - specifying anything other than a universal coding system is normally - restrictions imposed by other users or applications. Seventh, the - statistical feedback isn't terribly useful. Users rarely "want" a - coding system, they want their file saved in a useful way. We could - add a FORCE argument to conversions for those who really want a specific - coding system. But mostly, a user might want to edit out a few unsafe - characters. So (up to some maximum) we should keep a list of unsafe - text positions, and provide a convenient function for traversing them. - - --sjt -*/ - #include <config.h> #include "lisp.h" @@ -459,7 +106,7 @@ static coding_system_type_entry_dynarr *the_coding_system_type_entry_dynarr; static const struct memory_description cste_description_1[] = { - { XD_STRUCT_PTR, offsetof (coding_system_type_entry, meths), 1, &coding_system_methods_description }, + { XD_BLOCK_PTR, offsetof (coding_system_type_entry, meths), 1, &coding_system_methods_description }, { XD_END } }; @@ -523,7 +170,7 @@ static const struct memory_description struct_detector_description_1[] = { - { XD_STRUCT_PTR, offsetof (struct detector, cats), 1, + { XD_BLOCK_PTR, offsetof (struct detector, cats), 1, &detector_category_dynarr_description }, { XD_END } }; @@ -698,13 +345,13 @@ static const struct memory_description coding_system_description[] = { - { XD_STRUCT_PTR, offsetof (Lisp_Coding_System, methods), 1, + { XD_BLOCK_PTR, offsetof (Lisp_Coding_System, methods), 1, &coding_system_methods_description }, #define MARKED_SLOT(x) { XD_LISP_OBJECT, offsetof (Lisp_Coding_System, x) }, #define MARKED_SLOT_ARRAY(slot, size) \ { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Coding_System, slot), size }, #include "coding-system-slots.h" - { XD_STRUCT_ARRAY, offsetof (Lisp_Coding_System, data), 1, + { XD_BLOCK_ARRAY, offsetof (Lisp_Coding_System, data), 1, coding_system_extra_description_map }, { XD_END } }; @@ -1093,8 +740,8 @@ struct subsidiary_type { - Char_ASCII *extension; - Char_ASCII *mnemonic_ext; + Ascbyte *extension; + Ascbyte *mnemonic_ext; enum eol_type eol; }; @@ -1108,7 +755,7 @@ setup_eol_coding_systems (Lisp_Object codesys) { int len = XSTRING_LENGTH (XSYMBOL (XCODING_SYSTEM_NAME (codesys))->name); - Ibyte *codesys_name = (Ibyte *) ALLOCA (len + 7); + Ibyte *codesys_name = alloca_ibytes (len + 7); int mlen = -1; Ibyte *codesys_mnemonic = 0; Lisp_Object codesys_name_sym, sub_codesys; @@ -1120,7 +767,7 @@ if (STRINGP (XCODING_SYSTEM_MNEMONIC (codesys))) { mlen = XSTRING_LENGTH (XCODING_SYSTEM_MNEMONIC (codesys)); - codesys_mnemonic = (Ibyte *) ALLOCA (mlen + 7); + codesys_mnemonic = alloca_ibytes (mlen + 7); memcpy (codesys_mnemonic, XSTRING_DATA (XCODING_SYSTEM_MNEMONIC (codesys)), mlen); } @@ -1140,14 +787,14 @@ for (i = 0; i < countof (coding_subsidiary_list); i++) { - Char_ASCII *extension = coding_subsidiary_list[i].extension; - Char_ASCII *mnemonic_ext = coding_subsidiary_list[i].mnemonic_ext; + Ascbyte *extension = coding_subsidiary_list[i].extension; + Ascbyte *mnemonic_ext = coding_subsidiary_list[i].mnemonic_ext; enum eol_type eol = coding_subsidiary_list[i].eol; - qxestrcpy_c (codesys_name + len, extension); + qxestrcpy_ascii (codesys_name + len, extension); codesys_name_sym = intern_int (codesys_name); if (mlen != -1) - qxestrcpy_c (codesys_mnemonic + mlen, mnemonic_ext); + qxestrcpy_ascii (codesys_mnemonic + mlen, mnemonic_ext); sub_codesys = Fcopy_coding_system (codesys, codesys_name_sym); if (mlen != -1) @@ -1217,7 +864,7 @@ */ static Lisp_Object -make_coding_system_1 (Lisp_Object name_or_existing, Char_ASCII *prefix, +make_coding_system_1 (Lisp_Object name_or_existing, Ascbyte *prefix, Lisp_Object type, Lisp_Object description, Lisp_Object props) { @@ -1384,7 +1031,7 @@ } Lisp_Object -make_internal_coding_system (Lisp_Object existing, Char_ASCII *prefix, +make_internal_coding_system (Lisp_Object existing, Ascbyte *prefix, Lisp_Object type, Lisp_Object description, Lisp_Object props) { @@ -2080,8 +1727,8 @@ extern const struct sized_memory_description undecided_coding_stream_description; static const struct memory_description coding_stream_data_description_1 []= { - { XD_STRUCT_PTR, chain_coding_system, 1, &chain_coding_stream_description}, - { XD_STRUCT_PTR, undecided_coding_system, 1, &undecided_coding_stream_description}, + { XD_BLOCK_PTR, chain_coding_system, 1, &chain_coding_stream_description}, + { XD_BLOCK_PTR, undecided_coding_system, 1, &undecided_coding_stream_description}, { XD_END } }; @@ -2581,49 +2228,14 @@ for this] ------> [BUFFER] */ - /* Of course, this is just horrible. BYTE<->CHAR should only be available - to I/O routines. It should not be visible to Mule proper. - - A comment on the implementation. Hrvoje and Kyle worry about the - inefficiency of repeated copying among buffers that chained coding - systems entail. But this may not be as time inefficient as it appears - in the Mule ("house rules") context. The issue is how do you do chain - coding systems without copying? In theory you could have - - IChar external_to_raw (ExtChar *cp, State *s); - IChar decode_utf16 (IChar c, State *s); - IChar decode_crlf (ExtChar *cp, State *s); - - typedef Ichar (*Converter[]) (Ichar, State*); - - Converter utf16[2] = { &decode_utf16, &decode_crlf }; - - void convert (ExtChar *inbuf, IChar *outbuf, Converter cvtr) - { - int i; - ExtChar c; - State s; - - while (c = external_to_raw (*inbuf++, &s)) - { - for (i = 0; i < sizeof(cvtr)/sizeof(Converter); ++i) - if (s.ready) - c = (*cvtr[i]) (c, &s); - } - if (s.ready) - *outbuf++ = c; - } - - But this is a lot of function calls; what Ben is doing is basically - reducing this to one call per buffer-full. The only way to avoid this - is to hardcode all the "interesting" coding systems, maybe using - inline or macros to give structure. But this is still a huge amount - of work, and code. - - One advantage to the call-per-char approach is that we might be able - to do something about the marker/extent destruction that coding - normally entails. - */ + + /* #### See comment + + EFFICIENCY OF CODING CONVERSION WITH MULTIPLE COPIES/CHAINS + + in text.c. + */ + while (1) { char tempbuf[1024]; /* some random amount */ @@ -2717,7 +2329,7 @@ static const struct memory_description chain_coding_system_description[] = { { XD_INT, offsetof (struct chain_coding_system, count) }, - { XD_STRUCT_PTR, offsetof (struct chain_coding_system, chain), + { XD_BLOCK_PTR, offsetof (struct chain_coding_system, chain), XD_INDIRECT (0, 0), &lisp_object_description }, { XD_LISP_OBJECT, offsetof (struct chain_coding_system, canonicalize_after_coding) }, @@ -2726,7 +2338,7 @@ static const struct memory_description chain_coding_stream_description_1 [] = { { XD_INT, offsetof (struct chain_coding_stream, lstream_count) }, - { XD_STRUCT_PTR, offsetof (struct chain_coding_stream, lstreams), + { XD_BLOCK_PTR, offsetof (struct chain_coding_stream, lstreams), XD_INDIRECT (0, 0), &lisp_object_description }, { XD_END } }; @@ -2985,26 +2597,29 @@ { if (EQ (key, Qchain)) { - Lisp_Object tail; Lisp_Object *cslist; int count = 0; int i; - EXTERNAL_LIST_LOOP (tail, value) - { - Fget_coding_system (XCAR (tail)); - count++; - } + { + EXTERNAL_LIST_LOOP_2 (elt, value) + { + Fget_coding_system (elt); + count++; + } + } cslist = xnew_array (Lisp_Object, count); XCODING_SYSTEM_CHAIN_CHAIN (codesys) = cslist; count = 0; - EXTERNAL_LIST_LOOP (tail, value) - { - cslist[count] = Fget_coding_system (XCAR (tail)); - count++; - } + { + EXTERNAL_LIST_LOOP_2 (elt, value) + { + cslist[count] = Fget_coding_system (elt); + count++; + } + } XCODING_SYSTEM_CHAIN_COUNT (codesys) = count; @@ -3469,7 +3084,7 @@ static const struct memory_description undecided_coding_stream_description_1 [] = { { XD_LISP_OBJECT, offsetof (struct undecided_coding_stream, actual) }, - { XD_STRUCT_ARRAY, offsetof (struct undecided_coding_stream, c), + { XD_BLOCK_ARRAY, offsetof (struct undecided_coding_stream, c), 1, &chain_coding_stream_description }, { XD_END } }; @@ -4324,7 +3939,6 @@ int *category_to_priority = alloca_array (int, coding_detector_category_count); int i, j; - Lisp_Object rest; /* First generate a list that maps coding categories to priorities. */ @@ -4333,14 +3947,16 @@ /* Highest priority comes from the specified list. */ i = 0; - EXTERNAL_LIST_LOOP (rest, list) - { - int cat = coding_category_symbol_to_id (XCAR (rest)); - - if (category_to_priority[cat] >= 0) - sferror ("Duplicate coding category in list", XCAR (rest)); - category_to_priority[cat] = i++; - } + { + EXTERNAL_LIST_LOOP_2 (elt, list) + { + int cat = coding_category_symbol_to_id (elt); + + if (category_to_priority[cat] >= 0) + sferror ("Duplicate coding category in list", elt); + category_to_priority[cat] = i++; + } + } /* Now go through the existing categories by priority to retrieve the categories not yet specified and preserve their priority @@ -4837,7 +4453,7 @@ make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); the_coding_system_type_entry_dynarr = Dynarr_new (coding_system_type_entry); - dump_add_root_struct_ptr (&the_coding_system_type_entry_dynarr, + dump_add_root_block_ptr (&the_coding_system_type_entry_dynarr, &csted_description); Vcoding_system_type_list = Qnil; @@ -4855,7 +4471,7 @@ sizeof (coding_category_by_priority)); all_coding_detectors = Dynarr_new2 (detector_dynarr, struct detector); - dump_add_root_struct_ptr (&all_coding_detectors, + dump_add_root_block_ptr (&all_coding_detectors, &detector_dynarr_description); dump_add_opaque_int (&coding_system_tick); @@ -4955,8 +4571,6 @@ void vars_of_file_coding (void) { - reinit_vars_of_file_coding (); - /* We always have file-coding support */ Fprovide (intern ("file-coding"));
--- a/src/file-coding.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/file-coding.h Thu Nov 04 23:08:28 2004 +0000 @@ -480,7 +480,7 @@ defsymbol_nodump (&ty##_coding_system_methods->predicate_symbol, \ pred_sym); \ add_entry_to_coding_system_type_list (ty##_coding_system_methods); \ - dump_add_root_struct_ptr (&ty##_coding_system_methods, \ + dump_add_root_block_ptr (&ty##_coding_system_methods, \ &coding_system_methods_description); \ } while (0) @@ -1046,7 +1046,7 @@ Ichar decode_big5_char (int o1, int o2); void add_entry_to_coding_system_type_list (struct coding_system_methods *m); Lisp_Object make_internal_coding_system (Lisp_Object existing, - Char_ASCII *prefix, + Ascbyte *prefix, Lisp_Object type, Lisp_Object description, Lisp_Object props);
--- a/src/fileio.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/fileio.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,6 +1,6 @@ /* File IO for XEmacs. Copyright (C) 1985-1988, 1992-1995 Free Software Foundation, Inc. - Copyright (C) 1996, 2001, 2002, 2003 Ben Wing. + Copyright (C) 1996, 2001, 2002, 2003, 2004 Ben Wing. This file is part of XEmacs. @@ -267,7 +267,7 @@ /* This function does not GC */ /* This function can be called during GC */ /* This function must not munge the match data. */ - Lisp_Object chain, inhibited_handlers; + Lisp_Object inhibited_handlers; CHECK_STRING (filename); @@ -276,22 +276,22 @@ else inhibited_handlers = Qnil; - EXTERNAL_LIST_LOOP (chain, Vfile_name_handler_alist) - { - Lisp_Object elt = XCAR (chain); - if (CONSP (elt)) - { - Lisp_Object string = XCAR (elt); - if (STRINGP (string) - && (fast_lisp_string_match (string, filename) >= 0)) - { - Lisp_Object handler = XCDR (elt); - if (NILP (Fmemq (handler, inhibited_handlers))) - return handler; - } - } - QUIT; - } + { + EXTERNAL_LIST_LOOP_2 (elt, Vfile_name_handler_alist) + { + if (CONSP (elt)) + { + Lisp_Object string = XCAR (elt); + if (STRINGP (string) + && (fast_lisp_string_match (string, filename) >= 0)) + { + Lisp_Object handler = XCDR (elt); + if (NILP (Fmemq (handler, inhibited_handlers))) + return handler; + } + } + } + } return Qnil; } @@ -373,8 +373,7 @@ Ibyte *res; Ibyte *wd = mswindows_getdcwd (toupper (*beg) - 'A' + 1); - res = alloca_array (Ibyte, - (wd ? qxestrlen (wd) : 0) + 10); /* go overboard */ + res = alloca_ibytes ((wd ? qxestrlen (wd) : 0) + 10); /* go overboard */ res[0] = '\0'; if (p == beg + 4 && IS_DIRECTORY_SEP (*beg) && beg[1] == ':') { @@ -576,7 +575,7 @@ handler = Ffind_file_name_handler (directory, Qdirectory_file_name); if (!NILP (handler)) return call2_check_string (handler, Qdirectory_file_name, directory); - buf = (Ibyte *) ALLOCA (XSTRING_LENGTH (directory) + 20); + buf = alloca_ibytes (XSTRING_LENGTH (directory) + 20); directory_file_name (XSTRING_DATA (directory), buf); return build_intstring (buf); } @@ -978,7 +977,7 @@ { for (p = nm; *p && (!IS_DIRECTORY_SEP (*p)); p++) DO_NOTHING; - o = (Ibyte *) ALLOCA (p - nm + 1); + o = alloca_ibytes (p - nm + 1); memcpy (o, nm, p - nm); o [p - nm] = 0; @@ -1048,7 +1047,7 @@ if (!newdir) { /* Either nm starts with /, or drive isn't mounted. */ - newdir = (Ibyte *) ALLOCA (4); + newdir = alloca_ibytes (4); newdir[0] = DRIVE_LETTER (drive); newdir[1] = ':'; newdir[2] = '/'; @@ -1112,8 +1111,8 @@ } if (!IS_DIRECTORY_SEP (nm[0])) { - Ibyte *tmp = (Ibyte *) ALLOCA (qxestrlen (newdir) + - qxestrlen (nm) + 2); + Ibyte *tmp = alloca_ibytes (qxestrlen (newdir) + + qxestrlen (nm) + 2); file_name_as_directory (tmp, newdir); qxestrcat (tmp, nm); nm = tmp; @@ -1152,10 +1151,9 @@ { if (IS_DIRECTORY_SEP (newdir[0]) && IS_DIRECTORY_SEP (newdir[1])) { - newdir = - (Ibyte *) - qxestrcpy ((Ibyte *) ALLOCA (qxestrlen (newdir) + 1), - newdir); + /* !!#### Use ei API */ + newdir = qxestrcpy (alloca_ibytes (qxestrlen (newdir) + 1), + newdir); p = newdir + 2; while (*p && !IS_DIRECTORY_SEP (*p)) p++; p++; @@ -1179,7 +1177,7 @@ #endif ) { - Ibyte *temp = (Ibyte *) ALLOCA (length); + Ibyte *temp = alloca_ibytes (length); memcpy (temp, newdir, length - 1); temp[length - 1] = 0; newdir = temp; @@ -1195,10 +1193,10 @@ /* Reserve space for drive specifier and escape prefix, since either or both may need to be inserted. (The Microsoft x86 compiler produces incorrect code if the following two lines are combined.) */ - target = (Ibyte *) ALLOCA (tlen + 4); + target = alloca_ibytes (tlen + 4); target += 4; #else /* not WIN32_FILENAMES */ - target = (Ibyte *) ALLOCA (tlen); + target = alloca_ibytes (tlen); #endif /* not WIN32_FILENAMES */ *target = 0; @@ -1562,7 +1560,7 @@ } /* Copy out the variable name */ - target = (Ibyte *) ALLOCA (s - o + 1); + target = alloca_ibytes (s - o + 1); qxestrncpy (target, o, s - o); target[s - o] = 0; #ifdef WIN32_NATIVE @@ -1581,7 +1579,7 @@ /* If substitution required, recopy the filename and do it */ /* Make space in stack frame for the new copy */ - xnm = (Ibyte *) ALLOCA (XSTRING_LENGTH (filename) + total + 1); + xnm = alloca_ibytes (XSTRING_LENGTH (filename) + total + 1); x = xnm; /* Copy the rest of the name through, replacing $ constructs with values */ @@ -1613,7 +1611,7 @@ } /* Copy out the variable name */ - target = (Ibyte *) ALLOCA (s - o + 1); + target = alloca_ibytes (s - o + 1); qxestrncpy (target, o, s - o); target[s - o] = 0; #ifdef WIN32_NATIVE @@ -3137,22 +3135,16 @@ if (inserted > 0) { - Lisp_Object p; - struct gcpro ngcpro1; - - NGCPRO1 (p); - EXTERNAL_LIST_LOOP (p, Vafter_insert_file_functions) + GC_EXTERNAL_LIST_LOOP_2 (p, Vafter_insert_file_functions) { - Lisp_Object insval = - call1 (XCAR (p), make_int (inserted)); + Lisp_Object insval = call1 (p, make_int (inserted)); if (!NILP (insval)) { CHECK_NATNUM (insval); inserted = XINT (insval); } - QUIT; } - NUNGCPRO; + END_GC_EXTERNAL_LIST_LOOP (p); } UNGCPRO; @@ -3666,6 +3658,7 @@ */ (string, key)) { + /* !!#### Needs work */ Extbyte *encrypted_string, *raw_key; Extbyte *string_ext, *key_ext; Bytecount string_size_ext, key_size_ext, rounded_size, extra, key_size; @@ -4405,8 +4398,6 @@ what the normal separator is. */ ); Vdirectory_sep_char = make_char (DEFAULT_DIRECTORY_SEP); - - reinit_vars_of_fileio (); } void
--- a/src/filelock.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/filelock.c Thu Nov 04 23:08:28 2004 +0000 @@ -96,7 +96,7 @@ /* Write the name of the lock file for FN into LFNAME. Length will be that of FN plus two more for the leading `.#' plus one for the null. */ #define MAKE_LOCK_NAME(lock, file) \ - (lock = (Ibyte *) ALLOCA (XSTRING_LENGTH (file) + 2 + 1), \ + (lock = alloca_ibytes (XSTRING_LENGTH (file) + 2 + 1), \ fill_in_lock_file_name (lock, file)) static void @@ -141,8 +141,8 @@ host_name = (Ibyte *) ""; lock_info_str = - (Ibyte *) ALLOCA (qxestrlen (user_name) + qxestrlen (host_name) - + LOCK_PID_MAX + 5); + alloca_ibytes (qxestrlen (user_name) + qxestrlen (host_name) + + LOCK_PID_MAX + 5); qxesprintf (lock_info_str, "%s@%s.%d", user_name, host_name, qxe_getpid ()); @@ -194,7 +194,7 @@ read it to determine return value, so allocate it. */ if (!owner) { - owner = (lock_info_type *) ALLOCA (sizeof (lock_info_type)); + owner = alloca_new (lock_info_type); local_owner = 1; } @@ -207,7 +207,7 @@ return -1; } len = at - lfinfo; - owner->user = (Ibyte *) xmalloc (len + 1); + owner->user = xnew_ibytes (len + 1); qxestrncpy (owner->user, lfinfo, len); owner->user[len] = 0; @@ -216,7 +216,7 @@ /* The host is everything in between. */ len = dot - at - 1; - owner->host = (Ibyte *) xmalloc (len + 1); + owner->host = xnew_ibytes (len + 1); qxestrncpy (owner->host, at + 1, len); owner->host[len] = 0; @@ -349,9 +349,9 @@ goto done; /* Else consider breaking the lock */ - locker = (Ibyte *) ALLOCA (qxestrlen (lock_info.user) - + qxestrlen (lock_info.host) - + LOCK_PID_MAX + 9); + locker = alloca_ibytes (qxestrlen (lock_info.user) + + qxestrlen (lock_info.host) + + LOCK_PID_MAX + 9); qxesprintf (locker, "%s@%s (pid %d)", lock_info.user, lock_info.host, lock_info.pid); FREE_LOCK_INFO (lock_info);
--- a/src/fns.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/fns.c Thu Nov 04 23:08:28 2004 +0000 @@ -3229,7 +3229,7 @@ { /* The string data of `sequence' might be relocated during GC. */ Bytecount slen = XSTRING_LENGTH (sequence); - Ibyte *p = alloca_array (Ibyte, slen); + Ibyte *p = alloca_ibytes (slen); Ibyte *end = p + slen; memcpy (p, XSTRING_DATA (sequence), slen); @@ -3350,22 +3350,22 @@ */ (old, new)) { - Lisp_Object tail, oldtail = old, prevoldtail = Qnil; - - EXTERNAL_LIST_LOOP (tail, new) + Lisp_Object oldtail = old, prevoldtail = Qnil; + + EXTERNAL_LIST_LOOP_2 (elt, new) { if (!NILP (oldtail)) { CHECK_CONS (oldtail); - XCAR (oldtail) = XCAR (tail); + XCAR (oldtail) = elt; } else if (!NILP (prevoldtail)) { - XCDR (prevoldtail) = Fcons (XCAR (tail), Qnil); + XCDR (prevoldtail) = Fcons (elt, Qnil); prevoldtail = XCDR (prevoldtail); } else - old = oldtail = Fcons (XCAR (tail), Qnil); + old = oldtail = Fcons (elt, Qnil); if (!NILP (oldtail)) { @@ -3383,7 +3383,7 @@ } Lisp_Object -add_suffix_to_symbol (Lisp_Object symbol, const Char_ASCII *ascii_string) +add_suffix_to_symbol (Lisp_Object symbol, const Ascbyte *ascii_string) { return Fintern (concat2 (Fsymbol_name (symbol), build_string (ascii_string)), @@ -3391,7 +3391,7 @@ } Lisp_Object -add_prefix_to_symbol (const Char_ASCII *ascii_string, Lisp_Object symbol) +add_prefix_to_symbol (const Ascbyte *ascii_string, Lisp_Object symbol) { return Fintern (concat2 (build_string (ascii_string), Fsymbol_name (symbol)),
--- a/src/font-lock.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/font-lock.c Thu Nov 04 23:08:28 2004 +0000 @@ -853,7 +853,6 @@ void vars_of_font_lock (void) { - reinit_vars_of_font_lock (); } #endif /* USE_C_FONT_LOCK */
--- a/src/frame-msw.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/frame-msw.c Thu Nov 04 23:08:28 2004 +0000 @@ -401,7 +401,7 @@ client part. So, if non-client are is covered and client area is not, we return true. */ GetClientRect (hwnd, &rc_me); - MapWindowPoints (hwnd, HWND_DESKTOP, (LPPOINT)&rc_me, 2); + MapWindowPoints (hwnd, HWND_DESKTOP, (LPPOINT) (void *) (&rc_me), 2); /* First see if we're off the desktop */ GetWindowRect (GetDesktopWindow (), &rc_other); @@ -1170,8 +1170,6 @@ void vars_of_frame_mswindows (void) { - reinit_vars_of_frame_mswindows (); - DEFVAR_LISP ("mswindows-use-system-frame-size-defaults", &Vmswindows_use_system_frame_size_defaults /* Controls whether to use system or XEmacs defaults for frame size. If nil then reasonable defaults are used for initial frame sizes. If t
--- a/src/frame-x.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/frame-x.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,6 +1,6 @@ /* Functions for the X window system. Copyright (C) 1989, 1992-5, 1997 Free Software Foundation, Inc. - Copyright (C) 1995, 1996, 2001, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -21,10 +21,10 @@ /* Synched up with: Not synched with FSF. */ +/* This file has been Mule-ized, Ben Wing, 10-14-04. */ + /* Substantially rewritten for XEmacs. */ -/* 7-8-00 !!#### This file needs definite Mule review. */ - #include <config.h> #include "lisp.h" @@ -271,8 +271,8 @@ if (cw <= 0 || ch <= 0) abort (); - XtSetArg (al [0], XtNwidthInc, cw); - XtSetArg (al [1], XtNheightInc, ch); + XtSetArg (al[0], XtNwidthInc, cw); + XtSetArg (al[1], XtNheightInc, ch); XtSetValues (wmshell, al, 2); } @@ -289,8 +289,8 @@ fflush (stdout); #endif - XtSetArg (al [0], XtNwidthCells, width); - XtSetArg (al [1], XtNheightCells, height); + XtSetArg (al[0], XtNwidthCells, width); + XtSetArg (al[1], XtNheightCells, height); XtSetValues (wmshell, al, 2); } @@ -314,7 +314,7 @@ int format = 0; unsigned long nitems = 0; unsigned long bytes_after; - unsigned char *prop_return = 0; /* semantically a void* */ + Rawbyte *prop_return = 0; /* semantically a void* */ if (Success == XGetWindowProperty (dpy, w, DEVICE_XATOM_WM_PROTOCOLS (d), 0, 100, False, XA_ATOM, @@ -330,7 +330,7 @@ else if (atoms[nitems] == DEVICE_XATOM_WM_TAKE_FOCUS (d)) need_focus = 0; } - if (prop_return) XFree ((char *) prop_return); + if (prop_return) XFree ((CRawbyte *) prop_return); } { Atom props [10]; @@ -339,15 +339,15 @@ if (need_focus) props[count++] = DEVICE_XATOM_WM_TAKE_FOCUS (d); if (count) XChangeProperty (dpy, w, DEVICE_XATOM_WM_PROTOCOLS (d), XA_ATOM, 32, - PropModeAppend, (unsigned char *) props, count); + PropModeAppend, (Rawbyte *) props, count); } } static void -x_wm_store_class_hints (Widget shell, char *frame_name) +x_wm_store_class_hints (Widget shell, Extbyte *frame_name) { Display *dpy = XtDisplay (shell); - char *app_name, *app_class; + Extbyte *app_name, *app_class; XClassHint classhint; if (!XtIsWMShell (shell)) @@ -360,6 +360,7 @@ } #ifndef HAVE_WMCOMMAND + static void x_wm_maybe_store_wm_command (struct frame *f) { @@ -372,7 +373,7 @@ if (NILP (DEVICE_X_WM_COMMAND_FRAME (d))) { int argc; - char **argv; + Wexttext **argv; make_argc_argv (Vcommand_line_args, &argc, &argv); XSetCommand (XtDisplay (w), XtWindow (w), argv, argc); free_argc_argv (argv); @@ -410,6 +411,7 @@ } } + #endif /* !HAVE_WMCOMMAND */ int @@ -418,7 +420,7 @@ Atom actual_type; int actual_format; unsigned long nitems, bytesafter; - unsigned char *datap = 0; + Rawbyte *datap = 0; Widget widget; int result = -1; struct device *d = XDEVICE (FRAME_DEVICE (f)); @@ -434,7 +436,7 @@ unsigned long *ul_result_ptr = (unsigned long *) datap; if (nitems <= 2) /* "suggested" by ICCCM version 1 */ result = (int) ul_result_ptr[0]; - XFree ((char *) datap); + XFree ((CRawbyte *) datap); } return result; @@ -643,7 +645,7 @@ for (ptr = value; *ptr; ptr++) if (!byte_ascii_p (*ptr)) { - const char * tmp; + const Extbyte *tmp; encoding = DEVICE_XATOM_COMPOUND_TEXT (XDEVICE (FRAME_DEVICE (f))); C_STRING_TO_EXTERNAL (value, tmp, Qctext); new_XtValue = (String) tmp; @@ -685,12 +687,12 @@ x_set_initial_frame_size (struct frame *f, int flags, int x, int y, int w, int h) { - char shell_geom [255]; + Ascbyte shell_geom[255]; int xval, yval; - char xsign, ysign; - char uspos = !!(flags & (XValue | YValue)); - char ussize = !!(flags & (WidthValue | HeightValue)); - char *temp; + Ascbyte xsign, ysign; + Boolbyte uspos = !!(flags & (XValue | YValue)); + Boolbyte ussize = !!(flags & (WidthValue | HeightValue)); + Ascbyte *temp; /* assign the correct size to the EmacsFrame widget ... */ EmacsFrameSetCharSize (FRAME_X_TEXT_WIDGET (f), w, h); @@ -708,7 +710,7 @@ if (uspos || ussize) { - temp = (char *) xmalloc (1 + strlen (shell_geom)); + temp = xnew_ascbytes (1 + strlen (shell_geom)); strcpy (temp, shell_geom); FRAME_X_GEOM_FREE_ME_PLEASE (f) = temp; } @@ -742,21 +744,27 @@ if (STRINGP (prop)) { - const char *extprop; + const Extbyte *extprop; if (XSTRING_LENGTH (prop) == 0) continue; - LISP_STRING_TO_EXTERNAL (prop, extprop, Qctext); + LISP_STRING_TO_EXTERNAL (prop, extprop, Qxt_widget_arg_encoding); if (STRINGP (val)) { const Extbyte *extval; Bytecount extvallen; + /* !!#### I seriously doubt there is a single external format + for the value of a widget argument; it depends on the + semantics of the argument. So use of + Qxt_widget_arg_encoding is totally bogus. --ben */ TO_EXTERNAL_FORMAT (LISP_STRING, val, ALLOCA, (extval, extvallen), - Qctext); + Qxt_widget_arg_encoding); XtVaSetValues (w, XtVaTypedArg, extprop, + /* !!#### Verify this + 1 and document + as zero-termination */ XtRString, extval, extvallen + 1, (XtArgVal) NULL); } @@ -769,6 +777,7 @@ { Lisp_Object str = Fget (prop, Qx_resource_name, Qnil); int int_p = !NILP (Fget (prop, Qintegerp, Qnil)); + Extbyte *strext; if (NILP (prop) || NILP (str)) { @@ -796,14 +805,14 @@ /* Kludge the width/height so that we interpret them in characters instead of pixels. Yuck yuck yuck. */ - if (!strcmp ((char *) XSTRING_DATA (str), "width")) + if (!qxestrcmp_ascii (XSTRING_DATA (str), "width")) { CHECK_INT (val); width = XINT (val); width_specified_p = True; continue; } - if (!strcmp ((char *) XSTRING_DATA (str), "height")) + if (!qxestrcmp_ascii (XSTRING_DATA (str), "height")) { CHECK_INT (val); height = XINT (val); @@ -811,14 +820,14 @@ continue; } /* Further kludge the x/y. */ - if (!strcmp ((char *) XSTRING_DATA (str), "x")) + if (!qxestrcmp_ascii (XSTRING_DATA (str), "x")) { CHECK_INT (val); x = (Position) XINT (val); x_position_specified_p = True; continue; } - if (!strcmp ((char *) XSTRING_DATA (str), "y")) + if (!qxestrcmp_ascii (XSTRING_DATA (str), "y")) { CHECK_INT (val); y = (Position) XINT (val); @@ -827,41 +836,46 @@ } /* Have you figured out by now that this entire function is one gigantic kludge? */ - if (!strcmp ((char *) XSTRING_DATA (str), - "internalBorderWidth")) + if (!qxestrcmp_ascii (XSTRING_DATA (str), "internalBorderWidth")) { internal_border_width_specified = True; } + LISP_STRING_TO_EXTERNAL (str, strext, Qxt_widget_arg_encoding); if (int_p) { CHECK_INT (val); - Xt_SET_VALUE (w, (char *) XSTRING_DATA (str), XINT (val)); + Xt_SET_VALUE (w, strext, XINT (val)); } else if (EQ (val, Qt)) { - Xt_SET_VALUE (w, (char *) XSTRING_DATA (str), True); /* XtN...*/ + Xt_SET_VALUE (w, strext, True); /* XtN...*/ } else if (EQ (val, Qnil)) { - Xt_SET_VALUE (w, (char *) XSTRING_DATA (str), False); /* XtN...*/ + Xt_SET_VALUE (w, strext, False); /* XtN...*/ } else { CHECK_STRING (val); + const Extbyte *extval; + Bytecount extvallen; + + TO_EXTERNAL_FORMAT (LISP_STRING, val, + ALLOCA, (extval, extvallen), + Qxt_widget_arg_encoding); XtVaSetValues (w, XtVaTypedArg, /* XtN... */ - (char *) XSTRING_DATA (str), - XtRString, - XSTRING_DATA (val), - XSTRING_LENGTH (val) + 1, + strext, + /* !!#### Verify this + 1 and document + as zero-termination */ + XtRString, extval, extvallen + 1, (XtArgVal) NULL); } #ifdef HAVE_SCROLLBARS - if (!strcmp ((char *) XSTRING_DATA (str), "scrollBarWidth") - || !strcmp ((char *) XSTRING_DATA (str), - "scrollBarHeight")) + if (!qxestrcmp_ascii (XSTRING_DATA (str), "scrollBarWidth") + || !qxestrcmp_ascii (XSTRING_DATA (str), "scrollBarHeight")) { x_update_frame_scrollbars (f); } @@ -941,36 +955,131 @@ if (!frame_title_format_already_set) { /* No doubt there's a less stupid way to do this. */ - char *results [2]; - XtResource resources [2]; - results [0] = results [1] = 0; - resources [0].resource_name = XtNtitle; - resources [0].resource_class = XtCTitle; - resources [0].resource_type = XtRString; - resources [0].resource_size = sizeof (String); - resources [0].resource_offset = 0; - resources [0].default_type = XtRString; - resources [0].default_addr = 0; - resources [1].resource_name = XtNiconName; - resources [1].resource_class = XtCIconName; - resources [1].resource_type = XtRString; - resources [1].resource_size = sizeof (String); - resources [1].resource_offset = sizeof (char *); - resources [1].default_type = XtRString; - resources [1].default_addr = 0; + Extbyte *results[2]; + XtResource resources[2]; + results[0] = results[1] = 0; + resources[0].resource_name = XtNtitle; + resources[0].resource_class = XtCTitle; + resources[0].resource_type = XtRString; + resources[0].resource_size = sizeof (String); + resources[0].resource_offset = 0; + resources[0].default_type = XtRString; + resources[0].default_addr = 0; + resources[1].resource_name = XtNiconName; + resources[1].resource_class = XtCIconName; + resources[1].resource_type = XtRString; + resources[1].resource_size = sizeof (String); + resources[1].resource_offset = sizeof (Extbyte *); + resources[1].default_type = XtRString; + resources[1].default_addr = 0; XtGetSubresources (XtParent (shell), (XtPointer) results, shell->core.name, shell->core.widget_class->core_class.class_name, resources, XtNumber (resources), 0, 0); if (results[0]) - Vframe_title_format = build_string (results[0]); + Vframe_title_format = build_ext_string (results[0], Qctext); if (results[1]) - Vframe_icon_title_format = build_string (results[1]); + Vframe_icon_title_format = build_ext_string (results[1], Qctext); } frame_title_format_already_set = 1; } +#if defined (HAVE_CDE) || defined (HAVE_OFFIX_DND) + +static Extbyte * +start_drag_internal_1 (Lisp_Object event, Lisp_Object data, + Lisp_Object encoding, XEvent *x_event, int listp, + Widget *wid_out, Bytecount *len_out, + int *num_items_out) +{ + struct frame *f; + Widget wid; + struct device *d; + struct x_device *xd; + XWindowAttributes win_attrib; + int modifier = 0, state = 0; + Extbyte *dnd_data; + Lisp_Event *lisp_event; + + CHECK_EVENT (event); + lisp_event = XEVENT (event); + if (EVENT_TYPE (lisp_event) != button_press_event) + invalid_argument ("Need button-press event for drag", event); + f = decode_x_frame (FW_FRAME (EVENT_CHANNEL (lisp_event))); + wid = FRAME_X_TEXT_WIDGET (f); + d = XDEVICE (FRAME_DEVICE (f)); + xd = DEVICE_X_DATA (d); + *num_items_out = 0; + + if (listp) + { + DECLARE_EISTRING (ei); + + EXTERNAL_LIST_LOOP_2 (elt, data) + { + CHECK_STRING (elt); + eicat_lstr (ei, elt); + eicat_ch (ei, '\0'); + (*num_items_out)++; + } + eicat_ch (ei, '\0'); + SIZED_C_STRING_TO_SIZED_EXTERNAL_MALLOC (eidata (ei), eilen (ei), + dnd_data, *len_out, + encoding); + } + else + { + CHECK_STRING (data); + LISP_STRING_TO_SIZED_EXTERNAL_MALLOC (data, dnd_data, *len_out, + encoding); + *len_out += EXTTEXT_ZTERM_SIZE; + (*num_items_out)++; + } + + /* not so gross hack that converts an emacs event back to a XEvent */ + + x_event->xbutton.type = ButtonPress; + x_event->xbutton.send_event = False; + x_event->xbutton.display = XtDisplayOfObject (wid); + x_event->xbutton.window = XtWindowOfObject (wid); + x_event->xbutton.root = XRootWindow (x_event->xbutton.display, 0); + x_event->xbutton.subwindow = 0; + x_event->xbutton.time = lisp_event->timestamp; + x_event->xbutton.x = EVENT_BUTTON_X (lisp_event); + x_event->xbutton.y = EVENT_BUTTON_Y (lisp_event); + if (Success == XGetWindowAttributes (x_event->xbutton.display, + x_event->xbutton.window, + &win_attrib)) + { + x_event->xbutton.x_root = win_attrib.x + EVENT_BUTTON_X (lisp_event); + x_event->xbutton.y_root = win_attrib.y + EVENT_BUTTON_Y (lisp_event); + } + else + { + x_event->xbutton.x_root = EVENT_BUTTON_X (lisp_event); /* this is wrong */ + x_event->xbutton.y_root = EVENT_BUTTON_Y (lisp_event); + } + + modifier = EVENT_BUTTON_MODIFIERS (lisp_event); + if (modifier & XEMACS_MOD_SHIFT) state |= ShiftMask; + if (modifier & XEMACS_MOD_CONTROL) state |= ControlMask; + if (modifier & XEMACS_MOD_META) state |= xd->MetaMask; + if (modifier & XEMACS_MOD_SUPER) state |= xd->SuperMask; + if (modifier & XEMACS_MOD_HYPER) state |= xd->HyperMask; + if (modifier & XEMACS_MOD_ALT) state |= xd->AltMask; + state |= Button1Mask << (EVENT_BUTTON_BUTTON (lisp_event) - 1); + + x_event->xbutton.state = state; + x_event->xbutton.button = EVENT_BUTTON_BUTTON (lisp_event); + x_event->xbutton.same_screen = True; + + *wid_out = wid; + return dnd_data; +} + +#endif /* defined (HAVE_CDE) || defined (HAVE_OFFIX_DND) */ + #ifdef HAVE_CDE #include <Dt/Dt.h> #include <Dt/Dnd.h> @@ -985,7 +1094,7 @@ XtPointer callData) { DtDndDragFinishCallbackStruct *dragFinishInfo = - (DtDndDragFinishCallbackStruct *)callData; + (DtDndDragFinishCallbackStruct *) callData; DtDndContext *dragData = dragFinishInfo->dragData; int i; @@ -996,7 +1105,7 @@ { for (i = 0; i < dragData->numItems; i++) { - XtFree((char *) dragData->data.buffers[i].bp); + XtFree ((CRawbyte *) dragData->data.buffers[i].bp); if (dragData->data.buffers[i].name) XtFree(dragData->data.buffers[i].name); } @@ -1020,8 +1129,8 @@ { DtDndConvertCallbackStruct *convertInfo = (DtDndConvertCallbackStruct *) callData; - char *textdata = (char *) clientData; - char *textptr = NULL; + Extbyte *textdata = (Extbyte *) clientData; + Extbyte *textptr = NULL; int i; if (convertInfo == NULL) @@ -1036,19 +1145,19 @@ return; } - for (textptr=textdata, i=0; - i<convertInfo->dragData->numItems; - textptr+=strlen(textptr)+1, i++) + for (textptr = textdata, i = 0; + i < convertInfo->dragData->numItems; + textptr += strlen (textptr) + 1, i++) { if (convertInfo->dragData->protocol == DtDND_BUFFER_TRANSFER) { - convertInfo->dragData->data.buffers[i].bp = XtNewString(textptr); - convertInfo->dragData->data.buffers[i].size = strlen(textptr); + convertInfo->dragData->data.buffers[i].bp = XtNewString (textptr); + convertInfo->dragData->data.buffers[i].size = strlen (textptr); convertInfo->dragData->data.buffers[i].name = NULL; } else { - convertInfo->dragData->data.files[i] = XtNewString(textptr); + convertInfo->dragData->data.files[i] = XtNewString (textptr); } } @@ -1056,7 +1165,7 @@ } static Lisp_Object -abort_current_drag(Lisp_Object arg) +abort_current_drag (Lisp_Object arg) { if (CurrentDragWidget && drag_not_done) { @@ -1077,140 +1186,46 @@ */ (event, dragtype, dragdata)) { - if (EVENTP (event)) - { - struct frame *f = decode_x_frame (Fselected_frame (Qnil)); - XEvent x_event; - Widget wid = FRAME_X_TEXT_WIDGET (f); - Display *display = XtDisplayOfObject (wid); - struct device *d = get_device_from_display (display); - struct x_device *xd = DEVICE_X_DATA (d); - XWindowAttributes win_attrib; - int modifier = 0, state = 0; - char *Ctext; - int numItems = 0, textlen = 0, pos = 0; - Lisp_Event *lisp_event = XEVENT (event); - Lisp_Object item = Qnil; - struct gcpro gcpro1; - - /* only drag if this is really a press */ - if (EVENT_TYPE(lisp_event) != button_press_event - || !LISTP(dragdata)) - return Qnil; - - GCPRO1 (item); - - /* - * not so cross hack that converts a emacs event back to a XEvent - */ - - x_event.xbutton.type = ButtonPress; - x_event.xbutton.send_event = False; - x_event.xbutton.display = XtDisplayOfObject(wid); - x_event.xbutton.window = XtWindowOfObject(wid); - x_event.xbutton.root = XRootWindow(x_event.xbutton.display, 0); - x_event.xbutton.subwindow = 0; - x_event.xbutton.time = lisp_event->timestamp; - x_event.xbutton.x = EVENT_BUTTON_X (lisp_event); - x_event.xbutton.y = EVENT_BUTTON_Y (lisp_event); - if (Success == XGetWindowAttributes (x_event.xbutton.display, - x_event.xbutton.window, - &win_attrib)) - { - x_event.xbutton.x_root = win_attrib.x + EVENT_BUTTON_X (lisp_event); - x_event.xbutton.y_root = win_attrib.y + EVENT_BUTTON_Y (lisp_event); - } - else - { - x_event.xbutton.x_root = EVENT_BUTTON_X (lisp_event); /* this is wrong */ - x_event.xbutton.y_root = EVENT_BUTTON_Y (lisp_event); - } - modifier = EVENT_BUTTON_MODIFIERS (lisp_event); - if (modifier & XEMACS_MOD_SHIFT) state |= ShiftMask; - if (modifier & XEMACS_MOD_CONTROL) state |= ControlMask; - if (modifier & XEMACS_MOD_META) state |= xd->MetaMask; - if (modifier & XEMACS_MOD_SUPER) state |= xd->SuperMask; - if (modifier & XEMACS_MOD_HYPER) state |= xd->HyperMask; - if (modifier & XEMACS_MOD_ALT) state |= xd->AltMask; - state |= Button1Mask << (EVENT_BUTTON_BUTTON (lisp_event)-1); - - x_event.xbutton.state = state; - x_event.xbutton.button = EVENT_BUTTON_BUTTON (lisp_event); - x_event.xkey.same_screen = True; - - /* convert data strings into a big string */ - item = dragdata; - while (!NILP (item)) - { - if (!STRINGP (XCAR (item))) - { - numItems=0; - break; - } - textlen += XSTRING_LENGTH (XCAR (item)) + 1; - numItems++; - item = XCDR (item); - } - - if (numItems) - { - /* - * concatenate all strings given to one large string, with - * \0 as separator. List is ended by \0. - */ - Ctext = (char *)xmalloc (textlen+1); - Ctext[0] = 0; - - item = dragdata; - while (!NILP (item)) - { - if (!STRINGP (XCAR (item))) - { - numItems=0; - xfree(Ctext, char *); - Ctext=NULL; - break; - } - strcpy (Ctext+pos, (const char *)XSTRING_DATA (XCAR (item))); - pos += XSTRING_LENGTH (XCAR (item)) + 1; - item = XCDR (item); - } - Ctext[pos] = 0; - - dnd_convert_cb_rec[0].callback = x_cde_convert_callback; - dnd_convert_cb_rec[0].closure = (XtPointer) Ctext; - dnd_convert_cb_rec[1].callback = NULL; - dnd_convert_cb_rec[1].closure = NULL; - - dnd_destroy_cb_rec[0].callback = x_cde_destroy_callback; - dnd_destroy_cb_rec[0].closure = (XtPointer) Ctext; - dnd_destroy_cb_rec[1].callback = NULL; - dnd_destroy_cb_rec[1].closure = NULL; - - CurrentDragWidget = - DtDndDragStart (wid, &x_event, - (NILP(dragtype)?DtDND_BUFFER_TRANSFER:DtDND_FILENAME_TRANSFER), - numItems, - XmDROP_COPY, - dnd_convert_cb_rec, - dnd_destroy_cb_rec, - NULL, 0); - } - - UNGCPRO; - - return numItems?Qt:Qnil; - } - - return Qnil; + Extbyte *dnd_data; + XEvent x_event; + Bytecount dnd_len; + Widget wid; + int num_items; + + dnd_data = start_drag_internal_1 (event, dragdata, Qdt_dnd_encoding, + &x_event, 1, + &wid, &dnd_len, &num_items); + + dnd_convert_cb_rec[0].callback = x_cde_convert_callback; + dnd_convert_cb_rec[0].closure = (XtPointer) dnd_data; + dnd_convert_cb_rec[1].callback = NULL; + dnd_convert_cb_rec[1].closure = NULL; + + dnd_destroy_cb_rec[0].callback = x_cde_destroy_callback; + dnd_destroy_cb_rec[0].closure = (XtPointer) dnd_data; + dnd_destroy_cb_rec[1].callback = NULL; + dnd_destroy_cb_rec[1].closure = NULL; + + CurrentDragWidget = + DtDndDragStart (wid, &x_event, + (NILP (dragtype) ? DtDND_BUFFER_TRANSFER : + DtDND_FILENAME_TRANSFER), + num_items, + XmDROP_COPY, + dnd_convert_cb_rec, + dnd_destroy_cb_rec, + NULL, 0); + + xfree (dnd_data, Extbyte *); + + return num_items ? Qt : Qnil; } static void x_cde_transfer_callback (Widget widget, XtPointer clientData, XtPointer callData) { - char *filePath, *hurl; - int ii, enqueue=1; + int ii, enqueue = 1; Lisp_Object frame = Qnil; Lisp_Object l_type = Qnil; Lisp_Object l_data = Qnil; @@ -1239,53 +1254,62 @@ for (ii = 0; ii < transferInfo->dropData->numItems; ii++) { - filePath = transferInfo->dropData->data.files[ii]; - hurl = dnd_url_hexify_string ((char *)filePath, "file:"); - /* #### Mule-izing required */ - l_data = Fcons (make_string ((Ibyte* )hurl, - strlen (hurl)), - l_data); - xfree (hurl, char *); + Ibyte *fileint; + Ibyte *hurl; + + EXTERNAL_TO_C_STRING (transferInfo->dropData->data.files[ii], + fileint, Qfile_name); + + hurl = dnd_url_hexify_string (fileint, "file:"); + l_data = Fcons (build_intstring (hurl), l_data); + xfree (hurl, Ibyte *); } } else if (transferInfo->dropData->protocol == DtDND_BUFFER_TRANSFER) { - int speccount = specpdl_depth(); - - /* Problem: all buffers a treated as text/plain!!! - Solution: Also support DtDND_TEXT_TRANSFER + int speccount = specpdl_depth (); + + /* !!#### Problem: all buffers a treated as text/plain!!! + Not appropriate for intl text. Note that there is a function + DtDtsBufferToDataType(), but I don't know what the possible + return values are. + Solution (?): Also support DtDND_TEXT_TRANSFER (compound text) perhaps implementation of the Motif protocol (which is the base of CDE) will clear this */ l_type = Qdragdrop_MIME; - record_unwind_protect(abort_current_drag, Qnil); + record_unwind_protect (abort_current_drag, Qnil); drag_not_done = 1; for (ii = 0; ii < transferInfo->dropData->numItems; ii++) { /* let us forget this name thing for now... */ /* filePath = transferInfo->dropData->data.buffers[ii].name; path = (filePath == NULL) ? Qnil - : make_string ((Ibyte *)filePath, strlen (filePath)); */ + : build_ext_string (filePath, Q???); */ /* what, if the data is no text, and how can I tell it? */ - l_data = Fcons ( list3 ( list1 ( make_string ((Ibyte *)"text/plain", 10) ), - make_string ((Ibyte *)"8bit", 4), - make_string ((Ibyte *)transferInfo->dropData->data.buffers[ii].bp, - transferInfo->dropData->data.buffers[ii].size) ), - l_data ); + l_data = + Fcons (list3 (list1 (build_string ("text/plain")), + build_string ("8bit"), + make_ext_string + (transferInfo->dropData->data.buffers[ii].bp, + transferInfo->dropData->data.buffers[ii].size, + /* !!#### what goes here? */ + Qdt_dnd_encoding)), + l_data); } drag_not_done = 0; unbind_to (speccount); } else /* the other cases: NOOP_TRANSFER */ - enqueue=0; + enqueue = 0; /* The Problem: no button and mods from CDE... */ if (enqueue) - enqueue_misc_user_event_pos ( frame, Qdragdrop_drop_dispatch, - Fcons (l_type, l_data), - 0 /* this is the button */, - 0 /* these are the mods */, - transferInfo->x, - transferInfo->y); + enqueue_misc_user_event_pos (frame, Qdragdrop_drop_dispatch, + Fcons (l_type, l_data), + 0 /* this is the button */, + 0 /* these are the mods */, + transferInfo->x, + transferInfo->y); UNGCPRO; return; @@ -1303,115 +1327,30 @@ */ (event, data, dtyp)) { - if (EVENTP(event)) + Extbyte *dnd_data; + XEvent x_event; + Bytecount dnd_len; + Widget wid; + int num_items; + int dnd_type = DndText; + + if (!NILP (dtyp)) { - struct frame *f = decode_x_frame (Fselected_frame (Qnil)); - XEvent x_event; - Widget wid = FRAME_X_TEXT_WIDGET (f); - Display *display = XtDisplayOfObject (wid); - struct device *d = get_device_from_display (display); - struct x_device *xd = DEVICE_X_DATA (d); - XWindowAttributes win_attrib; - int modifier = 0, state = 0; - char *dnd_data = NULL; - long dnd_len = 0; - int dnd_typ = DndText, dnd_dealloc = 0; - Lisp_Event *lisp_event = XEVENT (event); - - /* only drag if this is really a press */ - if (EVENT_TYPE(lisp_event) != button_press_event) - return Qnil; - - /* get the desired type */ - if (!NILP (dtyp) && INTP (dtyp)) - dnd_typ = XINT (dtyp); - - if (dnd_typ == DndFiles) - { - Lisp_Object run = data; - int len = 0; - - if (NILP ( Flistp (data))) - return Qnil; - - /* construct the data from a list of files */ - dnd_len = 1; - dnd_data = (char *) xmalloc (1); - *dnd_data = 0; - while (!NILP (run)) - { - if (!STRINGP (XCAR (run))) - { - xfree (dnd_data, char *); - return Qnil; - } - len = XSTRING_LENGTH (XCAR (run)) + 1; - dnd_data = (char *) xrealloc (dnd_data, dnd_len + len); - strcpy (dnd_data + dnd_len - 1, (const char *)XSTRING_DATA (XCAR (run))); - dnd_len += len; - run = XCDR (run); - } - - dnd_data[dnd_len - 1] = 0; /* the list-ending zero */ - dnd_dealloc = 1; - - } - else - { - if (!STRINGP (data)) - return Qnil; - - /* and what's with MULE data ??? */ - dnd_data = (char *)XSTRING_DATA (data); - dnd_len = XSTRING_LENGTH (data) + 1; /* the zero */ - - } - - /* not so gross hack that converts an emacs event back to a XEvent */ - - x_event.xbutton.type = ButtonPress; - x_event.xbutton.send_event = False; - x_event.xbutton.display = XtDisplayOfObject(wid); - x_event.xbutton.window = XtWindowOfObject(wid); - x_event.xbutton.root = XRootWindow(x_event.xkey.display, 0); - x_event.xbutton.subwindow = 0; - x_event.xbutton.time = lisp_event->timestamp; - x_event.xbutton.x = EVENT_BUTTON_X (lisp_event); - x_event.xbutton.y = EVENT_BUTTON_Y (lisp_event); - if (Success == XGetWindowAttributes (x_event.xbutton.display, - x_event.xbutton.window, - &win_attrib)) - { - x_event.xbutton.x_root = win_attrib.x + EVENT_BUTTON_X (lisp_event); - x_event.xbutton.y_root = win_attrib.y + EVENT_BUTTON_Y (lisp_event); - } - else - { - x_event.xbutton.x_root = EVENT_BUTTON_X (lisp_event); /* this is wrong */ - x_event.xbutton.y_root = EVENT_BUTTON_Y (lisp_event); - } - - modifier = EVENT_BUTTON_MODIFIERS (lisp_event); - if (modifier & XEMACS_MOD_SHIFT) state |= ShiftMask; - if (modifier & XEMACS_MOD_CONTROL) state |= ControlMask; - if (modifier & XEMACS_MOD_META) state |= xd->MetaMask; - if (modifier & XEMACS_MOD_SUPER) state |= xd->SuperMask; - if (modifier & XEMACS_MOD_HYPER) state |= xd->HyperMask; - if (modifier & XEMACS_MOD_ALT) state |= xd->AltMask; - state |= Button1Mask << (EVENT_BUTTON_BUTTON (lisp_event)-1); - - x_event.xbutton.state = state; - x_event.xbutton.button = EVENT_BUTTON_BUTTON (lisp_event); - x_event.xkey.same_screen = True; - - DndSetData(dnd_typ, (unsigned char *)dnd_data, dnd_len); - if (dnd_dealloc) - xfree (dnd_data, char *); - - /* the next thing blocks everything... */ - if (DndHandleDragging(wid, &x_event)) - return Qt; + CHECK_INT (dtyp); + dnd_type = XINT (dtyp); } + + dnd_data = start_drag_internal_1 (event, data, Qoffix_dnd_encoding, + &x_event, dnd_type == DndFiles, + &wid, &dnd_len, &num_items); + + DndSetData (dnd_type, (UExtbyte *) dnd_data, dnd_len); + xfree (dnd_data, Extbyte *); + + /* the next thing blocks everything... */ + if (DndHandleDragging (wid, &x_event)) + return Qt; + return Qnil; } @@ -1516,7 +1455,7 @@ unsigned int h = 40; int flags = 0; - char *geom = 0, *ew_geom = 0; + Ascbyte *geom = 0, *ew_geom = 0; Boolean iconic_p = False, ew_iconic_p = False; Widget wmshell = FRAME_X_SHELL_WIDGET (f); @@ -1846,8 +1785,8 @@ #ifdef EXTERNAL_WIDGET Window window_id = 0; #endif - const char *name; - Arg al [25]; + const Extbyte *name; + Arg al[25]; int ac = 0; Widget text, container, shell; Widget parentwid = 0; @@ -1879,26 +1818,29 @@ #ifndef EXTERNAL_WIDGET if (!NILP (lisp_window_id)) - signal_error (Qunimplemented, "support for external widgets was not enabled at compile-time", Qunbound); + signal_error + (Qunimplemented, + "support for external widgets was not enabled at compile-time", + Qunbound); #else if (!NILP (lisp_window_id)) { - char *string; + Ibyte *string; CHECK_STRING (lisp_window_id); - string = (char *) XSTRING_DATA (lisp_window_id); + string = XSTRING_DATA (lisp_window_id); if (string[0] == '0' && (string[1] == 'x' || string[1] == 'X')) - sscanf (string+2, "%lxu", &window_id); + qxesscanf_ascii_1 (string + 2, "%lxu", &window_id); #if 0 else if (string[0] == 'w') { - sscanf (string+1, "%x", &parent_widget); + qxesscanf_ascii (string + 1, "%x", &parent_widget); if (parent_widget) window_id = XtWindow (parent_widget); } #endif else - sscanf (string, "%lu", &window_id); + qxesscanf_ascii_1 (string, "%lu", &window_id); if (!is_valid_window (window_id, d)) signal_ferror (Qinvalid_argument, "Invalid window %lu", (unsigned long) window_id); @@ -2009,14 +1951,14 @@ ShellWidget shell_widget = (ShellWidget) widget; XtGrabKind call_data = XtGrabNone; - XtCallCallbacks (widget, XtNpopupCallback, (XtPointer)&call_data); + XtCallCallbacks (widget, XtNpopupCallback, (XtPointer) &call_data); shell_widget->shell.popped_up = TRUE; shell_widget->shell.grab_kind = XtGrabNone; shell_widget->shell.spring_loaded = False; if (shell_widget->shell.create_popup_child_proc != NULL) - (*(shell_widget->shell.create_popup_child_proc))(widget); + (*(shell_widget->shell.create_popup_child_proc)) (widget); /* The XtSetValues below are not in XtPopup menu. We just want to make absolutely sure... */ @@ -2113,7 +2055,7 @@ */ XChangeProperty (XtDisplay (frame_widget), XtWindow (frame_widget), DEVICE_XATOM_WM_PROTOCOLS (d), XA_ATOM, 32, PropModeAppend, - (unsigned char*) NULL, 0); + (Rawbyte *) NULL, 0); x_send_synthetic_mouse_event (f); } @@ -2225,9 +2167,9 @@ /* Store the X data into the widget. */ { - Arg al [2]; - XtSetArg (al [0], XtNiconPixmap, x_pixmap); - XtSetArg (al [1], XtNiconMask, x_mask); + Arg al[2]; + XtSetArg (al[0], XtNiconPixmap, x_pixmap); + XtSetArg (al[1], XtNiconMask, x_mask); XtSetValues (FRAME_X_SHELL_WIDGET (f), al, 2); } } @@ -2290,11 +2232,11 @@ Dimension frame_h = DisplayHeight (dpy, DefaultScreen (dpy)); Dimension shell_w, shell_h, shell_bord; int win_gravity; - Arg al [3]; - - XtSetArg (al [0], XtNwidth, &shell_w); - XtSetArg (al [1], XtNheight, &shell_h); - XtSetArg (al [2], XtNborderWidth, &shell_bord); + Arg al[3]; + + XtSetArg (al[0], XtNwidth, &shell_w); + XtSetArg (al[1], XtNheight, &shell_h); + XtSetArg (al[2], XtNborderWidth, &shell_bord); XtGetValues (w, al, 3); win_gravity = @@ -2311,9 +2253,9 @@ come back at the right place. We can't look at s->visible to determine whether it is iconified because it might not be up-to-date yet (the queue might not be processed). */ - XtSetArg (al [0], XtNwinGravity, win_gravity); - XtSetArg (al [1], XtNx, xoff); - XtSetArg (al [2], XtNy, yoff); + XtSetArg (al[0], XtNwinGravity, win_gravity); + XtSetArg (al[1], XtNx, xoff); + XtSetArg (al[2], XtNy, yoff); XtSetValues (w, al, 3); /* Sometimes you will find that @@ -2684,7 +2626,7 @@ if (FRAME_X_GEOM_FREE_ME_PLEASE (f)) { - xfree (FRAME_X_GEOM_FREE_ME_PLEASE (f), char *); + xfree (FRAME_X_GEOM_FREE_ME_PLEASE (f), Ascbyte *); FRAME_X_GEOM_FREE_ME_PLEASE (f) = 0; } @@ -2696,7 +2638,7 @@ } static void -x_update_frame_external_traits (struct frame* frm, Lisp_Object name) +x_update_frame_external_traits (struct frame *frm, Lisp_Object name) { Arg al[10]; int ac = 0;
--- a/src/frame.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/frame.c Thu Nov 04 23:08:28 2004 +0000 @@ -144,13 +144,13 @@ static const struct memory_description frame_data_description_1 []= { #ifdef HAVE_GTK - { XD_STRUCT_PTR, gtk_console, 1, >k_frame_data_description}, + { XD_BLOCK_PTR, gtk_console, 1, >k_frame_data_description}, #endif #ifdef HAVE_MS_WINDOWS - { XD_STRUCT_PTR, mswindows_console, 1, &mswindows_frame_data_description}, + { XD_BLOCK_PTR, mswindows_console, 1, &mswindows_frame_data_description}, #endif #ifdef HAVE_X_WINDOWS - { XD_STRUCT_PTR, x_console, 1, &x_frame_data_description}, + { XD_BLOCK_PTR, x_console, 1, &x_frame_data_description}, #endif { XD_END } }; @@ -162,7 +162,7 @@ extern const struct sized_memory_description expose_ignore_description; static const struct memory_description expose_ignore_description_1 [] = { - { XD_STRUCT_PTR, offsetof (struct expose_ignore, next), + { XD_BLOCK_PTR, offsetof (struct expose_ignore, next), 1, &expose_ignore_description }, { XD_END } }; @@ -173,7 +173,7 @@ }; static const struct memory_description display_line_dynarr_pointer_description_1 []= { - { XD_STRUCT_PTR, 0, 1, &display_line_dynarr_description}, + { XD_BLOCK_PTR, 0, 1, &display_line_dynarr_description}, { XD_END } }; @@ -188,9 +188,9 @@ { XD_LISP_OBJECT_ARRAY, offsetof (struct frame, slot), size }, #include "frameslots.h" - { XD_STRUCT_PTR, offsetof (struct frame, subwindow_exposures), + { XD_BLOCK_PTR, offsetof (struct frame, subwindow_exposures), 1, &expose_ignore_description }, - { XD_STRUCT_PTR, offsetof (struct frame, subwindow_exposures_tail), + { XD_BLOCK_PTR, offsetof (struct frame, subwindow_exposures_tail), 1, &expose_ignore_description }, #ifdef HAVE_SCROLLBARS @@ -198,12 +198,12 @@ { XD_LISP_OBJECT, offsetof (struct frame, sb_hcache) }, #endif /* HAVE_SCROLLBARS */ - { XD_STRUCT_ARRAY, offsetof (struct frame, current_display_lines), + { XD_BLOCK_ARRAY, offsetof (struct frame, current_display_lines), 4, &display_line_dynarr_pointer_description }, - { XD_STRUCT_ARRAY, offsetof (struct frame, desired_display_lines), + { XD_BLOCK_ARRAY, offsetof (struct frame, desired_display_lines), 4, &display_line_dynarr_pointer_description }, - { XD_STRUCT_PTR, offsetof (struct frame, framemeths), 1, + { XD_BLOCK_PTR, offsetof (struct frame, framemeths), 1, &console_methods_description }, { XD_UNION, offsetof (struct frame, frame_data), XD_INDIRECT (0, 0), &frame_data_description },
--- a/src/glyphs-eimage.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/glyphs-eimage.c Thu Nov 04 23:08:28 2004 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1993, 1994, 1998 Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Tinker Systems - Copyright (C) 1995, 1996, 2001, 2002 Ben Wing + Copyright (C) 1995, 1996, 2001, 2002, 2004 Ben Wing Copyright (C) 1995 Sun Microsystems This file is part of XEmacs. @@ -140,7 +140,7 @@ /* Object that holds state info for JPEG decoding */ struct jpeg_decompress_struct *cinfo_ptr; /* EImage data */ - UChar_Binary *eimage; + Binbyte *eimage; }; static Lisp_Object @@ -157,7 +157,7 @@ retry_fclose (data->instream); if (data->eimage) - xfree (data->eimage, UChar_Binary *); + xfree (data->eimage, Binbyte *); return Qnil; } @@ -375,7 +375,7 @@ { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - const UChar_Binary *bytes; + const Binbyte *bytes; Bytecount len; /* #### This is a definite problem under Mule due to the amount of @@ -418,7 +418,8 @@ /* Step 6: Read in the data and put into EImage format (8bit RGB triples)*/ - unwind.eimage = (UChar_Binary*) xmalloc (cinfo.output_width * cinfo.output_height * 3); + unwind.eimage = + xnew_binbytes (cinfo.output_width * cinfo.output_height * 3); if (!unwind.eimage) signal_image_error("Unable to allocate enough memory for image", instantiator); @@ -426,7 +427,7 @@ JSAMPARRAY row_buffer; /* Output row buffer */ JSAMPLE *jp; int row_stride; /* physical row width in output buffer */ - UChar_Binary *op = unwind.eimage; + Binbyte *op = unwind.eimage; /* We may need to do some setup of our own at this point before reading * the data. After jpeg_start_decompress() we have the correct scaled @@ -458,11 +459,11 @@ int clr; if (jpeg_gray) { - UChar_Binary val; + Binbyte val; #if (BITS_IN_JSAMPLE == 8) - val = (UChar_Binary) *jp++; + val = (Binbyte) *jp++; #else /* other option is 12 */ - val = (UChar_Binary) (*jp++ >> 4); + val = (Binbyte) (*jp++ >> 4); #endif for (clr = 0; clr < 3; clr++) /* copy the same value into RGB */ *op++ = val; @@ -471,9 +472,9 @@ { for (clr = 0; clr < 3; clr++) #if (BITS_IN_JSAMPLE == 8) - *op++ = (UChar_Binary)*jp++; + *op++ = (Binbyte)*jp++; #else /* other option is 12 */ - *op++ = (UChar_Binary)(*jp++ >> 4); + *op++ = (Binbyte)(*jp++ >> 4); #endif } } @@ -535,7 +536,7 @@ struct gif_unwind_data { - UChar_Binary *eimage; + Binbyte *eimage; /* Object that holds the decoded data from a GIF file */ GifFileType *giffile; }; @@ -553,14 +554,14 @@ GifFree(data->giffile); } if (data->eimage) - xfree (data->eimage, UChar_Binary *); + xfree (data->eimage, Binbyte *); return Qnil; } typedef struct gif_memory_storage { - UChar_Binary *bytes; /* The data */ + Binbyte *bytes; /* The data */ Bytecount len; /* How big is it? */ Bytecount index; /* Where are we? */ } gif_memory_storage; @@ -613,7 +614,7 @@ int speccount = specpdl_depth (); gif_memory_storage mem_struct; struct gif_error_struct gif_err; - UChar_Binary *bytes; + Binbyte *bytes; Bytecount len; int height = 0; int width = 0; @@ -663,7 +664,7 @@ { ColorMapObject *cmo = unwind.giffile->SColorMap; int i, j, row, pass, interlace, slice; - UChar_Binary *eip; + Binbyte *eip; /* interlaced gifs have rows in this order: 0, 8, 16, ..., 4, 12, 20, ..., 2, 6, 10, ..., 1, 3, 5, ... */ static int InterlacedOffset[] = { 0, 4, 2, 1 }; @@ -671,8 +672,8 @@ height = unwind.giffile->SHeight; width = unwind.giffile->SWidth; - unwind.eimage = (UChar_Binary*) - xmalloc (width * height * 3 * unwind.giffile->ImageCount); + unwind.eimage = + xnew_binbytes (width * height * 3 * unwind.giffile->ImageCount); if (!unwind.eimage) signal_image_error("Unable to allocate enough memory for image", instantiator); @@ -703,7 +704,7 @@ eip = unwind.eimage + (width * height * 3 * slice) + (row * width * 3); for (j = 0; j < width; j++) { - UChar_Binary pixel = + Binbyte pixel = unwind.giffile->SavedImages[slice].RasterBits[(i * width) + j]; *eip++ = cmo->Colors[pixel].Red; *eip++ = cmo->Colors[pixel].Green; @@ -778,7 +779,7 @@ struct png_memory_storage { - const UChar_Binary *bytes; /* The data */ + const Binbyte *bytes; /* The data */ Bytecount len; /* How big is it? */ Bytecount index; /* Where are we? */ }; @@ -826,7 +827,7 @@ struct png_unwind_data { FILE *instream; - UChar_Binary *eimage; + Binbyte *eimage; png_structp png_ptr; png_infop info_ptr; }; @@ -844,7 +845,7 @@ retry_fclose (data->instream); if (data->eimage) - xfree(data->eimage, UChar_Binary *); + xfree(data->eimage, Binbyte *); return Qnil; } @@ -904,7 +905,7 @@ /* Initialize the IO layer and read in header information */ { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - const UChar_Binary *bytes; + const Binbyte *bytes; Bytecount len; assert (!NILP (data)); @@ -922,12 +923,12 @@ { int y; - UChar_Binary **row_pointers; + Binbyte **row_pointers; height = info_ptr->height; width = info_ptr->width; /* Wow, allocate all the memory. Truly, exciting. */ - unwind.eimage = xnew_array_and_zero (UChar_Binary, width * height * 3); + unwind.eimage = xnew_array_and_zero (Binbyte, width * height * 3); /* libpng expects that the image buffer passed in contains a picture to draw on top of if the png has any transparencies. This could be a good place to pass that in... */ @@ -1026,7 +1027,7 @@ } #endif - xfree (row_pointers, UChar_Binary **); + xfree (row_pointers, Binbyte **); } /* now instantiate */ @@ -1069,7 +1070,7 @@ struct tiff_unwind_data { - UChar_Binary *eimage; + Binbyte *eimage; /* Object that holds the decoded data from a TIFF file */ TIFF *tiff; }; @@ -1086,14 +1087,14 @@ TIFFClose(data->tiff); } if (data->eimage) - xfree (data->eimage, UChar_Binary *); + xfree (data->eimage, Binbyte *); return Qnil; } typedef struct tiff_memory_storage { - UChar_Binary *bytes; /* The data */ + Binbyte *bytes; /* The data */ Bytecount len; /* How big is it? */ Bytecount index; /* Where are we? */ } tiff_memory_storage; @@ -1258,11 +1259,11 @@ TIFFSetWarningHandler ((TIFFErrorHandler)tiff_warning_func); { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - UChar_Binary *bytes; + Binbyte *bytes; Bytecount len; uint32 *raster; - UChar_Binary *ep; + Binbyte *ep; assert (!NILP (data)); @@ -1285,7 +1286,7 @@ TIFFGetField (unwind.tiff, TIFFTAG_IMAGEWIDTH, &width); TIFFGetField (unwind.tiff, TIFFTAG_IMAGELENGTH, &height); - unwind.eimage = (UChar_Binary *) xmalloc (width * height * 3); + unwind.eimage = xnew_binbytes (width * height * 3); /* #### This is little more than proof-of-concept/function testing. It needs to be reimplemented via scanline reads for both memory @@ -1306,9 +1307,9 @@ rp = raster + (i * width); for (j = 0; j < (int) width; j++) { - *ep++ = (UChar_Binary)TIFFGetR(*rp); - *ep++ = (UChar_Binary)TIFFGetG(*rp); - *ep++ = (UChar_Binary)TIFFGetB(*rp); + *ep++ = (Binbyte)TIFFGetR(*rp); + *ep++ = (Binbyte)TIFFGetG(*rp); + *ep++ = (Binbyte)TIFFGetB(*rp); rp++; } }
--- a/src/glyphs-gtk.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/glyphs-gtk.c Thu Nov 04 23:08:28 2004 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Tinker Systems - Copyright (C) 1995, 1996, 2001, 2002 Ben Wing + Copyright (C) 1995, 1996, 2001, 2002, 2004 Ben Wing Copyright (C) 1995 Sun Microsystems This file is part of XEmacs. @@ -1163,7 +1163,7 @@ int force_mono; gint w, h; struct gcpro gcpro1, gcpro2, gcpro3; - const UChar_Binary * volatile dstring; + const Binbyte * volatile dstring; if (!DEVICE_GTK_P (XDEVICE (device))) gui_error ("Not a Gtk device", device); @@ -1224,9 +1224,9 @@ for (j = 0; j < image.ncolors; j++) { if (image.colorTable[j].symbolic != NULL && - !qxestrcasecmp_c(color_symbols[i].name, image.colorTable[j].symbolic)) + !qxestrcasecmp_ascii(color_symbols[i].name, image.colorTable[j].symbolic)) { - image.colorTable[j].c_color = (char*) xmalloc(16); + image.colorTable[j].c_color = xnew_ascbytes (16); sprintf(image.colorTable[j].c_color, "#%.4x%.4x%.4x", color_symbols[i].color.red, color_symbols[i].color.green,
--- a/src/glyphs-msw.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/glyphs-msw.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,6 +1,6 @@ /* mswindows-specific glyph objects. Copyright (C) 1998, 1999, 2000 Andy Piper. - Copyright (C) 2001, 2002, 2003 Ben Wing. + Copyright (C) 2001, 2002, 2003, 2004 Ben Wing. This file is part of XEmacs. @@ -162,16 +162,16 @@ /************************************************************************/ static BITMAPINFO *convert_EImage_to_DIBitmap (Lisp_Object device, int width, int height, - UChar_Binary *pic, + Binbyte *pic, int *bit_count, - UChar_Binary **bmp_data) + Binbyte **bmp_data) { struct device *d = XDEVICE (device); int i, j; RGBQUAD *colortbl; int ncolors; BITMAPINFO *bmp_info; - UChar_Binary *ip, *dp; + Binbyte *ip, *dp; if (GetDeviceCaps (get_device_compdc (d), BITSPIXEL) > 0) { @@ -197,7 +197,7 @@ /* bitmap data needs to be in blue, green, red triples - in that order, eimage is in RGB format so we need to convert */ - *bmp_data = xnew_array_and_zero (UChar_Binary, bpline * height); + *bmp_data = xnew_array_and_zero (Binbyte, bpline * height); *bit_count = bpline * height; if (!bmp_data) @@ -237,7 +237,7 @@ return NULL; } - colortbl = (RGBQUAD *) (((UChar_Binary *) bmp_info) + + colortbl = (RGBQUAD *) (((Binbyte *) bmp_info) + sizeof (BITMAPINFOHEADER)); bmp_info->bmiHeader.biBitCount = 8; @@ -246,7 +246,7 @@ bmp_info->bmiHeader.biClrUsed = ncolors; bmp_info->bmiHeader.biClrImportant = ncolors; - *bmp_data = (UChar_Binary *) xmalloc_and_zero (bpline * height); + *bmp_data = xnew_array_and_zero (Binbyte, bpline * height); *bit_count = bpline * height; if (!*bmp_data) @@ -433,14 +433,14 @@ mswindows_init_image_instance_from_eimage (Lisp_Image_Instance *ii, int width, int height, int slices, - UChar_Binary *eimage, + Binbyte *eimage, int dest_mask, Lisp_Object instantiator, Lisp_Object domain) { Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); BITMAPINFO * bmp_info; - UChar_Binary * bmp_data; + Binbyte * bmp_data; int bmp_bits; COLORREF bkcolor; int slice; @@ -473,23 +473,23 @@ instantiator); xfree (bmp_info, BITMAPINFO *); - xfree (bmp_data, UChar_Binary *); + xfree (bmp_data, Binbyte *); } } inline static void -set_mono_pixel (UChar_Binary *bits, +set_mono_pixel (Binbyte *bits, int bpline, int height, int x, int y, int white) { int i; - UChar_Binary bitnum; + Binbyte bitnum; /* Find the byte on which this scanline begins */ i = (height - y - 1) * bpline; /* Find the byte containing this pixel */ i += (x >> 3); /* Which bit is it? */ - bitnum = (UChar_Binary) (7 - (x & 7)); + bitnum = (Binbyte) (7 - (x & 7)); if (white) /* Turn it on */ bits[i] |= (1 << bitnum); else /* Turn it off */ @@ -502,7 +502,7 @@ { HBITMAP mask; HGDIOBJ old = NULL; - UChar_Binary *dibits, *and_bits; + Binbyte *dibits, *and_bits; BITMAPINFO *bmp_info = (BITMAPINFO *) xmalloc_and_zero (sizeof (BITMAPINFO) + sizeof (RGBQUAD)); int i, j; @@ -535,7 +535,10 @@ if (!(mask = CreateDIBSection (hcdc, bmp_info, DIB_RGB_COLORS, - (void **)&and_bits, + /* The intermediate cast fools gcc into + not outputting strict-aliasing + complaints */ + (void **) (void *) &and_bits, 0,0))) { xfree (bmp_info, BITMAPINFO *); @@ -556,7 +559,7 @@ bmp_info->bmiHeader.biClrImportant = 0; bmp_info->bmiHeader.biSizeImage = height * bpline; - dibits = (UChar_Binary *) xmalloc_and_zero (bpline * height); + dibits = xnew_array_and_zero (Binbyte, bpline * height); if (GetDIBits (hcdc, IMAGE_INSTANCE_MSWINDOWS_BITMAP (image), 0, @@ -575,7 +578,7 @@ { for (j = 0; j < height; j++) { - UChar_Binary *idx = &dibits[j * bpline + i * 3]; + Binbyte *idx = &dibits[j * bpline + i * 3]; if (RGB (idx[2], idx[1], idx[0]) == transparent_color) { @@ -598,7 +601,7 @@ DIB_RGB_COLORS); xfree (bmp_info, BITMAPINFO *); - xfree (dibits, UChar_Binary *); + xfree (dibits, Binbyte *); SelectObject(hcdc, old); @@ -788,7 +791,7 @@ } static int xpm_to_eimage (Lisp_Object image, const Extbyte *buffer, - UChar_Binary **data, + Binbyte **data, int *width, int *height, int *x_hot, int *y_hot, int *transp, @@ -798,7 +801,7 @@ XpmImage xpmimage; XpmInfo xpminfo; int result, i, j, transp_idx, maskbpline; - UChar_Binary *dptr; + Binbyte *dptr; unsigned int *sptr; COLORREF color; /* the american spelling virus hits again .. */ COLORREF *colortbl; @@ -836,7 +839,7 @@ *height = xpmimage.height; maskbpline = BPLINE ((~7UL & (unsigned long)(*width + 7)) / 8); - *data = xnew_array_and_zero (UChar_Binary, *width * *height * 3); + *data = xnew_array_and_zero (Binbyte, *width * *height * 3); if (!*data) { @@ -849,7 +852,7 @@ colortbl = xnew_array_and_zero (COLORREF, xpmimage.ncolors); if (!colortbl) { - xfree (*data, UChar_Binary *); + xfree (*data, Binbyte *); XpmFreeXpmImage (&xpmimage); XpmFreeXpmInfo (&xpminfo); return 0; @@ -874,7 +877,7 @@ { for (j = 0; j < nsymbols; j++) { - if (!qxestrcmp_c (color_symbols[j].name, + if (!qxestrcmp_ascii (color_symbols[j].name, xpmimage.colorTable[i].symbolic)) { colortbl[i] = color_symbols[j].color; @@ -905,7 +908,7 @@ } label_no_color: - xfree (*data, UChar_Binary *); + xfree (*data, Binbyte *); xfree (colortbl, COLORREF *); XpmFreeXpmImage (&xpmimage); XpmFreeXpmInfo (&xpminfo); @@ -947,10 +950,10 @@ Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); const Extbyte *bytes; Bytecount len; - UChar_Binary *eimage; + Binbyte *eimage; int width, height, x_hot, y_hot; BITMAPINFO* bmp_info; - UChar_Binary* bmp_data; + Binbyte* bmp_data; int bmp_bits; int nsymbols = 0, transp; struct color_symbol* color_symbols = NULL; @@ -995,7 +998,7 @@ signal_image_error ("XPM to EImage conversion failed", image_instance); } - xfree (eimage, UChar_Binary *); + xfree (eimage, Binbyte *); /* Now create the pixmap and set up the image instance */ init_image_instance_from_dibitmap (ii, bmp_info, dest_mask, @@ -1003,7 +1006,7 @@ x_hot, y_hot, transp); xfree (bmp_info, BITMAPINFO *); - xfree (bmp_data, UChar_Binary *); + xfree (bmp_data, Binbyte *); } #endif /* HAVE_XPM */ @@ -1335,15 +1338,15 @@ byte order from left to right, big-endian within a byte. 0 = black, 1 = white. */ static HBITMAP -xbm_create_bitmap_from_data (HDC hdc, const UChar_Binary *data, +xbm_create_bitmap_from_data (HDC hdc, const Binbyte *data, int width, int height, int mask, COLORREF fg, COLORREF bg) { int old_width = (width + 7)/8; int new_width = BPLINE (2 * ((width + 15)/16)); - const UChar_Binary *offset; + const Binbyte *offset; void *bmp_buf = 0; - UChar_Binary *new_data, *new_offset; + Binbyte *new_data, *new_offset; int i, j; BITMAPINFO *bmp_info = (BITMAPINFO *) xmalloc_and_zero (sizeof(BITMAPINFO) + sizeof(RGBQUAD)); @@ -1352,7 +1355,7 @@ if (!bmp_info) return NULL; - new_data = (UChar_Binary *) xmalloc_and_zero (height * new_width); + new_data = xnew_array_and_zero (Binbyte, height * new_width); if (!new_data) { @@ -1368,7 +1371,7 @@ for (j = 0; j < old_width; j++) { int bite = offset[j]; - new_offset[j] = ~ (UChar_Binary) + new_offset[j] = ~ (Binbyte) ((flip_table[bite & 0xf] << 4) + flip_table[bite >> 4]); } } @@ -1411,13 +1414,13 @@ if (!bitmap || !bmp_buf) { - xfree (new_data, UChar_Binary *); + xfree (new_data, Binbyte *); return NULL; } /* copy in the actual bitmap */ memcpy (bmp_buf, new_data, height * new_width); - xfree (new_data, UChar_Binary *); + xfree (new_data, Binbyte *); return bitmap; } @@ -1428,7 +1431,7 @@ static void init_image_instance_from_xbm_inline (Lisp_Image_Instance *ii, int width, int height, - const UChar_Binary *bits, + const Binbyte *bits, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, @@ -1556,7 +1559,7 @@ xbm_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, int width, int height, - const UChar_Binary *bits) + const Binbyte *bits) { Lisp_Object mask_data = find_keyword_in_vector (instantiator, Q_mask_data); Lisp_Object mask_file = find_keyword_in_vector (instantiator, Q_mask_file); @@ -1566,7 +1569,7 @@ if (!NILP (mask_data)) { - UChar_Binary *ext_data; + Binbyte *ext_data; TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (mask_data))), C_STRING_ALLOCA, ext_data, @@ -1594,7 +1597,7 @@ int dest_mask, Lisp_Object UNUSED (domain)) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - const UChar_Binary *ext_data; + const Binbyte *ext_data; assert (!NILP (data)); @@ -1636,9 +1639,9 @@ { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); int i, stattis; - UChar_Binary *p, *bits, *bp; + Binbyte *p, *bits, *bp; const CIbyte * volatile emsg = 0; - const UChar_Binary * volatile dstring; + const Binbyte * volatile dstring; assert (!NILP (data)); @@ -1646,7 +1649,7 @@ C_STRING_ALLOCA, dstring, Qbinary); - if ((p = (UChar_Binary *) strchr ((char *) dstring, ':'))) + if ((p = (Binbyte *) strchr ((char *) dstring, ':'))) { dstring = p + 1; } @@ -1674,11 +1677,11 @@ if (emsg) signal_image_error_2 (emsg, data, Qimage); - bp = bits = (UChar_Binary *) ALLOCA (PIXELS / 8); + bp = bits = alloca_binbytes (PIXELS / 8); /* the compface library exports char F[], which uses a single byte per pixel to represent a 48x48 bitmap. Yuck. */ - for (i = 0, p = (UChar_Binary *) F; i < (PIXELS / 8); ++i) + for (i = 0, p = (Binbyte *) F; i < (PIXELS / 8); ++i) { int n, b; /* reverse the bit order of each byte... */ @@ -1686,7 +1689,7 @@ { n |= ((*p++) << b); } - *bp++ = (UChar_Binary) n; + *bp++ = (Binbyte) n; } xbm_instantiate_1 (image_instance, instantiator, pointer_fg, @@ -2821,7 +2824,7 @@ if (EQ (prop, Q_text)) { Charcount tchar_len = qxeSendMessage (wnd, WM_GETTEXTLENGTH, 0, 0); - Extbyte *buf = (Extbyte *) ALLOCA (XETCHAR_SIZE * (tchar_len + 1)); + Extbyte *buf = alloca_extbytes (XETCHAR_SIZE * (tchar_len + 1)); qxeSendMessage (wnd, WM_GETTEXT, (WPARAM)tchar_len + 1, (LPARAM) buf); return build_tstr_string (buf); @@ -2858,7 +2861,7 @@ long item = qxeSendMessage (wnd, CB_GETCURSEL, 0, 0); Charcount tchar_len = qxeSendMessage (wnd, CB_GETLBTEXTLEN, (WPARAM)item, 0); - Extbyte *buf = (Extbyte *) ALLOCA (XETCHAR_SIZE * (tchar_len + 1)); + Extbyte *buf = alloca_extbytes (XETCHAR_SIZE * (tchar_len + 1)); qxeSendMessage (wnd, CB_GETLBTEXT, (WPARAM)item, (LPARAM) buf); return build_tstr_string (buf); }
--- a/src/glyphs-shared.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/glyphs-shared.c Thu Nov 04 23:08:28 2004 +0000 @@ -190,14 +190,14 @@ * like the Xlib routine XReadBitmapfile as possible. */ static int -read_bitmap_data (FILE *fstream, int *width, int *height, UChar_Binary **datap, +read_bitmap_data (FILE *fstream, int *width, int *height, Binbyte **datap, int *x_hot, int *y_hot) { - UChar_Binary *data = NULL; /* working variable */ - Char_ASCII line[MAX_SIZE]; /* input line from file */ + Binbyte *data = NULL; /* working variable */ + Ascbyte line[MAX_SIZE]; /* input line from file */ int size; /* number of bytes of data */ - Char_ASCII name_and_type[MAX_SIZE]; /* an input line */ - Char_ASCII *type; /* for parsing */ + Ascbyte name_and_type[MAX_SIZE]; /* an input line */ + Ascbyte *type; /* for parsing */ int value; /* from an input line */ int version10p; /* boolean, old format */ int padding; /* to handle alignment */ @@ -270,12 +270,12 @@ bytes_per_line = (ww+7)/8 + padding; size = bytes_per_line * hh; - data = (UChar_Binary *) Xmalloc ((unsigned int) size); + data = (Binbyte *) Xmalloc ((unsigned int) size); if (!data) RETURN (BitmapNoMemory); if (version10p) { - UChar_Binary *ptr; + Binbyte *ptr; int bytes; for (bytes=0, ptr=data; bytes<size; (bytes += 2)) { @@ -286,7 +286,7 @@ *(ptr++) = value >> 8; } } else { - UChar_Binary *ptr; + Binbyte *ptr; int bytes; for (bytes=0, ptr=data; bytes<size; bytes++, ptr++) { @@ -318,7 +318,7 @@ /* Remaining args are RETURNED */ int *width, int *height, - UChar_Binary **datap, + Binbyte **datap, int *x_hot, int *y_hot) { FILE *fstream;
--- a/src/glyphs-widget.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/glyphs-widget.c Thu Nov 04 23:08:28 2004 +0000 @@ -187,31 +187,25 @@ static void check_valid_item_list (Lisp_Object items) { - Lisp_Object rest; - - CHECK_LIST (items); - EXTERNAL_LIST_LOOP (rest, items) + EXTERNAL_LIST_LOOP_2 (elt, items) { - if (STRINGP (XCAR (rest))) - CHECK_STRING (XCAR (rest)); - else if (VECTORP (XCAR (rest))) - gui_parse_item_keywords (XCAR (rest)); - else if (LISTP (XCAR (rest))) - check_valid_item_list (XCAR (rest)); + if (STRINGP (elt)) + CHECK_STRING (elt); + else if (VECTORP (elt)) + gui_parse_item_keywords (elt); + else if (LISTP (elt)) + check_valid_item_list (elt); else - invalid_argument ("Items must be vectors, lists or strings", items); + invalid_argument ("Item must be vector, list or string", elt); } } static void check_valid_instantiator_list (Lisp_Object data) { - Lisp_Object rest; - - CHECK_LIST (data); - EXTERNAL_LIST_LOOP (rest, data) + EXTERNAL_LIST_LOOP_2 (elt, data) { - check_valid_instantiator (XCAR (rest)); + check_valid_instantiator (elt); } } @@ -1952,7 +1946,6 @@ void vars_of_glyphs_widget (void) { - reinit_vars_of_glyphs_widget (); }
--- a/src/glyphs-x.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/glyphs-x.c Thu Nov 04 23:08:28 2004 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Tinker Systems - Copyright (C) 1995, 1996, 2001, 2002, 2003 Ben Wing + Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004 Ben Wing Copyright (C) 1995 Sun Microsystems Copyright (C) 1999, 2000, 2002 Andy Piper @@ -163,7 +163,7 @@ /************************************************************************/ static XImage * convert_EImage_to_XImage (Lisp_Object device, int width, int height, - UChar_Binary *pic, unsigned long **pixtbl, + Binbyte *pic, unsigned long **pixtbl, int *npixels) { Display *dpy; @@ -172,7 +172,7 @@ XImage *outimg; int depth, bitmap_pad, bits_per_pixel, byte_cnt, i, j; int rd,gr,bl,q; - UChar_Binary *data, *ip, *dp; + Binbyte *data, *ip, *dp; quant_table *qtable = 0; union { UINT_32_BIT val; @@ -211,7 +211,7 @@ bits_per_pixel = outimg->bits_per_pixel; byte_cnt = bits_per_pixel >> 3; - data = (UChar_Binary *) xmalloc (outimg->bytes_per_line * height); + data = xnew_binbytes (outimg->bytes_per_line * height); if (!data) { XDestroyImage (outimg); @@ -843,7 +843,7 @@ x_init_image_instance_from_eimage (Lisp_Image_Instance *ii, int width, int height, int slices, - UChar_Binary *eimage, + Binbyte *eimage, int dest_mask, Lisp_Object instantiator, Lisp_Object UNUSED (domain)) @@ -893,7 +893,7 @@ static Pixmap pixmap_from_xbm_inline (Lisp_Object device, int width, int height, - Char_Binary *bits) + CBinbyte *bits) { return XCreatePixmapFromBitmapData (DEVICE_X_DISPLAY (XDEVICE (device)), XtWindow (DEVICE_XT_APP_SHELL @@ -908,7 +908,7 @@ static void init_image_instance_from_xbm_inline (Lisp_Image_Instance *ii, int width, int height, - Char_Binary *bits, + CBinbyte *bits, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, @@ -995,7 +995,7 @@ IMAGE_INSTANCE_PIXMAP_BG (ii) = background; IMAGE_INSTANCE_X_PIXMAP (ii) = XCreatePixmapFromBitmapData (dpy, draw, - (Char_Binary *) bits, width, height, + (CBinbyte *) bits, width, height, fg, bg, d); IMAGE_INSTANCE_PIXMAP_DEPTH (ii) = d; } @@ -1010,7 +1010,7 @@ source = XCreatePixmapFromBitmapData (dpy, draw, - (Char_Binary *) bits, width, height, + (CBinbyte *) bits, width, height, 1, 0, 1); if (NILP (foreground)) @@ -1045,7 +1045,7 @@ xbm_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator, Lisp_Object pointer_fg, Lisp_Object pointer_bg, int dest_mask, int width, int height, - Char_Binary *bits) + CBinbyte *bits) { Lisp_Object mask_data = find_keyword_in_vector (instantiator, Q_mask_data); Lisp_Object mask_file = find_keyword_in_vector (instantiator, Q_mask_file); @@ -1054,7 +1054,7 @@ if (!NILP (mask_data)) { - Char_Binary *ext_data; + CBinbyte *ext_data; LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (mask_data))), ext_data, Qbinary); @@ -1077,7 +1077,7 @@ int dest_mask, Lisp_Object UNUSED (domain)) { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); - Char_Binary *ext_data; + CBinbyte *ext_data; assert (!NILP (data)); @@ -1562,9 +1562,9 @@ { Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); int i, stattis; - UChar_Binary *p, *bits, *bp; + Binbyte *p, *bits, *bp; const CIbyte * volatile emsg = 0; - const UChar_Binary * volatile dstring; + const Binbyte * volatile dstring; assert (!NILP (data)); @@ -1572,7 +1572,7 @@ C_STRING_ALLOCA, dstring, Qbinary); - if ((p = (UChar_Binary *) strchr ((char *) dstring, ':'))) + if ((p = (Binbyte *) strchr ((char *) dstring, ':'))) { dstring = p + 1; } @@ -1600,11 +1600,11 @@ if (emsg) signal_image_error_2 (emsg, data, Qimage); - bp = bits = (UChar_Binary *) ALLOCA (PIXELS / 8); + bp = bits = alloca_binbytes (PIXELS / 8); /* the compface library exports char F[], which uses a single byte per pixel to represent a 48x48 bitmap. Yuck. */ - for (i = 0, p = (UChar_Binary *) F; i < (PIXELS / 8); ++i) + for (i = 0, p = (Binbyte *) F; i < (PIXELS / 8); ++i) { int n, b; /* reverse the bit order of each byte... */ @@ -1612,11 +1612,11 @@ { n |= ((*p++) << b); } - *bp++ = (UChar_Binary) n; + *bp++ = (Binbyte) n; } xbm_instantiate_1 (image_instance, instantiator, pointer_fg, - pointer_bg, dest_mask, 48, 48, (Char_Binary *) bits); + pointer_bg, dest_mask, 48, 48, (CBinbyte *) bits); } #endif /* HAVE_XFACE */
--- a/src/glyphs.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/glyphs.c Thu Nov 04 23:08:28 2004 +0000 @@ -303,15 +303,12 @@ */ (console_type, list)) { - Lisp_Object tail; Lisp_Object *imlist = get_image_conversion_list (console_type); /* Check the list to make sure that it only has valid entries. */ - EXTERNAL_LIST_LOOP (tail, list) + EXTERNAL_LIST_LOOP_2 (mapping, list) { - Lisp_Object mapping = XCAR (tail); - /* Mapping form should be (STRING VECTOR) or (STRING VECTOR INTEGER) */ if (!CONSP (mapping) || !CONSP (XCDR (mapping)) || @@ -878,13 +875,13 @@ }; static const struct memory_description image_instance_data_description_1 [] = { - { XD_STRUCT_ARRAY, IMAGE_TEXT, + { XD_BLOCK_ARRAY, IMAGE_TEXT, 1, &text_image_instance_description }, - { XD_STRUCT_ARRAY, IMAGE_MONO_PIXMAP, + { XD_BLOCK_ARRAY, IMAGE_MONO_PIXMAP, 1, &pixmap_image_instance_description }, - { XD_STRUCT_ARRAY, IMAGE_COLOR_PIXMAP, + { XD_BLOCK_ARRAY, IMAGE_COLOR_PIXMAP, 1, &pixmap_image_instance_description }, - { XD_STRUCT_ARRAY, IMAGE_WIDGET, + { XD_BLOCK_ARRAY, IMAGE_WIDGET, 1, &subwindow_image_instance_description }, { XD_END } }; @@ -1385,7 +1382,6 @@ static int decode_image_instance_type_list (Lisp_Object list) { - Lisp_Object rest; int mask = 0; if (NILP (list)) @@ -1398,12 +1394,14 @@ return image_instance_type_to_mask (type); } - EXTERNAL_LIST_LOOP (rest, list) - { - enum image_instance_type type = - decode_image_instance_type (XCAR (rest), ERROR_ME); - mask |= image_instance_type_to_mask (type); - } + { + EXTERNAL_LIST_LOOP_2 (elt, list) + { + enum image_instance_type type = + decode_image_instance_type (elt, ERROR_ME); + mask |= image_instance_type_to_mask (type); + } + } return mask; } @@ -2668,7 +2666,7 @@ int ok_if_data_invalid) { int w, h; - UChar_Binary *data; + Binbyte *data; int result; result = read_bitmap_data_from_file (name, &w, &h, &data, xhot, yhot); @@ -5264,7 +5262,7 @@ static const struct memory_description iife_description_1[] = { { XD_LISP_OBJECT, offsetof (image_instantiator_format_entry, symbol) }, { XD_LISP_OBJECT, offsetof (image_instantiator_format_entry, device) }, - { XD_STRUCT_PTR, offsetof (image_instantiator_format_entry, meths), 1, &iim_description }, + { XD_BLOCK_PTR, offsetof (image_instantiator_format_entry, meths), 1, &iim_description }, { XD_END } }; @@ -5286,8 +5284,8 @@ static const struct memory_description iim_description_1[] = { { XD_LISP_OBJECT, offsetof (struct image_instantiator_methods, symbol) }, { XD_LISP_OBJECT, offsetof (struct image_instantiator_methods, device) }, - { XD_STRUCT_PTR, offsetof (struct image_instantiator_methods, keywords), 1, &iiked_description }, - { XD_STRUCT_PTR, offsetof (struct image_instantiator_methods, consoles), 1, &cted_description }, + { XD_BLOCK_PTR, offsetof (struct image_instantiator_methods, keywords), 1, &iiked_description }, + { XD_BLOCK_PTR, offsetof (struct image_instantiator_methods, consoles), 1, &cted_description }, { XD_END } }; @@ -5307,7 +5305,7 @@ Vimage_instantiator_format_list = Qnil; staticpro (&Vimage_instantiator_format_list); - dump_add_root_struct_ptr (&the_image_instantiator_format_entry_dynarr, &iifed_description); + dump_add_root_block_ptr (&the_image_instantiator_format_entry_dynarr, &iifed_description); INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (nothing, "nothing"); @@ -5418,8 +5416,6 @@ void vars_of_glyphs (void) { - reinit_vars_of_glyphs (); - Vthe_nothing_vector = vector1 (Qnothing); staticpro (&Vthe_nothing_vector); @@ -5435,34 +5431,6 @@ Vglyph_type_list = list3 (Qbuffer, Qpointer, Qicon); staticpro (&Vglyph_type_list); - /* The octal-escape glyph, control-arrow-glyph and - invisible-text-glyph are completely initialized in glyphs.el */ - - DEFVAR_LISP ("octal-escape-glyph", &Voctal_escape_glyph /* -What to prefix character codes displayed in octal with. -*/); - Voctal_escape_glyph = allocate_glyph (GLYPH_BUFFER, redisplay_glyph_changed); - - DEFVAR_LISP ("control-arrow-glyph", &Vcontrol_arrow_glyph /* -What to use as an arrow for control characters. -*/); - Vcontrol_arrow_glyph = allocate_glyph (GLYPH_BUFFER, - redisplay_glyph_changed); - - DEFVAR_LISP ("invisible-text-glyph", &Vinvisible_text_glyph /* -What to use to indicate the presence of invisible text. -This is the glyph that is displayed when an ellipsis is called for -\(see `selective-display-ellipses' and `buffer-invisibility-spec'). -Normally this is three dots ("..."). -*/); - Vinvisible_text_glyph = allocate_glyph (GLYPH_BUFFER, - redisplay_glyph_changed); - - /* Partially initialized in glyphs.el */ - DEFVAR_LISP ("hscroll-glyph", &Vhscroll_glyph /* -What to display at the beginning of horizontally scrolled lines. -*/); - Vhscroll_glyph = allocate_glyph (GLYPH_BUFFER, redisplay_glyph_changed); #ifdef HAVE_WINDOW_SYSTEM Fprovide (Qxbm); #endif @@ -5575,6 +5543,35 @@ */ ); Vcontinuation_glyph = allocate_glyph (GLYPH_BUFFER, redisplay_glyph_changed); + /* The octal-escape glyph, control-arrow-glyph and + invisible-text-glyph are completely initialized in glyphs.el */ + + DEFVAR_LISP ("octal-escape-glyph", &Voctal_escape_glyph /* +What to prefix character codes displayed in octal with. +*/); + Voctal_escape_glyph = allocate_glyph (GLYPH_BUFFER, redisplay_glyph_changed); + + DEFVAR_LISP ("control-arrow-glyph", &Vcontrol_arrow_glyph /* +What to use as an arrow for control characters. +*/); + Vcontrol_arrow_glyph = allocate_glyph (GLYPH_BUFFER, + redisplay_glyph_changed); + + DEFVAR_LISP ("invisible-text-glyph", &Vinvisible_text_glyph /* +What to use to indicate the presence of invisible text. +This is the glyph that is displayed when an ellipsis is called for +\(see `selective-display-ellipses' and `buffer-invisibility-spec'). +Normally this is three dots ("..."). +*/); + Vinvisible_text_glyph = allocate_glyph (GLYPH_BUFFER, + redisplay_glyph_changed); + + /* Partially initialized in glyphs.el */ + DEFVAR_LISP ("hscroll-glyph", &Vhscroll_glyph /* +What to display at the beginning of horizontally scrolled lines. +*/); + Vhscroll_glyph = allocate_glyph (GLYPH_BUFFER, redisplay_glyph_changed); + /* Partially initialized in glyphs-x.c, glyphs.el */ DEFVAR_LISP ("xemacs-logo", &Vxemacs_logo /* The glyph used to display the XEmacs logo at startup.
--- a/src/glyphs.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/glyphs.h Thu Nov 04 23:08:28 2004 +0000 @@ -234,7 +234,7 @@ Dynarr_new (console_type_entry); \ add_entry_to_image_instantiator_format_list \ (Q##format, format##_image_instantiator_methods); \ - dump_add_root_struct_ptr (&format##_image_instantiator_methods, \ + dump_add_root_block_ptr (&format##_image_instantiator_methods, \ &iim_description); \ } while (0) @@ -312,7 +312,7 @@ add_entry_to_device_ii_format_list \ (Q##type, Q##format, type##_##format##_image_instantiator_methods); \ IIFORMAT_VALID_CONSOLE(type,format); \ - dump_add_root_struct_ptr (&type##_##format##_image_instantiator_methods, \ + dump_add_root_block_ptr (&type##_##format##_image_instantiator_methods, \ &iim_description); \ } while (0) @@ -925,7 +925,7 @@ Lisp_Object bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot, int ok_if_data_invalid); int read_bitmap_data_from_file (Lisp_Object filename, int *width, - int *height, UChar_Binary **datap, + int *height, Binbyte **datap, int *x_hot, int *y_hot); Lisp_Object xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file, Lisp_Object mask_file,
--- a/src/gui-msw.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/gui-msw.c Thu Nov 04 23:08:28 2004 +0000 @@ -115,7 +115,7 @@ mswindows_translate_menu_or_dialog_item (Lisp_Object item, Ichar *accel) { Bytecount len = XSTRING_LENGTH (item); - Ibyte *it = (Ibyte *) ALLOCA (2 * len + 42), *ptr = it; + Ibyte *it = alloca_ibytes (2 * len + 42), *ptr = it; memcpy (ptr, XSTRING_DATA (item), len + 1); if (accel)
--- a/src/gui-x.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/gui-x.c Thu Nov 04 23:08:28 2004 +0000 @@ -388,7 +388,7 @@ else { Bytecount namelen = XSTRING_LENGTH (string); - Ibyte *chars = (Ibyte *) ALLOCA (namelen + 3); + Ibyte *chars = alloca_ibytes (namelen + 3); chars[0] = '%'; chars[1] = '_'; memcpy (chars + 2, name, namelen + 1); @@ -694,8 +694,6 @@ void vars_of_gui_x (void) { - reinit_vars_of_gui_x (); - Vpopup_callbacks = Qnil; staticpro (&Vpopup_callbacks); }
--- a/src/gui.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/gui.c Thu Nov 04 23:08:28 2004 +0000 @@ -818,13 +818,13 @@ Lisp_Gui_Item); DOESNT_RETURN -gui_error (const Char_ASCII *reason, Lisp_Object frob) +gui_error (const Ascbyte *reason, Lisp_Object frob) { signal_error (Qgui_error, reason, frob); } DOESNT_RETURN -gui_error_2 (const Char_ASCII *reason, Lisp_Object frob0, Lisp_Object frob1) +gui_error_2 (const Ascbyte *reason, Lisp_Object frob0, Lisp_Object frob1) { signal_error_2 (Qgui_error, reason, frob0, frob1); }
--- a/src/gutter.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/gutter.c Thu Nov 04 23:08:28 2004 +0000 @@ -1065,11 +1065,9 @@ if (CONSP (instantiator)) { - Lisp_Object rest; - - EXTERNAL_LIST_LOOP (rest, instantiator) + EXTERNAL_LIST_LOOP_2 (elt, instantiator) { - if (!SYMBOLP (XCAR (rest))) + if (!SYMBOLP (elt)) invalid_argument ("Gutter visibility must be a boolean or list of symbols", instantiator); }
--- a/src/hftctl.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/hftctl.c Thu Nov 04 23:08:28 2004 +0000 @@ -323,7 +323,7 @@ if (cmdlen) /* if arg structure to pass */ { size = sizeof (struct hfctlreq) + cmdlen; - if ((p.c = xmalloc(size)) == NULL) /* malloc one area */ + if ((p.c = xmalloc (size)) == NULL) /* malloc one area */ return (-1); memcpy (p.c, &req, sizeof (req)); /* copy CTL REQ struct */
--- a/src/hpplay.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/hpplay.c Thu Nov 04 23:08:28 2004 +0000 @@ -72,7 +72,7 @@ /* error handling */ void -player_error_internal (Audio * audio, Char_ASCII * text, long errorCode) +player_error_internal (Audio * audio, Ascbyte * text, long errorCode) { Extbyte errorbuff[132]; Ibyte *interr; @@ -186,7 +186,7 @@ int -play_sound_data (UChar_Binary * data, int UNUSED (length), int volume) +play_sound_data (Binbyte * data, int UNUSED (length), int volume) { SBucket *pSBucket; Audio *audio; @@ -227,7 +227,7 @@ if (status) player_error_internal( audio, "Bucket creation failed", status ); - APutSBucketData(audio, pSBucket, 0, (Char_Binary *) (data + header->header_size), header->data_length, &status); + APutSBucketData(audio, pSBucket, 0, (CBinbyte *) (data + header->header_size), header->data_length, &status); if (status) player_error_internal( audio, "Audio data copy failed", status );
--- a/src/imgproc.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/imgproc.c Thu Nov 04 23:08:28 2004 +0000 @@ -45,10 +45,10 @@ #include "imgproc.h" static void -get_histogram(quant_table *qt, UChar_Binary *pic, +get_histogram(quant_table *qt, Binbyte *pic, int width, int height, Colorbox* box) { - register UChar_Binary *inptr; + register Binbyte *inptr; register int red, green, blue; register int j, i; @@ -340,7 +340,7 @@ ir = red >> (COLOR_DEPTH-C_DEPTH); ig = green >> (COLOR_DEPTH-C_DEPTH); ib = blue >> (COLOR_DEPTH-C_DEPTH); - ptr = (C_cell *)xmalloc(sizeof (C_cell)); + ptr = xnew (C_cell); *(qt->ColorCells + ir*C_LEN*C_LEN + ig*C_LEN + ib) = ptr; ptr->num_ents = 0; @@ -472,7 +472,7 @@ } quant_table * -build_EImage_quantable(UChar_Binary *eimage, int width, int height, int num_colors) +build_EImage_quantable(Binbyte *eimage, int width, int height, int num_colors) { quant_table *qt; Colorbox *box_list, *ptr; @@ -486,7 +486,7 @@ * STEP 1: create empty boxes */ qt->usedboxes = NULL; - box_list = qt->freeboxes = (Colorbox *)xmalloc (num_colors*sizeof (Colorbox)); + box_list = qt->freeboxes = xnew_array (Colorbox, num_colors); qt->freeboxes[0].next = &(qt->freeboxes[1]); qt->freeboxes[0].prev = NULL; for (i = 1; i < num_colors-1; ++i)
--- a/src/input-method-xlib.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/input-method-xlib.c Thu Nov 04 23:08:28 2004 +0000 @@ -661,9 +661,10 @@ if (p->count_styles == 0) { /* No valid styles? */ - char *buf = (char *)ALLOCA (strlen (fromVal->addr) - + strlen (DefaultXIMStyles) - + 100); + /* !!#### */ + char *buf = (char *) ALLOCA (strlen (fromVal->addr) + + strlen (DefaultXIMStyles) + + 100); XrmValue new_from; XtAppContext the_app_con = XtDisplayToApplicationContext (dpy);
--- a/src/insdel.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/insdel.c Thu Nov 04 23:08:28 2004 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1985, 1986, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2001, 2002, 2003 Ben Wing. + Copyright (C) 2001, 2002, 2003, 2004 Ben Wing. This file is part of XEmacs. @@ -65,19 +65,22 @@ #define SET_BUF_END_GAP_SIZE(buf, value) \ do { (buf)->text->end_gap_size = (value); } while (0) -/* Gap location. */ -#define BYTE_BUF_GPT(buf) ((buf)->text->gpt + 0) #define BUF_GPT_ADDR(buf) (BUF_BEG_ADDR (buf) + BYTE_BUF_GPT (buf) - 1) /* Set gap location. */ -#define SET_BYTE_BUF_GPT(buf, value) do { (buf)->text->gpt = (value); } while (0) +#define SET_BOTH_BUF_GPT(buf, cval, bval) \ +do \ +{ \ + (buf)->text->gpt = (bval); \ + (buf)->text->bufgpt = (cval); \ +} while (0) /* Set end of buffer. */ -#define SET_BOTH_BUF_Z(buf, val, bival) \ +#define SET_BOTH_BUF_Z(buf, cval, bval) \ do \ { \ - (buf)->text->z = (bival); \ - (buf)->text->bufz = (val); \ + (buf)->text->z = (bval); \ + (buf)->text->bufz = (cval); \ } while (0) /* Under Mule, we maintain two sentinels in the buffer: one at the @@ -254,10 +257,10 @@ bigger. --ben */ #define GAP_MOVE_CHUNK 300000 -/* Move the gap to POS, which is less than the current GPT. */ +/* Move the gap to CPOS/BPOS, which is less than the current GPT. */ static void -gap_left (struct buffer *buf, Bytebpos pos) +gap_left (struct buffer *buf, Charbpos cpos, Bytebpos bpos) { Ibyte *to, *from; Bytecount i; @@ -275,21 +278,23 @@ while (1) { /* I gets number of characters left to copy. */ - i = new_s1 - pos; + i = new_s1 - bpos; if (i == 0) break; /* If a quit is requested, stop copying now. - Change POS to be where we have actually moved the gap to. */ + Change BPOS to be where we have actually moved the gap to. */ if (QUITP) { - pos = new_s1; + bpos = new_s1; + cpos = bytebpos_to_charbpos (buf, bpos); break; } /* Move at most GAP_MOVE_CHUNK chars before checking again for a quit. */ if (i > GAP_MOVE_CHUNK) i = GAP_MOVE_CHUNK; - if (i >= 128) + if (i >= 10) /* was 128 but memmove() should be extremely efficient + nowadays */ { new_s1 -= i; from -= i; @@ -304,19 +309,19 @@ } } - /* Adjust markers, and buffer data structure, to put the gap at POS. - POS is where the loop above stopped, which may be what was specified + /* Adjust markers, and buffer data structure, to put the gap at BPOS. + BPOS is where the loop above stopped, which may be what was specified or may be where a quit was detected. */ MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) { - adjust_markers (mbuf, pos, BYTE_BUF_GPT (mbuf), BUF_GAP_SIZE (mbuf)); + adjust_markers (mbuf, bpos, BYTE_BUF_GPT (mbuf), BUF_GAP_SIZE (mbuf)); } MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) { - adjust_extents (wrap_buffer (mbuf), pos, BYTE_BUF_GPT (mbuf), + adjust_extents (wrap_buffer (mbuf), bpos, BYTE_BUF_GPT (mbuf), BUF_GAP_SIZE (mbuf)); } - SET_BYTE_BUF_GPT (buf, pos); + SET_BOTH_BUF_GPT (buf, cpos, bpos); SET_GAP_SENTINEL (buf); #ifdef ERROR_CHECK_EXTENTS MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) @@ -328,7 +333,7 @@ } static void -gap_right (struct buffer *buf, Bytebpos pos) +gap_right (struct buffer *buf, Charbpos cpos, Bytebpos bpos) { Ibyte *to, *from; Bytecount i; @@ -346,21 +351,23 @@ while (1) { /* I gets number of characters left to copy. */ - i = pos - new_s1; + i = bpos - new_s1; if (i == 0) break; /* If a quit is requested, stop copying now. - Change POS to be where we have actually moved the gap to. */ + Change BPOS to be where we have actually moved the gap to. */ if (QUITP) { - pos = new_s1; + bpos = new_s1; + cpos = bytebpos_to_charbpos (buf, bpos); break; } /* Move at most GAP_MOVE_CHUNK chars before checking again for a quit. */ if (i > GAP_MOVE_CHUNK) i = GAP_MOVE_CHUNK; - if (i >= 128) + if (i >= 10) /* was 128 but memmove() should be extremely efficient + nowadays */ { new_s1 += i; memmove (to, from, i); @@ -379,14 +386,14 @@ int gsize = BUF_GAP_SIZE (buf); MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) { - adjust_markers (mbuf, BYTE_BUF_GPT (mbuf) + gsize, pos + gsize, - gsize); + adjust_markers (mbuf, BYTE_BUF_GPT (mbuf) + gsize, bpos + gsize, - gsize); } MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) { adjust_extents (wrap_buffer (mbuf), BYTE_BUF_GPT (mbuf) + gsize, - pos + gsize, - gsize); + bpos + gsize, - gsize); } - SET_BYTE_BUF_GPT (buf, pos); + SET_BOTH_BUF_GPT (buf, cpos, bpos); SET_GAP_SENTINEL (buf); #ifdef ERROR_CHECK_EXTENTS MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) @@ -395,7 +402,7 @@ } #endif } - if (pos == BYTE_BUF_Z (buf)) + if (bpos == BYTE_BUF_Z (buf)) { /* merge gap with end gap */ @@ -407,18 +414,18 @@ QUIT; } -/* Move gap to position `pos'. +/* Move gap to position `bpos'. Note that this can quit! */ static void -move_gap (struct buffer *buf, Bytebpos pos) +move_gap (struct buffer *buf, Charbpos cpos, Bytebpos bpos) { if (! BUF_BEG_ADDR (buf)) abort (); - if (pos < BYTE_BUF_GPT (buf)) - gap_left (buf, pos); - else if (pos > BYTE_BUF_GPT (buf)) - gap_right (buf, pos); + if (bpos < BYTE_BUF_GPT (buf)) + gap_left (buf, cpos, bpos); + else if (bpos > BYTE_BUF_GPT (buf)) + gap_right (buf, cpos, bpos); } /* Merge the end gap into the gap */ @@ -427,7 +434,8 @@ merge_gap_with_end_gap (struct buffer *buf) { Lisp_Object tem; - Bytebpos real_gap_loc; + Charbpos real_gap_loc_char; + Bytebpos real_gap_loc_byte; Bytecount old_gap_size; Bytecount increment; @@ -440,20 +448,23 @@ tem = Vinhibit_quit; Vinhibit_quit = Qt; - real_gap_loc = BYTE_BUF_GPT (buf); + real_gap_loc_char = BUF_GPT (buf); + real_gap_loc_byte = BYTE_BUF_GPT (buf); old_gap_size = BUF_GAP_SIZE (buf); /* Pretend the end gap is the gap */ - SET_BYTE_BUF_GPT (buf, BYTE_BUF_Z (buf) + BUF_GAP_SIZE (buf)); + SET_BOTH_BUF_GPT (buf, BUF_Z (buf) + BUF_GAP_SIZE (buf), + BYTE_BUF_Z (buf) + BUF_GAP_SIZE (buf)); SET_BUF_GAP_SIZE (buf, increment); /* Move the new gap down to be consecutive with the end of the old one. This adjusts the markers properly too. */ - gap_left (buf, real_gap_loc + old_gap_size); + gap_left (buf, real_gap_loc_char + old_gap_size, + real_gap_loc_byte + old_gap_size); /* Now combine the two into one large gap. */ SET_BUF_GAP_SIZE (buf, BUF_GAP_SIZE (buf) + old_gap_size); - SET_BYTE_BUF_GPT (buf, real_gap_loc); + SET_BOTH_BUF_GPT (buf, real_gap_loc_char, real_gap_loc_byte); SET_GAP_SENTINEL (buf); /* We changed the total size of the buffer (including gap), @@ -471,7 +482,8 @@ { Ibyte *result; Lisp_Object tem; - Bytebpos real_gap_loc; + Charbpos real_gap_loc_char; + Bytebpos real_gap_loc_byte; Bytecount old_gap_size; /* If we have to get more space, get enough to last a while. We use @@ -508,22 +520,25 @@ tem = Vinhibit_quit; Vinhibit_quit = Qt; - real_gap_loc = BYTE_BUF_GPT (buf); + real_gap_loc_char = BUF_GPT (buf); + real_gap_loc_byte = BYTE_BUF_GPT (buf); old_gap_size = BUF_GAP_SIZE (buf); /* Call the newly allocated space a gap at the end of the whole space. */ - SET_BYTE_BUF_GPT (buf, BYTE_BUF_Z (buf) + BUF_GAP_SIZE (buf)); + SET_BOTH_BUF_GPT (buf, BUF_Z (buf) + BUF_GAP_SIZE (buf), + BYTE_BUF_Z (buf) + BUF_GAP_SIZE (buf)); SET_BUF_GAP_SIZE (buf, increment); SET_BUF_END_GAP_SIZE (buf, 0); /* Move the new gap down to be consecutive with the end of the old one. This adjusts the markers properly too. */ - gap_left (buf, real_gap_loc + old_gap_size); + gap_left (buf, real_gap_loc_char + old_gap_size, + real_gap_loc_byte + old_gap_size); /* Now combine the two into one large gap. */ SET_BUF_GAP_SIZE (buf, BUF_GAP_SIZE (buf) + old_gap_size); - SET_BYTE_BUF_GPT (buf, real_gap_loc); + SET_BOTH_BUF_GPT (buf, real_gap_loc_char, real_gap_loc_byte); SET_GAP_SENTINEL (buf); /* We changed the total size of the buffer (including gap), @@ -1130,7 +1145,7 @@ /* #### if debug-on-quit is invoked and the user changes the buffer, bad things can happen. This is a rampant problem in Emacs. */ - move_gap (buf, bytepos); /* may QUIT */ + move_gap (buf, pos, bytepos); /* may QUIT */ if (! GAP_CAN_HOLD_SIZE_P (buf, length_in_buffer)) { if (BUF_END_GAP_SIZE (buf) >= length_in_buffer) @@ -1166,7 +1181,8 @@ BUF_FORMAT (buf), wrap_buffer (buf), NULL); SET_BUF_GAP_SIZE (buf, BUF_GAP_SIZE (buf) - length_in_buffer); - SET_BYTE_BUF_GPT (buf, BYTE_BUF_GPT (buf) + length_in_buffer); + SET_BOTH_BUF_GPT (buf, BUF_GPT (buf) + cclen, + BYTE_BUF_GPT (buf) + length_in_buffer); MAP_INDIRECT_BUFFERS (buf, mbuf, bufcons) { SET_BOTH_BUF_ZV (mbuf, BUF_ZV (mbuf) + cclen, @@ -1389,9 +1405,9 @@ /* Make sure the gap is somewhere in or next to what we are deleting. */ /* NOTE: Can QUIT! */ if (byte_to < BYTE_BUF_GPT (buf)) - gap_left (buf, byte_to); + gap_left (buf, to, byte_to); if (byte_from > BYTE_BUF_GPT (buf)) - gap_right (buf, byte_from); + gap_right (buf, from, byte_from); do_move_gap = 1; } @@ -1511,7 +1527,7 @@ } SET_BOTH_BUF_Z (buf, BUF_Z (buf) - numdel, BYTE_BUF_Z (buf) - byte_numdel); if (do_move_gap) - SET_BYTE_BUF_GPT (buf, byte_from); + SET_BOTH_BUF_GPT (buf, from, byte_from); SET_GAP_SENTINEL (buf); #ifdef MULE @@ -1753,7 +1769,6 @@ void vars_of_insdel (void) { - reinit_vars_of_insdel (); } void @@ -1767,24 +1782,22 @@ memory_full (); SET_BUF_END_GAP_SIZE (b, 0); - SET_BYTE_BUF_GPT (b, 1); + SET_BOTH_BUF_GPT (b, 1, 1); SET_BOTH_BUF_Z (b, 1, 1); SET_GAP_SENTINEL (b); SET_END_SENTINEL (b); + #ifdef MULE - { - int i; + b->text->entirely_one_byte_p = 1; - b->text->mule_bufmin = b->text->mule_bufmax = 1; - b->text->mule_bytmin = b->text->mule_bytmax = 1; - b->text->entirely_one_byte_p = 1; +#ifdef OLD_BYTE_CHAR + b->text->mule_bufmin = b->text->mule_bufmax = 1; + b->text->mule_bytmin = b->text->mule_bytmax = 1; +#endif - for (i = 0; i < 16; i++) - { - b->text->mule_charbpos_cache[i] = 1; - b->text->mule_bytebpos_cache[i] = 1; - } - } + b->text->cached_charpos = 1; + b->text->cached_bytepos = 1; + /* &&#### Set to FORMAT_8_BIT_FIXED when that code is working */ BUF_FORMAT (b) = FORMAT_DEFAULT; #endif /* MULE */
--- a/src/intl-auto-encap-win32.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/intl-auto-encap-win32.c Thu Nov 04 23:08:28 2004 +0000 @@ -13,60 +13,281 @@ /*----------------------------------------------------------------------*/ -/* Processing file WINNLS.H */ +/* Processing file WINCON.H */ /*----------------------------------------------------------------------*/ -/* Error if GetCPInfoEx used: not used, not examined yet */ - -/* Error if CompareString used: not used, not examined yet */ - -/* Error if LCMapString used: not used, not examined yet */ - -int -qxeGetLocaleInfo (LCID Locale, LCTYPE LCType, Extbyte * lpLCData, int cchData) -{ - if (XEUNICODE_P) - return GetLocaleInfoW (Locale, LCType, (LPWSTR) lpLCData, cchData); - else - return GetLocaleInfoA (Locale, LCType, (LPSTR) lpLCData, cchData); +BOOL +qxePeekConsoleInput (HANDLE hConsoleInput, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead) +{ + if (XEUNICODE_P) + return PeekConsoleInputW (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead); + else + return PeekConsoleInputA (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead); +} + +BOOL +qxeReadConsoleInput (HANDLE hConsoleInput, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead) +{ + if (XEUNICODE_P) + return ReadConsoleInputW (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead); + else + return ReadConsoleInputA (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead); +} + +BOOL +qxeWriteConsoleInput (HANDLE hConsoleInput, CONST INPUT_RECORD * lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsWritten) +{ + if (XEUNICODE_P) + return WriteConsoleInputW (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsWritten); + else + return WriteConsoleInputA (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsWritten); +} + +BOOL +qxeReadConsoleOutput (HANDLE hConsoleOutput, PCHAR_INFO lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, PSMALL_RECT lpReadRegion) +{ + if (XEUNICODE_P) + return ReadConsoleOutputW (hConsoleOutput, lpBuffer, dwBufferSize, dwBufferCoord, lpReadRegion); + else + return ReadConsoleOutputA (hConsoleOutput, lpBuffer, dwBufferSize, dwBufferCoord, lpReadRegion); +} + +BOOL +qxeWriteConsoleOutput (HANDLE hConsoleOutput, CONST CHAR_INFO * lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, PSMALL_RECT lpWriteRegion) +{ + if (XEUNICODE_P) + return WriteConsoleOutputW (hConsoleOutput, lpBuffer, dwBufferSize, dwBufferCoord, lpWriteRegion); + else + return WriteConsoleOutputA (hConsoleOutput, lpBuffer, dwBufferSize, dwBufferCoord, lpWriteRegion); +} + +BOOL +qxeReadConsoleOutputCharacter (HANDLE hConsoleOutput, Extbyte * lpCharacter, DWORD nLength, COORD dwReadCoord, LPDWORD lpNumberOfCharsRead) +{ + if (XEUNICODE_P) + return ReadConsoleOutputCharacterW (hConsoleOutput, (LPWSTR) lpCharacter, nLength, dwReadCoord, lpNumberOfCharsRead); + else + return ReadConsoleOutputCharacterA (hConsoleOutput, (LPSTR) lpCharacter, nLength, dwReadCoord, lpNumberOfCharsRead); +} + +BOOL +qxeWriteConsoleOutputCharacter (HANDLE hConsoleOutput, const Extbyte * lpCharacter, DWORD nLength, COORD dwWriteCoord, LPDWORD lpNumberOfCharsWritten) +{ + if (XEUNICODE_P) + return WriteConsoleOutputCharacterW (hConsoleOutput, (LPCWSTR) lpCharacter, nLength, dwWriteCoord, lpNumberOfCharsWritten); + else + return WriteConsoleOutputCharacterA (hConsoleOutput, (LPCSTR) lpCharacter, nLength, dwWriteCoord, lpNumberOfCharsWritten); +} + +/* Error if FillConsoleOutputCharacter used: split CHAR */ + +BOOL +qxeScrollConsoleScreenBuffer (HANDLE hConsoleOutput, CONST SMALL_RECT * lpScrollRectangle, CONST SMALL_RECT * lpClipRectangle, COORD dwDestinationOrigin, CONST CHAR_INFO * lpFill) +{ + if (XEUNICODE_P) + return ScrollConsoleScreenBufferW (hConsoleOutput, lpScrollRectangle, lpClipRectangle, dwDestinationOrigin, lpFill); + else + return ScrollConsoleScreenBufferA (hConsoleOutput, lpScrollRectangle, lpClipRectangle, dwDestinationOrigin, lpFill); +} + +DWORD +qxeGetConsoleTitle (Extbyte * lpConsoleTitle, DWORD nSize) +{ + if (XEUNICODE_P) + return GetConsoleTitleW ((LPWSTR) lpConsoleTitle, nSize); + else + return GetConsoleTitleA ((LPSTR) lpConsoleTitle, nSize); +} + +BOOL +qxeSetConsoleTitle (const Extbyte * lpConsoleTitle) +{ + if (XEUNICODE_P) + return SetConsoleTitleW ((LPCWSTR) lpConsoleTitle); + else + return SetConsoleTitleA ((LPCSTR) lpConsoleTitle); +} + +BOOL +qxeReadConsole (HANDLE hConsoleInput, LPVOID lpBuffer, DWORD nNumberOfCharsToRead, LPDWORD lpNumberOfCharsRead, LPVOID lpReserved) +{ + if (XEUNICODE_P) + return ReadConsoleW (hConsoleInput, lpBuffer, nNumberOfCharsToRead, lpNumberOfCharsRead, lpReserved); + else + return ReadConsoleA (hConsoleInput, lpBuffer, nNumberOfCharsToRead, lpNumberOfCharsRead, lpReserved); } BOOL -qxeSetLocaleInfo (LCID Locale, LCTYPE LCType, const Extbyte * lpLCData) -{ - if (XEUNICODE_P) - return SetLocaleInfoW (Locale, LCType, (LPCWSTR) lpLCData); - else - return SetLocaleInfoA (Locale, LCType, (LPCSTR) lpLCData); -} - -/* Error if GetTimeFormat used: not used, not examined yet */ - -/* Error if GetDateFormat used: not used, not examined yet */ - -/* Error if GetNumberFormat used: not used, not examined yet */ - -/* Error if GetCurrencyFormat used: not used, not examined yet */ - -/* Error if EnumCalendarInfo used: not used, not examined yet */ - -/* Error if EnumCalendarInfoEx used: not used, not examined yet */ - -/* Error if EnumTimeFormats used: not used, not examined yet */ - -/* Error if EnumDateFormats used: not used, not examined yet */ - -/* Error if EnumDateFormatsEx used: not used, not examined yet */ - -/* Error if GetStringTypeEx used: not used, not examined yet */ - -/* Error if GetStringType used: no such fun; A and W versions have different nos. of args */ - -/* Error if FoldString used: not used, not examined yet */ - -/* Error if EnumSystemLocales used: not used, not examined yet */ - -/* Error if EnumSystemCodePages used: not used, not examined yet */ +qxeWriteConsole (HANDLE hConsoleOutput, CONST VOID * lpBuffer, DWORD nNumberOfCharsToWrite, LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved) +{ + if (XEUNICODE_P) + return WriteConsoleW (hConsoleOutput, lpBuffer, nNumberOfCharsToWrite, lpNumberOfCharsWritten, lpReserved); + else + return WriteConsoleA (hConsoleOutput, lpBuffer, nNumberOfCharsToWrite, lpNumberOfCharsWritten, lpReserved); +} + + +/*----------------------------------------------------------------------*/ +/* Processing file SHELLAPI.H */ +/*----------------------------------------------------------------------*/ + +UINT +qxeDragQueryFile (HDROP arg1, UINT arg2, Extbyte * arg3, UINT arg4) +{ + if (XEUNICODE_P) + return DragQueryFileW (arg1, arg2, (LPWSTR) arg3, arg4); + else + return DragQueryFileA (arg1, arg2, (LPSTR) arg3, arg4); +} + +HINSTANCE +qxeShellExecute (HWND hwnd, const Extbyte * lpOperation, const Extbyte * lpFile, const Extbyte * lpParameters, const Extbyte * lpDirectory, INT nShowCmd) +{ + if (XEUNICODE_P) + return ShellExecuteW (hwnd, (LPCWSTR) lpOperation, (LPCWSTR) lpFile, (LPCWSTR) lpParameters, (LPCWSTR) lpDirectory, nShowCmd); + else + return ShellExecuteA (hwnd, (LPCSTR) lpOperation, (LPCSTR) lpFile, (LPCSTR) lpParameters, (LPCSTR) lpDirectory, nShowCmd); +} + +HINSTANCE +qxeFindExecutable (const Extbyte * lpFile, const Extbyte * lpDirectory, Extbyte * lpResult) +{ + if (XEUNICODE_P) + return FindExecutableW ((LPCWSTR) lpFile, (LPCWSTR) lpDirectory, (LPWSTR) lpResult); + else + return FindExecutableA ((LPCSTR) lpFile, (LPCSTR) lpDirectory, (LPSTR) lpResult); +} + +/* Error if CommandLineToArgv used: Unicode-only */ + +INT +qxeShellAbout (HWND hWnd, const Extbyte * szApp, const Extbyte * szOtherStuff, HICON hIcon) +{ + if (XEUNICODE_P) + return ShellAboutW (hWnd, (LPCWSTR) szApp, (LPCWSTR) szOtherStuff, hIcon); + else + return ShellAboutA (hWnd, (LPCSTR) szApp, (LPCSTR) szOtherStuff, hIcon); +} + +HICON +qxeExtractAssociatedIcon (HINSTANCE hInst, Extbyte * lpIconPath, LPWORD lpiIcon) +{ + if (XEUNICODE_P) + return ExtractAssociatedIconW (hInst, (LPWSTR) lpIconPath, lpiIcon); + else + return ExtractAssociatedIconA (hInst, (LPSTR) lpIconPath, lpiIcon); +} + +HICON +qxeExtractIcon (HINSTANCE hInst, const Extbyte * lpszExeFileName, UINT nIconIndex) +{ + if (XEUNICODE_P) + return ExtractIconW (hInst, (LPCWSTR) lpszExeFileName, nIconIndex); + else + return ExtractIconA (hInst, (LPCSTR) lpszExeFileName, nIconIndex); +} + +#if !defined (CYGWIN_HEADERS) + +/* NOTE: NT 4.0+ only */ +DWORD +qxeDoEnvironmentSubst (Extbyte * szString, UINT cbString) +{ + if (XEUNICODE_P) + return DoEnvironmentSubstW ((LPWSTR) szString, cbString); + else + return DoEnvironmentSubstA ((LPSTR) szString, cbString); +} + +#endif /* !defined (CYGWIN_HEADERS) */ + +/* Error if FindEnvironmentString used: causes link error; NT 4.0+ only */ + +/* Skipping ExtractIconEx because NT 4.0+ only, error in Cygwin prototype */ + +/* NOTE: NT 4.0+ only */ +int +qxeSHFileOperation (LPSHFILEOPSTRUCTW lpFileOp) +{ + if (XEUNICODE_P) + return SHFileOperationW (lpFileOp); + else + return SHFileOperationA ((LPSHFILEOPSTRUCTA) lpFileOp); +} + +/* NOTE: NT 4.0+ only */ +BOOL +qxeShellExecuteEx (LPSHELLEXECUTEINFOW lpExecInfo) +{ + if (XEUNICODE_P) + return ShellExecuteExW (lpExecInfo); + else + return ShellExecuteExA ((LPSHELLEXECUTEINFOA) lpExecInfo); +} + +/* Error if WinExecError used: causes link error; NT 4.0+ only */ + +#if !defined (CYGWIN_HEADERS) + +/* NOTE: NT 4.0+ only */ +HRESULT +qxeSHQueryRecycleBin (const Extbyte * pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo) +{ + if (XEUNICODE_P) + return SHQueryRecycleBinW ((LPCWSTR) pszRootPath, pSHQueryRBInfo); + else + return SHQueryRecycleBinA ((LPCSTR) pszRootPath, pSHQueryRBInfo); +} + +#endif /* !defined (CYGWIN_HEADERS) */ + +#if !defined (CYGWIN_HEADERS) + +/* NOTE: NT 4.0+ only */ +HRESULT +qxeSHEmptyRecycleBin (HWND hwnd, const Extbyte * pszRootPath, DWORD dwFlags) +{ + if (XEUNICODE_P) + return SHEmptyRecycleBinW (hwnd, (LPCWSTR) pszRootPath, dwFlags); + else + return SHEmptyRecycleBinA (hwnd, (LPCSTR) pszRootPath, dwFlags); +} + +#endif /* !defined (CYGWIN_HEADERS) */ + +/* Error if Shell_NotifyIcon used: split-sized NOTIFYICONDATA, NT 4.0+ only */ + +/* Skipping SHGetFileInfo because split-sized SHFILEINFO, NT 4.0+ only */ + +/* Error if SHGetDiskFreeSpace used: causes link error; NT 4.0+ only */ + +#if !defined (CYGWIN_HEADERS) + +/* NOTE: NT 4.0+ only */ +BOOL +qxeSHGetNewLinkInfo (const Extbyte * pszLinkTo, const Extbyte * pszDir, Extbyte * pszName, BOOL * pfMustCopy, UINT uFlags) +{ + if (XEUNICODE_P) + return SHGetNewLinkInfoW ((LPCWSTR) pszLinkTo, (LPCWSTR) pszDir, (LPWSTR) pszName, pfMustCopy, uFlags); + else + return SHGetNewLinkInfoA ((LPCSTR) pszLinkTo, (LPCSTR) pszDir, (LPSTR) pszName, pfMustCopy, uFlags); +} + +#endif /* !defined (CYGWIN_HEADERS) */ + +#if !defined (CYGWIN_HEADERS) + +/* NOTE: NT 4.0+ only */ +BOOL +qxeSHInvokePrinterCommand (HWND hwnd, UINT uAction, const Extbyte * lpBuf1, const Extbyte * lpBuf2, BOOL fModal) +{ + if (XEUNICODE_P) + return SHInvokePrinterCommandW (hwnd, uAction, (LPCWSTR) lpBuf1, (LPCWSTR) lpBuf2, fModal); + else + return SHInvokePrinterCommandA (hwnd, uAction, (LPCSTR) lpBuf1, (LPCSTR) lpBuf2, fModal); +} + +#endif /* !defined (CYGWIN_HEADERS) */ /*----------------------------------------------------------------------*/ @@ -664,762 +885,6 @@ /*----------------------------------------------------------------------*/ -/* Processing file WINREG.H */ -/*----------------------------------------------------------------------*/ - -/* Skipping RegConnectRegistry because error in Cygwin prototype */ - -LONG - -qxeRegCreateKey (HKEY hKey, const Extbyte * lpSubKey, PHKEY phkResult) -{ - if (XEUNICODE_P) - return RegCreateKeyW (hKey, (LPCWSTR) lpSubKey, phkResult); - else - return RegCreateKeyA (hKey, (LPCSTR) lpSubKey, phkResult); -} - -LONG - -qxeRegCreateKeyEx (HKEY hKey, const Extbyte * lpSubKey, DWORD Reserved, Extbyte * lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition) -{ - if (XEUNICODE_P) - return RegCreateKeyExW (hKey, (LPCWSTR) lpSubKey, Reserved, (LPWSTR) lpClass, dwOptions, samDesired, lpSecurityAttributes, phkResult, lpdwDisposition); - else - return RegCreateKeyExA (hKey, (LPCSTR) lpSubKey, Reserved, (LPSTR) lpClass, dwOptions, samDesired, lpSecurityAttributes, phkResult, lpdwDisposition); -} - -LONG - -qxeRegDeleteKey (HKEY hKey, const Extbyte * lpSubKey) -{ - if (XEUNICODE_P) - return RegDeleteKeyW (hKey, (LPCWSTR) lpSubKey); - else - return RegDeleteKeyA (hKey, (LPCSTR) lpSubKey); -} - -LONG - -qxeRegDeleteValue (HKEY hKey, const Extbyte * lpValueName) -{ - if (XEUNICODE_P) - return RegDeleteValueW (hKey, (LPCWSTR) lpValueName); - else - return RegDeleteValueA (hKey, (LPCSTR) lpValueName); -} - -LONG - -qxeRegEnumKey (HKEY hKey, DWORD dwIndex, Extbyte * lpName, DWORD cbName) -{ - if (XEUNICODE_P) - return RegEnumKeyW (hKey, dwIndex, (LPWSTR) lpName, cbName); - else - return RegEnumKeyA (hKey, dwIndex, (LPSTR) lpName, cbName); -} - -LONG - -qxeRegEnumKeyEx (HKEY hKey, DWORD dwIndex, Extbyte * lpName, LPDWORD lpcbName, LPDWORD lpReserved, Extbyte * lpClass, LPDWORD lpcbClass, PFILETIME lpftLastWriteTime) -{ - if (XEUNICODE_P) - return RegEnumKeyExW (hKey, dwIndex, (LPWSTR) lpName, lpcbName, lpReserved, (LPWSTR) lpClass, lpcbClass, lpftLastWriteTime); - else - return RegEnumKeyExA (hKey, dwIndex, (LPSTR) lpName, lpcbName, lpReserved, (LPSTR) lpClass, lpcbClass, lpftLastWriteTime); -} - -LONG - -qxeRegEnumValue (HKEY hKey, DWORD dwIndex, Extbyte * lpValueName, LPDWORD lpcbValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData) -{ - if (XEUNICODE_P) - return RegEnumValueW (hKey, dwIndex, (LPWSTR) lpValueName, lpcbValueName, lpReserved, lpType, lpData, lpcbData); - else - return RegEnumValueA (hKey, dwIndex, (LPSTR) lpValueName, lpcbValueName, lpReserved, lpType, lpData, lpcbData); -} - -LONG - -qxeRegLoadKey (HKEY hKey, const Extbyte * lpSubKey, const Extbyte * lpFile) -{ - if (XEUNICODE_P) - return RegLoadKeyW (hKey, (LPCWSTR) lpSubKey, (LPCWSTR) lpFile); - else - return RegLoadKeyA (hKey, (LPCSTR) lpSubKey, (LPCSTR) lpFile); -} - -LONG - -qxeRegOpenKey (HKEY hKey, const Extbyte * lpSubKey, PHKEY phkResult) -{ - if (XEUNICODE_P) - return RegOpenKeyW (hKey, (LPCWSTR) lpSubKey, phkResult); - else - return RegOpenKeyA (hKey, (LPCSTR) lpSubKey, phkResult); -} - -LONG - -qxeRegOpenKeyEx (HKEY hKey, const Extbyte * lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult) -{ - if (XEUNICODE_P) - return RegOpenKeyExW (hKey, (LPCWSTR) lpSubKey, ulOptions, samDesired, phkResult); - else - return RegOpenKeyExA (hKey, (LPCSTR) lpSubKey, ulOptions, samDesired, phkResult); -} - -LONG - -qxeRegQueryInfoKey (HKEY hKey, Extbyte * lpClass, LPDWORD lpcbClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcbMaxSubKeyLen, LPDWORD lpcbMaxClassLen, LPDWORD lpcValues, LPDWORD lpcbMaxValueNameLen, LPDWORD lpcbMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime) -{ - if (XEUNICODE_P) - return RegQueryInfoKeyW (hKey, (LPWSTR) lpClass, lpcbClass, lpReserved, lpcSubKeys, lpcbMaxSubKeyLen, lpcbMaxClassLen, lpcValues, lpcbMaxValueNameLen, lpcbMaxValueLen, lpcbSecurityDescriptor, lpftLastWriteTime); - else - return RegQueryInfoKeyA (hKey, (LPSTR) lpClass, lpcbClass, lpReserved, lpcSubKeys, lpcbMaxSubKeyLen, lpcbMaxClassLen, lpcValues, lpcbMaxValueNameLen, lpcbMaxValueLen, lpcbSecurityDescriptor, lpftLastWriteTime); -} - -LONG - -qxeRegQueryValue (HKEY hKey, const Extbyte * lpSubKey, Extbyte * lpValue, PLONG lpcbValue) -{ - if (XEUNICODE_P) - return RegQueryValueW (hKey, (LPCWSTR) lpSubKey, (LPWSTR) lpValue, lpcbValue); - else - return RegQueryValueA (hKey, (LPCSTR) lpSubKey, (LPSTR) lpValue, lpcbValue); -} - -LONG - -qxeRegQueryMultipleValues (HKEY hKey, PVALENTW val_list, DWORD num_vals, Extbyte * lpValueBuf, LPDWORD ldwTotsize) -{ - if (XEUNICODE_P) - return RegQueryMultipleValuesW (hKey, val_list, num_vals, (LPWSTR) lpValueBuf, ldwTotsize); - else - return RegQueryMultipleValuesA (hKey, (PVALENTA) val_list, num_vals, (LPSTR) lpValueBuf, ldwTotsize); -} - -LONG - -qxeRegQueryValueEx (HKEY hKey, const Extbyte * lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData) -{ - if (XEUNICODE_P) - return RegQueryValueExW (hKey, (LPCWSTR) lpValueName, lpReserved, lpType, lpData, lpcbData); - else - return RegQueryValueExA (hKey, (LPCSTR) lpValueName, lpReserved, lpType, lpData, lpcbData); -} - -LONG - -qxeRegReplaceKey (HKEY hKey, const Extbyte * lpSubKey, const Extbyte * lpNewFile, const Extbyte * lpOldFile) -{ - if (XEUNICODE_P) - return RegReplaceKeyW (hKey, (LPCWSTR) lpSubKey, (LPCWSTR) lpNewFile, (LPCWSTR) lpOldFile); - else - return RegReplaceKeyA (hKey, (LPCSTR) lpSubKey, (LPCSTR) lpNewFile, (LPCSTR) lpOldFile); -} - -LONG - -qxeRegRestoreKey (HKEY hKey, const Extbyte * lpFile, DWORD dwFlags) -{ - if (XEUNICODE_P) - return RegRestoreKeyW (hKey, (LPCWSTR) lpFile, dwFlags); - else - return RegRestoreKeyA (hKey, (LPCSTR) lpFile, dwFlags); -} - -LONG - -qxeRegSaveKey (HKEY hKey, const Extbyte * lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes) -{ - if (XEUNICODE_P) - return RegSaveKeyW (hKey, (LPCWSTR) lpFile, lpSecurityAttributes); - else - return RegSaveKeyA (hKey, (LPCSTR) lpFile, lpSecurityAttributes); -} - -LONG - -qxeRegSetValue (HKEY hKey, const Extbyte * lpSubKey, DWORD dwType, const Extbyte * lpData, DWORD cbData) -{ - if (XEUNICODE_P) - return RegSetValueW (hKey, (LPCWSTR) lpSubKey, dwType, (LPCWSTR) lpData, cbData); - else - return RegSetValueA (hKey, (LPCSTR) lpSubKey, dwType, (LPCSTR) lpData, cbData); -} - -LONG - -qxeRegSetValueEx (HKEY hKey, const Extbyte * lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE* lpData, DWORD cbData) -{ - if (XEUNICODE_P) - return RegSetValueExW (hKey, (LPCWSTR) lpValueName, Reserved, dwType, lpData, cbData); - else - return RegSetValueExA (hKey, (LPCSTR) lpValueName, Reserved, dwType, lpData, cbData); -} - -LONG - -qxeRegUnLoadKey (HKEY hKey, const Extbyte * lpSubKey) -{ - if (XEUNICODE_P) - return RegUnLoadKeyW (hKey, (LPCWSTR) lpSubKey); - else - return RegUnLoadKeyA (hKey, (LPCSTR) lpSubKey); -} - -BOOL - -qxeInitiateSystemShutdown (Extbyte * lpMachineName, Extbyte * lpMessage, DWORD dwTimeout, BOOL bForceAppsClosed, BOOL bRebootAfterShutdown) -{ - if (XEUNICODE_P) - return InitiateSystemShutdownW ((LPWSTR) lpMachineName, (LPWSTR) lpMessage, dwTimeout, bForceAppsClosed, bRebootAfterShutdown); - else - return InitiateSystemShutdownA ((LPSTR) lpMachineName, (LPSTR) lpMessage, dwTimeout, bForceAppsClosed, bRebootAfterShutdown); -} - -BOOL - -qxeAbortSystemShutdown (Extbyte * lpMachineName) -{ - if (XEUNICODE_P) - return AbortSystemShutdownW ((LPWSTR) lpMachineName); - else - return AbortSystemShutdownA ((LPSTR) lpMachineName); -} - - -/*----------------------------------------------------------------------*/ -/* Processing file SHELLAPI.H */ -/*----------------------------------------------------------------------*/ - -UINT -qxeDragQueryFile (HDROP arg1, UINT arg2, Extbyte * arg3, UINT arg4) -{ - if (XEUNICODE_P) - return DragQueryFileW (arg1, arg2, (LPWSTR) arg3, arg4); - else - return DragQueryFileA (arg1, arg2, (LPSTR) arg3, arg4); -} - -HINSTANCE -qxeShellExecute (HWND hwnd, const Extbyte * lpOperation, const Extbyte * lpFile, const Extbyte * lpParameters, const Extbyte * lpDirectory, INT nShowCmd) -{ - if (XEUNICODE_P) - return ShellExecuteW (hwnd, (LPCWSTR) lpOperation, (LPCWSTR) lpFile, (LPCWSTR) lpParameters, (LPCWSTR) lpDirectory, nShowCmd); - else - return ShellExecuteA (hwnd, (LPCSTR) lpOperation, (LPCSTR) lpFile, (LPCSTR) lpParameters, (LPCSTR) lpDirectory, nShowCmd); -} - -HINSTANCE -qxeFindExecutable (const Extbyte * lpFile, const Extbyte * lpDirectory, Extbyte * lpResult) -{ - if (XEUNICODE_P) - return FindExecutableW ((LPCWSTR) lpFile, (LPCWSTR) lpDirectory, (LPWSTR) lpResult); - else - return FindExecutableA ((LPCSTR) lpFile, (LPCSTR) lpDirectory, (LPSTR) lpResult); -} - -/* Error if CommandLineToArgv used: Unicode-only */ - -INT -qxeShellAbout (HWND hWnd, const Extbyte * szApp, const Extbyte * szOtherStuff, HICON hIcon) -{ - if (XEUNICODE_P) - return ShellAboutW (hWnd, (LPCWSTR) szApp, (LPCWSTR) szOtherStuff, hIcon); - else - return ShellAboutA (hWnd, (LPCSTR) szApp, (LPCSTR) szOtherStuff, hIcon); -} - -HICON -qxeExtractAssociatedIcon (HINSTANCE hInst, Extbyte * lpIconPath, LPWORD lpiIcon) -{ - if (XEUNICODE_P) - return ExtractAssociatedIconW (hInst, (LPWSTR) lpIconPath, lpiIcon); - else - return ExtractAssociatedIconA (hInst, (LPSTR) lpIconPath, lpiIcon); -} - -HICON -qxeExtractIcon (HINSTANCE hInst, const Extbyte * lpszExeFileName, UINT nIconIndex) -{ - if (XEUNICODE_P) - return ExtractIconW (hInst, (LPCWSTR) lpszExeFileName, nIconIndex); - else - return ExtractIconA (hInst, (LPCSTR) lpszExeFileName, nIconIndex); -} - -#if !defined (CYGWIN_HEADERS) - -/* NOTE: NT 4.0+ only */ -DWORD -qxeDoEnvironmentSubst (Extbyte * szString, UINT cbString) -{ - if (XEUNICODE_P) - return DoEnvironmentSubstW ((LPWSTR) szString, cbString); - else - return DoEnvironmentSubstA ((LPSTR) szString, cbString); -} - -#endif /* !defined (CYGWIN_HEADERS) */ - -/* Error if FindEnvironmentString used: causes link error; NT 4.0+ only */ - -/* Skipping ExtractIconEx because NT 4.0+ only, error in Cygwin prototype */ - -/* NOTE: NT 4.0+ only */ -int -qxeSHFileOperation (LPSHFILEOPSTRUCTW lpFileOp) -{ - if (XEUNICODE_P) - return SHFileOperationW (lpFileOp); - else - return SHFileOperationA ((LPSHFILEOPSTRUCTA) lpFileOp); -} - -/* NOTE: NT 4.0+ only */ -BOOL -qxeShellExecuteEx (LPSHELLEXECUTEINFOW lpExecInfo) -{ - if (XEUNICODE_P) - return ShellExecuteExW (lpExecInfo); - else - return ShellExecuteExA ((LPSHELLEXECUTEINFOA) lpExecInfo); -} - -/* Error if WinExecError used: causes link error; NT 4.0+ only */ - -#if !defined (CYGWIN_HEADERS) - -/* NOTE: NT 4.0+ only */ -HRESULT -qxeSHQueryRecycleBin (const Extbyte * pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo) -{ - if (XEUNICODE_P) - return SHQueryRecycleBinW ((LPCWSTR) pszRootPath, pSHQueryRBInfo); - else - return SHQueryRecycleBinA ((LPCSTR) pszRootPath, pSHQueryRBInfo); -} - -#endif /* !defined (CYGWIN_HEADERS) */ - -#if !defined (CYGWIN_HEADERS) - -/* NOTE: NT 4.0+ only */ -HRESULT -qxeSHEmptyRecycleBin (HWND hwnd, const Extbyte * pszRootPath, DWORD dwFlags) -{ - if (XEUNICODE_P) - return SHEmptyRecycleBinW (hwnd, (LPCWSTR) pszRootPath, dwFlags); - else - return SHEmptyRecycleBinA (hwnd, (LPCSTR) pszRootPath, dwFlags); -} - -#endif /* !defined (CYGWIN_HEADERS) */ - -/* Error if Shell_NotifyIcon used: split-sized NOTIFYICONDATA, NT 4.0+ only */ - -/* Skipping SHGetFileInfo because split-sized SHFILEINFO, NT 4.0+ only */ - -/* Error if SHGetDiskFreeSpace used: causes link error; NT 4.0+ only */ - -#if !defined (CYGWIN_HEADERS) - -/* NOTE: NT 4.0+ only */ -BOOL -qxeSHGetNewLinkInfo (const Extbyte * pszLinkTo, const Extbyte * pszDir, Extbyte * pszName, BOOL * pfMustCopy, UINT uFlags) -{ - if (XEUNICODE_P) - return SHGetNewLinkInfoW ((LPCWSTR) pszLinkTo, (LPCWSTR) pszDir, (LPWSTR) pszName, pfMustCopy, uFlags); - else - return SHGetNewLinkInfoA ((LPCSTR) pszLinkTo, (LPCSTR) pszDir, (LPSTR) pszName, pfMustCopy, uFlags); -} - -#endif /* !defined (CYGWIN_HEADERS) */ - -#if !defined (CYGWIN_HEADERS) - -/* NOTE: NT 4.0+ only */ -BOOL -qxeSHInvokePrinterCommand (HWND hwnd, UINT uAction, const Extbyte * lpBuf1, const Extbyte * lpBuf2, BOOL fModal) -{ - if (XEUNICODE_P) - return SHInvokePrinterCommandW (hwnd, uAction, (LPCWSTR) lpBuf1, (LPCWSTR) lpBuf2, fModal); - else - return SHInvokePrinterCommandA (hwnd, uAction, (LPCSTR) lpBuf1, (LPCSTR) lpBuf2, fModal); -} - -#endif /* !defined (CYGWIN_HEADERS) */ - - -/*----------------------------------------------------------------------*/ -/* Processing file WINCON.H */ -/*----------------------------------------------------------------------*/ - -BOOL -qxePeekConsoleInput (HANDLE hConsoleInput, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead) -{ - if (XEUNICODE_P) - return PeekConsoleInputW (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead); - else - return PeekConsoleInputA (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead); -} - -BOOL -qxeReadConsoleInput (HANDLE hConsoleInput, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead) -{ - if (XEUNICODE_P) - return ReadConsoleInputW (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead); - else - return ReadConsoleInputA (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead); -} - -BOOL -qxeWriteConsoleInput (HANDLE hConsoleInput, CONST INPUT_RECORD * lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsWritten) -{ - if (XEUNICODE_P) - return WriteConsoleInputW (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsWritten); - else - return WriteConsoleInputA (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsWritten); -} - -BOOL -qxeReadConsoleOutput (HANDLE hConsoleOutput, PCHAR_INFO lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, PSMALL_RECT lpReadRegion) -{ - if (XEUNICODE_P) - return ReadConsoleOutputW (hConsoleOutput, lpBuffer, dwBufferSize, dwBufferCoord, lpReadRegion); - else - return ReadConsoleOutputA (hConsoleOutput, lpBuffer, dwBufferSize, dwBufferCoord, lpReadRegion); -} - -BOOL -qxeWriteConsoleOutput (HANDLE hConsoleOutput, CONST CHAR_INFO * lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, PSMALL_RECT lpWriteRegion) -{ - if (XEUNICODE_P) - return WriteConsoleOutputW (hConsoleOutput, lpBuffer, dwBufferSize, dwBufferCoord, lpWriteRegion); - else - return WriteConsoleOutputA (hConsoleOutput, lpBuffer, dwBufferSize, dwBufferCoord, lpWriteRegion); -} - -BOOL -qxeReadConsoleOutputCharacter (HANDLE hConsoleOutput, Extbyte * lpCharacter, DWORD nLength, COORD dwReadCoord, LPDWORD lpNumberOfCharsRead) -{ - if (XEUNICODE_P) - return ReadConsoleOutputCharacterW (hConsoleOutput, (LPWSTR) lpCharacter, nLength, dwReadCoord, lpNumberOfCharsRead); - else - return ReadConsoleOutputCharacterA (hConsoleOutput, (LPSTR) lpCharacter, nLength, dwReadCoord, lpNumberOfCharsRead); -} - -BOOL -qxeWriteConsoleOutputCharacter (HANDLE hConsoleOutput, const Extbyte * lpCharacter, DWORD nLength, COORD dwWriteCoord, LPDWORD lpNumberOfCharsWritten) -{ - if (XEUNICODE_P) - return WriteConsoleOutputCharacterW (hConsoleOutput, (LPCWSTR) lpCharacter, nLength, dwWriteCoord, lpNumberOfCharsWritten); - else - return WriteConsoleOutputCharacterA (hConsoleOutput, (LPCSTR) lpCharacter, nLength, dwWriteCoord, lpNumberOfCharsWritten); -} - -/* Error if FillConsoleOutputCharacter used: split CHAR */ - -BOOL -qxeScrollConsoleScreenBuffer (HANDLE hConsoleOutput, CONST SMALL_RECT * lpScrollRectangle, CONST SMALL_RECT * lpClipRectangle, COORD dwDestinationOrigin, CONST CHAR_INFO * lpFill) -{ - if (XEUNICODE_P) - return ScrollConsoleScreenBufferW (hConsoleOutput, lpScrollRectangle, lpClipRectangle, dwDestinationOrigin, lpFill); - else - return ScrollConsoleScreenBufferA (hConsoleOutput, lpScrollRectangle, lpClipRectangle, dwDestinationOrigin, lpFill); -} - -DWORD -qxeGetConsoleTitle (Extbyte * lpConsoleTitle, DWORD nSize) -{ - if (XEUNICODE_P) - return GetConsoleTitleW ((LPWSTR) lpConsoleTitle, nSize); - else - return GetConsoleTitleA ((LPSTR) lpConsoleTitle, nSize); -} - -BOOL -qxeSetConsoleTitle (const Extbyte * lpConsoleTitle) -{ - if (XEUNICODE_P) - return SetConsoleTitleW ((LPCWSTR) lpConsoleTitle); - else - return SetConsoleTitleA ((LPCSTR) lpConsoleTitle); -} - -BOOL -qxeReadConsole (HANDLE hConsoleInput, LPVOID lpBuffer, DWORD nNumberOfCharsToRead, LPDWORD lpNumberOfCharsRead, LPVOID lpReserved) -{ - if (XEUNICODE_P) - return ReadConsoleW (hConsoleInput, lpBuffer, nNumberOfCharsToRead, lpNumberOfCharsRead, lpReserved); - else - return ReadConsoleA (hConsoleInput, lpBuffer, nNumberOfCharsToRead, lpNumberOfCharsRead, lpReserved); -} - -BOOL -qxeWriteConsole (HANDLE hConsoleOutput, CONST VOID * lpBuffer, DWORD nNumberOfCharsToWrite, LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved) -{ - if (XEUNICODE_P) - return WriteConsoleW (hConsoleOutput, lpBuffer, nNumberOfCharsToWrite, lpNumberOfCharsWritten, lpReserved); - else - return WriteConsoleA (hConsoleOutput, lpBuffer, nNumberOfCharsToWrite, lpNumberOfCharsWritten, lpReserved); -} - - -/*----------------------------------------------------------------------*/ -/* Processing file IMM.H */ -/*----------------------------------------------------------------------*/ - -#if defined (HAVE_MS_WINDOWS) - -HKL -qxeImmInstallIME (const Extbyte * lpszIMEFileName, const Extbyte * lpszLayoutText) -{ - if (XEUNICODE_P) - return ImmInstallIMEW ((LPCWSTR) lpszIMEFileName, (LPCWSTR) lpszLayoutText); - else - return ImmInstallIMEA ((LPCSTR) lpszIMEFileName, (LPCSTR) lpszLayoutText); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -UINT -qxeImmGetDescription (HKL arg1, Extbyte * arg2, UINT uBufLen) -{ - if (XEUNICODE_P) - return ImmGetDescriptionW (arg1, (LPWSTR) arg2, uBufLen); - else - return ImmGetDescriptionA (arg1, (LPSTR) arg2, uBufLen); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -UINT -qxeImmGetIMEFileName (HKL arg1, Extbyte * arg2, UINT uBufLen) -{ - if (XEUNICODE_P) - return ImmGetIMEFileNameW (arg1, (LPWSTR) arg2, uBufLen); - else - return ImmGetIMEFileNameA (arg1, (LPSTR) arg2, uBufLen); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -LONG -qxeImmGetCompositionString (HIMC arg1, DWORD arg2, LPVOID arg3, DWORD arg4) -{ - if (XEUNICODE_P) - return ImmGetCompositionStringW (arg1, arg2, arg3, arg4); - else - return ImmGetCompositionStringA (arg1, arg2, arg3, arg4); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -BOOL -qxeImmSetCompositionString (HIMC arg1, DWORD dwIndex, LPCVOID lpComp, DWORD arg4, LPCVOID lpRead, DWORD arg6) -{ - if (XEUNICODE_P) - return ImmSetCompositionStringW (arg1, dwIndex, lpComp, arg4, lpRead, arg6); - else - return ImmSetCompositionStringA (arg1, dwIndex, lpComp, arg4, lpRead, arg6); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -DWORD -qxeImmGetCandidateListCount (HIMC arg1, LPDWORD lpdwListCount) -{ - if (XEUNICODE_P) - return ImmGetCandidateListCountW (arg1, lpdwListCount); - else - return ImmGetCandidateListCountA (arg1, lpdwListCount); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -DWORD -qxeImmGetCandidateList (HIMC arg1, DWORD deIndex, LPCANDIDATELIST arg3, DWORD dwBufLen) -{ - if (XEUNICODE_P) - return ImmGetCandidateListW (arg1, deIndex, arg3, dwBufLen); - else - return ImmGetCandidateListA (arg1, deIndex, arg3, dwBufLen); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -DWORD -qxeImmGetGuideLine (HIMC arg1, DWORD dwIndex, Extbyte * arg3, DWORD dwBufLen) -{ - if (XEUNICODE_P) - return ImmGetGuideLineW (arg1, dwIndex, (LPWSTR) arg3, dwBufLen); - else - return ImmGetGuideLineA (arg1, dwIndex, (LPSTR) arg3, dwBufLen); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -/* Skipping ImmGetCompositionFont because split-sized LOGFONT */ - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -/* Skipping ImmSetCompositionFont because split-sized LOGFONT */ - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -/* NOTE: // split-simple REGISTERWORD */ -BOOL -qxeImmConfigureIME (HKL arg1, HWND arg2, DWORD arg3, LPVOID arg4) -{ - if (XEUNICODE_P) - return ImmConfigureIMEW (arg1, arg2, arg3, arg4); - else - return ImmConfigureIMEA (arg1, arg2, arg3, arg4); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -/* NOTE: // strings of various sorts */ -LRESULT -qxeImmEscape (HKL arg1, HIMC arg2, UINT arg3, LPVOID arg4) -{ - if (XEUNICODE_P) - return ImmEscapeW (arg1, arg2, arg3, arg4); - else - return ImmEscapeA (arg1, arg2, arg3, arg4); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -DWORD -qxeImmGetConversionList (HKL arg1, HIMC arg2, const Extbyte * arg3, LPCANDIDATELIST arg4, DWORD dwBufLen, UINT uFlag) -{ - if (XEUNICODE_P) - return ImmGetConversionListW (arg1, arg2, (LPCWSTR) arg3, arg4, dwBufLen, uFlag); - else - return ImmGetConversionListA (arg1, arg2, (LPCSTR) arg3, arg4, dwBufLen, uFlag); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -BOOL -qxeImmIsUIMessage (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4) -{ - if (XEUNICODE_P) - return ImmIsUIMessageW (arg1, arg2, arg3, arg4); - else - return ImmIsUIMessageA (arg1, arg2, arg3, arg4); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -BOOL -qxeImmRegisterWord (HKL arg1, const Extbyte * lpszReading, DWORD arg3, const Extbyte * lpszRegister) -{ - if (XEUNICODE_P) - return ImmRegisterWordW (arg1, (LPCWSTR) lpszReading, arg3, (LPCWSTR) lpszRegister); - else - return ImmRegisterWordA (arg1, (LPCSTR) lpszReading, arg3, (LPCSTR) lpszRegister); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -BOOL -qxeImmUnregisterWord (HKL arg1, const Extbyte * lpszReading, DWORD arg3, const Extbyte * lpszUnregister) -{ - if (XEUNICODE_P) - return ImmUnregisterWordW (arg1, (LPCWSTR) lpszReading, arg3, (LPCWSTR) lpszUnregister); - else - return ImmUnregisterWordA (arg1, (LPCSTR) lpszReading, arg3, (LPCSTR) lpszUnregister); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -/* Error if ImmGetRegisterWordStyle used: split-sized STYLEBUF */ - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -UINT -qxeImmEnumRegisterWord (HKL arg1, REGISTERWORDENUMPROCW arg2, const Extbyte * lpszReading, DWORD arg4, const Extbyte * lpszRegister, LPVOID arg6) -{ - if (XEUNICODE_P) - return ImmEnumRegisterWordW (arg1, arg2, (LPCWSTR) lpszReading, arg4, (LPCWSTR) lpszRegister, arg6); - else - return ImmEnumRegisterWordA (arg1, (REGISTERWORDENUMPROCA) arg2, (LPCSTR) lpszReading, arg4, (LPCSTR) lpszRegister, arg6); -} - -#endif /* defined (HAVE_MS_WINDOWS) */ - -#if defined (HAVE_MS_WINDOWS) - -/* Error if ImmGetImeMenuItems used: split-sized IMEMENUITEMINFO */ - -#endif /* defined (HAVE_MS_WINDOWS) */ - - -/*----------------------------------------------------------------------*/ -/* Processing file DDEML.H */ -/*----------------------------------------------------------------------*/ - -UINT -qxeDdeInitialize (LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes) -{ - if (XEUNICODE_P) - return DdeInitializeW (pidInst, pfnCallback, afCmd, ulRes); - else - return DdeInitializeA (pidInst, pfnCallback, afCmd, ulRes); -} - -/* Skipping DdeCreateStringHandle because error in Cygwin prototype */ - -DWORD -qxeDdeQueryString (DWORD idInst, HSZ hsz, Extbyte * psz, DWORD cchMax, int iCodePage) -{ - if (XEUNICODE_P) - return DdeQueryStringW (idInst, hsz, (LPWSTR) psz, cchMax, iCodePage); - else - return DdeQueryStringA (idInst, hsz, (LPSTR) psz, cchMax, iCodePage); -} - - -/*----------------------------------------------------------------------*/ /* Processing file WINUSER.H */ /*----------------------------------------------------------------------*/ @@ -2393,160 +1858,943 @@ /*----------------------------------------------------------------------*/ -/* Processing file MMSYSTEM.H */ +/* Processing file DDEML.H */ +/*----------------------------------------------------------------------*/ + +UINT +qxeDdeInitialize (LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes) +{ + if (XEUNICODE_P) + return DdeInitializeW (pidInst, pfnCallback, afCmd, ulRes); + else + return DdeInitializeA (pidInst, pfnCallback, afCmd, ulRes); +} + +/* Skipping DdeCreateStringHandle because error in Cygwin prototype */ + +DWORD +qxeDdeQueryString (DWORD idInst, HSZ hsz, Extbyte * psz, DWORD cchMax, int iCodePage) +{ + if (XEUNICODE_P) + return DdeQueryStringW (idInst, hsz, (LPWSTR) psz, cchMax, iCodePage); + else + return DdeQueryStringA (idInst, hsz, (LPSTR) psz, cchMax, iCodePage); +} + + +/*----------------------------------------------------------------------*/ +/* Processing file WINREG.H */ /*----------------------------------------------------------------------*/ +/* Skipping RegConnectRegistry because error in Cygwin prototype */ + +LONG + +qxeRegCreateKey (HKEY hKey, const Extbyte * lpSubKey, PHKEY phkResult) +{ + if (XEUNICODE_P) + return RegCreateKeyW (hKey, (LPCWSTR) lpSubKey, phkResult); + else + return RegCreateKeyA (hKey, (LPCSTR) lpSubKey, phkResult); +} + +LONG + +qxeRegCreateKeyEx (HKEY hKey, const Extbyte * lpSubKey, DWORD Reserved, Extbyte * lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition) +{ + if (XEUNICODE_P) + return RegCreateKeyExW (hKey, (LPCWSTR) lpSubKey, Reserved, (LPWSTR) lpClass, dwOptions, samDesired, lpSecurityAttributes, phkResult, lpdwDisposition); + else + return RegCreateKeyExA (hKey, (LPCSTR) lpSubKey, Reserved, (LPSTR) lpClass, dwOptions, samDesired, lpSecurityAttributes, phkResult, lpdwDisposition); +} + +LONG + +qxeRegDeleteKey (HKEY hKey, const Extbyte * lpSubKey) +{ + if (XEUNICODE_P) + return RegDeleteKeyW (hKey, (LPCWSTR) lpSubKey); + else + return RegDeleteKeyA (hKey, (LPCSTR) lpSubKey); +} + +LONG + +qxeRegDeleteValue (HKEY hKey, const Extbyte * lpValueName) +{ + if (XEUNICODE_P) + return RegDeleteValueW (hKey, (LPCWSTR) lpValueName); + else + return RegDeleteValueA (hKey, (LPCSTR) lpValueName); +} + +LONG + +qxeRegEnumKey (HKEY hKey, DWORD dwIndex, Extbyte * lpName, DWORD cbName) +{ + if (XEUNICODE_P) + return RegEnumKeyW (hKey, dwIndex, (LPWSTR) lpName, cbName); + else + return RegEnumKeyA (hKey, dwIndex, (LPSTR) lpName, cbName); +} + +LONG + +qxeRegEnumKeyEx (HKEY hKey, DWORD dwIndex, Extbyte * lpName, LPDWORD lpcbName, LPDWORD lpReserved, Extbyte * lpClass, LPDWORD lpcbClass, PFILETIME lpftLastWriteTime) +{ + if (XEUNICODE_P) + return RegEnumKeyExW (hKey, dwIndex, (LPWSTR) lpName, lpcbName, lpReserved, (LPWSTR) lpClass, lpcbClass, lpftLastWriteTime); + else + return RegEnumKeyExA (hKey, dwIndex, (LPSTR) lpName, lpcbName, lpReserved, (LPSTR) lpClass, lpcbClass, lpftLastWriteTime); +} + +LONG + +qxeRegEnumValue (HKEY hKey, DWORD dwIndex, Extbyte * lpValueName, LPDWORD lpcbValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData) +{ + if (XEUNICODE_P) + return RegEnumValueW (hKey, dwIndex, (LPWSTR) lpValueName, lpcbValueName, lpReserved, lpType, lpData, lpcbData); + else + return RegEnumValueA (hKey, dwIndex, (LPSTR) lpValueName, lpcbValueName, lpReserved, lpType, lpData, lpcbData); +} + +LONG + +qxeRegLoadKey (HKEY hKey, const Extbyte * lpSubKey, const Extbyte * lpFile) +{ + if (XEUNICODE_P) + return RegLoadKeyW (hKey, (LPCWSTR) lpSubKey, (LPCWSTR) lpFile); + else + return RegLoadKeyA (hKey, (LPCSTR) lpSubKey, (LPCSTR) lpFile); +} + +LONG + +qxeRegOpenKey (HKEY hKey, const Extbyte * lpSubKey, PHKEY phkResult) +{ + if (XEUNICODE_P) + return RegOpenKeyW (hKey, (LPCWSTR) lpSubKey, phkResult); + else + return RegOpenKeyA (hKey, (LPCSTR) lpSubKey, phkResult); +} + +LONG + +qxeRegOpenKeyEx (HKEY hKey, const Extbyte * lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult) +{ + if (XEUNICODE_P) + return RegOpenKeyExW (hKey, (LPCWSTR) lpSubKey, ulOptions, samDesired, phkResult); + else + return RegOpenKeyExA (hKey, (LPCSTR) lpSubKey, ulOptions, samDesired, phkResult); +} + +LONG + +qxeRegQueryInfoKey (HKEY hKey, Extbyte * lpClass, LPDWORD lpcbClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcbMaxSubKeyLen, LPDWORD lpcbMaxClassLen, LPDWORD lpcValues, LPDWORD lpcbMaxValueNameLen, LPDWORD lpcbMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime) +{ + if (XEUNICODE_P) + return RegQueryInfoKeyW (hKey, (LPWSTR) lpClass, lpcbClass, lpReserved, lpcSubKeys, lpcbMaxSubKeyLen, lpcbMaxClassLen, lpcValues, lpcbMaxValueNameLen, lpcbMaxValueLen, lpcbSecurityDescriptor, lpftLastWriteTime); + else + return RegQueryInfoKeyA (hKey, (LPSTR) lpClass, lpcbClass, lpReserved, lpcSubKeys, lpcbMaxSubKeyLen, lpcbMaxClassLen, lpcValues, lpcbMaxValueNameLen, lpcbMaxValueLen, lpcbSecurityDescriptor, lpftLastWriteTime); +} + +LONG + +qxeRegQueryValue (HKEY hKey, const Extbyte * lpSubKey, Extbyte * lpValue, PLONG lpcbValue) +{ + if (XEUNICODE_P) + return RegQueryValueW (hKey, (LPCWSTR) lpSubKey, (LPWSTR) lpValue, lpcbValue); + else + return RegQueryValueA (hKey, (LPCSTR) lpSubKey, (LPSTR) lpValue, lpcbValue); +} + +LONG + +qxeRegQueryMultipleValues (HKEY hKey, PVALENTW val_list, DWORD num_vals, Extbyte * lpValueBuf, LPDWORD ldwTotsize) +{ + if (XEUNICODE_P) + return RegQueryMultipleValuesW (hKey, val_list, num_vals, (LPWSTR) lpValueBuf, ldwTotsize); + else + return RegQueryMultipleValuesA (hKey, (PVALENTA) val_list, num_vals, (LPSTR) lpValueBuf, ldwTotsize); +} + +LONG + +qxeRegQueryValueEx (HKEY hKey, const Extbyte * lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData) +{ + if (XEUNICODE_P) + return RegQueryValueExW (hKey, (LPCWSTR) lpValueName, lpReserved, lpType, lpData, lpcbData); + else + return RegQueryValueExA (hKey, (LPCSTR) lpValueName, lpReserved, lpType, lpData, lpcbData); +} + +LONG + +qxeRegReplaceKey (HKEY hKey, const Extbyte * lpSubKey, const Extbyte * lpNewFile, const Extbyte * lpOldFile) +{ + if (XEUNICODE_P) + return RegReplaceKeyW (hKey, (LPCWSTR) lpSubKey, (LPCWSTR) lpNewFile, (LPCWSTR) lpOldFile); + else + return RegReplaceKeyA (hKey, (LPCSTR) lpSubKey, (LPCSTR) lpNewFile, (LPCSTR) lpOldFile); +} + +LONG + +qxeRegRestoreKey (HKEY hKey, const Extbyte * lpFile, DWORD dwFlags) +{ + if (XEUNICODE_P) + return RegRestoreKeyW (hKey, (LPCWSTR) lpFile, dwFlags); + else + return RegRestoreKeyA (hKey, (LPCSTR) lpFile, dwFlags); +} + +LONG + +qxeRegSaveKey (HKEY hKey, const Extbyte * lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes) +{ + if (XEUNICODE_P) + return RegSaveKeyW (hKey, (LPCWSTR) lpFile, lpSecurityAttributes); + else + return RegSaveKeyA (hKey, (LPCSTR) lpFile, lpSecurityAttributes); +} + +LONG + +qxeRegSetValue (HKEY hKey, const Extbyte * lpSubKey, DWORD dwType, const Extbyte * lpData, DWORD cbData) +{ + if (XEUNICODE_P) + return RegSetValueW (hKey, (LPCWSTR) lpSubKey, dwType, (LPCWSTR) lpData, cbData); + else + return RegSetValueA (hKey, (LPCSTR) lpSubKey, dwType, (LPCSTR) lpData, cbData); +} + +LONG + +qxeRegSetValueEx (HKEY hKey, const Extbyte * lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE* lpData, DWORD cbData) +{ + if (XEUNICODE_P) + return RegSetValueExW (hKey, (LPCWSTR) lpValueName, Reserved, dwType, lpData, cbData); + else + return RegSetValueExA (hKey, (LPCSTR) lpValueName, Reserved, dwType, lpData, cbData); +} + +LONG + +qxeRegUnLoadKey (HKEY hKey, const Extbyte * lpSubKey) +{ + if (XEUNICODE_P) + return RegUnLoadKeyW (hKey, (LPCWSTR) lpSubKey); + else + return RegUnLoadKeyA (hKey, (LPCSTR) lpSubKey); +} + BOOL -qxesndPlaySound (const Extbyte * pszSound, UINT fuSound) -{ - if (XEUNICODE_P) - return sndPlaySoundW ((LPCWSTR) pszSound, fuSound); - else - return sndPlaySoundA ((LPCSTR) pszSound, fuSound); + +qxeInitiateSystemShutdown (Extbyte * lpMachineName, Extbyte * lpMessage, DWORD dwTimeout, BOOL bForceAppsClosed, BOOL bRebootAfterShutdown) +{ + if (XEUNICODE_P) + return InitiateSystemShutdownW ((LPWSTR) lpMachineName, (LPWSTR) lpMessage, dwTimeout, bForceAppsClosed, bRebootAfterShutdown); + else + return InitiateSystemShutdownA ((LPSTR) lpMachineName, (LPSTR) lpMessage, dwTimeout, bForceAppsClosed, bRebootAfterShutdown); +} + +BOOL + +qxeAbortSystemShutdown (Extbyte * lpMachineName) +{ + if (XEUNICODE_P) + return AbortSystemShutdownW ((LPWSTR) lpMachineName); + else + return AbortSystemShutdownA ((LPSTR) lpMachineName); +} + + +/*----------------------------------------------------------------------*/ +/* Processing file WINNLS.H */ +/*----------------------------------------------------------------------*/ + +/* Error if GetCPInfoEx used: not used, not examined yet */ + +/* Error if CompareString used: not used, not examined yet */ + +/* Error if LCMapString used: not used, not examined yet */ + +int +qxeGetLocaleInfo (LCID Locale, LCTYPE LCType, Extbyte * lpLCData, int cchData) +{ + if (XEUNICODE_P) + return GetLocaleInfoW (Locale, LCType, (LPWSTR) lpLCData, cchData); + else + return GetLocaleInfoA (Locale, LCType, (LPSTR) lpLCData, cchData); +} + +BOOL +qxeSetLocaleInfo (LCID Locale, LCTYPE LCType, const Extbyte * lpLCData) +{ + if (XEUNICODE_P) + return SetLocaleInfoW (Locale, LCType, (LPCWSTR) lpLCData); + else + return SetLocaleInfoA (Locale, LCType, (LPCSTR) lpLCData); +} + +/* Error if GetTimeFormat used: not used, not examined yet */ + +/* Error if GetDateFormat used: not used, not examined yet */ + +/* Error if GetNumberFormat used: not used, not examined yet */ + +/* Error if GetCurrencyFormat used: not used, not examined yet */ + +/* Error if EnumCalendarInfo used: not used, not examined yet */ + +/* Error if EnumCalendarInfoEx used: not used, not examined yet */ + +/* Error if EnumTimeFormats used: not used, not examined yet */ + +/* Error if EnumDateFormats used: not used, not examined yet */ + +/* Error if EnumDateFormatsEx used: not used, not examined yet */ + +/* Error if GetStringTypeEx used: not used, not examined yet */ + +/* Error if GetStringType used: no such fun; A and W versions have different nos. of args */ + +/* Error if FoldString used: not used, not examined yet */ + +/* Error if EnumSystemLocales used: not used, not examined yet */ + +/* Error if EnumSystemCodePages used: not used, not examined yet */ + + +/*----------------------------------------------------------------------*/ +/* Processing file IME.H */ +/*----------------------------------------------------------------------*/ + +/* Error if SendIMEMessageEx used: obsolete, no docs available */ + + +/*----------------------------------------------------------------------*/ +/* Processing file WINGDI.H */ +/*----------------------------------------------------------------------*/ + +int +qxeAddFontResource (const Extbyte * arg1) +{ + if (XEUNICODE_P) + return AddFontResourceW ((LPCWSTR) arg1); + else + return AddFontResourceA ((LPCSTR) arg1); +} + +HMETAFILE +qxeCopyMetaFile (HMETAFILE arg1, const Extbyte * arg2) +{ + if (XEUNICODE_P) + return CopyMetaFileW (arg1, (LPCWSTR) arg2); + else + return CopyMetaFileA (arg1, (LPCSTR) arg2); +} + +/* Skipping CreateDC because split-sized DEVMODE */ + +/* Skipping CreateFontIndirect because split-sized LOGFONT */ + +HFONT +qxeCreateFont (int arg1, int arg2, int arg3, int arg4, int arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13, const Extbyte * arg14) +{ + if (XEUNICODE_P) + return CreateFontW (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, (LPCWSTR) arg14); + else + return CreateFontA (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, (LPCSTR) arg14); +} + +/* Skipping CreateIC because split-sized DEVMODE */ + +HDC +qxeCreateMetaFile (const Extbyte * arg1) +{ + if (XEUNICODE_P) + return CreateMetaFileW ((LPCWSTR) arg1); + else + return CreateMetaFileA ((LPCSTR) arg1); +} + +BOOL +qxeCreateScalableFontResource (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4) +{ + if (XEUNICODE_P) + return CreateScalableFontResourceW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, (LPCWSTR) arg4); + else + return CreateScalableFontResourceA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, (LPCSTR) arg4); +} + +/* Skipping DeviceCapabilities because split-sized DEVMODE */ + +/* Skipping EnumFontFamiliesEx because split-complex FONTENUMPROC; NT 4.0+ only */ + +/* Error if EnumFontFamilies used: split-complex FONTENUMPROC */ + +/* Error if EnumFonts used: split-complex FONTENUMPROC */ + +BOOL +qxeGetCharWidth (HDC arg1, UINT arg2, UINT arg3, LPINT arg4) +{ + if (XEUNICODE_P) + return GetCharWidthW (arg1, arg2, arg3, arg4); + else + return GetCharWidthA (arg1, arg2, arg3, arg4); } BOOL -qxePlaySound (const Extbyte * pszSound, HMODULE hmod, DWORD fdwSound) -{ - if (XEUNICODE_P) - return PlaySoundW ((LPCWSTR) pszSound, hmod, fdwSound); - else - return PlaySoundA ((LPCSTR) pszSound, hmod, fdwSound); -} - -/* Error if waveOutGetDevCaps used: split-sized LPWAVEOUTCAPS */ - -MMRESULT -qxewaveOutGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText) -{ - if (XEUNICODE_P) - return waveOutGetErrorTextW (mmrError, (LPWSTR) pszText, cchText); - else - return waveOutGetErrorTextA (mmrError, (LPSTR) pszText, cchText); -} - -/* Error if waveInGetDevCaps used: split-sized LPWAVEINCAPS */ - -MMRESULT -qxewaveInGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText) -{ - if (XEUNICODE_P) - return waveInGetErrorTextW (mmrError, (LPWSTR) pszText, cchText); - else - return waveInGetErrorTextA (mmrError, (LPSTR) pszText, cchText); -} - -/* Error if midiOutGetDevCaps used: split-sized LPMIDIOUTCAPS */ - -MMRESULT -qxemidiOutGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText) -{ - if (XEUNICODE_P) - return midiOutGetErrorTextW (mmrError, (LPWSTR) pszText, cchText); - else - return midiOutGetErrorTextA (mmrError, (LPSTR) pszText, cchText); -} - -/* Error if midiInGetDevCaps used: split-sized LPMIDIOUTCAPS */ - -MMRESULT -qxemidiInGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText) -{ - if (XEUNICODE_P) - return midiInGetErrorTextW (mmrError, (LPWSTR) pszText, cchText); - else - return midiInGetErrorTextA (mmrError, (LPSTR) pszText, cchText); -} - -/* Error if auxGetDevCaps used: split-sized LPAUXCAPS */ - -/* Error if mixerGetDevCaps used: split-sized LPMIXERCAPS */ - -/* Error if mixerGetLineInfo used: split-sized LPMIXERLINE */ - -/* Error if mixerGetLineControls used: split-sized LPMIXERCONTROL */ - -/* Error if mixerGetControlDetails used: split-sized LPMIXERCONTROL in LPMIXERLINECONTROLS in LPMIXERCONTROLDETAILS */ - -/* Error if joyGetDevCaps used: split-sized LPJOYCAPS */ - -FOURCC -qxemmioStringToFOURCC (const Extbyte * sz, UINT uFlags) -{ - if (XEUNICODE_P) - return mmioStringToFOURCCW ((LPCWSTR) sz, uFlags); - else - return mmioStringToFOURCCA ((LPCSTR) sz, uFlags); -} - -LPMMIOPROC -qxemmioInstallIOProc (FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags) -{ - if (XEUNICODE_P) - return mmioInstallIOProcW (fccIOProc, pIOProc, dwFlags); - else - return mmioInstallIOProcA (fccIOProc, pIOProc, dwFlags); -} - -HMMIO -qxemmioOpen (Extbyte * pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen) -{ - if (XEUNICODE_P) - return mmioOpenW ((LPWSTR) pszFileName, pmmioinfo, fdwOpen); - else - return mmioOpenA ((LPSTR) pszFileName, pmmioinfo, fdwOpen); -} - -MMRESULT -qxemmioRename (const Extbyte * pszFileName, const Extbyte * pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename) -{ - if (XEUNICODE_P) - return mmioRenameW ((LPCWSTR) pszFileName, (LPCWSTR) pszNewFileName, pmmioinfo, fdwRename); - else - return mmioRenameA ((LPCSTR) pszFileName, (LPCSTR) pszNewFileName, pmmioinfo, fdwRename); -} - -MCIERROR -qxemciSendCommand (MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2) -{ - if (XEUNICODE_P) - return mciSendCommandW (mciId, uMsg, dwParam1, dwParam2); - else - return mciSendCommandA (mciId, uMsg, dwParam1, dwParam2); -} - -MCIERROR -qxemciSendString (const Extbyte * lpstrCommand, Extbyte * lpstrReturnString, UINT uReturnLength, HWND hwndCallback) -{ - if (XEUNICODE_P) - return mciSendStringW ((LPCWSTR) lpstrCommand, (LPWSTR) lpstrReturnString, uReturnLength, hwndCallback); - else - return mciSendStringA ((LPCSTR) lpstrCommand, (LPSTR) lpstrReturnString, uReturnLength, hwndCallback); -} - -MCIDEVICEID -qxemciGetDeviceID (const Extbyte * pszDevice) -{ - if (XEUNICODE_P) - return mciGetDeviceIDW ((LPCWSTR) pszDevice); - else - return mciGetDeviceIDA ((LPCSTR) pszDevice); -} - -#if !defined (MINGW) - -/* Error if mciGetDeviceIDFromElementID used: missing from Win98se version of ADVAPI32.dll */ - -#endif /* !defined (MINGW) */ +qxeGetCharWidth32 (HDC arg1, UINT arg2, UINT arg3, LPINT arg4) +{ + if (XEUNICODE_P) + return GetCharWidth32W (arg1, arg2, arg3, arg4); + else + return GetCharWidth32A (arg1, arg2, arg3, arg4); +} + +BOOL +qxeGetCharWidthFloat (HDC arg1, UINT arg2, UINT arg3, PFLOAT arg4) +{ + if (XEUNICODE_P) + return GetCharWidthFloatW (arg1, arg2, arg3, arg4); + else + return GetCharWidthFloatA (arg1, arg2, arg3, arg4); +} + +BOOL +qxeGetCharABCWidths (HDC arg1, UINT arg2, UINT arg3, LPABC arg4) +{ + if (XEUNICODE_P) + return GetCharABCWidthsW (arg1, arg2, arg3, arg4); + else + return GetCharABCWidthsA (arg1, arg2, arg3, arg4); +} + +BOOL +qxeGetCharABCWidthsFloat (HDC arg1, UINT arg2, UINT arg3, LPABCFLOAT arg4) +{ + if (XEUNICODE_P) + return GetCharABCWidthsFloatW (arg1, arg2, arg3, arg4); + else + return GetCharABCWidthsFloatA (arg1, arg2, arg3, arg4); +} + +DWORD +qxeGetGlyphOutline (HDC arg1, UINT arg2, UINT arg3, LPGLYPHMETRICS arg4, DWORD arg5, LPVOID arg6, CONST MAT2 * arg7) +{ + if (XEUNICODE_P) + return GetGlyphOutlineW (arg1, arg2, arg3, arg4, arg5, arg6, arg7); + else + return GetGlyphOutlineA (arg1, arg2, arg3, arg4, arg5, arg6, arg7); +} + +HMETAFILE +qxeGetMetaFile (const Extbyte * arg1) +{ + if (XEUNICODE_P) + return GetMetaFileW ((LPCWSTR) arg1); + else + return GetMetaFileA ((LPCSTR) arg1); +} + +/* Error if GetOutlineTextMetrics used: split-sized LPOUTLINETEXTMETRIC */ + +BOOL +qxeGetTextExtentPoint (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4) +{ + if (XEUNICODE_P) + return GetTextExtentPointW (arg1, (LPCWSTR) arg2, arg3, arg4); + else + return GetTextExtentPointA (arg1, (LPCSTR) arg2, arg3, arg4); +} + +BOOL +qxeGetTextExtentPoint32 (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4) +{ + if (XEUNICODE_P) + return GetTextExtentPoint32W (arg1, (LPCWSTR) arg2, arg3, arg4); + else + return GetTextExtentPoint32A (arg1, (LPCSTR) arg2, arg3, arg4); +} + +BOOL +qxeGetTextExtentExPoint (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPINT arg5, LPINT arg6, LPSIZE arg7) +{ + if (XEUNICODE_P) + return GetTextExtentExPointW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6, arg7); + else + return GetTextExtentExPointA (arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6, arg7); +} + +/* NOTE: NT 4.0+ only */ +DWORD +qxeGetCharacterPlacement (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPGCP_RESULTSW arg5, DWORD arg6) +{ + if (XEUNICODE_P) + return GetCharacterPlacementW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6); + else + return GetCharacterPlacementA (arg1, (LPCSTR) arg2, arg3, arg4, (LPGCP_RESULTSA) arg5, arg6); +} + +/* Error if GetGlyphIndices used: NT 5.0+ only */ + +/* Error if AddFontResourceEx used: NT 5.0+ only */ + +/* Error if RemoveFontResourceEx used: NT 5.0+ only */ + +/* Error if CreateFontIndirectEx used: split-sized ENUMLOGFONTEXDV; NT 5.0+ only */ + +/* Skipping ResetDC because split-sized DEVMODE */ + +BOOL +qxeRemoveFontResource (const Extbyte * arg1) +{ + if (XEUNICODE_P) + return RemoveFontResourceW ((LPCWSTR) arg1); + else + return RemoveFontResourceA ((LPCSTR) arg1); +} + +HENHMETAFILE +qxeCopyEnhMetaFile (HENHMETAFILE arg1, const Extbyte * arg2) +{ + if (XEUNICODE_P) + return CopyEnhMetaFileW (arg1, (LPCWSTR) arg2); + else + return CopyEnhMetaFileA (arg1, (LPCSTR) arg2); +} + +HDC +qxeCreateEnhMetaFile (HDC arg1, const Extbyte * arg2, CONST RECT * arg3, const Extbyte * arg4) +{ + if (XEUNICODE_P) + return CreateEnhMetaFileW (arg1, (LPCWSTR) arg2, arg3, (LPCWSTR) arg4); + else + return CreateEnhMetaFileA (arg1, (LPCSTR) arg2, arg3, (LPCSTR) arg4); +} + +HENHMETAFILE +qxeGetEnhMetaFile (const Extbyte * arg1) +{ + if (XEUNICODE_P) + return GetEnhMetaFileW ((LPCWSTR) arg1); + else + return GetEnhMetaFileA ((LPCSTR) arg1); +} + +UINT +qxeGetEnhMetaFileDescription (HENHMETAFILE arg1, UINT arg2, Extbyte * arg3) +{ + if (XEUNICODE_P) + return GetEnhMetaFileDescriptionW (arg1, arg2, (LPWSTR) arg3); + else + return GetEnhMetaFileDescriptionA (arg1, arg2, (LPSTR) arg3); +} + +/* Skipping GetTextMetrics because split-sized LPTEXTMETRIC */ + +int +qxeStartDoc (HDC arg1, CONST DOCINFOW * arg2) +{ + if (XEUNICODE_P) + return StartDocW (arg1, arg2); + else + return StartDocA (arg1, (CONST DOCINFOA *) arg2); +} + +/* Skipping GetObject because split-sized LOGFONT */ + +BOOL +qxeTextOut (HDC arg1, int arg2, int arg3, const Extbyte * arg4, int arg5) +{ + if (XEUNICODE_P) + return TextOutW (arg1, arg2, arg3, (LPCWSTR) arg4, arg5); + else + return TextOutA (arg1, arg2, arg3, (LPCSTR) arg4, arg5); +} + +BOOL +qxeExtTextOut (HDC arg1, int arg2, int arg3, UINT arg4, CONST RECT * arg5, const Extbyte * arg6, UINT arg7, CONST INT * arg8) +{ + if (XEUNICODE_P) + return ExtTextOutW (arg1, arg2, arg3, arg4, arg5, (LPCWSTR) arg6, arg7, arg8); + else + return ExtTextOutA (arg1, arg2, arg3, arg4, arg5, (LPCSTR) arg6, arg7, arg8); +} + +BOOL +qxePolyTextOut (HDC arg1, CONST POLYTEXTW * arg2, int arg3) +{ + if (XEUNICODE_P) + return PolyTextOutW (arg1, arg2, arg3); + else + return PolyTextOutA (arg1, (CONST POLYTEXTA *) arg2, arg3); +} + +int +qxeGetTextFace (HDC arg1, int arg2, Extbyte * arg3) +{ + if (XEUNICODE_P) + return GetTextFaceW (arg1, arg2, (LPWSTR) arg3); + else + return GetTextFaceA (arg1, arg2, (LPSTR) arg3); +} + +DWORD +qxeGetKerningPairs (HDC arg1, DWORD arg2, LPKERNINGPAIR arg3) +{ + if (XEUNICODE_P) + return GetKerningPairsW (arg1, arg2, arg3); + else + return GetKerningPairsA (arg1, arg2, arg3); +} + +/* Error if GetLogColorSpace used: split-sized LPLOGCOLORSPACE; NT 4.0+ only */ + +/* Error if CreateColorSpace used: split-sized LPLOGCOLORSPACE; NT 4.0+ only */ + +/* Skipping GetICMProfile because NT 4.0+ only, error in Cygwin prototype */ + +/* NOTE: NT 4.0+ only */ +BOOL +qxeSetICMProfile (HDC arg1, Extbyte * arg2) +{ + if (XEUNICODE_P) + return SetICMProfileW (arg1, (LPWSTR) arg2); + else + return SetICMProfileA (arg1, (LPSTR) arg2); +} + +/* NOTE: NT 4.0+ only */ +int +qxeEnumICMProfiles (HDC arg1, ICMENUMPROCW arg2, LPARAM arg3) +{ + if (XEUNICODE_P) + return EnumICMProfilesW (arg1, arg2, arg3); + else + return EnumICMProfilesA (arg1, (ICMENUMPROCA) arg2, arg3); +} + +/* Skipping UpdateICMRegKey because NT 4.0+ only, error in Cygwin prototype */ + +/* Error if wglUseFontBitmaps used: causes link error */ + +/* Error if wglUseFontOutlines used: causes link error */ + + +/*----------------------------------------------------------------------*/ +/* Processing file SHLOBJ.H */ +/*----------------------------------------------------------------------*/ BOOL -qxemciGetErrorString (MCIERROR mcierr, Extbyte * pszText, UINT cchText) -{ - if (XEUNICODE_P) - return mciGetErrorStringW (mcierr, (LPWSTR) pszText, cchText); - else - return mciGetErrorStringA (mcierr, (LPSTR) pszText, cchText); -} +qxeSHGetPathFromIDList (LPCITEMIDLIST pidl, Extbyte * pszPath) +{ + if (XEUNICODE_P) + return SHGetPathFromIDListW (pidl, (LPWSTR) pszPath); + else + return SHGetPathFromIDListA (pidl, (LPSTR) pszPath); +} + +/* Skipping SHGetSpecialFolderPath because error in Cygwin prototype, missing from Cygwin libraries */ + +/* Skipping SHBrowseForFolder because need to intercept callback for SendMessage */ + +/* Skipping SHGetDataFromIDList because split-sized WIN32_FIND_DATA or split-simple NETRESOURCE, missing from Cygwin libraries */ + + +/*----------------------------------------------------------------------*/ +/* Processing file COMMDLG.H */ +/*----------------------------------------------------------------------*/ + +BOOL +qxeGetOpenFileName (LPOPENFILENAMEW arg1) +{ + if (XEUNICODE_P) + return GetOpenFileNameW (arg1); + else + return GetOpenFileNameA ((LPOPENFILENAMEA) arg1); +} + +BOOL +qxeGetSaveFileName (LPOPENFILENAMEW arg1) +{ + if (XEUNICODE_P) + return GetSaveFileNameW (arg1); + else + return GetSaveFileNameA ((LPOPENFILENAMEA) arg1); +} + +short +qxeGetFileTitle (const Extbyte * arg1, Extbyte * arg2, WORD arg3) +{ + if (XEUNICODE_P) + return GetFileTitleW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3); + else + return GetFileTitleA ((LPCSTR) arg1, (LPSTR) arg2, arg3); +} + +BOOL +qxeChooseColor (LPCHOOSECOLORW arg1) +{ + if (XEUNICODE_P) + return ChooseColorW (arg1); + else + return ChooseColorA ((LPCHOOSECOLORA) arg1); +} + +HWND +qxeFindText (LPFINDREPLACEW arg1) +{ + if (XEUNICODE_P) + return FindTextW (arg1); + else + return FindTextA ((LPFINDREPLACEA) arg1); +} + +HWND +qxeReplaceText (LPFINDREPLACEW arg1) +{ + if (XEUNICODE_P) + return ReplaceTextW (arg1); + else + return ReplaceTextA ((LPFINDREPLACEA) arg1); +} + +/* Error if AfxReplaceText used: mac only */ + +/* Error if ChooseFont used: split-sized LPLOGFONT in LPCHOOSEFONT */ + +/* Skipping PrintDlg because LPPRINTDLG with split-sized DEVMODE handle */ + +/* Skipping PageSetupDlg because LPPAGESETUPDLG with split-sized DEVMODE handle */ + + +/*----------------------------------------------------------------------*/ +/* Processing file IMM.H */ +/*----------------------------------------------------------------------*/ + +#if defined (HAVE_MS_WINDOWS) + +HKL +qxeImmInstallIME (const Extbyte * lpszIMEFileName, const Extbyte * lpszLayoutText) +{ + if (XEUNICODE_P) + return ImmInstallIMEW ((LPCWSTR) lpszIMEFileName, (LPCWSTR) lpszLayoutText); + else + return ImmInstallIMEA ((LPCSTR) lpszIMEFileName, (LPCSTR) lpszLayoutText); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +UINT +qxeImmGetDescription (HKL arg1, Extbyte * arg2, UINT uBufLen) +{ + if (XEUNICODE_P) + return ImmGetDescriptionW (arg1, (LPWSTR) arg2, uBufLen); + else + return ImmGetDescriptionA (arg1, (LPSTR) arg2, uBufLen); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +UINT +qxeImmGetIMEFileName (HKL arg1, Extbyte * arg2, UINT uBufLen) +{ + if (XEUNICODE_P) + return ImmGetIMEFileNameW (arg1, (LPWSTR) arg2, uBufLen); + else + return ImmGetIMEFileNameA (arg1, (LPSTR) arg2, uBufLen); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +LONG +qxeImmGetCompositionString (HIMC arg1, DWORD arg2, LPVOID arg3, DWORD arg4) +{ + if (XEUNICODE_P) + return ImmGetCompositionStringW (arg1, arg2, arg3, arg4); + else + return ImmGetCompositionStringA (arg1, arg2, arg3, arg4); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +BOOL +qxeImmSetCompositionString (HIMC arg1, DWORD dwIndex, LPCVOID lpComp, DWORD arg4, LPCVOID lpRead, DWORD arg6) +{ + if (XEUNICODE_P) + return ImmSetCompositionStringW (arg1, dwIndex, lpComp, arg4, lpRead, arg6); + else + return ImmSetCompositionStringA (arg1, dwIndex, lpComp, arg4, lpRead, arg6); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +DWORD +qxeImmGetCandidateListCount (HIMC arg1, LPDWORD lpdwListCount) +{ + if (XEUNICODE_P) + return ImmGetCandidateListCountW (arg1, lpdwListCount); + else + return ImmGetCandidateListCountA (arg1, lpdwListCount); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +DWORD +qxeImmGetCandidateList (HIMC arg1, DWORD deIndex, LPCANDIDATELIST arg3, DWORD dwBufLen) +{ + if (XEUNICODE_P) + return ImmGetCandidateListW (arg1, deIndex, arg3, dwBufLen); + else + return ImmGetCandidateListA (arg1, deIndex, arg3, dwBufLen); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +DWORD +qxeImmGetGuideLine (HIMC arg1, DWORD dwIndex, Extbyte * arg3, DWORD dwBufLen) +{ + if (XEUNICODE_P) + return ImmGetGuideLineW (arg1, dwIndex, (LPWSTR) arg3, dwBufLen); + else + return ImmGetGuideLineA (arg1, dwIndex, (LPSTR) arg3, dwBufLen); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +/* Skipping ImmGetCompositionFont because split-sized LOGFONT */ + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +/* Skipping ImmSetCompositionFont because split-sized LOGFONT */ + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +/* NOTE: // split-simple REGISTERWORD */ +BOOL +qxeImmConfigureIME (HKL arg1, HWND arg2, DWORD arg3, LPVOID arg4) +{ + if (XEUNICODE_P) + return ImmConfigureIMEW (arg1, arg2, arg3, arg4); + else + return ImmConfigureIMEA (arg1, arg2, arg3, arg4); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +/* NOTE: // strings of various sorts */ +LRESULT +qxeImmEscape (HKL arg1, HIMC arg2, UINT arg3, LPVOID arg4) +{ + if (XEUNICODE_P) + return ImmEscapeW (arg1, arg2, arg3, arg4); + else + return ImmEscapeA (arg1, arg2, arg3, arg4); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +DWORD +qxeImmGetConversionList (HKL arg1, HIMC arg2, const Extbyte * arg3, LPCANDIDATELIST arg4, DWORD dwBufLen, UINT uFlag) +{ + if (XEUNICODE_P) + return ImmGetConversionListW (arg1, arg2, (LPCWSTR) arg3, arg4, dwBufLen, uFlag); + else + return ImmGetConversionListA (arg1, arg2, (LPCSTR) arg3, arg4, dwBufLen, uFlag); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +BOOL +qxeImmIsUIMessage (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4) +{ + if (XEUNICODE_P) + return ImmIsUIMessageW (arg1, arg2, arg3, arg4); + else + return ImmIsUIMessageA (arg1, arg2, arg3, arg4); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +BOOL +qxeImmRegisterWord (HKL arg1, const Extbyte * lpszReading, DWORD arg3, const Extbyte * lpszRegister) +{ + if (XEUNICODE_P) + return ImmRegisterWordW (arg1, (LPCWSTR) lpszReading, arg3, (LPCWSTR) lpszRegister); + else + return ImmRegisterWordA (arg1, (LPCSTR) lpszReading, arg3, (LPCSTR) lpszRegister); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +BOOL +qxeImmUnregisterWord (HKL arg1, const Extbyte * lpszReading, DWORD arg3, const Extbyte * lpszUnregister) +{ + if (XEUNICODE_P) + return ImmUnregisterWordW (arg1, (LPCWSTR) lpszReading, arg3, (LPCWSTR) lpszUnregister); + else + return ImmUnregisterWordA (arg1, (LPCSTR) lpszReading, arg3, (LPCSTR) lpszUnregister); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +/* Error if ImmGetRegisterWordStyle used: split-sized STYLEBUF */ + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +UINT +qxeImmEnumRegisterWord (HKL arg1, REGISTERWORDENUMPROCW arg2, const Extbyte * lpszReading, DWORD arg4, const Extbyte * lpszRegister, LPVOID arg6) +{ + if (XEUNICODE_P) + return ImmEnumRegisterWordW (arg1, arg2, (LPCWSTR) lpszReading, arg4, (LPCWSTR) lpszRegister, arg6); + else + return ImmEnumRegisterWordA (arg1, (REGISTERWORDENUMPROCA) arg2, (LPCSTR) lpszReading, arg4, (LPCSTR) lpszRegister, arg6); +} + +#endif /* defined (HAVE_MS_WINDOWS) */ + +#if defined (HAVE_MS_WINDOWS) + +/* Error if ImmGetImeMenuItems used: split-sized IMEMENUITEMINFO */ + +#endif /* defined (HAVE_MS_WINDOWS) */ /*----------------------------------------------------------------------*/ @@ -3725,406 +3973,158 @@ /*----------------------------------------------------------------------*/ -/* Processing file COMMDLG.H */ -/*----------------------------------------------------------------------*/ - -BOOL -qxeGetOpenFileName (LPOPENFILENAMEW arg1) -{ - if (XEUNICODE_P) - return GetOpenFileNameW (arg1); - else - return GetOpenFileNameA ((LPOPENFILENAMEA) arg1); -} - -BOOL -qxeGetSaveFileName (LPOPENFILENAMEW arg1) -{ - if (XEUNICODE_P) - return GetSaveFileNameW (arg1); - else - return GetSaveFileNameA ((LPOPENFILENAMEA) arg1); -} - -short -qxeGetFileTitle (const Extbyte * arg1, Extbyte * arg2, WORD arg3) -{ - if (XEUNICODE_P) - return GetFileTitleW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3); - else - return GetFileTitleA ((LPCSTR) arg1, (LPSTR) arg2, arg3); -} - -BOOL -qxeChooseColor (LPCHOOSECOLORW arg1) -{ - if (XEUNICODE_P) - return ChooseColorW (arg1); - else - return ChooseColorA ((LPCHOOSECOLORA) arg1); -} - -HWND -qxeFindText (LPFINDREPLACEW arg1) -{ - if (XEUNICODE_P) - return FindTextW (arg1); - else - return FindTextA ((LPFINDREPLACEA) arg1); -} - -HWND -qxeReplaceText (LPFINDREPLACEW arg1) -{ - if (XEUNICODE_P) - return ReplaceTextW (arg1); - else - return ReplaceTextA ((LPFINDREPLACEA) arg1); -} - -/* Error if AfxReplaceText used: mac only */ - -/* Error if ChooseFont used: split-sized LPLOGFONT in LPCHOOSEFONT */ - -/* Skipping PrintDlg because LPPRINTDLG with split-sized DEVMODE handle */ - -/* Skipping PageSetupDlg because LPPAGESETUPDLG with split-sized DEVMODE handle */ - - -/*----------------------------------------------------------------------*/ -/* Processing file SHLOBJ.H */ +/* Processing file MMSYSTEM.H */ /*----------------------------------------------------------------------*/ BOOL -qxeSHGetPathFromIDList (LPCITEMIDLIST pidl, Extbyte * pszPath) -{ - if (XEUNICODE_P) - return SHGetPathFromIDListW (pidl, (LPWSTR) pszPath); - else - return SHGetPathFromIDListA (pidl, (LPSTR) pszPath); -} - -/* Skipping SHGetSpecialFolderPath because error in Cygwin prototype, missing from Cygwin libraries */ - -/* Skipping SHBrowseForFolder because need to intercept callback for SendMessage */ - -/* Skipping SHGetDataFromIDList because split-sized WIN32_FIND_DATA or split-simple NETRESOURCE, missing from Cygwin libraries */ - - -/*----------------------------------------------------------------------*/ -/* Processing file IME.H */ -/*----------------------------------------------------------------------*/ - -/* Error if SendIMEMessageEx used: obsolete, no docs available */ - - -/*----------------------------------------------------------------------*/ -/* Processing file WINGDI.H */ -/*----------------------------------------------------------------------*/ - -int -qxeAddFontResource (const Extbyte * arg1) -{ - if (XEUNICODE_P) - return AddFontResourceW ((LPCWSTR) arg1); - else - return AddFontResourceA ((LPCSTR) arg1); -} - -HMETAFILE -qxeCopyMetaFile (HMETAFILE arg1, const Extbyte * arg2) -{ - if (XEUNICODE_P) - return CopyMetaFileW (arg1, (LPCWSTR) arg2); - else - return CopyMetaFileA (arg1, (LPCSTR) arg2); -} - -/* Skipping CreateDC because split-sized DEVMODE */ - -/* Skipping CreateFontIndirect because split-sized LOGFONT */ - -HFONT -qxeCreateFont (int arg1, int arg2, int arg3, int arg4, int arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13, const Extbyte * arg14) -{ - if (XEUNICODE_P) - return CreateFontW (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, (LPCWSTR) arg14); - else - return CreateFontA (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, (LPCSTR) arg14); -} - -/* Skipping CreateIC because split-sized DEVMODE */ - -HDC -qxeCreateMetaFile (const Extbyte * arg1) -{ - if (XEUNICODE_P) - return CreateMetaFileW ((LPCWSTR) arg1); - else - return CreateMetaFileA ((LPCSTR) arg1); -} - -BOOL -qxeCreateScalableFontResource (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4) -{ - if (XEUNICODE_P) - return CreateScalableFontResourceW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, (LPCWSTR) arg4); - else - return CreateScalableFontResourceA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, (LPCSTR) arg4); -} - -/* Skipping DeviceCapabilities because split-sized DEVMODE */ - -/* Skipping EnumFontFamiliesEx because split-complex FONTENUMPROC; NT 4.0+ only */ - -/* Error if EnumFontFamilies used: split-complex FONTENUMPROC */ - -/* Error if EnumFonts used: split-complex FONTENUMPROC */ - -BOOL -qxeGetCharWidth (HDC arg1, UINT arg2, UINT arg3, LPINT arg4) -{ - if (XEUNICODE_P) - return GetCharWidthW (arg1, arg2, arg3, arg4); - else - return GetCharWidthA (arg1, arg2, arg3, arg4); +qxesndPlaySound (const Extbyte * pszSound, UINT fuSound) +{ + if (XEUNICODE_P) + return sndPlaySoundW ((LPCWSTR) pszSound, fuSound); + else + return sndPlaySoundA ((LPCSTR) pszSound, fuSound); } BOOL -qxeGetCharWidth32 (HDC arg1, UINT arg2, UINT arg3, LPINT arg4) -{ - if (XEUNICODE_P) - return GetCharWidth32W (arg1, arg2, arg3, arg4); - else - return GetCharWidth32A (arg1, arg2, arg3, arg4); -} - -BOOL -qxeGetCharWidthFloat (HDC arg1, UINT arg2, UINT arg3, PFLOAT arg4) -{ - if (XEUNICODE_P) - return GetCharWidthFloatW (arg1, arg2, arg3, arg4); - else - return GetCharWidthFloatA (arg1, arg2, arg3, arg4); -} - -BOOL -qxeGetCharABCWidths (HDC arg1, UINT arg2, UINT arg3, LPABC arg4) -{ - if (XEUNICODE_P) - return GetCharABCWidthsW (arg1, arg2, arg3, arg4); - else - return GetCharABCWidthsA (arg1, arg2, arg3, arg4); -} - -BOOL -qxeGetCharABCWidthsFloat (HDC arg1, UINT arg2, UINT arg3, LPABCFLOAT arg4) -{ - if (XEUNICODE_P) - return GetCharABCWidthsFloatW (arg1, arg2, arg3, arg4); - else - return GetCharABCWidthsFloatA (arg1, arg2, arg3, arg4); -} - -DWORD -qxeGetGlyphOutline (HDC arg1, UINT arg2, UINT arg3, LPGLYPHMETRICS arg4, DWORD arg5, LPVOID arg6, CONST MAT2 * arg7) -{ - if (XEUNICODE_P) - return GetGlyphOutlineW (arg1, arg2, arg3, arg4, arg5, arg6, arg7); - else - return GetGlyphOutlineA (arg1, arg2, arg3, arg4, arg5, arg6, arg7); -} - -HMETAFILE -qxeGetMetaFile (const Extbyte * arg1) -{ - if (XEUNICODE_P) - return GetMetaFileW ((LPCWSTR) arg1); - else - return GetMetaFileA ((LPCSTR) arg1); -} - -/* Error if GetOutlineTextMetrics used: split-sized LPOUTLINETEXTMETRIC */ - -BOOL -qxeGetTextExtentPoint (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4) -{ - if (XEUNICODE_P) - return GetTextExtentPointW (arg1, (LPCWSTR) arg2, arg3, arg4); - else - return GetTextExtentPointA (arg1, (LPCSTR) arg2, arg3, arg4); -} - -BOOL -qxeGetTextExtentPoint32 (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4) -{ - if (XEUNICODE_P) - return GetTextExtentPoint32W (arg1, (LPCWSTR) arg2, arg3, arg4); - else - return GetTextExtentPoint32A (arg1, (LPCSTR) arg2, arg3, arg4); -} - -BOOL -qxeGetTextExtentExPoint (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPINT arg5, LPINT arg6, LPSIZE arg7) -{ - if (XEUNICODE_P) - return GetTextExtentExPointW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6, arg7); - else - return GetTextExtentExPointA (arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6, arg7); -} - -/* NOTE: NT 4.0+ only */ -DWORD -qxeGetCharacterPlacement (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPGCP_RESULTSW arg5, DWORD arg6) -{ - if (XEUNICODE_P) - return GetCharacterPlacementW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6); - else - return GetCharacterPlacementA (arg1, (LPCSTR) arg2, arg3, arg4, (LPGCP_RESULTSA) arg5, arg6); -} - -/* Error if GetGlyphIndices used: NT 5.0+ only */ - -/* Error if AddFontResourceEx used: NT 5.0+ only */ - -/* Error if RemoveFontResourceEx used: NT 5.0+ only */ - -/* Error if CreateFontIndirectEx used: split-sized ENUMLOGFONTEXDV; NT 5.0+ only */ - -/* Skipping ResetDC because split-sized DEVMODE */ +qxePlaySound (const Extbyte * pszSound, HMODULE hmod, DWORD fdwSound) +{ + if (XEUNICODE_P) + return PlaySoundW ((LPCWSTR) pszSound, hmod, fdwSound); + else + return PlaySoundA ((LPCSTR) pszSound, hmod, fdwSound); +} + +/* Error if waveOutGetDevCaps used: split-sized LPWAVEOUTCAPS */ + +MMRESULT +qxewaveOutGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText) +{ + if (XEUNICODE_P) + return waveOutGetErrorTextW (mmrError, (LPWSTR) pszText, cchText); + else + return waveOutGetErrorTextA (mmrError, (LPSTR) pszText, cchText); +} + +/* Error if waveInGetDevCaps used: split-sized LPWAVEINCAPS */ + +MMRESULT +qxewaveInGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText) +{ + if (XEUNICODE_P) + return waveInGetErrorTextW (mmrError, (LPWSTR) pszText, cchText); + else + return waveInGetErrorTextA (mmrError, (LPSTR) pszText, cchText); +} + +/* Error if midiOutGetDevCaps used: split-sized LPMIDIOUTCAPS */ + +MMRESULT +qxemidiOutGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText) +{ + if (XEUNICODE_P) + return midiOutGetErrorTextW (mmrError, (LPWSTR) pszText, cchText); + else + return midiOutGetErrorTextA (mmrError, (LPSTR) pszText, cchText); +} + +/* Error if midiInGetDevCaps used: split-sized LPMIDIOUTCAPS */ + +MMRESULT +qxemidiInGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText) +{ + if (XEUNICODE_P) + return midiInGetErrorTextW (mmrError, (LPWSTR) pszText, cchText); + else + return midiInGetErrorTextA (mmrError, (LPSTR) pszText, cchText); +} + +/* Error if auxGetDevCaps used: split-sized LPAUXCAPS */ + +/* Error if mixerGetDevCaps used: split-sized LPMIXERCAPS */ + +/* Error if mixerGetLineInfo used: split-sized LPMIXERLINE */ + +/* Error if mixerGetLineControls used: split-sized LPMIXERCONTROL */ + +/* Error if mixerGetControlDetails used: split-sized LPMIXERCONTROL in LPMIXERLINECONTROLS in LPMIXERCONTROLDETAILS */ + +/* Error if joyGetDevCaps used: split-sized LPJOYCAPS */ + +FOURCC +qxemmioStringToFOURCC (const Extbyte * sz, UINT uFlags) +{ + if (XEUNICODE_P) + return mmioStringToFOURCCW ((LPCWSTR) sz, uFlags); + else + return mmioStringToFOURCCA ((LPCSTR) sz, uFlags); +} + +LPMMIOPROC +qxemmioInstallIOProc (FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags) +{ + if (XEUNICODE_P) + return mmioInstallIOProcW (fccIOProc, pIOProc, dwFlags); + else + return mmioInstallIOProcA (fccIOProc, pIOProc, dwFlags); +} + +HMMIO +qxemmioOpen (Extbyte * pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen) +{ + if (XEUNICODE_P) + return mmioOpenW ((LPWSTR) pszFileName, pmmioinfo, fdwOpen); + else + return mmioOpenA ((LPSTR) pszFileName, pmmioinfo, fdwOpen); +} + +MMRESULT +qxemmioRename (const Extbyte * pszFileName, const Extbyte * pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename) +{ + if (XEUNICODE_P) + return mmioRenameW ((LPCWSTR) pszFileName, (LPCWSTR) pszNewFileName, pmmioinfo, fdwRename); + else + return mmioRenameA ((LPCSTR) pszFileName, (LPCSTR) pszNewFileName, pmmioinfo, fdwRename); +} + +MCIERROR +qxemciSendCommand (MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2) +{ + if (XEUNICODE_P) + return mciSendCommandW (mciId, uMsg, dwParam1, dwParam2); + else + return mciSendCommandA (mciId, uMsg, dwParam1, dwParam2); +} + +MCIERROR +qxemciSendString (const Extbyte * lpstrCommand, Extbyte * lpstrReturnString, UINT uReturnLength, HWND hwndCallback) +{ + if (XEUNICODE_P) + return mciSendStringW ((LPCWSTR) lpstrCommand, (LPWSTR) lpstrReturnString, uReturnLength, hwndCallback); + else + return mciSendStringA ((LPCSTR) lpstrCommand, (LPSTR) lpstrReturnString, uReturnLength, hwndCallback); +} + +MCIDEVICEID +qxemciGetDeviceID (const Extbyte * pszDevice) +{ + if (XEUNICODE_P) + return mciGetDeviceIDW ((LPCWSTR) pszDevice); + else + return mciGetDeviceIDA ((LPCSTR) pszDevice); +} + +#if !defined (MINGW) + +/* Error if mciGetDeviceIDFromElementID used: missing from Win98se version of ADVAPI32.dll */ + +#endif /* !defined (MINGW) */ BOOL -qxeRemoveFontResource (const Extbyte * arg1) -{ - if (XEUNICODE_P) - return RemoveFontResourceW ((LPCWSTR) arg1); - else - return RemoveFontResourceA ((LPCSTR) arg1); -} - -HENHMETAFILE -qxeCopyEnhMetaFile (HENHMETAFILE arg1, const Extbyte * arg2) -{ - if (XEUNICODE_P) - return CopyEnhMetaFileW (arg1, (LPCWSTR) arg2); - else - return CopyEnhMetaFileA (arg1, (LPCSTR) arg2); -} - -HDC -qxeCreateEnhMetaFile (HDC arg1, const Extbyte * arg2, CONST RECT * arg3, const Extbyte * arg4) -{ - if (XEUNICODE_P) - return CreateEnhMetaFileW (arg1, (LPCWSTR) arg2, arg3, (LPCWSTR) arg4); - else - return CreateEnhMetaFileA (arg1, (LPCSTR) arg2, arg3, (LPCSTR) arg4); -} - -HENHMETAFILE -qxeGetEnhMetaFile (const Extbyte * arg1) -{ - if (XEUNICODE_P) - return GetEnhMetaFileW ((LPCWSTR) arg1); - else - return GetEnhMetaFileA ((LPCSTR) arg1); -} - -UINT -qxeGetEnhMetaFileDescription (HENHMETAFILE arg1, UINT arg2, Extbyte * arg3) -{ - if (XEUNICODE_P) - return GetEnhMetaFileDescriptionW (arg1, arg2, (LPWSTR) arg3); - else - return GetEnhMetaFileDescriptionA (arg1, arg2, (LPSTR) arg3); -} - -/* Skipping GetTextMetrics because split-sized LPTEXTMETRIC */ - -int -qxeStartDoc (HDC arg1, CONST DOCINFOW * arg2) -{ - if (XEUNICODE_P) - return StartDocW (arg1, arg2); - else - return StartDocA (arg1, (CONST DOCINFOA *) arg2); -} - -/* Skipping GetObject because split-sized LOGFONT */ - -BOOL -qxeTextOut (HDC arg1, int arg2, int arg3, const Extbyte * arg4, int arg5) -{ - if (XEUNICODE_P) - return TextOutW (arg1, arg2, arg3, (LPCWSTR) arg4, arg5); - else - return TextOutA (arg1, arg2, arg3, (LPCSTR) arg4, arg5); -} - -BOOL -qxeExtTextOut (HDC arg1, int arg2, int arg3, UINT arg4, CONST RECT * arg5, const Extbyte * arg6, UINT arg7, CONST INT * arg8) -{ - if (XEUNICODE_P) - return ExtTextOutW (arg1, arg2, arg3, arg4, arg5, (LPCWSTR) arg6, arg7, arg8); - else - return ExtTextOutA (arg1, arg2, arg3, arg4, arg5, (LPCSTR) arg6, arg7, arg8); -} - -BOOL -qxePolyTextOut (HDC arg1, CONST POLYTEXTW * arg2, int arg3) -{ - if (XEUNICODE_P) - return PolyTextOutW (arg1, arg2, arg3); - else - return PolyTextOutA (arg1, (CONST POLYTEXTA *) arg2, arg3); -} - -int -qxeGetTextFace (HDC arg1, int arg2, Extbyte * arg3) -{ - if (XEUNICODE_P) - return GetTextFaceW (arg1, arg2, (LPWSTR) arg3); - else - return GetTextFaceA (arg1, arg2, (LPSTR) arg3); -} - -DWORD -qxeGetKerningPairs (HDC arg1, DWORD arg2, LPKERNINGPAIR arg3) -{ - if (XEUNICODE_P) - return GetKerningPairsW (arg1, arg2, arg3); - else - return GetKerningPairsA (arg1, arg2, arg3); -} - -/* Error if GetLogColorSpace used: split-sized LPLOGCOLORSPACE; NT 4.0+ only */ - -/* Error if CreateColorSpace used: split-sized LPLOGCOLORSPACE; NT 4.0+ only */ - -/* Skipping GetICMProfile because NT 4.0+ only, error in Cygwin prototype */ - -/* NOTE: NT 4.0+ only */ -BOOL -qxeSetICMProfile (HDC arg1, Extbyte * arg2) -{ - if (XEUNICODE_P) - return SetICMProfileW (arg1, (LPWSTR) arg2); - else - return SetICMProfileA (arg1, (LPSTR) arg2); -} - -/* NOTE: NT 4.0+ only */ -int -qxeEnumICMProfiles (HDC arg1, ICMENUMPROCW arg2, LPARAM arg3) -{ - if (XEUNICODE_P) - return EnumICMProfilesW (arg1, arg2, arg3); - else - return EnumICMProfilesA (arg1, (ICMENUMPROCA) arg2, arg3); -} - -/* Skipping UpdateICMRegKey because NT 4.0+ only, error in Cygwin prototype */ - -/* Error if wglUseFontBitmaps used: causes link error */ - -/* Error if wglUseFontOutlines used: causes link error */ - +qxemciGetErrorString (MCIERROR mcierr, Extbyte * pszText, UINT cchText) +{ + if (XEUNICODE_P) + return mciGetErrorStringW (mcierr, (LPWSTR) pszText, cchText); + else + return mciGetErrorStringA (mcierr, (LPSTR) pszText, cchText); +} +
--- a/src/intl-auto-encap-win32.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/intl-auto-encap-win32.h Thu Nov 04 23:08:28 2004 +0000 @@ -3,70 +3,192 @@ */ -/* Processing file WINNLS.H */ - -#undef GetCPInfoEx -#define GetCPInfoEx error not used, not examined yet - -#undef CompareString -#define CompareString error not used, not examined yet - -#undef LCMapString -#define LCMapString error not used, not examined yet - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetLocaleInfo -#define GetLocaleInfo error use qxeGetLocaleInfo or GetLocaleInfoA/GetLocaleInfoW -#endif -int qxeGetLocaleInfo (LCID Locale, LCTYPE LCType, Extbyte * lpLCData, int cchData); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SetLocaleInfo -#define SetLocaleInfo error use qxeSetLocaleInfo or SetLocaleInfoA/SetLocaleInfoW -#endif -BOOL qxeSetLocaleInfo (LCID Locale, LCTYPE LCType, const Extbyte * lpLCData); - -#undef GetTimeFormat -#define GetTimeFormat error not used, not examined yet - -#undef GetDateFormat -#define GetDateFormat error not used, not examined yet - -#undef GetNumberFormat -#define GetNumberFormat error not used, not examined yet - -#undef GetCurrencyFormat -#define GetCurrencyFormat error not used, not examined yet - -#undef EnumCalendarInfo -#define EnumCalendarInfo error not used, not examined yet - -#undef EnumCalendarInfoEx -#define EnumCalendarInfoEx error not used, not examined yet - -#undef EnumTimeFormats -#define EnumTimeFormats error not used, not examined yet - -#undef EnumDateFormats -#define EnumDateFormats error not used, not examined yet - -#undef EnumDateFormatsEx -#define EnumDateFormatsEx error not used, not examined yet - -#undef GetStringTypeEx -#define GetStringTypeEx error not used, not examined yet - -#undef GetStringType -#define GetStringType error no such fun; A and W versions have different nos. of args - -#undef FoldString -#define FoldString error not used, not examined yet - -#undef EnumSystemLocales -#define EnumSystemLocales error not used, not examined yet - -#undef EnumSystemCodePages -#define EnumSystemCodePages error not used, not examined yet +/* Processing file WINCON.H */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef PeekConsoleInput +#define PeekConsoleInput error_use_qxePeekConsoleInput_or_PeekConsoleInputA_and_PeekConsoleInputW +#endif +BOOL qxePeekConsoleInput (HANDLE hConsoleInput, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ReadConsoleInput +#define ReadConsoleInput error_use_qxeReadConsoleInput_or_ReadConsoleInputA_and_ReadConsoleInputW +#endif +BOOL qxeReadConsoleInput (HANDLE hConsoleInput, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef WriteConsoleInput +#define WriteConsoleInput error_use_qxeWriteConsoleInput_or_WriteConsoleInputA_and_WriteConsoleInputW +#endif +BOOL qxeWriteConsoleInput (HANDLE hConsoleInput, CONST INPUT_RECORD * lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsWritten); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ReadConsoleOutput +#define ReadConsoleOutput error_use_qxeReadConsoleOutput_or_ReadConsoleOutputA_and_ReadConsoleOutputW +#endif +BOOL qxeReadConsoleOutput (HANDLE hConsoleOutput, PCHAR_INFO lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, PSMALL_RECT lpReadRegion); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef WriteConsoleOutput +#define WriteConsoleOutput error_use_qxeWriteConsoleOutput_or_WriteConsoleOutputA_and_WriteConsoleOutputW +#endif +BOOL qxeWriteConsoleOutput (HANDLE hConsoleOutput, CONST CHAR_INFO * lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, PSMALL_RECT lpWriteRegion); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ReadConsoleOutputCharacter +#define ReadConsoleOutputCharacter error_use_qxeReadConsoleOutputCharacter_or_ReadConsoleOutputCharacterA_and_ReadConsoleOutputCharacterW +#endif +BOOL qxeReadConsoleOutputCharacter (HANDLE hConsoleOutput, Extbyte * lpCharacter, DWORD nLength, COORD dwReadCoord, LPDWORD lpNumberOfCharsRead); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef WriteConsoleOutputCharacter +#define WriteConsoleOutputCharacter error_use_qxeWriteConsoleOutputCharacter_or_WriteConsoleOutputCharacterA_and_WriteConsoleOutputCharacterW +#endif +BOOL qxeWriteConsoleOutputCharacter (HANDLE hConsoleOutput, const Extbyte * lpCharacter, DWORD nLength, COORD dwWriteCoord, LPDWORD lpNumberOfCharsWritten); + +#undef FillConsoleOutputCharacter +#define FillConsoleOutputCharacter error_split_CHAR + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ScrollConsoleScreenBuffer +#define ScrollConsoleScreenBuffer error_use_qxeScrollConsoleScreenBuffer_or_ScrollConsoleScreenBufferA_and_ScrollConsoleScreenBufferW +#endif +BOOL qxeScrollConsoleScreenBuffer (HANDLE hConsoleOutput, CONST SMALL_RECT * lpScrollRectangle, CONST SMALL_RECT * lpClipRectangle, COORD dwDestinationOrigin, CONST CHAR_INFO * lpFill); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetConsoleTitle +#define GetConsoleTitle error_use_qxeGetConsoleTitle_or_GetConsoleTitleA_and_GetConsoleTitleW +#endif +DWORD qxeGetConsoleTitle (Extbyte * lpConsoleTitle, DWORD nSize); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SetConsoleTitle +#define SetConsoleTitle error_use_qxeSetConsoleTitle_or_SetConsoleTitleA_and_SetConsoleTitleW +#endif +BOOL qxeSetConsoleTitle (const Extbyte * lpConsoleTitle); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ReadConsole +#define ReadConsole error_use_qxeReadConsole_or_ReadConsoleA_and_ReadConsoleW +#endif +BOOL qxeReadConsole (HANDLE hConsoleInput, LPVOID lpBuffer, DWORD nNumberOfCharsToRead, LPDWORD lpNumberOfCharsRead, LPVOID lpReserved); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef WriteConsole +#define WriteConsole error_use_qxeWriteConsole_or_WriteConsoleA_and_WriteConsoleW +#endif +BOOL qxeWriteConsole (HANDLE hConsoleOutput, CONST VOID * lpBuffer, DWORD nNumberOfCharsToWrite, LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved); + + +/* Processing file SHELLAPI.H */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DragQueryFile +#define DragQueryFile error_use_qxeDragQueryFile_or_DragQueryFileA_and_DragQueryFileW +#endif +UINT qxeDragQueryFile (HDROP arg1, UINT arg2, Extbyte * arg3, UINT arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ShellExecute +#define ShellExecute error_use_qxeShellExecute_or_ShellExecuteA_and_ShellExecuteW +#endif +HINSTANCE qxeShellExecute (HWND hwnd, const Extbyte * lpOperation, const Extbyte * lpFile, const Extbyte * lpParameters, const Extbyte * lpDirectory, INT nShowCmd); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef FindExecutable +#define FindExecutable error_use_qxeFindExecutable_or_FindExecutableA_and_FindExecutableW +#endif +HINSTANCE qxeFindExecutable (const Extbyte * lpFile, const Extbyte * lpDirectory, Extbyte * lpResult); + +#undef CommandLineToArgv +#define CommandLineToArgv error_Unicode_only + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ShellAbout +#define ShellAbout error_use_qxeShellAbout_or_ShellAboutA_and_ShellAboutW +#endif +INT qxeShellAbout (HWND hWnd, const Extbyte * szApp, const Extbyte * szOtherStuff, HICON hIcon); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ExtractAssociatedIcon +#define ExtractAssociatedIcon error_use_qxeExtractAssociatedIcon_or_ExtractAssociatedIconA_and_ExtractAssociatedIconW +#endif +HICON qxeExtractAssociatedIcon (HINSTANCE hInst, Extbyte * lpIconPath, LPWORD lpiIcon); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ExtractIcon +#define ExtractIcon error_use_qxeExtractIcon_or_ExtractIconA_and_ExtractIconW +#endif +HICON qxeExtractIcon (HINSTANCE hInst, const Extbyte * lpszExeFileName, UINT nIconIndex); + +#if !defined (CYGWIN_HEADERS) +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DoEnvironmentSubst +#define DoEnvironmentSubst error_use_qxeDoEnvironmentSubst_or_DoEnvironmentSubstA_and_DoEnvironmentSubstW +#endif +DWORD qxeDoEnvironmentSubst (Extbyte * szString, UINT cbString); +#endif /* !defined (CYGWIN_HEADERS) */ + +#undef FindEnvironmentString +#define FindEnvironmentString error_causes_link_error__NT_4_0__only + +/* Skipping ExtractIconEx because NT 4.0+ only, error in Cygwin prototype */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SHFileOperation +#define SHFileOperation error_use_qxeSHFileOperation_or_SHFileOperationA_and_SHFileOperationW +#endif +int qxeSHFileOperation (LPSHFILEOPSTRUCTW lpFileOp); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ShellExecuteEx +#define ShellExecuteEx error_use_qxeShellExecuteEx_or_ShellExecuteExA_and_ShellExecuteExW +#endif +BOOL qxeShellExecuteEx (LPSHELLEXECUTEINFOW lpExecInfo); + +#undef WinExecError +#define WinExecError error_causes_link_error__NT_4_0__only + +#if !defined (CYGWIN_HEADERS) +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SHQueryRecycleBin +#define SHQueryRecycleBin error_use_qxeSHQueryRecycleBin_or_SHQueryRecycleBinA_and_SHQueryRecycleBinW +#endif +HRESULT qxeSHQueryRecycleBin (const Extbyte * pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo); +#endif /* !defined (CYGWIN_HEADERS) */ + +#if !defined (CYGWIN_HEADERS) +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SHEmptyRecycleBin +#define SHEmptyRecycleBin error_use_qxeSHEmptyRecycleBin_or_SHEmptyRecycleBinA_and_SHEmptyRecycleBinW +#endif +HRESULT qxeSHEmptyRecycleBin (HWND hwnd, const Extbyte * pszRootPath, DWORD dwFlags); +#endif /* !defined (CYGWIN_HEADERS) */ + +#undef Shell_NotifyIcon +#define Shell_NotifyIcon error_split_sized_NOTIFYICONDATA__NT_4_0__only + +/* Skipping SHGetFileInfo because split-sized SHFILEINFO, NT 4.0+ only */ + +#undef SHGetDiskFreeSpace +#define SHGetDiskFreeSpace error_causes_link_error__NT_4_0__only + +#if !defined (CYGWIN_HEADERS) +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SHGetNewLinkInfo +#define SHGetNewLinkInfo error_use_qxeSHGetNewLinkInfo_or_SHGetNewLinkInfoA_and_SHGetNewLinkInfoW +#endif +BOOL qxeSHGetNewLinkInfo (const Extbyte * pszLinkTo, const Extbyte * pszDir, Extbyte * pszName, BOOL * pfMustCopy, UINT uFlags); +#endif /* !defined (CYGWIN_HEADERS) */ + +#if !defined (CYGWIN_HEADERS) +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SHInvokePrinterCommand +#define SHInvokePrinterCommand error_use_qxeSHInvokePrinterCommand_or_SHInvokePrinterCommandA_and_SHInvokePrinterCommandW +#endif +BOOL qxeSHInvokePrinterCommand (HWND hwnd, UINT uAction, const Extbyte * lpBuf1, const Extbyte * lpBuf2, BOOL fModal); +#endif /* !defined (CYGWIN_HEADERS) */ /* Processing file WINSPOOL.H */ @@ -74,7 +196,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef EnumPrinters -#define EnumPrinters error use qxeEnumPrinters or EnumPrintersA/EnumPrintersW +#define EnumPrinters error_use_qxeEnumPrinters_or_EnumPrintersA_and_EnumPrintersW #endif BOOL qxeEnumPrinters (DWORD Flags, Extbyte * Name, DWORD Level, LPBYTE pPrinterEnum, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -85,122 +207,122 @@ #if defined (HAVE_MS_WINDOWS) #undef ResetPrinter -#define ResetPrinter error split-sized DEVMODE pointer in split PRINTER_DEFAULTS +#define ResetPrinter error_split_sized_DEVMODE_pointer_in_split_PRINTER_DEFAULTS #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef SetJob -#define SetJob error split-sized DEVMODE pointer in split JOB_INFO_2 +#define SetJob error_split_sized_DEVMODE_pointer_in_split_JOB_INFO_2 #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef GetJob -#define GetJob error split-sized DEVMODE pointer in split JOB_INFO_2 +#define GetJob error_split_sized_DEVMODE_pointer_in_split_JOB_INFO_2 #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef EnumJobs -#define EnumJobs error split-sized DEVMODE pointer in split JOB_INFO_2 +#define EnumJobs error_split_sized_DEVMODE_pointer_in_split_JOB_INFO_2 #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef AddPrinter -#define AddPrinter error split-sized DEVMODE pointer in split PRINTER_INFO_2 +#define AddPrinter error_split_sized_DEVMODE_pointer_in_split_PRINTER_INFO_2 #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef SetPrinter -#define SetPrinter error split-sized DEVMODE pointer in split PRINTER_INFO_2 +#define SetPrinter error_split_sized_DEVMODE_pointer_in_split_PRINTER_INFO_2 #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef GetPrinter -#define GetPrinter error split-sized DEVMODE pointer in split PRINTER_INFO_2 +#define GetPrinter error_split_sized_DEVMODE_pointer_in_split_PRINTER_INFO_2 #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef AddPrinterDriver -#define AddPrinterDriver error not used, complicated interface with split structures +#define AddPrinterDriver error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef AddPrinterDriverEx -#define AddPrinterDriverEx error not used, complicated interface with split structures +#define AddPrinterDriverEx error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef EnumPrinterDrivers -#define EnumPrinterDrivers error not used, complicated interface with split structures +#define EnumPrinterDrivers error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef GetPrinterDriver -#define GetPrinterDriver error not used, complicated interface with split structures +#define GetPrinterDriver error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef GetPrinterDriverDirectory -#define GetPrinterDriverDirectory error not used, complicated interface with split structures +#define GetPrinterDriverDirectory error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef DeletePrinterDriver -#define DeletePrinterDriver error not used, complicated interface with split structures +#define DeletePrinterDriver error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef DeletePrinterDriverEx -#define DeletePrinterDriverEx error not used, complicated interface with split structures +#define DeletePrinterDriverEx error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef AddPerMachineConnection -#define AddPerMachineConnection error not used, complicated interface with split structures +#define AddPerMachineConnection error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef DeletePerMachineConnection -#define DeletePerMachineConnection error not used, complicated interface with split structures +#define DeletePerMachineConnection error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef EnumPerMachineConnections -#define EnumPerMachineConnections error not used, complicated interface with split structures +#define EnumPerMachineConnections error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef AddPrintProcessor -#define AddPrintProcessor error not used, complicated interface with split structures +#define AddPrintProcessor error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef EnumPrintProcessors -#define EnumPrintProcessors error not used, complicated interface with split structures +#define EnumPrintProcessors error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef GetPrintProcessorDirectory -#define GetPrintProcessorDirectory error not used, complicated interface with split structures +#define GetPrintProcessorDirectory error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef EnumPrintProcessorDatatypes -#define EnumPrintProcessorDatatypes error not used, complicated interface with split structures +#define EnumPrintProcessorDatatypes error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef DeletePrintProcessor -#define DeletePrintProcessor error not used, complicated interface with split structures +#define DeletePrintProcessor error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef StartDocPrinter -#define StartDocPrinter error not used, complicated interface with split structures +#define StartDocPrinter error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef AddJob -#define AddJob error not used, complicated interface with split structures +#define AddJob error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) @@ -209,162 +331,162 @@ #if defined (HAVE_MS_WINDOWS) #undef AdvancedDocumentProperties -#define AdvancedDocumentProperties error not used, complicated interface with split structures +#define AdvancedDocumentProperties error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef GetPrinterData -#define GetPrinterData error not used, complicated interface with split structures +#define GetPrinterData error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef GetPrinterDataEx -#define GetPrinterDataEx error not used, complicated interface with split structures +#define GetPrinterDataEx error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef EnumPrinterData -#define EnumPrinterData error not used, complicated interface with split structures +#define EnumPrinterData error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef EnumPrinterDataEx -#define EnumPrinterDataEx error not used, complicated interface with split structures +#define EnumPrinterDataEx error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef EnumPrinterKey -#define EnumPrinterKey error not used, complicated interface with split structures +#define EnumPrinterKey error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef SetPrinterData -#define SetPrinterData error not used, complicated interface with split structures +#define SetPrinterData error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef SetPrinterDataEx -#define SetPrinterDataEx error not used, complicated interface with split structures +#define SetPrinterDataEx error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef DeletePrinterData -#define DeletePrinterData error not used, complicated interface with split structures +#define DeletePrinterData error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef DeletePrinterDataEx -#define DeletePrinterDataEx error not used, complicated interface with split structures +#define DeletePrinterDataEx error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef DeletePrinterKey -#define DeletePrinterKey error not used, complicated interface with split structures +#define DeletePrinterKey error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef PrinterMessageBox -#define PrinterMessageBox error not used, complicated interface with split structures +#define PrinterMessageBox error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef AddForm -#define AddForm error not used, complicated interface with split structures +#define AddForm error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef DeleteForm -#define DeleteForm error not used, complicated interface with split structures +#define DeleteForm error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef GetForm -#define GetForm error not used, complicated interface with split structures +#define GetForm error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef SetForm -#define SetForm error not used, complicated interface with split structures +#define SetForm error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef EnumForms -#define EnumForms error not used, complicated interface with split structures +#define EnumForms error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef EnumMonitors -#define EnumMonitors error not used, complicated interface with split structures +#define EnumMonitors error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef AddMonitor -#define AddMonitor error not used, complicated interface with split structures +#define AddMonitor error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef DeleteMonitor -#define DeleteMonitor error not used, complicated interface with split structures +#define DeleteMonitor error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef EnumPorts -#define EnumPorts error not used, complicated interface with split structures +#define EnumPorts error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef AddPort -#define AddPort error not used, complicated interface with split structures +#define AddPort error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef ConfigurePort -#define ConfigurePort error not used, complicated interface with split structures +#define ConfigurePort error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef DeletePort -#define DeletePort error not used, complicated interface with split structures +#define DeletePort error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef XcvData -#define XcvData error not used, complicated interface with split structures +#define XcvData error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef SetPort -#define SetPort error not used, complicated interface with split structures +#define SetPort error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef AddPrinterConnection -#define AddPrinterConnection error not used, complicated interface with split structures +#define AddPrinterConnection error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef DeletePrinterConnection -#define DeletePrinterConnection error not used, complicated interface with split structures +#define DeletePrinterConnection error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef AddPrintProvidor -#define AddPrintProvidor error not used, complicated interface with split structures +#define AddPrintProvidor error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef DeletePrintProvidor -#define DeletePrintProvidor error not used, complicated interface with split structures +#define DeletePrintProvidor error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef SetPrinterHTMLView -#define SetPrinterHTMLView error not used, complicated interface with split structures +#define SetPrinterHTMLView error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef GetPrinterHTMLView -#define GetPrinterHTMLView error not used, complicated interface with split structures +#define GetPrinterHTMLView error_not_used__complicated_interface_with_split_structures #endif /* defined (HAVE_MS_WINDOWS) */ @@ -373,7 +495,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetAddConnection -#define WNetAddConnection error use qxeWNetAddConnection or WNetAddConnectionA/WNetAddConnectionW +#define WNetAddConnection error_use_qxeWNetAddConnection_or_WNetAddConnectionA_and_WNetAddConnectionW #endif DWORD qxeWNetAddConnection (const Extbyte * lpRemoteName, const Extbyte * lpPassword, const Extbyte * lpLocalName); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -381,7 +503,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetAddConnection2 -#define WNetAddConnection2 error use qxeWNetAddConnection2 or WNetAddConnection2A/WNetAddConnection2W +#define WNetAddConnection2 error_use_qxeWNetAddConnection2_or_WNetAddConnection2A_and_WNetAddConnection2W #endif DWORD qxeWNetAddConnection2 (LPNETRESOURCEW lpNetResource, const Extbyte * lpPassword, const Extbyte * lpUserName, DWORD dwFlags); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -389,7 +511,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetAddConnection3 -#define WNetAddConnection3 error use qxeWNetAddConnection3 or WNetAddConnection3A/WNetAddConnection3W +#define WNetAddConnection3 error_use_qxeWNetAddConnection3_or_WNetAddConnection3A_and_WNetAddConnection3W #endif DWORD qxeWNetAddConnection3 (HWND hwndOwner, LPNETRESOURCEW lpNetResource, const Extbyte * lpPassword, const Extbyte * lpUserName, DWORD dwFlags); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -397,7 +519,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetCancelConnection -#define WNetCancelConnection error use qxeWNetCancelConnection or WNetCancelConnectionA/WNetCancelConnectionW +#define WNetCancelConnection error_use_qxeWNetCancelConnection_or_WNetCancelConnectionA_and_WNetCancelConnectionW #endif DWORD qxeWNetCancelConnection (const Extbyte * lpName, BOOL fForce); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -405,7 +527,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetCancelConnection2 -#define WNetCancelConnection2 error use qxeWNetCancelConnection2 or WNetCancelConnection2A/WNetCancelConnection2W +#define WNetCancelConnection2 error_use_qxeWNetCancelConnection2_or_WNetCancelConnection2A_and_WNetCancelConnection2W #endif DWORD qxeWNetCancelConnection2 (const Extbyte * lpName, DWORD dwFlags, BOOL fForce); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -413,7 +535,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetGetConnection -#define WNetGetConnection error use qxeWNetGetConnection or WNetGetConnectionA/WNetGetConnectionW +#define WNetGetConnection error_use_qxeWNetGetConnection_or_WNetGetConnectionA_and_WNetGetConnectionW #endif DWORD qxeWNetGetConnection (const Extbyte * lpLocalName, Extbyte * lpRemoteName, LPDWORD lpnLength); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -421,7 +543,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetUseConnection -#define WNetUseConnection error use qxeWNetUseConnection or WNetUseConnectionA/WNetUseConnectionW +#define WNetUseConnection error_use_qxeWNetUseConnection_or_WNetUseConnectionA_and_WNetUseConnectionW #endif DWORD qxeWNetUseConnection (HWND hwndOwner, LPNETRESOURCEW lpNetResource, const Extbyte * lpUserID, const Extbyte * lpPassword, DWORD dwFlags, Extbyte * lpAccessName, LPDWORD lpBufferSize, LPDWORD lpResult); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -429,7 +551,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetConnectionDialog1 -#define WNetConnectionDialog1 error use qxeWNetConnectionDialog1 or WNetConnectionDialog1A/WNetConnectionDialog1W +#define WNetConnectionDialog1 error_use_qxeWNetConnectionDialog1_or_WNetConnectionDialog1A_and_WNetConnectionDialog1W #endif DWORD qxeWNetConnectionDialog1 (LPCONNECTDLGSTRUCTW lpConnDlgStruct); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -437,7 +559,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetDisconnectDialog1 -#define WNetDisconnectDialog1 error use qxeWNetDisconnectDialog1 or WNetDisconnectDialog1A/WNetDisconnectDialog1W +#define WNetDisconnectDialog1 error_use_qxeWNetDisconnectDialog1_or_WNetDisconnectDialog1A_and_WNetDisconnectDialog1W #endif DWORD qxeWNetDisconnectDialog1 (LPDISCDLGSTRUCTW lpConnDlgStruct); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -445,7 +567,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetOpenEnum -#define WNetOpenEnum error use qxeWNetOpenEnum or WNetOpenEnumA/WNetOpenEnumW +#define WNetOpenEnum error_use_qxeWNetOpenEnum_or_WNetOpenEnumA_and_WNetOpenEnumW #endif DWORD qxeWNetOpenEnum (DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCEW lpNetResource, LPHANDLE lphEnum); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -453,7 +575,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetEnumResource -#define WNetEnumResource error use qxeWNetEnumResource or WNetEnumResourceA/WNetEnumResourceW +#define WNetEnumResource error_use_qxeWNetEnumResource_or_WNetEnumResourceA_and_WNetEnumResourceW #endif DWORD qxeWNetEnumResource (HANDLE hEnum, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -461,7 +583,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetGetUniversalName -#define WNetGetUniversalName error use qxeWNetGetUniversalName or WNetGetUniversalNameA/WNetGetUniversalNameW +#define WNetGetUniversalName error_use_qxeWNetGetUniversalName_or_WNetGetUniversalNameA_and_WNetGetUniversalNameW #endif DWORD qxeWNetGetUniversalName (const Extbyte * lpLocalPath, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpBufferSize); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -469,7 +591,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetGetUser -#define WNetGetUser error use qxeWNetGetUser or WNetGetUserA/WNetGetUserW +#define WNetGetUser error_use_qxeWNetGetUser_or_WNetGetUserA_and_WNetGetUserW #endif DWORD qxeWNetGetUser (const Extbyte * lpName, Extbyte * lpUserName, LPDWORD lpnLength); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -477,7 +599,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetGetProviderName -#define WNetGetProviderName error use qxeWNetGetProviderName or WNetGetProviderNameA/WNetGetProviderNameW +#define WNetGetProviderName error_use_qxeWNetGetProviderName_or_WNetGetProviderNameA_and_WNetGetProviderNameW #endif DWORD qxeWNetGetProviderName (DWORD dwNetType, Extbyte * lpProviderName, LPDWORD lpBufferSize); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -485,7 +607,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetGetNetworkInformation -#define WNetGetNetworkInformation error use qxeWNetGetNetworkInformation or WNetGetNetworkInformationA/WNetGetNetworkInformationW +#define WNetGetNetworkInformation error_use_qxeWNetGetNetworkInformation_or_WNetGetNetworkInformationA_and_WNetGetNetworkInformationW #endif DWORD qxeWNetGetNetworkInformation (const Extbyte * lpProvider, LPNETINFOSTRUCT lpNetInfoStruct); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -493,7 +615,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WNetGetLastError -#define WNetGetLastError error use qxeWNetGetLastError or WNetGetLastErrorA/WNetGetLastErrorW +#define WNetGetLastError error_use_qxeWNetGetLastError_or_WNetGetLastErrorA_and_WNetGetLastErrorW #endif DWORD qxeWNetGetLastError (LPDWORD lpError, Extbyte * lpErrorBuf, DWORD nErrorBufSize, Extbyte * lpNameBuf, DWORD nNameBufSize); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -501,357 +623,1229 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef MultinetGetConnectionPerformance -#define MultinetGetConnectionPerformance error use qxeMultinetGetConnectionPerformance or MultinetGetConnectionPerformanceA/MultinetGetConnectionPerformanceW +#define MultinetGetConnectionPerformance error_use_qxeMultinetGetConnectionPerformance_or_MultinetGetConnectionPerformanceA_and_MultinetGetConnectionPerformanceW #endif DWORD qxeMultinetGetConnectionPerformance (LPNETRESOURCEW lpNetResource, LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct); #endif /* defined (HAVE_MS_WINDOWS) */ +/* Processing file WINUSER.H */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef wvsprintf +#define wvsprintf error_use_qxewvsprintf_or_wvsprintfA_and_wvsprintfW +#endif +int qxewvsprintf (Extbyte * arg1, const Extbyte * arg2, va_list arglist); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef LoadKeyboardLayout +#define LoadKeyboardLayout error_use_qxeLoadKeyboardLayout_or_LoadKeyboardLayoutA_and_LoadKeyboardLayoutW +#endif +HKL qxeLoadKeyboardLayout (const Extbyte * pwszKLID, UINT Flags); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetKeyboardLayoutName +#define GetKeyboardLayoutName error_use_qxeGetKeyboardLayoutName_or_GetKeyboardLayoutNameA_and_GetKeyboardLayoutNameW +#endif +BOOL qxeGetKeyboardLayoutName (Extbyte * pwszKLID); + +#undef CreateDesktop +#define CreateDesktop error_split_sized_LPDEVMODE + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef OpenDesktop +#define OpenDesktop error_use_qxeOpenDesktop_or_OpenDesktopA_and_OpenDesktopW +#endif +HDESK qxeOpenDesktop (Extbyte * lpszDesktop, DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef EnumDesktops +#define EnumDesktops error_use_qxeEnumDesktops_or_EnumDesktopsA_and_EnumDesktopsW +#endif +BOOL qxeEnumDesktops (HWINSTA hwinsta, DESKTOPENUMPROCW lpEnumFunc, LPARAM lParam); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CreateWindowStation +#define CreateWindowStation error_use_qxeCreateWindowStation_or_CreateWindowStationA_and_CreateWindowStationW +#endif +HWINSTA qxeCreateWindowStation (Extbyte * lpwinsta, DWORD dwReserved, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef OpenWindowStation +#define OpenWindowStation error_use_qxeOpenWindowStation_or_OpenWindowStationA_and_OpenWindowStationW +#endif +HWINSTA qxeOpenWindowStation (Extbyte * lpszWinSta, BOOL fInherit, ACCESS_MASK dwDesiredAccess); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef EnumWindowStations +#define EnumWindowStations error_use_qxeEnumWindowStations_or_EnumWindowStationsA_and_EnumWindowStationsW +#endif +BOOL qxeEnumWindowStations (WINSTAENUMPROCW lpEnumFunc, LPARAM lParam); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetUserObjectInformation +#define GetUserObjectInformation error_use_qxeGetUserObjectInformation_or_GetUserObjectInformationA_and_GetUserObjectInformationW +#endif +BOOL qxeGetUserObjectInformation (HANDLE hObj, int nIndex, PVOID pvInfo, DWORD nLength, LPDWORD lpnLengthNeeded); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SetUserObjectInformation +#define SetUserObjectInformation error_use_qxeSetUserObjectInformation_or_SetUserObjectInformationA_and_SetUserObjectInformationW +#endif +BOOL qxeSetUserObjectInformation (HANDLE hObj, int nIndex, PVOID pvInfo, DWORD nLength); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef RegisterWindowMessage +#define RegisterWindowMessage error_use_qxeRegisterWindowMessage_or_RegisterWindowMessageA_and_RegisterWindowMessageW +#endif +UINT qxeRegisterWindowMessage (const Extbyte * lpString); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetMessage +#define GetMessage error_use_qxeGetMessage_or_GetMessageA_and_GetMessageW +#endif +BOOL qxeGetMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DispatchMessage +#define DispatchMessage error_use_qxeDispatchMessage_or_DispatchMessageA_and_DispatchMessageW +#endif +LONG qxeDispatchMessage (CONST MSG * lpMsg); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef PeekMessage +#define PeekMessage error_use_qxePeekMessage_or_PeekMessageA_and_PeekMessageW +#endif +BOOL qxePeekMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg); + +/* Skipping SendMessage because split messages and structures */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SendMessageTimeout +#define SendMessageTimeout error_use_qxeSendMessageTimeout_or_SendMessageTimeoutA_and_SendMessageTimeoutW +#endif +LRESULT qxeSendMessageTimeout (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT fuFlags, UINT uTimeout, LPDWORD lpdwResult); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SendNotifyMessage +#define SendNotifyMessage error_use_qxeSendNotifyMessage_or_SendNotifyMessageA_and_SendNotifyMessageW +#endif +BOOL qxeSendNotifyMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SendMessageCallback +#define SendMessageCallback error_use_qxeSendMessageCallback_or_SendMessageCallbackA_and_SendMessageCallbackW +#endif +BOOL qxeSendMessageCallback (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, SENDASYNCPROC lpResultCallBack, DWORD dwData); + +#undef BroadcastSystemMessage +#define BroadcastSystemMessage error_win95_version_not_split__NT_4_0__only + +#undef RegisterDeviceNotification +#define RegisterDeviceNotification error_NT_5_0__only + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef PostMessage +#define PostMessage error_use_qxePostMessage_or_PostMessageA_and_PostMessageW +#endif +BOOL qxePostMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef PostThreadMessage +#define PostThreadMessage error_use_qxePostThreadMessage_or_PostThreadMessageA_and_PostThreadMessageW +#endif +BOOL qxePostThreadMessage (DWORD idThread, UINT Msg, WPARAM wParam, LPARAM lParam); + +/* Skipping DefWindowProc because return value is conditionalized on _MAC, messes up parser */ + +#undef CallWindowProc +#define CallWindowProc error_two_versions__STRICT_and_non_STRICT + +#undef CallWindowProc +#define CallWindowProc error_two_versions__STRICT_and_non_STRICT + +/* Skipping RegisterClass because need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASS */ + +/* Skipping UnregisterClass because need to intercept for reasons related to RegisterClass */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetClassInfo +#define GetClassInfo error_use_qxeGetClassInfo_or_GetClassInfoA_and_GetClassInfoW +#endif +BOOL qxeGetClassInfo (HINSTANCE hInstance, const Extbyte * lpClassName, LPWNDCLASSW lpWndClass); + +/* Skipping RegisterClassEx because need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASSEX; NT 4.0+ only */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetClassInfoEx +#define GetClassInfoEx error_use_qxeGetClassInfoEx_or_GetClassInfoExA_and_GetClassInfoExW +#endif +BOOL qxeGetClassInfoEx (HINSTANCE arg1, const Extbyte * arg2, LPWNDCLASSEXW arg3); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CreateWindowEx +#define CreateWindowEx error_use_qxeCreateWindowEx_or_CreateWindowExA_and_CreateWindowExW +#endif +HWND qxeCreateWindowEx (DWORD dwExStyle, const Extbyte * lpClassName, const Extbyte * lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CreateDialogParam +#define CreateDialogParam error_use_qxeCreateDialogParam_or_CreateDialogParamA_and_CreateDialogParamW +#endif +HWND qxeCreateDialogParam (HINSTANCE hInstance, const Extbyte * lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CreateDialogIndirectParam +#define CreateDialogIndirectParam error_use_qxeCreateDialogIndirectParam_or_CreateDialogIndirectParamA_and_CreateDialogIndirectParamW +#endif +HWND qxeCreateDialogIndirectParam (HINSTANCE hInstance, LPCDLGTEMPLATEW lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DialogBoxParam +#define DialogBoxParam error_use_qxeDialogBoxParam_or_DialogBoxParamA_and_DialogBoxParamW +#endif +int qxeDialogBoxParam (HINSTANCE hInstance, const Extbyte * lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DialogBoxIndirectParam +#define DialogBoxIndirectParam error_use_qxeDialogBoxIndirectParam_or_DialogBoxIndirectParamA_and_DialogBoxIndirectParamW +#endif +int qxeDialogBoxIndirectParam (HINSTANCE hInstance, LPCDLGTEMPLATEW hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SetDlgItemText +#define SetDlgItemText error_use_qxeSetDlgItemText_or_SetDlgItemTextA_and_SetDlgItemTextW +#endif +BOOL qxeSetDlgItemText (HWND hDlg, int nIDDlgItem, const Extbyte * lpString); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetDlgItemText +#define GetDlgItemText error_use_qxeGetDlgItemText_or_GetDlgItemTextA_and_GetDlgItemTextW +#endif +UINT qxeGetDlgItemText (HWND hDlg, int nIDDlgItem, Extbyte * lpString, int nMaxCount); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SendDlgItemMessage +#define SendDlgItemMessage error_use_qxeSendDlgItemMessage_or_SendDlgItemMessageA_and_SendDlgItemMessageW +#endif +LONG qxeSendDlgItemMessage (HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam); + +#undef DefDlgProc +#define DefDlgProc error_return_value_is_conditionalized_on__MAC__messes_up_parser + +#if !defined (CYGWIN_HEADERS) +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CallMsgFilter +#define CallMsgFilter error_use_qxeCallMsgFilter_or_CallMsgFilterA_and_CallMsgFilterW +#endif +BOOL qxeCallMsgFilter (LPMSG lpMsg, int nCode); +#endif /* !defined (CYGWIN_HEADERS) */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef RegisterClipboardFormat +#define RegisterClipboardFormat error_use_qxeRegisterClipboardFormat_or_RegisterClipboardFormatA_and_RegisterClipboardFormatW +#endif +UINT qxeRegisterClipboardFormat (const Extbyte * lpszFormat); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetClipboardFormatName +#define GetClipboardFormatName error_use_qxeGetClipboardFormatName_or_GetClipboardFormatNameA_and_GetClipboardFormatNameW +#endif +int qxeGetClipboardFormatName (UINT format, Extbyte * lpszFormatName, int cchMaxCount); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CharToOem +#define CharToOem error_use_qxeCharToOem_or_CharToOemA_and_CharToOemW +#endif +BOOL qxeCharToOem (const Extbyte * lpszSrc, LPSTR lpszDst); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef OemToChar +#define OemToChar error_use_qxeOemToChar_or_OemToCharA_and_OemToCharW +#endif +BOOL qxeOemToChar (LPCSTR lpszSrc, Extbyte * lpszDst); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CharToOemBuff +#define CharToOemBuff error_use_qxeCharToOemBuff_or_CharToOemBuffA_and_CharToOemBuffW +#endif +BOOL qxeCharToOemBuff (const Extbyte * lpszSrc, LPSTR lpszDst, DWORD cchDstLength); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef OemToCharBuff +#define OemToCharBuff error_use_qxeOemToCharBuff_or_OemToCharBuffA_and_OemToCharBuffW +#endif +BOOL qxeOemToCharBuff (LPCSTR lpszSrc, Extbyte * lpszDst, DWORD cchDstLength); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CharUpper +#define CharUpper error_use_qxeCharUpper_or_CharUpperA_and_CharUpperW +#endif +Extbyte * qxeCharUpper (Extbyte * lpsz); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CharUpperBuff +#define CharUpperBuff error_use_qxeCharUpperBuff_or_CharUpperBuffA_and_CharUpperBuffW +#endif +DWORD qxeCharUpperBuff (Extbyte * lpsz, DWORD cchLength); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CharLower +#define CharLower error_use_qxeCharLower_or_CharLowerA_and_CharLowerW +#endif +Extbyte * qxeCharLower (Extbyte * lpsz); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CharLowerBuff +#define CharLowerBuff error_use_qxeCharLowerBuff_or_CharLowerBuffA_and_CharLowerBuffW +#endif +DWORD qxeCharLowerBuff (Extbyte * lpsz, DWORD cchLength); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CharNext +#define CharNext error_use_qxeCharNext_or_CharNextA_and_CharNextW +#endif +Extbyte * qxeCharNext (const Extbyte * lpsz); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CharPrev +#define CharPrev error_use_qxeCharPrev_or_CharPrevA_and_CharPrevW +#endif +Extbyte * qxeCharPrev (const Extbyte * lpszStart, const Extbyte * lpszCurrent); + +#undef IsCharAlpha +#define IsCharAlpha error_split_CHAR + +#undef IsCharAlphaNumeric +#define IsCharAlphaNumeric error_split_CHAR + +#undef IsCharUpper +#define IsCharUpper error_split_CHAR + +#undef IsCharLower +#define IsCharLower error_split_CHAR + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetKeyNameText +#define GetKeyNameText error_use_qxeGetKeyNameText_or_GetKeyNameTextA_and_GetKeyNameTextW +#endif +int qxeGetKeyNameText (LONG lParam, Extbyte * lpString, int nSize); + +/* Skipping VkKeyScan because split CHAR */ + +#undef VkKeyScanEx +#define VkKeyScanEx error_split_CHAR__NT_4_0__only + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef MapVirtualKey +#define MapVirtualKey error_use_qxeMapVirtualKey_or_MapVirtualKeyA_and_MapVirtualKeyW +#endif +UINT qxeMapVirtualKey (UINT uCode, UINT uMapType); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef MapVirtualKeyEx +#define MapVirtualKeyEx error_use_qxeMapVirtualKeyEx_or_MapVirtualKeyExA_and_MapVirtualKeyExW +#endif +UINT qxeMapVirtualKeyEx (UINT uCode, UINT uMapType, HKL dwhkl); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef LoadAccelerators +#define LoadAccelerators error_use_qxeLoadAccelerators_or_LoadAcceleratorsA_and_LoadAcceleratorsW +#endif +HACCEL qxeLoadAccelerators (HINSTANCE hInstance, const Extbyte * lpTableName); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CreateAcceleratorTable +#define CreateAcceleratorTable error_use_qxeCreateAcceleratorTable_or_CreateAcceleratorTableA_and_CreateAcceleratorTableW +#endif +HACCEL qxeCreateAcceleratorTable (LPACCEL arg1, int arg2); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CopyAcceleratorTable +#define CopyAcceleratorTable error_use_qxeCopyAcceleratorTable_or_CopyAcceleratorTableA_and_CopyAcceleratorTableW +#endif +int qxeCopyAcceleratorTable (HACCEL hAccelSrc, LPACCEL lpAccelDst, int cAccelEntries); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef TranslateAccelerator +#define TranslateAccelerator error_use_qxeTranslateAccelerator_or_TranslateAcceleratorA_and_TranslateAcceleratorW +#endif +int qxeTranslateAccelerator (HWND hWnd, HACCEL hAccTable, LPMSG lpMsg); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef LoadMenu +#define LoadMenu error_use_qxeLoadMenu_or_LoadMenuA_and_LoadMenuW +#endif +HMENU qxeLoadMenu (HINSTANCE hInstance, const Extbyte * lpMenuName); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef LoadMenuIndirect +#define LoadMenuIndirect error_use_qxeLoadMenuIndirect_or_LoadMenuIndirectA_and_LoadMenuIndirectW +#endif +HMENU qxeLoadMenuIndirect (CONST MENUTEMPLATEW * lpMenuTemplate); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ChangeMenu +#define ChangeMenu error_use_qxeChangeMenu_or_ChangeMenuA_and_ChangeMenuW +#endif +BOOL qxeChangeMenu (HMENU hMenu, UINT cmd, const Extbyte * lpszNewItem, UINT cmdInsert, UINT flags); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetMenuString +#define GetMenuString error_use_qxeGetMenuString_or_GetMenuStringA_and_GetMenuStringW +#endif +int qxeGetMenuString (HMENU hMenu, UINT uIDItem, Extbyte * lpString, int nMaxCount, UINT uFlag); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef InsertMenu +#define InsertMenu error_use_qxeInsertMenu_or_InsertMenuA_and_InsertMenuW +#endif +BOOL qxeInsertMenu (HMENU hMenu, UINT uPosition, UINT uFlags, UINT uIDNewItem, const Extbyte * lpNewItem); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef AppendMenu +#define AppendMenu error_use_qxeAppendMenu_or_AppendMenuA_and_AppendMenuW +#endif +BOOL qxeAppendMenu (HMENU hMenu, UINT uFlags, UINT uIDNewItem, const Extbyte * lpNewItem); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ModifyMenu +#define ModifyMenu error_use_qxeModifyMenu_or_ModifyMenuA_and_ModifyMenuW +#endif +BOOL qxeModifyMenu (HMENU hMnu, UINT uPosition, UINT uFlags, UINT uIDNewItem, const Extbyte * lpNewItem); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef InsertMenuItem +#define InsertMenuItem error_use_qxeInsertMenuItem_or_InsertMenuItemA_and_InsertMenuItemW +#endif +BOOL qxeInsertMenuItem (HMENU arg1, UINT arg2, BOOL arg3, LPCMENUITEMINFOW arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetMenuItemInfo +#define GetMenuItemInfo error_use_qxeGetMenuItemInfo_or_GetMenuItemInfoA_and_GetMenuItemInfoW +#endif +BOOL qxeGetMenuItemInfo (HMENU arg1, UINT arg2, BOOL arg3, LPMENUITEMINFOW arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SetMenuItemInfo +#define SetMenuItemInfo error_use_qxeSetMenuItemInfo_or_SetMenuItemInfoA_and_SetMenuItemInfoW +#endif +BOOL qxeSetMenuItemInfo (HMENU arg1, UINT arg2, BOOL arg3, LPCMENUITEMINFOW arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DrawText +#define DrawText error_use_qxeDrawText_or_DrawTextA_and_DrawTextW +#endif +int qxeDrawText (HDC hDC, const Extbyte * lpString, int nCount, LPRECT lpRect, UINT uFormat); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DrawTextEx +#define DrawTextEx error_use_qxeDrawTextEx_or_DrawTextExA_and_DrawTextExW +#endif +int qxeDrawTextEx (HDC arg1, Extbyte * arg2, int arg3, LPRECT arg4, UINT arg5, LPDRAWTEXTPARAMS arg6); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GrayString +#define GrayString error_use_qxeGrayString_or_GrayStringA_and_GrayStringW +#endif +BOOL qxeGrayString (HDC hDC, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc, LPARAM lpData, int nCount, int X, int Y, int nWidth, int nHeight); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DrawState +#define DrawState error_use_qxeDrawState_or_DrawStateA_and_DrawStateW +#endif +BOOL qxeDrawState (HDC arg1, HBRUSH arg2, DRAWSTATEPROC arg3, LPARAM arg4, WPARAM arg5, int arg6, int arg7, int arg8, int arg9, UINT arg10); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef TabbedTextOut +#define TabbedTextOut error_use_qxeTabbedTextOut_or_TabbedTextOutA_and_TabbedTextOutW +#endif +LONG qxeTabbedTextOut (HDC hDC, int X, int Y, const Extbyte * lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetTabbedTextExtent +#define GetTabbedTextExtent error_use_qxeGetTabbedTextExtent_or_GetTabbedTextExtentA_and_GetTabbedTextExtentW +#endif +DWORD qxeGetTabbedTextExtent (HDC hDC, const Extbyte * lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SetProp +#define SetProp error_use_qxeSetProp_or_SetPropA_and_SetPropW +#endif +BOOL qxeSetProp (HWND hWnd, const Extbyte * lpString, HANDLE hData); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetProp +#define GetProp error_use_qxeGetProp_or_GetPropA_and_GetPropW +#endif +HANDLE qxeGetProp (HWND hWnd, const Extbyte * lpString); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef RemoveProp +#define RemoveProp error_use_qxeRemoveProp_or_RemovePropA_and_RemovePropW +#endif +HANDLE qxeRemoveProp (HWND hWnd, const Extbyte * lpString); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef EnumPropsEx +#define EnumPropsEx error_use_qxeEnumPropsEx_or_EnumPropsExA_and_EnumPropsExW +#endif +int qxeEnumPropsEx (HWND hWnd, PROPENUMPROCEXW lpEnumFunc, LPARAM lParam); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef EnumProps +#define EnumProps error_use_qxeEnumProps_or_EnumPropsA_and_EnumPropsW +#endif +int qxeEnumProps (HWND hWnd, PROPENUMPROCW lpEnumFunc); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SetWindowText +#define SetWindowText error_use_qxeSetWindowText_or_SetWindowTextA_and_SetWindowTextW +#endif +BOOL qxeSetWindowText (HWND hWnd, const Extbyte * lpString); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetWindowText +#define GetWindowText error_use_qxeGetWindowText_or_GetWindowTextA_and_GetWindowTextW +#endif +int qxeGetWindowText (HWND hWnd, Extbyte * lpString, int nMaxCount); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetWindowTextLength +#define GetWindowTextLength error_use_qxeGetWindowTextLength_or_GetWindowTextLengthA_and_GetWindowTextLengthW +#endif +int qxeGetWindowTextLength (HWND hWnd); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef MessageBox +#define MessageBox error_use_qxeMessageBox_or_MessageBoxA_and_MessageBoxW +#endif +int qxeMessageBox (HWND hWnd, const Extbyte * lpText, const Extbyte * lpCaption, UINT uType); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef MessageBoxEx +#define MessageBoxEx error_use_qxeMessageBoxEx_or_MessageBoxExA_and_MessageBoxExW +#endif +int qxeMessageBoxEx (HWND hWnd, const Extbyte * lpText, const Extbyte * lpCaption, UINT uType, WORD wLanguageId); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef MessageBoxIndirect +#define MessageBoxIndirect error_use_qxeMessageBoxIndirect_or_MessageBoxIndirectA_and_MessageBoxIndirectW +#endif +int qxeMessageBoxIndirect (LPMSGBOXPARAMSW arg1); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetWindowLong +#define GetWindowLong error_use_qxeGetWindowLong_or_GetWindowLongA_and_GetWindowLongW +#endif +LONG qxeGetWindowLong (HWND hWnd, int nIndex); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SetWindowLong +#define SetWindowLong error_use_qxeSetWindowLong_or_SetWindowLongA_and_SetWindowLongW +#endif +LONG qxeSetWindowLong (HWND hWnd, int nIndex, LONG dwNewLong); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetClassLong +#define GetClassLong error_use_qxeGetClassLong_or_GetClassLongA_and_GetClassLongW +#endif +DWORD qxeGetClassLong (HWND hWnd, int nIndex); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SetClassLong +#define SetClassLong error_use_qxeSetClassLong_or_SetClassLongA_and_SetClassLongW +#endif +DWORD qxeSetClassLong (HWND hWnd, int nIndex, LONG dwNewLong); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef FindWindow +#define FindWindow error_use_qxeFindWindow_or_FindWindowA_and_FindWindowW +#endif +HWND qxeFindWindow (const Extbyte * lpClassName, const Extbyte * lpWindowName); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef FindWindowEx +#define FindWindowEx error_use_qxeFindWindowEx_or_FindWindowExA_and_FindWindowExW +#endif +HWND qxeFindWindowEx (HWND arg1, HWND arg2, const Extbyte * arg3, const Extbyte * arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetClassName +#define GetClassName error_use_qxeGetClassName_or_GetClassNameA_and_GetClassNameW +#endif +int qxeGetClassName (HWND hWnd, Extbyte * lpClassName, int nMaxCount); + +#undef SetWindowsHook +#define SetWindowsHook error_obsolete__two_versions__STRICT_and_non_STRICT + +#undef SetWindowsHook +#define SetWindowsHook error_obsolete__two_versions__STRICT_and_non_STRICT + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SetWindowsHookEx +#define SetWindowsHookEx error_use_qxeSetWindowsHookEx_or_SetWindowsHookExA_and_SetWindowsHookExW +#endif +HHOOK qxeSetWindowsHookEx (int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadId); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef LoadBitmap +#define LoadBitmap error_use_qxeLoadBitmap_or_LoadBitmapA_and_LoadBitmapW +#endif +HBITMAP qxeLoadBitmap (HINSTANCE hInstance, const Extbyte * lpBitmapName); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef LoadCursor +#define LoadCursor error_use_qxeLoadCursor_or_LoadCursorA_and_LoadCursorW +#endif +HCURSOR qxeLoadCursor (HINSTANCE hInstance, const Extbyte * lpCursorName); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef LoadCursorFromFile +#define LoadCursorFromFile error_use_qxeLoadCursorFromFile_or_LoadCursorFromFileA_and_LoadCursorFromFileW +#endif +HCURSOR qxeLoadCursorFromFile (const Extbyte * lpFileName); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef LoadIcon +#define LoadIcon error_use_qxeLoadIcon_or_LoadIconA_and_LoadIconW +#endif +HICON qxeLoadIcon (HINSTANCE hInstance, const Extbyte * lpIconName); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef LoadImage +#define LoadImage error_use_qxeLoadImage_or_LoadImageA_and_LoadImageW +#endif +HANDLE qxeLoadImage (HINSTANCE arg1, const Extbyte * arg2, UINT arg3, int arg4, int arg5, UINT arg6); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef LoadString +#define LoadString error_use_qxeLoadString_or_LoadStringA_and_LoadStringW +#endif +int qxeLoadString (HINSTANCE hInstance, UINT uID, Extbyte * lpBuffer, int nBufferMax); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef IsDialogMessage +#define IsDialogMessage error_use_qxeIsDialogMessage_or_IsDialogMessageA_and_IsDialogMessageW +#endif +BOOL qxeIsDialogMessage (HWND hDlg, LPMSG lpMsg); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DlgDirList +#define DlgDirList error_use_qxeDlgDirList_or_DlgDirListA_and_DlgDirListW +#endif +int qxeDlgDirList (HWND hDlg, Extbyte * lpPathSpec, int nIDListBox, int nIDStaticPath, UINT uFileType); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DlgDirSelectEx +#define DlgDirSelectEx error_use_qxeDlgDirSelectEx_or_DlgDirSelectExA_and_DlgDirSelectExW +#endif +BOOL qxeDlgDirSelectEx (HWND hDlg, Extbyte * lpString, int nCount, int nIDListBox); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DlgDirListComboBox +#define DlgDirListComboBox error_use_qxeDlgDirListComboBox_or_DlgDirListComboBoxA_and_DlgDirListComboBoxW +#endif +int qxeDlgDirListComboBox (HWND hDlg, Extbyte * lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT uFiletype); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DlgDirSelectComboBoxEx +#define DlgDirSelectComboBoxEx error_use_qxeDlgDirSelectComboBoxEx_or_DlgDirSelectComboBoxExA_and_DlgDirSelectComboBoxExW +#endif +BOOL qxeDlgDirSelectComboBoxEx (HWND hDlg, Extbyte * lpString, int nCount, int nIDComboBox); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DefFrameProc +#define DefFrameProc error_use_qxeDefFrameProc_or_DefFrameProcA_and_DefFrameProcW +#endif +LRESULT qxeDefFrameProc (HWND hWnd, HWND hWndMDIClient, UINT uMsg, WPARAM wParam, LPARAM lParam); + +#undef DefMDIChildProc +#define DefMDIChildProc error_return_value_is_conditionalized_on__MAC__messes_up_parser + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CreateMDIWindow +#define CreateMDIWindow error_use_qxeCreateMDIWindow_or_CreateMDIWindowA_and_CreateMDIWindowW +#endif +HWND qxeCreateMDIWindow (Extbyte * lpClassName, Extbyte * lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HINSTANCE hInstance, LPARAM lParam); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef WinHelp +#define WinHelp error_use_qxeWinHelp_or_WinHelpA_and_WinHelpW +#endif +BOOL qxeWinHelp (HWND hWndMain, const Extbyte * lpszHelp, UINT uCommand, DWORD dwData); + +#undef ChangeDisplaySettings +#define ChangeDisplaySettings error_split_sized_LPDEVMODE + +#undef ChangeDisplaySettingsEx +#define ChangeDisplaySettingsEx error_split_sized_LPDEVMODE__NT_5_0_Win98__only + +#undef EnumDisplaySettings +#define EnumDisplaySettings error_split_sized_LPDEVMODE + +#undef EnumDisplayDevices +#define EnumDisplayDevices error_split_sized_PDISPLAY_DEVICE__NT_5_0__only__no_Win98 + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SystemParametersInfo +#define SystemParametersInfo error_use_qxeSystemParametersInfo_or_SystemParametersInfoA_and_SystemParametersInfoW +#endif +BOOL qxeSystemParametersInfo (UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni); + +#undef GetMonitorInfo +#define GetMonitorInfo error_NT_5_0_Win98__only + +#undef GetWindowModuleFileName +#define GetWindowModuleFileName error_NT_5_0__only + +#undef RealGetWindowClass +#define RealGetWindowClass error_NT_5_0__only + +#undef GetAltTabInfo +#define GetAltTabInfo error_NT_5_0__only + + +/* Processing file DDEML.H */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DdeInitialize +#define DdeInitialize error_use_qxeDdeInitialize_or_DdeInitializeA_and_DdeInitializeW +#endif +UINT qxeDdeInitialize (LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes); + +/* Skipping DdeCreateStringHandle because error in Cygwin prototype */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef DdeQueryString +#define DdeQueryString error_use_qxeDdeQueryString_or_DdeQueryStringA_and_DdeQueryStringW +#endif +DWORD qxeDdeQueryString (DWORD idInst, HSZ hsz, Extbyte * psz, DWORD cchMax, int iCodePage); + + /* Processing file WINREG.H */ /* Skipping RegConnectRegistry because error in Cygwin prototype */ #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegCreateKey -#define RegCreateKey error use qxeRegCreateKey or RegCreateKeyA/RegCreateKeyW +#define RegCreateKey error_use_qxeRegCreateKey_or_RegCreateKeyA_and_RegCreateKeyW #endif LONG qxeRegCreateKey (HKEY hKey, const Extbyte * lpSubKey, PHKEY phkResult); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegCreateKeyEx -#define RegCreateKeyEx error use qxeRegCreateKeyEx or RegCreateKeyExA/RegCreateKeyExW +#define RegCreateKeyEx error_use_qxeRegCreateKeyEx_or_RegCreateKeyExA_and_RegCreateKeyExW #endif LONG qxeRegCreateKeyEx (HKEY hKey, const Extbyte * lpSubKey, DWORD Reserved, Extbyte * lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegDeleteKey -#define RegDeleteKey error use qxeRegDeleteKey or RegDeleteKeyA/RegDeleteKeyW +#define RegDeleteKey error_use_qxeRegDeleteKey_or_RegDeleteKeyA_and_RegDeleteKeyW #endif LONG qxeRegDeleteKey (HKEY hKey, const Extbyte * lpSubKey); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegDeleteValue -#define RegDeleteValue error use qxeRegDeleteValue or RegDeleteValueA/RegDeleteValueW +#define RegDeleteValue error_use_qxeRegDeleteValue_or_RegDeleteValueA_and_RegDeleteValueW #endif LONG qxeRegDeleteValue (HKEY hKey, const Extbyte * lpValueName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegEnumKey -#define RegEnumKey error use qxeRegEnumKey or RegEnumKeyA/RegEnumKeyW +#define RegEnumKey error_use_qxeRegEnumKey_or_RegEnumKeyA_and_RegEnumKeyW #endif LONG qxeRegEnumKey (HKEY hKey, DWORD dwIndex, Extbyte * lpName, DWORD cbName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegEnumKeyEx -#define RegEnumKeyEx error use qxeRegEnumKeyEx or RegEnumKeyExA/RegEnumKeyExW +#define RegEnumKeyEx error_use_qxeRegEnumKeyEx_or_RegEnumKeyExA_and_RegEnumKeyExW #endif LONG qxeRegEnumKeyEx (HKEY hKey, DWORD dwIndex, Extbyte * lpName, LPDWORD lpcbName, LPDWORD lpReserved, Extbyte * lpClass, LPDWORD lpcbClass, PFILETIME lpftLastWriteTime); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegEnumValue -#define RegEnumValue error use qxeRegEnumValue or RegEnumValueA/RegEnumValueW +#define RegEnumValue error_use_qxeRegEnumValue_or_RegEnumValueA_and_RegEnumValueW #endif LONG qxeRegEnumValue (HKEY hKey, DWORD dwIndex, Extbyte * lpValueName, LPDWORD lpcbValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegLoadKey -#define RegLoadKey error use qxeRegLoadKey or RegLoadKeyA/RegLoadKeyW +#define RegLoadKey error_use_qxeRegLoadKey_or_RegLoadKeyA_and_RegLoadKeyW #endif LONG qxeRegLoadKey (HKEY hKey, const Extbyte * lpSubKey, const Extbyte * lpFile); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegOpenKey -#define RegOpenKey error use qxeRegOpenKey or RegOpenKeyA/RegOpenKeyW +#define RegOpenKey error_use_qxeRegOpenKey_or_RegOpenKeyA_and_RegOpenKeyW #endif LONG qxeRegOpenKey (HKEY hKey, const Extbyte * lpSubKey, PHKEY phkResult); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegOpenKeyEx -#define RegOpenKeyEx error use qxeRegOpenKeyEx or RegOpenKeyExA/RegOpenKeyExW +#define RegOpenKeyEx error_use_qxeRegOpenKeyEx_or_RegOpenKeyExA_and_RegOpenKeyExW #endif LONG qxeRegOpenKeyEx (HKEY hKey, const Extbyte * lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegQueryInfoKey -#define RegQueryInfoKey error use qxeRegQueryInfoKey or RegQueryInfoKeyA/RegQueryInfoKeyW +#define RegQueryInfoKey error_use_qxeRegQueryInfoKey_or_RegQueryInfoKeyA_and_RegQueryInfoKeyW #endif LONG qxeRegQueryInfoKey (HKEY hKey, Extbyte * lpClass, LPDWORD lpcbClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcbMaxSubKeyLen, LPDWORD lpcbMaxClassLen, LPDWORD lpcValues, LPDWORD lpcbMaxValueNameLen, LPDWORD lpcbMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegQueryValue -#define RegQueryValue error use qxeRegQueryValue or RegQueryValueA/RegQueryValueW +#define RegQueryValue error_use_qxeRegQueryValue_or_RegQueryValueA_and_RegQueryValueW #endif LONG qxeRegQueryValue (HKEY hKey, const Extbyte * lpSubKey, Extbyte * lpValue, PLONG lpcbValue); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegQueryMultipleValues -#define RegQueryMultipleValues error use qxeRegQueryMultipleValues or RegQueryMultipleValuesA/RegQueryMultipleValuesW +#define RegQueryMultipleValues error_use_qxeRegQueryMultipleValues_or_RegQueryMultipleValuesA_and_RegQueryMultipleValuesW #endif LONG qxeRegQueryMultipleValues (HKEY hKey, PVALENTW val_list, DWORD num_vals, Extbyte * lpValueBuf, LPDWORD ldwTotsize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegQueryValueEx -#define RegQueryValueEx error use qxeRegQueryValueEx or RegQueryValueExA/RegQueryValueExW +#define RegQueryValueEx error_use_qxeRegQueryValueEx_or_RegQueryValueExA_and_RegQueryValueExW #endif LONG qxeRegQueryValueEx (HKEY hKey, const Extbyte * lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegReplaceKey -#define RegReplaceKey error use qxeRegReplaceKey or RegReplaceKeyA/RegReplaceKeyW +#define RegReplaceKey error_use_qxeRegReplaceKey_or_RegReplaceKeyA_and_RegReplaceKeyW #endif LONG qxeRegReplaceKey (HKEY hKey, const Extbyte * lpSubKey, const Extbyte * lpNewFile, const Extbyte * lpOldFile); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegRestoreKey -#define RegRestoreKey error use qxeRegRestoreKey or RegRestoreKeyA/RegRestoreKeyW +#define RegRestoreKey error_use_qxeRegRestoreKey_or_RegRestoreKeyA_and_RegRestoreKeyW #endif LONG qxeRegRestoreKey (HKEY hKey, const Extbyte * lpFile, DWORD dwFlags); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegSaveKey -#define RegSaveKey error use qxeRegSaveKey or RegSaveKeyA/RegSaveKeyW +#define RegSaveKey error_use_qxeRegSaveKey_or_RegSaveKeyA_and_RegSaveKeyW #endif LONG qxeRegSaveKey (HKEY hKey, const Extbyte * lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegSetValue -#define RegSetValue error use qxeRegSetValue or RegSetValueA/RegSetValueW +#define RegSetValue error_use_qxeRegSetValue_or_RegSetValueA_and_RegSetValueW #endif LONG qxeRegSetValue (HKEY hKey, const Extbyte * lpSubKey, DWORD dwType, const Extbyte * lpData, DWORD cbData); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegSetValueEx -#define RegSetValueEx error use qxeRegSetValueEx or RegSetValueExA/RegSetValueExW +#define RegSetValueEx error_use_qxeRegSetValueEx_or_RegSetValueExA_and_RegSetValueExW #endif LONG qxeRegSetValueEx (HKEY hKey, const Extbyte * lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE* lpData, DWORD cbData); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegUnLoadKey -#define RegUnLoadKey error use qxeRegUnLoadKey or RegUnLoadKeyA/RegUnLoadKeyW +#define RegUnLoadKey error_use_qxeRegUnLoadKey_or_RegUnLoadKeyA_and_RegUnLoadKeyW #endif LONG qxeRegUnLoadKey (HKEY hKey, const Extbyte * lpSubKey); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef InitiateSystemShutdown -#define InitiateSystemShutdown error use qxeInitiateSystemShutdown or InitiateSystemShutdownA/InitiateSystemShutdownW +#define InitiateSystemShutdown error_use_qxeInitiateSystemShutdown_or_InitiateSystemShutdownA_and_InitiateSystemShutdownW #endif BOOL qxeInitiateSystemShutdown (Extbyte * lpMachineName, Extbyte * lpMessage, DWORD dwTimeout, BOOL bForceAppsClosed, BOOL bRebootAfterShutdown); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef AbortSystemShutdown -#define AbortSystemShutdown error use qxeAbortSystemShutdown or AbortSystemShutdownA/AbortSystemShutdownW +#define AbortSystemShutdown error_use_qxeAbortSystemShutdown_or_AbortSystemShutdownA_and_AbortSystemShutdownW #endif BOOL qxeAbortSystemShutdown (Extbyte * lpMachineName); -/* Processing file SHELLAPI.H */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DragQueryFile -#define DragQueryFile error use qxeDragQueryFile or DragQueryFileA/DragQueryFileW -#endif -UINT qxeDragQueryFile (HDROP arg1, UINT arg2, Extbyte * arg3, UINT arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ShellExecute -#define ShellExecute error use qxeShellExecute or ShellExecuteA/ShellExecuteW -#endif -HINSTANCE qxeShellExecute (HWND hwnd, const Extbyte * lpOperation, const Extbyte * lpFile, const Extbyte * lpParameters, const Extbyte * lpDirectory, INT nShowCmd); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef FindExecutable -#define FindExecutable error use qxeFindExecutable or FindExecutableA/FindExecutableW -#endif -HINSTANCE qxeFindExecutable (const Extbyte * lpFile, const Extbyte * lpDirectory, Extbyte * lpResult); - -#undef CommandLineToArgv -#define CommandLineToArgv error Unicode-only - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ShellAbout -#define ShellAbout error use qxeShellAbout or ShellAboutA/ShellAboutW -#endif -INT qxeShellAbout (HWND hWnd, const Extbyte * szApp, const Extbyte * szOtherStuff, HICON hIcon); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ExtractAssociatedIcon -#define ExtractAssociatedIcon error use qxeExtractAssociatedIcon or ExtractAssociatedIconA/ExtractAssociatedIconW -#endif -HICON qxeExtractAssociatedIcon (HINSTANCE hInst, Extbyte * lpIconPath, LPWORD lpiIcon); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ExtractIcon -#define ExtractIcon error use qxeExtractIcon or ExtractIconA/ExtractIconW -#endif -HICON qxeExtractIcon (HINSTANCE hInst, const Extbyte * lpszExeFileName, UINT nIconIndex); - -#if !defined (CYGWIN_HEADERS) -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DoEnvironmentSubst -#define DoEnvironmentSubst error use qxeDoEnvironmentSubst or DoEnvironmentSubstA/DoEnvironmentSubstW -#endif -DWORD qxeDoEnvironmentSubst (Extbyte * szString, UINT cbString); -#endif /* !defined (CYGWIN_HEADERS) */ - -#undef FindEnvironmentString -#define FindEnvironmentString error causes link error; NT 4.0+ only - -/* Skipping ExtractIconEx because NT 4.0+ only, error in Cygwin prototype */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SHFileOperation -#define SHFileOperation error use qxeSHFileOperation or SHFileOperationA/SHFileOperationW -#endif -int qxeSHFileOperation (LPSHFILEOPSTRUCTW lpFileOp); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ShellExecuteEx -#define ShellExecuteEx error use qxeShellExecuteEx or ShellExecuteExA/ShellExecuteExW -#endif -BOOL qxeShellExecuteEx (LPSHELLEXECUTEINFOW lpExecInfo); - -#undef WinExecError -#define WinExecError error causes link error; NT 4.0+ only - -#if !defined (CYGWIN_HEADERS) -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SHQueryRecycleBin -#define SHQueryRecycleBin error use qxeSHQueryRecycleBin or SHQueryRecycleBinA/SHQueryRecycleBinW -#endif -HRESULT qxeSHQueryRecycleBin (const Extbyte * pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo); -#endif /* !defined (CYGWIN_HEADERS) */ - -#if !defined (CYGWIN_HEADERS) -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SHEmptyRecycleBin -#define SHEmptyRecycleBin error use qxeSHEmptyRecycleBin or SHEmptyRecycleBinA/SHEmptyRecycleBinW -#endif -HRESULT qxeSHEmptyRecycleBin (HWND hwnd, const Extbyte * pszRootPath, DWORD dwFlags); -#endif /* !defined (CYGWIN_HEADERS) */ - -#undef Shell_NotifyIcon -#define Shell_NotifyIcon error split-sized NOTIFYICONDATA, NT 4.0+ only - -/* Skipping SHGetFileInfo because split-sized SHFILEINFO, NT 4.0+ only */ - -#undef SHGetDiskFreeSpace -#define SHGetDiskFreeSpace error causes link error; NT 4.0+ only - -#if !defined (CYGWIN_HEADERS) -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SHGetNewLinkInfo -#define SHGetNewLinkInfo error use qxeSHGetNewLinkInfo or SHGetNewLinkInfoA/SHGetNewLinkInfoW -#endif -BOOL qxeSHGetNewLinkInfo (const Extbyte * pszLinkTo, const Extbyte * pszDir, Extbyte * pszName, BOOL * pfMustCopy, UINT uFlags); -#endif /* !defined (CYGWIN_HEADERS) */ - -#if !defined (CYGWIN_HEADERS) -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SHInvokePrinterCommand -#define SHInvokePrinterCommand error use qxeSHInvokePrinterCommand or SHInvokePrinterCommandA/SHInvokePrinterCommandW -#endif -BOOL qxeSHInvokePrinterCommand (HWND hwnd, UINT uAction, const Extbyte * lpBuf1, const Extbyte * lpBuf2, BOOL fModal); -#endif /* !defined (CYGWIN_HEADERS) */ - - -/* Processing file WINCON.H */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef PeekConsoleInput -#define PeekConsoleInput error use qxePeekConsoleInput or PeekConsoleInputA/PeekConsoleInputW -#endif -BOOL qxePeekConsoleInput (HANDLE hConsoleInput, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ReadConsoleInput -#define ReadConsoleInput error use qxeReadConsoleInput or ReadConsoleInputA/ReadConsoleInputW -#endif -BOOL qxeReadConsoleInput (HANDLE hConsoleInput, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef WriteConsoleInput -#define WriteConsoleInput error use qxeWriteConsoleInput or WriteConsoleInputA/WriteConsoleInputW -#endif -BOOL qxeWriteConsoleInput (HANDLE hConsoleInput, CONST INPUT_RECORD * lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsWritten); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ReadConsoleOutput -#define ReadConsoleOutput error use qxeReadConsoleOutput or ReadConsoleOutputA/ReadConsoleOutputW -#endif -BOOL qxeReadConsoleOutput (HANDLE hConsoleOutput, PCHAR_INFO lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, PSMALL_RECT lpReadRegion); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef WriteConsoleOutput -#define WriteConsoleOutput error use qxeWriteConsoleOutput or WriteConsoleOutputA/WriteConsoleOutputW -#endif -BOOL qxeWriteConsoleOutput (HANDLE hConsoleOutput, CONST CHAR_INFO * lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, PSMALL_RECT lpWriteRegion); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ReadConsoleOutputCharacter -#define ReadConsoleOutputCharacter error use qxeReadConsoleOutputCharacter or ReadConsoleOutputCharacterA/ReadConsoleOutputCharacterW -#endif -BOOL qxeReadConsoleOutputCharacter (HANDLE hConsoleOutput, Extbyte * lpCharacter, DWORD nLength, COORD dwReadCoord, LPDWORD lpNumberOfCharsRead); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef WriteConsoleOutputCharacter -#define WriteConsoleOutputCharacter error use qxeWriteConsoleOutputCharacter or WriteConsoleOutputCharacterA/WriteConsoleOutputCharacterW -#endif -BOOL qxeWriteConsoleOutputCharacter (HANDLE hConsoleOutput, const Extbyte * lpCharacter, DWORD nLength, COORD dwWriteCoord, LPDWORD lpNumberOfCharsWritten); - -#undef FillConsoleOutputCharacter -#define FillConsoleOutputCharacter error split CHAR - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ScrollConsoleScreenBuffer -#define ScrollConsoleScreenBuffer error use qxeScrollConsoleScreenBuffer or ScrollConsoleScreenBufferA/ScrollConsoleScreenBufferW -#endif -BOOL qxeScrollConsoleScreenBuffer (HANDLE hConsoleOutput, CONST SMALL_RECT * lpScrollRectangle, CONST SMALL_RECT * lpClipRectangle, COORD dwDestinationOrigin, CONST CHAR_INFO * lpFill); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetConsoleTitle -#define GetConsoleTitle error use qxeGetConsoleTitle or GetConsoleTitleA/GetConsoleTitleW -#endif -DWORD qxeGetConsoleTitle (Extbyte * lpConsoleTitle, DWORD nSize); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SetConsoleTitle -#define SetConsoleTitle error use qxeSetConsoleTitle or SetConsoleTitleA/SetConsoleTitleW -#endif -BOOL qxeSetConsoleTitle (const Extbyte * lpConsoleTitle); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ReadConsole -#define ReadConsole error use qxeReadConsole or ReadConsoleA/ReadConsoleW -#endif -BOOL qxeReadConsole (HANDLE hConsoleInput, LPVOID lpBuffer, DWORD nNumberOfCharsToRead, LPDWORD lpNumberOfCharsRead, LPVOID lpReserved); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef WriteConsole -#define WriteConsole error use qxeWriteConsole or WriteConsoleA/WriteConsoleW -#endif -BOOL qxeWriteConsole (HANDLE hConsoleOutput, CONST VOID * lpBuffer, DWORD nNumberOfCharsToWrite, LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved); +/* Processing file WINNLS.H */ + +#undef GetCPInfoEx +#define GetCPInfoEx error_not_used__not_examined_yet + +#undef CompareString +#define CompareString error_not_used__not_examined_yet + +#undef LCMapString +#define LCMapString error_not_used__not_examined_yet + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetLocaleInfo +#define GetLocaleInfo error_use_qxeGetLocaleInfo_or_GetLocaleInfoA_and_GetLocaleInfoW +#endif +int qxeGetLocaleInfo (LCID Locale, LCTYPE LCType, Extbyte * lpLCData, int cchData); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SetLocaleInfo +#define SetLocaleInfo error_use_qxeSetLocaleInfo_or_SetLocaleInfoA_and_SetLocaleInfoW +#endif +BOOL qxeSetLocaleInfo (LCID Locale, LCTYPE LCType, const Extbyte * lpLCData); + +#undef GetTimeFormat +#define GetTimeFormat error_not_used__not_examined_yet + +#undef GetDateFormat +#define GetDateFormat error_not_used__not_examined_yet + +#undef GetNumberFormat +#define GetNumberFormat error_not_used__not_examined_yet + +#undef GetCurrencyFormat +#define GetCurrencyFormat error_not_used__not_examined_yet + +#undef EnumCalendarInfo +#define EnumCalendarInfo error_not_used__not_examined_yet + +#undef EnumCalendarInfoEx +#define EnumCalendarInfoEx error_not_used__not_examined_yet + +#undef EnumTimeFormats +#define EnumTimeFormats error_not_used__not_examined_yet + +#undef EnumDateFormats +#define EnumDateFormats error_not_used__not_examined_yet + +#undef EnumDateFormatsEx +#define EnumDateFormatsEx error_not_used__not_examined_yet + +#undef GetStringTypeEx +#define GetStringTypeEx error_not_used__not_examined_yet + +#undef GetStringType +#define GetStringType error_no_such_fun__A_and_W_versions_have_different_nos__of_args + +#undef FoldString +#define FoldString error_not_used__not_examined_yet + +#undef EnumSystemLocales +#define EnumSystemLocales error_not_used__not_examined_yet + +#undef EnumSystemCodePages +#define EnumSystemCodePages error_not_used__not_examined_yet + + +/* Processing file IME.H */ + +#undef SendIMEMessageEx +#define SendIMEMessageEx error_obsolete__no_docs_available + + +/* Processing file WINGDI.H */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef AddFontResource +#define AddFontResource error_use_qxeAddFontResource_or_AddFontResourceA_and_AddFontResourceW +#endif +int qxeAddFontResource (const Extbyte * arg1); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CopyMetaFile +#define CopyMetaFile error_use_qxeCopyMetaFile_or_CopyMetaFileA_and_CopyMetaFileW +#endif +HMETAFILE qxeCopyMetaFile (HMETAFILE arg1, const Extbyte * arg2); + +/* Skipping CreateDC because split-sized DEVMODE */ + +/* Skipping CreateFontIndirect because split-sized LOGFONT */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CreateFont +#define CreateFont error_use_qxeCreateFont_or_CreateFontA_and_CreateFontW +#endif +HFONT qxeCreateFont (int arg1, int arg2, int arg3, int arg4, int arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13, const Extbyte * arg14); + +/* Skipping CreateIC because split-sized DEVMODE */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CreateMetaFile +#define CreateMetaFile error_use_qxeCreateMetaFile_or_CreateMetaFileA_and_CreateMetaFileW +#endif +HDC qxeCreateMetaFile (const Extbyte * arg1); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CreateScalableFontResource +#define CreateScalableFontResource error_use_qxeCreateScalableFontResource_or_CreateScalableFontResourceA_and_CreateScalableFontResourceW +#endif +BOOL qxeCreateScalableFontResource (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4); + +/* Skipping DeviceCapabilities because split-sized DEVMODE */ + +/* Skipping EnumFontFamiliesEx because split-complex FONTENUMPROC; NT 4.0+ only */ + +#undef EnumFontFamilies +#define EnumFontFamilies error_split_complex_FONTENUMPROC + +#undef EnumFonts +#define EnumFonts error_split_complex_FONTENUMPROC + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetCharWidth +#define GetCharWidth error_use_qxeGetCharWidth_or_GetCharWidthA_and_GetCharWidthW +#endif +BOOL qxeGetCharWidth (HDC arg1, UINT arg2, UINT arg3, LPINT arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetCharWidth32 +#define GetCharWidth32 error_use_qxeGetCharWidth32_or_GetCharWidth32A_and_GetCharWidth32W +#endif +BOOL qxeGetCharWidth32 (HDC arg1, UINT arg2, UINT arg3, LPINT arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetCharWidthFloat +#define GetCharWidthFloat error_use_qxeGetCharWidthFloat_or_GetCharWidthFloatA_and_GetCharWidthFloatW +#endif +BOOL qxeGetCharWidthFloat (HDC arg1, UINT arg2, UINT arg3, PFLOAT arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetCharABCWidths +#define GetCharABCWidths error_use_qxeGetCharABCWidths_or_GetCharABCWidthsA_and_GetCharABCWidthsW +#endif +BOOL qxeGetCharABCWidths (HDC arg1, UINT arg2, UINT arg3, LPABC arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetCharABCWidthsFloat +#define GetCharABCWidthsFloat error_use_qxeGetCharABCWidthsFloat_or_GetCharABCWidthsFloatA_and_GetCharABCWidthsFloatW +#endif +BOOL qxeGetCharABCWidthsFloat (HDC arg1, UINT arg2, UINT arg3, LPABCFLOAT arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetGlyphOutline +#define GetGlyphOutline error_use_qxeGetGlyphOutline_or_GetGlyphOutlineA_and_GetGlyphOutlineW +#endif +DWORD qxeGetGlyphOutline (HDC arg1, UINT arg2, UINT arg3, LPGLYPHMETRICS arg4, DWORD arg5, LPVOID arg6, CONST MAT2 * arg7); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetMetaFile +#define GetMetaFile error_use_qxeGetMetaFile_or_GetMetaFileA_and_GetMetaFileW +#endif +HMETAFILE qxeGetMetaFile (const Extbyte * arg1); + +#undef GetOutlineTextMetrics +#define GetOutlineTextMetrics error_split_sized_LPOUTLINETEXTMETRIC + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetTextExtentPoint +#define GetTextExtentPoint error_use_qxeGetTextExtentPoint_or_GetTextExtentPointA_and_GetTextExtentPointW +#endif +BOOL qxeGetTextExtentPoint (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetTextExtentPoint32 +#define GetTextExtentPoint32 error_use_qxeGetTextExtentPoint32_or_GetTextExtentPoint32A_and_GetTextExtentPoint32W +#endif +BOOL qxeGetTextExtentPoint32 (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetTextExtentExPoint +#define GetTextExtentExPoint error_use_qxeGetTextExtentExPoint_or_GetTextExtentExPointA_and_GetTextExtentExPointW +#endif +BOOL qxeGetTextExtentExPoint (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPINT arg5, LPINT arg6, LPSIZE arg7); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetCharacterPlacement +#define GetCharacterPlacement error_use_qxeGetCharacterPlacement_or_GetCharacterPlacementA_and_GetCharacterPlacementW +#endif +DWORD qxeGetCharacterPlacement (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPGCP_RESULTSW arg5, DWORD arg6); + +#undef GetGlyphIndices +#define GetGlyphIndices error_NT_5_0__only + +#undef AddFontResourceEx +#define AddFontResourceEx error_NT_5_0__only + +#undef RemoveFontResourceEx +#define RemoveFontResourceEx error_NT_5_0__only + +#undef CreateFontIndirectEx +#define CreateFontIndirectEx error_split_sized_ENUMLOGFONTEXDV__NT_5_0__only + +/* Skipping ResetDC because split-sized DEVMODE */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef RemoveFontResource +#define RemoveFontResource error_use_qxeRemoveFontResource_or_RemoveFontResourceA_and_RemoveFontResourceW +#endif +BOOL qxeRemoveFontResource (const Extbyte * arg1); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CopyEnhMetaFile +#define CopyEnhMetaFile error_use_qxeCopyEnhMetaFile_or_CopyEnhMetaFileA_and_CopyEnhMetaFileW +#endif +HENHMETAFILE qxeCopyEnhMetaFile (HENHMETAFILE arg1, const Extbyte * arg2); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef CreateEnhMetaFile +#define CreateEnhMetaFile error_use_qxeCreateEnhMetaFile_or_CreateEnhMetaFileA_and_CreateEnhMetaFileW +#endif +HDC qxeCreateEnhMetaFile (HDC arg1, const Extbyte * arg2, CONST RECT * arg3, const Extbyte * arg4); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetEnhMetaFile +#define GetEnhMetaFile error_use_qxeGetEnhMetaFile_or_GetEnhMetaFileA_and_GetEnhMetaFileW +#endif +HENHMETAFILE qxeGetEnhMetaFile (const Extbyte * arg1); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetEnhMetaFileDescription +#define GetEnhMetaFileDescription error_use_qxeGetEnhMetaFileDescription_or_GetEnhMetaFileDescriptionA_and_GetEnhMetaFileDescriptionW +#endif +UINT qxeGetEnhMetaFileDescription (HENHMETAFILE arg1, UINT arg2, Extbyte * arg3); + +/* Skipping GetTextMetrics because split-sized LPTEXTMETRIC */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef StartDoc +#define StartDoc error_use_qxeStartDoc_or_StartDocA_and_StartDocW +#endif +int qxeStartDoc (HDC arg1, CONST DOCINFOW * arg2); + +/* Skipping GetObject because split-sized LOGFONT */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef TextOut +#define TextOut error_use_qxeTextOut_or_TextOutA_and_TextOutW +#endif +BOOL qxeTextOut (HDC arg1, int arg2, int arg3, const Extbyte * arg4, int arg5); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ExtTextOut +#define ExtTextOut error_use_qxeExtTextOut_or_ExtTextOutA_and_ExtTextOutW +#endif +BOOL qxeExtTextOut (HDC arg1, int arg2, int arg3, UINT arg4, CONST RECT * arg5, const Extbyte * arg6, UINT arg7, CONST INT * arg8); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef PolyTextOut +#define PolyTextOut error_use_qxePolyTextOut_or_PolyTextOutA_and_PolyTextOutW +#endif +BOOL qxePolyTextOut (HDC arg1, CONST POLYTEXTW * arg2, int arg3); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetTextFace +#define GetTextFace error_use_qxeGetTextFace_or_GetTextFaceA_and_GetTextFaceW +#endif +int qxeGetTextFace (HDC arg1, int arg2, Extbyte * arg3); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetKerningPairs +#define GetKerningPairs error_use_qxeGetKerningPairs_or_GetKerningPairsA_and_GetKerningPairsW +#endif +DWORD qxeGetKerningPairs (HDC arg1, DWORD arg2, LPKERNINGPAIR arg3); + +#undef GetLogColorSpace +#define GetLogColorSpace error_split_sized_LPLOGCOLORSPACE__NT_4_0__only + +#undef CreateColorSpace +#define CreateColorSpace error_split_sized_LPLOGCOLORSPACE__NT_4_0__only + +/* Skipping GetICMProfile because NT 4.0+ only, error in Cygwin prototype */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SetICMProfile +#define SetICMProfile error_use_qxeSetICMProfile_or_SetICMProfileA_and_SetICMProfileW +#endif +BOOL qxeSetICMProfile (HDC arg1, Extbyte * arg2); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef EnumICMProfiles +#define EnumICMProfiles error_use_qxeEnumICMProfiles_or_EnumICMProfilesA_and_EnumICMProfilesW +#endif +int qxeEnumICMProfiles (HDC arg1, ICMENUMPROCW arg2, LPARAM arg3); + +/* Skipping UpdateICMRegKey because NT 4.0+ only, error in Cygwin prototype */ + +#undef wglUseFontBitmaps +#define wglUseFontBitmaps error_causes_link_error + +#undef wglUseFontOutlines +#define wglUseFontOutlines error_causes_link_error + + +/* Processing file SHLOBJ.H */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef SHGetPathFromIDList +#define SHGetPathFromIDList error_use_qxeSHGetPathFromIDList_or_SHGetPathFromIDListA_and_SHGetPathFromIDListW +#endif +BOOL qxeSHGetPathFromIDList (LPCITEMIDLIST pidl, Extbyte * pszPath); + +/* Skipping SHGetSpecialFolderPath because error in Cygwin prototype, missing from Cygwin libraries */ + +/* Skipping SHBrowseForFolder because need to intercept callback for SendMessage */ + +/* Skipping SHGetDataFromIDList because split-sized WIN32_FIND_DATA or split-simple NETRESOURCE, missing from Cygwin libraries */ + + +/* Processing file COMMDLG.H */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetOpenFileName +#define GetOpenFileName error_use_qxeGetOpenFileName_or_GetOpenFileNameA_and_GetOpenFileNameW +#endif +BOOL qxeGetOpenFileName (LPOPENFILENAMEW arg1); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetSaveFileName +#define GetSaveFileName error_use_qxeGetSaveFileName_or_GetSaveFileNameA_and_GetSaveFileNameW +#endif +BOOL qxeGetSaveFileName (LPOPENFILENAMEW arg1); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef GetFileTitle +#define GetFileTitle error_use_qxeGetFileTitle_or_GetFileTitleA_and_GetFileTitleW +#endif +short qxeGetFileTitle (const Extbyte * arg1, Extbyte * arg2, WORD arg3); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ChooseColor +#define ChooseColor error_use_qxeChooseColor_or_ChooseColorA_and_ChooseColorW +#endif +BOOL qxeChooseColor (LPCHOOSECOLORW arg1); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef FindText +#define FindText error_use_qxeFindText_or_FindTextA_and_FindTextW +#endif +HWND qxeFindText (LPFINDREPLACEW arg1); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef ReplaceText +#define ReplaceText error_use_qxeReplaceText_or_ReplaceTextA_and_ReplaceTextW +#endif +HWND qxeReplaceText (LPFINDREPLACEW arg1); + +#undef AfxReplaceText +#define AfxReplaceText error_mac_only + +#undef ChooseFont +#define ChooseFont error_split_sized_LPLOGFONT_in_LPCHOOSEFONT + +/* Skipping PrintDlg because LPPRINTDLG with split-sized DEVMODE handle */ + +/* Skipping PageSetupDlg because LPPAGESETUPDLG with split-sized DEVMODE handle */ /* Processing file IMM.H */ @@ -859,7 +1853,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmInstallIME -#define ImmInstallIME error use qxeImmInstallIME or ImmInstallIMEA/ImmInstallIMEW +#define ImmInstallIME error_use_qxeImmInstallIME_or_ImmInstallIMEA_and_ImmInstallIMEW #endif HKL qxeImmInstallIME (const Extbyte * lpszIMEFileName, const Extbyte * lpszLayoutText); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -867,7 +1861,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmGetDescription -#define ImmGetDescription error use qxeImmGetDescription or ImmGetDescriptionA/ImmGetDescriptionW +#define ImmGetDescription error_use_qxeImmGetDescription_or_ImmGetDescriptionA_and_ImmGetDescriptionW #endif UINT qxeImmGetDescription (HKL arg1, Extbyte * arg2, UINT uBufLen); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -875,7 +1869,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmGetIMEFileName -#define ImmGetIMEFileName error use qxeImmGetIMEFileName or ImmGetIMEFileNameA/ImmGetIMEFileNameW +#define ImmGetIMEFileName error_use_qxeImmGetIMEFileName_or_ImmGetIMEFileNameA_and_ImmGetIMEFileNameW #endif UINT qxeImmGetIMEFileName (HKL arg1, Extbyte * arg2, UINT uBufLen); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -883,7 +1877,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmGetCompositionString -#define ImmGetCompositionString error use qxeImmGetCompositionString or ImmGetCompositionStringA/ImmGetCompositionStringW +#define ImmGetCompositionString error_use_qxeImmGetCompositionString_or_ImmGetCompositionStringA_and_ImmGetCompositionStringW #endif LONG qxeImmGetCompositionString (HIMC arg1, DWORD arg2, LPVOID arg3, DWORD arg4); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -891,7 +1885,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmSetCompositionString -#define ImmSetCompositionString error use qxeImmSetCompositionString or ImmSetCompositionStringA/ImmSetCompositionStringW +#define ImmSetCompositionString error_use_qxeImmSetCompositionString_or_ImmSetCompositionStringA_and_ImmSetCompositionStringW #endif BOOL qxeImmSetCompositionString (HIMC arg1, DWORD dwIndex, LPCVOID lpComp, DWORD arg4, LPCVOID lpRead, DWORD arg6); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -899,7 +1893,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmGetCandidateListCount -#define ImmGetCandidateListCount error use qxeImmGetCandidateListCount or ImmGetCandidateListCountA/ImmGetCandidateListCountW +#define ImmGetCandidateListCount error_use_qxeImmGetCandidateListCount_or_ImmGetCandidateListCountA_and_ImmGetCandidateListCountW #endif DWORD qxeImmGetCandidateListCount (HIMC arg1, LPDWORD lpdwListCount); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -907,7 +1901,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmGetCandidateList -#define ImmGetCandidateList error use qxeImmGetCandidateList or ImmGetCandidateListA/ImmGetCandidateListW +#define ImmGetCandidateList error_use_qxeImmGetCandidateList_or_ImmGetCandidateListA_and_ImmGetCandidateListW #endif DWORD qxeImmGetCandidateList (HIMC arg1, DWORD deIndex, LPCANDIDATELIST arg3, DWORD dwBufLen); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -915,7 +1909,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmGetGuideLine -#define ImmGetGuideLine error use qxeImmGetGuideLine or ImmGetGuideLineA/ImmGetGuideLineW +#define ImmGetGuideLine error_use_qxeImmGetGuideLine_or_ImmGetGuideLineA_and_ImmGetGuideLineW #endif DWORD qxeImmGetGuideLine (HIMC arg1, DWORD dwIndex, Extbyte * arg3, DWORD dwBufLen); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -931,7 +1925,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmConfigureIME -#define ImmConfigureIME error use qxeImmConfigureIME or ImmConfigureIMEA/ImmConfigureIMEW +#define ImmConfigureIME error_use_qxeImmConfigureIME_or_ImmConfigureIMEA_and_ImmConfigureIMEW #endif BOOL qxeImmConfigureIME (HKL arg1, HWND arg2, DWORD arg3, LPVOID arg4); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -939,7 +1933,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmEscape -#define ImmEscape error use qxeImmEscape or ImmEscapeA/ImmEscapeW +#define ImmEscape error_use_qxeImmEscape_or_ImmEscapeA_and_ImmEscapeW #endif LRESULT qxeImmEscape (HKL arg1, HIMC arg2, UINT arg3, LPVOID arg4); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -947,7 +1941,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmGetConversionList -#define ImmGetConversionList error use qxeImmGetConversionList or ImmGetConversionListA/ImmGetConversionListW +#define ImmGetConversionList error_use_qxeImmGetConversionList_or_ImmGetConversionListA_and_ImmGetConversionListW #endif DWORD qxeImmGetConversionList (HKL arg1, HIMC arg2, const Extbyte * arg3, LPCANDIDATELIST arg4, DWORD dwBufLen, UINT uFlag); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -955,7 +1949,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmIsUIMessage -#define ImmIsUIMessage error use qxeImmIsUIMessage or ImmIsUIMessageA/ImmIsUIMessageW +#define ImmIsUIMessage error_use_qxeImmIsUIMessage_or_ImmIsUIMessageA_and_ImmIsUIMessageW #endif BOOL qxeImmIsUIMessage (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -963,7 +1957,7 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmRegisterWord -#define ImmRegisterWord error use qxeImmRegisterWord or ImmRegisterWordA/ImmRegisterWordW +#define ImmRegisterWord error_use_qxeImmRegisterWord_or_ImmRegisterWordA_and_ImmRegisterWordW #endif BOOL qxeImmRegisterWord (HKL arg1, const Extbyte * lpszReading, DWORD arg3, const Extbyte * lpszRegister); #endif /* defined (HAVE_MS_WINDOWS) */ @@ -971,1363 +1965,547 @@ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmUnregisterWord -#define ImmUnregisterWord error use qxeImmUnregisterWord or ImmUnregisterWordA/ImmUnregisterWordW +#define ImmUnregisterWord error_use_qxeImmUnregisterWord_or_ImmUnregisterWordA_and_ImmUnregisterWordW #endif BOOL qxeImmUnregisterWord (HKL arg1, const Extbyte * lpszReading, DWORD arg3, const Extbyte * lpszUnregister); #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef ImmGetRegisterWordStyle -#define ImmGetRegisterWordStyle error split-sized STYLEBUF +#define ImmGetRegisterWordStyle error_split_sized_STYLEBUF #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ImmEnumRegisterWord -#define ImmEnumRegisterWord error use qxeImmEnumRegisterWord or ImmEnumRegisterWordA/ImmEnumRegisterWordW +#define ImmEnumRegisterWord error_use_qxeImmEnumRegisterWord_or_ImmEnumRegisterWordA_and_ImmEnumRegisterWordW #endif UINT qxeImmEnumRegisterWord (HKL arg1, REGISTERWORDENUMPROCW arg2, const Extbyte * lpszReading, DWORD arg4, const Extbyte * lpszRegister, LPVOID arg6); #endif /* defined (HAVE_MS_WINDOWS) */ #if defined (HAVE_MS_WINDOWS) #undef ImmGetImeMenuItems -#define ImmGetImeMenuItems error split-sized IMEMENUITEMINFO +#define ImmGetImeMenuItems error_split_sized_IMEMENUITEMINFO #endif /* defined (HAVE_MS_WINDOWS) */ -/* Processing file DDEML.H */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DdeInitialize -#define DdeInitialize error use qxeDdeInitialize or DdeInitializeA/DdeInitializeW -#endif -UINT qxeDdeInitialize (LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes); - -/* Skipping DdeCreateStringHandle because error in Cygwin prototype */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DdeQueryString -#define DdeQueryString error use qxeDdeQueryString or DdeQueryStringA/DdeQueryStringW -#endif -DWORD qxeDdeQueryString (DWORD idInst, HSZ hsz, Extbyte * psz, DWORD cchMax, int iCodePage); - - -/* Processing file WINUSER.H */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef wvsprintf -#define wvsprintf error use qxewvsprintf or wvsprintfA/wvsprintfW -#endif -int qxewvsprintf (Extbyte * arg1, const Extbyte * arg2, va_list arglist); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef LoadKeyboardLayout -#define LoadKeyboardLayout error use qxeLoadKeyboardLayout or LoadKeyboardLayoutA/LoadKeyboardLayoutW -#endif -HKL qxeLoadKeyboardLayout (const Extbyte * pwszKLID, UINT Flags); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetKeyboardLayoutName -#define GetKeyboardLayoutName error use qxeGetKeyboardLayoutName or GetKeyboardLayoutNameA/GetKeyboardLayoutNameW -#endif -BOOL qxeGetKeyboardLayoutName (Extbyte * pwszKLID); - -#undef CreateDesktop -#define CreateDesktop error split-sized LPDEVMODE - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef OpenDesktop -#define OpenDesktop error use qxeOpenDesktop or OpenDesktopA/OpenDesktopW -#endif -HDESK qxeOpenDesktop (Extbyte * lpszDesktop, DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef EnumDesktops -#define EnumDesktops error use qxeEnumDesktops or EnumDesktopsA/EnumDesktopsW -#endif -BOOL qxeEnumDesktops (HWINSTA hwinsta, DESKTOPENUMPROCW lpEnumFunc, LPARAM lParam); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CreateWindowStation -#define CreateWindowStation error use qxeCreateWindowStation or CreateWindowStationA/CreateWindowStationW -#endif -HWINSTA qxeCreateWindowStation (Extbyte * lpwinsta, DWORD dwReserved, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef OpenWindowStation -#define OpenWindowStation error use qxeOpenWindowStation or OpenWindowStationA/OpenWindowStationW -#endif -HWINSTA qxeOpenWindowStation (Extbyte * lpszWinSta, BOOL fInherit, ACCESS_MASK dwDesiredAccess); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef EnumWindowStations -#define EnumWindowStations error use qxeEnumWindowStations or EnumWindowStationsA/EnumWindowStationsW -#endif -BOOL qxeEnumWindowStations (WINSTAENUMPROCW lpEnumFunc, LPARAM lParam); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetUserObjectInformation -#define GetUserObjectInformation error use qxeGetUserObjectInformation or GetUserObjectInformationA/GetUserObjectInformationW -#endif -BOOL qxeGetUserObjectInformation (HANDLE hObj, int nIndex, PVOID pvInfo, DWORD nLength, LPDWORD lpnLengthNeeded); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SetUserObjectInformation -#define SetUserObjectInformation error use qxeSetUserObjectInformation or SetUserObjectInformationA/SetUserObjectInformationW -#endif -BOOL qxeSetUserObjectInformation (HANDLE hObj, int nIndex, PVOID pvInfo, DWORD nLength); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef RegisterWindowMessage -#define RegisterWindowMessage error use qxeRegisterWindowMessage or RegisterWindowMessageA/RegisterWindowMessageW -#endif -UINT qxeRegisterWindowMessage (const Extbyte * lpString); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetMessage -#define GetMessage error use qxeGetMessage or GetMessageA/GetMessageW -#endif -BOOL qxeGetMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DispatchMessage -#define DispatchMessage error use qxeDispatchMessage or DispatchMessageA/DispatchMessageW -#endif -LONG qxeDispatchMessage (CONST MSG * lpMsg); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef PeekMessage -#define PeekMessage error use qxePeekMessage or PeekMessageA/PeekMessageW -#endif -BOOL qxePeekMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg); - -/* Skipping SendMessage because split messages and structures */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SendMessageTimeout -#define SendMessageTimeout error use qxeSendMessageTimeout or SendMessageTimeoutA/SendMessageTimeoutW -#endif -LRESULT qxeSendMessageTimeout (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT fuFlags, UINT uTimeout, LPDWORD lpdwResult); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SendNotifyMessage -#define SendNotifyMessage error use qxeSendNotifyMessage or SendNotifyMessageA/SendNotifyMessageW -#endif -BOOL qxeSendNotifyMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SendMessageCallback -#define SendMessageCallback error use qxeSendMessageCallback or SendMessageCallbackA/SendMessageCallbackW -#endif -BOOL qxeSendMessageCallback (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, SENDASYNCPROC lpResultCallBack, DWORD dwData); - -#undef BroadcastSystemMessage -#define BroadcastSystemMessage error win95 version not split; NT 4.0+ only - -#undef RegisterDeviceNotification -#define RegisterDeviceNotification error NT 5.0+ only - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef PostMessage -#define PostMessage error use qxePostMessage or PostMessageA/PostMessageW -#endif -BOOL qxePostMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef PostThreadMessage -#define PostThreadMessage error use qxePostThreadMessage or PostThreadMessageA/PostThreadMessageW -#endif -BOOL qxePostThreadMessage (DWORD idThread, UINT Msg, WPARAM wParam, LPARAM lParam); - -/* Skipping DefWindowProc because return value is conditionalized on _MAC, messes up parser */ - -#undef CallWindowProc -#define CallWindowProc error two versions, STRICT and non-STRICT - -#undef CallWindowProc -#define CallWindowProc error two versions, STRICT and non-STRICT - -/* Skipping RegisterClass because need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASS */ - -/* Skipping UnregisterClass because need to intercept for reasons related to RegisterClass */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetClassInfo -#define GetClassInfo error use qxeGetClassInfo or GetClassInfoA/GetClassInfoW -#endif -BOOL qxeGetClassInfo (HINSTANCE hInstance, const Extbyte * lpClassName, LPWNDCLASSW lpWndClass); - -/* Skipping RegisterClassEx because need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASSEX; NT 4.0+ only */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetClassInfoEx -#define GetClassInfoEx error use qxeGetClassInfoEx or GetClassInfoExA/GetClassInfoExW -#endif -BOOL qxeGetClassInfoEx (HINSTANCE arg1, const Extbyte * arg2, LPWNDCLASSEXW arg3); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CreateWindowEx -#define CreateWindowEx error use qxeCreateWindowEx or CreateWindowExA/CreateWindowExW -#endif -HWND qxeCreateWindowEx (DWORD dwExStyle, const Extbyte * lpClassName, const Extbyte * lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CreateDialogParam -#define CreateDialogParam error use qxeCreateDialogParam or CreateDialogParamA/CreateDialogParamW -#endif -HWND qxeCreateDialogParam (HINSTANCE hInstance, const Extbyte * lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CreateDialogIndirectParam -#define CreateDialogIndirectParam error use qxeCreateDialogIndirectParam or CreateDialogIndirectParamA/CreateDialogIndirectParamW -#endif -HWND qxeCreateDialogIndirectParam (HINSTANCE hInstance, LPCDLGTEMPLATEW lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DialogBoxParam -#define DialogBoxParam error use qxeDialogBoxParam or DialogBoxParamA/DialogBoxParamW -#endif -int qxeDialogBoxParam (HINSTANCE hInstance, const Extbyte * lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DialogBoxIndirectParam -#define DialogBoxIndirectParam error use qxeDialogBoxIndirectParam or DialogBoxIndirectParamA/DialogBoxIndirectParamW -#endif -int qxeDialogBoxIndirectParam (HINSTANCE hInstance, LPCDLGTEMPLATEW hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SetDlgItemText -#define SetDlgItemText error use qxeSetDlgItemText or SetDlgItemTextA/SetDlgItemTextW -#endif -BOOL qxeSetDlgItemText (HWND hDlg, int nIDDlgItem, const Extbyte * lpString); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetDlgItemText -#define GetDlgItemText error use qxeGetDlgItemText or GetDlgItemTextA/GetDlgItemTextW -#endif -UINT qxeGetDlgItemText (HWND hDlg, int nIDDlgItem, Extbyte * lpString, int nMaxCount); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SendDlgItemMessage -#define SendDlgItemMessage error use qxeSendDlgItemMessage or SendDlgItemMessageA/SendDlgItemMessageW -#endif -LONG qxeSendDlgItemMessage (HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam); - -#undef DefDlgProc -#define DefDlgProc error return value is conditionalized on _MAC, messes up parser - -#if !defined (CYGWIN_HEADERS) -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CallMsgFilter -#define CallMsgFilter error use qxeCallMsgFilter or CallMsgFilterA/CallMsgFilterW -#endif -BOOL qxeCallMsgFilter (LPMSG lpMsg, int nCode); -#endif /* !defined (CYGWIN_HEADERS) */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef RegisterClipboardFormat -#define RegisterClipboardFormat error use qxeRegisterClipboardFormat or RegisterClipboardFormatA/RegisterClipboardFormatW -#endif -UINT qxeRegisterClipboardFormat (const Extbyte * lpszFormat); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetClipboardFormatName -#define GetClipboardFormatName error use qxeGetClipboardFormatName or GetClipboardFormatNameA/GetClipboardFormatNameW -#endif -int qxeGetClipboardFormatName (UINT format, Extbyte * lpszFormatName, int cchMaxCount); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CharToOem -#define CharToOem error use qxeCharToOem or CharToOemA/CharToOemW -#endif -BOOL qxeCharToOem (const Extbyte * lpszSrc, LPSTR lpszDst); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef OemToChar -#define OemToChar error use qxeOemToChar or OemToCharA/OemToCharW -#endif -BOOL qxeOemToChar (LPCSTR lpszSrc, Extbyte * lpszDst); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CharToOemBuff -#define CharToOemBuff error use qxeCharToOemBuff or CharToOemBuffA/CharToOemBuffW -#endif -BOOL qxeCharToOemBuff (const Extbyte * lpszSrc, LPSTR lpszDst, DWORD cchDstLength); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef OemToCharBuff -#define OemToCharBuff error use qxeOemToCharBuff or OemToCharBuffA/OemToCharBuffW -#endif -BOOL qxeOemToCharBuff (LPCSTR lpszSrc, Extbyte * lpszDst, DWORD cchDstLength); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CharUpper -#define CharUpper error use qxeCharUpper or CharUpperA/CharUpperW -#endif -Extbyte * qxeCharUpper (Extbyte * lpsz); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CharUpperBuff -#define CharUpperBuff error use qxeCharUpperBuff or CharUpperBuffA/CharUpperBuffW -#endif -DWORD qxeCharUpperBuff (Extbyte * lpsz, DWORD cchLength); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CharLower -#define CharLower error use qxeCharLower or CharLowerA/CharLowerW -#endif -Extbyte * qxeCharLower (Extbyte * lpsz); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CharLowerBuff -#define CharLowerBuff error use qxeCharLowerBuff or CharLowerBuffA/CharLowerBuffW -#endif -DWORD qxeCharLowerBuff (Extbyte * lpsz, DWORD cchLength); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CharNext -#define CharNext error use qxeCharNext or CharNextA/CharNextW -#endif -Extbyte * qxeCharNext (const Extbyte * lpsz); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CharPrev -#define CharPrev error use qxeCharPrev or CharPrevA/CharPrevW -#endif -Extbyte * qxeCharPrev (const Extbyte * lpszStart, const Extbyte * lpszCurrent); - -#undef IsCharAlpha -#define IsCharAlpha error split CHAR - -#undef IsCharAlphaNumeric -#define IsCharAlphaNumeric error split CHAR - -#undef IsCharUpper -#define IsCharUpper error split CHAR - -#undef IsCharLower -#define IsCharLower error split CHAR - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetKeyNameText -#define GetKeyNameText error use qxeGetKeyNameText or GetKeyNameTextA/GetKeyNameTextW -#endif -int qxeGetKeyNameText (LONG lParam, Extbyte * lpString, int nSize); - -/* Skipping VkKeyScan because split CHAR */ - -#undef VkKeyScanEx -#define VkKeyScanEx error split CHAR; NT 4.0+ only - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef MapVirtualKey -#define MapVirtualKey error use qxeMapVirtualKey or MapVirtualKeyA/MapVirtualKeyW -#endif -UINT qxeMapVirtualKey (UINT uCode, UINT uMapType); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef MapVirtualKeyEx -#define MapVirtualKeyEx error use qxeMapVirtualKeyEx or MapVirtualKeyExA/MapVirtualKeyExW -#endif -UINT qxeMapVirtualKeyEx (UINT uCode, UINT uMapType, HKL dwhkl); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef LoadAccelerators -#define LoadAccelerators error use qxeLoadAccelerators or LoadAcceleratorsA/LoadAcceleratorsW -#endif -HACCEL qxeLoadAccelerators (HINSTANCE hInstance, const Extbyte * lpTableName); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CreateAcceleratorTable -#define CreateAcceleratorTable error use qxeCreateAcceleratorTable or CreateAcceleratorTableA/CreateAcceleratorTableW -#endif -HACCEL qxeCreateAcceleratorTable (LPACCEL arg1, int arg2); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CopyAcceleratorTable -#define CopyAcceleratorTable error use qxeCopyAcceleratorTable or CopyAcceleratorTableA/CopyAcceleratorTableW -#endif -int qxeCopyAcceleratorTable (HACCEL hAccelSrc, LPACCEL lpAccelDst, int cAccelEntries); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef TranslateAccelerator -#define TranslateAccelerator error use qxeTranslateAccelerator or TranslateAcceleratorA/TranslateAcceleratorW -#endif -int qxeTranslateAccelerator (HWND hWnd, HACCEL hAccTable, LPMSG lpMsg); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef LoadMenu -#define LoadMenu error use qxeLoadMenu or LoadMenuA/LoadMenuW -#endif -HMENU qxeLoadMenu (HINSTANCE hInstance, const Extbyte * lpMenuName); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef LoadMenuIndirect -#define LoadMenuIndirect error use qxeLoadMenuIndirect or LoadMenuIndirectA/LoadMenuIndirectW -#endif -HMENU qxeLoadMenuIndirect (CONST MENUTEMPLATEW * lpMenuTemplate); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ChangeMenu -#define ChangeMenu error use qxeChangeMenu or ChangeMenuA/ChangeMenuW -#endif -BOOL qxeChangeMenu (HMENU hMenu, UINT cmd, const Extbyte * lpszNewItem, UINT cmdInsert, UINT flags); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetMenuString -#define GetMenuString error use qxeGetMenuString or GetMenuStringA/GetMenuStringW -#endif -int qxeGetMenuString (HMENU hMenu, UINT uIDItem, Extbyte * lpString, int nMaxCount, UINT uFlag); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef InsertMenu -#define InsertMenu error use qxeInsertMenu or InsertMenuA/InsertMenuW -#endif -BOOL qxeInsertMenu (HMENU hMenu, UINT uPosition, UINT uFlags, UINT uIDNewItem, const Extbyte * lpNewItem); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef AppendMenu -#define AppendMenu error use qxeAppendMenu or AppendMenuA/AppendMenuW -#endif -BOOL qxeAppendMenu (HMENU hMenu, UINT uFlags, UINT uIDNewItem, const Extbyte * lpNewItem); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ModifyMenu -#define ModifyMenu error use qxeModifyMenu or ModifyMenuA/ModifyMenuW -#endif -BOOL qxeModifyMenu (HMENU hMnu, UINT uPosition, UINT uFlags, UINT uIDNewItem, const Extbyte * lpNewItem); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef InsertMenuItem -#define InsertMenuItem error use qxeInsertMenuItem or InsertMenuItemA/InsertMenuItemW -#endif -BOOL qxeInsertMenuItem (HMENU arg1, UINT arg2, BOOL arg3, LPCMENUITEMINFOW arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetMenuItemInfo -#define GetMenuItemInfo error use qxeGetMenuItemInfo or GetMenuItemInfoA/GetMenuItemInfoW -#endif -BOOL qxeGetMenuItemInfo (HMENU arg1, UINT arg2, BOOL arg3, LPMENUITEMINFOW arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SetMenuItemInfo -#define SetMenuItemInfo error use qxeSetMenuItemInfo or SetMenuItemInfoA/SetMenuItemInfoW -#endif -BOOL qxeSetMenuItemInfo (HMENU arg1, UINT arg2, BOOL arg3, LPCMENUITEMINFOW arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DrawText -#define DrawText error use qxeDrawText or DrawTextA/DrawTextW -#endif -int qxeDrawText (HDC hDC, const Extbyte * lpString, int nCount, LPRECT lpRect, UINT uFormat); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DrawTextEx -#define DrawTextEx error use qxeDrawTextEx or DrawTextExA/DrawTextExW -#endif -int qxeDrawTextEx (HDC arg1, Extbyte * arg2, int arg3, LPRECT arg4, UINT arg5, LPDRAWTEXTPARAMS arg6); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GrayString -#define GrayString error use qxeGrayString or GrayStringA/GrayStringW -#endif -BOOL qxeGrayString (HDC hDC, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc, LPARAM lpData, int nCount, int X, int Y, int nWidth, int nHeight); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DrawState -#define DrawState error use qxeDrawState or DrawStateA/DrawStateW -#endif -BOOL qxeDrawState (HDC arg1, HBRUSH arg2, DRAWSTATEPROC arg3, LPARAM arg4, WPARAM arg5, int arg6, int arg7, int arg8, int arg9, UINT arg10); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef TabbedTextOut -#define TabbedTextOut error use qxeTabbedTextOut or TabbedTextOutA/TabbedTextOutW -#endif -LONG qxeTabbedTextOut (HDC hDC, int X, int Y, const Extbyte * lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetTabbedTextExtent -#define GetTabbedTextExtent error use qxeGetTabbedTextExtent or GetTabbedTextExtentA/GetTabbedTextExtentW -#endif -DWORD qxeGetTabbedTextExtent (HDC hDC, const Extbyte * lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SetProp -#define SetProp error use qxeSetProp or SetPropA/SetPropW -#endif -BOOL qxeSetProp (HWND hWnd, const Extbyte * lpString, HANDLE hData); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetProp -#define GetProp error use qxeGetProp or GetPropA/GetPropW -#endif -HANDLE qxeGetProp (HWND hWnd, const Extbyte * lpString); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef RemoveProp -#define RemoveProp error use qxeRemoveProp or RemovePropA/RemovePropW -#endif -HANDLE qxeRemoveProp (HWND hWnd, const Extbyte * lpString); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef EnumPropsEx -#define EnumPropsEx error use qxeEnumPropsEx or EnumPropsExA/EnumPropsExW -#endif -int qxeEnumPropsEx (HWND hWnd, PROPENUMPROCEXW lpEnumFunc, LPARAM lParam); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef EnumProps -#define EnumProps error use qxeEnumProps or EnumPropsA/EnumPropsW -#endif -int qxeEnumProps (HWND hWnd, PROPENUMPROCW lpEnumFunc); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SetWindowText -#define SetWindowText error use qxeSetWindowText or SetWindowTextA/SetWindowTextW -#endif -BOOL qxeSetWindowText (HWND hWnd, const Extbyte * lpString); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetWindowText -#define GetWindowText error use qxeGetWindowText or GetWindowTextA/GetWindowTextW -#endif -int qxeGetWindowText (HWND hWnd, Extbyte * lpString, int nMaxCount); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetWindowTextLength -#define GetWindowTextLength error use qxeGetWindowTextLength or GetWindowTextLengthA/GetWindowTextLengthW -#endif -int qxeGetWindowTextLength (HWND hWnd); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef MessageBox -#define MessageBox error use qxeMessageBox or MessageBoxA/MessageBoxW -#endif -int qxeMessageBox (HWND hWnd, const Extbyte * lpText, const Extbyte * lpCaption, UINT uType); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef MessageBoxEx -#define MessageBoxEx error use qxeMessageBoxEx or MessageBoxExA/MessageBoxExW -#endif -int qxeMessageBoxEx (HWND hWnd, const Extbyte * lpText, const Extbyte * lpCaption, UINT uType, WORD wLanguageId); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef MessageBoxIndirect -#define MessageBoxIndirect error use qxeMessageBoxIndirect or MessageBoxIndirectA/MessageBoxIndirectW -#endif -int qxeMessageBoxIndirect (LPMSGBOXPARAMSW arg1); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetWindowLong -#define GetWindowLong error use qxeGetWindowLong or GetWindowLongA/GetWindowLongW -#endif -LONG qxeGetWindowLong (HWND hWnd, int nIndex); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SetWindowLong -#define SetWindowLong error use qxeSetWindowLong or SetWindowLongA/SetWindowLongW -#endif -LONG qxeSetWindowLong (HWND hWnd, int nIndex, LONG dwNewLong); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetClassLong -#define GetClassLong error use qxeGetClassLong or GetClassLongA/GetClassLongW -#endif -DWORD qxeGetClassLong (HWND hWnd, int nIndex); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SetClassLong -#define SetClassLong error use qxeSetClassLong or SetClassLongA/SetClassLongW -#endif -DWORD qxeSetClassLong (HWND hWnd, int nIndex, LONG dwNewLong); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef FindWindow -#define FindWindow error use qxeFindWindow or FindWindowA/FindWindowW -#endif -HWND qxeFindWindow (const Extbyte * lpClassName, const Extbyte * lpWindowName); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef FindWindowEx -#define FindWindowEx error use qxeFindWindowEx or FindWindowExA/FindWindowExW -#endif -HWND qxeFindWindowEx (HWND arg1, HWND arg2, const Extbyte * arg3, const Extbyte * arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetClassName -#define GetClassName error use qxeGetClassName or GetClassNameA/GetClassNameW -#endif -int qxeGetClassName (HWND hWnd, Extbyte * lpClassName, int nMaxCount); - -#undef SetWindowsHook -#define SetWindowsHook error obsolete; two versions, STRICT and non-STRICT - -#undef SetWindowsHook -#define SetWindowsHook error obsolete; two versions, STRICT and non-STRICT - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SetWindowsHookEx -#define SetWindowsHookEx error use qxeSetWindowsHookEx or SetWindowsHookExA/SetWindowsHookExW -#endif -HHOOK qxeSetWindowsHookEx (int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadId); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef LoadBitmap -#define LoadBitmap error use qxeLoadBitmap or LoadBitmapA/LoadBitmapW -#endif -HBITMAP qxeLoadBitmap (HINSTANCE hInstance, const Extbyte * lpBitmapName); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef LoadCursor -#define LoadCursor error use qxeLoadCursor or LoadCursorA/LoadCursorW -#endif -HCURSOR qxeLoadCursor (HINSTANCE hInstance, const Extbyte * lpCursorName); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef LoadCursorFromFile -#define LoadCursorFromFile error use qxeLoadCursorFromFile or LoadCursorFromFileA/LoadCursorFromFileW -#endif -HCURSOR qxeLoadCursorFromFile (const Extbyte * lpFileName); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef LoadIcon -#define LoadIcon error use qxeLoadIcon or LoadIconA/LoadIconW -#endif -HICON qxeLoadIcon (HINSTANCE hInstance, const Extbyte * lpIconName); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef LoadImage -#define LoadImage error use qxeLoadImage or LoadImageA/LoadImageW -#endif -HANDLE qxeLoadImage (HINSTANCE arg1, const Extbyte * arg2, UINT arg3, int arg4, int arg5, UINT arg6); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef LoadString -#define LoadString error use qxeLoadString or LoadStringA/LoadStringW -#endif -int qxeLoadString (HINSTANCE hInstance, UINT uID, Extbyte * lpBuffer, int nBufferMax); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef IsDialogMessage -#define IsDialogMessage error use qxeIsDialogMessage or IsDialogMessageA/IsDialogMessageW -#endif -BOOL qxeIsDialogMessage (HWND hDlg, LPMSG lpMsg); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DlgDirList -#define DlgDirList error use qxeDlgDirList or DlgDirListA/DlgDirListW -#endif -int qxeDlgDirList (HWND hDlg, Extbyte * lpPathSpec, int nIDListBox, int nIDStaticPath, UINT uFileType); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DlgDirSelectEx -#define DlgDirSelectEx error use qxeDlgDirSelectEx or DlgDirSelectExA/DlgDirSelectExW -#endif -BOOL qxeDlgDirSelectEx (HWND hDlg, Extbyte * lpString, int nCount, int nIDListBox); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DlgDirListComboBox -#define DlgDirListComboBox error use qxeDlgDirListComboBox or DlgDirListComboBoxA/DlgDirListComboBoxW -#endif -int qxeDlgDirListComboBox (HWND hDlg, Extbyte * lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT uFiletype); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DlgDirSelectComboBoxEx -#define DlgDirSelectComboBoxEx error use qxeDlgDirSelectComboBoxEx or DlgDirSelectComboBoxExA/DlgDirSelectComboBoxExW -#endif -BOOL qxeDlgDirSelectComboBoxEx (HWND hDlg, Extbyte * lpString, int nCount, int nIDComboBox); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef DefFrameProc -#define DefFrameProc error use qxeDefFrameProc or DefFrameProcA/DefFrameProcW -#endif -LRESULT qxeDefFrameProc (HWND hWnd, HWND hWndMDIClient, UINT uMsg, WPARAM wParam, LPARAM lParam); - -#undef DefMDIChildProc -#define DefMDIChildProc error return value is conditionalized on _MAC, messes up parser - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CreateMDIWindow -#define CreateMDIWindow error use qxeCreateMDIWindow or CreateMDIWindowA/CreateMDIWindowW -#endif -HWND qxeCreateMDIWindow (Extbyte * lpClassName, Extbyte * lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HINSTANCE hInstance, LPARAM lParam); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef WinHelp -#define WinHelp error use qxeWinHelp or WinHelpA/WinHelpW -#endif -BOOL qxeWinHelp (HWND hWndMain, const Extbyte * lpszHelp, UINT uCommand, DWORD dwData); - -#undef ChangeDisplaySettings -#define ChangeDisplaySettings error split-sized LPDEVMODE - -#undef ChangeDisplaySettingsEx -#define ChangeDisplaySettingsEx error split-sized LPDEVMODE; NT 5.0/Win98+ only - -#undef EnumDisplaySettings -#define EnumDisplaySettings error split-sized LPDEVMODE - -#undef EnumDisplayDevices -#define EnumDisplayDevices error split-sized PDISPLAY_DEVICE; NT 5.0+ only, no Win98 - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SystemParametersInfo -#define SystemParametersInfo error use qxeSystemParametersInfo or SystemParametersInfoA/SystemParametersInfoW -#endif -BOOL qxeSystemParametersInfo (UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni); - -#undef GetMonitorInfo -#define GetMonitorInfo error NT 5.0/Win98+ only - -#undef GetWindowModuleFileName -#define GetWindowModuleFileName error NT 5.0+ only - -#undef RealGetWindowClass -#define RealGetWindowClass error NT 5.0+ only - -#undef GetAltTabInfo -#define GetAltTabInfo error NT 5.0+ only - - -/* Processing file MMSYSTEM.H */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef sndPlaySound -#define sndPlaySound error use qxesndPlaySound or sndPlaySoundA/sndPlaySoundW -#endif -BOOL qxesndPlaySound (const Extbyte * pszSound, UINT fuSound); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef PlaySound -#define PlaySound error use qxePlaySound or PlaySoundA/PlaySoundW -#endif -BOOL qxePlaySound (const Extbyte * pszSound, HMODULE hmod, DWORD fdwSound); - -#undef waveOutGetDevCaps -#define waveOutGetDevCaps error split-sized LPWAVEOUTCAPS - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef waveOutGetErrorText -#define waveOutGetErrorText error use qxewaveOutGetErrorText or waveOutGetErrorTextA/waveOutGetErrorTextW -#endif -MMRESULT qxewaveOutGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText); - -#undef waveInGetDevCaps -#define waveInGetDevCaps error split-sized LPWAVEINCAPS - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef waveInGetErrorText -#define waveInGetErrorText error use qxewaveInGetErrorText or waveInGetErrorTextA/waveInGetErrorTextW -#endif -MMRESULT qxewaveInGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText); - -#undef midiOutGetDevCaps -#define midiOutGetDevCaps error split-sized LPMIDIOUTCAPS - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef midiOutGetErrorText -#define midiOutGetErrorText error use qxemidiOutGetErrorText or midiOutGetErrorTextA/midiOutGetErrorTextW -#endif -MMRESULT qxemidiOutGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText); - -#undef midiInGetDevCaps -#define midiInGetDevCaps error split-sized LPMIDIOUTCAPS - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef midiInGetErrorText -#define midiInGetErrorText error use qxemidiInGetErrorText or midiInGetErrorTextA/midiInGetErrorTextW -#endif -MMRESULT qxemidiInGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText); - -#undef auxGetDevCaps -#define auxGetDevCaps error split-sized LPAUXCAPS - -#undef mixerGetDevCaps -#define mixerGetDevCaps error split-sized LPMIXERCAPS - -#undef mixerGetLineInfo -#define mixerGetLineInfo error split-sized LPMIXERLINE - -#undef mixerGetLineControls -#define mixerGetLineControls error split-sized LPMIXERCONTROL - -#undef mixerGetControlDetails -#define mixerGetControlDetails error split-sized LPMIXERCONTROL in LPMIXERLINECONTROLS in LPMIXERCONTROLDETAILS - -#undef joyGetDevCaps -#define joyGetDevCaps error split-sized LPJOYCAPS - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef mmioStringToFOURCC -#define mmioStringToFOURCC error use qxemmioStringToFOURCC or mmioStringToFOURCCA/mmioStringToFOURCCW -#endif -FOURCC qxemmioStringToFOURCC (const Extbyte * sz, UINT uFlags); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef mmioInstallIOProc -#define mmioInstallIOProc error use qxemmioInstallIOProc or mmioInstallIOProcA/mmioInstallIOProcW -#endif -LPMMIOPROC qxemmioInstallIOProc (FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef mmioOpen -#define mmioOpen error use qxemmioOpen or mmioOpenA/mmioOpenW -#endif -HMMIO qxemmioOpen (Extbyte * pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef mmioRename -#define mmioRename error use qxemmioRename or mmioRenameA/mmioRenameW -#endif -MMRESULT qxemmioRename (const Extbyte * pszFileName, const Extbyte * pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef mciSendCommand -#define mciSendCommand error use qxemciSendCommand or mciSendCommandA/mciSendCommandW -#endif -MCIERROR qxemciSendCommand (MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef mciSendString -#define mciSendString error use qxemciSendString or mciSendStringA/mciSendStringW -#endif -MCIERROR qxemciSendString (const Extbyte * lpstrCommand, Extbyte * lpstrReturnString, UINT uReturnLength, HWND hwndCallback); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef mciGetDeviceID -#define mciGetDeviceID error use qxemciGetDeviceID or mciGetDeviceIDA/mciGetDeviceIDW -#endif -MCIDEVICEID qxemciGetDeviceID (const Extbyte * pszDevice); - -#if !defined (MINGW) -#undef mciGetDeviceIDFromElementID -#define mciGetDeviceIDFromElementID error missing from Win98se version of ADVAPI32.dll -#endif /* !defined (MINGW) */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef mciGetErrorString -#define mciGetErrorString error use qxemciGetErrorString or mciGetErrorStringA/mciGetErrorStringW -#endif -BOOL qxemciGetErrorString (MCIERROR mcierr, Extbyte * pszText, UINT cchText); - - /* Processing file WINBASE.H */ #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetBinaryType -#define GetBinaryType error use qxeGetBinaryType or GetBinaryTypeA/GetBinaryTypeW +#define GetBinaryType error_use_qxeGetBinaryType_or_GetBinaryTypeA_and_GetBinaryTypeW #endif BOOL qxeGetBinaryType (const Extbyte * lpApplicationName, LPDWORD lpBinaryType); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetShortPathName -#define GetShortPathName error use qxeGetShortPathName or GetShortPathNameA/GetShortPathNameW +#define GetShortPathName error_use_qxeGetShortPathName_or_GetShortPathNameA_and_GetShortPathNameW #endif DWORD qxeGetShortPathName (const Extbyte * lpszLongPath, Extbyte * lpszShortPath, DWORD cchBuffer); #undef GetLongPathName -#define GetLongPathName error Win98/2K+ only +#define GetLongPathName error_Win98_2K__only /* Skipping GetEnvironmentStrings because misnamed ANSI version of the function */ #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef FreeEnvironmentStrings -#define FreeEnvironmentStrings error use qxeFreeEnvironmentStrings or FreeEnvironmentStringsA/FreeEnvironmentStringsW +#define FreeEnvironmentStrings error_use_qxeFreeEnvironmentStrings_or_FreeEnvironmentStringsA_and_FreeEnvironmentStringsW #endif BOOL qxeFreeEnvironmentStrings (Extbyte * arg1); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef FormatMessage -#define FormatMessage error use qxeFormatMessage or FormatMessageA/FormatMessageW +#define FormatMessage error_use_qxeFormatMessage_or_FormatMessageA_and_FormatMessageW #endif DWORD qxeFormatMessage (DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, Extbyte * lpBuffer, DWORD nSize, va_list * Arguments); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CreateMailslot -#define CreateMailslot error use qxeCreateMailslot or CreateMailslotA/CreateMailslotW +#define CreateMailslot error_use_qxeCreateMailslot_or_CreateMailslotA_and_CreateMailslotW #endif HANDLE qxeCreateMailslot (const Extbyte * lpName, DWORD nMaxMessageSize, DWORD lReadTimeout, LPSECURITY_ATTRIBUTES lpSecurityAttributes); #if !defined (CYGWIN_HEADERS) #undef EncryptFile -#define EncryptFile error Win2K+ only +#define EncryptFile error_Win2K__only #endif /* !defined (CYGWIN_HEADERS) */ #if !defined (CYGWIN_HEADERS) #undef DecryptFile -#define DecryptFile error Win2K+ only +#define DecryptFile error_Win2K__only #endif /* !defined (CYGWIN_HEADERS) */ #undef OpenRaw -#define OpenRaw error error "The procedure entry point OpenRawW could not be located in the dynamic link library ADVAPI32.dll." +#define OpenRaw error_error__The_procedure_entry_point_OpenRawW_could_not_be_located_in_the_dynamic_link_library_ADVAPI32_dll__ #undef QueryRecoveryAgents -#define QueryRecoveryAgents error split-sized LPRECOVERY_AGENT_INFORMATION +#define QueryRecoveryAgents error_split_sized_LPRECOVERY_AGENT_INFORMATION #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef lstrcmp -#define lstrcmp error use qxelstrcmp or lstrcmpA/lstrcmpW +#define lstrcmp error_use_qxelstrcmp_or_lstrcmpA_and_lstrcmpW #endif int qxelstrcmp (const Extbyte * lpString1, const Extbyte * lpString2); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef lstrcmpi -#define lstrcmpi error use qxelstrcmpi or lstrcmpiA/lstrcmpiW +#define lstrcmpi error_use_qxelstrcmpi_or_lstrcmpiA_and_lstrcmpiW #endif int qxelstrcmpi (const Extbyte * lpString1, const Extbyte * lpString2); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef lstrcpyn -#define lstrcpyn error use qxelstrcpyn or lstrcpynA/lstrcpynW +#define lstrcpyn error_use_qxelstrcpyn_or_lstrcpynA_and_lstrcpynW #endif Extbyte * qxelstrcpyn (Extbyte * lpString1, const Extbyte * lpString2, int iMaxLength); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef lstrcpy -#define lstrcpy error use qxelstrcpy or lstrcpyA/lstrcpyW +#define lstrcpy error_use_qxelstrcpy_or_lstrcpyA_and_lstrcpyW #endif Extbyte * qxelstrcpy (Extbyte * lpString1, const Extbyte * lpString2); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef lstrcat -#define lstrcat error use qxelstrcat or lstrcatA/lstrcatW +#define lstrcat error_use_qxelstrcat_or_lstrcatA_and_lstrcatW #endif Extbyte * qxelstrcat (Extbyte * lpString1, const Extbyte * lpString2); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef lstrlen -#define lstrlen error use qxelstrlen or lstrlenA/lstrlenW +#define lstrlen error_use_qxelstrlen_or_lstrlenA_and_lstrlenW #endif int qxelstrlen (const Extbyte * lpString); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CreateMutex -#define CreateMutex error use qxeCreateMutex or CreateMutexA/CreateMutexW +#define CreateMutex error_use_qxeCreateMutex_or_CreateMutexA_and_CreateMutexW #endif HANDLE qxeCreateMutex (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, const Extbyte * lpName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef OpenMutex -#define OpenMutex error use qxeOpenMutex or OpenMutexA/OpenMutexW +#define OpenMutex error_use_qxeOpenMutex_or_OpenMutexA_and_OpenMutexW #endif HANDLE qxeOpenMutex (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CreateEvent -#define CreateEvent error use qxeCreateEvent or CreateEventA/CreateEventW +#define CreateEvent error_use_qxeCreateEvent_or_CreateEventA_and_CreateEventW #endif HANDLE qxeCreateEvent (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, const Extbyte * lpName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef OpenEvent -#define OpenEvent error use qxeOpenEvent or OpenEventA/OpenEventW +#define OpenEvent error_use_qxeOpenEvent_or_OpenEventA_and_OpenEventW #endif HANDLE qxeOpenEvent (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CreateSemaphore -#define CreateSemaphore error use qxeCreateSemaphore or CreateSemaphoreA/CreateSemaphoreW +#define CreateSemaphore error_use_qxeCreateSemaphore_or_CreateSemaphoreA_and_CreateSemaphoreW #endif HANDLE qxeCreateSemaphore (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, const Extbyte * lpName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef OpenSemaphore -#define OpenSemaphore error use qxeOpenSemaphore or OpenSemaphoreA/OpenSemaphoreW +#define OpenSemaphore error_use_qxeOpenSemaphore_or_OpenSemaphoreA_and_OpenSemaphoreW #endif HANDLE qxeOpenSemaphore (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CreateWaitableTimer -#define CreateWaitableTimer error use qxeCreateWaitableTimer or CreateWaitableTimerA/CreateWaitableTimerW +#define CreateWaitableTimer error_use_qxeCreateWaitableTimer_or_CreateWaitableTimerA_and_CreateWaitableTimerW #endif HANDLE qxeCreateWaitableTimer (LPSECURITY_ATTRIBUTES lpTimerAttributes, BOOL bManualReset, const Extbyte * lpTimerName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef OpenWaitableTimer -#define OpenWaitableTimer error use qxeOpenWaitableTimer or OpenWaitableTimerA/OpenWaitableTimerW +#define OpenWaitableTimer error_use_qxeOpenWaitableTimer_or_OpenWaitableTimerA_and_OpenWaitableTimerW #endif HANDLE qxeOpenWaitableTimer (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpTimerName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CreateFileMapping -#define CreateFileMapping error use qxeCreateFileMapping or CreateFileMappingA/CreateFileMappingW +#define CreateFileMapping error_use_qxeCreateFileMapping_or_CreateFileMappingA_and_CreateFileMappingW #endif HANDLE qxeCreateFileMapping (HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, const Extbyte * lpName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef OpenFileMapping -#define OpenFileMapping error use qxeOpenFileMapping or OpenFileMappingA/OpenFileMappingW +#define OpenFileMapping error_use_qxeOpenFileMapping_or_OpenFileMappingA_and_OpenFileMappingW #endif HANDLE qxeOpenFileMapping (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetLogicalDriveStrings -#define GetLogicalDriveStrings error use qxeGetLogicalDriveStrings or GetLogicalDriveStringsA/GetLogicalDriveStringsW +#define GetLogicalDriveStrings error_use_qxeGetLogicalDriveStrings_or_GetLogicalDriveStringsA_and_GetLogicalDriveStringsW #endif DWORD qxeGetLogicalDriveStrings (DWORD nBufferLength, Extbyte * lpBuffer); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef LoadLibrary -#define LoadLibrary error use qxeLoadLibrary or LoadLibraryA/LoadLibraryW +#define LoadLibrary error_use_qxeLoadLibrary_or_LoadLibraryA_and_LoadLibraryW #endif HMODULE qxeLoadLibrary (const Extbyte * lpLibFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef LoadLibraryEx -#define LoadLibraryEx error use qxeLoadLibraryEx or LoadLibraryExA/LoadLibraryExW +#define LoadLibraryEx error_use_qxeLoadLibraryEx_or_LoadLibraryExA_and_LoadLibraryExW #endif HMODULE qxeLoadLibraryEx (const Extbyte * lpLibFileName, HANDLE hFile, DWORD dwFlags); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetModuleFileName -#define GetModuleFileName error use qxeGetModuleFileName or GetModuleFileNameA/GetModuleFileNameW +#define GetModuleFileName error_use_qxeGetModuleFileName_or_GetModuleFileNameA_and_GetModuleFileNameW #endif DWORD qxeGetModuleFileName (HMODULE hModule, Extbyte * lpFilename, DWORD nSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetModuleHandle -#define GetModuleHandle error use qxeGetModuleHandle or GetModuleHandleA/GetModuleHandleW +#define GetModuleHandle error_use_qxeGetModuleHandle_or_GetModuleHandleA_and_GetModuleHandleW #endif HMODULE qxeGetModuleHandle (const Extbyte * lpModuleName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CreateProcess -#define CreateProcess error use qxeCreateProcess or CreateProcessA/CreateProcessW +#define CreateProcess error_use_qxeCreateProcess_or_CreateProcessA_and_CreateProcessW #endif BOOL qxeCreateProcess (const Extbyte * lpApplicationName, Extbyte * lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, const Extbyte * lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef FatalAppExit -#define FatalAppExit error use qxeFatalAppExit or FatalAppExitA/FatalAppExitW +#define FatalAppExit error_use_qxeFatalAppExit_or_FatalAppExitA_and_FatalAppExitW #endif VOID qxeFatalAppExit (UINT uAction, const Extbyte * lpMessageText); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetStartupInfo -#define GetStartupInfo error use qxeGetStartupInfo or GetStartupInfoA/GetStartupInfoW +#define GetStartupInfo error_use_qxeGetStartupInfo_or_GetStartupInfoA_and_GetStartupInfoW #endif VOID qxeGetStartupInfo (LPSTARTUPINFOW lpStartupInfo); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetCommandLine -#define GetCommandLine error use qxeGetCommandLine or GetCommandLineA/GetCommandLineW +#define GetCommandLine error_use_qxeGetCommandLine_or_GetCommandLineA_and_GetCommandLineW #endif Extbyte * qxeGetCommandLine (void); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetEnvironmentVariable -#define GetEnvironmentVariable error use qxeGetEnvironmentVariable or GetEnvironmentVariableA/GetEnvironmentVariableW +#define GetEnvironmentVariable error_use_qxeGetEnvironmentVariable_or_GetEnvironmentVariableA_and_GetEnvironmentVariableW #endif DWORD qxeGetEnvironmentVariable (const Extbyte * lpName, Extbyte * lpBuffer, DWORD nSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef SetEnvironmentVariable -#define SetEnvironmentVariable error use qxeSetEnvironmentVariable or SetEnvironmentVariableA/SetEnvironmentVariableW +#define SetEnvironmentVariable error_use_qxeSetEnvironmentVariable_or_SetEnvironmentVariableA_and_SetEnvironmentVariableW #endif BOOL qxeSetEnvironmentVariable (const Extbyte * lpName, const Extbyte * lpValue); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ExpandEnvironmentStrings -#define ExpandEnvironmentStrings error use qxeExpandEnvironmentStrings or ExpandEnvironmentStringsA/ExpandEnvironmentStringsW +#define ExpandEnvironmentStrings error_use_qxeExpandEnvironmentStrings_or_ExpandEnvironmentStringsA_and_ExpandEnvironmentStringsW #endif DWORD qxeExpandEnvironmentStrings (const Extbyte * lpSrc, Extbyte * lpDst, DWORD nSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef OutputDebugString -#define OutputDebugString error use qxeOutputDebugString or OutputDebugStringA/OutputDebugStringW +#define OutputDebugString error_use_qxeOutputDebugString_or_OutputDebugStringA_and_OutputDebugStringW #endif VOID qxeOutputDebugString (const Extbyte * lpOutputString); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef FindResource -#define FindResource error use qxeFindResource or FindResourceA/FindResourceW +#define FindResource error_use_qxeFindResource_or_FindResourceA_and_FindResourceW #endif HRSRC qxeFindResource (HMODULE hModule, const Extbyte * lpName, const Extbyte * lpType); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef FindResourceEx -#define FindResourceEx error use qxeFindResourceEx or FindResourceExA/FindResourceExW +#define FindResourceEx error_use_qxeFindResourceEx_or_FindResourceExA_and_FindResourceExW #endif HRSRC qxeFindResourceEx (HMODULE hModule, const Extbyte * lpType, const Extbyte * lpName, WORD wLanguage); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef EnumResourceTypes -#define EnumResourceTypes error use qxeEnumResourceTypes or EnumResourceTypesA/EnumResourceTypesW +#define EnumResourceTypes error_use_qxeEnumResourceTypes_or_EnumResourceTypesA_and_EnumResourceTypesW #endif BOOL qxeEnumResourceTypes (HMODULE hModule, ENUMRESTYPEPROC lpEnumFunc, LONG lParam); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef EnumResourceNames -#define EnumResourceNames error use qxeEnumResourceNames or EnumResourceNamesA/EnumResourceNamesW +#define EnumResourceNames error_use_qxeEnumResourceNames_or_EnumResourceNamesA_and_EnumResourceNamesW #endif BOOL qxeEnumResourceNames (HMODULE hModule, const Extbyte * lpType, ENUMRESNAMEPROC lpEnumFunc, LONG lParam); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef EnumResourceLanguages -#define EnumResourceLanguages error use qxeEnumResourceLanguages or EnumResourceLanguagesA/EnumResourceLanguagesW +#define EnumResourceLanguages error_use_qxeEnumResourceLanguages_or_EnumResourceLanguagesA_and_EnumResourceLanguagesW #endif BOOL qxeEnumResourceLanguages (HMODULE hModule, const Extbyte * lpType, const Extbyte * lpName, ENUMRESLANGPROC lpEnumFunc, LONG lParam); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef BeginUpdateResource -#define BeginUpdateResource error use qxeBeginUpdateResource or BeginUpdateResourceA/BeginUpdateResourceW +#define BeginUpdateResource error_use_qxeBeginUpdateResource_or_BeginUpdateResourceA_and_BeginUpdateResourceW #endif HANDLE qxeBeginUpdateResource (const Extbyte * pFileName, BOOL bDeleteExistingResources); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef UpdateResource -#define UpdateResource error use qxeUpdateResource or UpdateResourceA/UpdateResourceW +#define UpdateResource error_use_qxeUpdateResource_or_UpdateResourceA_and_UpdateResourceW #endif BOOL qxeUpdateResource (HANDLE hUpdate, const Extbyte * lpType, const Extbyte * lpName, WORD wLanguage, LPVOID lpData, DWORD cbData); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef EndUpdateResource -#define EndUpdateResource error use qxeEndUpdateResource or EndUpdateResourceA/EndUpdateResourceW +#define EndUpdateResource error_use_qxeEndUpdateResource_or_EndUpdateResourceA_and_EndUpdateResourceW #endif BOOL qxeEndUpdateResource (HANDLE hUpdate, BOOL fDiscard); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GlobalAddAtom -#define GlobalAddAtom error use qxeGlobalAddAtom or GlobalAddAtomA/GlobalAddAtomW +#define GlobalAddAtom error_use_qxeGlobalAddAtom_or_GlobalAddAtomA_and_GlobalAddAtomW #endif ATOM qxeGlobalAddAtom (const Extbyte * lpString); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GlobalFindAtom -#define GlobalFindAtom error use qxeGlobalFindAtom or GlobalFindAtomA/GlobalFindAtomW +#define GlobalFindAtom error_use_qxeGlobalFindAtom_or_GlobalFindAtomA_and_GlobalFindAtomW #endif ATOM qxeGlobalFindAtom (const Extbyte * lpString); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GlobalGetAtomName -#define GlobalGetAtomName error use qxeGlobalGetAtomName or GlobalGetAtomNameA/GlobalGetAtomNameW +#define GlobalGetAtomName error_use_qxeGlobalGetAtomName_or_GlobalGetAtomNameA_and_GlobalGetAtomNameW #endif UINT qxeGlobalGetAtomName (ATOM nAtom, Extbyte * lpBuffer, int nSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef AddAtom -#define AddAtom error use qxeAddAtom or AddAtomA/AddAtomW +#define AddAtom error_use_qxeAddAtom_or_AddAtomA_and_AddAtomW #endif ATOM qxeAddAtom (const Extbyte * lpString); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef FindAtom -#define FindAtom error use qxeFindAtom or FindAtomA/FindAtomW +#define FindAtom error_use_qxeFindAtom_or_FindAtomA_and_FindAtomW #endif ATOM qxeFindAtom (const Extbyte * lpString); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetAtomName -#define GetAtomName error use qxeGetAtomName or GetAtomNameA/GetAtomNameW +#define GetAtomName error_use_qxeGetAtomName_or_GetAtomNameA_and_GetAtomNameW #endif UINT qxeGetAtomName (ATOM nAtom, Extbyte * lpBuffer, int nSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetProfileInt -#define GetProfileInt error use qxeGetProfileInt or GetProfileIntA/GetProfileIntW +#define GetProfileInt error_use_qxeGetProfileInt_or_GetProfileIntA_and_GetProfileIntW #endif UINT qxeGetProfileInt (const Extbyte * lpAppName, const Extbyte * lpKeyName, INT nDefault); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetProfileString -#define GetProfileString error use qxeGetProfileString or GetProfileStringA/GetProfileStringW +#define GetProfileString error_use_qxeGetProfileString_or_GetProfileStringA_and_GetProfileStringW #endif DWORD qxeGetProfileString (const Extbyte * lpAppName, const Extbyte * lpKeyName, const Extbyte * lpDefault, Extbyte * lpReturnedString, DWORD nSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WriteProfileString -#define WriteProfileString error use qxeWriteProfileString or WriteProfileStringA/WriteProfileStringW +#define WriteProfileString error_use_qxeWriteProfileString_or_WriteProfileStringA_and_WriteProfileStringW #endif BOOL qxeWriteProfileString (const Extbyte * lpAppName, const Extbyte * lpKeyName, const Extbyte * lpString); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetProfileSection -#define GetProfileSection error use qxeGetProfileSection or GetProfileSectionA/GetProfileSectionW +#define GetProfileSection error_use_qxeGetProfileSection_or_GetProfileSectionA_and_GetProfileSectionW #endif DWORD qxeGetProfileSection (const Extbyte * lpAppName, Extbyte * lpReturnedString, DWORD nSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WriteProfileSection -#define WriteProfileSection error use qxeWriteProfileSection or WriteProfileSectionA/WriteProfileSectionW +#define WriteProfileSection error_use_qxeWriteProfileSection_or_WriteProfileSectionA_and_WriteProfileSectionW #endif BOOL qxeWriteProfileSection (const Extbyte * lpAppName, const Extbyte * lpString); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetPrivateProfileInt -#define GetPrivateProfileInt error use qxeGetPrivateProfileInt or GetPrivateProfileIntA/GetPrivateProfileIntW +#define GetPrivateProfileInt error_use_qxeGetPrivateProfileInt_or_GetPrivateProfileIntA_and_GetPrivateProfileIntW #endif UINT qxeGetPrivateProfileInt (const Extbyte * lpAppName, const Extbyte * lpKeyName, INT nDefault, const Extbyte * lpFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetPrivateProfileString -#define GetPrivateProfileString error use qxeGetPrivateProfileString or GetPrivateProfileStringA/GetPrivateProfileStringW +#define GetPrivateProfileString error_use_qxeGetPrivateProfileString_or_GetPrivateProfileStringA_and_GetPrivateProfileStringW #endif DWORD qxeGetPrivateProfileString (const Extbyte * lpAppName, const Extbyte * lpKeyName, const Extbyte * lpDefault, Extbyte * lpReturnedString, DWORD nSize, const Extbyte * lpFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WritePrivateProfileString -#define WritePrivateProfileString error use qxeWritePrivateProfileString or WritePrivateProfileStringA/WritePrivateProfileStringW +#define WritePrivateProfileString error_use_qxeWritePrivateProfileString_or_WritePrivateProfileStringA_and_WritePrivateProfileStringW #endif BOOL qxeWritePrivateProfileString (const Extbyte * lpAppName, const Extbyte * lpKeyName, const Extbyte * lpString, const Extbyte * lpFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetPrivateProfileSection -#define GetPrivateProfileSection error use qxeGetPrivateProfileSection or GetPrivateProfileSectionA/GetPrivateProfileSectionW +#define GetPrivateProfileSection error_use_qxeGetPrivateProfileSection_or_GetPrivateProfileSectionA_and_GetPrivateProfileSectionW #endif DWORD qxeGetPrivateProfileSection (const Extbyte * lpAppName, Extbyte * lpReturnedString, DWORD nSize, const Extbyte * lpFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WritePrivateProfileSection -#define WritePrivateProfileSection error use qxeWritePrivateProfileSection or WritePrivateProfileSectionA/WritePrivateProfileSectionW +#define WritePrivateProfileSection error_use_qxeWritePrivateProfileSection_or_WritePrivateProfileSectionA_and_WritePrivateProfileSectionW #endif BOOL qxeWritePrivateProfileSection (const Extbyte * lpAppName, const Extbyte * lpString, const Extbyte * lpFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetPrivateProfileSectionNames -#define GetPrivateProfileSectionNames error use qxeGetPrivateProfileSectionNames or GetPrivateProfileSectionNamesA/GetPrivateProfileSectionNamesW +#define GetPrivateProfileSectionNames error_use_qxeGetPrivateProfileSectionNames_or_GetPrivateProfileSectionNamesA_and_GetPrivateProfileSectionNamesW #endif DWORD qxeGetPrivateProfileSectionNames (Extbyte * lpszReturnBuffer, DWORD nSize, const Extbyte * lpFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetPrivateProfileStruct -#define GetPrivateProfileStruct error use qxeGetPrivateProfileStruct or GetPrivateProfileStructA/GetPrivateProfileStructW +#define GetPrivateProfileStruct error_use_qxeGetPrivateProfileStruct_or_GetPrivateProfileStructA_and_GetPrivateProfileStructW #endif BOOL qxeGetPrivateProfileStruct (const Extbyte * lpszSection, const Extbyte * lpszKey, LPVOID lpStruct, UINT uSizeStruct, const Extbyte * szFile); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WritePrivateProfileStruct -#define WritePrivateProfileStruct error use qxeWritePrivateProfileStruct or WritePrivateProfileStructA/WritePrivateProfileStructW +#define WritePrivateProfileStruct error_use_qxeWritePrivateProfileStruct_or_WritePrivateProfileStructA_and_WritePrivateProfileStructW #endif BOOL qxeWritePrivateProfileStruct (const Extbyte * lpszSection, const Extbyte * lpszKey, LPVOID lpStruct, UINT uSizeStruct, const Extbyte * szFile); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetDriveType -#define GetDriveType error use qxeGetDriveType or GetDriveTypeA/GetDriveTypeW +#define GetDriveType error_use_qxeGetDriveType_or_GetDriveTypeA_and_GetDriveTypeW #endif UINT qxeGetDriveType (const Extbyte * lpRootPathName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetSystemDirectory -#define GetSystemDirectory error use qxeGetSystemDirectory or GetSystemDirectoryA/GetSystemDirectoryW +#define GetSystemDirectory error_use_qxeGetSystemDirectory_or_GetSystemDirectoryA_and_GetSystemDirectoryW #endif UINT qxeGetSystemDirectory (Extbyte * lpBuffer, UINT uSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetTempPath -#define GetTempPath error use qxeGetTempPath or GetTempPathA/GetTempPathW +#define GetTempPath error_use_qxeGetTempPath_or_GetTempPathA_and_GetTempPathW #endif DWORD qxeGetTempPath (DWORD nBufferLength, Extbyte * lpBuffer); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetTempFileName -#define GetTempFileName error use qxeGetTempFileName or GetTempFileNameA/GetTempFileNameW +#define GetTempFileName error_use_qxeGetTempFileName_or_GetTempFileNameA_and_GetTempFileNameW #endif UINT qxeGetTempFileName (const Extbyte * lpPathName, const Extbyte * lpPrefixString, UINT uUnique, Extbyte * lpTempFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetWindowsDirectory -#define GetWindowsDirectory error use qxeGetWindowsDirectory or GetWindowsDirectoryA/GetWindowsDirectoryW +#define GetWindowsDirectory error_use_qxeGetWindowsDirectory_or_GetWindowsDirectoryA_and_GetWindowsDirectoryW #endif UINT qxeGetWindowsDirectory (Extbyte * lpBuffer, UINT uSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef SetCurrentDirectory -#define SetCurrentDirectory error use qxeSetCurrentDirectory or SetCurrentDirectoryA/SetCurrentDirectoryW +#define SetCurrentDirectory error_use_qxeSetCurrentDirectory_or_SetCurrentDirectoryA_and_SetCurrentDirectoryW #endif BOOL qxeSetCurrentDirectory (const Extbyte * lpPathName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetCurrentDirectory -#define GetCurrentDirectory error use qxeGetCurrentDirectory or GetCurrentDirectoryA/GetCurrentDirectoryW +#define GetCurrentDirectory error_use_qxeGetCurrentDirectory_or_GetCurrentDirectoryA_and_GetCurrentDirectoryW #endif DWORD qxeGetCurrentDirectory (DWORD nBufferLength, Extbyte * lpBuffer); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetDiskFreeSpace -#define GetDiskFreeSpace error use qxeGetDiskFreeSpace or GetDiskFreeSpaceA/GetDiskFreeSpaceW +#define GetDiskFreeSpace error_use_qxeGetDiskFreeSpace_or_GetDiskFreeSpaceA_and_GetDiskFreeSpaceW #endif BOOL qxeGetDiskFreeSpace (const Extbyte * lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetDiskFreeSpaceEx -#define GetDiskFreeSpaceEx error use qxeGetDiskFreeSpaceEx or GetDiskFreeSpaceExA/GetDiskFreeSpaceExW +#define GetDiskFreeSpaceEx error_use_qxeGetDiskFreeSpaceEx_or_GetDiskFreeSpaceExA_and_GetDiskFreeSpaceExW #endif BOOL qxeGetDiskFreeSpaceEx (const Extbyte * lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailableToCaller, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CreateDirectory -#define CreateDirectory error use qxeCreateDirectory or CreateDirectoryA/CreateDirectoryW +#define CreateDirectory error_use_qxeCreateDirectory_or_CreateDirectoryA_and_CreateDirectoryW #endif BOOL qxeCreateDirectory (const Extbyte * lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CreateDirectoryEx -#define CreateDirectoryEx error use qxeCreateDirectoryEx or CreateDirectoryExA/CreateDirectoryExW +#define CreateDirectoryEx error_use_qxeCreateDirectoryEx_or_CreateDirectoryExA_and_CreateDirectoryExW #endif BOOL qxeCreateDirectoryEx (const Extbyte * lpTemplateDirectory, const Extbyte * lpNewDirectory, LPSECURITY_ATTRIBUTES lpSecurityAttributes); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RemoveDirectory -#define RemoveDirectory error use qxeRemoveDirectory or RemoveDirectoryA/RemoveDirectoryW +#define RemoveDirectory error_use_qxeRemoveDirectory_or_RemoveDirectoryA_and_RemoveDirectoryW #endif BOOL qxeRemoveDirectory (const Extbyte * lpPathName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetFullPathName -#define GetFullPathName error use qxeGetFullPathName or GetFullPathNameA/GetFullPathNameW +#define GetFullPathName error_use_qxeGetFullPathName_or_GetFullPathNameA_and_GetFullPathNameW #endif DWORD qxeGetFullPathName (const Extbyte * lpFileName, DWORD nBufferLength, Extbyte * lpBuffer, Extbyte * * lpFilePart); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef DefineDosDevice -#define DefineDosDevice error use qxeDefineDosDevice or DefineDosDeviceA/DefineDosDeviceW +#define DefineDosDevice error_use_qxeDefineDosDevice_or_DefineDosDeviceA_and_DefineDosDeviceW #endif BOOL qxeDefineDosDevice (DWORD dwFlags, const Extbyte * lpDeviceName, const Extbyte * lpTargetPath); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef QueryDosDevice -#define QueryDosDevice error use qxeQueryDosDevice or QueryDosDeviceA/QueryDosDeviceW +#define QueryDosDevice error_use_qxeQueryDosDevice_or_QueryDosDeviceA_and_QueryDosDeviceW #endif DWORD qxeQueryDosDevice (const Extbyte * lpDeviceName, Extbyte * lpTargetPath, DWORD ucchMax); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CreateFile -#define CreateFile error use qxeCreateFile or CreateFileA/CreateFileW +#define CreateFile error_use_qxeCreateFile_or_CreateFileA_and_CreateFileW #endif HANDLE qxeCreateFile (const Extbyte * lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef SetFileAttributes -#define SetFileAttributes error use qxeSetFileAttributes or SetFileAttributesA/SetFileAttributesW +#define SetFileAttributes error_use_qxeSetFileAttributes_or_SetFileAttributesA_and_SetFileAttributesW #endif BOOL qxeSetFileAttributes (const Extbyte * lpFileName, DWORD dwFileAttributes); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetFileAttributes -#define GetFileAttributes error use qxeGetFileAttributes or GetFileAttributesA/GetFileAttributesW +#define GetFileAttributes error_use_qxeGetFileAttributes_or_GetFileAttributesA_and_GetFileAttributesW #endif DWORD qxeGetFileAttributes (const Extbyte * lpFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetFileAttributesEx -#define GetFileAttributesEx error use qxeGetFileAttributesEx or GetFileAttributesExA/GetFileAttributesExW +#define GetFileAttributesEx error_use_qxeGetFileAttributesEx_or_GetFileAttributesExA_and_GetFileAttributesExW #endif BOOL qxeGetFileAttributesEx (const Extbyte * lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetCompressedFileSize -#define GetCompressedFileSize error use qxeGetCompressedFileSize or GetCompressedFileSizeA/GetCompressedFileSizeW +#define GetCompressedFileSize error_use_qxeGetCompressedFileSize_or_GetCompressedFileSizeA_and_GetCompressedFileSizeW #endif DWORD qxeGetCompressedFileSize (const Extbyte * lpFileName, LPDWORD lpFileSizeHigh); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef DeleteFile -#define DeleteFile error use qxeDeleteFile or DeleteFileA/DeleteFileW +#define DeleteFile error_use_qxeDeleteFile_or_DeleteFileA_and_DeleteFileW #endif BOOL qxeDeleteFile (const Extbyte * lpFileName); #undef FindFirstFileEx -#define FindFirstFileEx error split-sized LPWIN32_FIND_DATA; not used, NT 4.0+ only +#define FindFirstFileEx error_split_sized_LPWIN32_FIND_DATA__not_used__NT_4_0__only /* Skipping FindFirstFile because split-sized LPWIN32_FIND_DATA */ @@ -2335,586 +2513,408 @@ #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef SearchPath -#define SearchPath error use qxeSearchPath or SearchPathA/SearchPathW +#define SearchPath error_use_qxeSearchPath_or_SearchPathA_and_SearchPathW #endif DWORD qxeSearchPath (const Extbyte * lpPath, const Extbyte * lpFileName, const Extbyte * lpExtension, DWORD nBufferLength, Extbyte * lpBuffer, Extbyte * * lpFilePart); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CopyFile -#define CopyFile error use qxeCopyFile or CopyFileA/CopyFileW +#define CopyFile error_use_qxeCopyFile_or_CopyFileA_and_CopyFileW #endif BOOL qxeCopyFile (const Extbyte * lpExistingFileName, const Extbyte * lpNewFileName, BOOL bFailIfExists); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CopyFileEx -#define CopyFileEx error use qxeCopyFileEx or CopyFileExA/CopyFileExW +#define CopyFileEx error_use_qxeCopyFileEx_or_CopyFileExA_and_CopyFileExW #endif BOOL qxeCopyFileEx (const Extbyte * lpExistingFileName, const Extbyte * lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef MoveFile -#define MoveFile error use qxeMoveFile or MoveFileA/MoveFileW +#define MoveFile error_use_qxeMoveFile_or_MoveFileA_and_MoveFileW #endif BOOL qxeMoveFile (const Extbyte * lpExistingFileName, const Extbyte * lpNewFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef MoveFileEx -#define MoveFileEx error use qxeMoveFileEx or MoveFileExA/MoveFileExW +#define MoveFileEx error_use_qxeMoveFileEx_or_MoveFileExA_and_MoveFileExW #endif BOOL qxeMoveFileEx (const Extbyte * lpExistingFileName, const Extbyte * lpNewFileName, DWORD dwFlags); #undef MoveFileWithProgress -#define MoveFileWithProgress error NT 5.0+ only +#define MoveFileWithProgress error_NT_5_0__only #undef CreateHardLink -#define CreateHardLink error NT 5.0+ only +#define CreateHardLink error_NT_5_0__only #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CreateNamedPipe -#define CreateNamedPipe error use qxeCreateNamedPipe or CreateNamedPipeA/CreateNamedPipeW +#define CreateNamedPipe error_use_qxeCreateNamedPipe_or_CreateNamedPipeA_and_CreateNamedPipeW #endif HANDLE qxeCreateNamedPipe (const Extbyte * lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetNamedPipeHandleState -#define GetNamedPipeHandleState error use qxeGetNamedPipeHandleState or GetNamedPipeHandleStateA/GetNamedPipeHandleStateW +#define GetNamedPipeHandleState error_use_qxeGetNamedPipeHandleState_or_GetNamedPipeHandleStateA_and_GetNamedPipeHandleStateW #endif BOOL qxeGetNamedPipeHandleState (HANDLE hNamedPipe, LPDWORD lpState, LPDWORD lpCurInstances, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout, Extbyte * lpUserName, DWORD nMaxUserNameSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CallNamedPipe -#define CallNamedPipe error use qxeCallNamedPipe or CallNamedPipeA/CallNamedPipeW +#define CallNamedPipe error_use_qxeCallNamedPipe_or_CallNamedPipeA_and_CallNamedPipeW #endif BOOL qxeCallNamedPipe (const Extbyte * lpNamedPipeName, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesRead, DWORD nTimeOut); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef WaitNamedPipe -#define WaitNamedPipe error use qxeWaitNamedPipe or WaitNamedPipeA/WaitNamedPipeW +#define WaitNamedPipe error_use_qxeWaitNamedPipe_or_WaitNamedPipeA_and_WaitNamedPipeW #endif BOOL qxeWaitNamedPipe (const Extbyte * lpNamedPipeName, DWORD nTimeOut); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef SetVolumeLabel -#define SetVolumeLabel error use qxeSetVolumeLabel or SetVolumeLabelA/SetVolumeLabelW +#define SetVolumeLabel error_use_qxeSetVolumeLabel_or_SetVolumeLabelA_and_SetVolumeLabelW #endif BOOL qxeSetVolumeLabel (const Extbyte * lpRootPathName, const Extbyte * lpVolumeName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetVolumeInformation -#define GetVolumeInformation error use qxeGetVolumeInformation or GetVolumeInformationA/GetVolumeInformationW +#define GetVolumeInformation error_use_qxeGetVolumeInformation_or_GetVolumeInformationA_and_GetVolumeInformationW #endif BOOL qxeGetVolumeInformation (const Extbyte * lpRootPathName, Extbyte * lpVolumeNameBuffer, DWORD nVolumeNameSize, LPDWORD lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength, LPDWORD lpFileSystemFlags, Extbyte * lpFileSystemNameBuffer, DWORD nFileSystemNameSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ClearEventLog -#define ClearEventLog error use qxeClearEventLog or ClearEventLogA/ClearEventLogW +#define ClearEventLog error_use_qxeClearEventLog_or_ClearEventLogA_and_ClearEventLogW #endif BOOL qxeClearEventLog (HANDLE hEventLog, const Extbyte * lpBackupFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef BackupEventLog -#define BackupEventLog error use qxeBackupEventLog or BackupEventLogA/BackupEventLogW +#define BackupEventLog error_use_qxeBackupEventLog_or_BackupEventLogA_and_BackupEventLogW #endif BOOL qxeBackupEventLog (HANDLE hEventLog, const Extbyte * lpBackupFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef OpenEventLog -#define OpenEventLog error use qxeOpenEventLog or OpenEventLogA/OpenEventLogW +#define OpenEventLog error_use_qxeOpenEventLog_or_OpenEventLogA_and_OpenEventLogW #endif HANDLE qxeOpenEventLog (const Extbyte * lpUNCServerName, const Extbyte * lpSourceName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef RegisterEventSource -#define RegisterEventSource error use qxeRegisterEventSource or RegisterEventSourceA/RegisterEventSourceW +#define RegisterEventSource error_use_qxeRegisterEventSource_or_RegisterEventSourceA_and_RegisterEventSourceW #endif HANDLE qxeRegisterEventSource (const Extbyte * lpUNCServerName, const Extbyte * lpSourceName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef OpenBackupEventLog -#define OpenBackupEventLog error use qxeOpenBackupEventLog or OpenBackupEventLogA/OpenBackupEventLogW +#define OpenBackupEventLog error_use_qxeOpenBackupEventLog_or_OpenBackupEventLogA_and_OpenBackupEventLogW #endif HANDLE qxeOpenBackupEventLog (const Extbyte * lpUNCServerName, const Extbyte * lpFileName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ReadEventLog -#define ReadEventLog error use qxeReadEventLog or ReadEventLogA/ReadEventLogW +#define ReadEventLog error_use_qxeReadEventLog_or_ReadEventLogA_and_ReadEventLogW #endif BOOL qxeReadEventLog (HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, DWORD * pnBytesRead, DWORD * pnMinNumberOfBytesNeeded); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ReportEvent -#define ReportEvent error use qxeReportEvent or ReportEventA/ReportEventW +#define ReportEvent error_use_qxeReportEvent_or_ReportEventA_and_ReportEventW #endif BOOL qxeReportEvent (HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID, PSID lpUserSid, WORD wNumStrings, DWORD dwDataSize, const Extbyte * * lpStrings, LPVOID lpRawData); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef AccessCheckAndAuditAlarm -#define AccessCheckAndAuditAlarm error use qxeAccessCheckAndAuditAlarm or AccessCheckAndAuditAlarmA/AccessCheckAndAuditAlarmW +#define AccessCheckAndAuditAlarm error_use_qxeAccessCheckAndAuditAlarm_or_AccessCheckAndAuditAlarmA_and_AccessCheckAndAuditAlarmW #endif BOOL qxeAccessCheckAndAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, Extbyte * ObjectTypeName, Extbyte * ObjectName, PSECURITY_DESCRIPTOR SecurityDescriptor, DWORD DesiredAccess, PGENERIC_MAPPING GenericMapping, BOOL ObjectCreation, LPDWORD GrantedAccess, LPBOOL AccessStatus, LPBOOL pfGenerateOnClose); #undef AccessCheckByTypeAndAuditAlarm -#define AccessCheckByTypeAndAuditAlarm error NT 5.0+ only +#define AccessCheckByTypeAndAuditAlarm error_NT_5_0__only #undef AccessCheckByTypeResultListAndAuditAlarm -#define AccessCheckByTypeResultListAndAuditAlarm error NT 5.0+ only +#define AccessCheckByTypeResultListAndAuditAlarm error_NT_5_0__only #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ObjectOpenAuditAlarm -#define ObjectOpenAuditAlarm error use qxeObjectOpenAuditAlarm or ObjectOpenAuditAlarmA/ObjectOpenAuditAlarmW +#define ObjectOpenAuditAlarm error_use_qxeObjectOpenAuditAlarm_or_ObjectOpenAuditAlarmA_and_ObjectOpenAuditAlarmW #endif BOOL qxeObjectOpenAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, Extbyte * ObjectTypeName, Extbyte * ObjectName, PSECURITY_DESCRIPTOR pSecurityDescriptor, HANDLE ClientToken, DWORD DesiredAccess, DWORD GrantedAccess, PPRIVILEGE_SET Privileges, BOOL ObjectCreation, BOOL AccessGranted, LPBOOL GenerateOnClose); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ObjectPrivilegeAuditAlarm -#define ObjectPrivilegeAuditAlarm error use qxeObjectPrivilegeAuditAlarm or ObjectPrivilegeAuditAlarmA/ObjectPrivilegeAuditAlarmW +#define ObjectPrivilegeAuditAlarm error_use_qxeObjectPrivilegeAuditAlarm_or_ObjectPrivilegeAuditAlarmA_and_ObjectPrivilegeAuditAlarmW #endif BOOL qxeObjectPrivilegeAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, HANDLE ClientToken, DWORD DesiredAccess, PPRIVILEGE_SET Privileges, BOOL AccessGranted); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ObjectCloseAuditAlarm -#define ObjectCloseAuditAlarm error use qxeObjectCloseAuditAlarm or ObjectCloseAuditAlarmA/ObjectCloseAuditAlarmW +#define ObjectCloseAuditAlarm error_use_qxeObjectCloseAuditAlarm_or_ObjectCloseAuditAlarmA_and_ObjectCloseAuditAlarmW #endif BOOL qxeObjectCloseAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, BOOL GenerateOnClose); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef ObjectDeleteAuditAlarm -#define ObjectDeleteAuditAlarm error use qxeObjectDeleteAuditAlarm or ObjectDeleteAuditAlarmA/ObjectDeleteAuditAlarmW +#define ObjectDeleteAuditAlarm error_use_qxeObjectDeleteAuditAlarm_or_ObjectDeleteAuditAlarmA_and_ObjectDeleteAuditAlarmW #endif BOOL qxeObjectDeleteAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, BOOL GenerateOnClose); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef PrivilegedServiceAuditAlarm -#define PrivilegedServiceAuditAlarm error use qxePrivilegedServiceAuditAlarm or PrivilegedServiceAuditAlarmA/PrivilegedServiceAuditAlarmW +#define PrivilegedServiceAuditAlarm error_use_qxePrivilegedServiceAuditAlarm_or_PrivilegedServiceAuditAlarmA_and_PrivilegedServiceAuditAlarmW #endif BOOL qxePrivilegedServiceAuditAlarm (const Extbyte * SubsystemName, const Extbyte * ServiceName, HANDLE ClientToken, PPRIVILEGE_SET Privileges, BOOL AccessGranted); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef SetFileSecurity -#define SetFileSecurity error use qxeSetFileSecurity or SetFileSecurityA/SetFileSecurityW +#define SetFileSecurity error_use_qxeSetFileSecurity_or_SetFileSecurityA_and_SetFileSecurityW #endif BOOL qxeSetFileSecurity (const Extbyte * lpFileName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetFileSecurity -#define GetFileSecurity error use qxeGetFileSecurity or GetFileSecurityA/GetFileSecurityW +#define GetFileSecurity error_use_qxeGetFileSecurity_or_GetFileSecurityA_and_GetFileSecurityW #endif BOOL qxeGetFileSecurity (const Extbyte * lpFileName, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef FindFirstChangeNotification -#define FindFirstChangeNotification error use qxeFindFirstChangeNotification or FindFirstChangeNotificationA/FindFirstChangeNotificationW +#define FindFirstChangeNotification error_use_qxeFindFirstChangeNotification_or_FindFirstChangeNotificationA_and_FindFirstChangeNotificationW #endif HANDLE qxeFindFirstChangeNotification (const Extbyte * lpPathName, BOOL bWatchSubtree, DWORD dwNotifyFilter); #undef ReadDirectoryChanges -#define ReadDirectoryChanges error Unicode-only +#define ReadDirectoryChanges error_Unicode_only #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef IsBadStringPtr -#define IsBadStringPtr error use qxeIsBadStringPtr or IsBadStringPtrA/IsBadStringPtrW +#define IsBadStringPtr error_use_qxeIsBadStringPtr_or_IsBadStringPtrA_and_IsBadStringPtrW #endif BOOL qxeIsBadStringPtr (const Extbyte * lpsz, UINT ucchMax); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef LookupAccountSid -#define LookupAccountSid error use qxeLookupAccountSid or LookupAccountSidA/LookupAccountSidW +#define LookupAccountSid error_use_qxeLookupAccountSid_or_LookupAccountSidA_and_LookupAccountSidW #endif BOOL qxeLookupAccountSid (const Extbyte * lpSystemName, PSID Sid, Extbyte * Name, LPDWORD cbName, Extbyte * ReferencedDomainName, LPDWORD cbReferencedDomainName, PSID_NAME_USE peUse); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef LookupAccountName -#define LookupAccountName error use qxeLookupAccountName or LookupAccountNameA/LookupAccountNameW +#define LookupAccountName error_use_qxeLookupAccountName_or_LookupAccountNameA_and_LookupAccountNameW #endif BOOL qxeLookupAccountName (const Extbyte * lpSystemName, const Extbyte * lpAccountName, PSID Sid, LPDWORD cbSid, Extbyte * ReferencedDomainName, LPDWORD cbReferencedDomainName, PSID_NAME_USE peUse); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef LookupPrivilegeValue -#define LookupPrivilegeValue error use qxeLookupPrivilegeValue or LookupPrivilegeValueA/LookupPrivilegeValueW +#define LookupPrivilegeValue error_use_qxeLookupPrivilegeValue_or_LookupPrivilegeValueA_and_LookupPrivilegeValueW #endif BOOL qxeLookupPrivilegeValue (const Extbyte * lpSystemName, const Extbyte * lpName, PLUID lpLuid); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef LookupPrivilegeName -#define LookupPrivilegeName error use qxeLookupPrivilegeName or LookupPrivilegeNameA/LookupPrivilegeNameW +#define LookupPrivilegeName error_use_qxeLookupPrivilegeName_or_LookupPrivilegeNameA_and_LookupPrivilegeNameW #endif BOOL qxeLookupPrivilegeName (const Extbyte * lpSystemName, PLUID lpLuid, Extbyte * lpName, LPDWORD cbName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef LookupPrivilegeDisplayName -#define LookupPrivilegeDisplayName error use qxeLookupPrivilegeDisplayName or LookupPrivilegeDisplayNameA/LookupPrivilegeDisplayNameW +#define LookupPrivilegeDisplayName error_use_qxeLookupPrivilegeDisplayName_or_LookupPrivilegeDisplayNameA_and_LookupPrivilegeDisplayNameW #endif BOOL qxeLookupPrivilegeDisplayName (const Extbyte * lpSystemName, const Extbyte * lpName, Extbyte * lpDisplayName, LPDWORD cbDisplayName, LPDWORD lpLanguageId); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef BuildCommDCB -#define BuildCommDCB error use qxeBuildCommDCB or BuildCommDCBA/BuildCommDCBW +#define BuildCommDCB error_use_qxeBuildCommDCB_or_BuildCommDCBA_and_BuildCommDCBW #endif BOOL qxeBuildCommDCB (const Extbyte * lpDef, LPDCB lpDCB); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef BuildCommDCBAndTimeouts -#define BuildCommDCBAndTimeouts error use qxeBuildCommDCBAndTimeouts or BuildCommDCBAndTimeoutsA/BuildCommDCBAndTimeoutsW +#define BuildCommDCBAndTimeouts error_use_qxeBuildCommDCBAndTimeouts_or_BuildCommDCBAndTimeoutsA_and_BuildCommDCBAndTimeoutsW #endif BOOL qxeBuildCommDCBAndTimeouts (const Extbyte * lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CommConfigDialog -#define CommConfigDialog error use qxeCommConfigDialog or CommConfigDialogA/CommConfigDialogW +#define CommConfigDialog error_use_qxeCommConfigDialog_or_CommConfigDialogA_and_CommConfigDialogW #endif BOOL qxeCommConfigDialog (const Extbyte * lpszName, HWND hWnd, LPCOMMCONFIG lpCC); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetDefaultCommConfig -#define GetDefaultCommConfig error use qxeGetDefaultCommConfig or GetDefaultCommConfigA/GetDefaultCommConfigW +#define GetDefaultCommConfig error_use_qxeGetDefaultCommConfig_or_GetDefaultCommConfigA_and_GetDefaultCommConfigW #endif BOOL qxeGetDefaultCommConfig (const Extbyte * lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef SetDefaultCommConfig -#define SetDefaultCommConfig error use qxeSetDefaultCommConfig or SetDefaultCommConfigA/SetDefaultCommConfigW +#define SetDefaultCommConfig error_use_qxeSetDefaultCommConfig_or_SetDefaultCommConfigA_and_SetDefaultCommConfigW #endif BOOL qxeSetDefaultCommConfig (const Extbyte * lpszName, LPCOMMCONFIG lpCC, DWORD dwSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetComputerName -#define GetComputerName error use qxeGetComputerName or GetComputerNameA/GetComputerNameW +#define GetComputerName error_use_qxeGetComputerName_or_GetComputerNameA_and_GetComputerNameW #endif BOOL qxeGetComputerName (Extbyte * lpBuffer, LPDWORD nSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef SetComputerName -#define SetComputerName error use qxeSetComputerName or SetComputerNameA/SetComputerNameW +#define SetComputerName error_use_qxeSetComputerName_or_SetComputerNameA_and_SetComputerNameW #endif BOOL qxeSetComputerName (const Extbyte * lpComputerName); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef GetUserName -#define GetUserName error use qxeGetUserName or GetUserNameA/GetUserNameW +#define GetUserName error_use_qxeGetUserName_or_GetUserNameA_and_GetUserNameW #endif BOOL qxeGetUserName (Extbyte * lpBuffer, LPDWORD nSize); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef LogonUser -#define LogonUser error use qxeLogonUser or LogonUserA/LogonUserW +#define LogonUser error_use_qxeLogonUser_or_LogonUserA_and_LogonUserW #endif BOOL qxeLogonUser (Extbyte * lpszUsername, Extbyte * lpszDomain, Extbyte * lpszPassword, DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken); #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED #undef CreateProcessAsUser -#define CreateProcessAsUser error use qxeCreateProcessAsUser or CreateProcessAsUserA/CreateProcessAsUserW +#define CreateProcessAsUser error_use_qxeCreateProcessAsUser_or_CreateProcessAsUserA_and_CreateProcessAsUserW #endif BOOL qxeCreateProcessAsUser (HANDLE hToken, const Extbyte * lpApplicationName, Extbyte * lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, const Extbyte * lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation); #undef GetCurrentHwProfile -#define GetCurrentHwProfile error split-sized LPHW_PROFILE_INFO; NT 4.0+ only +#define GetCurrentHwProfile error_split_sized_LPHW_PROFILE_INFO__NT_4_0__only #undef GetVersionEx -#define GetVersionEx error split-sized LPOSVERSIONINFO +#define GetVersionEx error_split_sized_LPOSVERSIONINFO #undef CreateJobObject -#define CreateJobObject error NT 5.0+ only +#define CreateJobObject error_NT_5_0__only #undef OpenJobObject -#define OpenJobObject error NT 5.0+ only - - -/* Processing file COMMDLG.H */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetOpenFileName -#define GetOpenFileName error use qxeGetOpenFileName or GetOpenFileNameA/GetOpenFileNameW -#endif -BOOL qxeGetOpenFileName (LPOPENFILENAMEW arg1); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetSaveFileName -#define GetSaveFileName error use qxeGetSaveFileName or GetSaveFileNameA/GetSaveFileNameW -#endif -BOOL qxeGetSaveFileName (LPOPENFILENAMEW arg1); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetFileTitle -#define GetFileTitle error use qxeGetFileTitle or GetFileTitleA/GetFileTitleW -#endif -short qxeGetFileTitle (const Extbyte * arg1, Extbyte * arg2, WORD arg3); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ChooseColor -#define ChooseColor error use qxeChooseColor or ChooseColorA/ChooseColorW -#endif -BOOL qxeChooseColor (LPCHOOSECOLORW arg1); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef FindText -#define FindText error use qxeFindText or FindTextA/FindTextW -#endif -HWND qxeFindText (LPFINDREPLACEW arg1); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ReplaceText -#define ReplaceText error use qxeReplaceText or ReplaceTextA/ReplaceTextW -#endif -HWND qxeReplaceText (LPFINDREPLACEW arg1); - -#undef AfxReplaceText -#define AfxReplaceText error mac only - -#undef ChooseFont -#define ChooseFont error split-sized LPLOGFONT in LPCHOOSEFONT - -/* Skipping PrintDlg because LPPRINTDLG with split-sized DEVMODE handle */ - -/* Skipping PageSetupDlg because LPPAGESETUPDLG with split-sized DEVMODE handle */ - - -/* Processing file SHLOBJ.H */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SHGetPathFromIDList -#define SHGetPathFromIDList error use qxeSHGetPathFromIDList or SHGetPathFromIDListA/SHGetPathFromIDListW -#endif -BOOL qxeSHGetPathFromIDList (LPCITEMIDLIST pidl, Extbyte * pszPath); - -/* Skipping SHGetSpecialFolderPath because error in Cygwin prototype, missing from Cygwin libraries */ - -/* Skipping SHBrowseForFolder because need to intercept callback for SendMessage */ - -/* Skipping SHGetDataFromIDList because split-sized WIN32_FIND_DATA or split-simple NETRESOURCE, missing from Cygwin libraries */ - - -/* Processing file IME.H */ - -#undef SendIMEMessageEx -#define SendIMEMessageEx error obsolete, no docs available - - -/* Processing file WINGDI.H */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef AddFontResource -#define AddFontResource error use qxeAddFontResource or AddFontResourceA/AddFontResourceW -#endif -int qxeAddFontResource (const Extbyte * arg1); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CopyMetaFile -#define CopyMetaFile error use qxeCopyMetaFile or CopyMetaFileA/CopyMetaFileW -#endif -HMETAFILE qxeCopyMetaFile (HMETAFILE arg1, const Extbyte * arg2); - -/* Skipping CreateDC because split-sized DEVMODE */ - -/* Skipping CreateFontIndirect because split-sized LOGFONT */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CreateFont -#define CreateFont error use qxeCreateFont or CreateFontA/CreateFontW -#endif -HFONT qxeCreateFont (int arg1, int arg2, int arg3, int arg4, int arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13, const Extbyte * arg14); - -/* Skipping CreateIC because split-sized DEVMODE */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CreateMetaFile -#define CreateMetaFile error use qxeCreateMetaFile or CreateMetaFileA/CreateMetaFileW -#endif -HDC qxeCreateMetaFile (const Extbyte * arg1); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CreateScalableFontResource -#define CreateScalableFontResource error use qxeCreateScalableFontResource or CreateScalableFontResourceA/CreateScalableFontResourceW -#endif -BOOL qxeCreateScalableFontResource (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4); - -/* Skipping DeviceCapabilities because split-sized DEVMODE */ - -/* Skipping EnumFontFamiliesEx because split-complex FONTENUMPROC; NT 4.0+ only */ - -#undef EnumFontFamilies -#define EnumFontFamilies error split-complex FONTENUMPROC - -#undef EnumFonts -#define EnumFonts error split-complex FONTENUMPROC - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetCharWidth -#define GetCharWidth error use qxeGetCharWidth or GetCharWidthA/GetCharWidthW -#endif -BOOL qxeGetCharWidth (HDC arg1, UINT arg2, UINT arg3, LPINT arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetCharWidth32 -#define GetCharWidth32 error use qxeGetCharWidth32 or GetCharWidth32A/GetCharWidth32W -#endif -BOOL qxeGetCharWidth32 (HDC arg1, UINT arg2, UINT arg3, LPINT arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetCharWidthFloat -#define GetCharWidthFloat error use qxeGetCharWidthFloat or GetCharWidthFloatA/GetCharWidthFloatW -#endif -BOOL qxeGetCharWidthFloat (HDC arg1, UINT arg2, UINT arg3, PFLOAT arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetCharABCWidths -#define GetCharABCWidths error use qxeGetCharABCWidths or GetCharABCWidthsA/GetCharABCWidthsW -#endif -BOOL qxeGetCharABCWidths (HDC arg1, UINT arg2, UINT arg3, LPABC arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetCharABCWidthsFloat -#define GetCharABCWidthsFloat error use qxeGetCharABCWidthsFloat or GetCharABCWidthsFloatA/GetCharABCWidthsFloatW -#endif -BOOL qxeGetCharABCWidthsFloat (HDC arg1, UINT arg2, UINT arg3, LPABCFLOAT arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetGlyphOutline -#define GetGlyphOutline error use qxeGetGlyphOutline or GetGlyphOutlineA/GetGlyphOutlineW -#endif -DWORD qxeGetGlyphOutline (HDC arg1, UINT arg2, UINT arg3, LPGLYPHMETRICS arg4, DWORD arg5, LPVOID arg6, CONST MAT2 * arg7); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetMetaFile -#define GetMetaFile error use qxeGetMetaFile or GetMetaFileA/GetMetaFileW -#endif -HMETAFILE qxeGetMetaFile (const Extbyte * arg1); - -#undef GetOutlineTextMetrics -#define GetOutlineTextMetrics error split-sized LPOUTLINETEXTMETRIC - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetTextExtentPoint -#define GetTextExtentPoint error use qxeGetTextExtentPoint or GetTextExtentPointA/GetTextExtentPointW -#endif -BOOL qxeGetTextExtentPoint (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetTextExtentPoint32 -#define GetTextExtentPoint32 error use qxeGetTextExtentPoint32 or GetTextExtentPoint32A/GetTextExtentPoint32W -#endif -BOOL qxeGetTextExtentPoint32 (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetTextExtentExPoint -#define GetTextExtentExPoint error use qxeGetTextExtentExPoint or GetTextExtentExPointA/GetTextExtentExPointW -#endif -BOOL qxeGetTextExtentExPoint (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPINT arg5, LPINT arg6, LPSIZE arg7); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetCharacterPlacement -#define GetCharacterPlacement error use qxeGetCharacterPlacement or GetCharacterPlacementA/GetCharacterPlacementW -#endif -DWORD qxeGetCharacterPlacement (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPGCP_RESULTSW arg5, DWORD arg6); - -#undef GetGlyphIndices -#define GetGlyphIndices error NT 5.0+ only - -#undef AddFontResourceEx -#define AddFontResourceEx error NT 5.0+ only - -#undef RemoveFontResourceEx -#define RemoveFontResourceEx error NT 5.0+ only - -#undef CreateFontIndirectEx -#define CreateFontIndirectEx error split-sized ENUMLOGFONTEXDV; NT 5.0+ only - -/* Skipping ResetDC because split-sized DEVMODE */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef RemoveFontResource -#define RemoveFontResource error use qxeRemoveFontResource or RemoveFontResourceA/RemoveFontResourceW -#endif -BOOL qxeRemoveFontResource (const Extbyte * arg1); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CopyEnhMetaFile -#define CopyEnhMetaFile error use qxeCopyEnhMetaFile or CopyEnhMetaFileA/CopyEnhMetaFileW -#endif -HENHMETAFILE qxeCopyEnhMetaFile (HENHMETAFILE arg1, const Extbyte * arg2); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef CreateEnhMetaFile -#define CreateEnhMetaFile error use qxeCreateEnhMetaFile or CreateEnhMetaFileA/CreateEnhMetaFileW -#endif -HDC qxeCreateEnhMetaFile (HDC arg1, const Extbyte * arg2, CONST RECT * arg3, const Extbyte * arg4); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetEnhMetaFile -#define GetEnhMetaFile error use qxeGetEnhMetaFile or GetEnhMetaFileA/GetEnhMetaFileW -#endif -HENHMETAFILE qxeGetEnhMetaFile (const Extbyte * arg1); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetEnhMetaFileDescription -#define GetEnhMetaFileDescription error use qxeGetEnhMetaFileDescription or GetEnhMetaFileDescriptionA/GetEnhMetaFileDescriptionW -#endif -UINT qxeGetEnhMetaFileDescription (HENHMETAFILE arg1, UINT arg2, Extbyte * arg3); - -/* Skipping GetTextMetrics because split-sized LPTEXTMETRIC */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef StartDoc -#define StartDoc error use qxeStartDoc or StartDocA/StartDocW -#endif -int qxeStartDoc (HDC arg1, CONST DOCINFOW * arg2); - -/* Skipping GetObject because split-sized LOGFONT */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef TextOut -#define TextOut error use qxeTextOut or TextOutA/TextOutW -#endif -BOOL qxeTextOut (HDC arg1, int arg2, int arg3, const Extbyte * arg4, int arg5); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef ExtTextOut -#define ExtTextOut error use qxeExtTextOut or ExtTextOutA/ExtTextOutW -#endif -BOOL qxeExtTextOut (HDC arg1, int arg2, int arg3, UINT arg4, CONST RECT * arg5, const Extbyte * arg6, UINT arg7, CONST INT * arg8); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef PolyTextOut -#define PolyTextOut error use qxePolyTextOut or PolyTextOutA/PolyTextOutW -#endif -BOOL qxePolyTextOut (HDC arg1, CONST POLYTEXTW * arg2, int arg3); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetTextFace -#define GetTextFace error use qxeGetTextFace or GetTextFaceA/GetTextFaceW -#endif -int qxeGetTextFace (HDC arg1, int arg2, Extbyte * arg3); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef GetKerningPairs -#define GetKerningPairs error use qxeGetKerningPairs or GetKerningPairsA/GetKerningPairsW -#endif -DWORD qxeGetKerningPairs (HDC arg1, DWORD arg2, LPKERNINGPAIR arg3); - -#undef GetLogColorSpace -#define GetLogColorSpace error split-sized LPLOGCOLORSPACE; NT 4.0+ only - -#undef CreateColorSpace -#define CreateColorSpace error split-sized LPLOGCOLORSPACE; NT 4.0+ only - -/* Skipping GetICMProfile because NT 4.0+ only, error in Cygwin prototype */ - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef SetICMProfile -#define SetICMProfile error use qxeSetICMProfile or SetICMProfileA/SetICMProfileW -#endif -BOOL qxeSetICMProfile (HDC arg1, Extbyte * arg2); - -#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED -#undef EnumICMProfiles -#define EnumICMProfiles error use qxeEnumICMProfiles or EnumICMProfilesA/EnumICMProfilesW -#endif -int qxeEnumICMProfiles (HDC arg1, ICMENUMPROCW arg2, LPARAM arg3); - -/* Skipping UpdateICMRegKey because NT 4.0+ only, error in Cygwin prototype */ - -#undef wglUseFontBitmaps -#define wglUseFontBitmaps error causes link error - -#undef wglUseFontOutlines -#define wglUseFontOutlines error causes link error - +#define OpenJobObject error_NT_5_0__only + + +/* Processing file MMSYSTEM.H */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef sndPlaySound +#define sndPlaySound error_use_qxesndPlaySound_or_sndPlaySoundA_and_sndPlaySoundW +#endif +BOOL qxesndPlaySound (const Extbyte * pszSound, UINT fuSound); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef PlaySound +#define PlaySound error_use_qxePlaySound_or_PlaySoundA_and_PlaySoundW +#endif +BOOL qxePlaySound (const Extbyte * pszSound, HMODULE hmod, DWORD fdwSound); + +#undef waveOutGetDevCaps +#define waveOutGetDevCaps error_split_sized_LPWAVEOUTCAPS + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef waveOutGetErrorText +#define waveOutGetErrorText error_use_qxewaveOutGetErrorText_or_waveOutGetErrorTextA_and_waveOutGetErrorTextW +#endif +MMRESULT qxewaveOutGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText); + +#undef waveInGetDevCaps +#define waveInGetDevCaps error_split_sized_LPWAVEINCAPS + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef waveInGetErrorText +#define waveInGetErrorText error_use_qxewaveInGetErrorText_or_waveInGetErrorTextA_and_waveInGetErrorTextW +#endif +MMRESULT qxewaveInGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText); + +#undef midiOutGetDevCaps +#define midiOutGetDevCaps error_split_sized_LPMIDIOUTCAPS + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef midiOutGetErrorText +#define midiOutGetErrorText error_use_qxemidiOutGetErrorText_or_midiOutGetErrorTextA_and_midiOutGetErrorTextW +#endif +MMRESULT qxemidiOutGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText); + +#undef midiInGetDevCaps +#define midiInGetDevCaps error_split_sized_LPMIDIOUTCAPS + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef midiInGetErrorText +#define midiInGetErrorText error_use_qxemidiInGetErrorText_or_midiInGetErrorTextA_and_midiInGetErrorTextW +#endif +MMRESULT qxemidiInGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText); + +#undef auxGetDevCaps +#define auxGetDevCaps error_split_sized_LPAUXCAPS + +#undef mixerGetDevCaps +#define mixerGetDevCaps error_split_sized_LPMIXERCAPS + +#undef mixerGetLineInfo +#define mixerGetLineInfo error_split_sized_LPMIXERLINE + +#undef mixerGetLineControls +#define mixerGetLineControls error_split_sized_LPMIXERCONTROL + +#undef mixerGetControlDetails +#define mixerGetControlDetails error_split_sized_LPMIXERCONTROL_in_LPMIXERLINECONTROLS_in_LPMIXERCONTROLDETAILS + +#undef joyGetDevCaps +#define joyGetDevCaps error_split_sized_LPJOYCAPS + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef mmioStringToFOURCC +#define mmioStringToFOURCC error_use_qxemmioStringToFOURCC_or_mmioStringToFOURCCA_and_mmioStringToFOURCCW +#endif +FOURCC qxemmioStringToFOURCC (const Extbyte * sz, UINT uFlags); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef mmioInstallIOProc +#define mmioInstallIOProc error_use_qxemmioInstallIOProc_or_mmioInstallIOProcA_and_mmioInstallIOProcW +#endif +LPMMIOPROC qxemmioInstallIOProc (FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef mmioOpen +#define mmioOpen error_use_qxemmioOpen_or_mmioOpenA_and_mmioOpenW +#endif +HMMIO qxemmioOpen (Extbyte * pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef mmioRename +#define mmioRename error_use_qxemmioRename_or_mmioRenameA_and_mmioRenameW +#endif +MMRESULT qxemmioRename (const Extbyte * pszFileName, const Extbyte * pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef mciSendCommand +#define mciSendCommand error_use_qxemciSendCommand_or_mciSendCommandA_and_mciSendCommandW +#endif +MCIERROR qxemciSendCommand (MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef mciSendString +#define mciSendString error_use_qxemciSendString_or_mciSendStringA_and_mciSendStringW +#endif +MCIERROR qxemciSendString (const Extbyte * lpstrCommand, Extbyte * lpstrReturnString, UINT uReturnLength, HWND hwndCallback); + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef mciGetDeviceID +#define mciGetDeviceID error_use_qxemciGetDeviceID_or_mciGetDeviceIDA_and_mciGetDeviceIDW +#endif +MCIDEVICEID qxemciGetDeviceID (const Extbyte * pszDevice); + +#if !defined (MINGW) +#undef mciGetDeviceIDFromElementID +#define mciGetDeviceIDFromElementID error_missing_from_Win98se_version_of_ADVAPI32_dll +#endif /* !defined (MINGW) */ + +#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED +#undef mciGetErrorString +#define mciGetErrorString error_use_qxemciGetErrorString_or_mciGetErrorStringA_and_mciGetErrorStringW +#endif +BOOL qxemciGetErrorString (MCIERROR mcierr, Extbyte * pszText, UINT cchText); +
--- a/src/intl-encap-win32.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/intl-encap-win32.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,5 +1,5 @@ /* Unicode-encapsulation of Win32 library functions. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -38,118 +38,6 @@ int no_mswin_unicode_lib_calls; -/* The golden rules of writing Unicode-safe code: - --- There are no preprocessor games going on. - --- Do not set the UNICODE constant. - --- You need to change your code to call the Windows API prefixed with "qxe" - functions (when they exist) and use the ...W structs instead of the - generic ones. String arguments in the qxe functions are of type Extbyte - *. - --- You code is responsible for conversion of text arguments. We try to - handle everything else -- the argument differences, the copying back and - forth of structures, etc. Use Qmswindows_tstr and macros such as - C_STRING_TO_TSTR. You are also responsible for interpreting and - specifying string sizes, which have not been changed. Usually these are - in characters, meaning you need to divide by XETCHAR_SIZE. (But, some - functions want sizes in bytes, even with Unicode strings. Look in the - documentation.) Use XETEXT when specifying string constants, so that - they show up in Unicode as necessary. - --- If you need to process external strings (in general you should not do - this; do all your manipulations in internal format and convert at the - point of entry into or exit from the function), use the xet...() - functions. - -more specifically: - -Unicode support is important for supporting many languages under -Windows, such as Cyrillic, without resorting to translation tables for -particular Windows-specific code pages. Internally, all characters in -Windows can be represented in two encodings: code pages and Unicode. -With Unicode support, we can seamlessly support all Windows -characters. Currently, the test in the drive to support Unicode is if -IME input works properly, since it is being converted from Unicode. - -Unicode support also requires that the various Windows API's be -"Unicode-encapsulated", so that they automatically call the ANSI or -Unicode version of the API call appropriately and handle the size -differences in structures. What this means is: - --- first, note that Windows already provides a sort of encapsulation - of all API's that deal with text. All such API's are underlyingly - provided in two versions, with an A or W suffix (ANSI or "wide" - i.e. Unicode), and the compile-time constant UNICODE controls which is - selected by the unsuffixed API. Same thing happens with structures, and - also with types, where the generic types have names beginning with T -- - TCHAR, LPTSTR, etc.. Unfortunately, this is compile-time only, not - run-time, so not sufficient. (Creating the necessary run-time encoding - is not conceptually difficult, but very time-consuming to write. It - adds no significant overhead, and the only reason it's not standard in - Windows is conscious marketing attempts by Microsoft to cripple Windows - 95. FUCK MICROSOFT! They even describe in a KnowledgeBase article - exactly how to create such an API [although we don't exactly follow - their procedure], and point out its usefulness; the procedure is also - described more generally in Nadine Kano's book on Win32 - internationalization -- written SIX YEARS AGO! Obviously Microsoft has - such an API available internally.) - --- what we do is provide an encapsulation of each standard Windows API call - that is split into A and W versions. current theory is to avoid all - preprocessor games; so we name the function with a prefix -- "qxe" - currently -- and require callers to use the prefixed name. Callers need - to explicitly use the W version of all structures, and convert text - themselves using Qmswindows_tstr. the qxe encapsulated version will - automatically call the appropriate A or W version depending on whether - we're running on 9x or NT (you can force use of the A calls on NT, - e.g. for testing purposes, using the command- line switch -nuni aka - -no-unicode-lib-calls), and copy data between W and A versions of the - structures as necessary. - --- We require the caller to handle the actual translation of text to - avoid possible overflow when dealing with fixed-size Windows - structures. There are no such problems when copying data between - the A and W versions because ANSI text is never larger than its - equivalent Unicode representation. - -NOTE NOTE NOTE: As of August 2001, Microsoft (finally! See my nasty -comment above) released their own Unicode-encapsulation library, called -Microsoft Layer for Unicode on Windows 95/98/Me Systems. It tries to be -more transparent than we are, in that - --- its routines do ANSI/Unicode string translation, while we don't, for - efficiency (we already have to do internal/external conversion so it's - no extra burden to do the proper conversion directly rather than always - converting to Unicode and then doing a second conversion to ANSI as - necessary) - --- rather than requiring separately-named routines (qxeFooBar), they - physically override the existing routines at the link level. it also - appears that they do this BADLY, in that if you link with the MLU, you - get an application that runs ONLY on Win9x!!! (hint -- use - GetProcAddress()). there's still no way to create a single binary! - fucking losers. - --- they assume you compile with UNICODE defined, so there's no need for the - application to explicitly use ...W structures, as we require. - --- they also intercept windows procedures to deal with notify messages as - necessary, which we don't do yet. - --- they (of course) don't use Extbyte. - -at some point (especially when they fix the single-binary problem!), we -should consider switching. for the meantime, we'll stick with what i've -already written. perhaps we should think about adopting some of the -greater transparency they have; but i opted against transparency on -purpose, to make the code easier to follow for someone who's not familiar -with it. until our library is really complete and bug-free, we should -think twice before doing this. -*/ - /************************************************************************/ /* auto-generation */ @@ -2513,7 +2401,9 @@ if (XEUNICODE_P) return RegisterClassW (&classnew); else - return RegisterClassA ((CONST WNDCLASSA *) &classnew); + /* The intermediate cast fools gcc into not outputting strict-aliasing + complaints */ + return RegisterClassA ((CONST WNDCLASSA *) (void *) &classnew); } BOOL @@ -2557,7 +2447,9 @@ if (XEUNICODE_P) return RegisterClassExW (&classnew); else - return RegisterClassExA ((CONST WNDCLASSEXA *) &classnew); + /* The intermediate cast fools gcc into not outputting strict-aliasing + complaints */ + return RegisterClassExA ((CONST WNDCLASSEXA *) (void *) &classnew); }
--- a/src/intl-win32.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/intl-win32.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,5 +1,5 @@ /* Win32 internationalization functions. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2004 Ben Wing. Copyright (C) 2000 IKEYAMA Tomonori. This file is part of XEmacs. @@ -53,6 +53,15 @@ # define NO_EXT_MULTIBYTE_FEATURES #endif + + +/* + +Detailed info on Microsoft Windows-Related Multilingual Issues: + + (Info-goto-node "(internals)Microsoft Windows-Related Multilingual Issues") +*/ + Lisp_Object Qmswindows_multibyte, Qmswindows_multibyte_to_unicode; Lisp_Object Qmswindows_tstr, Qmswindows_unicode; Lisp_Object Qmswindows_multibyte_system_default; @@ -73,74 +82,6 @@ /* Language/locale/code page conversion functions */ /************************************************************************/ -/* There are various different ways of representing the vague concept - of "language", and it can be very confusing. So: - - -- The C library has the concept of "locale", which is a - combination of language and country, and which controls the way - currency and dates are displayed, the encoding of data, etc. - - -- XEmacs has the concept of "language environment", more or less - like a locale; although currently in most cases it just refers to - the language, and no sub-language distinctions are - made. (Exceptions are with Chinese, which has different language - environments for Taiwan and mainland China, due to the different - encodings and writing systems.) - - -- Windows has a number of different language concepts: - - 1. There are "languages" and "sublanguages", which correspond to - the languages and countries of the C library -- e.g. LANG_ENGLISH - and SUBLANG_ENGLISH_US. These are identified by 8-bit integers, - called the "primary language identifier" and "sublanguage - identifier", respectively. These are combined into a 16-bit - integer or "language identifier" by MAKELANGID(). - - 2. The language identifier in turn is combined with a "sort - identifier" (and optionally a "sort version") to yield a 32-bit - integer called a "locale identifier" (type LCID), which identifies - locales -- the primary means of distinguishing language/regional - settings and similar to C library locales. - - 3. "Code pages" identify different text encodings (i.e. a set of - supported characters, an enumeration of those characters [i.e. an - association of character with number or number pair; there may be - disjoint ranges of numbers supported]), and a way of encoding a - stream of those characters into an 8-bit data stream). All of the - encodings are either one-byte or mixed one-byte/two-byte encodings, - all non-modal; in the mixed encodings, two-byte characters have the - first byte >= 128, although the second byte may or may not be - restricted to this range, depending on the encoding. Code pages - are similar to XEmacs "charsets"; the latter also define a set of - supported characters and an enumeration of those characters (but - code pages in additionally define an encoding, which charsets don't - do). Code pages often function in Windows like charsets in XEmacs. - - 4. Every Windows locale has a specific code page associated with - it; more than one locale can share a code page -- e.g. all the - Western European languages, including English, do. - - 5. Windows also has an "input locale identifier" (aka "keyboard - layout id") or HKL, which is a 32-bit integer composed of the - 16-bit language identifier and a 16-bit "device identifier", which - originally specified a particular keyboard layout (e.g. the locale - "US English" can have the QWERTY layout, the Dvorak layout, etc.), - but has been expanded to include speech-to-text converters and - other non-keyboard ways of inputting text. Note that both the HKL - and LCID share the language identifier in the lower 16 bits, and in - both cases a 0 in the upper 16 bits means "default" (sort order or - device), providing a way to convert between HKL's, LCID's, and - language identifiers (i.e. language/sublanguage pairs). The - default keyboard layout for a language is (as far as I can - determine) established using the Regional Settings control panel - applet, where you can add input locales as combinations of language - (actually language/sublanguage) and layout; presumably if you list - only one input locale with a particular language, the corresponding - layout is the default for that language. But what if you list more - than one? You can specify a single default input locale, but there - appears to be no way to do so on a per-language basis. -*/ - struct lang_to_string { int code; @@ -675,7 +616,7 @@ int i; for (i = 0; i < table_size; i++) - if (!strcmp ((char *) XSTRING_DATA (lang), table[i].string)) + if (!qxestrcmp_ascii (XSTRING_DATA (lang), table[i].string)) return table[i].code; return -1; } @@ -688,14 +629,14 @@ for (i = 0; i < table_size; i++) if (table[i].string && - !strcmp ((char *) XSTRING_DATA (lang), table[i].string)) + !qxestrcmp_ascii (XSTRING_DATA (lang), table[i].string)) return table[i].code; - if (!strcmp ((char *) XSTRING_DATA (lang), "NEUTRAL")) + if (!qxestrcmp_ascii (XSTRING_DATA (lang), "NEUTRAL")) return SUBLANG_NEUTRAL; - if (!strcmp ((char *) XSTRING_DATA (lang), "DEFAULT")) + if (!qxestrcmp_ascii (XSTRING_DATA (lang), "DEFAULT")) return SUBLANG_DEFAULT; - if (!strcmp ((char *) XSTRING_DATA (lang), "SYS_DEFAULT")) + if (!qxestrcmp_ascii (XSTRING_DATA (lang), "SYS_DEFAULT")) return SUBLANG_SYS_DEFAULT; return -1; @@ -1093,11 +1034,11 @@ } static DWORD -int_from_hex (Char_ASCII *s) +int_from_hex (Ascbyte *s) { DWORD val = 0; - static Char_ASCII hex[] = "0123456789abcdefABCDEF"; - Char_ASCII *p; + static Ascbyte hex[] = "0123456789abcdefABCDEF"; + Ascbyte *p; while (*s && (p = strchr (hex, *s)) != NULL) { @@ -1115,7 +1056,7 @@ static Lisp_Object Vmswindows_valid_locales; static BOOL CALLBACK -enum_locale_fn (Char_ASCII *localeNum) +enum_locale_fn (Ascbyte *localeNum) { DWORD id = int_from_hex (localeNum); Vmswindows_valid_locales = @@ -1485,7 +1426,7 @@ ()) { int num_layouts = GetKeyboardLayoutList (0, NULL); - HKL * layouts = (HKL *) ALLOCA (num_layouts * sizeof (HKL)); + HKL *layouts = alloca_array (HKL, num_layouts); Lisp_Object obj = Qnil; if (GetKeyboardLayoutList (num_layouts, layouts) == num_layouts) @@ -1682,7 +1623,7 @@ wcsdup (const wchar_t *str) { int len = wcslen (str) + 1; - void *val = xmalloc (len * sizeof (wchar_t)); + wchar_t *val = xnew_array (wchar_t, len); if (val == 0) return 0; return (wchar_t *) memcpy (val, str, len * sizeof (wchar_t)); @@ -1924,6 +1865,10 @@ write_c_string (printcharfun, ")"); } +/* ----------------------------------------------------------------------- */ +/* Unicode/Multibyte converters */ +/* ----------------------------------------------------------------------- */ + /* Convert multibyte to Unicode according to the specified code page and return the value as a malloc()ed string. This currently exists because the TO_INTERNAL_FORMAT() mechanism -- the normal way to do @@ -1934,21 +1879,40 @@ called recursively merely when I'm doing a simple conversion operation? It turns out this can and does happen, consistently, as a result of calling QUIT -- it happens consistently for complicated - reasons outlined in event-msw.c, WM_KEYDOWN handling.) */ + reasons outlined in event-msw.c, WM_KEYDOWN handling.) + + NOTE: These functions are also used at startup. */ Extbyte * convert_multibyte_to_unicode_malloc (const Extbyte *src, Bytecount n, int cp, Bytecount *size_out) { - Bytecount nout = MultiByteToWideChar (cp, 0, src, n, 0, 0); + Charcount nout = MultiByteToWideChar (cp, MBTOWC_OPTIONS, src, n, 0, 0); Extbyte *outp = xnew_array (Extbyte, nout * sizeof (WCHAR)); - MultiByteToWideChar (cp, 0, src, n, (LPWSTR) outp, nout); + MultiByteToWideChar (cp, MBTOWC_OPTIONS, src, n, (LPWSTR) outp, nout); if (size_out) *size_out = nout * sizeof (WCHAR); return outp; } +Extbyte * +convert_unicode_to_multibyte_malloc (const Extbyte *src, Bytecount n, + int cp, Bytecount *size_out) +{ + Bytecount nout = WideCharToMultiByte (cp, WCTOMB_OPTIONS, (LPWSTR) src, + n / sizeof (WCHAR), + 0, 0, WCTOMB_INVALID_STRING, 0); + Extbyte *outp = xnew_array (Extbyte, nout); + + WideCharToMultiByte (cp, WCTOMB_OPTIONS, (LPWSTR) src, + n / sizeof (WCHAR), (LPSTR) outp, nout, + WCTOMB_INVALID_STRING, 0); + if (size_out) + *size_out = nout; + return outp; +} + /* Convert MS Windows multibyte to internal, with specified code page. See above for why this exists, and the TO_INTERNAL_FORMAT() macros aren't just used. */ @@ -1972,6 +1936,69 @@ return intdata; } +static void +unicode_multibyte_convert_now_damn_it (const void *src, Bytecount src_size, + int to_unicode, void **dst, + Bytecount *dst_size, int cp) +{ + if (to_unicode) + { + Charcount nout = MultiByteToWideChar (cp, MBTOWC_OPTIONS, (LPSTR) src, + src_size, 0, 0); + Extbyte *outp = (Extbyte *) stack_like_malloc (nout * sizeof (WCHAR)); + + MultiByteToWideChar (cp, MBTOWC_OPTIONS, (LPSTR) src, src_size, + (LPWSTR) outp, nout); + *dst = (void *) outp; + *dst_size = nout * sizeof (WCHAR); + } + else + { + Bytecount nout = WideCharToMultiByte (cp, WCTOMB_OPTIONS, (LPWSTR) src, + src_size / sizeof (WCHAR), + 0, 0, WCTOMB_INVALID_STRING, 0); + Extbyte *outp = (Extbyte *) stack_like_malloc (nout); + + WideCharToMultiByte (cp, WCTOMB_OPTIONS, (LPWSTR) src, + src_size / sizeof (WCHAR), (LPSTR) outp, nout, + WCTOMB_INVALID_STRING, 0); + *dst = (void *) outp; + *dst_size = nout; + } +} + +Bytecount +unicode_multibyte_convert_size (const char *srctext, const void *src, + Bytecount src_size, int to_unicode, int cp) +{ + alloca_convert_vals vals; + + assert (find_pos_of_existing_active_alloca_convert (srctext) < 0); + + vals.srctext = srctext; + + unicode_multibyte_convert_now_damn_it (src, src_size, to_unicode, &vals.dst, + &vals.dst_size, cp); + + Dynarr_add (active_alloca_convert, vals); + return vals.dst_size; +} + +void * +unicode_multibyte_convert_copy_data (const char *srctext, void *alloca_data) +{ + alloca_convert_vals *vals; + int i = find_pos_of_existing_active_alloca_convert (srctext); + + assert (i >= 0); + vals = Dynarr_atp (active_alloca_convert, i); + assert (alloca_data); + memcpy (alloca_data, vals->dst, vals->dst_size); + stack_like_free (vals->dst); + Dynarr_delete (active_alloca_convert, i); + return alloca_data; +} + /* Convert multibyte to Unicode according to the specified code page and append the results onto the specified Dynarr. See above. */ @@ -1979,15 +2006,33 @@ convert_multibyte_to_unicode_dynarr (const Extbyte *src, Bytecount n, int cp, unsigned_char_dynarr *dst) { - Bytecount nout = MultiByteToWideChar (cp, 0, src, n, 0, 0); + Charcount nout = MultiByteToWideChar (cp, MBTOWC_OPTIONS, src, n, 0, 0); void *outp; Dynarr_add_many (dst, 0, nout * sizeof (WCHAR)); /* dynarr's buffer may be realloc()ed by call above, so access it after */ outp = Dynarr_atp (dst, Dynarr_length (dst) - nout * sizeof (WCHAR)); - MultiByteToWideChar (cp, 0, src, n, (LPWSTR) outp, nout); + MultiByteToWideChar (cp, MBTOWC_OPTIONS, src, n, (LPWSTR) outp, nout); } +void +convert_unicode_to_multibyte_dynarr (const Extbyte *src, Bytecount n, + int cp, unsigned_char_dynarr *dst) +{ + Bytecount nout = WideCharToMultiByte (cp, WCTOMB_OPTIONS, (LPWSTR) src, + n / sizeof (WCHAR), + 0, 0, WCTOMB_INVALID_STRING, 0); + void *outp; + + Dynarr_add_many (dst, 0, nout); + /* dynarr's buffer may be realloc()ed by call above, so access it after */ + outp = Dynarr_atp (dst, Dynarr_length (dst) - nout); + WideCharToMultiByte (cp, WCTOMB_OPTIONS, (LPWSTR) src, + n / sizeof (WCHAR), (LPSTR) outp, nout, + WCTOMB_INVALID_STRING, 0); +} + + /* Convert MS Windows multibyte to Unicode. */ static Bytecount @@ -2054,20 +2099,8 @@ else data->partial_byte_present = 0; - { - int nout = WideCharToMultiByte (data->cp, WC_COMPOSITECHECK, - (LPWSTR) new_src, n / sizeof (WCHAR), - 0, 0, "~", 0); - void *outp; - - Dynarr_add_many (dst, 0, nout); - /* dynarr's buffer may be realloc()ed by call above, so access it - after */ - outp = Dynarr_atp (dst, Dynarr_length (dst) - nout); - WideCharToMultiByte (data->cp, WC_COMPOSITECHECK, (LPWSTR) new_src, - n / sizeof (WCHAR), - (LPSTR) outp, nout, "~", 0); - } + convert_unicode_to_multibyte_dynarr ((Extbyte *) new_src, n, data->cp, + dst); } return orign; }
--- a/src/keymap.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/keymap.c Thu Nov 04 23:08:28 2004 +0000 @@ -1320,13 +1320,13 @@ accept these as aliases for the "real" names? */ (XSTRING_LENGTH (XSYMBOL (*keysym)->name) <= 3 && - (!qxestrcmp_c (name, "LFD") || - !qxestrcmp_c (name, "TAB") || - !qxestrcmp_c (name, "RET") || - !qxestrcmp_c (name, "ESC") || - !qxestrcmp_c (name, "DEL") || - !qxestrcmp_c (name, "SPC") || - !qxestrcmp_c (name, "BS"))) + (!qxestrcmp_ascii (name, "LFD") || + !qxestrcmp_ascii (name, "TAB") || + !qxestrcmp_ascii (name, "RET") || + !qxestrcmp_ascii (name, "ESC") || + !qxestrcmp_ascii (name, "DEL") || + !qxestrcmp_ascii (name, "SPC") || + !qxestrcmp_ascii (name, "BS"))) #endif /* unused */ ) invalid_argument @@ -1338,7 +1338,7 @@ otherwise have the same problem as above. (Gag!) We silently accept these as aliases for the "real" names. */ - else if (!qxestrncmp_c (name, "kp_", 3)) + else if (!qxestrncmp_ascii (name, "kp_", 3)) { /* Likewise, the obsolete keysym binding of kp_.* should not lose. */ DECLARE_EISTRING (temp);
--- a/src/libsst.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/libsst.c Thu Nov 04 23:08:28 2004 +0000 @@ -147,7 +147,7 @@ /* These are tables of values to be loaded into various gain registers. */ -static UChar_Binary ger_table[][2] = { +static Binbyte ger_table[][2] = { 0xaa, 0xaa, /* -10db */ 0x79, 0xac, 0x41, 0x99, @@ -180,7 +180,7 @@ }; -static UChar_Binary gr_gx_table[][2] = { +static Binbyte gr_gx_table[][2] = { 0x8b, 0x7c, /* -18db */ 0x8b, 0x35, 0x8b, 0x24, @@ -330,7 +330,7 @@ Extbyte buf [255]; struct audio_ioctl ai; int dval1, dval2, tval, rval; - UChar_Binary oldmmr2, newmmr2; + Binbyte oldmmr2, newmmr2; if ( dhz1 == 0 ) dval1 = 0;
--- a/src/linuxplay.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/linuxplay.c Thu Nov 04 23:08:28 2004 +0000 @@ -72,7 +72,7 @@ static int mix_fd; static int audio_vol; static int audio_fd; -static Char_ASCII *audio_dev = "/dev/dsp"; +static Ascbyte *audio_dev = "/dev/dsp"; /* Intercept SIGINT and SIGHUP in order to close the audio and mixer devices before terminating sound output; this requires reliable @@ -267,7 +267,7 @@ Returns 1 on succes. 0 otherwise. */ static int -linux_play_data_or_file(int fd, UChar_Binary *data, +linux_play_data_or_file(int fd, Binbyte *data, int length, int volume) { size_t (*parsesndfile)(void **dayta,size_t *sz,void **outbuf); @@ -276,7 +276,7 @@ int fmt,speed,tracks; void *pptr, *optr, *cptr, *sptr; int wrtn,rrtn,crtn,prtn; - UChar_Binary sndbuf[SNDBUFSZ]; + Binbyte sndbuf[SNDBUFSZ]; /* We need to read at least the header information before we can start doing anything */ @@ -388,7 +388,7 @@ /* Call "linux_play_data_or_file" with the appropriate parameters for playing pre-loaded data */ int -play_sound_data (UChar_Binary *data, int length, int volume) +play_sound_data (Binbyte *data, int length, int volume) { return linux_play_data_or_file(-1,data,length,volume); }
--- a/src/lisp.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/lisp.h Thu Nov 04 23:08:28 2004 +0000 @@ -1,7 +1,7 @@ /* Fundamental definitions for XEmacs Lisp interpreter. Copyright (C) 1985-1987, 1992-1995 Free Software Foundation, Inc. Copyright (C) 1993-1996 Richard Mlynarik. - Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003 Ben Wing. + Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2004 Ben Wing. This file is part of XEmacs. @@ -57,6 +57,40 @@ /* general definitions */ /************************************************************************/ +/* Conventions in comments: + + "Mule-izing" is the process of going through a file and eliminating + assumptions that the internal format (Ibyte * text) is the same as the + external format used by library routines. Mule-ization should also + include replacing *ALL* raw references to `char' or `unsigned char' with + one of the self-documenting types created below. How exactly to do the + conversion, and how to write correctly Mule-ized code, is described in + the internals manual. Files that say "This file is Mule-ized" have + been reviewed at some point; that's not to say that incorrect code hasn't + crept in, though. + + "Unicode-splitting" is the process of fixing a file so that it will + handle external text in Unicode under Microsoft Windows, as appropriate. + ("splitting" because it needs to handle either Unicode or variable-width + multibyte depending on the OS -- NT or 9x). See intl-win32.c. + + #### is a way of marking problems of any sort. + + !!#### marks places that are not properly Mule-ized. + + &&#### marks places that need to be fixed in order for the "8-bit mule" + conversion to work correctly, i.e. in order to support multiple different + buffer formats under Mule, including a fixed 8-bit format. + + ^^#### marks places that need to be fixed in order to eliminate the + assumption that Ibyte * text is composed of 1-byte units (e.g. UTF-16 + is composed of 2-byte units and might be a possible format to consider + for Ibyte * text). + + %%#### marks places that need work for KKCC (the new garbage collector). + + */ + /* -------------------------- include files --------------------- */ /* We include the following generally useful header files so that you @@ -133,37 +167,11 @@ #define trapping_problems_checking_assert_with_message(assertion, msg) #endif -/* ------------------------ definition of EMACS_INT ------------------- */ - -/* EMACS_INT is the underlying integral type into which a Lisp_Object must fit. - In particular, it must be large enough to contain a pointer. - config.h can override this, e.g. to use `long long' for bigger lisp ints. - - #### In point of fact, it would NOT be a good idea for config.h to mess - with EMACS_INT. A lot of code makes the basic assumption that EMACS_INT - is the size of a pointer. */ - -#ifndef SIZEOF_EMACS_INT -# define SIZEOF_EMACS_INT SIZEOF_VOID_P -#endif - -#ifndef EMACS_INT -# if SIZEOF_EMACS_INT == SIZEOF_LONG -# define EMACS_INT long -# elif SIZEOF_EMACS_INT == SIZEOF_INT -# define EMACS_INT int -# elif SIZEOF_EMACS_INT == SIZEOF_LONG_LONG -# define EMACS_INT long long -# else -# error Unable to determine suitable type for EMACS_INT -# endif -#endif - -#ifndef EMACS_UINT -# define EMACS_UINT unsigned EMACS_INT -#endif - -#define BITS_PER_EMACS_INT (SIZEOF_EMACS_INT * BITS_PER_CHAR) +/************************************************************************/ +/** Definitions of basic types **/ +/************************************************************************/ + +/* ------------- generic 8/16/32/64/128-bit integral types ------------ */ #if SIZEOF_SHORT == 2 #define INT_16_BIT short @@ -223,23 +231,99 @@ #define EFFICIENT_UINT_128_BIT UINT_128_BIT #endif -/* ------------------------ basic char/int typedefs ------------------- */ - -/* The definitions we put here use typedefs to attribute specific meaning - to types that by themselves are pretty general. Stuff pointed to by a - char * or unsigned char * will nearly always be one of four types: - a) pointer to internally-formatted text; b) pointer to text in some - external format, which can be defined as all formats other than the - internal one; c) pure ASCII text; d) binary data that is not meant to - be interpreted as text. [A fifth possible type "e) a general pointer - to memory" should be replaced with void *.] Using these more specific - types rather than the general ones helps avoid the confusions that - occur when the semantics of a char * argument being studied are unclear. - - Note that these typedefs are purely for documentation purposes; from +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#elif defined (HAVE_INTPTR_T_IN_SYS_TYPES_H) +/* included elsewhere */ +#elif SIZEOF_VOID_P == SIZEOF_INT +typedef int intptr_t; +typedef unsigned int uintptr_t; +#elif SIZEOF_VOID_P == SIZEOF_LONG +typedef long intptr_t; +typedef unsigned long uintptr_t; +#elif defined (SIZEOF_LONG_LONG) && SIZEOF_VOID_P == SIZEOF_LONG_LONG +typedef long long intptr_t; +typedef unsigned long long uintptr_t; +#else +/* Just pray. May break, may not. */ +typedef long intptr_t; +typedef unsigned long uintptr_t; +#endif + +/* ---------------------- definition of EMACS_INT --------------------- */ + +/* EMACS_INT is the underlying integral type into which a Lisp_Object must fit. + In particular, it must be large enough to contain a pointer. + config.h can override this, e.g. to use `long long' for bigger lisp ints. + + #### In point of fact, it would NOT be a good idea for config.h to mess + with EMACS_INT. A lot of code makes the basic assumption that EMACS_INT + is the size of a pointer. */ + +#ifndef SIZEOF_EMACS_INT +# define SIZEOF_EMACS_INT SIZEOF_VOID_P +#endif + +#ifndef EMACS_INT +# if SIZEOF_EMACS_INT == SIZEOF_LONG +# define EMACS_INT long +# elif SIZEOF_EMACS_INT == SIZEOF_INT +# define EMACS_INT int +# elif SIZEOF_EMACS_INT == SIZEOF_LONG_LONG +# define EMACS_INT long long +# else +# error Unable to determine suitable type for EMACS_INT +# endif +#endif + +#ifndef EMACS_UINT +# define EMACS_UINT unsigned EMACS_INT +#endif + +#define BITS_PER_EMACS_INT (SIZEOF_EMACS_INT * BITS_PER_CHAR) + +/* -------------------------- basic byte typedefs --------------------- */ + +/* The definitions we put here and in the next section use typedefs to + attribute specific meaning to types that by themselves are pretty + general. + + REMEMBER! These typedefs are purely for documentation purposes; from the C code's perspective, they are exactly equivalent to `char *', `unsigned char *', etc., so you can freely use them with library - functions declared as such. */ + functions declared as such. + + (See also "Byte/Character Types" in text.c) + + The basic semantics for `char': + + a) [Ibyte] pointer to internally-formatted text + b) [Extbyte] pointer to text in some external format, which can be + defined as all formats other than the internal one + c) [Ascbyte] pure ASCII text + d) [Binbyte] binary data that is not meant to be interpreted as text + e) [Rawbyte] general data in memory, where we don't care about whether + it's text or binary + f) [Boolbyte] a zero or a one + g) [Bitbyte] a byte used for bit fields + h) [Chbyte] null-semantics `char *'; used when casting an argument to + an external API where the the other types may not be + appropriate + + + Prefixing codes: + + C = plain char, when the base type is unsigned + U = unsigned + S = signed + + Ideally, XEmacs code should NEVER directly use `char' or any type + derived from it. This is for Mule-cleanliness. If you find yourself + wanting or needing to use `char' and one of the above six semantics does + not apply, add a new type of semantics; don't use `char' directly. + + See text.c under "Byte Types", and following sections. +*/ /* The data representing the text in a buffer is logically a set of Ibytes, declared as follows. */ @@ -251,9 +335,10 @@ are function arguments whose values are most commonly literal strings, or where you have to apply a stdlib string function to internal data. - In general, you should avoid this where possible and use Ibyte instead, - for consistency. For example, the new Mule workspace contains - Ibyte versions of the stdlib string functions. */ + In general, you should avoid this where possible and use Ascbyte if the + text is just ASCII (e.g. string literals) or otherwise Ibyte, for + consistency. For example, the new Mule workspace contains Ibyte + versions of the stdlib string functions. */ typedef char CIbyte; @@ -266,16 +351,51 @@ typedef char Extbyte; typedef unsigned char UExtbyte; -/* A byte in a string in binary format: */ -typedef char Char_Binary; -typedef signed char SChar_Binary; -typedef unsigned char UChar_Binary; +#define EXTTEXT_ZTERM_SIZE (sizeof (Extbyte)) /* A byte in a string in entirely US-ASCII format: (Nothing outside the range 00 - 7F) */ -typedef char Char_ASCII; -typedef unsigned char UChar_ASCII; +typedef char Ascbyte; +typedef unsigned char UAscbyte; + +/* A generic memory pointer, no text or binary semantics assumed. + In general, there should be no manipulation of the memory pointed to + by these pointers other than just copying it around. */ + +typedef unsigned char Rawbyte; +typedef char CRawbyte; + +/* A byte in a string in binary (not meant as text) format: */ + +typedef unsigned char Binbyte; +typedef char CBinbyte; +typedef signed char SBinbyte; + +/* A byte used to represent a boolean value: 0 or 1. + Normally use plain Boolint, and only use Boolbyte to save space. */ + +typedef char Boolbyte; + +/* A byte composed of bitfields. Hardly ever used. */ + +typedef unsigned char Bitbyte; + +/* A no-semantics `char'. Used (pretty-much) ONLY for casting arguments to + functions accepting a `char *', `unsigned char *', etc. where the other + types don't exactly apply and what you are logically concerned with is + the type of the function's argument and not its semantics. + + DO NOT DO NOT DO NOT DO NOT use this as a sloppy replacement for one of + the other types. If you're not using this as part of casting an + argument to a function call, and you're not Ben Wing, you're using it + wrong. Go find another one of the types. */ + +typedef char Chbyte; +typedef unsigned char UChbyte; +typedef signed char SChbyte; + +/* ------------------------ other text-related typedefs ------------------- */ /* To the user, a buffer is made up of characters. In the non-Mule world, characters and Ibytes are equivalent, restricted to the range 0 - 255. @@ -309,6 +429,39 @@ typedef int Raw_Ichar; +/* Internal text as a series of textual units (8-bit bytes in the old + "Mule" encoding -- still the standard internal encoding -- and in UTF-8, + but 16-bit bytes in UTF-16 and 32-bit bytes in UTF-32). See text.c. */ + +#ifdef UTF16_IBYTE_FORMAT +#define NON_ASCII_INTERNAL_FORMAT +typedef unsigned short Itext; +#else +typedef Ibyte Itext; +#endif +typedef EMACS_INT Textcount; + +#define ITEXT_SIZE (sizeof (Itext)) +/* Use this to emphasize that we are adding space for the zero-terminator */ +#define ITEXT_ZTERM_SIZE ITEXT_SIZE + +/* Wexttext is wchar_t on WIN32_NATIVE (and perhaps other systems that + support wchar_t's in library functions), and Extbyte otherwise. This is + used whenever we have to do any sort of manipulation of + externally-encoded strings -- generally a very bad idea, and unsafe, but + in some cases we have no choice (especially at startup, and esp. prior + to pdump, where we haven't loaded the Unicode tables necessary for + conversion under Windows). On platforms where the external encoding may + be Unicode (i.e. Windows), we always do our manipulations in Unicode, + converting to and from multibyte if necessary -- otherwise we'd have to + conditionalize on Unicode vs. multibyte all over the place, which is + just a nightmare. */ +#ifdef WIN32_NATIVE +#define WEXTTEXT_IS_WIDE +typedef wchar_t Wexttext; +#else +typedef Extbyte Wexttext; +#endif #if !defined (__cplusplus) || !defined (CPLUSPLUS_INTEGRAL_CLASSES_NOT_YET) @@ -797,25 +950,8 @@ typedef EMACS_INT Elemcount; /* Hash codes */ typedef unsigned long Hashcode; - -#ifdef HAVE_INTTYPES_H -#include <inttypes.h> -#elif defined(HAVE_INTPTR_T_IN_SYS_TYPES_H) -/* included elsewhere */ -#elif SIZEOF_VOID_P == SIZEOF_INT -typedef int intptr_t; -typedef unsigned int uintptr_t; -#elif SIZEOF_VOID_P == SIZEOF_LONG -typedef long intptr_t; -typedef unsigned long uintptr_t; -#elif defined(SIZEOF_LONG_LONG) && SIZEOF_VOID_P == SIZEOF_LONG_LONG -typedef long long intptr_t; -typedef unsigned long long uintptr_t; -#else -/* Just pray. May break, may not. */ -typedef long intptr_t; -typedef unsigned long uintptr_t; -#endif +/* Booleans */ +typedef int Boolint; /* ------------------------ basic compiler defines ------------------- */ @@ -907,7 +1043,7 @@ #ifdef USE_ASSERTIONS /* Highly dubious kludge */ /* (thanks, Jamie, I feel better now -- ben) */ -MODULE_API void assert_failed (const char *, int, const char *); +MODULE_API void assert_failed (const Ascbyte *, int, const Ascbyte *); # define abort() (assert_failed (__FILE__, __LINE__, "abort()")) # define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x)) # define assert_with_message(x, msg) \ @@ -926,54 +1062,38 @@ # endif #endif -/* EMACS_INT is the underlying integral type into which a Lisp_Object must fit. - In particular, it must be large enough to contain a pointer. - config.h can override this, e.g. to use `long long' for bigger lisp ints. - - #### In point of fact, it would NOT be a good idea for config.h to mess - with EMACS_INT. A lot of code makes the basic assumption that EMACS_INT - is the size of a pointer. */ - -#ifndef SIZEOF_EMACS_INT -# define SIZEOF_EMACS_INT SIZEOF_VOID_P -#endif +/************************************************************************/ +/** Memory allocation **/ +/************************************************************************/ /* ------------------------ simple memory allocation ------------------- */ -/* Memory allocation */ -void malloc_warning (const char *); +/* Basic memory allocation and freeing functions */ +void malloc_warning (const Ascbyte *); MODULE_API void *xmalloc (Bytecount size) ATTRIBUTE_MALLOC; MODULE_API void *xmalloc_and_zero (Bytecount size) ATTRIBUTE_MALLOC; MODULE_API void *xrealloc (void *, Bytecount size) ATTRIBUTE_MALLOC; -MODULE_API char *xstrdup (const char *) ATTRIBUTE_MALLOC; -/* generally useful */ -#define countof(x) ((int) (sizeof(x)/sizeof((x)[0]))) -#define xnew(type) ((type *) xmalloc (sizeof (type))) -#define xnew_array(type, len) ((type *) xmalloc ((len) * sizeof (type))) -#define xnew_and_zero(type) ((type *) xmalloc_and_zero (sizeof (type))) -#define xzero(lvalue) ((void) memset (&(lvalue), '\0', sizeof (lvalue))) -#define xnew_array_and_zero(type, len) ((type *) xmalloc_and_zero ((len) * sizeof (type))) -#define XREALLOC_ARRAY(ptr, type, len) ((void) (ptr = (type *) xrealloc (ptr, (len) * sizeof (type)))) -#define alloca_new(type) ((type *) ALLOCA (sizeof (type))) -#define alloca_array(type, len) ((type *) ALLOCA ((len) * sizeof (type))) - -MODULE_API void *xemacs_c_alloca (unsigned int size) ATTRIBUTE_MALLOC; - -MODULE_API int record_unwind_protect_freeing (void *ptr); - -DECLARE_INLINE_HEADER ( -void * -xmalloc_and_record_unwind (Bytecount size) -) -{ - void *ptr = xmalloc (size); - record_unwind_protect_freeing (ptr); - return ptr; -} - -/* Stack allocation. - - Allocating excessively large blocks on the stack can cause crashes. +MODULE_API Chbyte *xstrdup (const Chbyte *) ATTRIBUTE_MALLOC; + +/* Basic free function */ + +MODULE_API void xfree_1 (void *); +#ifdef ERROR_CHECK_MALLOC +/* This used to use a temporary variable, which both avoided the multiple + evaluation and obviated the need for the TYPE argument. But that triggered + complaints under strict aliasing. #### There should be a better way. */ +#define xfree(lvalue, type) do \ +{ \ + xfree_1 (lvalue); \ + VOIDP_CAST (lvalue) = (void *) 0xDEADBEEF; \ +} while (0) +#else +#define xfree(lvalue,type) xfree_1 (lvalue) +#endif /* ERROR_CHECK_MALLOC */ + +/* ------------------------ stack allocation -------------------------- */ + +/* Allocating excessively large blocks on the stack can cause crashes. We provide MALLOC_OR_ALLOCA() below for places where it's likely that large amounts will be allocated; it mallocs the block if it's too big. Unfortunately, that requires a call to unbind_to() at the end of the @@ -1047,6 +1167,20 @@ #define ALLOCA_FUNCALL_OK(size) ALLOCA (size) #endif +MODULE_API void *xemacs_c_alloca (unsigned int size) ATTRIBUTE_MALLOC; + +MODULE_API int record_unwind_protect_freeing (void *ptr); + +DECLARE_INLINE_HEADER ( +void * +xmalloc_and_record_unwind (Bytecount size) +) +{ + void *ptr = xmalloc (size); + record_unwind_protect_freeing (ptr); + return ptr; +} + /* WARNING: If you use this, you must unbind_to() at the end of your function! */ @@ -1058,6 +1192,46 @@ (need_to_check_c_alloca ? xemacs_c_alloca (0) : 0, \ alloca (__temp_alloca_size__))) +/* -------------- convenience functions for memory allocation ------------- */ + +#define countof(x) ((int) (sizeof(x)/sizeof((x)[0]))) +#define xnew(type) ((type *) xmalloc (sizeof (type))) +#define xnew_array(type, len) ((type *) xmalloc ((len) * sizeof (type))) +#define xnew_and_zero(type) ((type *) xmalloc_and_zero (sizeof (type))) +#define xzero(lvalue) ((void) memset (&(lvalue), '\0', sizeof (lvalue))) +#define xnew_array_and_zero(type, len) ((type *) xmalloc_and_zero ((len) * sizeof (type))) + +#define alloca_new(type) ((type *) ALLOCA (sizeof (type))) +#define alloca_array(type, len) ((type *) ALLOCA ((len) * sizeof (type))) + +#define alloca_itexts(num) alloca_array (Itext, num) +#define alloca_ibytes(num) alloca_array (Ibyte, num) +#define alloca_extbytes(num) alloca_array (Extbyte, num) +#define alloca_rawbytes(num) alloca_array (Rawbyte, num) +#define alloca_binbytes(num) alloca_array (Binbyte, num) +#define alloca_ascbytes(num) alloca_array (Ascbyte, num) +#define xmalloc_itexts(num) xnew_array (Itext, num) +#define xnew_ibytes(num) xnew_array (Ibyte, num) +#define xnew_extbytes(num) xnew_array (Extbyte, num) +#define xnew_rawbytes(num) xnew_array (Rawbyte, num) +#define xnew_binbytes(num) xnew_array (Binbyte, num) +#define xnew_ascbytes(num) xnew_array (Ascbyte, num) + +/* Make an alloca'd copy of a Ibyte * */ +#define IBYTE_STRING_TO_ALLOCA(p, lval) \ +do { \ + Ibyte **_bsta_ = (Ibyte **) &(lval); \ + const Ibyte *_bsta_2 = (p); \ + Bytecount _bsta_3 = qxestrlen (_bsta_2); \ + *_bsta_ = alloca_ibytes (1 + _bsta_3); \ + memcpy (*_bsta_, _bsta_2, 1 + _bsta_3); \ +} while (0) + +/* ----------------- convenience functions for reallocation --------------- */ + +#define XREALLOC_ARRAY(ptr, type, len) \ + ((void) (ptr = (type *) xrealloc (ptr, (len) * sizeof (type)))) + /* also generally useful if you want to avoid arbitrary size limits but don't need a full dynamic array. Assumes that BASEVAR points to a malloced array of TYPE objects (or possibly a NULL pointer, @@ -1078,17 +1252,6 @@ } \ } while (0) -MODULE_API void xfree_1 (void *); -#ifdef ERROR_CHECK_MALLOC -#define xfree(lvalue,type) do \ -{ \ - xfree_1 (lvalue); \ - lvalue = (type) 0xDEADBEEF; \ -} while (0) -#else -#define xfree(lvalue,type) xfree_1 (lvalue) -#endif /* ERROR_CHECK_MALLOC */ - /* ------------------------ dynamic arrays ------------------- */ #ifdef ERROR_CHECK_STRUCTURES @@ -1114,7 +1277,7 @@ } Dynarr; MODULE_API void *Dynarr_newf (int elsize); -MODULE_API void Dynarr_resize (void *dy, int size); +MODULE_API void Dynarr_resize (void *dy, Elemcount size); MODULE_API void Dynarr_insert_many (void *d, const void *el, int len, int start); MODULE_API void Dynarr_delete_many (void *d, int start, int len); MODULE_API void Dynarr_free (void *d); @@ -1131,7 +1294,7 @@ #ifdef ERROR_CHECK_STRUCTURES DECLARE_INLINE_HEADER ( Dynarr * -Dynarr_verify_1 (void *d, const char *file, int line) +Dynarr_verify_1 (void *d, const Ascbyte *file, int line) ) { Dynarr *dy = (Dynarr *) d; @@ -1142,7 +1305,7 @@ DECLARE_INLINE_HEADER ( Dynarr * -Dynarr_verify_mod_1 (void *d, const char *file, int line) +Dynarr_verify_mod_1 (void *d, const Ascbyte *file, int line) ) { Dynarr *dy = (Dynarr *) d; @@ -1216,7 +1379,12 @@ Bytecount Dynarr_memory_usage (void *d, struct overhead_stats *stats); #endif -/* Counts of bytes or chars */ +void *stack_like_malloc (Bytecount size); +void stack_like_free (void *val); + +/************************************************************************/ +/** Definitions of more complex types **/ +/************************************************************************/ /* Note that the simplest typedefs are near the top of this file. */ @@ -1671,22 +1839,13 @@ macros will hit an assertion failure if the structure is ill-formed; the external-list macros will signal an error in this case, either a malformed-list error or a circular-list error. - - Note also that the simplest external list iterator, EXTERNAL_LIST_LOOP, - does *NOT* check for circularities. Therefore, make sure you call - QUIT each iteration or so. However, it's probably easier just to use - EXTERNAL_LIST_LOOP_2, which is easier to use in any case. */ -/* LIST_LOOP and EXTERNAL_LIST_LOOP are the simplest macros. They don't - require brace surrounding, and iterate through a list, which may or may - not known to be syntactically correct. EXTERNAL_LIST_LOOP is for those - not known to be correct, and it detects and signals a malformed list - error when encountering a problem. Circularities, however, are not - handled, and cause looping forever, so make sure to include a QUIT. - These functions also accept two args, TAIL (set progressively to each - cons starting with the first), and LIST, the list to iterate over. - TAIL needs to be defined by the program. +/* LIST_LOOP is a simple, old-fashioned macro. It doesn't require brace + surrounding, and iterates through a list, which may or may not known to + be syntactically correct. It accepts two args, TAIL (set progressively + to each cons starting with the first), and LIST, the list to iterate + over. TAIL needs to be defined by the caller. In each iteration, you can retrieve the current list item using XCAR (tail), or destructively modify the list using XSETCAR (tail, @@ -1697,12 +1856,6 @@ !NILP (tail); \ tail = XCDR (tail)) -#define EXTERNAL_LIST_LOOP(tail, list) \ - for (tail = list; !NILP (tail); tail = XCDR (tail)) \ - if (!CONSP (tail)) \ - signal_malformed_list_error (list); \ - else - /* The following macros are the "core" macros for list traversal. *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. *** @@ -1757,6 +1910,22 @@ PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, hare_##elt, \ tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH) + +#define GC_EXTERNAL_LIST_LOOP_2(elt, list) \ +do { \ + XGCDECL3 (elt); \ + Lisp_Object elt, hare_##elt, tortoise_##elt; \ + EMACS_INT len_##elt; \ + XGCPRO3 (elt, elt, hare_##elt, tortoise_##elt); \ + PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, hare_##elt, \ + tortoise_##elt, \ + CIRCULAR_LIST_SUSPICION_LENGTH) + +#define END_GC_EXTERNAL_LIST_LOOP(elt) \ + XUNGCPRO (elt); \ +} \ +while (0) + #define EXTERNAL_LIST_LOOP_3(elt, list, tail) \ Lisp_Object elt, tail, tortoise_##elt; \ EMACS_INT len_##elt; \ @@ -2036,23 +2205,6 @@ ((void) signal_circular_property_list_error (list)) : \ ((void) 0))))) -/* For a property list (alternating keywords/values) that may not be - in valid list format -- will signal an error if the list is not in - valid format. CONSVAR is used to keep track of the iterations - without modifying PLIST. - - We have to be tricky to still keep the same C format.*/ -#define EXTERNAL_PROPERTY_LIST_LOOP(tail, key, value, plist) \ - for (tail = plist; \ - (CONSP (tail) && CONSP (XCDR (tail)) ? \ - (key = XCAR (tail), value = XCAR (XCDR (tail))) : \ - (key = Qunbound, value = Qunbound)), \ - !NILP (tail); \ - tail = XCDR (XCDR (tail))) \ - if (UNBOUNDP (key)) \ - Fsignal (Qmalformed_property_list, list1 (plist)); \ - else - #define PROPERTY_LIST_LOOP(tail, key, value, plist) \ for (tail = plist; \ NILP (tail) ? 0 : \ @@ -2387,7 +2539,7 @@ DECLARE_INLINE_HEADER ( Ichar -XCHAR_1 (Lisp_Object obj, const char *file, int line) +XCHAR_1 (Lisp_Object obj, const Ascbyte *file, int line) ) { assert_at_line (CHARP (obj), file, line); @@ -2455,7 +2607,7 @@ DECLARE_INLINE_HEADER ( EMACS_INT -XINT_1 (Lisp_Object obj, const char *file, int line) +XINT_1 (Lisp_Object obj, const Ascbyte *file, int line) ) { assert_at_line (INTP (obj), file, line); @@ -2464,7 +2616,7 @@ DECLARE_INLINE_HEADER ( EMACS_INT -XCHAR_OR_INT_1 (Lisp_Object obj, const char *file, int line) +XCHAR_OR_INT_1 (Lisp_Object obj, const Ascbyte *file, int line) ) { assert_at_line (INTP (obj) || CHARP (obj), file, line); @@ -3095,114 +3247,93 @@ BEGIN_C_DECLS +#define XGCDECL1(x) struct gcpro x##cpro1 +#define XGCDECL2(x) struct gcpro x##cpro1, x##cpro2 +#define XGCDECL3(x) struct gcpro x##cpro1, x##cpro2, x##cpro3 +#define XGCDECL4(x) struct gcpro x##cpro1, x##cpro2, x##cpro3, x##cpro4 +#define XGCDECL5(x) struct gcpro x##cpro1, x##cpro2, x##cpro3, x##cpro4, x##cpro5 + #ifdef DEBUG_GCPRO -MODULE_API void debug_gcpro1 (char *, int, struct gcpro *, Lisp_Object *); -MODULE_API void debug_gcpro2 (char *, int, struct gcpro *, struct gcpro *, +MODULE_API void debug_gcpro1 (Ascbyte *, int, struct gcpro *, Lisp_Object *); +MODULE_API void debug_gcpro2 (Ascbyte *, int, struct gcpro *, struct gcpro *, Lisp_Object *, Lisp_Object *); -MODULE_API void debug_gcpro3 (char *, int, struct gcpro *, struct gcpro *, +MODULE_API void debug_gcpro3 (Ascbyte *, int, struct gcpro *, struct gcpro *, struct gcpro *, Lisp_Object *, Lisp_Object *, Lisp_Object *); -MODULE_API void debug_gcpro4 (char *, int, struct gcpro *, struct gcpro *, +MODULE_API void debug_gcpro4 (Ascbyte *, int, struct gcpro *, struct gcpro *, struct gcpro *, struct gcpro *, Lisp_Object *, Lisp_Object *, Lisp_Object *, Lisp_Object *); -MODULE_API void debug_gcpro5 (char *, int, struct gcpro *, struct gcpro *, +MODULE_API void debug_gcpro5 (Ascbyte *, int, struct gcpro *, struct gcpro *, struct gcpro *, struct gcpro *, struct gcpro *, Lisp_Object *, Lisp_Object *, Lisp_Object *, Lisp_Object *, Lisp_Object *); -MODULE_API void debug_ungcpro(char *, int, struct gcpro *); - -#define GCPRO1(v) \ - debug_gcpro1 (__FILE__, __LINE__,&gcpro1,&v) -#define GCPRO2(v1,v2) \ - debug_gcpro2 (__FILE__, __LINE__,&gcpro1,&gcpro2,&v1,&v2) -#define GCPRO3(v1,v2,v3) \ - debug_gcpro3 (__FILE__, __LINE__,&gcpro1,&gcpro2,&gcpro3,&v1,&v2,&v3) -#define GCPRO4(v1,v2,v3,v4) \ - debug_gcpro4 (__FILE__, __LINE__,&gcpro1,&gcpro2,&gcpro3,&gcpro4,\ +MODULE_API void debug_ungcpro(Ascbyte *, int, struct gcpro *); + +#define XGCPRO1(x,v) \ + debug_gcpro1 (__FILE__, __LINE__,&x##cpro1,&v) +#define XGCPRO2(x,v1,v2) \ + debug_gcpro2 (__FILE__, __LINE__,&x##cpro1,&x##cpro2,&v1,&v2) +#define XGCPRO3(x,v1,v2,v3) \ + debug_gcpro3 (__FILE__, __LINE__,&x##cpro1,&x##cpro2,&x##cpro3, \ + &v1,&v2,&v3) +#define XGCPRO4(x,v1,v2,v3,v4) \ + debug_gcpro4 (__FILE__, __LINE__,&x##cpro1,&x##cpro2,&x##cpro3, \ + &x##cpro4, \ &v1,&v2,&v3,&v4) -#define GCPRO5(v1,v2,v3,v4,v5) \ - debug_gcpro5 (__FILE__, __LINE__,&gcpro1,&gcpro2,&gcpro3,&gcpro4,&gcpro5,\ +#define XGCPRO5(x,v1,v2,v3,v4,v5) \ + debug_gcpro5 (__FILE__, __LINE__,&x##cpro1,&x##cpro2,&x##cpro3, \ + &x##cpro4,&x##cpro5, \ &v1,&v2,&v3,&v4,&v5) -#define UNGCPRO \ - debug_ungcpro(__FILE__, __LINE__,&gcpro1) - -#define NGCPRO1(v) \ - debug_gcpro1 (__FILE__, __LINE__,&ngcpro1,&v) -#define NGCPRO2(v1,v2) \ - debug_gcpro2 (__FILE__, __LINE__,&ngcpro1,&ngcpro2,&v1,&v2) -#define NGCPRO3(v1,v2,v3) \ - debug_gcpro3 (__FILE__, __LINE__,&ngcpro1,&ngcpro2,&ngcpro3,&v1,&v2,&v3) -#define NGCPRO4(v1,v2,v3,v4) \ - debug_gcpro4 (__FILE__, __LINE__,&ngcpro1,&ngcpro2,&ngcpro3,&ngcpro4,\ - &v1,&v2,&v3,&v4) -#define NGCPRO5(v1,v2,v3,v4,v5) \ - debug_gcpro5 (__FILE__, __LINE__,&ngcpro1,&ngcpro2,&ngcpro3,&ngcpro4,\ - &ngcpro5,&v1,&v2,&v3,&v4,&v5) -#define NUNGCPRO \ - debug_ungcpro(__FILE__, __LINE__,&ngcpro1) - -#define NNGCPRO1(v) \ - debug_gcpro1 (__FILE__, __LINE__,&nngcpro1,&v) -#define NNGCPRO2(v1,v2) \ - debug_gcpro2 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&v1,&v2) -#define NNGCPRO3(v1,v2,v3) \ - debug_gcpro3 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&nngcpro3,&v1,&v2,&v3) -#define NNGCPRO4(v1,v2,v3,v4) \ - debug_gcpro4 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&nngcpro3,&nngcpro4,\ - &v1,&v2,&v3,&v4) -#define NNGCPRO5(v1,v2,v3,v4,v5) \ - debug_gcpro5 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&nngcpro3,&nngcpro4,\ - &nngcpro5,&v1,&v2,&v3,&v4,&v5) -#define NNUNGCPRO \ - debug_ungcpro(__FILE__, __LINE__,&nngcpro1) +#define XUNGCPRO(x) \ + debug_ungcpro(__FILE__, __LINE__,&x##cpro1) #else /* ! DEBUG_GCPRO */ -#define GCPRO1(var1) ((void) ( \ - gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \ - gcprolist = &gcpro1 )) - -#define GCPRO2(var1, var2) ((void) ( \ - gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \ - gcpro2.next = &gcpro1, gcpro2.var = &var2, gcpro2.nvars = 1, \ - gcprolist = &gcpro2 )) - -#define GCPRO3(var1, var2, var3) ((void) ( \ - gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \ - gcpro2.next = &gcpro1, gcpro2.var = &var2, gcpro2.nvars = 1, \ - gcpro3.next = &gcpro2, gcpro3.var = &var3, gcpro3.nvars = 1, \ - gcprolist = &gcpro3 )) - -#define GCPRO4(var1, var2, var3, var4) ((void) ( \ - gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \ - gcpro2.next = &gcpro1, gcpro2.var = &var2, gcpro2.nvars = 1, \ - gcpro3.next = &gcpro2, gcpro3.var = &var3, gcpro3.nvars = 1, \ - gcpro4.next = &gcpro3, gcpro4.var = &var4, gcpro4.nvars = 1, \ - gcprolist = &gcpro4 )) - -#define GCPRO5(var1, var2, var3, var4, var5) ((void) ( \ - gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \ - gcpro2.next = &gcpro1, gcpro2.var = &var2, gcpro2.nvars = 1, \ - gcpro3.next = &gcpro2, gcpro3.var = &var3, gcpro3.nvars = 1, \ - gcpro4.next = &gcpro3, gcpro4.var = &var4, gcpro4.nvars = 1, \ - gcpro5.next = &gcpro4, gcpro5.var = &var5, gcpro5.nvars = 1, \ - gcprolist = &gcpro5 )) - -#define GCPRO1_ARRAY(array, n) ((void) ( \ - gcpro1.next = gcprolist, gcpro1.var = array, gcpro1.nvars = n, \ - gcprolist = &gcpro1 )) - -#define GCPRO2_ARRAY(array1, n1, array2, n2) ((void) ( \ - gcpro1.next = gcprolist, gcpro1.var = array1, gcpro1.nvars = n1, \ - gcpro2.next = &gcpro1, gcpro2.var = array2, gcpro2.nvars = n2, \ - gcprolist = &gcpro2 )) - -#define GCPRO3_ARRAY(array1, n1, array2, n2, array3, n3) ((void) ( \ - gcpro1.next = gcprolist, gcpro1.var = array1, gcpro1.nvars = n1, \ - gcpro2.next = &gcpro1, gcpro2.var = array2, gcpro2.nvars = n2, \ - gcpro3.next = &gcpro2, gcpro3.var = array3, gcpro3.nvars = n3, \ - gcprolist = &gcpro3 )) +#define XGCPRO1(x, var1) ((void) ( \ + x##cpro1.next = gcprolist, x##cpro1.var = &var1, x##cpro1.nvars = 1, \ + gcprolist = &x##cpro1 )) + +#define XGCPRO2(x, var1, var2) ((void) ( \ + x##cpro1.next = gcprolist, x##cpro1.var = &var1, x##cpro1.nvars = 1, \ + x##cpro2.next = &x##cpro1, x##cpro2.var = &var2, x##cpro2.nvars = 1, \ + gcprolist = &x##cpro2 )) + +#define XGCPRO3(x, var1, var2, var3) ((void) ( \ + x##cpro1.next = gcprolist, x##cpro1.var = &var1, x##cpro1.nvars = 1, \ + x##cpro2.next = &x##cpro1, x##cpro2.var = &var2, x##cpro2.nvars = 1, \ + x##cpro3.next = &x##cpro2, x##cpro3.var = &var3, x##cpro3.nvars = 1, \ + gcprolist = &x##cpro3 )) + +#define XGCPRO4(x, var1, var2, var3, var4) ((void) ( \ + x##cpro1.next = gcprolist, x##cpro1.var = &var1, x##cpro1.nvars = 1, \ + x##cpro2.next = &x##cpro1, x##cpro2.var = &var2, x##cpro2.nvars = 1, \ + x##cpro3.next = &x##cpro2, x##cpro3.var = &var3, x##cpro3.nvars = 1, \ + x##cpro4.next = &x##cpro3, x##cpro4.var = &var4, x##cpro4.nvars = 1, \ + gcprolist = &x##cpro4 )) + +#define XGCPRO5(x, var1, var2, var3, var4, var5) ((void) ( \ + x##cpro1.next = gcprolist, x##cpro1.var = &var1, x##cpro1.nvars = 1, \ + x##cpro2.next = &x##cpro1, x##cpro2.var = &var2, x##cpro2.nvars = 1, \ + x##cpro3.next = &x##cpro2, x##cpro3.var = &var3, x##cpro3.nvars = 1, \ + x##cpro4.next = &x##cpro3, x##cpro4.var = &var4, x##cpro4.nvars = 1, \ + x##cpro5.next = &x##cpro4, x##cpro5.var = &var5, x##cpro5.nvars = 1, \ + gcprolist = &x##cpro5 )) + +#define XGCPRO1_ARRAY(x, array, n) ((void) ( \ + x##cpro1.next = gcprolist, x##cpro1.var = array, x##cpro1.nvars = n, \ + gcprolist = &x##cpro1 )) + +#define XGCPRO2_ARRAY(x, array1, n1, array2, n2) ((void) ( \ + x##cpro1.next = gcprolist, x##cpro1.var = array1, x##cpro1.nvars = n1, \ + x##cpro2.next = &x##cpro1, x##cpro2.var = array2, x##cpro2.nvars = n2, \ + gcprolist = &x##cpro2 )) + +#define XGCPRO3_ARRAY(x, array1, n1, array2, n2, array3, n3) ((void) ( \ + x##cpro1.next = gcprolist, x##cpro1.var = array1, x##cpro1.nvars = n1, \ + x##cpro2.next = &x##cpro1, x##cpro2.var = array2, x##cpro2.nvars = n2, \ + x##cpro3.next = &x##cpro2, x##cpro3.var = array3, x##cpro3.nvars = n3, \ + gcprolist = &x##cpro3 )) #if defined (__cplusplus) && defined (ERROR_CHECK_GC) /* We need to reset each gcpro to avoid triggering the assert() in @@ -3226,106 +3357,64 @@ #define UNWIND_GCPRO_TO(val) (gcprolist = (val)) #endif /* defined (__cplusplus) && defined (ERROR_CHECK_GC) */ -#define UNGCPRO_1(gcpro1) UNWIND_GCPRO_TO (gcpro1.next) - -#define UNGCPRO UNGCPRO_1 (gcpro1) - -#define NGCPRO1(var1) ((void) ( \ - ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \ - gcprolist = &ngcpro1 )) - -#define NGCPRO2(var1, var2) ((void) ( \ - ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \ - ngcpro2.next = &ngcpro1, ngcpro2.var = &var2, ngcpro2.nvars = 1, \ - gcprolist = &ngcpro2 )) - -#define NGCPRO3(var1, var2, var3) ((void) ( \ - ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \ - ngcpro2.next = &ngcpro1, ngcpro2.var = &var2, ngcpro2.nvars = 1, \ - ngcpro3.next = &ngcpro2, ngcpro3.var = &var3, ngcpro3.nvars = 1, \ - gcprolist = &ngcpro3 )) - -#define NGCPRO4(var1, var2, var3, var4) ((void) ( \ - ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \ - ngcpro2.next = &ngcpro1, ngcpro2.var = &var2, ngcpro2.nvars = 1, \ - ngcpro3.next = &ngcpro2, ngcpro3.var = &var3, ngcpro3.nvars = 1, \ - ngcpro4.next = &ngcpro3, ngcpro4.var = &var4, ngcpro4.nvars = 1, \ - gcprolist = &ngcpro4 )) - -#define NGCPRO5(var1, var2, var3, var4, var5) ((void) ( \ - ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \ - ngcpro2.next = &ngcpro1, ngcpro2.var = &var2, ngcpro2.nvars = 1, \ - ngcpro3.next = &ngcpro2, ngcpro3.var = &var3, ngcpro3.nvars = 1, \ - ngcpro4.next = &ngcpro3, ngcpro4.var = &var4, ngcpro4.nvars = 1, \ - ngcpro5.next = &ngcpro4, ngcpro5.var = &var5, ngcpro5.nvars = 1, \ - gcprolist = &ngcpro5 )) - -#define NGCPRO1_ARRAY(array, n) ((void) ( \ - ngcpro1.next = gcprolist, ngcpro1.var = array, ngcpro1.nvars = n, \ - gcprolist = &ngcpro1 )) - -#define NGCPRO2_ARRAY(array1, n1, array2, n2) ((void) ( \ - ngcpro1.next = gcprolist, ngcpro1.var = array1, ngcpro1.nvars = n1, \ - ngcpro2.next = &ngcpro1, ngcpro2.var = array2, ngcpro2.nvars = n2, \ - gcprolist = &ngcpro2 )) - -#define NGCPRO3_ARRAY(array1, n1, array2, n2, array3, n3) ((void) ( \ - ngcpro1.next = gcprolist, ngcpro1.var = array1, ngcpro1.nvars = n1, \ - ngcpro2.next = &ngcpro1, ngcpro2.var = array2, ngcpro2.nvars = n2, \ - ngcpro3.next = &ngcpro2, ngcpro3.var = array3, ngcpro3.nvars = n3, \ - gcprolist = &ngcpro3 )) - -#define NUNGCPRO UNGCPRO_1 (ngcpro1) - -#define NNGCPRO1(var1) ((void) ( \ - nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \ - gcprolist = &nngcpro1 )) - -#define NNGCPRO2(var1, var2) ((void) ( \ - nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \ - nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \ - gcprolist = &nngcpro2 )) - -#define NNGCPRO3(var1, var2, var3) ((void) ( \ - nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \ - nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \ - nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \ - gcprolist = &nngcpro3 )) - -#define NNGCPRO4(var1, var2, var3, var4) ((void) ( \ - nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \ - nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \ - nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \ - nngcpro4.next = &nngcpro3, nngcpro4.var = &var4, nngcpro4.nvars = 1, \ - gcprolist = &nngcpro4 )) - -#define NNGCPRO5(var1, var2, var3, var4, var5) ((void) ( \ - nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \ - nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \ - nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \ - nngcpro4.next = &nngcpro3, nngcpro4.var = &var4, nngcpro4.nvars = 1, \ - nngcpro5.next = &nngcpro4, nngcpro5.var = &var5, nngcpro5.nvars = 1, \ - gcprolist = &nngcpro5 )) - -#define NNGCPRO1_ARRAY(array, n) ((void) ( \ - nngcpro1.next = gcprolist, nngcpro1.var = array, nngcpro1.nvars = n, \ - gcprolist = &nngcpro1 )) - -#define NNGCPRO2_ARRAY(array1, n1, array2, n2) ((void) ( \ - nngcpro1.next = gcprolist, nngcpro1.var = array1, nngcpro1.nvars = n1, \ - nngcpro2.next = &nngcpro1, nngcpro2.var = array2, nngcpro2.nvars = n2, \ - gcprolist = &nngcpro2 )) - -#define NNGCPRO3_ARRAY(array1, n1, array2, n2, array3, n3) ((void) ( \ - nngcpro1.next = gcprolist, nngcpro1.var = array1, nngcpro1.nvars = n1, \ - nngcpro2.next = &nngcpro1, nngcpro2.var = array2, nngcpro2.nvars = n2, \ - nngcpro3.next = &nngcpro2, nngcpro3.var = array3, nngcpro3.nvars = n3, \ - gcprolist = &nngcpro3 )) - -#define NNUNGCPRO UNGCPRO_1 (nngcpro1) +#define XUNGCPRO(x) UNWIND_GCPRO_TO (x##cpro1.next) #endif /* ! DEBUG_GCPRO */ +#define GCDECL1 XGCDECL1 (g) +#define GCDECL2 XGCDECL2 (g) +#define GCDECL3 XGCDECL3 (g) +#define GCDECL4 XGCDECL4 (g) +#define GCDECL5 XGCDECL5 (g) + +#define GCPRO1(a) XGCPRO1 (g,a) +#define GCPRO2(a,b) XGCPRO2 (g,a,b) +#define GCPRO3(a,b,c) XGCPRO3 (g,a,b,c) +#define GCPRO4(a,b,c,d) XGCPRO4 (g,a,b,c,d) +#define GCPRO5(a,b,c,d,e) XGCPRO5 (g,a,b,c,d,e) + +#define GCPRO1_ARRAY(a1,n1) XGCPRO1_ARRAY(g,a1,n1) +#define GCPRO2_ARRAY(a1,n1,a2,n2) XGCPRO2_ARRAY (g,a1,n1,a2,n2) +#define GCPRO3_ARRAY(a1,n1,a2,n2,a3,n3) XGCPRO3_ARRAY (g,a1,n1,a2,n2,a3,n3) + +#define UNGCPRO XUNGCPRO (g) + +#define NGCDECL1 XGCDECL1 (ng) +#define NGCDECL2 XGCDECL2 (ng) +#define NGCDECL3 XGCDECL3 (ng) +#define NGCDECL4 XGCDECL4 (ng) +#define NGCDECL5 XGCDECL5 (ng) + +#define NGCPRO1(a) XGCPRO1 (ng,a) +#define NGCPRO2(a,b) XGCPRO2 (ng,a,b) +#define NGCPRO3(a,b,c) XGCPRO3 (ng,a,b,c) +#define NGCPRO4(a,b,c,d) XGCPRO4 (ng,a,b,c,d) +#define NGCPRO5(a,b,c,d,e) XGCPRO5 (ng,a,b,c,d,e) + +#define NGCPRO1_ARRAY(a1,n1) XGCPRO1_ARRAY(ng,a1,n1) +#define NGCPRO2_ARRAY(a1,n1,a2,n2) XGCPRO2_ARRAY (ng,a1,n1,a2,n2) +#define NGCPRO3_ARRAY(a1,n1,a2,n2,a3,n3) XGCPRO3_ARRAY (ng,a1,n1,a2,n2,a3,n3) + +#define NUNGCPRO XUNGCPRO (ng) + +#define NNGCDECL1 XGCDECL1 (nng) +#define NNGCDECL2 XGCDECL2 (nng) +#define NNGCDECL3 XGCDECL3 (nng) +#define NNGCDECL4 XGCDECL4 (nng) +#define NNGCDECL5 XGCDECL5 (nng) + +#define NNGCPRO1(a) XGCPRO1 (nng,a) +#define NNGCPRO2(a,b) XGCPRO2 (nng,a,b) +#define NNGCPRO3(a,b,c) XGCPRO3 (nng,a,b,c) +#define NNGCPRO4(a,b,c,d) XGCPRO4 (nng,a,b,c,d) +#define NNGCPRO5(a,b,c,d,e) XGCPRO5 (nng,a,b,c,d,e) + +#define NNGCPRO1_ARRAY(a1,n1) XGCPRO1_ARRAY(nng,a1,n1) +#define NNGCPRO2_ARRAY(a1,n1,a2,n2) XGCPRO2_ARRAY (nng,a1,n1,a2,n2) +#define NNGCPRO3_ARRAY(a1,n1,a2,n2,a3,n3) XGCPRO3_ARRAY (nng,a1,n1,a2,n2,a3,n3) + +#define NNUNGCPRO XUNGCPRO (nng) + /* Evaluate expr, UNGCPRO, and then return the value of expr. */ #define RETURN_UNGCPRO(expr) do \ { \ @@ -3360,13 +3449,13 @@ /* Help debug crashes gc-marking a staticpro'ed object. */ -MODULE_API void staticpro_1 (Lisp_Object *, char *); -MODULE_API void staticpro_nodump_1 (Lisp_Object *, char *); +MODULE_API void staticpro_1 (Lisp_Object *, Ascbyte *); +MODULE_API void staticpro_nodump_1 (Lisp_Object *, Ascbyte *); #define staticpro(ptr) staticpro_1 (ptr, #ptr) #define staticpro_nodump(ptr) staticpro_nodump_1 (ptr, #ptr) #ifdef HAVE_SHLIB -MODULE_API void unstaticpro_nodump_1 (Lisp_Object *, char *); +MODULE_API void unstaticpro_nodump_1 (Lisp_Object *, Ascbyte *); #define unstaticpro_nodump(ptr) unstaticpro_nodump_1 (ptr, #ptr) #endif @@ -3747,15 +3836,15 @@ EXFUN (Fforce_debugging_signal, 1); SIGTYPE fatal_error_signal (int); -Lisp_Object make_arg_list (int, Extbyte **); -void make_argc_argv (Lisp_Object, int *, Extbyte ***); -void free_argc_argv (Extbyte **); +Lisp_Object make_arg_list (int, Wexttext **); +void make_argc_argv (Lisp_Object, int *, Wexttext ***); +void free_argc_argv (Wexttext **); Lisp_Object split_external_path (const Extbyte *path); Lisp_Object split_env_path (const CIbyte *evarname, const Ibyte *default_); /* Nonzero means don't do interactive redisplay and don't change tty modes */ extern int noninteractive, noninteractive1; -extern int inhibit_non_essential_printing_operations; +extern int inhibit_non_essential_conversion_operations; extern int preparing_for_armageddon; extern Fixnum emacs_priority; extern int suppress_early_error_handler_backtrace; @@ -3998,32 +4087,32 @@ Lisp_Object arg); int set_trapping_problems_flags (int flags); Lisp_Object call_trapping_problems (Lisp_Object warning_class, - const char *warning_string, + const Ascbyte *warning_string, int flags, struct call_trapping_problems_result *problem, Lisp_Object (*fun) (void *), void *arg); Lisp_Object va_call_trapping_problems (Lisp_Object warning_class, - const char *warning_string, + const Ascbyte *warning_string, int flags, struct call_trapping_problems_result *problem, lisp_fn_t fun, int nargs, ...); -Lisp_Object call0_trapping_problems (const char *, Lisp_Object, int); -Lisp_Object call1_trapping_problems (const char *, Lisp_Object, Lisp_Object, +Lisp_Object call0_trapping_problems (const Ascbyte *, Lisp_Object, int); +Lisp_Object call1_trapping_problems (const Ascbyte *, Lisp_Object, Lisp_Object, int); -Lisp_Object call2_trapping_problems (const char *, Lisp_Object, Lisp_Object, +Lisp_Object call2_trapping_problems (const Ascbyte *, Lisp_Object, Lisp_Object, Lisp_Object, int); -Lisp_Object call3_trapping_problems (const char *, Lisp_Object, Lisp_Object, +Lisp_Object call3_trapping_problems (const Ascbyte *, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, int); -Lisp_Object call4_trapping_problems (const char *, Lisp_Object, Lisp_Object, +Lisp_Object call4_trapping_problems (const Ascbyte *, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, int); -Lisp_Object call5_trapping_problems (const char *, Lisp_Object, Lisp_Object, +Lisp_Object call5_trapping_problems (const Ascbyte *, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, int); -Lisp_Object eval_in_buffer_trapping_problems (const char *, struct buffer *, +Lisp_Object eval_in_buffer_trapping_problems (const Ascbyte *, struct buffer *, Lisp_Object, int); Lisp_Object run_hook_trapping_problems (Lisp_Object, Lisp_Object, int); Lisp_Object safe_run_hook_trapping_problems (Lisp_Object, Lisp_Object, int); @@ -4288,7 +4377,7 @@ Lisp_Object, int, Error_Behavior); int external_remprop (Lisp_Object *, Lisp_Object, int, Error_Behavior); int internal_equal_trapping_problems (Lisp_Object warning_class, - const char *warning_string, + const Ascbyte *warning_string, int flags, struct call_trapping_problems_result *p, int retval, @@ -4305,8 +4394,8 @@ void check_losing_bytecode (const char *, Lisp_Object); Lisp_Object add_suffix_to_symbol (Lisp_Object symbol, - const Char_ASCII *ascii_string); -Lisp_Object add_prefix_to_symbol (const Char_ASCII *ascii_string, + const Ascbyte *ascii_string); +Lisp_Object add_prefix_to_symbol (const Ascbyte *ascii_string, Lisp_Object symbol); /* Defined in free-hook.c */ @@ -4327,9 +4416,9 @@ extern Lisp_Object Q_resource_type, Q_resource_id; /* Defined in gui.c */ -DECLARE_DOESNT_RETURN (gui_error (const char *reason, +DECLARE_DOESNT_RETURN (gui_error (const Ascbyte *reason, Lisp_Object frob)); -DECLARE_DOESNT_RETURN (gui_error_2 (const char *reason, +DECLARE_DOESNT_RETURN (gui_error_2 (const Ascbyte *reason, Lisp_Object frob0, Lisp_Object frob1)); /* Defined in indent.c */ EXFUN (Findent_to, 3); @@ -4555,7 +4644,7 @@ EXFUN (Fding, 3); void init_device_sound (struct device *); -DECLARE_DOESNT_RETURN (report_sound_error (const Char_ASCII *, Lisp_Object)); +DECLARE_DOESNT_RETURN (report_sound_error (const Ascbyte *, Lisp_Object)); /* Defined in specifier.c */ EXFUN (Fadd_spec_to_specifier, 5); @@ -4758,12 +4847,12 @@ DECLARE_INLINE_HEADER (Ibyte *qxestrdup (const Ibyte *s)) { - return (Ibyte *) xstrdup ((const char *) s); + return (Ibyte *) xstrdup ((const Chbyte *) s); } DECLARE_INLINE_HEADER (Bytecount qxestrlen (const Ibyte *s)) { - return strlen ((const char *) s); + return strlen ((const Chbyte *) s); } DECLARE_INLINE_HEADER (Charcount qxestrcharlen (const Ibyte *s)) @@ -4774,177 +4863,186 @@ DECLARE_INLINE_HEADER (int qxestrcmp (const Ibyte *s1, const Ibyte *s2)) { - return strcmp ((const char *) s1, (const char *) s2); + return strcmp ((const Chbyte *) s1, (const Chbyte *) s2); } -DECLARE_INLINE_HEADER (int qxestrcmp_c (const Ibyte *s1, - const char *s2)) +DECLARE_INLINE_HEADER (int qxestrcmp_ascii (const Ibyte *s1, + const Ascbyte *s2)) { - return strcmp ((const char *) s1, s2); + return strcmp ((const Chbyte *) s1, s2); } DECLARE_INLINE_HEADER (int qxestrncmp (const Ibyte *string1, const Ibyte *string2, Bytecount count)) { - return strncmp ((const char *) string1, (const char *) string2, + return strncmp ((const Chbyte *) string1, (const Chbyte *) string2, (size_t) count); } -DECLARE_INLINE_HEADER (int qxestrncmp_c (const Ibyte *string1, - const char *string2, - Bytecount count)) +DECLARE_INLINE_HEADER (int qxestrncmp_ascii (const Ibyte *string1, + const Ascbyte *string2, + Bytecount count)) { - return strncmp ((const char *) string1, string2, (size_t) count); + return strncmp ((const Chbyte *) string1, string2, (size_t) count); } DECLARE_INLINE_HEADER (Ibyte *qxestrcpy (Ibyte *strDest, - const Ibyte *strSource)) + const Ibyte *strSource)) { - return (Ibyte *) strcpy ((char *) strDest, (const char *) strSource); + return (Ibyte *) strcpy ((Chbyte *) strDest, (const Chbyte *) strSource); } -DECLARE_INLINE_HEADER (Ibyte *qxestrcpy_c (Ibyte *strDest, - const char *strSource)) +DECLARE_INLINE_HEADER (Ibyte *qxestrcpy_ascii (Ibyte *strDest, + const Ascbyte *strSource)) { - return (Ibyte *) strcpy ((char *) strDest, strSource); + return (Ibyte *) strcpy ((Chbyte *) strDest, strSource); } DECLARE_INLINE_HEADER (Ibyte *qxestrncpy (Ibyte *strDest, - const Ibyte *strSource, - Bytecount count)) + const Ibyte *strSource, + Bytecount count)) { - return (Ibyte *) strncpy ((char *) strDest, (const char *) strSource, + return (Ibyte *) strncpy ((Chbyte *) strDest, (const Chbyte *) strSource, (size_t) count); } -DECLARE_INLINE_HEADER (Ibyte *qxestrncpy_c (Ibyte *strDest, - const char *strSource, - Bytecount count)) +DECLARE_INLINE_HEADER (Ibyte *qxestrncpy_ascii (Ibyte *strDest, + const Ascbyte *strSource, + Bytecount count)) { - return (Ibyte *) strncpy ((char *) strDest, strSource, (size_t) count); + return (Ibyte *) strncpy ((Chbyte *) strDest, strSource, (size_t) count); } DECLARE_INLINE_HEADER (Ibyte *qxestrcat (Ibyte *strDest, - const Ibyte *strSource)) + const Ibyte *strSource)) { - return (Ibyte *) strcat ((char *) strDest, (const char *) strSource); + return (Ibyte *) strcat ((Chbyte *) strDest, (const Chbyte *) strSource); } -DECLARE_INLINE_HEADER (Ibyte *qxestrcat_c (Ibyte *strDest, - const char *strSource)) +DECLARE_INLINE_HEADER (Ibyte *qxestrcat_ascii (Ibyte *strDest, + const Ascbyte *strSource)) { - return (Ibyte *) strcat ((char *) strDest, strSource); + return (Ibyte *) strcat ((Chbyte *) strDest, strSource); } DECLARE_INLINE_HEADER (Ibyte *qxestrncat (Ibyte *strDest, - const Ibyte *strSource, - Bytecount count)) + const Ibyte *strSource, + Bytecount count)) { - return (Ibyte *) strncat ((char *) strDest, (const char *) strSource, + return (Ibyte *) strncat ((Chbyte *) strDest, (const Chbyte *) strSource, (size_t) count); } -DECLARE_INLINE_HEADER (Ibyte *qxestrncat_c (Ibyte *strDest, - const char *strSource, - Bytecount count)) +DECLARE_INLINE_HEADER (Ibyte *qxestrncat_ascii (Ibyte *strDest, + const Ascbyte *strSource, + Bytecount count)) { - return (Ibyte *) strncat ((char *) strDest, strSource, (size_t) count); + return (Ibyte *) strncat ((Chbyte *) strDest, strSource, (size_t) count); } DECLARE_INLINE_HEADER (Ibyte *qxestrchr (const Ibyte *s, Ichar c)) { assert (c >= 0 && c <= 255); - return (Ibyte *) strchr ((const char *) s, c); + return (Ibyte *) strchr ((const Chbyte *) s, c); } DECLARE_INLINE_HEADER (Ibyte *qxestrrchr (const Ibyte *s, Ichar c)) { assert (c >= 0 && c <= 255); - return (Ibyte *) strrchr ((const char *) s, c); + return (Ibyte *) strrchr ((const Chbyte *) s, c); } DECLARE_INLINE_HEADER (Ibyte *qxestrstr (const Ibyte *string1, - const Ibyte *string2)) + const Ibyte *string2)) { - return (Ibyte *) strstr ((const char *) string1, (const char *) string2); + return (Ibyte *) strstr ((const Chbyte *) string1, (const Chbyte *) string2); } DECLARE_INLINE_HEADER (Bytecount qxestrcspn (const Ibyte *string, const CIbyte *strCharSet)) { - return (Bytecount) strcspn ((const char *) string, strCharSet); + return (Bytecount) strcspn ((const Chbyte *) string, strCharSet); } DECLARE_INLINE_HEADER (Bytecount qxestrspn (const Ibyte *string, const CIbyte *strCharSet)) { - return (Bytecount) strspn ((const char *) string, strCharSet); + return (Bytecount) strspn ((const Chbyte *) string, strCharSet); } DECLARE_INLINE_HEADER (Ibyte *qxestrpbrk (const Ibyte *string, - const CIbyte *strCharSet)) + const CIbyte *strCharSet)) { - return (Ibyte *) strpbrk ((const char *) string, strCharSet); + return (Ibyte *) strpbrk ((const Chbyte *) string, strCharSet); } DECLARE_INLINE_HEADER (Ibyte *qxestrtok (Ibyte *strToken, - const CIbyte *strDelimit)) + const CIbyte *strDelimit)) { - return (Ibyte *) strtok ((char *) strToken, strDelimit); + return (Ibyte *) strtok ((Chbyte *) strToken, strDelimit); } DECLARE_INLINE_HEADER (double qxestrtod (const Ibyte *nptr, Ibyte **endptr)) { - return strtod ((const char *) nptr, (char **) endptr); + return strtod ((const Chbyte *) nptr, (Chbyte **) endptr); } DECLARE_INLINE_HEADER (long qxestrtol (const Ibyte *nptr, Ibyte **endptr, int base)) { - return strtol ((const char *) nptr, (char **) endptr, base); + return strtol ((const Chbyte *) nptr, (Chbyte **) endptr, base); } DECLARE_INLINE_HEADER (unsigned long qxestrtoul (const Ibyte *nptr, Ibyte **endptr, int base)) { - return strtoul ((const char *) nptr, (char **) endptr, base); + return strtoul ((const Chbyte *) nptr, (Chbyte **) endptr, base); } DECLARE_INLINE_HEADER (int qxeatoi (const Ibyte *string)) { - return atoi ((const char *) string); + return atoi ((const Chbyte *) string); } DECLARE_INLINE_HEADER (Ibyte *qxestrupr (Ibyte *s)) { - return (Ibyte *) strupr ((char *) s); + return (Ibyte *) strupr ((Chbyte *) s); } DECLARE_INLINE_HEADER (Ibyte *qxestrlwr (Ibyte *s)) { - return (Ibyte *) strlwr ((char *) s); + return (Ibyte *) strlwr ((Chbyte *) s); } int qxesprintf (Ibyte *buffer, const CIbyte *format, ...) PRINTF_ARGS (2, 3); +DECLARE_INLINE_HEADER (int qxesscanf_ascii_1 (Ibyte *buffer, + const Ascbyte *format, + void *ptr)) +{ + /* #### DAMNIT! No vsscanf! */ + return sscanf ((Chbyte *) buffer, format, ptr); +} + /* Do not use POSIX locale routines. Not Mule-correct. */ #define qxestrcoll DO NOT USE. #define qxestrxfrm DO NOT USE. int qxestrcasecmp (const Ibyte *s1, const Ibyte *s2); -int qxestrcasecmp_c (const Ibyte *s1, const Char_ASCII *s2); +int qxestrcasecmp_ascii (const Ibyte *s1, const Ascbyte *s2); int qxestrcasecmp_i18n (const Ibyte *s1, const Ibyte *s2); -int ascii_strcasecmp (const Char_ASCII *s1, const Char_ASCII *s2); +int ascii_strcasecmp (const Ascbyte *s1, const Ascbyte *s2); int lisp_strcasecmp (Lisp_Object s1, Lisp_Object s2); int lisp_strcasecmp_i18n (Lisp_Object s1, Lisp_Object s2); int qxestrncasecmp (const Ibyte *s1, const Ibyte *s2, Bytecount len); -int qxestrncasecmp_c (const Ibyte *s1, const Char_ASCII *s2, Bytecount len); +int qxestrncasecmp_ascii (const Ibyte *s1, const Ascbyte *s2, + Bytecount len); int qxestrncasecmp_i18n (const Ibyte *s1, const Ibyte *s2, Bytecount len); -int ascii_strncasecmp (const Char_ASCII *s1, const Char_ASCII *s2, +int ascii_strncasecmp (const Ascbyte *s1, const Ascbyte *s2, Bytecount len); int qxememcmp (const Ibyte *s1, const Ibyte *s2, Bytecount len); int qxememcmp4 (const Ibyte *s1, Bytecount len1, @@ -4970,6 +5068,23 @@ Charbpos end, Bytebpos byte_start, Bytebpos byte_end); +typedef struct +{ + const char *srctext; + void *dst; + Bytecount dst_size; +} alloca_convert_vals; + +typedef struct +{ + Dynarr_declare (alloca_convert_vals); +} alloca_convert_vals_dynarr; + +extern alloca_convert_vals_dynarr *active_alloca_convert; + +MODULE_API int find_pos_of_existing_active_alloca_convert (const char * + srctext); + /* Defined in unicode.c */ extern const struct sized_memory_description to_unicode_description; extern const struct sized_memory_description from_unicode_description;
--- a/src/lread.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/lread.c Thu Nov 04 23:08:28 2004 +0000 @@ -564,7 +564,7 @@ } } - foundstr = (Ibyte *) ALLOCA (XSTRING_LENGTH (found) + 1); + foundstr = alloca_ibytes (XSTRING_LENGTH (found) + 1); qxestrcpy (foundstr, XSTRING_DATA (found)); foundlen = qxestrlen (foundstr); @@ -799,10 +799,9 @@ return R_OK; else if (CONSP (mode)) { - Lisp_Object tail; int mask = 0; - EXTERNAL_LIST_LOOP (tail, mode) - mask |= decode_mode_1 (XCAR (tail)); + EXTERNAL_LIST_LOOP_2 (elt, mode) + mask |= decode_mode_1 (elt); return mask; } else @@ -835,9 +834,8 @@ if (LISTP (suffixes)) { - Lisp_Object tail; - EXTERNAL_LIST_LOOP (tail, suffixes) - CHECK_STRING (XCAR (tail)); + EXTERNAL_LIST_LOOP_2 (elt, suffixes) + CHECK_STRING (elt); } else CHECK_STRING (suffixes); @@ -921,7 +919,7 @@ max = XSTRING_LENGTH (suffixes); fn_len = XSTRING_LENGTH (filename); - fn = (Ibyte *) ALLOCA (max + fn_len + 1); + fn = alloca_ibytes (max + fn_len + 1); memcpy (fn, XSTRING_DATA (filename), fn_len); /* Loop over suffixes. */ @@ -1095,9 +1093,9 @@ /* This function can GC */ int absolute = !NILP (Ffile_name_absolute_p (str)); - EXTERNAL_LIST_LOOP (path, path) + EXTERNAL_LIST_LOOP_2 (elt, path) { - int val = locate_file_in_directory (XCAR (path), str, suffixes, storeptr, + int val = locate_file_in_directory (elt, str, suffixes, storeptr, mode); if (val >= 0) return val; @@ -1160,10 +1158,9 @@ Fclrhash (Vlocate_file_hash_table); else { - Lisp_Object pathtail; - EXTERNAL_LIST_LOOP (pathtail, path) + EXTERNAL_LIST_LOOP_2 (elt, path) { - Lisp_Object pathel = Fexpand_file_name (XCAR (pathtail), Qnil); + Lisp_Object pathel = Fexpand_file_name (elt, Qnil); Fremhash (pathel, Vlocate_file_hash_table); } } @@ -1193,7 +1190,7 @@ { /* This function can GC */ Lisp_Object suffixtab = Qnil; - Lisp_Object pathtail, pathel_expanded; + Lisp_Object pathel_expanded; int val; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; @@ -1216,56 +1213,56 @@ suffixtab = locate_file_construct_suffixed_files (str, suffixes); - EXTERNAL_LIST_LOOP (pathtail, path) - { - Lisp_Object pathel = XCAR (pathtail); - Lisp_Object hash_table; - Lisp_Object tail; - int found = 0; - - /* If this path element is relative, we have to look by hand. */ - if (NILP (pathel) || NILP (Ffile_name_absolute_p (pathel))) - { - val = locate_file_in_directory (pathel, str, suffixes, storeptr, - mode); - if (val >= 0) - { - UNGCPRO; - return val; - } - continue; - } - - pathel_expanded = Fexpand_file_name (pathel, Qnil); - hash_table = locate_file_find_directory_hash_table (pathel_expanded); - - if (!NILP (hash_table)) - { - /* Loop over suffixes. */ - LIST_LOOP (tail, suffixtab) - if (!NILP (Fgethash (XCAR (tail), hash_table, Qnil))) + { + EXTERNAL_LIST_LOOP_2 (pathel, path) + { + Lisp_Object hash_table; + int found = 0; + + /* If this path element is relative, we have to look by hand. */ + if (NILP (pathel) || NILP (Ffile_name_absolute_p (pathel))) + { + val = locate_file_in_directory (pathel, str, suffixes, storeptr, + mode); + if (val >= 0) { - found = 1; - break; + UNGCPRO; + return val; } - } - - if (found) - { - /* This is a likely candidate. Look by hand in this directory - so we don't get thrown off if someone byte-compiles a file. */ - val = locate_file_in_directory (pathel, str, suffixes, storeptr, - mode); - if (val >= 0) - { - UNGCPRO; - return val; - } - - /* Hmm ... the file isn't actually there. (Or possibly it's - a directory ...) So refresh our hashing. */ - locate_file_refresh_hashing (pathel_expanded); - } + continue; + } + + pathel_expanded = Fexpand_file_name (pathel, Qnil); + hash_table = locate_file_find_directory_hash_table (pathel_expanded); + + if (!NILP (hash_table)) + { + /* Loop over suffixes. */ + LIST_LOOP_2 (elt, suffixtab) + if (!NILP (Fgethash (elt, hash_table, Qnil))) + { + found = 1; + break; + } + } + + if (found) + { + /* This is a likely candidate. Look by hand in this directory + so we don't get thrown off if someone byte-compiles a file. */ + val = locate_file_in_directory (pathel, str, suffixes, storeptr, + mode); + if (val >= 0) + { + UNGCPRO; + return val; + } + + /* Hmm ... the file isn't actually there. (Or possibly it's + a directory ...) So refresh our hashing. */ + locate_file_refresh_hashing (pathel_expanded); + } + } } /* File is probably not there, but check the hard way just in case. */ @@ -3111,8 +3108,6 @@ void vars_of_lread (void) { - reinit_vars_of_lread (); - DEFVAR_LISP ("values", &Vvalues /* List of values of all expressions which were read, evaluated and printed. Order is reverse chronological.
--- a/src/lrecord.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/lrecord.h Thu Nov 04 23:08:28 2004 +0000 @@ -1,6 +1,6 @@ /* The "lrecord" structure (header of a compound lisp object). Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. - Copyright (C) 1996, 2001, 2002 Ben Wing. + Copyright (C) 1996, 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -21,6 +21,8 @@ /* Synched up with: Not in FSF. */ +/* This file has been Mule-ized, Ben Wing, 10-13-04. */ + #ifndef INCLUDED_lrecord_h_ #define INCLUDED_lrecord_h_ @@ -227,7 +229,7 @@ struct lrecord_implementation { - const char *name; + const Ascbyte *name; /* information for the dumper: is the object dumpable and should it be dumped. */ @@ -394,7 +396,7 @@ objects, referenced in the DEFINE_*LRECORD_*IMPLEMENTATION*() call; (b) descriptions of global objects to be dumped, registered by dump_add_root_block(); (c) descriptions of global pointers to - non-Lisp_Object heap objects, registered by dump_add_root_struct_ptr(). + non-Lisp_Object heap objects, registered by dump_add_root_block_ptr(). The descriptions need to tell pdump which elements of your structure are Lisp_Objects or structure pointers, plus the descriptions in turn of the non-Lisp_Object structures pointed to. If these structures are you own @@ -446,9 +448,9 @@ does not need to be given here) and global objects, where the size is an argument to the call to dump_add_root_block(). sized_memory_descriptions are used for pointers and arrays in - memory_descriptions and for calls to dump_add_root_struct_ptr(). (#### + memory_descriptions and for calls to dump_add_root_block_ptr(). (#### It is not obvious why this is so in the latter case. Probably, calls to - dump_add_root_struct_ptr() should use plain memory_descriptions and have + dump_add_root_block_ptr() should use plain memory_descriptions and have the size be an argument to the call.) NOTE: Anywhere that a sized_memory_description occurs inside of a plain @@ -497,12 +499,12 @@ ...; } - You'd use XD_STRUCT_PTR, something like: + You'd use XD_BLOCK_PTR, something like: static const struct memory_description foo_description[] = { ... { XD_INT, offsetof (Lisp_Foo, count) }, - { XD_STRUCT_PTR, offsetof (Lisp_Foo, objects), + { XD_BLOCK_PTR, offsetof (Lisp_Foo, objects), XD_INDIRECT (0, 0), &lisp_object_description }, ... }; @@ -519,7 +521,7 @@ lisp_object_description_1 }; - Another example of XD_STRUCT_PTR: + Another example of XD_BLOCK_PTR: typedef struct htentry { @@ -557,7 +559,7 @@ const struct memory_description hash_table_description[] = { { XD_ELEMCOUNT, offsetof (Lisp_Hash_Table, size) }, - { XD_STRUCT_PTR, offsetof (Lisp_Hash_Table, hentries), XD_INDIRECT (0, 1), + { XD_BLOCK_PTR, offsetof (Lisp_Hash_Table, hentries), XD_INDIRECT (0, 1), &htentry_description }, { XD_LO_LINK, offsetof (Lisp_Hash_Table, next_weak) }, { XD_END } @@ -577,7 +579,7 @@ const struct memory_description specifier_description[] = { ... - { XD_STRUCT_ARRAY, offset (Lisp_Specifier, data), 1, + { XD_BLOCK_ARRAY, offset (Lisp_Specifier, data), 1, specifier_extra_description_map }, ... { XD_END } @@ -627,7 +629,7 @@ An array of Lisp objects or (equivalently) pointers to lrecords. The parameter (i.e. third element) is the count. This would be declared as Lisp_Object foo[666]. For something declared as Lisp_Object *foo, - use XD_STRUCT_PTR, whose description parameter is a sized_memory_description + use XD_BLOCK_PTR, whose description parameter is a sized_memory_description consisting of only XD_LISP_OBJECT and XD_END. XD_LO_LINK @@ -646,35 +648,39 @@ Pointer to undumpable data. Must be NULL when dumping. - XD_STRUCT_PTR + XD_BLOCK_PTR Pointer to block of described memory. (This is misnamed: It is NOT necessarily a pointer to a struct foo.) Parameters are number of contiguous blocks and sized_memory_description. - XD_STRUCT_ARRAY + XD_BLOCK_ARRAY Array of blocks of described memory. Parameters are number of - structures and sized_memory_description. This differs from XD_STRUCT_PTR + structures and sized_memory_description. This differs from XD_BLOCK_PTR in that the parameter is declared as struct foo[666] instead of struct *foo. In other words, the block of memory holding the structures is within the containing structure, rather than being elsewhere, with a pointer in the containing structure. NOTE NOTE NOTE: Be sure that you understand the difference between - XD_STRUCT_PTR and XD_STRUCT_ARRAY: + XD_BLOCK_PTR and XD_BLOCK_ARRAY: - struct foo bar[666], i.e. 666 inline struct foos - --> XD_STRUCT_ARRAY, argument 666, pointing to a description of + --> XD_BLOCK_ARRAY, argument 666, pointing to a description of struct foo - struct foo *bar, i.e. pointer to a block of 666 struct foos - --> XD_STRUCT_PTR, argument 666, pointing to a description of + --> XD_BLOCK_PTR, argument 666, pointing to a description of struct foo - struct foo *bar[666], i.e. 666 pointers to separate blocks of struct foos - --> XD_STRUCT_ARRAY, argument 666, pointing to a description of + --> XD_BLOCK_ARRAY, argument 666, pointing to a description of a single pointer to struct foo; the description is a single - XD_STRUCT_PTR, argument 1, which in turn points to a description + XD_BLOCK_PTR, argument 1, which in turn points to a description of struct foo. + NOTE also that an XD_BLOCK_PTR of 666 foos is equivalent to an + XD_BLOCK_PTR of 1 bar, where the description of `bar' is an + XD_BLOCK_ARRAY of 666 foos. + XD_OPAQUE_DATA_PTR Pointer to dumpable opaque data. Parameter is the size of the data. @@ -693,9 +699,9 @@ parameter of the XD_UNION descriptor to determine if this description applies to the union data, and XD_INDIRECT references refer to the containing object and description. Note that the description applies - "inline" to the union data, like XD_STRUCT_ARRAY and not XD_STRUCT_PTR. + "inline" to the union data, like XD_BLOCK_ARRAY and not XD_BLOCK_PTR. If the union data is a pointer to different types of structures, each - element in the memory_description should be an XD_STRUCT_PTR. See + element in the memory_description should be an XD_BLOCK_PTR. See unicode.c, redisplay.c and objects.c for examples of XD_UNION. XD_UNION_DYNAMIC_SIZE @@ -705,7 +711,7 @@ of the union constant. That is, an object with plain XD_UNION typically has the union declared as `union foo' or as `void *', where an object with XD_UNION_DYNAMIC_SIZE typically has the union as the last element, - and declared as something like char foo[1]. With plain XD_UNION, the + and declared as something like Rawbyte foo[1]. With plain XD_UNION, the object is (usually) of fixed size and always contains enough space for the data associated with all possible union constants, and thus the union constant can potentially change during the lifetime of the object. With @@ -723,13 +729,14 @@ associated with the currently specified (and unchangeable) union constant. - XD_C_STRING + XD_ASCII_STRING - Pointer to a C string. + Pointer to a C string, purely ASCII. XD_DOC_STRING - Pointer to a doc string (C string if positive, opaque value if negative) + Pointer to a doc string (C string in pure ASCII if positive, + opaque value if negative) XD_INT_RESET @@ -779,12 +786,12 @@ XD_LISP_OBJECT, XD_LO_LINK, XD_OPAQUE_PTR, - XD_STRUCT_PTR, - XD_STRUCT_ARRAY, + XD_BLOCK_PTR, + XD_BLOCK_ARRAY, XD_OPAQUE_DATA_PTR, XD_UNION, XD_UNION_DYNAMIC_SIZE, - XD_C_STRING, + XD_ASCII_STRING, XD_DOC_STRING, XD_INT_RESET, XD_BYTECOUNT, @@ -866,7 +873,7 @@ #define XD_INDIRECT_DELTA(code) ((-1 - (code)) >> 8) #define XD_DYNARR_DESC(base_type, sub_desc) \ - { XD_STRUCT_PTR, offsetof (base_type, base), XD_INDIRECT(1, 0), sub_desc }, \ + { XD_BLOCK_PTR, offsetof (base_type, base), XD_INDIRECT(1, 0), sub_desc }, \ { XD_INT, offsetof (base_type, cur) }, \ { XD_INT_RESET, offsetof (base_type, max), XD_INDIRECT(1, 0) } \ @@ -1154,7 +1161,7 @@ extern const struct lrecord_implementation lrecord_##c_name; \ DECLARE_INLINE_HEADER ( \ structtype * \ -error_check_##c_name (Lisp_Object obj, const char *file, int line) \ +error_check_##c_name (Lisp_Object obj, const Ascbyte *file, int line) \ ) \ { \ assert_at_line (RECORD_TYPEP (obj, lrecord_type_##c_name), file, line); \ @@ -1166,7 +1173,7 @@ extern MODULE_API const struct lrecord_implementation lrecord_##c_name; \ DECLARE_INLINE_HEADER ( \ structtype * \ -error_check_##c_name (Lisp_Object obj, const char *file, int line) \ +error_check_##c_name (Lisp_Object obj, const Ascbyte *file, int line) \ ) \ { \ assert_at_line (RECORD_TYPEP (obj, lrecord_type_##c_name), file, line); \ @@ -1179,7 +1186,7 @@ extern struct lrecord_implementation lrecord_##c_name; \ DECLARE_INLINE_HEADER ( \ structtype * \ -error_check_##c_name (Lisp_Object obj, const char *file, int line) \ +error_check_##c_name (Lisp_Object obj, const Ascbyte *file, int line) \ ) \ { \ assert_at_line (RECORD_TYPEP (obj, lrecord_type_##c_name), file, line); \ @@ -1190,7 +1197,7 @@ # define DECLARE_NONRECORD(c_name, type_enum, structtype) \ DECLARE_INLINE_HEADER ( \ structtype * \ -error_check_##c_name (Lisp_Object obj, const char *file, int line) \ +error_check_##c_name (Lisp_Object obj, const Ascbyte *file, int line) \ ) \ { \ assert_at_line (XTYPE (obj) == type_enum, file, line); \ @@ -1205,7 +1212,7 @@ DECLARE_INLINE_HEADER ( Lisp_Object -wrap_record_1 (const void *ptr, enum lrecord_type ty, const char *file, +wrap_record_1 (const void *ptr, enum lrecord_type ty, const Ascbyte *file, int line) ) { @@ -1402,14 +1409,14 @@ overwrite the header information. */ #define copy_sized_lcrecord(dst, src, size) \ - memcpy ((char *) (dst) + sizeof (struct lcrecord_header), \ - (char *) (src) + sizeof (struct lcrecord_header), \ + memcpy ((Rawbyte *) (dst) + sizeof (struct lcrecord_header), \ + (Rawbyte *) (src) + sizeof (struct lcrecord_header), \ (size) - sizeof (struct lcrecord_header)) #define copy_lcrecord(dst, src) copy_sized_lcrecord (dst, src, sizeof (*(dst))) #define zero_sized_lcrecord(lcr, size) \ - memset ((char *) (lcr) + sizeof (struct lcrecord_header), 0, \ + memset ((Rawbyte *) (lcr) + sizeof (struct lcrecord_header), 0, \ (size) - sizeof (struct lcrecord_header)) #define zero_lcrecord(lcr) zero_sized_lcrecord (lcr, sizeof (*(lcr))) @@ -1439,13 +1446,26 @@ /* Dumping */ /************************************************************************/ -/* dump_add_root_struct_ptr (&var, &desc) dumps the structure pointed to by +/* dump_add_root_block_ptr (&var, &desc) dumps the structure pointed to by `var'. This is for a single relocatable pointer located in the data - segment (i.e. the block pointed to is in the heap). */ + segment (i.e. the block pointed to is in the heap). + + If the structure pointed to is not a `struct' but an array, you should + set the size field of the sized_memory_description to 0, and use + XD_BLOCK_ARRAY in the inner memory_description. + + NOTE that a "root struct pointer" could also be described using + dump_add_root_block(), with SIZE == sizeof (void *), and a description + containing a single XD_BLOCK_PTR entry, offset 0, size 1, with a + structure description the same as the value passed to + dump_add_root_block_ptr(). That would require an extra level of + description, though, as compared to using dump_add_root_block_ptr(), + and thus this function is generally more convenient. + */ #ifdef PDUMP -void dump_add_root_struct_ptr (void *, const struct sized_memory_description *); +void dump_add_root_block_ptr (void *, const struct sized_memory_description *); #else -#define dump_add_root_struct_ptr(varaddr,descaddr) DO_NOTHING +#define dump_add_root_block_ptr(varaddr, descaddr) DO_NOTHING #endif /* dump_add_opaque (&var, size) dumps the opaque static structure `var'. @@ -1465,7 +1485,7 @@ void dump_add_root_block (const void *ptraddress, Bytecount size, const struct memory_description *desc); #else -#define dump_add_root_block(ptraddress,desc) DO_NOTHING +#define dump_add_root_block(ptraddress, size, desc) DO_NOTHING #endif /* Call dump_add_opaque_int (&int_var) to dump `int_var', of type `int'. */ @@ -1512,8 +1532,8 @@ #ifdef PDUMP #include "dumper.h" -#define DUMPEDP(adr) ((((char *) (adr)) < pdump_end) && \ - (((char *) (adr)) >= pdump_start)) +#define DUMPEDP(adr) ((((Rawbyte *) (adr)) < pdump_end) && \ + (((Rawbyte *) (adr)) >= pdump_start)) #else #define DUMPEDP(adr) 0 #endif @@ -1534,9 +1554,15 @@ const void *idata); const struct sized_memory_description *lispdesc_indirect_description_1 (const void *obj, const struct sized_memory_description *sdesc); -Bytecount lispdesc_structure_size (const void *obj, - const struct sized_memory_description * - sdesc); +Bytecount lispdesc_block_size_1 (const void *obj, Bytecount size, + const struct memory_description *desc); + +DECLARE_INLINE_HEADER ( +Bytecount lispdesc_block_size (const void *obj, + const struct sized_memory_description *sdesc)) +{ + return lispdesc_block_size_1 (obj, sdesc->size, sdesc->description); +} DECLARE_INLINE_HEADER ( EMACS_INT
--- a/src/lstream.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/lstream.c Thu Nov 04 23:08:28 2004 +0000 @@ -134,9 +134,9 @@ static const struct memory_description lstream_description[] = { - { XD_STRUCT_PTR, offsetof (Lstream, imp), 1, + { XD_BLOCK_PTR, offsetof (Lstream, imp), 1, &lstream_implementation_description }, - { XD_STRUCT_ARRAY, offsetof (Lstream, data), 1, + { XD_BLOCK_ARRAY, offsetof (Lstream, data), 1, lstream_extra_description_map }, { XD_END } }; @@ -1637,7 +1637,7 @@ static Lisp_Object make_lisp_buffer_stream_1 (struct buffer *buf, Charbpos start, Charbpos end, - int flags, const Char_ASCII *mode) + int flags, const Ascbyte *mode) { Lstream *lstr; struct lisp_buffer_stream *str; @@ -1867,6 +1867,4 @@ vars_of_lstream (void) { INIT_LRECORD_IMPLEMENTATION (lstream); - - reinit_vars_of_lstream (); }
--- a/src/m/7300.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/7300.h Thu Nov 04 23:08:28 2004 +0000 @@ -51,13 +51,9 @@ #ifdef __GNUC__ -#define HAVE_ALLOCA - #else #define SWITCH_ENUM_BUG -#define C_ALLOCA -#define STACK_DIRECTION -1 #endif
--- a/src/m/acorn.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/acorn.h Thu Nov 04 23:08:28 2004 +0000 @@ -63,26 +63,12 @@ #define ADJUST_EXEC_HEADER {hdr.a_magic &= ~MF_SQUEEZED;} -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - #ifdef __GNUC__ -/* Use builtin alloca. Also be sure that no other ones are tried out. */ -#define alloca __builtin_alloca -#define HAVE_ALLOCA - /* Keep gcc/RISCiX happy - it uses __gccmain where other versions of gcc use __main, because of a library routine name clash. */ #define __main __gccmain -#else -#define C_ALLOCA -#undef HAVE_ALLOCA #endif /* __GNUC__ */ /* Define NO_REMAP if memory segmentation makes it not work well @@ -124,9 +110,6 @@ #undef SYSTEM_MALLOC -/* For the portable alloca */ -#define STACK_DIRECTION -1 - #ifdef NO_REMAP /* CRT0_O is defined in s/riscix1-1.h or s/riscix1-2.h, as appropriate. */ #define START_FILES "pre-crt0.o CRT0_O"
--- a/src/m/alliant-2800.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/alliant-2800.h Thu Nov 04 23:08:28 2004 +0000 @@ -53,16 +53,6 @@ #define UNEXEC "unexfx2800.o" #define LIBS_MACHINE "-lalliant" -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#undef C_ALLOCA -#define HAVE_ALLOCA - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/alliant.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/alliant.h Thu Nov 04 23:08:28 2004 +0000 @@ -39,21 +39,6 @@ #undef LOAD_AVE_TYPE #undef LOAD_AVE_CVT -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#undef C_ALLOCA -#define HAVE_ALLOCA - -#ifdef ALLIANT_1 -#define C_ALLOCA -#undef HAVE_ALLOCA -#endif /* ALLIANT_1 */ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/altos.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/altos.h Thu Nov 04 23:08:28 2004 +0000 @@ -26,18 +26,9 @@ #define LIB_STANDARD "-lc" -#ifdef __GNUC__ -#define alloca __builtin_alloca -#define HAVE_ALLOCA -#else -#define C_ALLOCA /* we have -lPW and alloca but it's broken! - <vsedev!ron> */ -#endif - #define SWITCH_ENUM_BUG #define NO_REMAP -#define STACK_DIRECTION -1 #undef TERMINFO
--- a/src/m/amdahl.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/amdahl.h Thu Nov 04 23:08:28 2004 +0000 @@ -49,20 +49,6 @@ /*#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0)*/ -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA -/*#define HAVE_ALLOCA */ - -#ifdef HAVE_ALLOCA -#define LIB_STANDARD "-lPW -lc" -#endif - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp @@ -105,9 +91,6 @@ #define SEGSIZ 0x10000 /* Should this not be defined elsewhere ? */ #define SEGMENT_MASK (SEGSIZ - 1) -/* Tell alloca.c which direction stack grows. */ -#define STACK_DIRECTION -1 - /* Compensate for error in signal.h. */ #if NSIG==19 #undef NSIG
--- a/src/m/apollo.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/apollo.h Thu Nov 04 23:08:28 2004 +0000 @@ -39,10 +39,6 @@ /* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT since there is no /dev/kmem */ -/* Define HAVE_ALLOCA because we use the system's version of alloca. */ - -#define HAVE_ALLOCA - /* Prevent -lg from being used for debugging. Not needed. */ #define LIBS_DEBUG
--- a/src/m/att3b.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/att3b.h Thu Nov 04 23:08:28 2004 +0000 @@ -37,17 +37,9 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - /* SysV has alloca in the PW library */ #define LIB_STANDARD "-lPW -lc" -#define HAVE_ALLOCA /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section @@ -98,9 +90,6 @@ #define TEXT_START 0 -/* For alloca.c (not actually used, since HAVE_ALLOCA) */ -#define STACK_DIRECTION 1 - /* (short) negative-int doesn't sign-extend correctly */ #define SHORT_CAST_BUG
--- a/src/m/aviion.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/aviion.h Thu Nov 04 23:08:28 2004 +0000 @@ -37,17 +37,6 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ -#define HAVE_ALLOCA -#define alloca(x) __builtin_alloca(x) - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/celerity.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/celerity.h Thu Nov 04 23:08:28 2004 +0000 @@ -39,9 +39,5 @@ #define LD_SWITCH_MACHINE "-k100000" -/* alloca is provided by the system. */ - -#define HAVE_ALLOCA - /* (short) negative-int doesn't sign-extend correctly */ #define SHORT_CAST_BUG
--- a/src/m/clipper.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/clipper.h Thu Nov 04 23:08:28 2004 +0000 @@ -40,15 +40,6 @@ #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/cnvrgnt.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/cnvrgnt.h Thu Nov 04 23:08:28 2004 +0000 @@ -34,16 +34,6 @@ #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA -#undef HAVE_ALLOCA - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp @@ -55,10 +45,6 @@ #define SWITCH_ENUM_BUG -/* grows towards lower addresses. */ - -#define STACK_DIRECTION -1 - /* some errno.h's don't actually allocate the variable itself. Cause crt0.c to define errno. */
--- a/src/m/convex.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/convex.h Thu Nov 04 23:08:28 2004 +0000 @@ -50,16 +50,6 @@ #define LOAD_AVE_CVT(x) (int) ((x) * 100.0) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ -#define HAVE_ALLOCA - /* Must use the system's termcap. It does special things. */ #define LIBS_TERMCAP "-ltermcap"
--- a/src/m/cydra5.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/cydra5.h Thu Nov 04 23:08:28 2004 +0000 @@ -37,16 +37,6 @@ #define LOAD_AVE_CVT(x) x -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA -#undef HAVE_ALLOCA - #define DATA_START 0x20000000 /* Define NO_REMAP if memory segmentation makes it not work well @@ -57,9 +47,6 @@ #define NO_REMAP #define LIBS_MACHINE "-lsocket -lnsl" -/* Stack grows downward in memory. */ -#define STACK_DIRECTION -1 - /* The data section in a coff file must be aligned in the file. */ #define DATA_SECTION_ALIGNMENT 0xFFF
--- a/src/m/delta.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/delta.h Thu Nov 04 23:08:28 2004 +0000 @@ -42,16 +42,6 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ -/* #define HAVE_ALLOCA */ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp @@ -86,11 +76,6 @@ # define LIBX11_SYSTEM "-lnls -lnsl_s" #endif /* HAVE_X_WINDOWS */ -#ifdef __GNUC__ - /* Use builtin alloca. Also be sure that no other ones are tried out. */ -# define alloca __builtin_alloca -# define HAVE_ALLOCA - /* We are assuming here that the `true' GNU gcc has not been installed, and we are using the gnucc provided by Motorola. No support exists for compiling with GNU gcc, as I do not have it on
--- a/src/m/delta88k.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/delta88k.h Thu Nov 04 23:08:28 2004 +0000 @@ -51,25 +51,6 @@ #define NO_REMAP -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* BEM: Distributed asm alloca doesn't work. Don't know about libPW.a. - C ALLOCA is safe and fast enough for now. */ - -#ifdef __GNUC__ -#define HAVE_ALLOCA /* ... and be sure that no other ones are tried out. */ -#undef C_ALLOCA -#else /* not __GNUC__ */ -#undef HAVE_ALLOCA -#define C_ALLOCA /* Use the alloca() supplied in alloca.c. */ -#define STACK_DIRECTION -1 /* The stack grows towards lower addresses. */ -#endif /* __GNUC__ */ - /* * we have the wrong name for networking libs */
--- a/src/m/dpx2.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/dpx2.h Thu Nov 04 23:08:28 2004 +0000 @@ -49,16 +49,6 @@ #define FSCALE 1000.0 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA -/* #define HAVE_ALLOCA /**/ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp @@ -133,12 +123,6 @@ #define TEXT_START 0 -/* - * Define the direction of stack growth. - */ - -#define STACK_DIRECTION -1 - /* on bos2.00.45 there is a bug that makes the F_SETOWN fcntl() call enters in an infinite loop. Avoid calling it */ #define F_SETOWN_BUG
--- a/src/m/elxsi.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/elxsi.h Thu Nov 04 23:08:28 2004 +0000 @@ -50,16 +50,6 @@ #define LOAD_AVE_CVT(x) (int) ((x) * 100.0) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA -/*#define HAVE_ALLOCA */ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/ews4800r.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/ews4800r.h Thu Nov 04 23:08:28 2004 +0000 @@ -36,19 +36,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / 256.0) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#ifdef __GNUC__ -#define HAVE_ALLOCA -#else -#define C_ALLOCA -#endif - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/gec63.h Thu Nov 04 22:51:31 2004 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* machine description file for gec63 - Copyright (C) 1986 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs 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. - -GNU Emacs 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: FSF 19.31. */ - -/* The following line tells the configuration script what sort of - operating system this machine is likely to run. - USUAL-OPSYS="usg5-2" */ - -/* Say this machine is a 68000 */ - -#define gec63 - -/* GEC63 has alloca in the PW/ux63 library. */ -#define LIB_STANDARD "-lPW -lc" -#define HAVE_ALLOCA - -/* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT - since there is no /dev/kmem */ - -#undef ADDR_CORRECT(x) - -#undef TERMCAP -#define TERMINFO - -#define NO_REMAP - -/* The rest of the file certainly needs updating for Emacs 19.29! */ - -/* I'm certain none of this works with XEmacs. -jwz */ -#error fixme - -/* Define sizes of portions of a Lisp_Object. */ -#define VALBITS 24 - -#define VALAMASK (((1<<VALBITS) - 1)| 0xF0000000L) - -#define XTYPE(a) ((enum Lisp_Type) (((a) >> VALBITS) & GCTYPEMASK)) -#define XSETTYPE(a, b) ((a) = ((a) & VALAMASK) + ((int)(b) << VALBITS)) - -#define XPNTR(a) ((a) & VALAMASK) - -#define XSET(var, type, ptr) \ - ((var) = ((int)(type) << VALBITS) + ((int) (ptr) & VALAMASK)) - -/* Move some garbage-collector flag bits to different bit positions. */ -#define ARRAY_MARK_FLAG (1 << 27)
--- a/src/m/gould.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/gould.h Thu Nov 04 23:08:28 2004 +0000 @@ -65,16 +65,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA -#define STACK_DIRECTION -1 /* grows towards lower addresses on Gould UTX/32 */ - /* No need to extend the user stack. */ /* If this is a 2.1 system, COFF will be predefined by cpp. If it's */
--- a/src/m/hp300bsd.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/hp300bsd.h Thu Nov 04 23:08:28 2004 +0000 @@ -34,7 +34,5 @@ #define CRT0_DUMMIES one_dummy, -#define HAVE_ALLOCA - #define LOAD_AVE_TYPE long #define LOAD_AVE_CVT(x) ((int) (((double) (x)) / 2048.0 * 100.0))
--- a/src/m/hp800.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/hp800.h Thu Nov 04 23:08:28 2004 +0000 @@ -50,21 +50,6 @@ #define LOAD_AVE_CVT(x) ((int) (x * 100.0)) - -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* lemacs change: define HAVE_ALLOCA if gcc is being used */ -#ifdef __GNUC__ -#define HAVE_ALLOCA -#else -#define C_ALLOCA -#endif - /* the data segment on this machine always starts at address 0x40000000. */ #ifdef DATA_START @@ -77,8 +62,6 @@ #define DATA_START 0x40000000 #define TEXT_START 0x00000000 -#define STACK_DIRECTION 1 - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/hp9000s300.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/hp9000s300.h Thu Nov 04 23:08:28 2004 +0000 @@ -64,8 +64,6 @@ #define CRT0_DUMMIES bogus_a6, -#define HAVE_ALLOCA - #ifndef __GNUC__ #define LIBS_DEBUG /* don't have -lg that works */ #define C_DEBUG_SWITCH /* don't support -g */ @@ -94,10 +92,6 @@ #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) -#ifdef __GNUC__ -#define HAVE_ALLOCA -#endif - /* This library is needed with -g, on the 200/300 only. */ #if !defined(__GNUC__) || defined(__HPUX_ASM__)
--- a/src/m/i860.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/i860.h Thu Nov 04 23:08:28 2004 +0000 @@ -39,16 +39,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA -/* #define HAVE_ALLOCA */ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/ibmps2-aix.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/ibmps2-aix.h Thu Nov 04 23:08:28 2004 +0000 @@ -99,15 +99,7 @@ /* Here override various assumptions in ymakefile */ -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - #ifdef __GNUC__ -#define HAVE_ALLOCA #define alloca(n) __builtin_alloca(n) #if __GNUC__ < 2 #define LIB_STANDARD "/usr/local/lib/gcc-gnulib -lbsd -lrts -lc " @@ -116,8 +108,6 @@ /* tranle says that -fstrength-reduce does not help. */ #define C_DEBUG_SWITCH #else -#define C_ALLOCA -#define STACK_DIRECTION -1 /* tell alloca.c which way it grows */ #define LIBS_MACHINE "-lbsd -lrts" #endif
--- a/src/m/ibmrs6000.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/ibmrs6000.h Thu Nov 04 23:08:28 2004 +0000 @@ -62,19 +62,6 @@ #undef ADDR_CORRECT #define ADDR_CORRECT(x) ((int)(x)) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* Note: aix3-2.h defines HAVE_ALLOCA; aix3-1.h doesn't. */ -#ifndef HAVE_ALLOCA -#define C_ALLOCA -#define STACK_DIRECTION -1 /* tell alloca.c which way it grows */ -#endif - /* Specify the font for X to use. This used to be Rom14.500; that's nice on the X server shipped with the RS/6000, but it's not available on other servers. */
--- a/src/m/ibmrt-aix.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/ibmrt-aix.h Thu Nov 04 23:08:28 2004 +0000 @@ -56,16 +56,6 @@ #define A_TEXT_SEEK(HDR) (N_TXTOFF (hdr) + sizeof (hdr)) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA -#define STACK_DIRECTION -1 /* tell alloca.c which way it grows */ - /* AIX has PTYs, so define here, along with macros needed to make them work. */ #define PTY_ITERATION for (i=0; i<256; i++)
--- a/src/m/ibmrt.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/ibmrt.h Thu Nov 04 23:08:28 2004 +0000 @@ -43,14 +43,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define HAVE_ALLOCA #define DATA_START 0x10000000
--- a/src/m/intel386.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/intel386.h Thu Nov 04 23:08:28 2004 +0000 @@ -115,8 +115,6 @@ #define NO_REMAP -#define STACK_DIRECTION -1 - /* Since cannot purify, use standard Xenix 386 startup code. */ #define START_FILES "/lib/386/Sseg.o pre-crt0.o /lib/386/Scrt0.o" @@ -144,11 +142,3 @@ #define SEGMENT_MASK ((SEGMENT_SIZE)-1) #endif - -#ifdef __GNUC__ -/* GCC's alloca() is semi-broken. See lisp.h. - - This brokenness has been confirmed under both Linux and NetBSD. - It may also exist on non-Intel architectures. */ -#define BROKEN_ALLOCA_IN_FUNCTION_CALLS -#endif
--- a/src/m/iris4d.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/iris4d.h Thu Nov 04 23:08:28 2004 +0000 @@ -49,16 +49,6 @@ #define KERNEL_FILE "/unix" #endif -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ /* Sjoerd.Mullender@cwi.nl says no need. */ -/* #define HAVE_ALLOCA */ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp @@ -109,8 +99,3 @@ #undef FIRST_PTY_LETTER #define FIRST_PTY_LETTER 'q' - -/* Define STACK_DIRECTION for alloca.c */ - -#undef STACK_DIRECTION -#define STACK_DIRECTION -1
--- a/src/m/iris5d.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/iris5d.h Thu Nov 04 23:08:28 2004 +0000 @@ -50,16 +50,6 @@ #undef KERNEL_FILE #define KERNEL_FILE "/unix" -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA -/* #define HAVE_ALLOCA */ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp @@ -112,9 +102,6 @@ #undef FIRST_PTY_LETTER #define FIRST_PTY_LETTER 'q' -/* Define STACK_DIRECTION for alloca.c */ - -#define STACK_DIRECTION -1 #ifndef __GNUC__ /* Turn off some "helpful" error checks for type mismatches
--- a/src/m/iris6d.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/iris6d.h Thu Nov 04 23:08:28 2004 +0000 @@ -49,16 +49,6 @@ #define KERNEL_FILE "/unix" #endif -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ /* Sjoerd.Mullender@cwi.nl says no need. */ -/* #define HAVE_ALLOCA */ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp @@ -109,8 +99,3 @@ #undef FIRST_PTY_LETTER #define FIRST_PTY_LETTER 'q' - -/* Define STACK_DIRECTION for alloca.c */ - -#undef STACK_DIRECTION -#define STACK_DIRECTION -1
--- a/src/m/irist.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/irist.h Thu Nov 04 23:08:28 2004 +0000 @@ -76,16 +76,6 @@ #define FSCALE 1.0 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ -#define HAVE_ALLOCA - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/isi-ov.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/isi-ov.h Thu Nov 04 23:08:28 2004 +0000 @@ -71,7 +71,6 @@ /* A few changes for the newer systems. */ #ifdef BSD4_3 -#define HAVE_ALLOCA /* The following line affects crt0.c. */ #undef m68k
--- a/src/m/luna88k.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/luna88k.h Thu Nov 04 23:08:28 2004 +0000 @@ -55,12 +55,6 @@ #define A_TEXT_OFFSET(HDR) sizeof(HDR) #define A_TEXT_SEEK(HDR) sizeof(HDR) -/* Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - At least, gcc for 88000 supports inline alloca. */ - -#define HAVE_ALLOCA - /* Memory management mechanism is different on Mach, so emacs-supplied malloc.c does not work. */
--- a/src/m/m68k.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/m68k.h Thu Nov 04 23:08:28 2004 +0000 @@ -33,9 +33,4 @@ #define TEXT_START 0 #endif -/* If compiling with GCC, let GCC implement alloca. */ -#if defined(__GNUC__) && !defined(alloca) -#define alloca(n) __builtin_alloca(n) -#define HAVE_ALLOCA -#endif #define ASSERT_VALID_POINTER(pnt) (assert ((((int) pnt) & 1) == 0))
--- a/src/m/masscomp.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/masscomp.h Thu Nov 04 23:08:28 2004 +0000 @@ -39,25 +39,6 @@ #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* On return from a subroutine, the 68020 compiler restores old contents of - register variables relative to sp, so alloca() screws up such routines. - The following definitions should work on all Masscomps. On the MC-5500 - (a 68000) one can #undef C_ALLOCA and #define HAVE_ALLOCA. */ -#ifdef mc500 -#undef C_ALLOCA -#define HAVE_ALLOCA -#else -#define C_ALLOCA -#undef HAVE_ALLOCA -#endif - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/mg1.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/mg1.h Thu Nov 04 23:08:28 2004 +0000 @@ -50,16 +50,6 @@ #define FSCALE 1000.0 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ -/* hmmmm... again not sure. so copied sequent.h again! */ -#undef C_ALLOCA -#undef HAVE_ALLOCA - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/mips-nec.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/mips-nec.h Thu Nov 04 23:08:28 2004 +0000 @@ -57,19 +57,6 @@ #undef KERNEL_FILE #define KERNEL_FILE "/unix" -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#ifdef __GNUC__ -#define HAVE_ALLOCA -#else -#define C_ALLOCA -#endif - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/mips-siemens.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/mips-siemens.h Thu Nov 04 23:08:28 2004 +0000 @@ -57,19 +57,6 @@ #undef KERNEL_FILE #define KERNEL_FILE "/unix" -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#ifdef __GNUC__ -#define HAVE_ALLOCA -#else -#define C_ALLOCA -#endif - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/mips.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/mips.h Thu Nov 04 23:08:28 2004 +0000 @@ -52,19 +52,6 @@ #define KERNEL_FILE "/unix" #endif /* ! linux */ -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#ifdef __GNUC__ -#define HAVE_ALLOCA -#else -#define C_ALLOCA -#endif - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/news.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/news.h Thu Nov 04 23:08:28 2004 +0000 @@ -40,10 +40,6 @@ #define CRT0_DUMMIES one_dummy, #endif -/* The News machine has alloca. */ - -#define HAVE_ALLOCA - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double
--- a/src/m/nh3000.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/nh3000.h Thu Nov 04 23:08:28 2004 +0000 @@ -47,16 +47,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ -#define HAVE_ALLOCA - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/nh4000.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/nh4000.h Thu Nov 04 23:08:28 2004 +0000 @@ -46,16 +46,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ -#define HAVE_ALLOCA - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/ns32000.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/ns32000.h Thu Nov 04 23:08:28 2004 +0000 @@ -37,18 +37,6 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ -#ifdef __NetBSD__ -#define HAVE_ALLOCA -#endif - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp @@ -58,8 +46,6 @@ #define TEXT_START 0 -#define STACK_DIRECTION -1 - #ifndef __NetBSD__ #define EXEC_MAGIC 0410
--- a/src/m/orion105.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/orion105.h Thu Nov 04 23:08:28 2004 +0000 @@ -38,8 +38,6 @@ #endif #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -#define HAVE_ALLOCA - /* Here is where programs actually start running */ #define TEXT_START 0x8000 #define LD_TEXT_START_ADDR 8000
--- a/src/m/pfa50.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/pfa50.h Thu Nov 04 23:08:28 2004 +0000 @@ -50,7 +50,6 @@ /* SX/A has alloca in the PW library. */ #define LIB_STANDARD "-lPW -lc" -#define HAVE_ALLOCA /* SX/A uses terminfo and lib/curses */
--- a/src/m/plexus.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/plexus.h Thu Nov 04 23:08:28 2004 +0000 @@ -39,16 +39,6 @@ #undef LOAD_AVE_CVT -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#undef C_ALLOCA -#define HAVE_ALLOCA - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/pmax.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/pmax.h Thu Nov 04 23:08:28 2004 +0000 @@ -48,11 +48,6 @@ and it causes hanging in read_process_output. */ #define BROKEN_O_NONBLOCK -#if defined (OSF1) || defined (MACH) -#undef C_ALLOCA -#define HAVE_ALLOCA -#endif - /* mcc@timessqr.gc.cuny.edu says this makes Emacs work with DECnet. */ #ifdef HAVE_LIBDNET #define LIBS_MACHINE "-ldnet"
--- a/src/m/powerpc.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/powerpc.h Thu Nov 04 23:08:28 2004 +0000 @@ -68,15 +68,6 @@ #undef ADDR_CORRECT #define ADDR_CORRECT(x) ((int)(x)) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define HAVE_ALLOCA - /* Specify the font for X to use. This used to be Rom14.500; that's nice on the X server shipped with the RS/6000, but it's not available on other servers. */ @@ -86,7 +77,6 @@ /* #undef START_FILES */ /* #define HAVE_SYSVIPC */ -/* #define HAVE_GETWD */ /* Don't try to include sioctl.h or ptem.h. */ #undef NEED_SIOCTL
--- a/src/m/pyrmips.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/pyrmips.h Thu Nov 04 23:08:28 2004 +0000 @@ -6,6 +6,5 @@ #include "m-pyramid.h" #define SYSTEM_MALLOC -#define HAVE_ALLOCA #define CANNOT_DUMP
--- a/src/m/sequent-ptx.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/sequent-ptx.h Thu Nov 04 23:08:28 2004 +0000 @@ -49,18 +49,6 @@ #define FSCALE 1000.0 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#ifndef __GNUC__ -#define C_ALLOCA -#undef HAVE_ALLOCA -#endif - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/sequent.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/sequent.h Thu Nov 04 23:08:28 2004 +0000 @@ -58,16 +58,6 @@ #define FSCALE 1000.0 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ -#define HAVE_ALLOCA - /* Name of file the to look in for the kernel symbol table (for load average) */
--- a/src/m/sgi-challenge.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/sgi-challenge.h Thu Nov 04 23:08:28 2004 +0000 @@ -62,16 +62,6 @@ #undef KERNEL_FILE #define KERNEL_FILE "/unix" -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA -/* #define HAVE_ALLOCA */ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp @@ -123,10 +113,6 @@ #undef FIRST_PTY_LETTER #define FIRST_PTY_LETTER 'q' -/* Define STACK_DIRECTION for alloca.c */ - -#define STACK_DIRECTION -1 - /* By Tor Arntsen <tor@spacetec.no> for XEmacs. */ #ifdef USE_GCC #define C_SWITCH_MACHINE "-D_BSD_TYPES -mcpu=r4000 -mips2"
--- a/src/m/symmetry.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/symmetry.h Thu Nov 04 23:08:28 2004 +0000 @@ -46,16 +46,6 @@ #define FSCALE 1000.0 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ -/*#define HAVE_ALLOCA*/ - /* Name of file the to look in for the kernel symbol table (for load average) */
--- a/src/m/tad68k.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/tad68k.h Thu Nov 04 23:08:28 2004 +0000 @@ -31,17 +31,9 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - /* SysV has alloca in the PW library */ #define LIB_STANDARD "-lPW -lc" -#define HAVE_ALLOCA /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section
--- a/src/m/tahoe.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/tahoe.h Thu Nov 04 23:08:28 2004 +0000 @@ -54,7 +54,3 @@ /* This triggers some stuff to avoid a compiler bug */ #define TAHOE_REGISTER_BUG - -/* System provides alloca. */ - -#define HAVE_ALLOCA
--- a/src/m/targon31.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/targon31.h Thu Nov 04 23:08:28 2004 +0000 @@ -40,16 +40,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ -/* #define HAVE_ALLOCA */ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/tekxd88.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/tekxd88.h Thu Nov 04 23:08:28 2004 +0000 @@ -41,22 +41,8 @@ code will not be sharable; but that's better than failing completely. */ #define NO_REMAP -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca /* Use the gcc builtin alloca() ... */ -# define HAVE_ALLOCA /* ... and be sure that no other ones are tried out. */ -# undef C_ALLOCA -# define C_OPTIMIZE_SWITCH "-O2" -#else /* not __GNUC__ */ -# undef HAVE_ALLOCA -# define C_ALLOCA /* Use the alloca() supplied in alloca.c. */ -# define STACK_DIRECTION -1 /* The stack grows towards lower addresses. */ -# define C_OPTIMIZE_SWITCH "-O" +#ifndef __GNUC__ +# define C_OPTIMIZE_SWITCH -O #endif /* __GNUC__ */ #undef LIB_X11_LIB /* Don't use shared libraries defined in usg5-3.h */
--- a/src/m/template.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/template.h Thu Nov 04 23:08:28 2004 +0000 @@ -37,16 +37,6 @@ #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA -#define HAVE_ALLOCA - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/tower32.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/tower32.h Thu Nov 04 23:08:28 2004 +0000 @@ -38,16 +38,6 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* #define C_ALLOCA */ -#define HAVE_ALLOCA - /* Change some things to avoid bugs in compiler */ #define SWITCH_ENUM_BUG 1
--- a/src/m/tower32v3.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/tower32v3.h Thu Nov 04 23:08:28 2004 +0000 @@ -38,27 +38,15 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - #ifdef __GNUC__ -#define HAVE_ALLOCA -#define alloca __builtin_alloca #define C_OPTIMIZE_SWITCH "-O -fstrength-reduce -fomit-frame-pointer" #define LIB_STANDARD "-lc /lib/crtn.o" #else /* This section is correct if you do *not* change src/ymakefile so that CFLAGS includes C_OPTIMIZE_SWITCH rather than C_DEBUG_SWITCH. */ -#define HAVE_ALLOCA -#define "C_DEBUG_SWITCH -g -O0" +#define C_DEBUG_SWITCH "-g -O0" #define LIB_STANDARD "-lc -lPW /lib/crtn.o" /* This section is correct if you do enable C_OPTIMIZE_SWITCH. */ -/* #define C_ALLOCA */ -/* #define STACK_DIRECTION -1 */ /* #define C_OPTIMIZE_SWITCH -O2 */ /* #define LIB_STANDARD -lc /lib/crtn.o */ #endif
--- a/src/m/ustation.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/ustation.h Thu Nov 04 23:08:28 2004 +0000 @@ -40,21 +40,6 @@ #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* On return from a subroutine, the 68020 compiler restores old contents of - register variables relative to sp, so alloca() screws up such routines. - The following definitions should work on all Masscomps. On the MC-5500 - (a 68000) one can #undef C_ALLOCA and #define HAVE_ALLOCA. */ - -#define C_ALLOCA -#undef HAVE_ALLOCA - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/vax.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/vax.h Thu Nov 04 23:08:28 2004 +0000 @@ -81,7 +81,6 @@ #ifdef USG #define LIB_STANDARD "-lPW -lc" -#define HAVE_ALLOCA /* There is some bug in unexec in for usg 5.2 on a vax which nobody who runs such a system has yet tracked down. */ @@ -92,10 +91,6 @@ #define TEXT_START 0 #endif /* USG */ -#ifdef BSD -#define HAVE_ALLOCA -#endif /* BSD */ - #ifdef BSD4_2 #define HAVE_FTIME #endif
--- a/src/m/wicat.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/wicat.h Thu Nov 04 23:08:28 2004 +0000 @@ -43,18 +43,6 @@ #undef LOAD_AVE_CVT -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -/* For the Wicat C compiler version 4.2, this can be removed - and the alloca in alloca.s used. */ -#define C_ALLOCA -#define STACK_DIRECTION -1 /* grows towards lower addresses on WICAT */ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp
--- a/src/m/xps100.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/m/xps100.h Thu Nov 04 23:08:28 2004 +0000 @@ -39,23 +39,12 @@ /* #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) */ -/* Define C_ALLOCA if this machine does not support a true alloca - and the one written in C should be used instead. - Define HAVE_ALLOCA to say that the system provides a properly - working alloca function and it should be used. - Define neither one if an assembler-language alloca - in the file alloca.s should be used. */ - -#define C_ALLOCA -/* #define HAVE_ALLOCA */ - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp code will not be sharable; but that's better than failing completely. */ #define NO_REMAP -#define STACK_DIRECTION -1 #define TERMINFO #define SWITCH_ENUM_BUG #define LIB_STANDARD " -lc"
--- a/src/menubar-gtk.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/menubar-gtk.c Thu Nov 04 23:08:28 2004 +0000 @@ -875,13 +875,15 @@ if (STRINGP (suffix) && XSTRING_LENGTH (suffix)) { - label_buffer = (Ibyte*) ALLOCA (XSTRING_LENGTH (name) + 15 + XSTRING_LENGTH (suffix)); - sprintf ((char*) label_buffer, "%s %s ", XSTRING_DATA (name), XSTRING_DATA (suffix)); + /* !!#### */ + label_buffer = alloca_ibytes (XSTRING_LENGTH (name) + 15 + XSTRING_LENGTH (suffix)); + qxesprintf (label_buffer, "%s %s ", XSTRING_DATA (name), + XSTRING_DATA (suffix)); } else { - label_buffer = (Ibyte*) ALLOCA (XSTRING_LENGTH (name) + 15); - sprintf ((char*) label_buffer, "%s ", XSTRING_DATA (name)); + label_buffer = alloca_ibytes (XSTRING_LENGTH (name) + 15); + qxesprintf (label_buffer, "%s ", XSTRING_DATA (name)); } temp_label = convert_underscores (label_buffer); @@ -1082,9 +1084,7 @@ menu_create_menubar (struct frame *f, Lisp_Object descr) { gboolean right_justify = FALSE; - Lisp_Object tail = Qnil; Lisp_Object value = descr; - Lisp_Object item_descr = Qnil; GtkWidget *menubar = FRAME_GTK_MENUBAR_WIDGET (f); GUI_ID id = (GUI_ID) gtk_object_get_data (GTK_OBJECT (menubar), XEMACS_MENU_GUIID_TAG); guint menu_position = 0; @@ -1098,74 +1098,74 @@ menubar_accel_group = gtk_accel_group_new(); - EXTERNAL_LIST_LOOP (tail, value) - { - gpointer current_child = g_list_nth_data (GTK_MENU_SHELL (menubar)->children, menu_position); + { + EXTERNAL_LIST_LOOP_2 (item_descr, value) + { + gpointer current_child = g_list_nth_data (GTK_MENU_SHELL (menubar)->children, menu_position); - item_descr = XCAR (tail); + if (NILP (item_descr)) + { + /* Need to start right-justifying menus */ + right_justify = TRUE; + menu_position--; + } + else if (VECTORP (item_descr)) + { + /* It is a button description */ + GtkWidget *item; - if (NILP (item_descr)) - { - /* Need to start right-justifying menus */ - right_justify = TRUE; - menu_position--; - } - else if (VECTORP (item_descr)) - { - /* It is a button description */ - GtkWidget *item; + item = menu_descriptor_to_widget (item_descr, menubar_accel_group); + gtk_widget_set_name (item, "XEmacsMenuButton"); + + if (!item) + { + item = gtk_menu_item_new_with_label ("ITEM CREATION ERROR"); + } - item = menu_descriptor_to_widget (item_descr, menubar_accel_group); - gtk_widget_set_name (item, "XEmacsMenuButton"); - - if (!item) - { - item = gtk_menu_item_new_with_label ("ITEM CREATION ERROR"); - } + gtk_widget_show_all (item); + if (current_child) gtk_widget_destroy (GTK_WIDGET (current_child)); + gtk_menu_bar_insert (GTK_MENU_BAR (menubar), item, menu_position); + } + else if (LISTP (item_descr)) + { + /* Need to actually convert it into a menu and slap it in */ + GtkWidget *widget; + gboolean reused_p = FALSE; - gtk_widget_show_all (item); - if (current_child) gtk_widget_destroy (GTK_WIDGET (current_child)); - gtk_menu_bar_insert (GTK_MENU_BAR (menubar), item, menu_position); - } - else if (LISTP (item_descr)) - { - /* Need to actually convert it into a menu and slap it in */ - GtkWidget *widget; - gboolean reused_p = FALSE; + /* We may be able to reuse the widget, let's at least check. */ + if (current_child && menu_can_reuse_widget (GTK_WIDGET (current_child), + XSTRING_DATA (XCAR (item_descr)))) + { + widget = menu_convert (item_descr, GTK_WIDGET (current_child), + menubar_accel_group); + reused_p = TRUE; + } + else + { + widget = menu_convert (item_descr, NULL, menubar_accel_group); + if (current_child) gtk_widget_destroy (GTK_WIDGET (current_child)); + gtk_menu_bar_insert (GTK_MENU_BAR (menubar), widget, menu_position); + } - /* We may be able to reuse the widget, let's at least check. */ - if (current_child && menu_can_reuse_widget (GTK_WIDGET (current_child), - XSTRING_DATA (XCAR (item_descr)))) - { - widget = menu_convert (item_descr, GTK_WIDGET (current_child), - menubar_accel_group); - reused_p = TRUE; - } - else - { - widget = menu_convert (item_descr, NULL, menubar_accel_group); - if (current_child) gtk_widget_destroy (GTK_WIDGET (current_child)); - gtk_menu_bar_insert (GTK_MENU_BAR (menubar), widget, menu_position); - } - - if (widget) - { - if (right_justify) gtk_menu_item_right_justify (GTK_MENU_ITEM (widget)); - } - else - { - widget = gtk_menu_item_new_with_label ("ERROR"); - /* abort() */ - } - gtk_widget_show_all (widget); - } - else if (STRINGP (item_descr)) - { - /* Do I really want to be this careful? Anything else in a - menubar description is illegal */ - } - menu_position++; - } + if (widget) + { + if (right_justify) gtk_menu_item_right_justify (GTK_MENU_ITEM (widget)); + } + else + { + widget = gtk_menu_item_new_with_label ("ERROR"); + /* abort() */ + } + gtk_widget_show_all (widget); + } + else if (STRINGP (item_descr)) + { + /* Do I really want to be this careful? Anything else in a + menubar description is illegal */ + } + menu_position++; + } + } /* Need to delete any menu items that were past the bounds of the new one */ { @@ -1495,7 +1495,6 @@ If non-nil, menus can be torn off into their own top-level windows. */ ); #endif - reinit_vars_of_menubar_gtk (); } /*---------------------------------------------------------------------------*/
--- a/src/menubar-msw.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/menubar-msw.c Thu Nov 04 23:08:28 2004 +0000 @@ -383,7 +383,6 @@ populate_or_checksum_helper (HMENU menu, Lisp_Object path, Lisp_Object desc, Lisp_Object hash_tab, int bar_p, int populate_p) { - Lisp_Object item_desc; int deep_p, flush_right; struct gcpro gcpro1, gcpro2, gcpro3; unsigned long checksum; @@ -418,24 +417,26 @@ /* Loop thru the desc's CDR and add items for each entry */ flush_right = 0; - EXTERNAL_LIST_LOOP (item_desc, desc) - { - if (NILP (XCAR (item_desc))) - { - /* Do not flush right menubar items when MS style compliant */ - if (bar_p && !REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH) - flush_right = 1; - if (!populate_p) - checksum = HASH2 (checksum, LISP_HASH (Qnil)); - } - else if (populate_p) - populate_menu_add_item (menu, path, hash_tab, - XCAR (item_desc), &accel_list, - flush_right, bar_p); - else - checksum = HASH2 (checksum, - checksum_menu_item (XCAR (item_desc))); - } + { + EXTERNAL_LIST_LOOP_2 (elt, desc) + { + if (NILP (elt)) + { + /* Do not flush right menubar items when MS style compliant */ + if (bar_p && !REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH) + flush_right = 1; + if (!populate_p) + checksum = HASH2 (checksum, LISP_HASH (Qnil)); + } + else if (populate_p) + populate_menu_add_item (menu, path, hash_tab, + elt, &accel_list, + flush_right, bar_p); + else + checksum = HASH2 (checksum, + checksum_menu_item (elt)); + } + } if (populate_p) {
--- a/src/menubar-x.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/menubar-x.c Thu Nov 04 23:08:28 2004 +0000 @@ -1375,8 +1375,6 @@ void vars_of_menubar_x (void) { - reinit_vars_of_menubar_x (); - #if defined (LWLIB_MENUBARS_LUCID) Fprovide (intern ("lucid-menubars")); #elif defined (LWLIB_MENUBARS_MOTIF)
--- a/src/menubar.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/menubar.c Thu Nov 04 23:08:28 2004 +0000 @@ -187,49 +187,51 @@ */ (desc, path)) { - Lisp_Object path_entry, submenu_desc, submenu; struct gcpro gcpro1, gcpro2; Lisp_Object gui_item = allocate_gui_item (); Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item); GCPRO2 (gui_item, desc); - EXTERNAL_LIST_LOOP (path_entry, path) - { - /* Verify that DESC describes a menu, not single item */ - if (!CONSP (desc)) - RETURN_UNGCPRO (Qnil); + { + EXTERNAL_LIST_LOOP_2 (elt, path) + { + /* Verify that DESC describes a menu, not single item */ + if (!CONSP (desc)) + RETURN_UNGCPRO (Qnil); + + /* Parse this menu */ + desc = menu_parse_submenu_keywords (desc, gui_item); + + /* Check that this (sub)menu is active */ + if (!gui_item_active_p (gui_item)) + RETURN_UNGCPRO (Qnil); - /* Parse this menu */ - desc = menu_parse_submenu_keywords (desc, gui_item); + /* Apply :filter */ + if (!NILP (pgui_item->filter)) + desc = call1 (pgui_item->filter, desc); - /* Check that this (sub)menu is active */ - if (!gui_item_active_p (gui_item)) + /* Find the next menu on the path inside this one */ + { + EXTERNAL_LIST_LOOP_2 (submenu, desc) + { + if (CONSP (submenu) + && STRINGP (XCAR (submenu)) + && !NILP (Fstring_equal (XCAR (submenu), elt))) + { + desc = submenu; + goto descend; + } + } + } + /* Submenu not found */ RETURN_UNGCPRO (Qnil); - /* Apply :filter */ - if (!NILP (pgui_item->filter)) - desc = call1 (pgui_item->filter, desc); - - /* Find the next menu on the path inside this one */ - EXTERNAL_LIST_LOOP (submenu_desc, desc) - { - submenu = XCAR (submenu_desc); - if (CONSP (submenu) - && STRINGP (XCAR (submenu)) - && !NILP (Fstring_equal (XCAR (submenu), XCAR (path_entry)))) - { - desc = submenu; - goto descend; - } - } - /* Submenu not found */ - RETURN_UNGCPRO (Qnil); - - descend: - /* Prepare for the next iteration */ - gui_item_init (gui_item); - } + descend: + /* Prepare for the next iteration */ + gui_item_init (gui_item); + } + } /* We have successfully descended down the end of the path */ UNGCPRO; @@ -345,7 +347,7 @@ end = string_char_length (name); name_data = XSTRING_DATA (name); - string_result = (Ibyte *) ALLOCA (end * MAX_ICHAR_LEN); + string_result = alloca_ibytes (end * MAX_ICHAR_LEN); string_result_ptr = string_result; for (i = 0; i < end; i++) {
--- a/src/minibuf.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/minibuf.c Thu Nov 04 23:08:28 2004 +0000 @@ -255,10 +255,8 @@ /* Ignore this element if it fails to match all the regexps. */ if (!NILP (Vcompletion_regexp_list)) { - Lisp_Object regexps; - EXTERNAL_LIST_LOOP (regexps, Vcompletion_regexp_list) + EXTERNAL_LIST_LOOP_2 (re, Vcompletion_regexp_list) { - Lisp_Object re = XCAR (regexps); CHECK_STRING (re); if (fast_string_match (re, nonreloc, reloc, offset, length, 0, ERROR_ME, 0) < 0) @@ -955,8 +953,6 @@ void vars_of_minibuf (void) { - reinit_vars_of_minibuf (); - staticpro (&Vminibuf_prompt); Vminibuf_prompt = Qnil;
--- a/src/miscplay.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/miscplay.c Thu Nov 04 23:08:28 2004 +0000 @@ -48,7 +48,7 @@ int align; enum wvState state; size_t left; - UChar_Binary leftover[HEADERSZ]; + Binbyte leftover[HEADERSZ]; signed long chunklength; } wave; struct { @@ -56,13 +56,13 @@ int isdata; int skipping; size_t left; - UChar_Binary leftover[HEADERSZ]; + Binbyte leftover[HEADERSZ]; } audio; } parsestate; /* Use a global buffer as scratch-pad for possible conversions of the sampling format */ -UChar_Binary miscplay_sndbuf[SNDBUFSZ]; +Binbyte miscplay_sndbuf[SNDBUFSZ]; /* Initialize global parser state information to zero */ void reset_parsestate() @@ -121,7 +121,7 @@ memcpy(parsestate.wave.leftover+parsestate.wave.left, *data,rq); parsestate.wave.left += rq; - (*(UChar_Binary **)data) += rq; + (*(Binbyte **)data) += rq; *sz -= rq; return(rc); } @@ -192,7 +192,7 @@ else { if (parsestate.wave.chunklength > 0 && *sz > 0) { *sz -= parsestate.wave.chunklength; - (*(UChar_Binary **)data) += parsestate.wave.chunklength; } + (*(Binbyte **)data) += parsestate.wave.chunklength; } parsestate.wave.state = wvOutOfBlock; } break; case wvSoundChunk: { @@ -217,7 +217,7 @@ count = *sz; count -= rq = count % parsestate.wave.align; } *outbuf = *data; - (*(UChar_Binary **)data) += count; + (*(Binbyte **)data) += count; *sz -= count; if ((parsestate.wave.chunklength -= count) < parsestate.wave.align) { parsestate.wave.state = wvOutOfBlock; @@ -258,7 +258,7 @@ count = parsestate.audio.align - parsestate.audio.left); *outbuf = parsestate.audio.leftover; *sz -= count; - *data = (*(Char_Binary **)data) + count; + *data = (*(CBinbyte **)data) + count; parsestate.audio.left = 0; return(parsestate.audio.align); } else { @@ -266,7 +266,7 @@ memmove(parsestate.audio.leftover + parsestate.audio.left, *data, *sz); - *data = (*(Char_Binary **)data) + *sz; + *data = (*(CBinbyte **)data) + *sz; parsestate.audio.left += *sz; *sz = 0; return(0); } } @@ -278,7 +278,7 @@ *outbuf = *data; if ((parsestate.audio.left = rc % parsestate.audio.align) != 0) { memmove(parsestate.audio.leftover, - (Char_Binary *)*outbuf + rc - parsestate.audio.left, + (CBinbyte *)*outbuf + rc - parsestate.audio.left, parsestate.audio.left); rc -= parsestate.audio.left; } *sz = 0; @@ -288,7 +288,7 @@ header information and determine how many bytes we need to skip until the start of the sound chunk */ if (!parsestate.audio.skipping) { - UChar_Binary *header = (UChar_Binary *) *data; + Binbyte *header = (Binbyte *) *data; if (*sz < 8) { sound_warn("Irrecoverable error while parsing Sun/DEC audio file"); return(0); } @@ -310,10 +310,10 @@ if (*sz >= (size_t) parsestate.audio.skipping) { /* Skip just the header information and return the sound chunk */ int rc = *sz - parsestate.audio.skipping; - *outbuf = (Char_Binary *)*data + parsestate.audio.skipping; + *outbuf = (CBinbyte *)*data + parsestate.audio.skipping; if ((parsestate.audio.left = rc % parsestate.audio.align) != 0) { memmove(parsestate.audio.leftover, - (Char_Binary *)*outbuf + rc - parsestate.audio.left, + (CBinbyte *)*outbuf + rc - parsestate.audio.left, parsestate.audio.left); rc -= parsestate.audio.left; } *sz = 0; @@ -341,20 +341,20 @@ /* Convert 8 bit unsigned stereo data to 8 bit unsigned mono data */ size_t sndcnv8U_2mono(void **data,size_t *sz,void **outbuf) { - REGISTER UChar_Binary *src; - REGISTER UChar_Binary *dest; + REGISTER Binbyte *src; + REGISTER Binbyte *dest; int rc,count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (UChar_Binary *) *data; + src = (Binbyte *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (UChar_Binary)(((int)*(src) + + *dest++ = (Binbyte)(((int)*(src) + (int)*(src+1)) / 2); src += 2; } @@ -365,21 +365,21 @@ /* Convert 8 bit signed stereo data to 8 bit signed mono data */ size_t sndcnv8S_2mono(void **data,size_t *sz,void **outbuf) { - REGISTER UChar_Binary *src; - REGISTER UChar_Binary *dest; + REGISTER Binbyte *src; + REGISTER Binbyte *dest; int rc, count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (UChar_Binary *) *data; + src = (Binbyte *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (UChar_Binary)(((int)*((SChar_Binary *)(src)) + - (int)*((SChar_Binary *)(src+1))) / 2); + *dest++ = (Binbyte)(((int)*((SBinbyte *)(src)) + + (int)*((SBinbyte *)(src+1))) / 2); src += 2; } *data = src; @@ -389,21 +389,21 @@ /* Convert 8 bit signed stereo data to 8 bit unsigned mono data */ size_t sndcnv2monounsigned(void **data,size_t *sz,void **outbuf) { - REGISTER UChar_Binary *src; - REGISTER UChar_Binary *dest; + REGISTER Binbyte *src; + REGISTER Binbyte *dest; int rc,count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (UChar_Binary *) *data; + src = (Binbyte *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (UChar_Binary)(((int)*((SChar_Binary *)(src)) + - (int)*((SChar_Binary *)(src+1))) / 2) ^ 0x80; + *dest++ = (Binbyte)(((int)*((SBinbyte *)(src)) + + (int)*((SBinbyte *)(src+1))) / 2) ^ 0x80; src += 2; } *data = src; @@ -413,15 +413,15 @@ /* Convert 8 bit signed mono data to 8 bit unsigned mono data */ size_t sndcnv2unsigned(void **data,size_t *sz,void **outbuf) { - REGISTER UChar_Binary *src; - REGISTER UChar_Binary *dest; + REGISTER Binbyte *src; + REGISTER Binbyte *dest; int rc,count; count = *sz; if (count > SNDBUFSZ) { *sz -= SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (UChar_Binary *) *data; + src = (Binbyte *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) @@ -432,7 +432,7 @@ /* Convert a number in the range -32768..32767 to an 8 bit ulaw encoded number --- I hope, I got this conversion right :-) */ -static inline SChar_Binary int2ulaw(int i) +static inline SBinbyte int2ulaw(int i) { /* Lookup table for fast calculation of number of bits that need shifting*/ static short int t_bits[128] = { @@ -457,7 +457,7 @@ size_t sndcnvULaw_2linear(void **data,size_t *sz,void **outbuf) { /* conversion table stolen from Linux's ulaw.h */ - static UChar_Binary ulaw_dsp[] = { + static Binbyte ulaw_dsp[] = { 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 66, 68, 70, 72, 74, 76, 78, 80, @@ -491,7 +491,7 @@ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - UChar_Binary *p=(UChar_Binary *)*data; + Binbyte *p=(Binbyte *)*data; *outbuf = *data; while ((*sz)--) @@ -501,7 +501,7 @@ } *sz = 0; *data = p; - return p - (UChar_Binary *)*outbuf; + return p - (Binbyte *)*outbuf; } /* Convert 8 bit ulaw stereo data to 8 bit ulaw mono data */ @@ -543,15 +543,15 @@ +60, +56, +52, +48, +44, +40, +36, +32, +28, +24, +20, +16, +12, +8, +4, +0}; - REGISTER UChar_Binary *src; - REGISTER UChar_Binary *dest; + REGISTER Binbyte *src; + REGISTER Binbyte *dest; int rc,count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (UChar_Binary *) *data; + src = (Binbyte *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) @@ -589,8 +589,8 @@ signed mono data */ size_t sndcnv16_2monoLE(void **data,size_t *sz,void **outbuf) { - REGISTER UChar_Binary *src; - REGISTER UChar_Binary *dest; + REGISTER Binbyte *src; + REGISTER Binbyte *dest; int rc,count; signed short i; @@ -598,7 +598,7 @@ if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (UChar_Binary *) *data; + src = (Binbyte *) *data; *outbuf = dest = miscplay_sndbuf; for (count /= 2; count--; ) { @@ -607,8 +607,8 @@ (int)(src[2]) + 256*(int)(src[3])) / 2; src += 4; - *dest++ = (UChar_Binary)(i & 0xFF); - *dest++ = (UChar_Binary)((i / 256) & 0xFF); } + *dest++ = (Binbyte)(i & 0xFF); + *dest++ = (Binbyte)((i / 256) & 0xFF); } *data = src; return(rc); } @@ -617,8 +617,8 @@ signed mono data */ size_t sndcnv16_2monoBE(void **data,size_t *sz,void **outbuf) { - REGISTER UChar_Binary *src; - REGISTER UChar_Binary *dest; + REGISTER Binbyte *src; + REGISTER Binbyte *dest; int rc,count; signed short i; @@ -626,7 +626,7 @@ if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (UChar_Binary *) *data; + src = (Binbyte *) *data; *outbuf = dest = miscplay_sndbuf; for (count /= 2; count--; ) { @@ -635,8 +635,8 @@ (int)(src[3]) + 256*(int)(src[2])) / 2; src += 4; - *dest++ = (UChar_Binary)((i / 256) & 0xFF); - *dest++ = (UChar_Binary)(i & 0xFF); } + *dest++ = (Binbyte)((i / 256) & 0xFF); + *dest++ = (Binbyte)(i & 0xFF); } *data = src; return(rc); } @@ -644,19 +644,19 @@ /* Convert 16 bit little endian signed data to 8 bit unsigned data */ size_t sndcnv2byteLE(void **data,size_t *sz,void **outbuf) { - REGISTER UChar_Binary *src; - REGISTER UChar_Binary *dest; + REGISTER Binbyte *src; + REGISTER Binbyte *dest; int rc,count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (UChar_Binary *) *data; + src = (Binbyte *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (UChar_Binary)(((SChar_Binary *)src)[1] ^ (SChar_Binary)0x80); + *dest++ = (Binbyte)(((SBinbyte *)src)[1] ^ (SBinbyte)0x80); src += 2; } *data = src; @@ -666,19 +666,19 @@ /* Convert 16 bit big endian signed data to 8 bit unsigned data */ size_t sndcnv2byteBE(void **data,size_t *sz,void **outbuf) { - REGISTER UChar_Binary *src; - REGISTER UChar_Binary *dest; + REGISTER Binbyte *src; + REGISTER Binbyte *dest; int rc,count; count = *sz / 2; if (count > SNDBUFSZ) { *sz -= 2*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (UChar_Binary *) *data; + src = (Binbyte *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (UChar_Binary)(((SChar_Binary *)src)[0] ^ (SChar_Binary)0x80); + *dest++ = (Binbyte)(((SBinbyte *)src)[0] ^ (SBinbyte)0x80); src += 2; } *data = src; @@ -689,20 +689,20 @@ mono data */ size_t sndcnv2monobyteLE(void **data,size_t *sz,void **outbuf) { - REGISTER UChar_Binary *src; - REGISTER UChar_Binary *dest; + REGISTER Binbyte *src; + REGISTER Binbyte *dest; int rc,count; count = *sz / 4; if (count > SNDBUFSZ) { *sz -= 4*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (UChar_Binary *) *data; + src = (Binbyte *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (UChar_Binary)(((int)((SChar_Binary *)src)[1] + - (int)((SChar_Binary *)src)[3]) / 2 ^ 0x80); + *dest++ = (Binbyte)(((int)((SBinbyte *)src)[1] + + (int)((SBinbyte *)src)[3]) / 2 ^ 0x80); src += 4; } *data = src; @@ -713,20 +713,20 @@ mono data */ size_t sndcnv2monobyteBE(void **data,size_t *sz,void **outbuf) { - REGISTER UChar_Binary *src; - REGISTER UChar_Binary *dest; + REGISTER Binbyte *src; + REGISTER Binbyte *dest; int rc,count; count = *sz / 4; if (count > SNDBUFSZ) { *sz -= 4*SNDBUFSZ; count = SNDBUFSZ; } else *sz = 0; rc = count; - src = (UChar_Binary *) *data; + src = (Binbyte *) *data; *outbuf = dest = miscplay_sndbuf; while (count--) { - *dest++ = (UChar_Binary)(((int)((SChar_Binary *)src)[0] + - (int)((SChar_Binary *)src)[2]) / 2 ^ 0x80); + *dest++ = (Binbyte)(((int)((SBinbyte *)src)[0] + + (int)((SBinbyte *)src)[2]) / 2 ^ 0x80); src += 4; } *data = src; @@ -736,7 +736,7 @@ /* Look at the header of the sound file and try to determine the format; we can recognize files in VOC, WAVE, and, Sun/DEC-audio format--- everything else is assumed to be raw 8 bit unsigned data sampled at 8kHz */ -fmtType analyze_format(UChar_Binary *format,int *fmt,int *speed, +fmtType analyze_format(Binbyte *format,int *fmt,int *speed, int *tracks, size_t (**parsesndfile)(void **,size_t *sz, void **))
--- a/src/miscplay.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/miscplay.h Thu Nov 04 23:08:28 2004 +0000 @@ -55,7 +55,7 @@ size_t sndcnv2monobyteLE(void **data,size_t *sz,void **outbuf); size_t sndcnv2monobyteBE(void **data,size_t *sz,void **outbuf); -fmtType analyze_format(UChar_Binary *format,int *fmt,int *speed, +fmtType analyze_format(Binbyte *format,int *fmt,int *speed, int *tracks, size_t (**parsesndfile)(void **,size_t *sz, void **));
--- a/src/mule-charset.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/mule-charset.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,7 +1,7 @@ /* Functions to handle multilingual characters. Copyright (C) 1992, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2001, 2002 Ben Wing. + Copyright (C) 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -162,20 +162,6 @@ write_fmt_string (printcharfun, " 0x%x>", cs->header.uid); } -static void -finalize_charset (void *header, int for_disksave) -{ - /* See mule-charset.h, definition of Lisp_Charset. */ - Lisp_Object charset = wrap_charset ((Lisp_Charset *) header); - if (for_disksave && XCHARSET_TO_UNICODE_TABLE (charset)) - { - /* Control-1, ASCII, Composite don't have tables */ - free_charset_unicode_tables (charset); - XCHARSET_TO_UNICODE_TABLE (charset) = 0; - XCHARSET_FROM_UNICODE_TABLE (charset) = 0; - } -} - static const struct memory_description charset_description[] = { { XD_INT, offsetof (Lisp_Charset, dimension) }, { XD_INT, offsetof (Lisp_Charset, from_unicode_levels) }, @@ -195,7 +181,7 @@ DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, 1, /* dumpable flag */ - mark_charset, print_charset, finalize_charset, + mark_charset, print_charset, 0, 0, 0, charset_description, Lisp_Charset); /* Make a new charset. */ /* #### SJT Should generic properties be allowed? */ @@ -1014,30 +1000,13 @@ DEFSYMBOL (Qcomposite); } -static int -init_charset_unicode_tables_mapper (Lisp_Object UNUSED (key), - Lisp_Object value, void *UNUSED (closure)) -{ - init_charset_unicode_tables (value); - return 0; -} - -void -init_mule_charset (void) -{ - /* See mule-charset.h, definition of Lisp_Charset. */ - if (initialized) - elisp_maphash (init_charset_unicode_tables_mapper, Vcharset_hash_table, - 0); -} - void vars_of_mule_charset (void) { int i, j, k; chlook = xnew_and_zero (struct charset_lookup); /* zero for Purify. */ - dump_add_root_struct_ptr (&chlook, &charset_lookup_description); + dump_add_root_block_ptr (&chlook, &charset_lookup_description); /* Table of charsets indexed by leading byte. */ for (i = 0; i < countof (chlook->charset_by_leading_byte); i++)
--- a/src/mule-coding.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/mule-coding.c Thu Nov 04 23:08:28 2004 +0000 @@ -952,9 +952,9 @@ static const struct memory_description iso2022_coding_system_description[] = { { XD_LISP_OBJECT_ARRAY, offsetof (struct iso2022_coding_system, initial_charset), 4 }, - { XD_STRUCT_PTR, offsetof (struct iso2022_coding_system, input_conv), + { XD_BLOCK_PTR, offsetof (struct iso2022_coding_system, input_conv), 1, &ccsd_description }, - { XD_STRUCT_PTR, offsetof (struct iso2022_coding_system, output_conv), + { XD_BLOCK_PTR, offsetof (struct iso2022_coding_system, output_conv), 1, &ccsd_description }, { XD_END } }; @@ -1274,46 +1274,7 @@ or invocation of an invalid character set and treat that as 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_coding_stream *iso, @@ -2480,11 +2441,8 @@ parse_charset_conversion_specs (charset_conversion_spec_dynarr *store_here, Lisp_Object spec_list) { - Lisp_Object rest; - - EXTERNAL_LIST_LOOP (rest, spec_list) + EXTERNAL_LIST_LOOP_2 (car, spec_list) { - Lisp_Object car = XCAR (rest); Lisp_Object from, to; struct charset_conversion_spec spec; @@ -3078,7 +3036,7 @@ { Lisp_Object sym; struct ccl_program test_ccl; - Char_ASCII *suffix; + Ascbyte *suffix; /* Check key first. */ if (EQ (key, Qdecode))
--- a/src/mule-wnnfns.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/mule-wnnfns.c Thu Nov 04 23:08:28 2004 +0000 @@ -361,6 +361,7 @@ return Qnil; } size = XSTRING_LENGTH (lname) > 1024 ? 1026 : XSTRING_LENGTH (lname) + 2; + /* !!#### */ envname = (char *) ALLOCA (size); strncpy (envname, (char *) XSTRING_DATA (lname), size-2); envname[size-2] = '\0'; @@ -1890,8 +1891,6 @@ void vars_of_mule_wnn (void) { - reinit_vars_of_mule_wnn (); - DEFVAR_INT ("lb-sisheng", &lb_sisheng /* Leading character for Sisheng. */ );
--- a/src/nas.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/nas.c Thu Nov 04 23:08:28 2004 +0000 @@ -136,7 +136,7 @@ extern Lisp_Object Vsynchronous_sounds; -static Sound SoundOpenDataForReading (UChar_Binary *data, int length); +static Sound SoundOpenDataForReading (Binbyte *data, int length); static AuServer *aud; @@ -274,7 +274,7 @@ static void do_caching_play (Sound s, int volume, - UChar_Binary *buf) + Binbyte *buf) { AuBucketAttributes *list, b; @@ -442,9 +442,9 @@ return 1; } -int nas_play_sound_data (UChar_Binary *data, int length, int volume); +int nas_play_sound_data (Binbyte *data, int length, int volume); int -nas_play_sound_data (UChar_Binary *data, int length, int volume) +nas_play_sound_data (Binbyte *data, int length, int volume) { Sound s; int offset; @@ -621,7 +621,7 @@ /* Create a name from the sound. */ static Extbyte * -NameFromData (const Char_Binary *buf, +NameFromData (const CBinbyte *buf, int len) { @@ -665,7 +665,7 @@ */ static SndInfo * -SndOpenDataForReading (const Char_Binary *data, +SndOpenDataForReading (const CBinbyte *data, int length) { @@ -682,7 +682,7 @@ if (NAS_LITTLE_ENDIAN) { - Char_Binary n; + CBinbyte n; swapl (&si->h.magic, n); swapl (&si->h.dataOffset, n); @@ -731,7 +731,7 @@ #define Err() { return NULL; } #define readFourcc(_f) dread(_f, sizeof(RIFF_FOURCC), 1) #define cmpID(_x, _y) \ - strncmp((Char_Binary *) (_x), (Char_Binary *) (_y), sizeof(RIFF_FOURCC)) + strncmp((CBinbyte *) (_x), (CBinbyte *) (_y), sizeof(RIFF_FOURCC)) #define PAD2(_x) (((_x) + 1) & ~1) /* These functions here are for faking file I/O from buffer. */ @@ -760,7 +760,7 @@ if (file_posn + nread <= file_len) { - memcpy(buf, (Char_Binary *) file_data + file_posn, size * nitems); + memcpy(buf, (CBinbyte *) file_data + file_posn, size * nitems); file_posn += nread; return nitems; } @@ -775,7 +775,7 @@ dgetc (void) { if (file_posn < file_len) - return ((Char_Binary *)file_data)[file_posn++]; + return ((CBinbyte *)file_data)[file_posn++]; else return -1; } @@ -829,7 +829,7 @@ readChunk (RiffChunk *c) { int status; - Char_Binary n; + CBinbyte n; if ((status = dread(c, sizeof(RiffChunk), 1))) if (NAS_BIG_ENDIAN) @@ -842,7 +842,7 @@ read the wave data from a buffer in memory. */ static WaveInfo * -WaveOpenDataForReading (const Char_Binary *data, +WaveOpenDataForReading (const CBinbyte *data, int length) { RiffChunk ck; @@ -976,7 +976,7 @@ static Sound -SoundOpenDataForReading (UChar_Binary *data, +SoundOpenDataForReading (Binbyte *data, int length) { @@ -988,7 +988,7 @@ if (!(s = (Sound) malloc (sizeof (SoundRec)))) return NULL; - if ((s->formatInfo = SndOpenDataForReading ((Char_Binary *) data, length)) != NULL) + if ((s->formatInfo = SndOpenDataForReading ((CBinbyte *) data, length)) != NULL) { #if (AudioLibraryVersionMajor >= 2 ) && (AudioLibraryVersionMinor >= 3) if ((toProc = SoundFileGetProc(SoundFileFormatSnd, @@ -1009,7 +1009,7 @@ return NULL; } } - else if ((s->formatInfo = WaveOpenDataForReading ((Char_Binary *) data, length)) != NULL) + else if ((s->formatInfo = WaveOpenDataForReading ((CBinbyte *) data, length)) != NULL) { #if (AudioLibraryVersionMajor >= 2 ) && (AudioLibraryVersionMinor >= 3) if ((toProc = SoundFileGetProc(SoundFileFormatWave,
--- a/src/nt.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/nt.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,6 +1,6 @@ /* Utility and Unix shadow routines under MS Windows (WIN32_NATIVE defined). Copyright (C) 1994, 1995 Free Software Foundation, Inc. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -389,7 +389,7 @@ if (qxeRegQueryValueEx (hrootkey, keyext, NULL, NULL, NULL, &cbData) == ERROR_SUCCESS - && (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL + && (lpvalue = xnew_array (BYTE, cbData)) != NULL && qxeRegQueryValueEx (hrootkey, keyext, NULL, lpdwtype, lpvalue, &cbData) == ERROR_SUCCESS) return (lpvalue); @@ -407,7 +407,7 @@ if (qxeRegQueryValueEx (hrootkey, keyext, NULL, NULL, NULL, &cbData) == ERROR_SUCCESS && - (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL && + (lpvalue = xnew_array (BYTE, cbData)) != NULL && qxeRegQueryValueEx (hrootkey, keyext, NULL, lpdwtype, lpvalue, &cbData) == ERROR_SUCCESS) return (lpvalue); @@ -433,7 +433,7 @@ LPBYTE lpval; DWORD dwType; - static Char_ASCII *env_vars[] = + static Ascbyte *env_vars[] = { "HOME", "EMACSLOADPATH", @@ -483,7 +483,7 @@ Charcount cch; cch = qxeExpandEnvironmentStrings ((Extbyte *) lpval, buf, 0); - buf = (Extbyte *) ALLOCA (cch * XETCHAR_SIZE); + buf = alloca_extbytes (cch * XETCHAR_SIZE); qxeExpandEnvironmentStrings ((Extbyte *) lpval, buf, cch); TSTR_TO_C_STRING (buf, envval); eputenv (env_vars[i], (CIbyte *) envval); @@ -510,17 +510,14 @@ The same applies to COMSPEC. */ { - Lisp_Object tail; - - EXTERNAL_LIST_LOOP (tail, Vprocess_environment) + EXTERNAL_LIST_LOOP_2 (str, Vprocess_environment) { - Lisp_Object str = XCAR (tail); if (STRINGP (str)) { Ibyte *dat = XSTRING_DATA (str); - if (qxestrncasecmp_c (dat, "PATH=", 5) == 0) + if (qxestrncasecmp_ascii (dat, "PATH=", 5) == 0) memcpy (dat, "PATH=", 5); - else if (qxestrncasecmp_c (dat, "COMSPEC=", 8) == 0) + else if (qxestrncasecmp_ascii (dat, "COMSPEC=", 8) == 0) memcpy (dat, "COMSPEC=", 8); } } @@ -700,7 +697,7 @@ entry if present. */ if (info == NULL) { - info = (volume_info_data *) xmalloc (sizeof (volume_info_data)); + info = xnew (volume_info_data); add_volume_info (root_dir, info); } else @@ -727,7 +724,7 @@ { /* We probably only need a couple of bytes, but let's be generous in case this function gets changed */ - Ibyte *temp = alloca_array (Ibyte, qxestrlen (name) + 10); + Ibyte *temp = alloca_ibytes (qxestrlen (name) + 10); Ibyte *rootname = NULL; /* default to current volume */ volume_info_data *info; @@ -781,10 +778,10 @@ mswindows_is_executable (const Ibyte *name) { Ibyte *p = qxestrrchr (name, '.'); - return (p != NULL && (qxestrcasecmp_c (p, ".exe") == 0 || - qxestrcasecmp_c (p, ".com") == 0 || - qxestrcasecmp_c (p, ".bat") == 0 || - qxestrcasecmp_c (p, ".cmd") == 0)); + return (p != NULL && (qxestrcasecmp_ascii (p, ".exe") == 0 || + qxestrcasecmp_ascii (p, ".com") == 0 || + qxestrcasecmp_ascii (p, ".bat") == 0 || + qxestrcasecmp_ascii (p, ".cmd") == 0)); } /* Emulate the Unix directory procedures opendir, closedir, @@ -1881,10 +1878,10 @@ p = qxestrrchr (filename, '.'); /* We can only identify DOS .com programs from the extension. */ - if (p && qxestrcasecmp_c (p, ".com") == 0) + if (p && qxestrcasecmp_ascii (p, ".com") == 0) *is_dos_app = TRUE; - else if (p && (qxestrcasecmp_c (p, ".bat") == 0 || - qxestrcasecmp_c (p, ".cmd") == 0)) + else if (p && (qxestrcasecmp_ascii (p, ".bat") == 0 || + qxestrcasecmp_ascii (p, ".cmd") == 0)) { /* A DOS shell script - it appears that CreateProcess is happy to accept this (somewhat surprisingly); presumably it looks at
--- a/src/nt.h Thu Nov 04 22:51:31 2004 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* Include file for nt.c; used whenever WIN32_NATIVE is defined. - #### rename me to win32.h - Copyright (C) 1994 Free Software Foundation, Inc. - Copyright (C) 2000, 2001 Ben Wing. - -This file is part of XEmacs. - -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - - -/* #define FULL_DEBUG */ - -#ifndef INCLUDED_nt_h_ -#define INCLUDED_nt_h_ - -#include "syswindows.h" -#include "systime.h" /* because of struct utimbuf below */ - - -#endif /* INCLUDED_nt_h_ */
--- a/src/ntheap.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/ntheap.c Thu Nov 04 23:08:28 2004 +0000 @@ -52,39 +52,39 @@ } /* Round ADDRESS up to be aligned with ALIGN. */ -UChar_Binary * -round_to_next (UChar_Binary *address, unsigned long align) +URawbyte * +round_to_next (URawbyte *address, unsigned long align) { unsigned long tmp; tmp = (unsigned long) address; tmp = (tmp + align - 1) / align; - return (UChar_Binary *) (tmp * align); + return (URawbyte *) (tmp * align); } /* Info for keeping track of our heap. */ -UChar_Binary *data_region_base = UNINIT_PTR; -UChar_Binary *data_region_end = UNINIT_PTR; -UChar_Binary *real_data_region_end = UNINIT_PTR; +URawbyte *data_region_base = UNINIT_PTR; +URawbyte *data_region_end = UNINIT_PTR; +URawbyte *real_data_region_end = UNINIT_PTR; unsigned long data_region_size = UNINIT_LONG; unsigned long reserved_heap_size = UNINIT_LONG; /* The start of the data segment. */ -UChar_Binary * +URawbyte * get_data_start (void) { return data_region_base; } /* The end of the data segment. */ -UChar_Binary * +URawbyte * get_data_end (void) { return data_region_end; } -static UChar_Binary * +static URawbyte * allocate_heap (void) { /* The base address for our GNU malloc heap is chosen in conjunction @@ -148,7 +148,7 @@ PAGE_NOACCESS); #endif - return (UChar_Binary *) ptr; + return (URawbyte *) ptr; } @@ -177,7 +177,7 @@ if (size < 0) { int new_size; - UChar_Binary *new_data_region_end; + URawbyte *new_data_region_end; size = -size; @@ -188,7 +188,7 @@ /* We can only decommit full pages, so allow for partial deallocation [cga]. */ new_data_region_end = (data_region_end - size); - new_data_region_end = (UChar_Binary *) + new_data_region_end = (URawbyte *) ((long) (new_data_region_end + syspage_mask) & ~syspage_mask); new_size = real_data_region_end - new_data_region_end; real_data_region_end = new_data_region_end; @@ -217,7 +217,7 @@ /* We really only commit full pages, so record where the real end of committed memory is [cga]. */ - real_data_region_end = (UChar_Binary *) + real_data_region_end = (URawbyte *) ((long) (data_region_end + syspage_mask) & ~syspage_mask); } @@ -239,8 +239,8 @@ void *tmp; MEMORY_BASIC_INFORMATION info; DWORD size; - UChar_Binary *base = get_heap_end (); - UChar_Binary *end = + URawbyte *base = get_heap_end (); + URawbyte *end = base + get_reserved_heap_size () - get_committed_heap_size (); VirtualQuery (base, &info, sizeof (info)); if (info.State != MEM_FREE)
--- a/src/ntplay.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/ntplay.c Thu Nov 04 23:08:28 2004 +0000 @@ -31,7 +31,7 @@ #include "sysfile.h" -static int play_sound_data_1 (UChar_Binary *data, int length, +static int play_sound_data_1 (Binbyte *data, int length, int volume, int convert); void @@ -49,14 +49,14 @@ { /* file isn't in the path so read it as data */ int size; - UChar_Binary *data; + Binbyte *data; int ofd = qxe_open (XSTRING_DATA (fname), O_RDONLY | OPEN_BINARY, 0); if (ofd <0) return; size = lseek (ofd, 0, SEEK_END); - data = (UChar_Binary *) xmalloc (size); + data = xnew_binbytes (size); lseek (ofd, 0, SEEK_SET); if (!data) @@ -68,7 +68,7 @@ if (retry_read (ofd, data, size) != size) { retry_close (ofd); - xfree (data, UChar_Binary *); + xfree (data, Binbyte *); return; } retry_close (ofd); @@ -82,21 +82,21 @@ /* mswindows can't cope with playing a sound from alloca space so we have to convert if necessary */ static int -play_sound_data_1 (UChar_Binary *data, int length, int UNUSED (volume), +play_sound_data_1 (Binbyte *data, int length, int UNUSED (volume), int convert_to_malloc) { DWORD flags = SND_ASYNC | SND_MEMORY | SND_NODEFAULT; - static UChar_Binary *sound_data = 0; + static Binbyte *sound_data = 0; if (sound_data) { qxePlaySound (NULL, NULL, flags); - xfree (sound_data, UChar_Binary *); + xfree (sound_data, Binbyte *); sound_data = 0; } if (convert_to_malloc) { - sound_data = (UChar_Binary *) xmalloc (length); + sound_data = xnew_binbytes (length); memcpy (sound_data, data, length); } else @@ -109,7 +109,7 @@ } int -play_sound_data (UChar_Binary *data, int length, int volume) +play_sound_data (Binbyte *data, int length, int volume) { return play_sound_data_1 (data, length, volume, TRUE); }
--- a/src/number-gmp.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/number-gmp.c Thu Nov 04 23:08:28 2004 +0000 @@ -91,7 +91,8 @@ void init_number_gmp () { - mp_set_memory_functions ((void *(*) (size_t))xmalloc, gmp_realloc, gmp_free); + mp_set_memory_functions ((void *(*) (size_t)) xmalloc, gmp_realloc, + gmp_free); /* The smallest number that is printed without exponents */ mpf_init_set_d (float_print_min, 0.001);
--- a/src/objects-msw.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/objects-msw.c Thu Nov 04 23:08:28 2004 +0000 @@ -50,7 +50,7 @@ typedef struct colormap_t { - const Char_ASCII *name; + const Ascbyte *name; COLORREF colorref; } colormap_t; @@ -728,7 +728,7 @@ typedef struct fontmap_t { - const Char_ASCII *name; + const Ascbyte *name; int value; } fontmap_t; @@ -964,7 +964,7 @@ return (PALETTERGB (r, g, b)); } } - else if (!qxestrncmp_c (name, "rgb:", 4)) + else if (!qxestrncmp_ascii (name, "rgb:", 4)) { unsigned int r, g, b; @@ -990,7 +990,7 @@ } else if (*name) /* Can't be an empty string */ { - Ibyte *nospaces = (Ibyte *) ALLOCA (qxestrlen (name) + 1); + Ibyte *nospaces = alloca_ibytes (qxestrlen (name) + 1); Ibyte *c = nospaces; while (*name) if (*name != ' ') @@ -1000,7 +1000,7 @@ *c = '\0'; for (i = 0; i < countof (mswindows_X_color_map); i++) - if (!qxestrcasecmp_c (nospaces, mswindows_X_color_map[i].name)) + if (!qxestrcasecmp_ascii (nospaces, mswindows_X_color_map[i].name)) return (mswindows_X_color_map[i].colorref); } return (COLORREF) -1; @@ -1010,7 +1010,7 @@ mswindows_color_to_string (COLORREF color) { int i; - Char_ASCII buf[8]; + Ascbyte buf[8]; COLORREF pcolor = PALETTERGB (GetRValue (color), GetGValue (color), GetBValue (color)); @@ -1057,14 +1057,14 @@ return 0; } else if (fontname) - qxestrcat_c (qxestrcat (fontname, c1), ":"); + qxestrcat_ascii (qxestrcat (fontname, c1), ":"); } else if (fontname) { if (c2 && c2[0] != '\0') - qxestrcat_c (qxestrcat (fontname, c2), ":"); + qxestrcat_ascii (qxestrcat (fontname, c2), ":"); else - qxestrcat_c (fontname, ":"); + qxestrcat_ascii (fontname, ":"); } if (e1) *(e1++) = ':'; @@ -1134,7 +1134,7 @@ for (i = 0; i < countof (charset_map); i++) if (lpelfe->elfLogFont.lfCharSet == charset_map[i].value) { - qxestrcat_c (fontname, charset_map[i].name); + qxestrcat_ascii (fontname, charset_map[i].name); break; } if (i == countof (charset_map)) @@ -1204,8 +1204,8 @@ c1 = qxestrrchr (font1, ':'); c2 = qxestrrchr (font2, ':'); - t1 = !qxestrcasecmp_c (c1 + 1, "western"); - t2 = !qxestrcasecmp_c (c2 + 1, "western"); + t1 = !qxestrcasecmp_ascii (c1 + 1, "western"); + t2 = !qxestrcasecmp_ascii (c2 + 1, "western"); if (t1 && !t2) return 1; @@ -1243,8 +1243,8 @@ return 1; } - t1 = !qxestrncasecmp_c (font1, "courier new:", 12); - t2 = !qxestrncasecmp_c (font2, "courier new:", 12); + t1 = !qxestrncasecmp_ascii (font1, "courier new:", 12); + t2 = !qxestrncasecmp_ascii (font2, "courier new:", 12); if (t1 && !t2) return 1; @@ -1500,7 +1500,7 @@ /* weight */ if (fields < 2) - qxestrcpy_c (weight, fontweight_map[0].name); + qxestrcpy_ascii (weight, fontweight_map[0].name); /* Maybe split weight into weight and style */ if ((c = qxestrchr (weight, ' '))) @@ -1512,7 +1512,7 @@ style = NULL; for (i = 0; i < countof (fontweight_map); i++) - if (!qxestrcasecmp_c (weight, fontweight_map[i].name)) + if (!qxestrcasecmp_ascii (weight, fontweight_map[i].name)) { if (logfont) logfont->lfWeight = fontweight_map[i].value; @@ -1537,7 +1537,7 @@ if (style) { /* #### what about oblique? */ - if (qxestrcasecmp_c (style, "italic") == 0) + if (qxestrcasecmp_ascii (style, "italic") == 0) { if (logfont) logfont->lfItalic = TRUE; @@ -1557,7 +1557,7 @@ else if (logfont) logfont->lfItalic = FALSE; - if (fields < 3 || !qxestrcmp_c (points, "")) + if (fields < 3 || !qxestrcmp_ascii (points, "")) ; else if (points[0] == '0' || qxestrspn (points, "0123456789") < qxestrlen (points)) @@ -1601,9 +1601,9 @@ else effects2 = NULL; - if (qxestrcasecmp_c (effects, "underline") == 0) + if (qxestrcasecmp_ascii (effects, "underline") == 0) underline = TRUE; - else if (qxestrcasecmp_c (effects, "strikeout") == 0) + else if (qxestrcasecmp_ascii (effects, "strikeout") == 0) strikeout = TRUE; else { @@ -1614,9 +1614,9 @@ if (effects2 && effects2[0] != '\0') { - if (qxestrcasecmp_c (effects2, "underline") == 0) + if (qxestrcasecmp_ascii (effects2, "underline") == 0) underline = TRUE; - else if (qxestrcasecmp_c (effects2, "strikeout") == 0) + else if (qxestrcasecmp_ascii (effects2, "strikeout") == 0) strikeout = TRUE; else { @@ -1630,12 +1630,12 @@ if (underline) { if (strikeout) - qxestrcpy_c (effects, "underline strikeout"); + qxestrcpy_ascii (effects, "underline strikeout"); else - qxestrcpy_c (effects, "underline"); + qxestrcpy_ascii (effects, "underline"); } else if (strikeout) - qxestrcpy_c (effects, "strikeout"); + qxestrcpy_ascii (effects, "strikeout"); if (logfont) { @@ -1663,12 +1663,12 @@ font_instantiate() calls the devmeth find_matching_font(), which gets a truename font spec with the registry (i.e. the charset spec) filled in appropriately to the charset. */ - if (!qxestrcmp_c (charset, "")) + if (!qxestrcmp_ascii (charset, "")) ; else { for (i = 0; i < countof (charset_map); i++) - if (!qxestrcasecmp_c (charset, charset_map[i].name)) + if (!qxestrcasecmp_ascii (charset, charset_map[i].name)) { if (logfont) logfont->lfCharSet = charset_map[i].value; @@ -2001,7 +2001,7 @@ font_charset = c; /* For border-glyph use */ - if (!qxestrcasecmp_c (font_charset, "symbol")) + if (!qxestrcasecmp_ascii (font_charset, "symbol")) font_charset = (const Ibyte *) "western"; /* Get code page for the charset */ @@ -2320,6 +2320,4 @@ make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); staticpro (&Vfont_signature_data); #endif /* MULE */ - - reinit_vars_of_object_mswindows (); }
--- a/src/objects-tty.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/objects-tty.c Thu Nov 04 23:08:28 2004 +0000 @@ -238,7 +238,7 @@ Ibyte *str = XSTRING_DATA (name); Lisp_Object charset = Qnil; - if (qxestrncmp_c (str, "normal", 6)) + if (qxestrncmp_ascii (str, "normal", 6)) return 0; str += 6; if (*str)
--- a/src/objects-x.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/objects-x.c Thu Nov 04 23:08:28 2004 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Tinker Systems. - Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004 Ben Wing. Copyright (C) 1995 Sun Microsystems, Inc. This file is part of XEmacs. @@ -652,7 +652,7 @@ if (ok) { int L = strlen (composed_name) + 1; - result = (Extbyte *) xmalloc (L); + result = xnew_extbytes (L); strncpy (result, composed_name, L); } else @@ -827,17 +827,17 @@ atom == DEVICE_XATOM_SPACING (d) || atom == DEVICE_XATOM_CHARSET_REGISTRY (d) || atom == DEVICE_XATOM_CHARSET_ENCODING (d) || - !qxestrcmp_c (name_str, "CHARSET_COLLECTIONS") || - !qxestrcmp_c (name_str, "FONTNAME_REGISTRY") || - !qxestrcmp_c (name_str, "CLASSIFICATION") || - !qxestrcmp_c (name_str, "COPYRIGHT") || - !qxestrcmp_c (name_str, "DEVICE_FONT_NAME") || - !qxestrcmp_c (name_str, "FULL_NAME") || - !qxestrcmp_c (name_str, "MONOSPACED") || - !qxestrcmp_c (name_str, "QUALITY") || - !qxestrcmp_c (name_str, "RELATIVE_SET") || - !qxestrcmp_c (name_str, "RELATIVE_WEIGHT") || - !qxestrcmp_c (name_str, "STYLE"))) + !qxestrcmp_ascii (name_str, "CHARSET_COLLECTIONS") || + !qxestrcmp_ascii (name_str, "FONTNAME_REGISTRY") || + !qxestrcmp_ascii (name_str, "CLASSIFICATION") || + !qxestrcmp_ascii (name_str, "COPYRIGHT") || + !qxestrcmp_ascii (name_str, "DEVICE_FONT_NAME") || + !qxestrcmp_ascii (name_str, "FULL_NAME") || + !qxestrcmp_ascii (name_str, "MONOSPACED") || + !qxestrcmp_ascii (name_str, "QUALITY") || + !qxestrcmp_ascii (name_str, "RELATIVE_SET") || + !qxestrcmp_ascii (name_str, "RELATIVE_WEIGHT") || + !qxestrcmp_ascii (name_str, "STYLE"))) { Extbyte *val_str = XGetAtomName (dpy, props [i].card32);
--- a/src/objects.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/objects.c Thu Nov 04 23:08:28 2004 +0000 @@ -63,7 +63,7 @@ static const struct memory_description color_instance_data_description_1 []= { #ifdef HAVE_TTY - { XD_STRUCT_PTR, tty_console, 1, &tty_color_instance_data_description}, + { XD_BLOCK_PTR, tty_console, 1, &tty_color_instance_data_description}, #endif { XD_END } }; @@ -260,7 +260,7 @@ static const struct memory_description font_instance_data_description_1 []= { #ifdef HAVE_TTY - { XD_STRUCT_PTR, tty_console, 1, &tty_font_instance_data_description}, + { XD_BLOCK_PTR, tty_console, 1, &tty_font_instance_data_description}, #endif { XD_END } }; @@ -1214,5 +1214,4 @@ void vars_of_objects (void) { - reinit_vars_of_objects (); }
--- a/src/print.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/print.c Thu Nov 04 23:08:28 2004 +0000 @@ -123,7 +123,7 @@ into an opaque object. */ struct debug_bindings { - int inhibit_non_essential_printing_operations; + int inhibit_non_essential_conversion_operations; int print_depth; int print_readably; int print_unbuffered; @@ -154,14 +154,18 @@ if (stream || output_is_std_handle) { - if (initialized && !inhibit_non_essential_printing_operations) + if (initialized && !inhibit_non_essential_conversion_operations) TO_EXTERNAL_FORMAT (DATA, (ptr, len), ALLOCA, (extptr, extlen), Qterminal); else { +#ifdef NON_ASCII_INTERNAL_FORMAT +#error Do something here +#else extptr = (Extbyte *) ptr; extlen = (Bytecount) len; +#endif } } @@ -291,7 +295,7 @@ Ibyte kludge[8192]; Bytecount kludgelen; - if (initialized && !inhibit_non_essential_printing_operations) + if (initialized && !inhibit_non_essential_conversion_operations) fmt = GETTEXT (fmt); vsprintf ((CIbyte *) kludge, fmt, args); kludgelen = qxestrlen (kludge); @@ -424,7 +428,7 @@ we inhibit GC. */ if (len < 65536) { - Ibyte *copied = alloca_array (Ibyte, len); + Ibyte *copied = alloca_ibytes (len); memcpy (copied, newnonreloc + offset, len); Lstream_write (XLSTREAM (function), copied, len); } @@ -1473,7 +1477,7 @@ static void printing_major_badness (Lisp_Object printcharfun, - Char_ASCII *badness_string, int type, void *val, + Ascbyte *badness_string, int type, void *val, enum printing_badness badness) { Ibyte buf[666]; @@ -1496,7 +1500,7 @@ /* Don't abort or signal if called from debug_print() or already crashing */ - if (!inhibit_non_essential_printing_operations) + if (!inhibit_non_essential_conversion_operations) { #ifdef ERROR_CHECK_TYPES abort (); @@ -1560,7 +1564,7 @@ /* Avoid calling internal_bind_int, which conses, when called from debug_prin1. In that case, we have bound print_depth to 0 anyway. */ - if (!inhibit_non_essential_printing_operations) + if (!inhibit_non_essential_conversion_operations) { specdepth = internal_bind_int (&print_depth, print_depth + 1); @@ -1653,7 +1657,7 @@ debug_print() or we're already crashing. In such cases, (further) crashing is counterproductive. */ - if (inhibit_non_essential_printing_operations && + if (inhibit_non_essential_conversion_operations && !debug_can_access_memory (lheader, sizeof (*lheader))) { write_fmt_string (printcharfun, "#<EMACS BUG: BAD MEMORY %p>", @@ -1697,7 +1701,7 @@ (e.g. under Unix we typically have to set a SIGSEGV handler and try to trigger a seg fault). */ - if (inhibit_non_essential_printing_operations) + if (inhibit_non_essential_conversion_operations) { if (!debug_can_access_memory (lheader, detagged_lisp_object_size (lheader))) @@ -1740,7 +1744,7 @@ } } - if (!inhibit_non_essential_printing_operations) + if (!inhibit_non_essential_conversion_operations) unbind_to (specdepth); UNGCPRO; } @@ -1914,7 +1918,7 @@ int extlen; const Extbyte *extptr; #if 0 /* We want to see the internal representation, don't we? */ - if (initialized && !inhibit_non_essential_printing_operations) + if (initialized && !inhibit_non_essential_conversion_operations) TO_EXTERNAL_FORMAT (DATA, (str, len), ALLOCA, (extptr, extlen), Qterminal); @@ -2062,8 +2066,8 @@ { struct debug_bindings *bindings = (struct debug_bindings *) XOPAQUE (debug_prin1_bindings)->data; - inhibit_non_essential_printing_operations = - bindings->inhibit_non_essential_printing_operations; + inhibit_non_essential_conversion_operations = + bindings->inhibit_non_essential_conversion_operations; print_depth = bindings->print_depth; print_readably = bindings->print_readably; print_unbuffered = bindings->print_unbuffered; @@ -2089,8 +2093,8 @@ struct debug_bindings *bindings = (struct debug_bindings *) XOPAQUE (debug_prin1_bindings)->data; - bindings->inhibit_non_essential_printing_operations = - inhibit_non_essential_printing_operations; + bindings->inhibit_non_essential_conversion_operations = + inhibit_non_essential_conversion_operations; bindings->print_depth = print_depth; bindings->print_readably = print_readably; bindings->print_unbuffered = print_unbuffered; @@ -2100,7 +2104,7 @@ bindings->Vinhibit_quit = Vinhibit_quit; specdepth = record_unwind_protect (debug_prin1_exit, Qnil); - inhibit_non_essential_printing_operations = 1; + inhibit_non_essential_conversion_operations = 1; print_depth = 0; print_readably = debug_print_readably != -1 ? debug_print_readably : 0; print_unbuffered++; @@ -2128,7 +2132,7 @@ void debug_p4 (Lisp_Object obj) { - inhibit_non_essential_printing_operations = 1; + inhibit_non_essential_conversion_operations = 1; if (STRINGP (obj)) debug_out ("\"%s\"", XSTRING_DATA (obj)); else if (CONSP (obj)) @@ -2195,7 +2199,7 @@ ((struct lcrecord_header *) header)->uid); } - inhibit_non_essential_printing_operations = 0; + inhibit_non_essential_conversion_operations = 0; } static void @@ -2227,9 +2231,9 @@ debug_p3 (Lisp_Object obj) { debug_p4 (obj); - inhibit_non_essential_printing_operations = 1; + inhibit_non_essential_conversion_operations = 1; debug_out ("\n"); - inhibit_non_essential_printing_operations = 0; + inhibit_non_essential_conversion_operations = 0; } void @@ -2266,7 +2270,7 @@ /* by doing this, we trick various things that are non-essential but might cause crashes into not getting executed. */ int specdepth = - internal_bind_int (&inhibit_non_essential_printing_operations, 1); + internal_bind_int (&inhibit_non_essential_conversion_operations, 1); internal_bind_int (&print_depth, 0); internal_bind_int (&print_readably, 0); @@ -2375,8 +2379,6 @@ void vars_of_print (void) { - reinit_vars_of_print (); - DEFVAR_LISP ("standard-output", &Vstandard_output /* Output stream `print' uses by default for outputting a character. This may be any function of one argument.
--- a/src/process-nt.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/process-nt.c Thu Nov 04 23:08:28 2004 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -25,10 +25,15 @@ /* Mule-ized as of 8-6-00 */ +/* Major comment about parsing and/or constructing a command line taken + from Windows, or suitable for giving to one of the library routines that + calls a subprocess is in win32-native.el */ + #include <config.h> #include "lisp.h" #include "console-msw.h" +#include "events.h" #include "hash.h" #include "lstream.h" #include "process.h" @@ -120,6 +125,13 @@ LPVOID address; } process_memory; +static void +free_process_memory (process_memory *pmc) +{ + ResumeThread (pmc->h_thread); + CloseHandle (pmc->h_thread); +} + /* * Allocate SIZE bytes in H_PROCESS address space. Fill in PMC used * further by other routines. Return nonzero if successful. @@ -176,17 +188,11 @@ return 1; failure: - ResumeThread (pmc->h_thread); + free_process_memory (pmc); pmc->address = 0; return 0; } -static void -free_process_memory (process_memory *pmc) -{ - ResumeThread (pmc->h_thread); -} - /* * Run ROUTINE in the context of process determined by H_PROCESS. The * routine is passed the address of DATA as parameter. The ROUTINE must @@ -256,7 +262,7 @@ failure: free_process_memory (&pm); - return (DWORD)-1; + return (DWORD) -1; } /*-----------------------------------------------------------------------*/ @@ -382,7 +388,7 @@ assert (d.adr_GenerateConsoleCtrlEvent); d.event = CTRL_C_EVENT; retval = run_in_other_process (h_process, - (LPTHREAD_START_ROUTINE) sigint_proc, + (LPTHREAD_START_ROUTINE) sigint_proc, &d, sizeof (d)); break; } @@ -392,7 +398,7 @@ if (close_process) CloseHandle (h_process); - return (int)retval > 0 ? 1 : 0; + return (int) retval > 0 ? 1 : 0; } /* @@ -654,10 +660,14 @@ { assert (!for_disksave); /* If it's still in the list of processes we are waiting on delete - it. */ + it. This can happen if we forcibly delete a process and are unable + to kill it. */ mswindows_unwait_process (p); if (NT_DATA (p)->h_process) - CloseHandle (NT_DATA (p)->h_process); + { + CloseHandle (NT_DATA (p)->h_process); + NT_DATA (p)->h_process = 0; + } } /* @@ -700,8 +710,8 @@ int mswindows_compare_env (const void *strp1, const void *strp2) { - const Ibyte *str1 = *(const Ibyte **)strp1, - *str2 = *(const Ibyte **)strp2; + const Itext *str1 = * (const Itext **) strp1, + *str2 = * (const Itext **) strp2; while (*str1 && *str2 && *str1 != '=' && *str2 != '=') { @@ -799,8 +809,8 @@ CreatePipe (&hmyslurp_err, &hprocerr, &sa, 0); else /* Duplicate the stdout handle for use as stderr */ - DuplicateHandle(GetCurrentProcess(), hprocout, GetCurrentProcess(), - &hprocerr, 0, TRUE, DUPLICATE_SAME_ACCESS); + DuplicateHandle (GetCurrentProcess(), hprocout, GetCurrentProcess(), + &hprocerr, 0, TRUE, DUPLICATE_SAME_ACCESS); /* Stupid Win32 allows to create a pipe with *both* ends either inheritable or not. We need process ends inheritable, and local @@ -837,6 +847,8 @@ args_or_ret = Fnreverse (args_or_ret); args_or_ret = Fcons (program, args_or_ret); + /* This Lisp function is in win32-native.el and has lots of comments + about what exactly is going on. */ args_or_ret = call1 (Qmswindows_construct_process_command_line, args_or_ret); @@ -938,7 +950,7 @@ while leaving the real app name as argv[0]. */ if (is_dos_app) { - cmdname = (Ibyte *) ALLOCA (PATH_MAX); + cmdname = alloca_ibytes (PATH_MAX); if (egetenv ("CMDPROXY")) qxestrcpy (cmdname, egetenv ("CMDPROXY")); else @@ -1134,6 +1146,20 @@ } } +static void +nt_deactivate_process (Lisp_Process *p, + USID *in_usid, + USID *err_usid) +{ + event_stream_delete_io_streams (p->pipe_instream, p->pipe_outstream, + p->pipe_errstream, in_usid, err_usid); + /* Go ahead and close the process handle now to prevent accumulation + of handles when lots of processes are run. (The handle gets closed + anyway upon GC, but that might be a ways away, esp. if + deleted-exited-processes is set to nil.) */ + nt_finalize_process_data (p, 0); +} + /* * Send a signal number SIGNO to PROCESS. * CURRENT_GROUP means send to the process group that currently owns @@ -1196,7 +1222,7 @@ static int get_internet_address (Lisp_Object host, struct sockaddr_in *address) { - Char_Binary buf[MAXGETHOSTSTRUCT]; + CBinbyte buf[MAXGETHOSTSTRUCT]; HWND hwnd; HANDLE hasync; int errcode = 0; @@ -1558,6 +1584,7 @@ PROCESS_HAS_METHOD (nt, create_process); PROCESS_HAS_METHOD (nt, update_status_if_terminated); PROCESS_HAS_METHOD (nt, send_process); + PROCESS_HAS_METHOD (nt, deactivate_process); PROCESS_HAS_METHOD (nt, kill_child_process); PROCESS_HAS_METHOD (nt, kill_process_by_pid); #ifdef HAVE_SOCKETS
--- a/src/process-unix.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/process-unix.c Thu Nov 04 23:08:28 2004 +0000 @@ -917,7 +917,7 @@ REGISTER Bytecount i; i = XSTRING_LENGTH (current_dir); - pwd = alloca_array (Ibyte, i + 6); + pwd = alloca_ibytes (i + 6); memcpy (pwd, "PWD=", 4); memcpy (pwd + 4, XSTRING_DATA (current_dir), i); i += 4; @@ -1620,10 +1620,10 @@ { SIGTYPE (*old_sigpipe) (int) = 0; - if (UNIX_DATA(p)->infd >= 0) - flush_pending_output (UNIX_DATA(p)->infd); - if (UNIX_DATA(p)->errfd >= 0) - flush_pending_output (UNIX_DATA(p)->errfd); + if (UNIX_DATA (p)->infd >= 0) + flush_pending_output (UNIX_DATA (p)->infd); + if (UNIX_DATA (p)->errfd >= 0) + flush_pending_output (UNIX_DATA (p)->errfd); /* closing the outstream could result in SIGPIPE, so ignore it. */ old_sigpipe = (SIGTYPE (*) (int)) EMACS_SIGNAL (SIGPIPE, SIG_IGN); @@ -1631,8 +1631,8 @@ p->pipe_errstream, in_usid, err_usid); EMACS_SIGNAL (SIGPIPE, old_sigpipe); - UNIX_DATA(p)->infd = -1; - UNIX_DATA(p)->errfd = -1; + UNIX_DATA (p)->infd = -1; + UNIX_DATA (p)->errfd = -1; } /* If the subtty field of the process data is not filled in, do so now. */
--- a/src/process.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/process.c Thu Nov 04 23:08:28 2004 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996, 2001, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -63,6 +63,10 @@ #include "systty.h" #include "syswait.h" +#ifdef WIN32_NATIVE +#include "syswindows.h" +#endif + Lisp_Object Qprocessp, Qprocess_live_p, Qprocess_readable_p; /* Process methods */ @@ -1788,7 +1792,7 @@ name = XSTRING_DATA (XSYMBOL (signal_)->name); #define handle_signal(sym) do { \ - if (!qxestrcmp_c ( name, #sym)) \ + if (!qxestrcmp_ascii ( name, #sym)) \ return sym; \ } while (0) @@ -2146,9 +2150,9 @@ &in_usid, &err_usid); if (in_usid != USID_DONTHASH) - remhash ((const void*)in_usid, usid_to_process); + remhash ((const void *) in_usid, usid_to_process); if (err_usid != USID_DONTHASH) - remhash ((const void*)err_usid, usid_to_process); + remhash ((const void *) err_usid, usid_to_process); p->pipe_instream = Qnil; p->pipe_outstream = Qnil; @@ -2435,11 +2439,19 @@ { /* jwz: always initialize Vprocess_environment, so that egetenv() works in temacs. */ - char **envp; + Extbyte **envp; Vprocess_environment = Qnil; +#ifdef WIN32_NATIVE + _wgetenv (L""); /* force initialization of _wenviron */ + for (envp = (Extbyte **) _wenviron; envp && *envp; envp++) + Vprocess_environment = + Fcons (build_ext_string (*envp, Qmswindows_unicode), + Vprocess_environment); +#else for (envp = environ; envp && *envp; envp++) Vprocess_environment = Fcons (build_ext_string (*envp, Qnative), Vprocess_environment); +#endif /* This gets set back to 0 in disksave_object_finalization() */ env_initted = 1; } @@ -2475,7 +2487,7 @@ if (!egetenv ("SHELL")) { - Ibyte *faux_var = alloca_array (Ibyte, 7 + qxestrlen (shell)); + Ibyte *faux_var = alloca_ibytes (7 + qxestrlen (shell)); qxesprintf (faux_var, "SHELL=%s", shell); Vprocess_environment = Fcons (build_intstring (faux_var), Vprocess_environment);
--- a/src/profile.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/profile.c Thu Nov 04 23:08:28 2004 +0000 @@ -39,77 +39,13 @@ int mswindows_is_blocking; #endif -/* Written by Ben Wing. - - We implement our own profiling scheme so that we can determine - things like which Lisp functions are occupying the most time. Any - standard OS-provided profiling works on C functions, which is - not always that useful -- and inconvenient, since it requires compiling - with profile info and can't be retrieved dynamically, as XEmacs is - running. +/* Written by Ben Wing. */ - The basic idea is simple. We set a profiling timer using setitimer - (ITIMER_PROF), which generates a SIGPROF every so often. (This runs not - in real time but rather when the process is executing or the system is - running on behalf of the process -- at least, that is the case under - Unix. Under MS Windows and Cygwin, there is no setitimer(), so we - simulate it using multimedia timers, which run in real time. To make - the results a bit more realistic, we ignore ticks that go off while - blocking on an event wait. Note that Cygwin does provide a simulation - of setitimer(), but it's in real time anyway, since Windows doesn't - provide a way to have process-time timers, and furthermore, it's broken, - so we don't use it.) When the signal goes off, we see what we're in, and - add 1 to the count associated with that function. +/* - It would be nice to use the Lisp allocation mechanism etc. to keep track - of the profiling information (i.e. to use Lisp hash tables), but we - can't because that's not safe -- updating the timing information happens - inside of a signal handler, so we can't rely on not being in the middle - of Lisp allocation, garbage collection, malloc(), etc. Trying to make - it work would be much more work than it's worth. Instead we use a basic - (non-Lisp) hash table, which will not conflict with garbage collection - or anything else as long as it doesn't try to resize itself. Resizing - itself, however (which happens as a result of a puthash()), could be - deadly. To avoid this, we make sure, at points where it's safe - (e.g. profile_record_about_to_call() -- recording the entry into a - function call), that the table always has some breathing room in it so - that no resizes will occur until at least that many items are added. - This is safe because any new item to be added in the sigprof would - likely have the profile_record_about_to_call() called just before it, - and the breathing room is checked. +Documented in - In general: any entry that the sigprof handler puts into the table comes - from a backtrace frame (except "Processing Events at Top Level", and - there's only one of those). Either that backtrace frame was added when - profiling was on (in which case profile_record_about_to_call() was - called and the breathing space updated), or when it was off -- and in - this case, no such frames can have been added since the last time - `start-profile' was called, so when `start-profile' is called we make - sure there is sufficient breathing room to account for all entries - currently on the stack. - - Jan 1998: In addition to timing info, I have added code to remember call - counts of Lisp funcalls. The profile_increase_call_count() - function is called from Ffuncall(), and serves to add data to - Vcall_count_profile_table. This mechanism is much simpler and - independent of the SIGPROF-driven one. It uses the Lisp allocation - mechanism normally, since it is not called from a handler. It may - even be useful to provide a way to turn on only one profiling - mechanism, but I haven't done so yet. --hniksic - - Dec 2002: Total overhaul of the interface, making it sane and easier to - use. --ben - - Feb 2003: Lots of rewriting of the internal code. Add GC-consing-usage, - total GC usage, and total timing to the information tracked. Track - profiling overhead and allow the ability to have internal sections - (e.g. internal-external conversion, byte-char conversion) that are - treated like Lisp functions for the purpose of profiling. --ben - - BEWARE: If you are modifying this file, be *very* careful. Correctly - implementing the "total" values is very tricky due to the possibility of - recursion and of functions already on the stack when starting to - profile/still on the stack when stopping. + (Info-goto-node "(internals)Profiling") */ /* We use a plain table here because we're recording inside of a signal @@ -163,7 +99,7 @@ static const struct memory_description plain_hash_table_description_1[] = { { XD_ELEMCOUNT, offsetof (struct hash_table, size) }, - { XD_STRUCT_PTR, offsetof (struct hash_table, harray), XD_INDIRECT (0, 0), + { XD_BLOCK_PTR, offsetof (struct hash_table, harray), XD_INDIRECT (0, 0), &hentry_description }, { XD_END } }; @@ -741,7 +677,7 @@ #if 0 /* #### This is supposed to be for KKCC but KKCC doesn't use this stuff currently. */ - dump_add_root_struct_ptr (&big_profile_table, &plain_hash_table_description); + dump_add_root_block_ptr (&big_profile_table, &plain_hash_table_description); #endif /* 0 */ profiling_lock = 0;
--- a/src/rangetab.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/rangetab.c Thu Nov 04 23:08:28 2004 +0000 @@ -153,7 +153,7 @@ }; static const struct memory_description range_table_description[] = { - { XD_STRUCT_PTR, offsetof (Lisp_Range_Table, entries), 1, &rted_description }, + { XD_BLOCK_PTR, offsetof (Lisp_Range_Table, entries), 1, &rted_description }, { XD_END } }; @@ -494,15 +494,9 @@ rangetab_data_validate (Lisp_Object UNUSED (keyword), Lisp_Object value, Error_Behavior UNUSED (errb)) { - Lisp_Object rest; - - /* #### should deal with errb */ - EXTERNAL_LIST_LOOP (rest, value) + /* #### should deal with ERRB */ + EXTERNAL_PROPERTY_LIST_LOOP_3 (range, data, value) { - Lisp_Object range = XCAR (rest); - rest = XCDR (rest); - if (!CONSP (rest)) - sferror ("Invalid list format", value); if (!INTP (range) && !CHARP (range) && !(CONSP (range) && CONSP (XCDR (range)) && NILP (XCDR (XCDR (range)))
--- a/src/realpath.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/realpath.c Thu Nov 04 23:08:28 2004 +0000 @@ -83,8 +83,8 @@ /* The file may exist, but isn't a symlink. Try to find the right name. */ - tmp = (Ibyte *) ALLOCA (cygwin_posix_to_win32_path_list_buf_size - ((char *) name)); + tmp = + alloca_ibytes (cygwin_posix_to_win32_path_list_buf_size ((char *) name)); cygwin_posix_to_win32_path_list ((char *) name, (char *) tmp); name = tmp; # endif
--- a/src/redisplay-gtk.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/redisplay-gtk.c Thu Nov 04 23:08:28 2004 +0000 @@ -239,6 +239,7 @@ gtk_text_width (struct frame *UNUSED (f), struct face_cachel *cachel, CONST Ichar *str, Charcount len) { + /* !!#### */ int width_so_far = 0; unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len); struct textual_run *runs = alloca_array (struct textual_run, len); @@ -659,6 +660,7 @@ int width, face_index findex, int cursor, int cursor_start, int cursor_width, int cursor_height) { + /* !!#### Needs review */ /* General variables */ struct frame *f = XFRAME (w->frame); struct device *d = XDEVICE (f->device);
--- a/src/redisplay-msw.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/redisplay-msw.c Thu Nov 04 23:08:28 2004 +0000 @@ -148,7 +148,7 @@ Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset); SIZE size; -#if 0 /* @@#### not the way of ikeyama's ws */ +#if 0 /* #### not the way of ikeyama's ws */ if (!fi->proportional_p || !hdc) { if (XCHARSET_DIMENSION (run->charset) == 2) @@ -166,7 +166,7 @@ cachel->underline, cachel->strikethru); GetTextExtentPoint32W (hdc, run->ptr, run->nwchars, &size); return size.cx; -#if 0 /* @@#### not the way of ikeyama's ws */ +#if 0 /* #### not the way of ikeyama's ws */ } #endif }
--- a/src/redisplay-tty.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/redisplay-tty.c Thu Nov 04 23:08:28 2004 +0000 @@ -1057,6 +1057,7 @@ int init_tty_for_redisplay (struct device *d, char *terminal_type) { + /* !!#### Mule-ize this */ int status; char entry_buffer[2044]; /* char temp_buffer[2044]; */
--- a/src/redisplay-x.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/redisplay-x.c Thu Nov 04 23:08:28 2004 +0000 @@ -244,6 +244,7 @@ x_text_width (struct frame *UNUSED (f), struct face_cachel *cachel, const Ichar *str, Charcount len) { + /* !!#### Needs review */ int width_so_far = 0; unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len); struct textual_run *runs = alloca_array (struct textual_run, len);
--- a/src/redisplay.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/redisplay.c Thu Nov 04 23:08:28 2004 +0000 @@ -522,7 +522,7 @@ }; static const struct memory_description rune_object_description_1[] = { - { XD_STRUCT_ARRAY, RUNE_DGLYPH, 1, &rune_dglyph_description }, + { XD_BLOCK_ARRAY, RUNE_DGLYPH, 1, &rune_dglyph_description }, { XD_END } }; @@ -553,7 +553,7 @@ }; static const struct memory_description display_block_description_1[] = { - { XD_STRUCT_PTR, offsetof (display_block, runes), + { XD_BLOCK_PTR, offsetof (display_block, runes), 1, &rune_dynarr_description }, { XD_END } }; @@ -595,11 +595,11 @@ }; static const struct memory_description display_line_description_1[] = { - { XD_STRUCT_PTR, offsetof (display_line, display_blocks), + { XD_BLOCK_PTR, offsetof (display_line, display_blocks), 1, &display_block_dynarr_description }, - { XD_STRUCT_PTR, offsetof (display_line, left_glyphs), + { XD_BLOCK_PTR, offsetof (display_line, left_glyphs), 1, &glyph_block_dynarr_description }, - { XD_STRUCT_PTR, offsetof (display_line, right_glyphs), + { XD_BLOCK_PTR, offsetof (display_line, right_glyphs), 1, &glyph_block_dynarr_description }, { XD_END } }; @@ -1569,7 +1569,7 @@ Lisp_Object format = XCAR (XCDR (entry)); Bytebpos len = XSTRING_LENGTH (format); Ibyte *src = XSTRING_DATA (format), *end = src + len; - Ibyte *result = alloca_array (Ibyte, len); + Ibyte *result = alloca_ibytes (len); Ibyte *dst = result; while (src < end) @@ -2144,42 +2144,11 @@ #### This variable should probably have some rethought done to it. - #### It would also be really nice if you could specify that - the characters come out in hex instead of in octal. Mule - does that by adding a ctl-hexa variable similar to ctl-arrow, - but that's bogus -- we need a more general solution. I - think you need to extend the concept of display tables - into a more general conversion mechanism. Ideally you - could specify a Lisp function that converts characters, - but this violates the Second Golden Rule and besides would - make things way way way way slow. - - So instead, we extend the display-table concept, which was - historically limited to 256-byte vectors, to one of the - following: - - a) A 256-entry vector, for backward compatibility; - b) char-table, mapping characters to values; - c) range-table, mapping ranges of characters to values; - d) a list of the above. - - The (d) option allows you to specify multiple display tables - instead of just one. Each display table can specify conversions - for some characters and leave others unchanged. The way the - character gets displayed is determined by the first display table - with a binding for that character. This way, you could call a - function `enable-hex-display' that adds a hex display-table to - the list of display tables for the current buffer. - - #### ...not yet implemented... Also, we extend the concept of - "mapping" to include a printf-like spec. Thus you can make all - extended characters show up as hex with a display table like - this: - - #s(range-table data ((256 524288) (format "%x"))) - - Since more than one display table is possible, you have - great flexibility in mapping ranges of characters. */ + See also + + (Info-goto-node "(internals)Future Work -- Display Tables") + + */ Ichar printable_min = (CHAR_OR_CHAR_INTP (b->ctl_arrow) ? XCHAR_OR_CHAR_INT (b->ctl_arrow) : ((EQ (b->ctl_arrow, Qt) || EQ (b->ctl_arrow, Qnil)) @@ -7734,63 +7703,13 @@ } -/***************************************************************************** - Line Start Cache Description and Rationale - - The traditional scrolling code in Emacs breaks in a variable height world. - It depends on the key assumption that the number of lines that can be - displayed at any given time is fixed. This led to a complete separation - of the scrolling code from the redisplay code. In order to fully support - variable height lines, the scrolling code must actually be tightly - integrated with redisplay. Only redisplay can determine how many lines - will be displayed on a screen for any given starting point. - - What is ideally wanted is a complete list of the starting buffer position - for every possible display line of a buffer along with the height of that - display line. Maintaining such a full list would be very expensive. We - settle for having it include information for all areas which we happen to - generate anyhow (i.e. the region currently being displayed) and for those - areas we need to work with. - - In order to ensure that the cache accurately represents what redisplay - would actually show, it is necessary to invalidate it in many situations. - If the buffer changes, the starting positions may no longer be correct. - If a face or an extent has changed then the line heights may have altered. - These events happen frequently enough that the cache can end up being - constantly disabled. With this potentially constant invalidation when is - the cache ever useful? - - Even if the cache is invalidated before every single usage, it is - necessary. Scrolling often requires knowledge about display lines which - are actually above or below the visible region. The cache provides a - convenient light-weight method of storing this information for multiple - display regions. This knowledge is necessary for the scrolling code to - always obey the First Golden Rule of Redisplay. - - If the cache already contains all of the information that the scrolling - routines happen to need so that it doesn't have to go generate it, then we - are able to obey the Third Golden Rule of Redisplay. The first thing we - do to help out the cache is to always add the displayed region. This - region had to be generated anyway, so the cache ends up getting the - information basically for free. In those cases where a user is simply - scrolling around viewing a buffer there is a high probability that this is - sufficient to always provide the needed information. The second thing we - can do is be smart about invalidating the cache. - - TODO -- Be smart about invalidating the cache. Potential places: - - + Insertions at end-of-line which don't cause line-wraps do not alter the - starting positions of any display lines. These types of buffer - modifications should not invalidate the cache. This is actually a large - optimization for redisplay speed as well. - - + Buffer modifications frequently only affect the display of lines at and - below where they occur. In these situations we should only invalidate - the part of the cache starting at where the modification occurs. - - In case you're wondering, the Second Golden Rule of Redisplay is not - applicable. - ****************************************************************************/ + +/* + +Info on line-start cache: + + (Info-goto-node "(internals)Line Start Cache") +*/ /* This will get used quite a bit so we don't want to be constantly allocating and freeing it. */
--- a/src/redisplay.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/redisplay.h Thu Nov 04 23:08:28 2004 +0000 @@ -692,7 +692,7 @@ extern int display_arg; /* Type of display specified. Defined in emacs.c. */ -extern const Char_ASCII *display_use; +extern const Ascbyte *display_use; /* Nonzero means reading single-character input with prompt so put cursor on minibuffer after the prompt. */
--- a/src/regex.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/regex.c Thu Nov 04 23:08:28 2004 +0000 @@ -28,10 +28,6 @@ #include <config.h> #endif -#ifndef REGISTER /* Rigidly enforced as of 20.3 */ -#define REGISTER -#endif - #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif @@ -41,10 +37,6 @@ #undef MULE #endif -/* We need this for `regex.h', and perhaps for the Emacs include files. */ -#include <sys/types.h> -#include <stddef.h> /* needed for ptrdiff_t under Solaris */ - /* XEmacs addition */ #ifdef REL_ALLOC #define REGEX_REL_ALLOC /* may be undefined below */ @@ -83,6 +75,11 @@ #else /* not emacs */ +#include <stdlib.h> +#include <sys/types.h> +#include <stddef.h> /* needed for ptrdiff_t under Solaris */ +#include <string.h> + #include "compiler.h" /* Get compiler-specific definitions like UNUSED */ /* If we are not linking with Emacs proper, @@ -97,8 +94,6 @@ #endif #endif -#include <stdlib.h> - #define itext_ichar(str) ((Ichar) (str)[0]) #define itext_ichar_fmt(str, fmt, object) ((Ichar) (str)[0]) #define itext_ichar_ascii_fmt(str, fmt, object) ((Ichar) (str)[0]) @@ -118,8 +113,6 @@ #define itext_ichar_len(ptr) 1 #define itext_ichar_len_fmt(ptr, fmt) 1 -#include <string.h> - /* Define the syntax stuff for \<, \>, etc. */ /* This must be nonzero for the wordchar and notwordchar pattern @@ -345,6 +338,7 @@ #define REGEX_ALLOCATE ALLOCA + /* !!#### Needs review */ /* Assumes a `char *destination' variable. */ #define REGEX_REALLOCATE(source, osize, nsize) \ (destination = (char *) ALLOCA (nsize), \
--- a/src/s/cxux.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/s/cxux.h Thu Nov 04 23:08:28 2004 +0000 @@ -92,8 +92,6 @@ */ #undef const -#define HAVE_GETWD - /* * <pwd.h> already declares getpwuid, and with a uid_t argument in ANSI C * mode. Define this so xrdb.c will compile
--- a/src/s/mingw32.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/s/mingw32.h Thu Nov 04 23:08:28 2004 +0000 @@ -21,14 +21,7 @@ /* based on cygwin32.h by Andy Piper <andy@xemacs.org> */ -/* NOTE: MinGW is a way of using GCC to target the native Windows - environment. This works similarly to building with Cygwin, but the - resulting executable does not use the Cygwin DLL. Instead, MINGW - provides import libraries for the standard C library DLL's (specifically - CRTDLL -- #### how does this differ from MSVCRT and LIBC.LIB?). This - means that code for MinGW will be very similar to code written for - VC++. See comment in windowsnt.h for more information on how Cygwin - and native Windows relate. */ +/* See win32.c for info about the different Windows files in XEmacs. */ #include "win32-native.h"
--- a/src/s/usg5-4-2.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/s/usg5-4-2.h Thu Nov 04 23:08:28 2004 +0000 @@ -10,8 +10,5 @@ #define VFORK_RETURN_TYPE pid_t -/* XEmacs change (since getwd is auto-determined) */ -#undef HAVE_GETWD /* (appears to be buggy on SVR4.2) */ - /* XEmacs change: communicate to m/intel386.h */ #define USG5_4_2
--- a/src/s/win32-common.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/s/win32-common.h Thu Nov 04 23:08:28 2004 +0000 @@ -19,6 +19,8 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* See win32.c for info about the different Windows files in XEmacs. */ + /* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT since there is no load average available. */
--- a/src/s/win32-native.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/s/win32-native.h Thu Nov 04 23:08:28 2004 +0000 @@ -19,6 +19,8 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* See win32.c for info about the different Windows files in XEmacs. */ + #include "win32-common.h" /* Identify ourselves */
--- a/src/s/windowsnt.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/s/windowsnt.h Thu Nov 04 23:08:28 2004 +0000 @@ -21,87 +21,7 @@ /* Synched up with: FSF 19.31. */ -/* Capsule summary of different preprocessor flags: - -1. Keep in mind that there are two possible OS environments we are dealing - with -- Cygwin and Native Windows. MS Windows natively provides - file-system, process, and window-system services through the Win32 API, - implemented by various DLL's. (The most important and KERNEL32, USER32, - and GDI32. KERNEL32 implements the basic file-system and process - services. USER32 implements the fundamental window-system services - such as creating windows and handling messages. GDI32 implements - higher-level drawing capabilities -- fonts, colors, lines, etc.) The C - library is implemented on top of Win32 using either MSVCRT (dynamically - linked) or LIBC.LIB (statically linked). Cygwin provides a POSIX - emulation layer on top of MS Windows -- in particular, providing the - file-system, process, tty, and signal semantics that are part of a - modern, standard Unix operating system. Cygwin does this using its own - DLL, cygwin1.dll, which makes calls to the Win32 API services in - kernel32.dll. Cygwin also provides its own implementation of the C - library, called `newlib' (libcygwin.a; libc.a and libm.a are symlinked - to it), which is implemented on top of the Unix system calls provided - in cygwin1.dll. In addition, Cygwin provides static import libraries - that give you direct access to the Win32 API -- XEmacs uses this to - provide GUI support under Cygwin. The two environments also use - different compilers -- Native Windows uses Visual C++, and Cygwin uses - GCC. (MinGW, however, is a way of using GCC to target the Native - Windows environment. See comment in mingw32.h.) - -2. There are two windowing environments we can target XEmacs for when - running under MS Windows -- Windows native, and X. (It may seem strange - to write an X application under Windows, but there are in fact many X - servers out there running on Windows, and as far as I know there is no - real (or at least, that works well) networking Window-system extension - under MS Windows. Furthermore, if you're porting a Unix application to - Windows and use Cygwin to assist you, it might seem natural to use an - X server to avoid having to port all the code to Windows.) For XEmacs, - there are various reasons people could come up with for why we would - want to keep maintaining X Windows under MS Windows support. - -That gives us four possible build environments. I (Ben) build -regularly on fully-native-everything, Andy builds on Cygwin + MS -Windows + X Windows for windowing. - -The build flags used for these divisions are: - -CYGWIN -- for Cygwin-only stuff. -WIN32_NATIVE -- Win32 native OS-level stuff (files, process, etc.). Applies - whenever linking against the native C libraries -- i.e. - all compilations with VC++ and with MINGW, but never Cygwin. -HAVE_X_WINDOWS -- for X Windows (regardless of whether under MS Win) -HAVE_MS_WINDOWS -- MS Windows native windowing system (anything related to - the appearance of the graphical screen). May or may not - apply to any of VC++, MINGW, Cygwin. - -Finally, there's also the MINGW build environment, which uses GCC -\(similar to Cygwin), but native MS Windows libraries rather than a -POSIX emulation layer (the Cygwin approach). This environment defines -WIN32_NATIVE, but also defines MINGW, which is used mostly because -uses its own include files (related to Cygwin), which have a few -things messed up. - - -Formerly, we had a whole host of flags. Here's the conversion, for porting -code from GNU Emacs and such: - - -WINDOWSNT -> WIN32_NATIVE -WIN32 -> WIN32_NATIVE -_WIN32 -> WIN32_NATIVE -HAVE_WIN32 -> WIN32_NATIVE -DOS_NT -> WIN32_NATIVE -HAVE_NTGUI -> WIN32_NATIVE, unless it ends up already bracketed by this -HAVE_FACES -> always true -MSDOS -> determine whether this code is really specific to MS-DOS (and not - Windows -- e.g. DJGPP code); if so, delete the code; otherwise, - convert to WIN32_NATIVE (we do not support MS-DOS w/DOS Extender - under XEmacs) - -__CYGWIN__ -> CYGWIN -__CYGWIN32__ -> CYGWIN -__MINGW32__ -> MINGW - -*/ +/* See win32.c for info about the different Windows files in XEmacs. */ #include "win32-native.h"
--- a/src/scrollbar-x.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/scrollbar-x.c Thu Nov 04 23:08:28 2004 +0000 @@ -743,8 +743,6 @@ void vars_of_scrollbar_x (void) { - reinit_vars_of_scrollbar_x (); - #if defined (LWLIB_SCROLLBARS_LUCID) Fprovide (intern ("lucid-scrollbars")); #elif defined (LWLIB_SCROLLBARS_MOTIF)
--- a/src/search.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/search.c Thu Nov 04 23:08:28 2004 +0000 @@ -1341,7 +1341,7 @@ int charset_base = -1; int boyer_moore_ok = 1; Ibyte *pat = 0; - Ibyte *patbuf = alloca_array (Ibyte, len * MAX_ICHAR_LEN); + Ibyte *patbuf = alloca_ibytes (len * MAX_ICHAR_LEN); pat = patbuf; #ifdef MULE /* &&#### needs some 8-bit work here */ @@ -2058,7 +2058,7 @@ /* The following value is an upper bound on the amount of storage we need. In non-Mule, it is exact. */ Ibyte *storage = - (Ibyte *) ALLOCA (XSTRING_LENGTH (string) - punct_count + + alloca_ibytes (XSTRING_LENGTH (string) - punct_count + 5 * (word_count - 1) + 4); Ibyte *o = storage; @@ -3057,7 +3057,7 @@ CHECK_STRING (string); - temp = (Ibyte *) ALLOCA (XSTRING_LENGTH (string) * 2); + temp = alloca_ibytes (XSTRING_LENGTH (string) * 2); /* Now copy the data into the new string, inserting escapes. */ @@ -3152,8 +3152,6 @@ void vars_of_search (void) { - reinit_vars_of_search (); - DEFVAR_LISP ("forward-word-regexp", &Vforward_word_regexp /* *Regular expression to be used in `forward-word'. #### Not yet implemented.
--- a/src/select-common.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/select-common.h Thu Nov 04 23:08:28 2004 +0000 @@ -67,7 +67,7 @@ static Lisp_Object selection_data_to_lisp_data (struct device *d, - UChar_Binary *data, + Rawbyte *data, Bytecount size, XE_ATOM_TYPE type, int format) @@ -168,7 +168,7 @@ static void lisp_data_to_selection_data (struct device *d, Lisp_Object obj, - UChar_Binary **data_ret, + Rawbyte **data_ret, XE_ATOM_TYPE *type_ret, Bytecount *size_ret, int *format_ret) @@ -200,7 +200,7 @@ (NILP (type) ? Qctext : Qbinary)); *format_ret = 8; *size_ret = extvallen; - *data_ret = (UChar_Binary *) xmalloc (*size_ret); + *data_ret = xnew_rawbytes (*size_ret); memcpy (*data_ret, extval, *size_ret); #ifdef MULE if (NILP (type)) type = QCOMPOUND_TEXT; @@ -221,7 +221,7 @@ ALLOCA, (extval, extvallen), Qctext); *size_ret = extvallen; - *data_ret = (UChar_Binary *) xmalloc (*size_ret); + *data_ret = xnew_rawbytes (*size_ret); memcpy (*data_ret, extval, *size_ret); #ifdef MULE if (NILP (type)) type = QCOMPOUND_TEXT; @@ -233,7 +233,7 @@ { *format_ret = 32; *size_ret = 1; - *data_ret = (UChar_Binary *) xmalloc (sizeof (XE_ATOM_TYPE) + 1); + *data_ret = xnew_rawbytes (sizeof (XE_ATOM_TYPE) + 1); (*data_ret) [sizeof (XE_ATOM_TYPE)] = 0; (*(XE_ATOM_TYPE **) data_ret) [0] = XE_SYMBOL_TO_ATOM (d, obj, 0); if (NILP (type)) type = QATOM; @@ -244,7 +244,7 @@ { *format_ret = 16; *size_ret = 1; - *data_ret = (UChar_Binary *) xmalloc (sizeof (short) + 1); + *data_ret = xnew_rawbytes (sizeof (short) + 1); (*data_ret) [sizeof (short)] = 0; (*(short **) data_ret) [0] = (short) XINT (obj); if (NILP (type)) type = QINTEGER; @@ -253,7 +253,7 @@ { *format_ret = 32; *size_ret = 1; - *data_ret = (UChar_Binary *) xmalloc (sizeof (long) + 1); + *data_ret = xnew_rawbytes (sizeof (long) + 1); (*data_ret) [sizeof (long)] = 0; (*(unsigned long **) data_ret) [0] = lisp_to_word (obj); if (NILP (type)) type = QINTEGER; @@ -272,7 +272,7 @@ if (NILP (type)) type = QATOM; *size_ret = XVECTOR_LENGTH (obj); *format_ret = 32; - *data_ret = (UChar_Binary *) xmalloc ((*size_ret) * sizeof (XE_ATOM_TYPE)); + *data_ret = xnew_rawbytes ((*size_ret) * sizeof (XE_ATOM_TYPE)); for (i = 0; i < *size_ret; i++) if (SYMBOLP (XVECTOR_DATA (obj) [i])) (*(XE_ATOM_TYPE **) data_ret) [i] = @@ -288,8 +288,8 @@ if (NILP (type)) type = QATOM_PAIR; *size_ret = XVECTOR_LENGTH (obj); *format_ret = 32; - *data_ret = (UChar_Binary *) - xmalloc ((*size_ret) * sizeof (XE_ATOM_TYPE) * 2); + *data_ret = + xnew_rawbytes ((*size_ret) * sizeof (XE_ATOM_TYPE) * 2); for (i = 0; i < *size_ret; i++) if (VECTORP (XVECTOR_DATA (obj) [i])) { @@ -321,7 +321,7 @@ syntax_error ("all elements of the vector must be integers or conses of integers", obj); - *data_ret = (UChar_Binary *) xmalloc (*size_ret * (*format_ret/8)); + *data_ret = xnew_rawbytes (*size_ret * (*format_ret/8)); for (i = 0; i < *size_ret; i++) if (*format_ret == 32) (*((unsigned long **) data_ret)) [i] =
--- a/src/select-gtk.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/select-gtk.c Thu Nov 04 23:08:28 2004 +0000 @@ -192,7 +192,7 @@ count = specpdl_depth (); - cl = (struct _selection_closure *) xmalloc (sizeof (*cl)); + cl = xnew (struct _selection_closure); cl->data = selection_data; cl->successful = FALSE; @@ -200,7 +200,7 @@ make_opaque_ptr (cl)); { - UChar_Binary *data; + Rawbyte *data; Bytecount size; int format; GdkAtom type; @@ -213,7 +213,7 @@ successful_p = Qt; /* Tell x_selection_request_lisp_error() it's cool. */ cl->successful = TRUE; - xfree (data, UChar_Binary *); + xfree (data, Rawbyte *); } unbind_to (count);
--- a/src/select-x.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/select-x.c Thu Nov 04 23:08:28 2004 +0000 @@ -479,7 +479,7 @@ */ static void x_reply_selection_request (XSelectionRequestEvent *event, int format, - UChar_Binary *data, Bytecount size, Atom type) + Rawbyte *data, Bytecount size, Atom type) { /* This function can GC */ XSelectionEvent reply; @@ -531,7 +531,7 @@ PropertyDelete); XChangeProperty (display, window, reply.property, DEVICE_XATOM_INCR (d), - 32, PropModeReplace, (UChar_Binary *) + 32, PropModeReplace, (Rawbyte *) &bytes_remaining, 1); XSelectInput (display, window, PropertyChangeMask); /* Tell 'em the INCR data is there... */ @@ -642,7 +642,7 @@ make_opaque_ptr (event)); { - UChar_Binary *data; + Rawbyte *data; Bytecount size; int format; Atom type; @@ -653,7 +653,7 @@ successful_p = Qt; /* Tell x_selection_request_lisp_error() it's cool. */ event->type = 0; - xfree (data, UChar_Binary *); + xfree (data, Rawbyte *); } unbind_to (count); @@ -969,14 +969,14 @@ static void x_get_window_property (Display *display, Window window, Atom property, - UChar_Binary **data_ret, Bytecount *bytes_ret, + Rawbyte **data_ret, Bytecount *bytes_ret, Atom *actual_type_ret, int *actual_format_ret, unsigned long *actual_size_ret, int delete_p) { Bytecount total_size; unsigned long bytes_remaining; Bytecount offset = 0; - UChar_Binary *tmp_data = 0; + Rawbyte *tmp_data = 0; int result; Bytecount buffer_size = SELECTION_QUANTUM (display); if (buffer_size > MAX_SELECTION_QUANTUM) buffer_size = MAX_SELECTION_QUANTUM; @@ -1004,7 +1004,7 @@ } total_size = bytes_remaining + 1; - *data_ret = (UChar_Binary *) xmalloc (total_size); + *data_ret = xnew_rawbytes (total_size); /* Now read, until we've gotten it all. */ while (bytes_remaining) @@ -1041,7 +1041,7 @@ /* this one is for error messages only */ Lisp_Object UNUSED (target_type), Bytecount min_size_bytes, - UChar_Binary **data_ret, + Rawbyte **data_ret, Bytecount *size_bytes_ret, Atom *type_ret, int *format_ret, unsigned long *size_ret) @@ -1050,7 +1050,7 @@ Bytecount offset = 0; int prop_id; *size_bytes_ret = min_size_bytes; - *data_ret = (UChar_Binary *) xmalloc (*size_bytes_ret); + *data_ret = xnew_rawbytes (*size_bytes_ret); #if 0 stderr_out ("\nread INCR %d\n", min_size_bytes); #endif @@ -1066,7 +1066,7 @@ PropertyNewValue); while (1) { - UChar_Binary *tmp_data; + Rawbyte *tmp_data; Bytecount tmp_size_bytes; wait_for_property_change (prop_id); /* expect it again immediately, because x_get_window_property may @@ -1086,7 +1086,7 @@ #endif unexpect_property_change (prop_id); if (tmp_data) - xfree (tmp_data, UChar_Binary *); + xfree (tmp_data, Rawbyte *); break; } #if 0 @@ -1099,11 +1099,11 @@ *size_bytes_ret, offset + tmp_size_bytes); #endif *size_bytes_ret = offset + tmp_size_bytes; - *data_ret = (UChar_Binary *) xrealloc (*data_ret, *size_bytes_ret); + *data_ret = (Rawbyte *) xrealloc (*data_ret, *size_bytes_ret); } memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes); offset += tmp_size_bytes; - xfree (tmp_data, UChar_Binary *); + xfree (tmp_data, Rawbyte *); } } @@ -1120,7 +1120,7 @@ Atom actual_type; int actual_format; unsigned long actual_size; - UChar_Binary *data = NULL; + Rawbyte *data = NULL; Bytecount bytes = 0; Lisp_Object val; struct device *d = get_device_from_display (display); @@ -1152,7 +1152,7 @@ Bytecount min_size_bytes = /* careful here. */ (Bytecount) (* ((unsigned int *) data)); - xfree (data, UChar_Binary *); + xfree (data, Rawbyte *); receive_incremental_selection (display, window, property, target_type, min_size_bytes, &data, &bytes, &actual_type, &actual_format, @@ -1164,7 +1164,7 @@ val = selection_data_to_lisp_data (d, data, bytes, actual_type, actual_format); - xfree (data, UChar_Binary *); + xfree (data, Rawbyte *); return val; } @@ -1268,7 +1268,7 @@ Display *display = DEVICE_X_DISPLAY (d); Window window = RootWindow (display, 0); /* Cutbuffers are on frame 0 */ Atom cut_buffer_atom; - UChar_Binary *data; + Rawbyte *data; Bytecount bytes; Atom type; int format; @@ -1296,7 +1296,7 @@ memchr (data, 0x1b, bytes) ? Qctext : Qbinary) : Qnil); - xfree (data, UChar_Binary *); + xfree (data, Rawbyte *); return ret; } @@ -1467,8 +1467,6 @@ void vars_of_select_x (void) { - reinit_vars_of_select_x (); - #ifdef CUT_BUFFER_SUPPORT cut_buffers_initialized = 0; Fprovide (intern ("cut-buffer"));
--- a/src/sgiplay.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/sgiplay.c Thu Nov 04 23:08:28 2004 +0000 @@ -174,8 +174,8 @@ /* Forward declarations */ static Lisp_Object close_sound_file (Lisp_Object); -static AudioContext audio_initialize (UChar_Binary *, int, int); -static int play_internal (UChar_Binary *, int, AudioContext); +static AudioContext audio_initialize (Binbyte *, int, int); +static int play_internal (Binbyte *, int, AudioContext); static void drain_audio_port (AudioContext); static void write_mulaw_8_chunk (void *, void *, AudioContext); static void write_linear_chunk (void *, void *, AudioContext); @@ -205,7 +205,7 @@ { int count = specpdl_depth (); int input_fd; - UChar_Binary buffer[CHUNKSIZE]; + Binbyte buffer[CHUNKSIZE]; int bytes_read; AudioContext ac = (AudioContext) 0; @@ -256,7 +256,7 @@ } int -play_sound_data (UChar_Binary *data, int length, int volume) +play_sound_data (Binbyte *data, int length, int volume) { int count = specpdl_depth (); AudioContext ac; @@ -272,7 +272,7 @@ } static AudioContext -audio_initialize (UChar_Binary *data, int length, int volume) +audio_initialize (Binbyte *data, int length, int volume) { Lisp_Object audio_port_state[3]; static AudioContextRec desc; @@ -316,17 +316,17 @@ } static int -play_internal (UChar_Binary *data, int UNUSED (length), AudioContext ac) +play_internal (Binbyte *data, int UNUSED (length), AudioContext ac) { - UChar_Binary * limit; + Binbyte * limit; if (ac == (AudioContext) 0) return 0; - data = (UChar_Binary *) ac->ac_data; + data = (Binbyte *) ac->ac_data; limit = data + ac->ac_size; while (data < limit) { - UChar_Binary * chunklimit = data + CHUNKSIZE; + Binbyte * chunklimit = data + CHUNKSIZE; if (chunklimit > limit) chunklimit = limit; @@ -371,8 +371,8 @@ static void write_mulaw_8_chunk (void *buffer, void *chunklimit, AudioContext ac) { - UChar_Binary * data = (UChar_Binary *) buffer; - UChar_Binary * limit = (UChar_Binary *) chunklimit; + Binbyte * data = (Binbyte *) buffer; + Binbyte * limit = (Binbyte *) chunklimit; short * obuf, * bufp; long n_samples = limit - data; @@ -394,7 +394,7 @@ switch (ac->ac_format) { case AFlinear16: n_samples = (short *) limit - (short *) data; break; - case AFlinear8: n_samples = (Char_Binary *) limit - (Char_Binary *) data; break; + case AFlinear8: n_samples = (CBinbyte *) limit - (CBinbyte *) data; break; default: n_samples = (long *) limit - (long *) data; break; } ALwritesamps (ac->ac_port, data, (long) n_samples); @@ -607,7 +607,7 @@ int dataFormat; int samplingRate; int channelCount; - Char_Binary info[4]; + CBinbyte info[4]; } SNDSoundStruct; #define SOUND_TO_HOST_INT(x) ntohl(x) @@ -679,8 +679,8 @@ } desc->ac_output_rate = SOUND_TO_HOST_INT (hp->samplingRate); desc->ac_nchan = SOUND_TO_HOST_INT (hp->channelCount); - desc->ac_data = (Char_Binary *) header + SOUND_TO_HOST_INT (hp->dataLocation); - limit = (Char_Binary *) header + length - (Char_Binary *) desc->ac_data; + desc->ac_data = (CBinbyte *) header + SOUND_TO_HOST_INT (hp->dataLocation); + limit = (CBinbyte *) header + length - (CBinbyte *) desc->ac_data; desc->ac_size = SOUND_TO_HOST_INT (hp->dataSize); if (desc->ac_size > limit) desc->ac_size = limit; return 0;
--- a/src/signal.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/signal.c Thu Nov 04 23:08:28 2004 +0000 @@ -642,133 +642,12 @@ /* Control-G checking */ /**********************************************************************/ -/* Note: The code to handle QUIT is divided between lisp.h and signal.c. - There is also some special-case code in the async timer code in - event-stream.c to notice when the poll-for-quit (and poll-for-sigchld) - timers have gone off. */ - -/* OK, here's an overview of how this convoluted stuff works: - -[1] Scattered throughout the XEmacs core code are calls to the macro QUIT; - This macro checks to see whether a C-g has recently been pressed and - not yet handled, and if so, it handles the C-g by calling signal_quit(), - which invokes the standard Fsignal() code, with the error being Qquit. - Lisp code can establish handlers for this (using condition-case), but - normally there is no handler, and so execution is thrown back to the - innermost enclosing event loop. (One of the things that happens when - entering an event loop is that a condition-case is established that - catches *all* calls to `signal', including this one.) - -[2] How does the QUIT macro check to see whether C-g has been pressed; - obviously this needs to be extremely fast. Now for some history. - In early Lemacs as inherited from the FSF going back 15 years or - more, there was a great fondness for using SIGIO (which is sent - whenever there is I/O available on a given socket, tty, etc.). - In fact, in GNU Emacs, perhaps even today, all reading of events - from the X server occurs inside the SIGIO handler! This is crazy, - but not completely relevant. What is relevant is that similar - stuff happened inside the SIGIO handler for C-g: it searched - through all the pending (i.e. not yet delivered to XEmacs yet) - X events for one that matched C-g. When it saw a match, it set - Vquit_flag to Qt. On TTY's, C-g is actually mapped to be the - interrupt character (i.e. it generates SIGINT), and XEmacs's - handler for this signal sets Vquit_flag to Qt. Then, sometime - later after the signal handlers finished and a QUIT macro was - called, the macro noticed the setting of Vquit_flag and used - this as an indication to call signal_quit(). What signal_quit() - actually does is set Vquit_flag to Qnil (so that we won't get - repeated interruptions from a single C-g press) and then calls - the equivalent of (signal 'quit nil). - -[3] Another complication is introduced in that Vquit_flag is actually - exported to Lisp as `quit-flag'. This allows users some level of - control over whether and when C-g is processed as quit, esp. in - combination with `inhibit-quit'. This is another Lisp variable, - and if set to non-nil, it inhibits signal_quit() from getting - called, meaning that the C-g gets essentially ignored. But not - completely: Because the resetting of `quit-flag' happens only - in signal_quit(), which isn't getting called, the C-g press is - still noticed, and as soon as `inhibit-quit' is set back to nil, - a quit will be signalled at the next QUIT macro. Thus, what - `inhibit-quit' really does is defer quits until after the quit- - inhibitted period. - -[4] Another consideration, introduced by XEmacs, is critical quitting. - If you press Control-Shift-G instead of just C-g, `quit-flag' is - set to `critical' instead of to t. When QUIT processes this value, - it *ignores* the value of `inhibit-quit'. This allows you to quit - even out of a quit-inhibitted section of code! Furthermore, when - signal_quit() notices that it was invoked as a result of a critical - quit, it automatically invokes the debugger (which otherwise would - only happen when `debug-on-quit' is set to t). +/* -[5] Well, I explained above about how `quit-flag' gets set correctly, - but I began with a disclaimer stating that this was the old way - of doing things. What's done now? Well, first of all, the SIGIO - handler (which formerly checked all pending events to see if there's - a C-g) now does nothing but set a flag -- or actually two flags, - something_happened and quit_check_signal_happened. There are two - flags because the QUIT macro is now used for more than just handling - QUIT; it's also used for running asynchronous timeout handlers that - have recently expired, and perhaps other things. The idea here is - that the QUIT macros occur extremely often in the code, but only occur - at places that are relatively safe -- in particular, if an error occurs, - nothing will get completely trashed. - -[6] Now, let's look at QUIT again. - - UNFINISHED. Note, however, that as of the point when this comment - got committed to CVS (mid-2001), the interaction between reading - C-g as an event and processing it as QUIT was overhauled to (for - the first time) be understandable and actually work correctly. - Now, the way things work is that if C-g is pressed while XEmacs is - blocking at the top level, waiting for a user event, it will be - read as an event; otherwise, it will cause QUIT. (This includes - times when XEmacs is blocking, but not waiting for a user event, - e.g. accept-process-output and wait_delaying_user_events().) - Formerly, this was supposed to happen, but didn't always due to a - bizarre and broken scheme, documented in next_event_internal - like this: - - If we read a ^G, then set quit-flag but do not discard the ^G. - The callers of next_event_internal() will do one of two things: +Info on Control-G checking: - -- set Vquit_flag to Qnil. (next-event does this.) This will - cause the ^G to be treated as a normal keystroke. - -- not change Vquit_flag but attempt to enqueue the ^G, at - which point it will be discarded. The next time QUIT is - called, it will notice that Vquit_flag was set. - - This required weirdness in enqueue_command_event_1 like this: - - put the event on the typeahead queue, unless - the event is the quit char, in which case the `QUIT' - which will occur on the next trip through this loop is - all the processing we should do - leaving it on the queue - would cause the quit to be processed twice. - - And further weirdness elsewhere, none of which made any sense, - and didn't work, because (e.g.) it required that QUIT never - happen anywhere inside next_event_internal() or any callers when - C-g should be read as a user event, which was impossible to - implement in practice. - - Now what we do is fairly simple. Callers of next_event_internal() - that want C-g read as a user event call begin_dont_check_for_quit(). - next_event_internal(), when it gets a C-g, simply sets Vquit_flag - (just as when a C-g is detected during the operation of QUIT or - QUITP), and then tries to QUIT. This will fail if blocked by the - previous call, at which point next_event_internal() will return - the C-g as an event. To unblock things, first set Vquit_flag to - nil (it was set to t when the C-g was read, and if we don't reset - it, the next call to QUIT will quit), and then unbind_to() the - depth returned by begin_dont_check_for_quit(). It makes no - difference is QUIT is called a zillion times in next_event_internal() - or anywhere else, because it's blocked and will never signal. - - --ben - */ - + (Info-goto-node "(internals)Control-G (Quit) Checking") +*/ /* Defer all checking or processing of C-g. You can do this, for example, if you want to read C-g's as events. (In that case, you should set
--- a/src/sound.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/sound.c Thu Nov 04 23:08:28 2004 +0000 @@ -53,7 +53,7 @@ #ifdef HAVE_ESD_SOUND extern int esd_play_sound_file (Extbyte *file, int vol); -extern int esd_play_sound_data (UChar_Binary *data, size_t length, int vol); +extern int esd_play_sound_data (Binbyte *data, size_t length, int vol); # define DEVICE_CONNECTED_TO_ESD_P(x) 1 /* #### better check */ #endif @@ -68,13 +68,13 @@ #ifdef HAVE_NAS_SOUND extern int nas_play_sound_file (Extbyte *name, int volume); -extern int nas_play_sound_data (UChar_Binary *data, int length, int volume); +extern int nas_play_sound_data (Binbyte *data, int length, int volume); extern int nas_wait_for_sounds (void); extern Extbyte *nas_init_play (Display *); #endif DOESNT_RETURN -report_sound_error (const Char_ASCII *string, Lisp_Object data) +report_sound_error (const Ascbyte *string, Lisp_Object data) { report_error_with_errno (Qsound_error, string, data); } @@ -346,7 +346,7 @@ #ifdef HAVE_NAS_SOUND if (DEVICE_CONNECTED_TO_NAS_P (d) && STRINGP (sound)) { - UChar_Binary *soundext; + Binbyte *soundext; Bytecount soundextlen; TO_EXTERNAL_FORMAT (LISP_STRING, sound, @@ -360,7 +360,7 @@ #ifdef HAVE_ESD_SOUND if (DEVICE_CONNECTED_TO_ESD_P (d) && STRINGP (sound)) { - UChar_Binary *soundext; + Binbyte *soundext; Bytecount soundextlen; int succes; @@ -381,7 +381,7 @@ if ((NILP (Vnative_sound_only_on_console) || DEVICE_ON_CONSOLE_P (d)) && STRINGP (sound)) { - UChar_Binary *soundext; + Binbyte *soundext; Bytecount soundextlen; int succes;
--- a/src/sound.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/sound.h Thu Nov 04 23:08:28 2004 +0000 @@ -27,7 +27,7 @@ /* Defined in *play.c */ void play_sound_file (Extbyte *name, int volume); -int play_sound_data (UChar_Binary *data, int length, int volume); +int play_sound_data (Binbyte *data, int length, int volume); # define sound_perror(string) \ do { \
--- a/src/specifier.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/specifier.c Thu Nov 04 23:08:28 2004 +0000 @@ -65,7 +65,7 @@ static const struct memory_description ste_description_1[] = { { XD_LISP_OBJECT, offsetof (specifier_type_entry, symbol) }, - { XD_STRUCT_PTR, offsetof (specifier_type_entry, meths), 1, + { XD_BLOCK_PTR, offsetof (specifier_type_entry, meths), 1, &specifier_methods_description }, { XD_END } }; @@ -396,7 +396,7 @@ }; const struct memory_description specifier_description[] = { - { XD_STRUCT_PTR, offsetof (Lisp_Specifier, methods), 1, + { XD_BLOCK_PTR, offsetof (Lisp_Specifier, methods), 1, &specifier_methods_description }, { XD_LO_LINK, offsetof (Lisp_Specifier, next_specifier) }, { XD_LISP_OBJECT, offsetof (Lisp_Specifier, global_specs) }, @@ -404,11 +404,11 @@ { XD_LISP_OBJECT, offsetof (Lisp_Specifier, frame_specs) }, { XD_LISP_OBJECT, offsetof (Lisp_Specifier, window_specs) }, { XD_LISP_OBJECT, offsetof (Lisp_Specifier, buffer_specs) }, - { XD_STRUCT_PTR, offsetof (Lisp_Specifier, caching), 1, + { XD_BLOCK_PTR, offsetof (Lisp_Specifier, caching), 1, &specifier_caching_description }, { XD_LISP_OBJECT, offsetof (Lisp_Specifier, magic_parent) }, { XD_LISP_OBJECT, offsetof (Lisp_Specifier, fallback) }, - { XD_STRUCT_ARRAY, offsetof (Lisp_Specifier, data), 1, + { XD_BLOCK_ARRAY, offsetof (Lisp_Specifier, data), 1, specifier_extra_description_map }, { XD_END } }; @@ -3183,10 +3183,8 @@ ; else if (CONSP (instantiator)) { - Lisp_Object tail; - EXTERNAL_LIST_LOOP (tail, instantiator) + EXTERNAL_LIST_LOOP_2 (car, instantiator) { - Lisp_Object car = XCAR (tail); if (!VALID_SINGLE_DISPTABLE_INSTANTIATOR_P (car)) goto lose; } @@ -3295,7 +3293,7 @@ specifier_type_create (void) { the_specifier_type_entry_dynarr = Dynarr_new (specifier_type_entry); - dump_add_root_struct_ptr (&the_specifier_type_entry_dynarr, &sted_description); + dump_add_root_block_ptr (&the_specifier_type_entry_dynarr, &sted_description); Vspecifier_type_list = Qnil; staticpro (&Vspecifier_type_list);
--- a/src/specifier.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/specifier.h Thu Nov 04 23:08:28 2004 +0000 @@ -330,7 +330,7 @@ &specifier_empty_extra_description; \ defsymbol_nodump (&type##_specifier_methods->predicate_symbol, pred_sym); \ add_entry_to_specifier_type_list (Q##type, type##_specifier_methods); \ - dump_add_root_struct_ptr (&type##_specifier_methods, \ + dump_add_root_block_ptr (&type##_specifier_methods, \ &specifier_methods_description); \ } while (0)
--- a/src/sunplay.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/sunplay.c Thu Nov 04 23:08:28 2004 +0000 @@ -42,7 +42,7 @@ static Audio_hdr dev_hdr; static int -init_device (int volume, UChar_Binary *data, int fd, +init_device (int volume, Binbyte *data, int fd, unsigned int *header_length) { #ifdef SUNOS4_0_3 @@ -130,7 +130,7 @@ play_sound_file (Extbyte *sound_file, int volume) { int rrtn, wrtn; - UChar_Binary buf [255]; + Binbyte buf [255]; int file_fd; audio_fd = audio_open (); @@ -152,12 +152,12 @@ goto END_OF_PLAY; } - if (init_device (volume, (UChar_Binary *) 0, file_fd, (unsigned int *) 0)) + if (init_device (volume, (Binbyte *) 0, file_fd, (unsigned int *) 0)) goto END_OF_PLAY; while (1) { - rrtn = read (file_fd, (Char_Binary *) buf, sizeof (buf)); + rrtn = read (file_fd, (CBinbyte *) buf, sizeof (buf)); if (rrtn < 0) { sound_perror ("read"); @@ -168,7 +168,7 @@ while (1) { - wrtn = write (audio_fd, (Char_Binary *) buf, rrtn); + wrtn = write (audio_fd, (CBinbyte *) buf, rrtn); if (wrtn < 0) { sound_perror ("write"); @@ -206,7 +206,7 @@ int -play_sound_data (UChar_Binary *data, int length, int volume) +play_sound_data (Binbyte *data, int length, int volume) { int wrtn, start = 0; unsigned int ilen; @@ -217,7 +217,7 @@ if (length == 0) return 0; /* this is just to get a better error message */ - if (strncmp (".snd\0", (Char_Binary *) data, 4)) + if (strncmp (".snd\0", (CBinbyte *) data, 4)) { sound_warn ("Not valid audio data (bad magic number)"); goto END_OF_PLAY; @@ -246,7 +246,7 @@ while (1) { - wrtn = write (audio_fd, (Char_Binary *) (data+start), length-start); + wrtn = write (audio_fd, (CBinbyte *) (data+start), length-start); if (wrtn < 0) { sound_perror ("write");
--- a/src/symbols.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/symbols.c Thu Nov 04 23:08:28 2004 +0000 @@ -3492,7 +3492,7 @@ if (!UNBOUNDP (f) && (!CONSP (f) || !EQ (XCAR (f), Qautoload))) \ signal_ferror (Qdll_error, "Attempt to redefine %s", subr_name (subr)); \ \ - newsubr = (Lisp_Subr *) xmalloc (sizeof (Lisp_Subr)); \ + newsubr = xnew (Lisp_Subr); \ memcpy (newsubr, subr, sizeof (Lisp_Subr)); \ subr->doc = (const char *)newsubr; \ subr = newsubr; \
--- a/src/symsinit.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/symsinit.h Thu Nov 04 23:08:28 2004 +0000 @@ -26,13 +26,14 @@ /* Earliest environment initializations (dump-time and run-time). */ +void init_win32_very_very_early (void); + void init_data_very_early (void); void init_floatfns_very_early (void); void init_free_hook (void); void init_process_times_very_early (void); void init_ralloc (void); void init_signals_very_early (void); -void init_win32_very_early (void); void init_mswindows_dde_very_early (void); /* Early Lisp-engine initialization -- dump-time only for init, dump-time @@ -284,8 +285,7 @@ void init_provide_once (void); /* Initialize most variables (dump-time for vars_, dump-time and - post-pdump-load-time for reinit_vars). #### The reinit_() functions - should be called from emacs.c, not the corresponding vars_of_(). */ + post-pdump-load-time for reinit_vars). */ void vars_of_abbrev (void); void vars_of_alloc (void); @@ -429,7 +429,6 @@ void vars_of_undo (void); void reinit_vars_of_undo (void); void vars_of_unicode (void); -void reinit_vars_of_unicode (void); void vars_of_window (void); void reinit_vars_of_window (void); void vars_of_win32 (void); @@ -500,7 +499,6 @@ void init_lread (void); void init_macros (void); void init_mswindows_environment (void); -void init_mule_charset (void); void init_nt (void); void init_postgresql_from_environment (void); void init_redisplay (void);
--- a/src/sysdep.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/sysdep.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,7 +1,7 @@ /* Interfaces to system-dependent kernel and library entries. Copyright (C) 1985-1988, 1992-1995 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems. - Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003, 2004 Ben Wing. This file is part of XEmacs. @@ -616,7 +616,7 @@ dir = Funhandled_file_name_directory (dir); dir = expand_and_dir_to_file (dir, Qnil); - str = (Ibyte *) ALLOCA (XSTRING_LENGTH (dir) + 2); + str = alloca_ibytes (XSTRING_LENGTH (dir) + 2); len = XSTRING_LENGTH (dir); memcpy (str, XSTRING_DATA (dir), len); if (!IS_ANY_SEP (str[len - 1])) @@ -2299,6 +2299,7 @@ Vsystem_name = build_string (uts.nodename); #else /* HAVE_GETHOSTNAME */ int hostname_size = 256; + /* !!#### Needs review */ char *hostname = (char *) ALLOCA (hostname_size); /* Try to get the host name; if the buffer is too short, try @@ -2315,6 +2316,7 @@ break; hostname_size <<= 1; + /* !!#### Needs review */ hostname = (char *) ALLOCA (hostname_size); } # if defined( HAVE_SOCKETS) @@ -2356,6 +2358,7 @@ if (*alias) fqdn = *alias; } + /* !!#### Needs review */ hostname = (char *) ALLOCA (strlen (fqdn) + 1); strcpy (hostname, fqdn); } @@ -2373,6 +2376,7 @@ hints.ai_protocol = 0; if (!getaddrinfo (hostname, NULL, &hints, &res)) { + /* !!#### Needs review */ hostname = (char *) ALLOCA (strlen (res->ai_canonname) + 1); strcpy (hostname, res->ai_canonname); @@ -2578,7 +2582,8 @@ #endif /* WIN32_NATIVE */ -/* Just one call with normal open() semantics. */ +/* Just call open() with normal open() semantics, with some fixups for + problems under Windows. */ static int underlying_open (const Extbyte *path, int oflag, int mode) @@ -2599,18 +2604,9 @@ #endif /* WIN32_NATIVE */ } -/* Like qxe_open() below but operates on externally-encoded filenames. */ - -int XCDECL -retry_open (const Extbyte *path, int oflag, ...) +static int +retry_open_1 (const Extbyte *path, int oflag, int mode) { - int mode; - va_list ap; - - va_start (ap, oflag); - mode = va_arg (ap, int); - va_end (ap); - #ifdef INTERRUPTIBLE_OPEN { int rtnval; @@ -2624,6 +2620,44 @@ #endif } +/* A version of open() that retries when interrupted. Operates on + externally-encoded filenames. */ + +int XCDECL +retry_open (const Extbyte *path, int oflag, ...) +{ + int mode; + va_list ap; + + va_start (ap, oflag); + mode = va_arg (ap, int); + va_end (ap); + + return retry_open_1 (path, oflag, mode); +} + +#if defined (WIN32_NATIVE) && defined (WEXTTEXT_IS_WIDE) + +/* Like retry_open() but operate on Wexttext filenames. */ + +int XCDECL +wext_retry_open (const Wexttext *path, int oflag, ...) +{ + int mode; + va_list ap; + + va_start (ap, oflag); + mode = va_arg (ap, int); + va_end (ap); + + if (!XEUNICODE_P) + return retry_open_1 (WEXTTEXT_TO_MULTIBYTE (path), oflag, mode); + else + return retry_open_1 ((Extbyte *) path, oflag, mode); +} + +#endif + /* The basic external entry point to open(). Handles conversion to external encoding, interruptions, etc. */ @@ -2784,12 +2818,12 @@ #### Should conceivably encapsulate getchar() etc. What a pain! */ FILE * -retry_fopen (const Extbyte *path, const Char_ASCII *mode) +retry_fopen (const Extbyte *path, const Ascbyte *mode) { #ifdef WIN32_NATIVE int fd; int oflag; - const Char_ASCII *mode_save = mode; + const Ascbyte *mode_save = mode; /* Force all file handles to be non-inheritable. This is necessary to ensure child processes don't unwittingly inherit handles that might @@ -2839,7 +2873,7 @@ } FILE * -qxe_fopen (const Ibyte *path, const Char_ASCII *mode) +qxe_fopen (const Ibyte *path, const Ascbyte *mode) { Extbyte *pathout; PATHNAME_CONVERT_OUT (path, pathout); @@ -3417,7 +3451,7 @@ #ifndef HAVE_WCHAR_H size_t -wcslen(const wchar_t *s) +wcslen (const wchar_t *s) { const wchar_t *p = s;
--- a/src/sysfile.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/sysfile.h Thu Nov 04 23:08:28 2004 +0000 @@ -341,8 +341,8 @@ size_t retry_fread (void *, size_t, size_t, FILE *); size_t retry_fwrite (const void *, size_t, size_t, FILE *); -FILE *retry_fopen (const Extbyte *path, const Char_ASCII *mode); -FILE *qxe_fopen (const Ibyte *path, const Char_ASCII *mode); +FILE *retry_fopen (const Extbyte *path, const Ascbyte *mode); +FILE *qxe_fopen (const Ibyte *path, const Ascbyte *mode); int retry_fclose (FILE *); /* encapsulations: file-information calls */
--- a/src/syswindows.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/syswindows.h Thu Nov 04 23:08:28 2004 +0000 @@ -1,5 +1,5 @@ /* Copyright (C) 2000 Free Software Foundation, Inc. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -39,24 +39,7 @@ #ifndef INCLUDED_syswindows_h_ #define INCLUDED_syswindows_h_ -/* There are two different general Windows-related include files in src. - - Uses are approximately: - - syswindows.h: Wrapper around <windows.h>, including missing defines as - necessary. Includes stuff needed on both Cygwin and native Windows, - regardless of window system chosen. Includes definitions needed for - Unicode conversion/encapsulation, and other Mule-related stuff, plus - various other prototypes and Windows-specific, but not GUI-specific, - stuff. - - console-msw.h: Used on both Cygwin and native Windows, but only when - native window system (as opposed to X) chosen. Includes syswindows.h. -*/ - -/* See s/windowsnt.h for a description of what exactly the various - constants such as WIN32_NATIVE, HAVE_MS_WINDOWS, CYGWIN, and MINGW - mean, and how they relate to each other. */ +/* See win32.c for info about the different Windows files in XEmacs. */ /* ------------------------- Basic includes ------------------------- */ @@ -519,7 +502,7 @@ /* ------------------------- Unicode encapsulation ------------------------- */ -/* See intl-encap-win32.c for more information about Unicode-encapsulation */ +/* See intl-win32.c for more information about Unicode-encapsulation */ #define ERROR_WHEN_NONINTERCEPTED_FUNS_USED @@ -762,7 +745,7 @@ /* Set early in command-line processing, when -nuni or --no-unicode-lib-calls is seen. */ extern int no_mswin_unicode_lib_calls; -/* Set early, in init_win32_very_early(). */ +/* Set early, in init_win32_very_very_early(). */ extern int mswindows_windows9x_p; #define XEUNICODE_P (!mswindows_windows9x_p && !no_mswin_unicode_lib_calls) @@ -832,11 +815,58 @@ Extbyte *convert_multibyte_to_unicode_malloc (const Extbyte *src, Bytecount n, int cp, Bytecount *size_out); +Extbyte *convert_unicode_to_multibyte_malloc (const Extbyte *src, + Bytecount n, + int cp, Bytecount *size_out); Ibyte *convert_multibyte_to_internal_malloc (const Extbyte *src, Bytecount n, int cp, Bytecount *size_out); void convert_multibyte_to_unicode_dynarr (const Extbyte *src, Bytecount n, int cp, unsigned_char_dynarr *dst); +void convert_unicode_to_multibyte_dynarr (const Extbyte *src, Bytecount n, + int cp, unsigned_char_dynarr *dst); + +Bytecount unicode_multibyte_convert_size (const char *srctext, const void *src, + Bytecount src_size, int to_unicode, + int cp); +void *unicode_multibyte_convert_copy_data (const char *srctext, + void *alloca_data); + +/* NOTE: If you make two invocations of the following functions in the same + subexpression and use the exact same expression for the source in both + cases, you will lose. In this unlikely case, you may get an abort, and + need to rewrite the code. + + We need to use ALLOCA_FUNCALL_OK here, see NEW_DFC in text.h. +*/ + +#ifdef WEXTTEXT_IS_WIDE +#define MULTIBYTE_TO_WEXTTEXT(str) \ + ((Wexttext *) \ + unicode_multibyte_convert_copy_data \ + (#str, ALLOCA_FUNCALL_OK (unicode_multibyte_convert_size \ + (#str, str, strlen (str) + 1, 1, CP_ACP)))) + +#define WEXTTEXT_TO_MULTIBYTE(str) \ + ((Extbyte *) \ + unicode_multibyte_convert_copy_data \ + (#str, ALLOCA_FUNCALL_OK (unicode_multibyte_convert_size \ + (#str, str, \ + (wcslen (str) + 1) * sizeof (WCHAR), 0, \ + CP_ACP)))) +#else +#define MULTIBYTE_TO_WEXTTEXT(str) ((Wexttext *) (str)) +#define WEXTTEXT_TO_MULTIBYTE(str) ((Extbyte *) (str)) +#endif + +/* #### mbstowcs() uses MB_ERR_INVALID_CHARS in addition to MB_PRECOMPOSED. + Should we do this? But then we have to handle errors. + #### Do we already check for invalid sequences in the coding system? */ +#define MBTOWC_OPTIONS MB_PRECOMPOSED /* | MB_ERR_INVALID_CHARS */ + /* The following options are what wcstombs() uses in the CRT. It uses + NULL in place of "~". */ +#define WCTOMB_OPTIONS WC_COMPOSITECHECK | WC_SEPCHARS +#define WCTOMB_INVALID_STRING "~" /* ------------------------- Other Mule stuff ------------------------- */ @@ -895,7 +925,7 @@ { \ int ltwff2 = \ cygwin_posix_to_win32_path_list_buf_size ((char *) ltwffp); \ - pathout = (Ibyte *) ALLOCA (ltwff2); \ + pathout = alloca_ibytes (ltwff2); \ cygwin_posix_to_win32_path_list ((char *) ltwffp, (char *) pathout); \ } \ } while (0) @@ -912,7 +942,7 @@ Ibyte *wtlff1 = (path); \ int wtlff2 = \ cygwin_win32_to_posix_path_list_buf_size ((char *) wtlff1); \ - Ibyte *wtlff3 = (Ibyte *) ALLOCA (wtlff2); \ + Ibyte *wtlff3 = alloca_ibytes (wtlff2); \ cygwin_win32_to_posix_path_list ((char *) wtlff1, (char *) wtlff3); \ (pathout) = wtlff3; \ } while (0) @@ -940,7 +970,7 @@ /* If URL style file, the innards may have Cygwin mount points and \ the like. so separate out the innards, process them, and put back \ together. */ \ - if (qxestrncasecmp_c (lffmutt_pathint, "file://", 7) == 0) \ + if (qxestrncasecmp_ascii (lffmutt_pathint, "file://", 7) == 0) \ { \ Ibyte *lffmutt_path1, *lffmutt_path2; \ LOCAL_TO_WIN32_FILE_FORMAT (lffmutt_pathint + 7, lffmutt_path1); \
--- a/src/text.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/text.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,6 +1,6 @@ -/* Buffer manipulation primitives for XEmacs. +/* Text manipulation primitives for XEmacs. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003 Ben Wing. + Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2004 Ben Wing. Copyright (C) 1999 Martin Buchholz. This file is part of XEmacs. @@ -39,536 +39,138 @@ /* long comments */ /************************************************************************/ -/* - ========================================================================== - 1. Intro to Characters, Character Sets, and Encodings - ========================================================================== - - A character (which is, BTW, a surprisingly complex concept) is, in a - written representation of text, the most basic written unit that has a - meaning of its own. It's comparable to a phoneme when analyzing words - in spoken speech (for example, the sound of `t' in English, which in - fact has different pronunciations in different words -- aspirated in - `time', unaspirated in `stop', unreleased or even pronounced as a - glottal stop in `button', etc. -- but logically is a single concept). - Like a phoneme, a character is an abstract concept defined by its - *meaning*. The character `lowercase f', for example, can always be used - to represent the first letter in the word `fill', regardless of whether - it's drawn upright or italic, whether the `fi' combination is drawn as a - single ligature, whether there are serifs on the bottom of the vertical - stroke, etc. (These different appearances of a single character are - often called "graphs" or "glyphs".) Our concern when representing text - is on representing the abstract characters, and not on their exact - appearance. - - A character set (or "charset"), as we define it, is a set of characters, - each with an associated number (or set of numbers -- see below), called - a "code point". It's important to understand that a character is not - defined by any number attached to it, but by its meaning. For example, - ASCII and EBCDIC are two charsets containing exactly the same characters - (lowercase and uppercase letters, numbers 0 through 9, particular - punctuation marks) but with different numberings. The `comma' character - in ASCII and EBCDIC, for instance, is the same character despite having - a different numbering. Conversely, when comparing ASCII and JIS-Roman, - which look the same except that the latter has a yen sign substituted - for the backslash, we would say that the backslash and yen sign are - *not* the same characters, despite having the same number (95) and - despite the fact that all other characters are present in both charsets, - with the same numbering. ASCII and JIS-Roman, then, do *not* have - exactly the same characters in them (ASCII has a backslash character but - no yen-sign character, and vice-versa for JIS-Roman), unlike ASCII and - EBCDIC, even though the numberings in ASCII and JIS-Roman are closer. - - It's also important to distinguish between charsets and encodings. For - a simple charset like ASCII, there is only one encoding normally used -- - each character is represented by a single byte, with the same value as - its code point. For more complicated charsets, however, things are not - so obvious. Unicode version 2, for example, is a large charset with - thousands of characters, each indexed by a 16-bit number, often - represented in hex, e.g. 0x05D0 for the Hebrew letter "aleph". One - obvious encoding uses two bytes per character (actually two encodings, - depending on which of the two possible byte orderings is chosen). This - encoding is convenient for internal processing of Unicode text; however, - it's incompatible with ASCII, so a different encoding, e.g. UTF-8, is - usually used for external text, for example files or e-mail. UTF-8 - represents Unicode characters with one to three bytes (often extended to - six bytes to handle characters with up to 31-bit indices). Unicode - characters 00 to 7F (identical with ASCII) are directly represented with - one byte, and other characters with two or more bytes, each in the range - 80 to FF. - - In general, a single encoding may be able to represent more than one - charset. - - See also man/lispref/mule.texi. - - ========================================================================== - 2. Character Sets - ========================================================================== - - A particular character in a charset is indexed using one or - more "position codes", which are non-negative integers. - The number of position codes needed to identify a particular - character in a charset is called the "dimension" of the - charset. In XEmacs/Mule, all charsets have 1 or 2 dimensions, - and the size of all charsets (except for a few special cases) - is either 94, 96, 94 by 94, or 96 by 96. The range of - position codes used to index characters from any of these - types of character sets is as follows: - - Charset type Position code 1 Position code 2 - ------------------------------------------------------------ - 94 33 - 126 N/A - 96 32 - 127 N/A - 94x94 33 - 126 33 - 126 - 96x96 32 - 127 32 - 127 - - Note that in the above cases position codes do not start at - an expected value such as 0 or 1. The reason for this will - become clear later. - - For example, Latin-1 is a 96-character charset, and JISX0208 - (the Japanese national character set) is a 94x94-character - charset. - - [Note that, although the ranges above define the *valid* - position codes for a charset, some of the slots in a particular - charset may in fact be empty. This is the case for JISX0208, - for example, where (e.g.) all the slots whose first - position code is in the range 118 - 127 are empty.] - - There are three charsets that do not follow the above rules. - All of them have one dimension, and have ranges of position - codes as follows: - - Charset name Position code 1 - ------------------------------------ - ASCII 0 - 127 - Control-1 0 - 31 - Composite 0 - some large number - - (The upper bound of the position code for composite characters - has not yet been determined, but it will probably be at - least 16,383). - - ASCII is the union of two subsidiary character sets: - Printing-ASCII (the printing ASCII character set, - consisting of position codes 33 - 126, like for a standard - 94-character charset) and Control-ASCII (the non-printing - characters that would appear in a binary file with codes 0 - - 32 and 127). - - Control-1 contains the non-printing characters that would - appear in a binary file with codes 128 - 159. - - Composite contains characters that are generated by - overstriking one or more characters from other charsets. - - Note that some characters in ASCII, and all characters - in Control-1, are "control" (non-printing) characters. - These have no printed representation but instead control - some other function of the printing (e.g. TAB or 8 moves - the current character position to the next tab stop). - All other characters in all charsets are "graphic" - (printing) characters. - - When a binary file is read in, the bytes in the file are - assigned to character sets as follows: - - Bytes Character set Range - -------------------------------------------------- - 0 - 127 ASCII 0 - 127 - 128 - 159 Control-1 0 - 31 - 160 - 255 Latin-1 32 - 127 - - This is a bit ad-hoc but gets the job done. - - ========================================================================== - 3. Encodings - ========================================================================== - - An "encoding" is a way of numerically representing - characters from one or more character sets. If an encoding - only encompasses one character set, then the position codes - for the characters in that character set could be used - directly. This is not possible, however, if more than one - character set is to be used in the encoding. - - For example, the conversion detailed above between bytes in - a binary file and characters is effectively an encoding - that encompasses the three character sets ASCII, Control-1, - and Latin-1 in a stream of 8-bit bytes. - - Thus, an encoding can be viewed as a way of encoding - characters from a specified group of character sets using a - stream of bytes, each of which contains a fixed number of - bits (but not necessarily 8, as in the common usage of - "byte"). - - Here are descriptions of a couple of common - encodings: - - - A. Japanese EUC (Extended Unix Code) - - This encompasses the character sets: - - Printing-ASCII, - - Katakana-JISX0201 (half-width katakana, the right half of JISX0201). - - Japanese-JISX0208 - - Japanese-JISX0212 - It uses 8-bit bytes. - - Note that Printing-ASCII and Katakana-JISX0201 are 94-character - charsets, while Japanese-JISX0208 is a 94x94-character charset. - - The encoding is as follows: - - Character set Representation (PC == position-code) - ------------- -------------- - Printing-ASCII PC1 - Japanese-JISX0208 PC1 + 0x80 | PC2 + 0x80 - Katakana-JISX0201 0x8E | PC1 + 0x80 - - - B. JIS7 - - This encompasses the character sets: - - Printing-ASCII - - Latin-JISX0201 (the left half of JISX0201; this character set is - very similar to Printing-ASCII and is a 94-character charset) - - Japanese-JISX0208 - - Katakana-JISX0201 - It uses 7-bit bytes. - - Unlike Japanese EUC, this is a "modal" encoding, which - means that there are multiple states that the encoding can - be in, which affect how the bytes are to be interpreted. - Special sequences of bytes (called "escape sequences") - are used to change states. - - The encoding is as follows: - - Character set Representation - ------------- -------------- - Printing-ASCII PC1 - Latin-JISX0201 PC1 - Katakana-JISX0201 PC1 - Japanese-JISX0208 PC1 | PC2 - - Escape sequence ASCII equivalent Meaning - --------------- ---------------- ------- - 0x1B 0x28 0x42 ESC ( B invoke Printing-ASCII - 0x1B 0x28 0x4A ESC ( J invoke Latin-JISX0201 - 0x1B 0x28 0x49 ESC ( I invoke Katakana-JISX0201 - 0x1B 0x24 0x42 ESC $ B invoke Japanese-JISX0208 - - Initially, Printing-ASCII is invoked. +/* NB: Everything below was written by Ben Wing except as otherwise noted. */ + +/************************************************************************/ +/* */ +/* */ +/* Part A: More carefully-written documentation */ +/* */ +/* */ +/************************************************************************/ + +/* Authorship: Ben Wing + ========================================================================== - 4. Internal Mule Encodings + 7. Handling non-default formats ========================================================================== - In XEmacs/Mule, each character set is assigned a unique number, - called a "leading byte". This is used in the encodings of a - character. Leading bytes are in the range 0x80 - 0xFF - (except for ASCII, which has a leading byte of 0), although - some leading bytes are reserved. - - Charsets whose leading byte is in the range 0x80 - 0x9F are - called "official" and are used for built-in charsets. - Other charsets are called "private" and have leading bytes - in the range 0xA0 - 0xFF; these are user-defined charsets. - - More specifically: - - Character set Leading byte - ------------- ------------ - ASCII 0 (0x7F in arrays indexed by leading byte) - Composite 0x8D - Dimension-1 Official 0x80 - 0x8C/0x8D - (0x8E is free) - Control 0x8F - Dimension-2 Official 0x90 - 0x99 - (0x9A - 0x9D are free) - Dimension-1 Private Marker 0x9E - Dimension-2 Private Marker 0x9F - Dimension-1 Private 0xA0 - 0xEF - Dimension-2 Private 0xF0 - 0xFF - - There are two internal encodings for characters in XEmacs/Mule. - One is called "string encoding" and is an 8-bit encoding that - is used for representing characters in a buffer or string. - It uses 1 to 4 bytes per character. The other is called - "character encoding" and is a 19-bit encoding that is used - for representing characters individually in a variable. - - (In the following descriptions, we'll ignore composite - characters for the moment. We also give a general (structural) - overview first, followed later by the exact details.) - - A. Internal String Encoding - - ASCII characters are encoded using their position code directly. - Other characters are encoded using their leading byte followed - by their position code(s) with the high bit set. Characters - in private character sets have their leading byte prefixed with - a "leading byte prefix", which is either 0x9E or 0x9F. (No - character sets are ever assigned these leading bytes.) Specifically: - - Character set Encoding (PC == position-code) - ------------- -------- (LB == leading-byte) - ASCII PC1 | - Control-1 LB | PC1 + 0xA0 - Dimension-1 official LB | PC1 + 0x80 - Dimension-1 private 0x9E | LB | PC1 + 0x80 - Dimension-2 official LB | PC1 | PC2 + 0x80 - Dimension-2 private 0x9F | LB | PC1 + 0x80 | PC2 + 0x80 - - The basic characteristic of this encoding is that the first byte - of all characters is in the range 0x00 - 0x9F, and the second and - following bytes of all characters is in the range 0xA0 - 0xFF. - This means that it is impossible to get out of sync, or more - specifically: - - 1. Given any byte position, the beginning of the character it is - within can be determined in constant time. - 2. Given any byte position at the beginning of a character, the - beginning of the next character can be determined in constant - time. - 3. Given any byte position at the beginning of a character, the - beginning of the previous character can be determined in constant - time. - 4. Textual searches can simply treat encoded strings as if they - were encoded in a one-byte-per-character fashion rather than - the actual multi-byte encoding. - - None of the standard non-modal encodings meet all of these - conditions. For example, EUC satisfies only (2) and (3), while - Shift-JIS and Big5 (not yet described) satisfy only (2). (All - non-modal encodings must satisfy (2), in order to be unambiguous.) - - B. Internal Character Encoding - - One 19-bit word represents a single character. The word is - separated into three fields: - - Bit number: 18 17 16 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 - <------------> <------------------> <------------------> - Field: 1 2 3 - - Note that fields 2 and 3 hold 7 bits each, while field 1 holds 5 bits. - - Character set Field 1 Field 2 Field 3 - ------------- ------- ------- ------- - ASCII 0 0 PC1 - range: (00 - 7F) - Control-1 0 1 PC1 - range: (00 - 1F) - Dimension-1 official 0 LB - 0x7F PC1 - range: (01 - 0D) (20 - 7F) - Dimension-1 private 0 LB - 0x80 PC1 - range: (20 - 6F) (20 - 7F) - Dimension-2 official LB - 0x8F PC1 PC2 - range: (01 - 0A) (20 - 7F) (20 - 7F) - Dimension-2 private LB - 0xE1 PC1 PC2 - range: (0F - 1E) (20 - 7F) (20 - 7F) - Composite 0x1F ? ? - - Note that character codes 0 - 255 are the same as the "binary encoding" - described above. - - Most of the code in XEmacs knows nothing of the representation of a - character other than that values 0 - 255 represent ASCII, Control 1, - and Latin 1. - - WARNING WARNING WARNING: The Boyer-Moore code in search.c, and the - code in search_buffer() that determines whether that code can be used, - knows that "field 3" in a character always corresponds to the last - byte in the textual representation of the character. (This is important - because the Boyer-Moore algorithm works by looking at the last byte - of the search string and &&#### finish this. + We support, at least to some extent, formats other than the default + variable-width format, for speed; all of these alternative formats are + fixed-width. Currently we only handle these non-default formats in + buffers, because access to their text is strictly controlled and thus + the details of the format mostly compartmentalized. The only really + tricky part is the search code -- the regex, Boyer-Moore, and + simple-search algorithms in search.c and regex.c. All other code that + knows directly about the buffer representation is the basic code to + modify or retrieve the buffer text. + + Supporting fixed-width formats in Lisp strings is harder, but possible + -- FSF currently does this, for example. In this case, however, + probably only 8-bit-fixed is reasonable for Lisp strings -- getting + non-ASCII-compatible fixed-width formats to work is much, much harder + because a lot of code assumes that strings are ASCII-compatible + (i.e. ASCII + other characters represented exclusively using high-bit + bytes) and a lot of code mixes Lisp strings and non-Lisp strings freely. + + The different possible fixed-width formats are 8-bit fixed, 16-bit + fixed, and 32-bit fixed. The latter can represent all possible + characters, but at a substantial memory penalty. The other two can + represent only a subset of the possible characters. How these subsets + are defined can be simple or very tricky. + + Currently we support only the default format and the 8-bit fixed format, + and in the latter, we only allow these to be the first 256 characters in + an Ichar (ASCII and Latin 1). + + One reasonable approach for 8-bit fixed is to allow the upper half to + represent any 1-byte charset, which is specified on a per-buffer basis. + This should work fairly well in practice since most documents are in + only one foreign language (possibly with some English mixed in). I + think FSF does something like this; or at least, they have something + called nonascii-translation-table and use it when converting from + 8-bit-fixed text ("unibyte text") to default text ("multibyte text"). + With 16-bit fixed, you could do something like assign chunks of the 64K + worth of characters to charsets as they're encountered in documents. + This should work well with most Asian documents. + + If/when we switch to using Unicode internally, we might have formats more + like this: + + -- UTF-8 or some extension as the default format. Perl uses an + extension that handles 64-bit chars and requires as much as 13 bytes per + char, vs. the standard of 31-bit chars and 6 bytes max. UTF-8 has the + same basic properties as our own variable-width format (see text.c, + Internal String Encoding) and so most code would not need to be changed. + + -- UTF-16 as a "pseudo-fixed" format (i.e. 16-bit fixed plus surrogates + for representing characters not in the BMP, aka >= 65536). The vast + majority of documents will have no surrogates in them so byte/char + conversion will be very fast. + + -- an 8-bit fixed format, like currently. + + -- possibly, UCS-4 as a 32-bit fixed format. + + The fixed-width formats essentially treat the buffer as an array of + 8-bit, 16-bit or 32-bit integers. This means that how they are stored + in memory (in particular, big-endian or little-endian) depends on the + native format of the machine's processor. It also means we have to + worry a bit about alignment (basically, we just need to keep the gap an + integral size of the character size, and get things aligned properly + when converting the buffer between formats). ========================================================================== - 5. Buffer Positions and Other Typedefs + 8. Using UTF-16 as the default text format ========================================================================== - A. Buffer Positions - - There are three possible ways to specify positions in a buffer. All - of these are one-based: the beginning of the buffer is position or - index 1, and 0 is not a valid position. - - As a "buffer position" (typedef Charbpos): - - This is an index specifying an offset in characters from the - beginning of the buffer. Note that buffer positions are - logically *between* characters, not on a character. The - difference between two buffer positions specifies the number of - characters between those positions. Buffer positions are the - only kind of position externally visible to the user. - - As a "byte index" (typedef Bytebpos): - - This is an index over the bytes used to represent the characters - in the buffer. If there is no Mule support, this is identical - to a buffer position, because each character is represented - using one byte. However, with Mule support, many characters - require two or more bytes for their representation, and so a - byte index may be greater than the corresponding buffer - position. - - As a "memory index" (typedef Membpos): - - This is the byte index adjusted for the gap. For positions - before the gap, this is identical to the byte index. For - positions after the gap, this is the byte index plus the gap - size. There are two possible memory indices for the gap - position; the memory index at the beginning of the gap should - always be used, except in code that deals with manipulating the - gap, where both indices may be seen. The address of the - character "at" (i.e. following) a particular position can be - obtained from the formula - - buffer_start_address + memory_index(position) - 1 - - except in the case of characters at the gap position. - - B. Other Typedefs - - Ichar: - ------ - This typedef represents a single Emacs character, which can be - ASCII, ISO-8859, or some extended character, as would typically - be used for Kanji. Note that the representation of a character - as an Ichar is *not* the same as the representation of that - same character in a string; thus, you cannot do the standard - C trick of passing a pointer to a character to a function that - expects a string. - - An Ichar takes up 19 bits of representation and (for code - compatibility and such) is compatible with an int. This - representation is visible on the Lisp level. The important - characteristics of the Ichar representation are - - -- values 0x00 - 0x7f represent ASCII. - -- values 0x80 - 0xff represent the right half of ISO-8859-1. - -- values 0x100 and up represent all other characters. - - This means that Ichar values are upwardly compatible with - the standard 8-bit representation of ASCII/ISO-8859-1. - - Ibyte: - ------ - The data in a buffer or string is logically made up of Ibyte - objects, where a Ibyte takes up the same amount of space as a - char. (It is declared differently, though, to catch invalid - usages.) Strings stored using Ibytes are said to be in - "internal format". The important characteristics of internal - format are - - -- ASCII characters are represented as a single Ibyte, - in the range 0 - 0x7f. - -- All other characters are represented as a Ibyte in - the range 0x80 - 0x9f followed by one or more Ibytes - in the range 0xa0 to 0xff. - - This leads to a number of desirable properties: - - -- Given the position of the beginning of a character, - you can find the beginning of the next or previous - character in constant time. - -- When searching for a substring or an ASCII character - within the string, you need merely use standard - searching routines. - - Extbyte: - -------- - Strings that go in or out of Emacs are in "external format", - typedef'ed as an array of char or a char *. There is more - than one external format (JIS, EUC, etc.) but they all - have similar properties. They are modal encodings, - which is to say that the meaning of particular bytes is - not fixed but depends on what "mode" the string is currently - in (e.g. bytes in the range 0 - 0x7f might be - interpreted as ASCII, or as Hiragana, or as 2-byte Kanji, - depending on the current mode). The mode starts out in - ASCII/ISO-8859-1 and is switched using escape sequences -- - for example, in the JIS encoding, 'ESC $ B' switches to a - mode where pairs of bytes in the range 0 - 0x7f - are interpreted as Kanji characters. - - External-formatted data is generally desirable for passing - data between programs because it is upwardly compatible - with standard ASCII/ISO-8859-1 strings and may require - less space than internal encodings such as the one - described above. In addition, some encodings (e.g. JIS) - keep all characters (except the ESC used to switch modes) - in the printing ASCII range 0x20 - 0x7e, which results in - a much higher probability that the data will avoid being - garbled in transmission. Externally-formatted data is - generally not very convenient to work with, however, and - for this reason is usually converted to internal format - before any work is done on the string. - - NOTE: filenames need to be in external format so that - ISO-8859-1 characters come out correctly. - - Charcount: - ---------- - This typedef represents a count of characters, such as - a character offset into a string or the number of - characters between two positions in a buffer. The - difference between two Charbpos's is a Charcount, and - character positions in a string are represented using - a Charcount. - - Bytecount: - ---------- - Similar to a Charcount but represents a count of bytes. - The difference between two Bytebpos's is a Bytecount. - - - C. Usage of the Various Representations - - Memory indices are used in low-level functions in insdel.c and for - extent endpoints and marker positions. The reason for this is that - this way, the extents and markers don't need to be updated for most - insertions, which merely shrink the gap and don't move any - characters around in memory. - - (The beginning-of-gap memory index simplifies insertions w.r.t. - markers, because text usually gets inserted after markers. For - extents, it is merely for consistency, because text can get - inserted either before or after an extent's endpoint depending on - the open/closedness of the endpoint.) - - Byte indices are used in other code that needs to be fast, - such as the searching, redisplay, and extent-manipulation code. - - Buffer positions are used in all other code. This is because this - representation is easiest to work with (especially since Lisp - code always uses buffer positions), necessitates the fewest - changes to existing code, and is the safest (e.g. if the text gets - shifted underneath a buffer position, it will still point to a - character; if text is shifted under a byte index, it might point - to the middle of a character, which would be bad). - - Similarly, Charcounts are used in all code that deals with strings - except for code that needs to be fast, which used Bytecounts. - - Strings are always passed around internally using internal format. - Conversions between external format are performed at the time - that the data goes in or out of Emacs. - - D. Working With the Various Representations - - We write things this way because it's very important the - MAX_BYTEBPOS_GAP_SIZE_3 is a multiple of 3. (As it happens, - 65535 is a multiple of 3, but this may not always be the - case. #### unfinished + NOTE: The Eistring API is (or should be) Mule-correct even without + an ASCII-compatible internal representation. + + #### Currently, the assumption that text units are one byte in size is + embedded throughout XEmacs, and `Ibyte *' is used where `Itext *' should + be. The way to fix this is to (among other things) + + (a) review all places referencing `Ibyte' and `Ibyte *', change them to + use Itext, and fix up the code. + (b) change XSTRING_DATA to be of type Itext * + (c) review all uses of XSTRING_DATA + (d) eliminate XSTRING_LENGTH, splitting it into XSTRING_BYTE_LENGTH and + XSTRING_TEXT_LENGTH and reviewing all places referencing this + (e) make similar changes to other API's that refer to the "length" of + something, such as qxestrlen() and eilen() + (f) review all use of `CIbyte *'. Currently this is usually a way of + passing literal ASCII text strings in places that want internal text. + Either create separate _ascii() and _itext() versions of the + functions taking CIbyte *, or make use of something like the + WEXTTEXT() macro, which will generate wide strings as appropriate. + (g) review all uses of Bytecount and see which ones should be Textcount. + (h) put in error-checking code that will be tripped as often as possible + when doing anything with internal text, and check to see that ASCII + text has not mistakenly filtered in. This should be fairly easy as + ASCII text will generally be entirely spaces and letters whereas every + second byte of Unicode text will generally be a null byte. Either we + abort if the second bytes are entirely letters and numbers, or, + perhaps better, do the equivalent of a non-MULE build, where we should + be dealing entirely with 8-bit characters, and assert that the high + bytes of each pair are null. + (i) review places where xmalloc() is called. If we convert each use of + xmalloc() to instead be xnew_array() or some other typed routine, + then we will find every place that allocates space for Itext and + assumes it is based on one-byte units. + (j) encourage the use of ITEXT_ZTERM_SIZE instead of '+ 1' whenever we + are adding space for a zero-terminator, to emphasize what we are + doing and make sure the calculations are correct. Similarly for + EXTTEXT_ZTERM_SIZE. + (k) Note that the qxestr*() functions, among other things, will need to + be rewritten. + + Note that this is a lot of work, and is not high on the list of priorities + currently. ========================================================================== - 6. Miscellaneous + 9. Miscellaneous ========================================================================== A. Unicode Support @@ -621,8 +223,1051 @@ Or you could use 0x8D C1 C2 C3 C4, allowing for about 85 million (slightly over 2^26) composite characters. + ========================================================================== + 10. Internal API's + ========================================================================== + + All of these are documented in more detail in text.h. + +@enumerate +@item +Basic internal-format API's + +These are simple functions and macros to convert between text +representation and characters, move forward and back in text, etc. + +@item +The DFC API + +This is for conversion between internal and external text. Note that +there is also the "new DFC" API, which *returns* a pointer to the +converted text (in alloca space), rather than storing it into a +variable. + +@item +The Eistring API + +(This API is currently under-used) When doing simple things with +internal text, the basic internal-format API's are enough. But to do +things like delete or replace a substring, concatenate various strings, +etc. is difficult to do cleanly because of the allocation issues. +The Eistring API is designed to deal with this, and provides a clean +way of modifying and building up internal text. (Note that the former +lack of this API has meant that some code uses Lisp strings to do +similar manipulations, resulting in excess garbage and increased +garbage collection.) + +NOTE: The Eistring API is (or should be) Mule-correct even without +an ASCII-compatible internal representation. +@end enumerate + + ========================================================================== + 11. Other Sources of Documentation + ========================================================================== + + man/lispref/mule.texi +@enumerate +@item +another intro to characters, encodings, etc; #### Merge with the +above info +@item +documentation of ISO-2022 +@item +The charset and coding-system Lisp API's +@item +The CCL conversion language for writing encoding conversions +@item +The Latin-Unity package for unifying Latin charsets +@end enumerate + + man/internals/internals.texi (the Internals manual) +@enumerate +@item +"Coding for Mule" -- how to write Mule-aware code +@item +"Modules for Internationalization" +@item +"The Text in a Buffer" -- more about the different ways of +viewing buffer positions; #### Merge with the above info +@item +"MULE Character Sets and Encodings" -- yet another intro +to characters, encodings, etc; #### Merge with the +above info; also some documentation of Japanese EUC and JIS7, +and CCL internals +@end enumerate + + text.h -- info about specific XEmacs-C API's for handling internal and + external text + + intl-win32.c -- Windows-specific I18N information + + lisp.h -- some info appears alongside the definitions of the basic + character-related types + + unicode.c -- documentation about Unicode translation tables */ + +/************************************************************************/ +/* */ +/* */ +/* Part B: Random proposals for work to be done */ +/* */ +/* */ +/************************************************************************/ + + +/* + + + ========================================================================== + - Mule design issues (ben) + ========================================================================== + +circa 1999 + +Here is a more detailed list of Mule-related projects that we will be +working on. They are more or less ordered according to how we will +proceed, but it's not exact. In particular, there will probably be +time overlap among adjacent projects. + +@enumerate +@item +Modify the internal/external conversion macros to allow for +MS Windows support. + +@item +Modify the buffer macros to allow for more than one internal +representation, e.g. fixed width and variable width. + +@item +Review the existing Mule code, especially the lisp code, for code +quality issues and improve the cleanliness of it. Also work on +creating a specification for the Mule API. + +@item +Write some more automated mule tests. + +@item +Integrate Tomohiko's UTF-2000 code, fixing it up so that nothing is +broken when the UTF-2000 configure option is not enabled. + +@item +Fix up the MS Windows code to be Mule-correct, so that you can +compile with Mule support under MS windows and have a working +XEmacs, at least just with Latin-1. + +@item +Implement a scheme to guarantee no corruption of files, even with +an incorrect coding system - in particular, guarantee no corruption +of binary files. + +@item +Make the text property support in XEmacs robust with respect to +string and text operations, so that the `no corruption' support in +the previous entry works properly, even if a lot of cutting and +pasting is done. + +@item +Improve the handling of auto-detection so that, when there is any +possibility at all of mistake, the user is informed of the detected +encoding and given the choice of choosing other possibilities. + +@item +Improve the support for different language environments in XEmacs, +for example, the priority of coding systems used in auto-detection +should properly reflect the language environment. This probably +necessitates rethinking the current `coding system priority' +scheme. + +@item +Do quality work to improve the existing UTF-2000 implementation. + +@item +Implement preliminary support for 8-bit fixed width +representation. First, we will only implement 7-bit support, and +will fall back to variable width as soon as any non-ASCII +character is encountered. Then we will improve the support to +handle an arbitrary character set in the upper half of the 8-bit space. + +@item +Investigate any remaining hurdles to making --with-mule be the +default configure option. +@end enumerate + + ========================================================================== + - Mule design issues (stephen) + ========================================================================== + +What I see as Mule priorities (in rough benefit order, I am not taking +account of difficulty, nor the fact that some - eg 8 & 10 - will +probably come as packages): + +@enumerate +@item +Fix the autodetect problem (by making the coding priority list +user-configurable, as short as he likes, even null, with "binary" +as the default). +@item +Document the language environments and other Mule "APIs" as +implemented (since there is no real design spec). Check to see +how and where they are broken. +@item +Make the Mule menu useful to non-ISO-2022-literate folks. +@item +Redo the lstreams stuff to make it easy and robust to "pipeline", +eg, libz | gnupg | jis2mule. +@item +Make Custom Mule-aware. (This probably depends on a sensible +fonts model.) +@item +Implement the "literal byte stream" memory feature. +@item +Study the FSF implementation of Mule for background for 7 & 8. +@item +Identify desirable Mule features (eg, i18n-ized messages as above, +collating tables by language environment, etc). (New features +might have priority as high as 9.) +@item +Specify Mule UIs, APIs, etc, and design and (re)implement them. +@item +Implement the 8-bit-wide buffer optimization. +@item +Move the internal encoding to UTF-32 (subject to Olivier's caveats +regarding compose characters), with the variable-width char +buffers using UTF-8. +@item +Implement the 16- and 32-bit-wide buffer optimizations. +@end enumerate + + ========================================================================== + - Mule design issues "short term" (ben) + ========================================================================== + +@enumerate +@item +Finish changes in fixup/directory, get in CVS. + +(Test with and without "quick-build", to see if really faster) +(need autoconf) + +@item +Finish up Windows/Mule changes. Outline of this elsewhere; Do +*minimal* effort. + +@item +Continue work on Windows stability, e.g. go through existing notes +on Windows Mule-ization + extract all info. + +@item +Get Unicode translation tables integrated. + +Finish UCS2/UTF16 coding system. + +@item +Make sure coding system priority list is language-environment specific. + +@item +Consider moving language selection Menu up to be parallel with Mule menu. + +@item +Check to make sure we grok the default locale at startup under +Windows and understand the Windows locales. Finish implementation +of mswindows-multibyte and make sure it groks all the locales. + +@item +Do the above as best as we can without using Unicode tables. + +@item +Start tagging all text with a language text property, +indicating the current language environment when the text was input. + +@item +Make sure we correctly accept input of non-ASCII chars +(probably already do!) + +@item +Implement active language/keyboard switching under Windows. + +@item +Look into implementing support for "MS IME" protocol (Microsoft +fancy built-in Asian input methods). + +@item +Redo implementation of mswindows-multibyte and internal display to +entirely use translation to/from Unicode for increased accuracy. + +@item +Implement buf<->char improvements from FSF. Also implement +my string byte<->char optimization structure. + +@item +Integrate all Mule DOCS from 20.6 or 21.0. Try to add sections +for what we've added. + +@item +Implement 8-bit fixed width optimizations. Then work on 16-bit. +@end enumerate + + ========================================================================== + - Mule design issues (more) (ben) + ========================================================================== + + Get minimal Mule for Windows working using Ikeyama's patches. At + first, rely on his conversion of internal -> external + locale-specific but very soon (as soon as we get translation + tables) can switch to using Unicode versions of display funs, which + will allow many more charsets to be handled and in a more + consistent fashion. + + i.e. to convert an internal string to an external format, at first + we use our own knowledge of the Microsoft locale file formats but + an alternative is to convert to Unicode and use Microsoft's + convert-Unicode-to-locale encoding functions. This gains us a + great deal of generality, since in practice all charset caching + points can be wrapped into Unicode caching points. + + This requires adding UCS2 support, which I'm doing. This support + would let us convert internal -> Unicode, which is exactly what we + want. + + At first, though, I would do the UCS2 support, but leave the + existing way of doing things in redisplay. Meanwhile, I'd go + through and fix up the places in the code that assume we are + dealing with unibytes. + + After this, the font problems will be fixed , we should have a + pretty well working XEmacs + MULE under Windows. The only real + other work is the clipboard code, which should be straightforward. + + ========================================================================== + - Mule design discussion + ========================================================================== + +-------------------------------------------------------------------------- + +Ben + +April 11, 2000 + +Well yes, this was the whole point of my "no lossage" proposal of being +able to undo any coding-system transformation on a buffer. The idea was +to figure out which transformations were definitely reversable, and for +all the others, cache the original text in a text property. This way, you +could probably still do a fairly good job at constructing a good reversal +even after you've gone into the text and added, deleted, and rearranged +some things. + +But you could implement it much more simply and usefully by just +determining, for any text being decoded into mule-internal, can we go back +and read the source again? If not, remember the entire file (GNUS +message, etc) in text properties. Then, implement the UI interface (like +Netscape's) on top of that. This way, you have something that at least +works, but it might be inefficient. All we would need to do is work on +making the +underlying implementation more efficient. + +Are you interested in doing this? It would be a huge win for users. +Hrvoje Niksic wrote: + +> Ben Wing <ben@666.com> writes: +> +> > let me know exactly what "rethink" functionality you want and i'll +> > come up with an interface. perhaps you just want something like +> > netscape's encoding menu, where if you switch encodings, it reloads +> > and reencodes? +> +> It might be a bit more complex than that. In many cases, it's hard or +> impossible to meaningfully "reload" -- for instance, this +> functionality should be available while editing a Gnus message, as +> well as while visiting a file. +> +> For the special case of Latin-N <-> Latin-M conversion, things could +> be done easily -- to convert from N to M, you only need to convert +> internal representation back to N, and then convert it forth to M. + +-------------------------------------------------------------------------- +April 11, 2000 + +Well yes, this was the whole point of my "no lossage" proposal of being +able to undo any coding-system transformation on a buffer. The idea was +to figure out which transformations were definitely reversable, and for +all the others, cache the original text in a text property. This way, you +could probably still do a fairly good job at constructing a good reversal +even after you've gone into the text and added, deleted, and rearranged +some things. + +But you could implement it much more simply and usefully by just +determining, for any text being decoded into mule-internal, can we go back +and read the source again? If not, remember the entire file (GNUS +message, etc) in text properties. Then, implement the UI interface (like +Netscape's) on top of that. This way, you have something that at least +works, but it might be inefficient. All we would need to do is work on +making the +underlying implementation more efficient. + +Are you interested in doing this? It would be a huge win for users. +Hrvoje Niksic wrote: + +> Ben Wing <ben@666.com> writes: +> +> > let me know exactly what "rethink" functionality you want and i'll +> > come up with an interface. perhaps you just want something like +> > netscape's encoding menu, where if you switch encodings, it reloads +> > and reencodes? +> +> It might be a bit more complex than that. In many cases, it's hard or +> impossible to meaningfully "reload" -- for instance, this +> functionality should be available while editing a Gnus message, as +> well as while visiting a file. +> +> For the special case of Latin-N <-> Latin-M conversion, things could +> be done easily -- to convert from N to M, you only need to convert +> internal representation back to N, and then convert it forth to M. + + +------------------------------------------------------------------------ + + ========================================================================== + - Redoing translation macros [old] + ========================================================================== + + Currently the translation macros (the macros with names such as + GET_C_STRING_CTEXT_DATA_ALLOCA) have names that are difficult to parse + or remember, and are not all that general. In the process of + reviewing the Windows code so that it could be muleized, I discovered + that these macros need to be extended in various ways to allow for + the Windows code to be easily muleized. + + Since the macros needed to be changed anyways, I figured it would be a + good time to redo them properly. I propose new macros which have + names like this: + + @itemize @bullet + @item + <A>_TO_EXTERNAL_FORMAT_<B> + @item + <A>_TO_EXTERNAL_FORMAT_<B>_1 + @item + <C>_TO_INTERNAL_FORMAT_<D> + @item + <C>_TO_INTERNAL_FORMAT_<D>_1 + @end itemize + + A and C represent the source of the data, and B and D represent the + sink of the data. + + All of these macros call either the functions + convert_to_external_format or convert_to_internal_format internally, + with some massaging of the arguments. + + All of these macros take the following arguments: + + @itemize @bullet + @item + First, one or two arguments indicating the source of the data. + @item + Second, an argument indicating the coding system. (In order to avoid + an excessive number of macros, we no longer provide separate macros + for specific coding systems.) + @item + Third, one or two arguments indicating the sink of the data. + @item + Fourth, optionally, arguments indicating the error behavior and the + warning class (these arguments are only present in the _1 versions + of the macros). The other, shorter named macros are trivial + interfaces onto these macros with the error behavior being + ERROR_ME_WARN, with the warning class being Vstandard_warning_class. + @end itemize + + <A> can be one of the following: + @itemize @bullet + @item + LISP (which means a Lisp string) Takes one argument, a Lisp Object. + @item + LSTREAM (which indicates an lstream) Takes one argument, an + lstream. The data is read from the lstream until EOF is reached. + @item + DATA (which indicates a raw memory area) Takes two arguments, a + pointer and a length in bytes. + (You must never use this if the source of the data is a Lisp string, + because of the possibility of relocation during garbage collection.) + @end itemize + + <B> can be one of the following: + @itemize @bullet + @item + ALLOCA (which means that the resulting data is stored in alloca()ed + memory. Two arguments should be specified, a pointer and a length, + which should be lvalues.) + @item + MALLOC (which means that the resulting data is stored in malloc()ed + memory. Two arguments should be specified, a pointer and a + length. The memory must be free()d by the caller. + @item + OPAQUE (which means the resulting data is stored in an opaque Lisp + Object. This takes one argument, a lvalue Lisp Object. + @item + LSTREAM. The data is written to an lstream. + @end itemize + + <C> can be one of the : + @itemize @bullet + @item + DATA + @item + LSTREAM + @end itemize + (just like <A> above) + + <D> can be one of + @itemize @bullet + @item + ALLOCA + @item + MALLOC + @item + LISP This means a Lisp String. + @item + BUFFER The resulting data is inserted into a buffer at the buffer's + value of point. + @item + LSTREAM The data is written to the lstream. + @end itemize + + + Note that I have eliminated the FORMAT argument of previous macros, + and replaced it with a coding system. This was made possible by + coding system aliases. In place of old `format's, we use a `virtual + coding system', which is aliased to the actual coding system. + + The value of the coding system argument can be anything that is legal + input to get_coding_system, i.e. a symbol or a coding system object. + + ========================================================================== + - creation of generic macros for accessing internally formatted data [old] + ========================================================================== + + I have a design; it's all written down (I did it in Tsukuba), and I just have + to have it transcribed. It's higher level than the macros, though; it's Lisp + primitives that I'm designing. + + As for the design of the macros, don't worry so much about all files having to + get included (which is inevitable with macros), but about how the files are + separated. Your design might go like this: + + @enumerate + @item + you have generic macro interfaces, which specify a particular + behavior but not an implementation. these generic macros have + complementary versions for buffers and for strings (and the buffer + or string is an argument to all of the macros), and do such things + as convert between byte and char indices, retrieve the character at + a particular byte or char index, increment or decrement a byte + index to the beginning of the next or previous character, indicate + the number of bytes occupied by the character at a particular byte + or character index, etc. These are similar to what's already out + there except that they confound buffers and strings and that they + can also work with actual char *'s, which I think is a really bad + idea because it encourages code to "assume" that the representation + is ASCII compatible, which is might not be (e.g. 16-bit fixed + width). In fact, one thing I'm planning on doing is redefining + Bufbyte as a struct, for debugging purposes, to catch all places + that cavalierly compare them with ASCII char's. Note also that I + really want to rename Bufpos and Bytind, which are confusing and + wrong in that they also apply to strings. They should be Bytepos + and Charpos, or something like that, to go along with Bytecount and + Charcount. Similarly, Bufbyte is similarly a misnomer and should be + Intbyte -- a byte in the internal string representation (any of the + internal representations) of a string or buffer. Corresponding to + this is Extbyte (which we already have), a byte in any external + string representation. We also have Extcount, which makes sense, + and we might possibly want Extcharcount, the number of characters + in an external string representation; but that gets sticky in modal + encodings, and it's not clear how useful it would be. + + @item + for all generic macro interfaces, there are specific versions of + each of them for each possible representation (pure ASCII in the + non-Mule world, Mule standard, UTF-8, 8-bit fixed, 16-bit fixed, + 32-bit fixed, etc.; there may well be more than one possible 16-bit + fixed version, as well). Each representation has a corresponding + prefix, e.g. MULE_ or FIXED16_ or whatever, which is prefixed onto + the generic macro names. The resulting macros perform the + operation defined for the macro, but assume, and only work + correctly with, text in the corresponding representation. + + @item + The definition of the generic versions merely conditionalizes on + the appropriate things (i.e. bit flags in the buffer or string + object) and calls the appropriate representation-specific version. + There may be more than one definition (protected by ifdefs, of + course), or one definition that amalgamated out of many ifdef'ed + sections. + + @item + You should probably put each different representation in its own + header file, e.g. charset-mule.h or charset-fixed16.h or + charset-ascii.h or whatever. Then put the main macros into + charset.h, and conditionalize in this file appropriately to include + the other ones. That way, code that actually needs to play around + with internal-format text at this level can include "charset.h" + (certainly a much better place than buffer.h), and everyone else + uses higher-level routines. The representation-specific macros + should not normally be used *directly* at all; they are invoked + automatically from the generic macros. However, code that needs to + be highly, highly optimized might choose to take a loop and write + two versions of it, one for each representation, to avoid the + per-loop-iteration cost of a comparison. Until the macro interface + is rock stable and solid, we should strongly discourage such + nanosecond optimizations. + @end enumerate + + ========================================================================== + - UTF-16 compatible representation + ========================================================================== + +NOTE: One possible default internal representation that was compatible +with UTF16 but allowed all possible chars in UCS4 would be to take a +more-or-less unused range of 2048 chars (not from the private area +because Microsoft actually uses up most or all of it with EUDC chars). +Let's say we picked A400 - ABFF. Then, we'd have: + +0000 - FFFF Simple chars + +D[8-B]xx D[C-F]xx Surrogate char, represents 1M chars + +A[4-B]xx D[C-F]xx D[C-F]xx Surrogate char, represents 2G chars + +This is exactly the same number of chars as UCS-4 handles, and it follows the +same property as UTF8 and Mule-internal: + +@enumerate +@item +There are two disjoint groupings of units, one representing leading units +and one representing non-leading units. +@item +Given a leading unit, you immediately know how many units follow to make +up a valid char, irrespective of any other context. +@end enumerate + +Note that A4xx is actually currently assigned to Yi. Since this is an +internal representation, we could just move these elsewhere. + +An alternative is to pick two disjoint ranges, e.g. 2D00 - 2DFF and +A500 - ABFF. + + ========================================================================== + New API for char->font mapping + ========================================================================== +- ; supersedes charset-registry and CCL; + supports all windows systems; powerful enough for Unicode; etc. + + (charset-font-mapping charset) + +font-mapping-specifier string + +char-font-mapping-table + + char-table, specifier; elements of char table are either strings (which + specify a registry or comparable font property, or vectors of a string + (same) followed by keyword-value pairs (optional). The only allowable + keyword currently is :ccl-program, which specifies a CCL program to map + the characters into font indices. Other keywords may be added + e.g. allowing Elisp fragments instead of CCL programs, also allowed is + [inherit], which inherits from the next less-specific char-table in the + specifier. + + The preferred interface onto this mapping (which should be portable + across Emacsen) is + + (set-char-font-mapping key value &optional locale tag-set how-to-add) + + where key is a char, range or charset (as for put-char-table), value is + as above, and the other arguments are standard for specifiers. This + automatically creates a char table in the locale, as necessary (all + elements default to [inherit]). On GNU Emacs, some specifiers arguments + may be unimplemented. + + (char-font-mapping key value &optional locale) +works vaguely like get-specifier? But does inheritance processing. +locale should clearly default here to current-buffer + +#### should get-specifier as well? Would make it work most like +#### buffer-local variables. + +NB. set-charset-registry and set-charset-ccl-program are obsoleted. + + ========================================================================== + Implementing fixed-width 8,16,32 bit buffer optimizations + ========================================================================== + +Add set-buffer-optimization (buffer &rest keywords) for +controlling these things. + +Also, put in hack so that correct arglist can be retrieved by +Lisp code. + +Look at the way keyword primitives are currently handled; make +sure it works and is documented, etc. + +Implement 8-bit fixed width optimization. Take the things that +know about the actual implementation and put them in a single +file, in essence creating an abstraction layer to allow +pluggable internal representations. Implement a fairly general +scheme for mapping between character codes in the 8 bits or 16 +bits representation and on actual charset characters. As part of +set-buffer-optimization, you can specify a list of character sets +to be used in the 8 bit to 16 bit, etc. world. You can also +request that the buffer be in 8, 16, etc. if possible. + +-> set defaults wrt this. +-> perhaps this should be just buffer properties. +-> this brings up the idea of default properties on an object. +-> Implement default-put, default-get, etc. + +What happens when a character not assigned in the range gets +added? Then, must convert to variable width of some sort. + +Note: at first, possibly we just convert whole hog to get things +right. Then we'd have to poy alternative to characters that got +added + deleted that were unassigned in the fixed width. When +this goes to zero and there's been enough time (heuristics), we +go back to fixed. + +Side note: We could dynamically build up the set of assigned +chars as they go. Conceivably this could even go down to the +single char level: Just keep a big array of mapping from 16 bit +values to chars, and add empty time, a char has been encountered +that wasn't there before. Problem need inverse mapping. + +-> Possibility; chars are actual objects, not just numbers. +Then you could keep track of such info in the chars itself. +*Think about this.* + +Eventually, we might consider allowing mixed fixed-width, +variable-width buffer encodings. Then, we use range tables to +indicate which sections are fixed and which variable and INC_CHAR does +something like this: binary search to find the current range, which +indicates whether it's fixed or variable, and tells us what the +increment is. We can cache this info and use it next time to speed +up. + +-> We will then have two partially shared range tables - one for +overall fixed width vs. variable width, and possibly one containing +this same info, but partitioning the variable width in one. Maybe +need fancier nested range table model. + + ========================================================================== + Expansion of display table and case mapping table support for all + chars, not just ASCII/Latin1. + ========================================================================== + + ========================================================================== + Improved flexibility for display tables, and evaluation of its + features to make sure it meshes with and complements the char<->font + mapping API mentioned earlier + ========================================================================== + + ========================================================================== + String access speedup: + ========================================================================== + + For strings larger than some size in bytes (10?), keep extra fields of + info: length in chars, and a (char, byte) pair in the middle to speed + up sequential access. + + (Better idea: do this for any size string, but only if it contains + non-ASCII chars. Then if info is missing, we know string is + ASCII-only.) + + Use a string-extra-info object, replacing string property slot and + containing fields for string mod tick, string extents, string props, + and string char length, and cached (char,byte) pair. + string-extra-info (or string-auxiliary?) objects could be in frob + blocks, esp. if creating frob blocks is easy + worth it. + +- Caching of char<->byte conversions in strings - should make nearly + all operations on strings O(N) + + ========================================================================== + Improvements in buffer char<->byte mapping + ========================================================================== + + - Range table implementation - especially when there are few runs of + different widths, e.g. recently converted from fixed-width + optimization to variable width + + Range Tables to speed up Bufpos <-> Bytind caching + ================================================== + + This describes an alternative implementation using ranges. We + maintain a range table of all spans of characters of a fixed width. + Updating this table could take time if there are a large number of + spans; but constant factors of operations should be quick. This method really wins + when you have 8-bit buffers just converted to variable width, where + there will be few spans. More specifically, lookup in this range + table is O(log N) and can be done with simple binary search, which is + very fast. If we maintain the ranges using a gap array, updating this + table will be fast for local operations, which is most of the time. + + We will also provide (at first, at least) a Lisp function to set the + caching mechanism explicitly - either range tables or the existing + implementation. Eventually, we want to improve things, to the point + where we automatically pick the right caching for the situation and + have more caching schemes implemented. + + ========================================================================== + - Robustify Text Properties + ========================================================================== + + ========================================================================== + Support for unified internal representation, e.g. Unicode + ========================================================================== + + Start tagging all text with a language text property, + indicating the current language environment when the text was input. + (needs "Robustify Text Properties") + + ========================================================================== + - Generalized Coding Systems + ========================================================================== + + - Lisp API for Defining Coding Systems + + User-defined coding systems. + + (define-coding-system-type 'type + :encode-function fun + :decode-function fun + :detect-function fun + :buffering (number = at least this many chars + line = buffer up to end of line + regexp = buffer until this regexp is found in match + source data. match data will be appropriate when fun is + called + + encode fun is called as + + (encode instream outstream) + + should read data from instream and write converted result onto + outstream. Can leave some data stuff in stream, it will reappear + next time. Generally, there is a finite amount of data in instream + and further attempts to read lead to would-block errors or retvals. + Can use instream properties to record state. May use read-stream + functionality to read everything into a vector or string. + + ->Need vectors + string exposed to resizing of Lisp implementation + where necessary. + + ========================================================================== + Support Windows Active Kbd Switching, Far East IME API (done already?) + ========================================================================== + + ========================================================================== + - UI/design changes for Coding System Pipelining + ========================================================================== + + ------------------------------------------------------------------ + CODING-SYSTEM CHAINS + ------------------------------------------------------------------ + + sjt sez: + + There should be no elementary coding systems in the Lisp API, only + chains. Chains should be declared, not computed, as a sequence of coding + formats. (Probably the internal representation can be a vector for + efficiency but programmers would probably rather work with lists.) A + stream has a token type. Most streams are octet streams. Text is a + stream of characters (in _internal_ format; a file on disk is not text!) + An octet-stream has no implicit semantics, so its format must always be + specified. The only type currently having semantics is characters. This + means that the chain [euc-jp -> internal -> shift_jis) may be specified + (euc-jp, shift_jis), and if no euc-jp -> shift_jis converter is + available, then the chain is automatically constructed. (N.B. I f we + have fixed width buffers in the future, then we could have ASCII -> 8-bit + char -> 16-bit char -> ISO-2022-JP (with escape sequences). + + EOL handling is a char <-> char coding. It should not be part of another + coding system except as a convenience for users. For text coding, + automatically insert EOL handlers between char <-> octet boundaries. + + ------------------------------------------------------------------ + ABOUT DETECTION + ------------------------------------------------------------------ + + + ------------------------------------------------------------------ + EFFICIENCY OF CODING CONVERSION WITH MULTIPLE COPIES/CHAINS + ------------------------------------------------------------------ + + A comment in encode_decode_coding_region(): + + The chain of streams looks like this: + + [BUFFER] <----- (( read from/send to loop )) + ------> [CHAR->BYTE i.e. ENCODE AS BINARY if source is + in bytes] + ------> [ENCODE/DECODE AS SPECIFIED] + ------> [BYTE->CHAR i.e. DECODE AS BINARY + if sink is in bytes] + ------> [AUTODETECT EOL if + we're decoding and + coding system calls + for this] + ------> [BUFFER] + + sjt (?) responds: + + Of course, this is just horrible. BYTE<->CHAR should only be available + to I/O routines. It should not be visible to Mule proper. + + A comment on the implementation. Hrvoje and Kyle worry about the + inefficiency of repeated copying among buffers that chained coding + systems entail. But this may not be as time inefficient as it appears + in the Mule ("house rules") context. The issue is how do you do chain + coding systems without copying? In theory you could have + + IChar external_to_raw (ExtChar *cp, State *s); + IChar decode_utf16 (IChar c, State *s); + IChar decode_crlf (ExtChar *cp, State *s); + + typedef Ichar (*Converter[]) (Ichar, State*); + + Converter utf16[2] = { &decode_utf16, &decode_crlf }; + + void convert (ExtChar *inbuf, IChar *outbuf, Converter cvtr) + { + int i; + ExtChar c; + State s; + + while (c = external_to_raw (*inbuf++, &s)) + { + for (i = 0; i < sizeof(cvtr)/sizeof(Converter); ++i) + if (s.ready) + c = (*cvtr[i]) (c, &s); + } + if (s.ready) + *outbuf++ = c; + } + + But this is a lot of function calls; what Ben is doing is basically + reducing this to one call per buffer-full. The only way to avoid this + is to hardcode all the "interesting" coding systems, maybe using + inline or macros to give structure. But this is still a huge amount + of work, and code. + + One advantage to the call-per-char approach is that we might be able + to do something about the marker/extent destruction that coding + normally entails. + + ben sez: + + it should be possible to preserve the markers/extents without + switching completely to one-call-per-char -- we could at least do one + call per "run", where a run is more or less the maximal stretch of + text not overlapping any markers or extent boundaries. (It's a bit + more complicated if we want to properly support the different extent + begins/ends; in some cases we might have to pump a single character + adjacent to where two extents meet.) The "stateless" way that I wrote + all of the conversion routines may be a real hassle but it allows + something like this to work without too much problem -- pump in one + run at a time into one end of the chain, do a flush after each + iteration, and stick what comes out the other end in its place. + + ------------------------------------------------------------------ + ABOUT FORMATS + ------------------------------------------------------------------ + + when calling make-coding-system, the name can be a cons of (format1 . + format2), specifying that it decodes format1->format2 and encodes the other + way. if only one name is given, that is assumed to be format1, and the + other is either `external' or `internal' depending on the end type. + normally the user when decoding gives the decoding order in formats, but + can leave off the last one, `internal', which is assumed. a multichain + might look like gzip|multibyte|unicode, using the coding systems named + `gzip', `(unicode . multibyte)' and `unicode'. the way this actually works + is by searching for gzip->multibyte; if not found, look for gzip->external + or gzip->internal. (In general we automatically do conversion between + internal and external as necessary: thus gzip|crlf does the expected, and + maps to gzip->external, external->internal, crlf->internal, which when + fully specified would be gzip|external:external|internal:crlf|internal -- + see below.) To forcibly fit together two converters that have explicitly + specified and incompatible names (say you have unicode->multibyte and + iso8859-1->ebcdic and you know that the multibyte and iso8859-1 in this + case are compatible), you can force-cast using :, like this: + ebcdic|iso8859-1:multibyte|unicode. (again, if you force-cast between + internal and external formats, the conversion happens automatically.) + + -------------------------------------------------------------------------- + ABOUT PDUMP, UNICODE, AND RUNNING XEMACS FROM A DIRECTORY WITH WEIRD CHARS + -------------------------------------------------------------------------- + +-- there's the problem that XEmacs can't be run in a directory with + non-ASCII/Latin-1 chars in it, since it will be doing Unicode + processing before we've had a chance to load the tables. In fact, + even finding the tables in such a situation is problematic using + the normal commands. my idea is to eventually load the stuff + extremely extremely early, at the same time as the pdump data gets + loaded. in fact, the unicode table data (stored in an efficient + binary format) can even be stuck into the pdump file (which would + mean as a resource to the executable, for windows). we'd need to + extend pdump a bit: to allow for attaching extra data to the pdump + file. (something like pdump_attach_extra_data (addr, length) + returns a number of some sort, an index into the file, which you + can then retrieve with pdump_load_extra_data(), which returns an + addr (mmap()ed or loaded), and later you pdump_unload_extra_data() + when finished. we'd probably also need + pdump_attach_extra_data_append(), which appends data to the data + just written out with pdump_attach_extra_data(). this way, + multiple tables in memory can be written out into one contiguous + table. (we'd use the tar-like trick of allowing new blocks to be + written without going back to change the old blocks -- we just rely + on the end of file/end of memory.) this same mechanism could be + extracted out of pdump and used to handle the non-pdump situation + (or alternatively, we could just dump either the memory image of + the tables themselves or the compressed binary version). in the + case of extra unicode tables not known about at compile time that + get loaded before dumping, we either just dump them into the image + (pdump and all) or extract them into the compressed binary format, + free the original tables, and treat them like all other tables. + + + ========================================================================== + - Generalized language appropriate word wrapping (requires + layout-exposing API defined in BIDI section) + ========================================================================== + + ========================================================================== + - Make Custom Mule-aware + ========================================================================== + + ========================================================================== + - Composite character support + ========================================================================== + + ========================================================================== + - Language appropriate sorting and searching + ========================================================================== + + ========================================================================== + - Glyph shaping for Arabic and Devanagari + ========================================================================== + +- (needs to be handled mostly + at C level, as part of layout; luckily it's entirely local in its + changes, as this is not hard) + + + ========================================================================== + Consider moving language selection Menu up to be parallel with Mule menu + ========================================================================== + +*/ + + /************************************************************************/ /* declarations */ @@ -695,7 +1340,7 @@ int retval; va_start (args, format); - retval = vsprintf ((char *) buffer, format, args); + retval = vsprintf ((Chbyte *) buffer, format, args); va_end (args); return retval; @@ -760,13 +1405,13 @@ } int -ascii_strcasecmp (const Char_ASCII *s1, const Char_ASCII *s2) +ascii_strcasecmp (const Ascbyte *s1, const Ascbyte *s2) { return qxestrcasecmp ((const Ibyte *) s1, (const Ibyte *) s2); } int -qxestrcasecmp_c (const Ibyte *s1, const Char_ASCII *s2) +qxestrcasecmp_ascii (const Ibyte *s1, const Ascbyte *s2) { return qxestrcasecmp (s1, (const Ibyte *) s2); } @@ -814,13 +1459,13 @@ } int -ascii_strncasecmp (const Char_ASCII *s1, const Char_ASCII *s2, Bytecount len) +ascii_strncasecmp (const Ascbyte *s1, const Ascbyte *s2, Bytecount len) { return qxestrncasecmp ((const Ibyte *) s1, (const Ibyte *) s2, len); } int -qxestrncasecmp_c (const Ibyte *s1, const Char_ASCII *s2, Bytecount len) +qxestrncasecmp_ascii (const Ibyte *s1, const Ascbyte *s2, Bytecount len) { return qxestrncasecmp (s1, (const Ibyte *) s2, len); } @@ -1034,6 +1679,37 @@ XSTRING_DATA (s2), XSTRING_LENGTH (s2)); } +/* Compare a wide string with an ASCII string */ + +int +wcscmp_ascii (const wchar_t *s1, const Ascbyte *s2) +{ + while (*s1 && *s2) + { + if (*s1 != *s2) + break; + s1++, s2++; + } + + return *s1 - *s2; +} + +int +wcsncmp_ascii (const wchar_t *s1, const Ascbyte *s2, Charcount len) +{ + while (len--) + { + int diff = *s1 - *s2; + if (diff != 0) + return diff; + if (!*s1) + return 0; + s1++, s2++; + } + + return 0; +} + /************************************************************************/ /* conversion between textual representations */ @@ -1043,7 +1719,7 @@ void convert_ibyte_string_into_ichar_dynarr (const Ibyte *str, Bytecount len, - Ichar_dynarr *dyn) + Ichar_dynarr *dyn) { const Ibyte *strend = str + len; @@ -1057,7 +1733,7 @@ Charcount convert_ibyte_string_into_ichar_string (const Ibyte *str, Bytecount len, - Ichar *arr) + Ichar *arr) { const Ibyte *strend = str + len; Charcount newlen = 0; @@ -1099,7 +1775,7 @@ Bytecount *len_out) { /* Damn zero-termination. */ - Ibyte *str = (Ibyte *) ALLOCA (nels * MAX_ICHAR_LEN + 1); + Ibyte *str = alloca_ibytes (nels * MAX_ICHAR_LEN + 1); Ibyte *strorig = str; Bytecount len; @@ -1109,7 +1785,7 @@ str += set_itext_ichar (str, arr[i]); *str = '\0'; len = str - strorig; - str = (Ibyte *) xmalloc (1 + len); + str = xnew_ibytes (1 + len); memcpy (str, strorig, 1 + len); if (len_out) *len_out = len; @@ -1440,14 +2116,14 @@ ei->max_size_allocated_ = eifind_large_enough_buffer (0, ei->bytelen_ + 1); - newdata = (Ibyte *) xmalloc (ei->max_size_allocated_); + newdata = xnew_ibytes (ei->max_size_allocated_); memcpy (newdata, ei->data_, ei->bytelen_ + 1); ei->data_ = newdata; } if (ei->extdata_) { - Extbyte *newdata = (Extbyte *) xmalloc (ei->extlen_ + 2); + Extbyte *newdata = xnew_extbytes (ei->extlen_ + 2); memcpy (newdata, ei->extdata_, ei->extlen_); /* Double null-terminate in case of Unicode data */ @@ -1496,7 +2172,7 @@ } if (is_c) - EI_ASSERT_ASCII ((Char_ASCII *) dst, dstlen); + ASSERT_ASCTEXT_ASCII_LEN ((Ascbyte *) dst, dstlen); return (fold_case == 0 ? qxememcmp4 (src, len, dst, dstlen) : fold_case == 1 ? qxememcasecmp4 (src, len, dst, dstlen) : @@ -1527,12 +2203,6 @@ #ifdef MULE -/* Skip as many ASCII bytes as possible in the memory block [PTR, END). - Return pointer to the first non-ASCII byte. optimized for long - stretches of ASCII. */ -inline static const Ibyte * -skip_ascii (const Ibyte *ptr, const Ibyte *end) -{ #ifdef EFFICIENT_INT_128_BIT # define STRIDE_TYPE INT_128_BIT # define HIGH_BIT_MASK \ @@ -1550,6 +2220,12 @@ #define ALIGNED(ptr) ((((EMACS_UINT) ptr) & ALIGN_BITS) == 0) #define STRIDE sizeof (STRIDE_TYPE) +/* Skip as many ASCII bytes as possible in the memory block [PTR, END). + Return pointer to the first non-ASCII byte. optimized for long + stretches of ASCII. */ +inline static const Ibyte * +skip_ascii (const Ibyte *ptr, const Ibyte *end) +{ const unsigned STRIDE_TYPE *ascii_end; /* Need to do in 3 sections -- before alignment start, aligned chunk, @@ -1572,6 +2248,34 @@ return ptr; } +/* Skip as many ASCII bytes as possible in the memory block [END, PTR), + going downwards. Return pointer to the location above the first + non-ASCII byte. Optimized for long stretches of ASCII. */ +inline static const Ibyte * +skip_ascii_down (const Ibyte *ptr, const Ibyte *end) +{ + const unsigned STRIDE_TYPE *ascii_end; + + /* Need to do in 3 sections -- before alignment start, aligned chunk, + after alignment end. */ + while (!ALIGNED (ptr)) + { + if (ptr == end || !byte_ascii_p (*(ptr - 1))) + return ptr; + ptr--; + } + ascii_end = (const unsigned STRIDE_TYPE *) ptr - 1; + /* This loop screams, because we can detect ASCII + characters 4 or 8 at a time. */ + while ((const Ibyte *) ascii_end >= end + && !(*ascii_end & HIGH_BIT_MASK)) + ascii_end--; + ptr = (Ibyte *) (ascii_end + 1); + while (ptr > end && byte_ascii_p (*(ptr - 1))) + ptr--; + return ptr; +} + /* Function equivalents of bytecount_to_charcount/charcount_to_bytecount. These work on strings of all sizes but are more efficient than a simple loop on large strings and probably less efficient on sufficiently small @@ -1631,6 +2335,31 @@ return newptr - ptr; } +/* Function equivalent of charcount_to_bytecount_down. This works on strings + of all sizes but is more efficient than a simple loop on large strings + and probably less efficient on sufficiently small strings. */ + +Bytecount +charcount_to_bytecount_down_fun (const Ibyte *ptr, Charcount len) +{ + const Ibyte *newptr = ptr; + while (1) + { + const Ibyte *newnewptr = skip_ascii_down (newptr, newptr - len); + len -= newptr - newnewptr; + newptr = newnewptr; + /* Skip over all non-ASCII chars, counting the length and + stopping if it's zero */ + while (len && !byte_ascii_p (*(newptr - 1))) + if (ibyte_first_byte_p (*--newptr)) + len--; + if (!len) + break; + } + text_checking_assert (ptr - newptr >= 0); + return ptr - newptr; +} + /* The next two functions are the actual meat behind the charbpos-to-bytebpos and bytebpos-to-charbpos conversions. Currently the method they use is fairly unsophisticated; see buffer.h. @@ -1641,36 +2370,281 @@ Similar considerations apply to bytebpos_to_charbpos_func(), although less so because the function is not called so often. - - #### At some point this should use a more sophisticated method; - see buffer.h. */ - + */ + +/* + +Info on Byte-Char conversion: + + (Info-goto-node "(internals)Byte-Char Position Conversion") +*/ + +#ifdef OLD_BYTE_CHAR static int not_very_random_number; +#endif /* OLD_BYTE_CHAR */ + +#define OLD_LOOP + +/* If we are this many characters away from any known position, cache the + new position in the buffer's char-byte cache. */ +#define FAR_AWAY_DISTANCE 5000 + +/* Converting between character positions and byte positions. */ + +/* There are several places in the buffer where we know + the correspondence: BEG, BEGV, PT, GPT, ZV and Z, + and everywhere there is a marker. So we find the one of these places + that is closest to the specified position, and scan from there. */ + +/* This macro is a subroutine of charbpos_to_bytebpos_func. + Note that it is desirable that BYTEPOS is not evaluated + except when we really want its value. */ + +#define CONSIDER(CHARPOS, BYTEPOS) \ +do \ +{ \ + Charbpos this_charpos = (CHARPOS); \ + int changed = 0; \ + \ + if (this_charpos == x) \ + { \ + retval = (BYTEPOS); \ + goto done; \ + } \ + else if (this_charpos > x) \ + { \ + if (this_charpos < best_above) \ + { \ + best_above = this_charpos; \ + best_above_byte = (BYTEPOS); \ + changed = 1; \ + } \ + } \ + else if (this_charpos > best_below) \ + { \ + best_below = this_charpos; \ + best_below_byte = (BYTEPOS); \ + changed = 1; \ + } \ + \ + if (changed) \ + { \ + if (best_above - best_below == best_above_byte - best_below_byte) \ + { \ + retval = best_below_byte + (x - best_below); \ + goto done; \ + } \ + } \ +} \ +while (0) + Bytebpos charbpos_to_bytebpos_func (struct buffer *buf, Charbpos x) { +#ifdef OLD_BYTE_CHAR Charbpos bufmin; Charbpos bufmax; Bytebpos bytmin; Bytebpos bytmax; int size; int forward_p; - Bytebpos retval; int diff_so_far; int add_to_cache = 0; +#endif /* OLD_BYTE_CHAR */ + + Charbpos best_above, best_below; + Bytebpos best_above_byte, best_below_byte; + int i; + struct buffer_text *t; + Bytebpos retval; + PROFILE_DECLARE (); - /* Check for some cached positions, for speed. */ - if (x == BUF_PT (buf)) - return BYTE_BUF_PT (buf); - if (x == BUF_ZV (buf)) - return BYTE_BUF_ZV (buf); - if (x == BUF_BEGV (buf)) - return BYTE_BUF_BEGV (buf); - PROFILE_RECORD_ENTERING_SECTION (QSin_char_byte_conversion); + best_above = BUF_Z (buf); + best_above_byte = BYTE_BUF_Z (buf); + + /* In this case, we simply have all one-byte characters. But this should + have been intercepted before, in charbpos_to_bytebpos(). */ + text_checking_assert (best_above != best_above_byte); + + best_below = BUF_BEG (buf); + best_below_byte = BYTE_BUF_BEG (buf); + + /* We find in best_above and best_above_byte + the closest known point above CHARPOS, + and in best_below and best_below_byte + the closest known point below CHARPOS, + + If at any point we can tell that the space between those + two best approximations is all single-byte, + we interpolate the result immediately. */ + + CONSIDER (BUF_PT (buf), BYTE_BUF_PT (buf)); + CONSIDER (BUF_GPT (buf), BYTE_BUF_GPT (buf)); + CONSIDER (BUF_BEGV (buf), BYTE_BUF_BEGV (buf)); + CONSIDER (BUF_ZV (buf), BYTE_BUF_ZV (buf)); + + t = buf->text; + CONSIDER (t->cached_charpos, t->cached_bytepos); + + /* Check the most recently entered positions first */ + + for (i = t->next_cache_pos - 1; i >= 0; i--) + { + CONSIDER (t->mule_charbpos_cache[i], t->mule_bytebpos_cache[i]); + + /* If we are down to a range of 50 chars, + don't bother checking any other markers; + scan the intervening chars directly now. */ + if (best_above - best_below < 50) + break; + } + + /* We get here if we did not exactly hit one of the known places. + We have one known above and one known below. + Scan, counting characters, from whichever one is closer. */ + + if (x - best_below < best_above - x) + { + int record = x - best_below > FAR_AWAY_DISTANCE; + +#ifdef OLD_LOOP /* old code */ + while (best_below != x) + { + best_below++; + INC_BYTEBPOS (buf, best_below_byte); + } +#else + text_checking_assert (BUF_FORMAT (buf) == FORMAT_DEFAULT); + /* The gap should not occur between best_below and x, or we will be + screwed in using charcount_to_bytecount(). It should not be exactly + at x either, because we already should have caught that. */ + text_checking_assert + (BUF_CEILING_OF_IGNORE_ACCESSIBLE (buf, best_below) > x); + + /* Using charcount_to_bytecount() is potentially a lot faster than a + simple loop using INC_BYTEBPOS() because (a) the checks for gap + and buffer format are factored out instead of getting checked + every time; (b) the checking goes 4 or 8 bytes at a time in ASCII + text. + */ + best_below_byte += + charcount_to_bytecount + (BYTE_BUF_BYTE_ADDRESS (buf, best_below_byte), x - best_below); + best_below = x; +#endif /* 0 */ + + /* If this position is quite far from the nearest known position, + cache the correspondence. + + NB FSF does this: "... by creating a marker here. + It will last until the next GC." + */ + + if (record) + { + /* If we have run out of positions to record, discard some of the + old ones. I used to use a circular buffer, which avoids the + need to block-move any memory. But it makes it more difficult + to keep track of which positions haven't been used -- commonly + we haven't yet filled out anywhere near the whole set of + positions and don't want to check them all. We should not be + recording that often, and block-moving is extremely fast in + any case. --ben */ + if (t->next_cache_pos == NUM_CACHED_POSITIONS) + { + memmove (t->mule_charbpos_cache, + t->mule_charbpos_cache + NUM_MOVED_POSITIONS, + sizeof (Charbpos) * + (NUM_CACHED_POSITIONS - NUM_MOVED_POSITIONS)); + memmove (t->mule_bytebpos_cache, + t->mule_bytebpos_cache + NUM_MOVED_POSITIONS, + sizeof (Bytebpos) * + (NUM_CACHED_POSITIONS - NUM_MOVED_POSITIONS)); + t->next_cache_pos -= NUM_MOVED_POSITIONS; + } + t->mule_charbpos_cache[t->next_cache_pos] = best_below; + t->mule_bytebpos_cache[t->next_cache_pos] = best_below_byte; + t->next_cache_pos++; + } + + t->cached_charpos = best_below; + t->cached_bytepos = best_below_byte; + + retval = best_below_byte; + text_checking_assert (best_below_byte >= best_below); + goto done; + } + else + { + int record = best_above - x > FAR_AWAY_DISTANCE; + +#ifdef OLD_LOOP + while (best_above != x) + { + best_above--; + DEC_BYTEBPOS (buf, best_above_byte); + } +#else + text_checking_assert (BUF_FORMAT (buf) == FORMAT_DEFAULT); + /* The gap should not occur between best_above and x, or we will be + screwed in using charcount_to_bytecount_down(). It should not be + exactly at x either, because we already should have caught + that. */ + text_checking_assert + (BUF_FLOOR_OF_IGNORE_ACCESSIBLE (buf, best_above) < x); + + /* Using charcount_to_bytecount_down() is potentially a lot faster + than a simple loop using DEC_BYTEBPOS(); see above. */ + best_above_byte -= + charcount_to_bytecount_down + /* BYTE_BUF_BYTE_ADDRESS will return a value on the high side of the + gap if we are at the gap, which is the wrong side. So do the + following trick instead. */ + (BYTE_BUF_BYTE_ADDRESS_BEFORE (buf, best_above_byte) + 1, + best_above - x); + best_above = x; +#endif /* SLEDGEHAMMER_CHECK_TEXT */ + + + /* If this position is quite far from the nearest known position, + cache the correspondence. + + NB FSF does this: "... by creating a marker here. + It will last until the next GC." + */ + if (record) + { + if (t->next_cache_pos == NUM_CACHED_POSITIONS) + { + memmove (t->mule_charbpos_cache, + t->mule_charbpos_cache + NUM_MOVED_POSITIONS, + sizeof (Charbpos) * + (NUM_CACHED_POSITIONS - NUM_MOVED_POSITIONS)); + memmove (t->mule_bytebpos_cache, + t->mule_bytebpos_cache + NUM_MOVED_POSITIONS, + sizeof (Bytebpos) * + (NUM_CACHED_POSITIONS - NUM_MOVED_POSITIONS)); + t->next_cache_pos -= NUM_MOVED_POSITIONS; + } + t->mule_charbpos_cache[t->next_cache_pos] = best_above; + t->mule_bytebpos_cache[t->next_cache_pos] = best_above_byte; + t->next_cache_pos++; + } + + t->cached_charpos = best_above; + t->cached_bytepos = best_above_byte; + + retval = best_above_byte; + text_checking_assert (best_above_byte >= best_above); + goto done; + } + +#ifdef OLD_BYTE_CHAR + bufmin = buf->text->mule_bufmin; bufmax = buf->text->mule_bufmax; bytmin = buf->text->mule_bytmin; @@ -1789,7 +2763,7 @@ /* I considered keeping the positions ordered. This would speed up this loop, but updating the cache would take longer, so it doesn't seem like it would really matter. */ - for (i = 0; i < 16; i++) + for (i = 0; i < NUM_CACHED_POSITIONS; i++) { int diff = buf->text->mule_charbpos_cache[i] - x; @@ -1921,38 +2895,249 @@ buf->text->mule_bytebpos_cache[replace_loc] = retval; } +#endif /* OLD_BYTE_CHAR */ + +done: PROFILE_RECORD_EXITING_SECTION (QSin_char_byte_conversion); return retval; } +#undef CONSIDER + +/* bytepos_to_charpos returns the char position corresponding to BYTEPOS. */ + +/* This macro is a subroutine of bytebpos_to_charbpos_func. + It is used when BYTEPOS is actually the byte position. */ + +#define CONSIDER(BYTEPOS, CHARPOS) \ +do \ +{ \ + Bytebpos this_bytepos = (BYTEPOS); \ + int changed = 0; \ + \ + if (this_bytepos == x) \ + { \ + retval = (CHARPOS); \ + goto done; \ + } \ + else if (this_bytepos > x) \ + { \ + if (this_bytepos < best_above_byte) \ + { \ + best_above = (CHARPOS); \ + best_above_byte = this_bytepos; \ + changed = 1; \ + } \ + } \ + else if (this_bytepos > best_below_byte) \ + { \ + best_below = (CHARPOS); \ + best_below_byte = this_bytepos; \ + changed = 1; \ + } \ + \ + if (changed) \ + { \ + if (best_above - best_below == best_above_byte - best_below_byte) \ + { \ + retval = best_below + (x - best_below_byte); \ + goto done; \ + } \ + } \ +} \ +while (0) + /* The logic in this function is almost identical to the logic in the previous function. */ Charbpos bytebpos_to_charbpos_func (struct buffer *buf, Bytebpos x) { +#ifdef OLD_BYTE_CHAR Charbpos bufmin; Charbpos bufmax; Bytebpos bytmin; Bytebpos bytmax; int size; int forward_p; - Charbpos retval; int diff_so_far; int add_to_cache = 0; +#endif /* OLD_BYTE_CHAR */ + + Charbpos best_above, best_above_byte; + Bytebpos best_below, best_below_byte; + int i; + struct buffer_text *t; + Charbpos retval; + PROFILE_DECLARE (); - /* Check for some cached positions, for speed. */ - if (x == BYTE_BUF_PT (buf)) - return BUF_PT (buf); - if (x == BYTE_BUF_ZV (buf)) - return BUF_ZV (buf); - if (x == BYTE_BUF_BEGV (buf)) - return BUF_BEGV (buf); - PROFILE_RECORD_ENTERING_SECTION (QSin_char_byte_conversion); + best_above = BUF_Z (buf); + best_above_byte = BYTE_BUF_Z (buf); + + /* In this case, we simply have all one-byte characters. But this should + have been intercepted before, in bytebpos_to_charbpos(). */ + text_checking_assert (best_above != best_above_byte); + + best_below = BUF_BEG (buf); + best_below_byte = BYTE_BUF_BEG (buf); + + CONSIDER (BYTE_BUF_PT (buf), BUF_PT (buf)); + CONSIDER (BYTE_BUF_GPT (buf), BUF_GPT (buf)); + CONSIDER (BYTE_BUF_BEGV (buf), BUF_BEGV (buf)); + CONSIDER (BYTE_BUF_ZV (buf), BUF_ZV (buf)); + + t = buf->text; + CONSIDER (t->cached_bytepos, t->cached_charpos); + + /* Check the most recently entered positions first */ + + for (i = t->next_cache_pos - 1; i >= 0; i--) + { + CONSIDER (t->mule_bytebpos_cache[i], t->mule_charbpos_cache[i]); + + /* If we are down to a range of 50 chars, + don't bother checking any other markers; + scan the intervening chars directly now. */ + if (best_above - best_below < 50) + break; + } + + /* We get here if we did not exactly hit one of the known places. + We have one known above and one known below. + Scan, counting characters, from whichever one is closer. */ + + if (x - best_below_byte < best_above_byte - x) + { + int record = x - best_below_byte > 5000; + +#ifdef OLD_LOOP /* old code */ + while (best_below_byte < x) + { + best_below++; + INC_BYTEBPOS (buf, best_below_byte); + } +#else + text_checking_assert (BUF_FORMAT (buf) == FORMAT_DEFAULT); + /* The gap should not occur between best_below and x, or we will be + screwed in using charcount_to_bytecount(). It should not be exactly + at x either, because we already should have caught that. */ + text_checking_assert + (BYTE_BUF_CEILING_OF_IGNORE_ACCESSIBLE (buf, best_below_byte) > x); + + /* Using bytecount_to_charcount() is potentially a lot faster than + a simple loop above using INC_BYTEBPOS(); see above. + */ + best_below += + bytecount_to_charcount + (BYTE_BUF_BYTE_ADDRESS (buf, best_below_byte), x - best_below_byte); + best_below_byte = x; +#endif + + /* If this position is quite far from the nearest known position, + cache the correspondence. + + NB FSF does this: "... by creating a marker here. + It will last until the next GC." + */ + + if (record) + { + if (t->next_cache_pos == NUM_CACHED_POSITIONS) + { + memmove (t->mule_charbpos_cache, + t->mule_charbpos_cache + NUM_MOVED_POSITIONS, + sizeof (Charbpos) * + (NUM_CACHED_POSITIONS - NUM_MOVED_POSITIONS)); + memmove (t->mule_bytebpos_cache, + t->mule_bytebpos_cache + NUM_MOVED_POSITIONS, + sizeof (Bytebpos) * + (NUM_CACHED_POSITIONS - NUM_MOVED_POSITIONS)); + t->next_cache_pos -= NUM_MOVED_POSITIONS; + } + t->mule_charbpos_cache[t->next_cache_pos] = best_below; + t->mule_bytebpos_cache[t->next_cache_pos] = best_below_byte; + t->next_cache_pos++; + } + + + t->cached_charpos = best_below; + t->cached_bytepos = best_below_byte; + + retval = best_below; + text_checking_assert (best_below_byte >= best_below); + goto done; + } + else + { + int record = best_above_byte - x > 5000; + +#ifdef OLD_LOOP /* old code */ + while (best_above_byte > x) + { + best_above--; + DEC_BYTEBPOS (buf, best_above_byte); + } +#else + text_checking_assert (BUF_FORMAT (buf) == FORMAT_DEFAULT); + /* The gap should not occur between best_above and x, or we will be + screwed in using bytecount_to_charcount_down(). It should not be + exactly at x either, because we already should have caught + that. */ + text_checking_assert + (BYTE_BUF_FLOOR_OF_IGNORE_ACCESSIBLE (buf, best_above_byte) < x); + + /* Using bytecount_to_charcount_down() is potentially a lot faster + than a simple loop using INC_BYTEBPOS(); see above. */ + best_above -= + bytecount_to_charcount_down + /* BYTE_BUF_BYTE_ADDRESS will return a value on the high side of the + gap if we are at the gap, which is the wrong side. So do the + following trick instead. */ + (BYTE_BUF_BYTE_ADDRESS_BEFORE (buf, best_above_byte) + 1, + best_above_byte - x); + best_above_byte = x; +#endif + + + /* If this position is quite far from the nearest known position, + cache the correspondence. + + NB FSF does this: "... by creating a marker here. + It will last until the next GC." + */ + if (record) + { + if (t->next_cache_pos == NUM_CACHED_POSITIONS) + { + memmove (t->mule_charbpos_cache, + t->mule_charbpos_cache + NUM_MOVED_POSITIONS, + sizeof (Charbpos) * + (NUM_CACHED_POSITIONS - NUM_MOVED_POSITIONS)); + memmove (t->mule_bytebpos_cache, + t->mule_bytebpos_cache + NUM_MOVED_POSITIONS, + sizeof (Bytebpos) * + (NUM_CACHED_POSITIONS - NUM_MOVED_POSITIONS)); + t->next_cache_pos -= NUM_MOVED_POSITIONS; + } + t->mule_charbpos_cache[t->next_cache_pos] = best_above; + t->mule_bytebpos_cache[t->next_cache_pos] = best_above_byte; + t->next_cache_pos++; + } + + t->cached_charpos = best_above; + t->cached_bytepos = best_above_byte; + + retval = best_above; + text_checking_assert (best_above_byte >= best_above); + goto done; + } + +#ifdef OLD_BYTE_CHAR + bufmin = buf->text->mule_bufmin; bufmax = buf->text->mule_bufmax; bytmin = buf->text->mule_bytmin; @@ -2071,7 +3256,7 @@ /* I considered keeping the positions ordered. This would speed up this loop, but updating the cache would take longer, so it doesn't seem like it would really matter. */ - for (i = 0; i < 16; i++) + for (i = 0; i < NUM_CACHED_POSITIONS; i++) { int diff = buf->text->mule_bytebpos_cache[i] - x; @@ -2202,7 +3387,9 @@ buf->text->mule_charbpos_cache[replace_loc] = retval; buf->text->mule_bytebpos_cache[replace_loc] = x; } - +#endif /* OLD_BYTE_CHAR */ + +done: PROFILE_RECORD_EXITING_SECTION (QSin_char_byte_conversion); return retval; @@ -2216,11 +3403,13 @@ Bytecount bytelength, Charcount charlength) { +#ifdef OLD_BYTE_CHAR int size = (1 << buf->text->mule_shifter) + !!buf->text->mule_three_p; +#endif /* OLD_BYTE_CHAR */ int i; /* Adjust the cache of known positions. */ - for (i = 0; i < 16; i++) + for (i = 0; i < buf->text->next_cache_pos; i++) { if (buf->text->mule_charbpos_cache[i] > start) @@ -2230,6 +3419,15 @@ } } + /* Adjust the special cached position. */ + + if (buf->text->cached_charpos > start) + { + buf->text->cached_charpos += charlength; + buf->text->cached_bytepos += bytelength; + } + +#ifdef OLD_BYTE_CHAR if (start >= buf->text->mule_bufmax) return; @@ -2304,6 +3502,7 @@ } } } +#endif /* OLD_BYTE_CHAR */ } /* Text from START to END (equivalent in Bytebpos's: from BYTE_START to @@ -2317,7 +3516,7 @@ int i; /* Adjust the cache of known positions. */ - for (i = 0; i < 16; i++) + for (i = 0; i < buf->text->next_cache_pos; i++) { /* After the end; gets shoved backward */ if (buf->text->mule_charbpos_cache[i] > end) @@ -2333,6 +3532,22 @@ } } + /* Adjust the special cached position. */ + + /* After the end; gets shoved backward */ + if (buf->text->cached_charpos > end) + { + buf->text->cached_charpos -= end - start; + buf->text->cached_bytepos -= byte_end - byte_start; + } + /* In the range; moves to start of range */ + else if (buf->text->cached_charpos > start) + { + buf->text->cached_charpos = start; + buf->text->cached_bytepos = byte_start; + } + +#ifdef OLD_BYTE_CHAR /* We don't care about any text after the end of the known region. */ end = min (end, buf->text->mule_bufmax); @@ -2355,6 +3570,7 @@ buf->text->mule_bufmin -= end - start; buf->text->mule_bytmin -= byte_end - byte_start; } +#endif /* OLD_BYTE_CHAR */ } #endif /* MULE */ @@ -2833,6 +4049,7 @@ Extbyte_dynarr *conversion_out_dynarr; PROFILE_DECLARE (); + assert (!inhibit_non_essential_conversion_operations); PROFILE_RECORD_ENTERING_SECTION (QSin_internal_external_conversion); count = begin_gc_forbidden (); @@ -3038,6 +4255,7 @@ Ibyte_dynarr *conversion_in_dynarr; PROFILE_DECLARE (); + assert (!inhibit_non_essential_conversion_operations); PROFILE_RECORD_ENTERING_SECTION (QSin_internal_external_conversion); count = begin_gc_forbidden (); @@ -3223,6 +4441,50 @@ } /* ----------------------------------------------------------------------- */ +/* Alloca-conversion helpers */ +/* ----------------------------------------------------------------------- */ + +/* For alloca(), things are trickier because the calling function needs to + allocate. This means that the caller needs to do the following: + + (a) invoke us to do the conversion, remember the data and return the size. + (b) alloca() the proper size. + (c) invoke us again to copy the data. + + We need to handle the possibility of two or more invocations of the + converter in the same expression. In such cases it's conceivable that + the evaluation of the sub-expressions will be overlapping (e.g. one size + function called, then the other one called, then the copy functions + called). To handle this, we keep a list of active data, indexed by the + src expression. (We use the stringize operator to avoid evaluating the + expression multiple times.) If the caller uses the exact same src + expression twice in two converter calls in the same subexpression, we + will lose, but at least we can check for this and abort(). We could + conceivably try to index on other parameters as well, but there is not + really any point. */ + +alloca_convert_vals_dynarr *active_alloca_convert; + +int +find_pos_of_existing_active_alloca_convert (const char *srctext) +{ + alloca_convert_vals *vals = NULL; + int i; + + if (!active_alloca_convert) + active_alloca_convert = Dynarr_new (alloca_convert_vals); + + for (i = 0; i < Dynarr_length (active_alloca_convert); i++) + { + vals = Dynarr_atp (active_alloca_convert, i); + if (vals->srctext == srctext) + return i; + } + + return -1; +} + +/* ----------------------------------------------------------------------- */ /* New-style DFC converters (data is returned rather than stored into var) */ /* ----------------------------------------------------------------------- */ @@ -3275,6 +4537,43 @@ default: abort (); } + + /* The size is always + 2 because we have double zero-termination at the + end of all data (for Unicode-correctness). */ + *dst_size += 2; +} + +Bytecount +new_dfc_convert_size (const char *srctext, const void *src, + Bytecount src_size, enum new_dfc_src_type type, + Lisp_Object codesys) +{ + alloca_convert_vals vals; + + assert (find_pos_of_existing_active_alloca_convert (srctext) < 0); + + vals.srctext = srctext; + + new_dfc_convert_now_damn_it (src, src_size, type, &vals.dst, &vals.dst_size, + codesys); + + Dynarr_add (active_alloca_convert, vals); + return vals.dst_size; +} + +void * +new_dfc_convert_copy_data (const char *srctext, void *alloca_data) +{ + alloca_convert_vals *vals; + int i = find_pos_of_existing_active_alloca_convert (srctext); + + assert (i >= 0); + vals = Dynarr_atp (active_alloca_convert, i); + assert (alloca_data); + memcpy (alloca_data, vals->dst, vals->dst_size); + xfree (vals->dst, void *); + Dynarr_delete (active_alloca_convert, i); + return alloca_data; } void * @@ -3288,90 +4587,6 @@ return dst; } -/* For alloca(), things are trickier because the calling function needs to - allocate. This means that the caller needs to do the following: - - (a) invoke us to do the conversion, remember the data and return the size. - (b) alloca() the proper size. - (c) invoke us again to copy the data. - - We need to handle the possibility of two or more invocations of the - converter in the same expression. In such cases it's conceivable that - the evaluation of the sub-expressions will be overlapping (e.g. one size - function called, then the other one called, then the copy functions - called). To handle this, we keep a list of active data, indexed by the - src expression. (We use the stringize operator to avoid evaluating the - expression multiple times.) If the caller uses the exact same src - expression twice in two converter calls in the same subexpression, we - will lose, but at least we can check for this and abort(). We could - conceivably try to index on other parameters as well, but there is not - really any point. */ - -typedef struct -{ - const char *srctext; - void *dst; - Bytecount dst_size; -} dfc_e2c_vals; - -typedef struct -{ - Dynarr_declare (dfc_e2c_vals); -} dfc_e2c_vals_dynarr; - -static dfc_e2c_vals_dynarr *active_dfc_e2c; - -static int -find_pos_of_existing_active_dfc_e2c (const char *srctext) -{ - dfc_e2c_vals *vals = NULL; - int i; - - for (i = 0; i < Dynarr_length (active_dfc_e2c); i++) - { - vals = Dynarr_atp (active_dfc_e2c, i); - if (vals->srctext == srctext) - return i; - } - - return -1; -} - -void * -new_dfc_convert_alloca (const char *srctext, void *alloca_data) -{ - dfc_e2c_vals *vals; - int i = find_pos_of_existing_active_dfc_e2c (srctext); - - assert (i >= 0); - vals = Dynarr_atp (active_dfc_e2c, i); - assert (alloca_data); - memcpy (alloca_data, vals->dst, vals->dst_size + 2); - xfree (vals->dst, void *); - Dynarr_delete (active_dfc_e2c, i); - return alloca_data; -} - -Bytecount -new_dfc_convert_size (const char *srctext, const void *src, - Bytecount src_size, enum new_dfc_src_type type, - Lisp_Object codesys) -{ - dfc_e2c_vals vals; - - assert (find_pos_of_existing_active_dfc_e2c (srctext) < 0); - - vals.srctext = srctext; - - new_dfc_convert_now_damn_it (src, src_size, type, &vals.dst, &vals.dst_size, - codesys); - - Dynarr_add (active_dfc_e2c, vals); - /* The size is always + 2 because we have double zero-termination at the - end of all data (for Unicode-correctness). */ - return vals.dst_size + 2; -} - /************************************************************************/ /* Basic Ichar functions */ @@ -3893,7 +5108,6 @@ Ibyte_dynarr *); conversion_out_dynarr_list = Dynarr_new2 (Extbyte_dynarr_dynarr, Extbyte_dynarr *); - active_dfc_e2c = Dynarr_new (dfc_e2c_vals); for (i = 0; i <= MAX_BYTEBPOS_GAP_SIZE_3; i++) three_to_one_table[i] = i / 3; @@ -3902,8 +5116,6 @@ void vars_of_text (void) { - reinit_vars_of_text (); - QSin_char_byte_conversion = build_msg_string ("(in char-byte conversion)"); staticpro (&QSin_char_byte_conversion); QSin_internal_external_conversion =
--- a/src/text.h Thu Nov 04 22:51:31 2004 +0000 +++ b/src/text.h Thu Nov 04 23:08:28 2004 +0000 @@ -1,7 +1,7 @@ /* Header file for text manipulation primitives and macros. Copyright (C) 1985-1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003, 2004 Ben Wing. This file is part of XEmacs. @@ -166,73 +166,8 @@ #endif /* not MULE */ -/* ---------------- Handling non-default formats ----------------- */ - -/* We support, at least to some extent, formats other than the default - variable-width format, for speed; all of these alternative formats are - fixed-width. Currently we only handle these non-default formats in - buffers, because access to their text is strictly controlled and thus - the details of the format mostly compartmentalized. The only really - tricky part is the search code -- the regex, Boyer-Moore, and - simple-search algorithms in search.c and regex.c. All other code that - knows directly about the buffer representation is the basic code to - modify or retrieve the buffer text. - - Supporting fixed-width formats in Lisp strings is harder, but possible - -- FSF currently does this, for example. In this case, however, - probably only 8-bit-fixed is reasonable for Lisp strings -- getting - non-ASCII-compatible fixed-width formats to work is much, much harder - because a lot of code assumes that strings are ASCII-compatible - (i.e. ASCII + other characters represented exclusively using high-bit - bytes) and a lot of code mixes Lisp strings and non-Lisp strings freely. - - The different possible fixed-width formats are 8-bit fixed, 16-bit - fixed, and 32-bit fixed. The latter can represent all possible - characters, but at a substantial memory penalty. The other two can - represent only a subset of the possible characters. How these subsets - are defined can be simple or very tricky. - - Currently we support only the default format and the 8-bit fixed format, - and in the latter, we only allow these to be the first 256 characters in - an Ichar (ASCII and Latin 1). - - One reasonable approach for 8-bit fixed is to allow the upper half to - represent any 1-byte charset, which is specified on a per-buffer basis. - This should work fairly well in practice since most documents are in - only one foreign language (possibly with some English mixed in). I - think FSF does something like this; or at least, they have something - called nonascii-translation-table and use it when converting from - 8-bit-fixed text ("unibyte text") to default text ("multibyte text"). - With 16-bit fixed, you could do something like assign chunks of the 64K - worth of characters to charsets as they're encountered in documents. - This should work well with most Asian documents. - - If/when we switch to using Unicode internally, we might have formats more - like this: - - -- UTF-8 or some extension as the default format. Perl uses an - extension that handles 64-bit chars and requires as much as 13 bytes per - char, vs. the standard of 31-bit chars and 6 bytes max. UTF-8 has the - same basic properties as our own variable-width format (see text.c, - Internal String Encoding) and so most code would not need to be changed. - - -- UTF-16 as a "pseudo-fixed" format (i.e. 16-bit fixed plus surrogates - for representing characters not in the BMP, aka >= 65536). The vast - majority of documents will have no surrogates in them so byte/char - conversion will be very fast. - - -- an 8-bit fixed format, like currently. - - -- possibly, UCS-4 as a 32-bit fixed format. - - The fixed-width formats essentially treat the buffer as an array of - 8-bit, 16-bit or 32-bit integers. This means that how they are stored - in memory (in particular, big-endian or little-endian) depends on the - native format of the machine's processor. It also means we have to - worry a bit about alignment (basically, we just need to keep the gap an - integral size of the character size, and get things aligned properly - when converting the buffer between formats). - */ +/* For more discussion, see text.c, "handling non-default formats" */ + typedef enum internal_format { FORMAT_DEFAULT, @@ -603,6 +538,26 @@ #endif /* MULE */ +#ifdef ERROR_CHECK_TEXT +#define ASSERT_ASCTEXT_ASCII_LEN(ptr, len) \ +do { \ + int aia2; \ + const Ascbyte *aia2ptr = (ptr); \ + int aia2len = (len); \ + \ + for (aia2 = 0; aia2 < aia2len; aia2++) \ + assert (aia2ptr[aia2] >= 0x00 && aia2ptr[aia2] < 0x7F); \ +} while (0) +#define ASSERT_ASCTEXT_ASCII(ptr) \ +do { \ + const Ascbyte *aiaz2 = (ptr); \ + ASSERT_ASCTEXT_ASCII_LEN (aiaz2, strlen (aiaz2)); \ +} while (0) +#else +#define ASSERT_ASCTEXT_ASCII_LEN(ptr, len) +#define ASSERT_ASCTEXT_ASCII(ptr) +#endif + /* -------------------------------------------------------------- */ /* Working with the length (in bytes and characters) of a */ /* section of internally-formatted text */ @@ -672,6 +627,68 @@ return charcount_to_bytecount_fun (ptr, len); } +MODULE_API Bytecount +charcount_to_bytecount_down_fun (const Ibyte *ptr, Charcount len); + +/* Given a pointer to a text string and a length in bytes, return + the equivalent length in characters of the stretch [PTR - LEN, PTR). */ + +DECLARE_INLINE_HEADER ( +Charcount +bytecount_to_charcount_down (const Ibyte *ptr, Bytecount len) +) +{ + /* No need to be clever here */ + return bytecount_to_charcount (ptr - len, len); +} + +/* Given a pointer to a text string and a length in characters, return the + equivalent length in bytes of the stretch of characters of that length + BEFORE the pointer. +*/ + +DECLARE_INLINE_HEADER ( +Bytecount +charcount_to_bytecount_down (const Ibyte *ptr, Charcount len) +) +{ +#define SLEDGEHAMMER_CHECK_TEXT +#ifdef SLEDGEHAMMER_CHECK_TEXT + Charcount len1 = len; + Bytecount ret1, ret2; + + /* To test the correctness of the function version, always do the + calculation both ways and check that the values are the same. */ + text_checking_assert (len >= 0); + { + const Ibyte *newptr = ptr; + while (len1 > 0) + { + DEC_IBYTEPTR (newptr); + len1--; + } + ret1 = ptr - newptr; + } + ret2 = charcount_to_bytecount_down_fun (ptr, len); + text_checking_assert (ret1 == ret2); + return ret1; +#else + text_checking_assert (len >= 0); + if (len < 20) /* See above */ + { + const Ibyte *newptr = ptr; + while (len > 0) + { + DEC_IBYTEPTR (newptr); + len--; + } + return ptr - newptr; + } + else + return charcount_to_bytecount_down_fun (ptr, len); +#endif /* SLEDGEHAMMER_CHECK_TEXT */ +} + /* Given a pointer to a text string in the specified format and a length in bytes, return the equivalent length in characters. */ @@ -991,7 +1008,7 @@ /* ---------------------------- */ -/* Working with Ichars */ +/* Working with Ichars */ /* ---------------------------- */ /* NOTE: There are other functions/macros for working with Ichars in @@ -1100,24 +1117,10 @@ do { \ Ibyte **_lta_ = (Ibyte **) &(lval); \ Lisp_Object _lta_2 = (s); \ - *_lta_ = alloca_array (Ibyte, 1 + XSTRING_LENGTH (_lta_2)); \ + *_lta_ = alloca_ibytes (1 + XSTRING_LENGTH (_lta_2)); \ memcpy (*_lta_, XSTRING_DATA (_lta_2), 1 + XSTRING_LENGTH (_lta_2)); \ } while (0) -/* Make an alloca'd copy of a Ibyte * */ -#define IBYTE_STRING_TO_ALLOCA(p, lval) \ -do { \ - Ibyte **_bsta_ = (Ibyte **) &(lval); \ - const Ibyte *_bsta_2 = (p); \ - Bytecount _bsta_3 = qxestrlen (_bsta_2); \ - *_bsta_ = alloca_array (Ibyte, 1 + _bsta_3); \ - memcpy (*_bsta_, _bsta_2, 1 + _bsta_3); \ -} while (0) - - -#define alloca_ibytes(num) alloca_array (Ibyte, num) -#define alloca_extbytes(num) alloca_array (Extbyte, num) - void resize_string (Lisp_Object s, Bytecount pos, Bytecount delta); /* Convert a byte index into a string into a char index. */ @@ -1335,19 +1338,20 @@ variable section: DECLARE_EISTRING (name); - Declare a new Eistring. This is a standard local variable declaration - and can go anywhere in the variable declaration section. NAME itself - is declared as an Eistring *, and its storage declared on the stack. + Declare a new Eistring and initialize it to the empy string. This + is a standard local variable declaration and can go anywhere in the + variable declaration section. NAME itself is declared as an + Eistring *, and its storage declared on the stack. DECLARE_EISTRING_MALLOC (name); - Declare a new Eistring, which uses malloc()ed instead of ALLOCA()ed - data. This is a standard local variable declaration and can go - anywhere in the variable declaration section. Once you initialize - the Eistring, you will have to free it using eifree() to avoid - memory leaks. You will need to use this form if you are passing - an Eistring to any function that modifies it (otherwise, the - modified data may be in stack space and get overwritten when the - function returns). + Declare and initialize a new Eistring, which uses malloc()ed + instead of ALLOCA()ed data. This is a standard local variable + declaration and can go anywhere in the variable declaration + section. Once you initialize the Eistring, you will have to free + it using eifree() to avoid memory leaks. You will need to use this + form if you are passing an Eistring to any function that modifies + it (otherwise, the modified data may be in stack space and get + overwritten when the function returns). or use @@ -1416,10 +1420,10 @@ ... from raw internal-format data in the specified format that is "null-terminated" (the meaning of this depends on the nature of the specific format). - void eicpy_c (Eistring *eistr, const Char_ASCII *c_string); + void eicpy_c (Eistring *eistr, const Ascbyte *c_string); ... from an ASCII null-terminated string. Non-ASCII characters in the string are *ILLEGAL* (read abort() with error-checking defined). - void eicpy_c_len (Eistring *eistr, const Char_ASCII *c_string, len); + void eicpy_c_len (Eistring *eistr, const Ascbyte *c_string, len); ... from an ASCII string, with length specified. Non-ASCII characters in the string are *ILLEGAL* (read abort() with error-checking defined). void eicpy_ext (Eistring *eistr, const Extbyte *extdata, @@ -1559,7 +1563,7 @@ void eicat_ei (Eistring *eistr, Eistring *eistr2); ... from another Eistring. - void eicat_c (Eistring *eistr, Char_ASCII *c_string); + void eicat_c (Eistring *eistr, Ascbyte *c_string); ... from an ASCII null-terminated string. Non-ASCII characters in the string are *ILLEGAL* (read abort() with error-checking defined). void eicat_raw (ei, const Ibyte *data, Bytecount len); @@ -1589,7 +1593,7 @@ Bytecount len, Charcount charlen, Eistring *eistr2); ... with another Eistring. void eisub_c (Eistring *eistr, Bytecount off, Charcount charoff, - Bytecount len, Charcount charlen, Char_ASCII *c_string); + Bytecount len, Charcount charlen, Ascbyte *c_string); ... with an ASCII null-terminated string. Non-ASCII characters in the string are *ILLEGAL* (read abort() with error-checking defined). void eisub_ch (Eistring *eistr, Bytecount off, Charcount charoff, @@ -1656,17 +1660,17 @@ Charcount eirstr_ei_off_char (Eistring *eistr, Eistring *eistr2, Bytecount off, Charcount charoff); - Bytecount eistr_c (Eistring *eistr, Char_ASCII *c_string); - Charcount eistr_c_char (Eistring *eistr, Char_ASCII *c_string); - Bytecount eistr_c_off (Eistring *eistr, Char_ASCII *c_string, Bytecount off, + Bytecount eistr_c (Eistring *eistr, Ascbyte *c_string); + Charcount eistr_c_char (Eistring *eistr, Ascbyte *c_string); + Bytecount eistr_c_off (Eistring *eistr, Ascbyte *c_string, Bytecount off, Charcount charoff); - Charcount eistr_c_off_char (Eistring *eistr, Char_ASCII *c_string, + Charcount eistr_c_off_char (Eistring *eistr, Ascbyte *c_string, Bytecount off, Charcount charoff); - Bytecount eirstr_c (Eistring *eistr, Char_ASCII *c_string); - Charcount eirstr_c_char (Eistring *eistr, Char_ASCII *c_string); - Bytecount eirstr_c_off (Eistring *eistr, Char_ASCII *c_string, + Bytecount eirstr_c (Eistring *eistr, Ascbyte *c_string); + Charcount eirstr_c_char (Eistring *eistr, Ascbyte *c_string); + Bytecount eirstr_c_off (Eistring *eistr, Ascbyte *c_string, Bytecount off, Charcount charoff); - Charcount eirstr_c_off_char (Eistring *eistr, Char_ASCII *c_string, + Charcount eirstr_c_off_char (Eistring *eistr, Ascbyte *c_string, Bytecount off, Charcount charoff); @@ -1707,17 +1711,17 @@ Charcount charoff, Bytecount len, Charcount charlen, Eistring *eistr2); - int eicmp_c (Eistring *eistr, Char_ASCII *c_string); + int eicmp_c (Eistring *eistr, Ascbyte *c_string); int eicmp_off_c (Eistring *eistr, Bytecount off, Charcount charoff, - Bytecount len, Charcount charlen, Char_ASCII *c_string); - int eicasecmp_c (Eistring *eistr, Char_ASCII *c_string); + Bytecount len, Charcount charlen, Ascbyte *c_string); + int eicasecmp_c (Eistring *eistr, Ascbyte *c_string); int eicasecmp_off_c (Eistring *eistr, Bytecount off, Charcount charoff, Bytecount len, Charcount charlen, - Char_ASCII *c_string); - int eicasecmp_i18n_c (Eistring *eistr, Char_ASCII *c_string); + Ascbyte *c_string); + int eicasecmp_i18n_c (Eistring *eistr, Ascbyte *c_string); int eicasecmp_i18n_off_c (Eistring *eistr, Bytecount off, Charcount charoff, Bytecount len, Charcount charlen, - Char_ASCII *c_string); + Ascbyte *c_string); ********************************************** @@ -1899,7 +1903,7 @@ /* We don't have realloc, so ALLOCA() more space and copy the \ data into it. */ \ Ibyte *ei1oldeidata = (ei)->data_; \ - (ei)->data_ = (Ibyte *) ALLOCA (ei1newsize); \ + (ei)->data_ = alloca_ibytes (ei1newsize); \ if (ei1oldeidata) \ memcpy ((ei)->data_, ei1oldeidata, ei1oldeibytelen + 1); \ } \ @@ -1916,27 +1920,6 @@ memcpy ((ei)->data_, data, (ei)->bytelen_); \ } while (0) -#ifdef ERROR_CHECK_TEXT -#define EI_ASSERT_ASCII(ptr, len) \ -do { \ - int ei5; \ - const Char_ASCII *ei5ptr = (ptr); \ - int ei5len = (len); \ - \ - for (ei5 = 0; ei5 < ei5len; ei5++) \ - assert (ei5ptr[ei5] >= 0x00 && ei5ptr[ei5] < 0x7F); \ -} while (0) -#define EI_ASSERT_ASCIIZ(ptr) \ -do { \ - const Char_ASCII *ei5p1 = (ptr); \ - EI_ASSERT_ASCII (ei5p1, strlen (ei5p1)); \ -} while (0) -#else -#define EI_ASSERT_ASCII(ptr, len) -#define EI_ASSERT_ASCIIZ(ptr) -#endif - - /* ----- Initialization ----- */ #define eicpy_ei(ei, eicpy) \ @@ -2001,18 +1984,18 @@ #define eicpy_c(ei, c_string) \ do { \ - const Char_ASCII *ei4 = (c_string); \ + const Ascbyte *ei4 = (c_string); \ \ - EI_ASSERT_ASCIIZ (ei4); \ + ASSERT_ASCTEXT_ASCII (ei4); \ eicpy_ext (ei, ei4, Qbinary); \ } while (0) #define eicpy_c_len(ei, c_string, c_len) \ do { \ - const Char_ASCII *ei6 = (c_string); \ + const Ascbyte *ei6 = (c_string); \ int ei6len = (c_len); \ \ - EI_ASSERT_ASCII (ei6, ei6len); \ + ASSERT_ASCTEXT_ASCII_LEN (ei6, ei6len); \ eicpy_ext_len (ei, ei6, ei6len, Qbinary); \ } while (0) @@ -2078,7 +2061,7 @@ assert (ei23fmt == FORMAT_DEFAULT); \ \ *ei23lenout = (eistr)->bytelen_; \ - *ei23ptrout = alloca_array (Ibyte, (eistr)->bytelen_ + 1); \ + *ei23ptrout = alloca_ibytes ((eistr)->bytelen_ + 1); \ memcpy (*ei23ptrout, (eistr)->data_, (eistr)->bytelen_ + 1); \ } while (0) @@ -2114,7 +2097,7 @@ \ (ei)->max_size_allocated_ = \ eifind_large_enough_buffer (0, (ei)->bytelen_ + 1); \ - ei13newdata = (Ibyte *) ALLOCA ((ei)->max_size_allocated_); \ + ei13newdata = alloca_ibytes ((ei)->max_size_allocated_); \ memcpy (ei13newdata, (ei)->data_, (ei)->bytelen_ + 1); \ xfree ((ei)->data_, Ibyte *); \ (ei)->data_ = ei13newdata; \ @@ -2122,7 +2105,7 @@ \ if ((ei)->extdata_) \ { \ - Extbyte *ei13newdata = (Extbyte *) ALLOCA ((ei)->extlen_ + 2); \ + Extbyte *ei13newdata = alloca_extbytes ((ei)->extlen_ + 2); \ \ memcpy (ei13newdata, (ei)->extdata_, (ei)->extlen_); \ /* Double null-terminate in case of Unicode data */ \ @@ -2226,10 +2209,10 @@ #define eicat_c(ei, c_string) \ do { \ - const Char_ASCII *ei15 = (c_string); \ + const Ascbyte *ei15 = (c_string); \ int ei15len = strlen (ei15); \ \ - EI_ASSERT_ASCII (ei15, ei15len); \ + ASSERT_ASCTEXT_ASCII_LEN (ei15, ei15len); \ eicat_1 (ei, ei15, ei15len, \ bytecount_to_charcount ((Ibyte *) ei15, ei15len)); \ } while (0) @@ -2305,9 +2288,9 @@ #define eisub_c(ei, off, charoff, len, charlen, c_string) \ do { \ - const Char_ASCII *ei20 = (c_string); \ + const Ascbyte *ei20 = (c_string); \ int ei20len = strlen (ei20); \ - EI_ASSERT_ASCII (ei20, ei20len); \ + ASSERT_ASCTEXT_ASCII_LEN (ei20, ei20len); \ eisub_1 (ei, off, charoff, len, charlen, ei20, ei20len, -1); \ } while (0) @@ -2446,7 +2429,7 @@ do { \ int ei11new_allocmax = (ei)->charlen_ * MAX_ICHAR_LEN + 1; \ Ibyte *ei11storage = \ - (Ibyte *) alloca_array (Ibyte, ei11new_allocmax); \ + (Ibyte *) alloca_ibytes (ei11new_allocmax); \ int ei11newlen = eistr_casefiddle_1 ((ei)->data_, (ei)->bytelen_, \ ei11storage, downp); \ \ @@ -2525,9 +2508,27 @@ Typical use is - TO_EXTERNAL_FORMAT (DATA, (ptr, len), - LISP_BUFFER, buffer, - Qfile_name); + TO_EXTERNAL_FORMAT (LISP_STRING, str, C_STRING_MALLOC, ptr, Qfile_name); + + which means that the contents of the lisp string `str' are written + to a malloc'ed memory area which will be pointed to by `ptr', after the + function returns. The conversion will be done using the `file-name' + coding system (which will be controlled by the user indirectly by + setting or binding the variable `file-name-coding-system'). + + Some sources and sinks require two C variables to specify. We use + some preprocessor magic to allow different source and sink types, and + even different numbers of arguments to specify different types of + sources and sinks. + + So we can have a call that looks like + + TO_INTERNAL_FORMAT (DATA, (ptr, len), + MALLOC, (ptr, len), + coding_system); + + The parenthesized argument pairs are required to make the + preprocessor magic work. NOTE: GC is inhibited during the entire operation of these macros. This is because frequently the data to be converted comes from strings but @@ -2552,6 +2553,12 @@ When specifying the sink, use lvalues, since the macro will assign to them, except when the sink is an lstream or a lisp buffer. + For the sink types `ALLOCA' and `C_STRING_ALLOCA', the resulting text is + stored in a stack-allocated buffer, which is automatically freed on + returning from the function. However, the sink types `MALLOC' and + `C_STRING_MALLOC' return `xmalloc()'ed memory. The caller is responsible + for freeing this memory using `xfree()'. + The macros accept the kinds of sources and sinks appropriate for internal and external data representation. See the type_checking_assert macros below for the actual allowed types. @@ -2607,7 +2614,45 @@ behavior may change in the future, and you cannot rely on this -- the most you can rely on is that sink data in Unicode format will have two terminating nulls, which combine to form one Unicode null - character. */ + character. + + NOTE: You might ask, why are these not written as functions that + *RETURN* the converted string, since that would allow them to be used + much more conveniently, without having to constantly declare temporary + variables? The answer is that in fact I originally did write the + routines that way, but that required either + + (a) calling alloca() inside of a function call, or + (b) using expressions separated by commas and a global temporary variable, or + (c) using the GCC extension ({ ... }). + + Turned out that all of the above had bugs, all caused by GCC (hence the + comments about "those GCC wankers" and "ream gcc up the ass"). As for + (a), some versions of GCC (especially on Intel platforms), which had + buggy implementations of alloca() that couldn't handle being called + inside of a function call -- they just decremented the stack right in the + middle of pushing args. Oops, crash with stack trashing, very bad. (b) + was an attempt to fix (a), and that led to further GCC crashes, esp. when + you had two such calls in a single subexpression, because GCC couldn't be + counted upon to follow even a minimally reasonable order of execution. + True, you can't count on one argument being evaluated before another, but + GCC would actually interleave them so that the temp var got stomped on by + one while the other was accessing it. So I tried (c), which was + problematic because that GCC extension has more bugs in it than a + termite's nest. + + So reluctantly I converted to the current way. Now, that was awhile ago + (c. 1994), and it appears that the bug involving alloca in function calls + has long since been fixed. More recently, I defined the new-dfc routines + down below, which DO allow exactly such convenience of returning your + args rather than store them in temp variables, and I also wrote a + configure check to see whether alloca() causes crashes inside of function + calls, and if so use the portable alloca() implementation in alloca.c. + If you define TEST_NEW_DFC, the old routines get written in terms of the + new ones, and I've had a beta put out with this on and it appeared to + this appears to cause no problems -- so we should consider + switching, and feel no compunctions about writing further such function- + like alloca() routines in lieu of statement-like ones. --ben */ #define TO_EXTERNAL_FORMAT(source_type, source, sink_type, sink, codesys) \ do { \ @@ -2802,24 +2847,24 @@ #define DFC_ALLOCA_USE_CONVERTED_DATA(sink) do { \ void * dfc_sink_ret = ALLOCA (dfc_sink.data.len + 2); \ memcpy (dfc_sink_ret, dfc_sink.data.ptr, dfc_sink.data.len + 2); \ - ((dfc_aliasing_voidpp) &(DFC_CPP_CAR sink))->p = dfc_sink_ret; \ + VOIDP_CAST (DFC_CPP_CAR sink) = dfc_sink_ret; \ (DFC_CPP_CDR sink) = dfc_sink.data.len; \ } while (0) #define DFC_MALLOC_USE_CONVERTED_DATA(sink) do { \ void * dfc_sink_ret = xmalloc (dfc_sink.data.len + 2); \ memcpy (dfc_sink_ret, dfc_sink.data.ptr, dfc_sink.data.len + 2); \ - ((dfc_aliasing_voidpp) &(DFC_CPP_CAR sink))->p = dfc_sink_ret; \ + VOIDP_CAST (DFC_CPP_CAR sink) = dfc_sink_ret; \ (DFC_CPP_CDR sink) = dfc_sink.data.len; \ } while (0) #define DFC_C_STRING_ALLOCA_USE_CONVERTED_DATA(sink) do { \ void * dfc_sink_ret = ALLOCA (dfc_sink.data.len + 2); \ memcpy (dfc_sink_ret, dfc_sink.data.ptr, dfc_sink.data.len + 2); \ - ((dfc_aliasing_voidpp) &(sink))->p = dfc_sink_ret; \ + VOIDP_CAST (sink) = dfc_sink_ret; \ } while (0) #define DFC_C_STRING_MALLOC_USE_CONVERTED_DATA(sink) do { \ void * dfc_sink_ret = xmalloc (dfc_sink.data.len + 2); \ memcpy (dfc_sink_ret, dfc_sink.data.ptr, dfc_sink.data.len + 2); \ - ((dfc_aliasing_voidpp) &(sink))->p = dfc_sink_ret; \ + VOIDP_CAST (sink) = dfc_sink_ret; \ } while (0) #define DFC_LISP_STRING_USE_CONVERTED_DATA(sink) \ sink = make_string ((Ibyte *) dfc_sink.data.ptr, dfc_sink.data.len) @@ -2879,21 +2924,46 @@ #define C_STRING_TO_EXTERNAL_MALLOC(in, out, codesys) \ do { * (Extbyte **) &(out) = \ NEW_C_STRING_TO_EXTERNAL_MALLOC (in, codesys); } while (0) +#define SIZED_C_STRING_TO_EXTERNAL_MALLOC(in, inlen, out, codesys) \ + do { * (Extbyte **) &(out) = \ + NEW_SIZED_C_STRING_TO_EXTERNAL_MALLOC (in, inlen, codesys); } \ + while (0) #define EXTERNAL_TO_C_STRING_MALLOC(in, out, codesys) \ do { * (Ibyte **) &(out) = \ NEW_EXTERNAL_TO_C_STRING_MALLOC (in, codesys); } while (0) +#define SIZED_EXTERNAL_TO_C_STRING_MALLOC(in, inlen, out, codesys) \ + do { * (Ibyte **) &(out) = \ + NEW_SIZED_EXTERNAL_TO_C_STRING_MALLOC (in, inlen, codesys); } \ + while (0) #define LISP_STRING_TO_EXTERNAL_MALLOC(in, out, codesys) \ do { * (Extbyte **) &(out) = \ NEW_LISP_STRING_TO_EXTERNAL_MALLOC (in, codesys); } while (0) #else #define C_STRING_TO_EXTERNAL_MALLOC(in, out, codesys) \ TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, codesys) +#define SIZED_C_STRING_TO_EXTERNAL_MALLOC(in, inlen, out, codesys) \ + TO_EXTERNAL_FORMAT (DATA, (in, inlen), C_STRING_MALLOC, out, codesys) #define EXTERNAL_TO_C_STRING_MALLOC(in, out, codesys) \ TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, codesys) +#define SIZED_EXTERNAL_TO_C_STRING_MALLOC(in, inlen, out, codesys) \ + TO_INTERNAL_FORMAT (DATA, (in, inlen), C_STRING_MALLOC, out, codesys) #define LISP_STRING_TO_EXTERNAL_MALLOC(in, out, codesys) \ TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_MALLOC, out, codesys) #endif /* TEST_NEW_DFC */ +#define C_STRING_TO_SIZED_EXTERNAL_MALLOC(in, out, outlen, codesys) \ + TO_EXTERNAL_FORMAT (C_STRING, in, MALLOC, (out, outlen), codesys) +#define SIZED_C_STRING_TO_SIZED_EXTERNAL_MALLOC(in, inlen, out, outlen, \ + codesys) \ + TO_EXTERNAL_FORMAT (DATA, (in, inlen), MALLOC, (out, outlen), codesys) +#define EXTERNAL_TO_SIZED_C_STRING_MALLOC(in, out, outlen, codesys) \ + TO_INTERNAL_FORMAT (C_STRING, in, MALLOC, (out, outlen), codesys) +#define SIZED_EXTERNAL_TO_SIZED_C_STRING_MALLOC(in, inlen, out, outlen, \ + codesys) \ + TO_INTERNAL_FORMAT (DATA, (in, inlen), MALLOC, (out, outlen), codesys) +#define LISP_STRING_TO_SIZED_EXTERNAL_MALLOC(in, out, outlen, codesys) \ + TO_EXTERNAL_FORMAT (LISP_STRING, in, MALLOC, (out, outlen), codesys) + enum new_dfc_src_type { DFC_EXTERNAL, @@ -2906,11 +2976,13 @@ MODULE_API void *new_dfc_convert_malloc (const void *src, Bytecount src_size, enum new_dfc_src_type type, Lisp_Object codesys); -MODULE_API void *new_dfc_convert_alloca (const char *srctext, void *alloca_data); -MODULE_API Bytecount new_dfc_convert_size (const char *srctext, const void *src, +MODULE_API Bytecount new_dfc_convert_size (const char *srctext, + const void *src, Bytecount src_size, enum new_dfc_src_type type, Lisp_Object codesys); +MODULE_API void *new_dfc_convert_copy_data (const char *srctext, + void *alloca_data); END_C_DECLS @@ -2932,7 +3004,7 @@ could be inside of a function call. */ #define NEW_DFC_CONVERT_1_ALLOCA(src, src_size, type, codesys) \ - new_dfc_convert_alloca \ + new_dfc_convert_copy_data \ (#src, ALLOCA_FUNCALL_OK (new_dfc_convert_size (#src, src, src_size, \ type, codesys))) @@ -2959,15 +3031,76 @@ (Extbyte *) new_dfc_convert_malloc (LISP_TO_VOID (src), -1, \ DFC_LISP_STRING, codesys) -/* Standins for various encodings, until we know them better */ +/* Standins for various encodings. */ +#ifdef WEXTTEXT_IS_WIDE +#define Qcommand_argument_encoding Qmswindows_unicode +#define Qenvironment_variable_encoding Qmswindows_unicode +#else #define Qcommand_argument_encoding Qnative #define Qenvironment_variable_encoding Qnative +#endif #define Qunix_host_name_encoding Qnative #define Qunix_service_name_encoding Qnative #define Qmswindows_host_name_encoding Qmswindows_multibyte #define Qmswindows_service_name_encoding Qmswindows_multibyte -/* Standins for various X encodings, until we know them better. +/* Wexttext functions. The type of Wexttext is selected at compile time + and will sometimes be wchar_t, sometimes char. */ + +int wcscmp_ascii (const wchar_t *s1, const Ascbyte *s2); +int wcsncmp_ascii (const wchar_t *s1, const Ascbyte *s2, Charcount len); + +#ifdef WEXTTEXT_IS_WIDE /* defined under MS Windows i.e. WIN32_NATIVE */ +#define WEXTTEXT_ZTERM_SIZE sizeof (wchar_t) +/* Extra indirection needed in case of manifest constant as arg */ +#define WEXTSTRING_1(arg) L##arg +#define WEXTSTRING(arg) WEXTSTRING_1(arg) +#define wext_strlen wcslen +#define wext_strcmp wcscmp +#define wext_strncmp wcsncmp +#define wext_strcmp_ascii wcscmp_ascii +#define wext_strncmp_ascii wcsncmp_ascii +#define wext_strcpy wcscpy +#define wext_strncpy wcsncpy +#define wext_strchr wcschr +#define wext_strrchr wcsrchr +#define wext_strdup wcsdup +#define wext_atol(str) wcstol (str, 0, 10) +#define wext_sprintf wsprintfW /* Huh? both wsprintfA and wsprintfW? */ +#define wext_getenv _wgetenv +#define build_wext_string(str, cs) build_ext_string ((Extbyte *) str, cs) +#define WEXTTEXT_TO_8_BIT(arg) WEXTTEXT_TO_MULTIBYTE(arg) +#ifdef WIN32_NATIVE +int XCDECL wext_retry_open (const Wexttext *path, int oflag, ...); +#else +#error Cannot handle Wexttext yet on this system +#endif +#define wext_access _waccess +#define wext_stat _wstat +#else +#define WEXTTEXT_ZTERM_SIZE sizeof (char) +#define WEXTSTRING(arg) arg +#define wext_strlen strlen +#define wext_strcmp strcmp +#define wext_strncmp strncmp +#define wext_strcmp_ascii strcmp +#define wext_strncmp_ascii strncmp +#define wext_strcpy strcpy +#define wext_strncpy strncpy +#define wext_strchr strchr +#define wext_strrchr strrchr +#define wext_strdup xstrdup +#define wext_atol(str) atol (str) +#define wext_sprintf sprintf +#define wext_getenv getenv +#define build_wext_string build_ext_string +#define wext_retry_open retry_open +#define wext_access access +#define wext_stat stat +#define WEXTTEXT_TO_8_BIT(arg) ((Extbyte *) arg) +#endif + +/* Standins for various X encodings. About encodings in X: @@ -3042,6 +3175,11 @@ #define Qx_display_name_encoding Qx_hpc_encoding #define Qx_xpm_data_encoding Qx_hpc_encoding +/* !!#### Verify these! */ +#define Qxt_widget_arg_encoding Qnative +#define Qdt_dnd_encoding Qnative +#define Qoffix_dnd_encoding Qnative + /* RedHat 6.2 contains a locale called "Francais" with the C-cedilla encoded in ISO2022! */ #define Qlocale_name_encoding Qctext
--- a/src/toolbar.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/toolbar.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,7 +1,7 @@ /* Generic toolbar implementation. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1995, 1996, 2003 Ben Wing. + Copyright (C) 1995, 1996, 2003, 2004 Ben Wing. Copyright (C) 1996 Chuck Thompson. This file is part of XEmacs. @@ -778,8 +778,11 @@ if (frame_size_changed) { int width, height; - pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), - &width, &height); + if (!window_system_pixelated_geometry (wrap_frame (f))) + pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), + &width, &height); + else + width = FRAME_PIXWIDTH (f), height = FRAME_PIXHEIGHT (f); if (!HAS_FRAMEMETH_P (f, set_frame_size)) change_frame_size (f, height, width, 0); else
--- a/src/ui-byhand.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/ui-byhand.c Thu Nov 04 23:08:28 2004 +0000 @@ -348,7 +348,7 @@ wtaerror ("Object is not a GtkCurve", curve); } - vector = (gfloat *) ALLOCA (sizeof (gfloat) * XINT (length)); + vector = alloca_array (gfloat, XINT (length)); gtk_curve_get_vector (GTK_CURVE (XGTK_OBJECT (curve)->object), XINT (length), vector); lisp_vector = make_vector (XINT (length), Qnil); @@ -380,7 +380,7 @@ wtaerror ("Object is not a GtkCurve", curve); } - c_vector = (gfloat *) ALLOCA (sizeof (gfloat) * vec_length); + c_vector = alloca_array (gfloat, vec_length); for (i = 0; i < vec_length; i++) {
--- a/src/ui-gtk.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/ui-gtk.c Thu Nov 04 23:08:28 2004 +0000 @@ -609,18 +609,17 @@ if (!NILP (args)) { - Lisp_Object tail = Qnil; Lisp_Object value = args; Lisp_Object type = Qnil; - EXTERNAL_LIST_LOOP (tail, value) + EXTERNAL_LIST_LOOP_2 (elt, value) { GtkType the_type; Lisp_Object marshaller_type = Qnil; - CHECK_SYMBOL (XCAR (tail)); + CHECK_SYMBOL (elt); - type = Fsymbol_name (XCAR (tail)); + type = Fsymbol_name (elt); the_type = gtk_type_from_name ((char *) XSTRING_DATA (type)); @@ -728,24 +727,25 @@ if (!NILP (args)) { - Lisp_Object tail = Qnil; Lisp_Object value = args; CHECK_LIST (args); n_args = 0; /* First we convert all of the arguments from Lisp to GtkArgs */ - EXTERNAL_LIST_LOOP (tail, value) - { - the_args[n_args].type = XFFI (func)->args[n_args]; + { + EXTERNAL_LIST_LOOP_2 (elt, value) + { + the_args[n_args].type = XFFI (func)->args[n_args]; - if (lisp_to_gtk_type (XCAR (tail), &the_args[n_args])) - { - /* There was some sort of an error */ - gui_error ("Error converting arguments", args); - } - n_args++; - } + if (lisp_to_gtk_type (elt, &the_args[n_args])) + { + /* There was some sort of an error */ + gui_error ("Error converting arguments", args); + } + n_args++; + } + } } /* Now we need to tack on space for a return value, if they have
--- a/src/undo.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/undo.c Thu Nov 04 23:08:28 2004 +0000 @@ -545,8 +545,6 @@ void vars_of_undo (void) { - reinit_vars_of_undo (); - pending_boundary = Qnil; staticpro (&pending_boundary); last_undo_buffer = Qnil;
--- a/src/unexnt.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/unexnt.c Thu Nov 04 23:08:28 2004 +0000 @@ -194,13 +194,13 @@ ".exe" extension...patch them up if they don't. */ qxestrcpy (in_filename, old_name); ptr = in_filename + qxestrlen (in_filename) - 4; - if (qxestrcmp_c (ptr, ".exe")) - qxestrcat_c (in_filename, ".exe"); + if (qxestrcmp_ascii (ptr, ".exe")) + qxestrcat_ascii (in_filename, ".exe"); qxestrcpy (out_filename, new_name); ptr = out_filename + qxestrlen (out_filename) - 4; - if (qxestrcmp_c (ptr, ".exe")) - qxestrcat_c (out_filename, ".exe"); + if (qxestrcmp_ascii (ptr, ".exe")) + qxestrcat_ascii (out_filename, ".exe"); stdout_out ("Dumping from %s\n", in_filename); stdout_out (" to %s\n", out_filename); @@ -222,7 +222,7 @@ /* The size of the dumped executable is the size of the original executable plus the size of the heap and the size of the .bss section. */ heap_index_in_executable = (unsigned long) - round_to_next ((UChar_Binary *) in_file.size, get_allocation_unit ()); + round_to_next ((Rawbyte *) in_file.size, get_allocation_unit ()); size = heap_index_in_executable + get_committed_heap_size () + bss_size; if (!open_output_file (&out_file, out_filename, size)) { @@ -249,7 +249,7 @@ pfnCheckSumMappedFile_t pfnCheckSumMappedFile; dos_header = (PIMAGE_DOS_HEADER) out_file.file_base; - nt_header = (PIMAGE_NT_HEADERS) ((UChar_Binary *) dos_header + + nt_header = (PIMAGE_NT_HEADERS) ((Rawbyte *) dos_header + dos_header->e_lfanew); nt_header->OptionalHeader.CheckSum = 0; @@ -333,7 +333,7 @@ PIMAGE_DOS_HEADER dos_header; PIMAGE_NT_HEADERS nt_header; PIMAGE_SECTION_HEADER section, data_section; - UChar_Binary *ptr; + Rawbyte *ptr; int i; dos_header = (PIMAGE_DOS_HEADER) p_infile->file_base; @@ -363,26 +363,26 @@ for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) { #ifndef DUMP_SEPARATE_SECTION - if (!qxestrcmp_c (section->Name, ".bss")) + if (!qxestrcmp_ascii (section->Name, ".bss")) { extern int my_ebss; /* From lastfile.c */ - ptr = (UChar_Binary *) nt_header->OptionalHeader.ImageBase + + ptr = (Rawbyte *) nt_header->OptionalHeader.ImageBase + section->VirtualAddress; bss_start = ptr; - bss_size = (UChar_Binary*) &my_ebss - (UChar_Binary*) bss_start; + bss_size = (Rawbyte*) &my_ebss - (Rawbyte*) bss_start; } - if (!qxestrcmp_c (section->Name, ".data")) + if (!qxestrcmp_ascii (section->Name, ".data")) #else - if (!qxestrcmp_c (section->Name, "xdata")) + if (!qxestrcmp_ascii (section->Name, "xdata")) #endif { - extern Char_Binary my_edata[]; /* From lastfile.c */ + extern Rawbyte my_edata[]; /* From lastfile.c */ /* The .data section. */ data_section = section; - ptr = (UChar_Binary *) nt_header->OptionalHeader.ImageBase + + ptr = (Rawbyte *) nt_header->OptionalHeader.ImageBase + section->VirtualAddress; data_start_va = ptr; data_start_file = section->PointerToRawData; @@ -422,7 +422,7 @@ get_bss_info_from_map_file (p_infile, &ptr, &bss_size); bss_start = ptr + nt_header->OptionalHeader.ImageBase + data_section->VirtualAddress; - bss_size = (UChar_Binary *) &my_ebss - (UChar_Binary *) bss_start; + bss_size = (Rawbyte *) &my_ebss - (Rawbyte *) bss_start; } #else bss_size = 0; @@ -443,11 +443,11 @@ copy_executable_and_dump_data_section (file_data *p_infile, file_data *p_outfile) { - UChar_Binary *data_file, *data_va; + Rawbyte *data_file, *data_va; unsigned long size, index; /* Get a pointer to where the raw data should go in the executable file. */ - data_file = (UChar_Binary *) p_outfile->file_base + data_start_file; + data_file = (Rawbyte *) p_outfile->file_base + data_start_file; /* Get a pointer to the raw data in our address space. */ data_va = data_start_va; @@ -463,8 +463,8 @@ DUMP_MSG (("Dumping data section...\n")); DUMP_MSG (("\t0x%08x Address in process.\n", data_va)); DUMP_MSG (("\t0x%08x Offset in output file.\n", - (UChar_Binary *) data_file - - (UChar_Binary *) p_outfile->file_base)); + (Rawbyte *) data_file - + (Rawbyte *) p_outfile->file_base)); DUMP_MSG (("\t0x%08x Size in bytes.\n", size)); memcpy (data_file, data_va, size); @@ -474,14 +474,14 @@ DUMP_MSG (("\t0x%08x Offset in input file.\n", index)); DUMP_MSG (("\t0x%08x Offset in output file.\n", index)); DUMP_MSG (("\t0x%08x Size in bytes.\n", size)); - memcpy ((UChar_Binary *) p_outfile->file_base + index, - (UChar_Binary *) p_infile->file_base + index, size); + memcpy ((Rawbyte *) p_outfile->file_base + index, + (Rawbyte *) p_infile->file_base + index, size); } static void dump_bss_and_heap (file_data *UNUSED (p_infile), file_data *p_outfile) { - UChar_Binary *heap_data; + Rawbyte *heap_data; unsigned long size, index; DUMP_MSG (("Dumping heap onto end of executable...\n")); @@ -505,7 +505,7 @@ DUMP_MSG (("\t0x%08x BSS start in process.\n", bss_start)); DUMP_MSG (("\t0x%08x BSS offset in executable.\n", index)); DUMP_MSG (("\t0x%08x BSS size in bytes.\n", size)); - memcpy ((UChar_Binary *) p_outfile->file_base + index, bss_start, size); + memcpy ((Rawbyte *) p_outfile->file_base + index, bss_start, size); #endif }
--- a/src/unicode.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/unicode.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,5 +1,5 @@ /* Code to handle Unicode conversion. - Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003, 2004 Ben Wing. This file is part of XEmacs. @@ -43,6 +43,126 @@ #include "sysfile.h" +/* For more info about how Unicode works under Windows, see intl-win32.c. */ + +/* Info about Unicode translation tables [ben]: + + FORMAT: + ------- + + We currently use the following format for tables: + + If dimension == 1, to_unicode_table is a 96-element array of ints + (Unicode code points); else, it's a 96-element array of int * pointers, + each of which points to a 96-element array of ints. If no elements in a + row have been filled in, the pointer will point to a default empty + table; that way, memory usage is more reasonable but lookup still fast. + + -- If from_unicode_levels == 1, from_unicode_table is a 256-element + array of shorts (octet 1 in high byte, octet 2 in low byte; we don't + store Ichars directly to save space). + + -- If from_unicode_levels == 2, from_unicode_table is a 256-element + array of short * pointers, each of which points to a 256-element array + of shorts. + + -- If from_unicode_levels == 3, from_unicode_table is a 256-element + array of short ** pointers, each of which points to a 256-element array + of short * pointers, each of which points to a 256-element array of + shorts. + + -- If from_unicode_levels == 4, same thing but one level deeper. + + Just as for to_unicode_table, we use default tables to fill in all + entries with no values in them. + + #### An obvious space-saving optimization is to use variable-sized + tables, where each table instead of just being a 256-element array, is a + structure with a start value, an end value, and a variable number of + entries (END - START + 1). Only 8 bits are needed for END and START, + and could be stored at the end to avoid alignment problems. However, + before charging off and implementing this, we need to consider whether + it's worth it: + + (1) Most tables will be highly localized in which code points are + defined, heavily reducing the possible memory waste. Before doing any + rewriting, write some code to see how much memory is actually being + wasted (i.e. ratio of empty entries to total # of entries) and only + start rewriting if it's unacceptably high. You have to check over all + charsets. + + (2) Since entries are usually added one at a time, you have to be very + careful when creating the tables to avoid realloc()/free() thrashing in + the common case when you are in an area of high localization and are + going to end up using most entries in the table. You'd certainly want + to allow only certain sizes, not arbitrary ones (probably powers of 2, + where you want the entire block including the START/END values to fit + into a power of 2, minus any malloc overhead if there is any -- there's + none under gmalloc.c, and probably most system malloc() functions are + quite smart nowadays and also have no overhead). You could optimize + somewhat during the in-C initializations, because you can compute the + actual usage of various tables by scanning the entries you're going to + add in a separate pass before adding them. (You could actually do the + same thing when entries are added on the Lisp level by making the + assumption that all the entries will come in one after another before + any use is made of the data. So as they're coming in, you just store + them in a big long list, and the first time you need to retrieve an + entry, you compute the whole table at once.) You'd still have to deal + with the possibility of later entries coming in, though. + + (3) You do lose some speed using START/END values, since you need a + couple of comparisons at each level. This could easily make each single + lookup become 3-4 times slower. The Unicode book considers this a big + issue, and recommends against variable-sized tables for this reason; + however, they almost certainly have in mind applications that primarily + involve conversion of large amounts of data. Most Unicode strings that + are translated in XEmacs are fairly small. The only place where this + might matter is in loading large files -- e.g. a 3-megabyte + Unicode-encoded file. So think about this, and maybe do a trial + implementation where you don't worry too much about the intricacies of + (2) and just implement some basic "multiply by 1.5" trick or something + to do the resizing. There is a very good FAQ on Unicode called + something like the Linux-Unicode How-To (it should be part of the Linux + How-To's, I think), that lists the url of a guy with a whole bunch of + unicode files you can use to stress-test your implementations, and he's + highly likely to have a good multi-megabyte Unicode-encoded file (with + normal text in it -- if you created your own just by creating repeated + strings of letters and numbers, you probably wouldn't get accurate + results). + + INITIALIZATION: + --------------- + + There are advantages and disadvantages to loading the tables at + run-time. + + Advantages: + + They're big, and it's very fast to recreate them (a fraction of a second + on modern processors). + + Disadvantages: + + (1) User-defined charsets: It would be inconvenient to require all + dumped user-defined charsets to be reloaded at init time. + + (2) Starting up in a non-ISO-8859-1 directory. If we load at run-time, + we don't load the tables until after we've parsed the current + directories, and we run into a real bootstrapping problem, if the + directories themselves are non-ISO-8859-1. This is potentially fixable + once we switch to using Unicode internally, so we don't have to do any + conversion (other than the automatic kind, e.g. UTF-16 to UTF-8). + + NB With run-time loading, we load in init-mule-at-startup, in + mule-cmds.el. This is called from startup.el, which is quite late in + the initialization process -- but data-directory isn't set until then. + With dump-time loading, you still can't dump in a Japanese directory + (again, until we move to Unicode internally), but this is not such an + imposition. + + +*/ + /* #### WARNING! The current sledgehammer routines have a fundamental problem in that they can't handle two characters mapping to a single Unicode codepoint or vice-versa in a single charset table. @@ -62,91 +182,6 @@ /* #define SLEDGEHAMMER_CHECK_UNICODE */ - /* We currently use the following format for tables: - - If dimension == 1, to_unicode_table is a 96-element array of ints - (Unicode code points); else, it's a 96-element array of int * - pointers, each of which points to a 96-element array of ints. If no - elements in a row have been filled in, the pointer will point to a - default empty table; that way, memory usage is more reasonable but - lookup still fast. - - -- If from_unicode_levels == 1, from_unicode_table is a 256-element - array of shorts (octet 1 in high byte, octet 2 in low byte; we don't - store Ichars directly to save space). - - -- If from_unicode_levels == 2, from_unicode_table is a - 256-element array of short * pointers, each of which points to a - 256-element array of shorts. - - -- If from_unicode_levels == 3, from_unicode_table is a - 256-element array of short ** pointers, each of which points to - a 256-element array of short * pointers, each of which points to - a 256-element array of shorts. - - -- If from_unicode_levels == 4, same thing but one level deeper. - - Just as for to_unicode_table, we use default tables to fill in - all entries with no values in them. - - #### An obvious space-saving optimization is to use variable-sized - tables, where each table instead of just being a 256-element array, - is a structure with a start value, an end value, and a variable - number of entries (END - START + 1). Only 8 bits are needed for - END and START, and could be stored at the end to avoid alignment - problems. However, before charging off and implementing this, - we need to consider whether it's worth it: - - (1) Most tables will be highly localized in which code points are - defined, heavily reducing the possible memory waste. Before - doing any rewriting, write some code to see how much memory is - actually being wasted (i.e. ratio of empty entries to total # of - entries) and only start rewriting if it's unacceptably high. You - have to check over all charsets. - - (2) Since entries are usually added one at a time, you have to be - very careful when creating the tables to avoid realloc()/free() - thrashing in the common case when you are in an area of high - localization and are going to end up using most entries in the - table. You'd certainly want to allow only certain sizes, not - arbitrary ones (probably powers of 2, where you want the entire - block including the START/END values to fit into a power of 2, - minus any malloc overhead if there is any -- there's none under - gmalloc.c, and probably most system malloc() functions are quite - smart nowadays and also have no overhead). You could optimize - somewhat during the in-C initializations, because you can compute - the actual usage of various tables by scanning the entries you're - going to add in a separate pass before adding them. (You could - actually do the same thing when entries are added on the Lisp - level by making the assumption that all the entries will come in - one after another before any use is made of the data. So as - they're coming in, you just store them in a big long list, and - the first time you need to retrieve an entry, you compute the - whole table at once.) You'd still have to deal with the - possibility of later entries coming in, though. - - (3) You do lose some speed using START/END values, since you need - a couple of comparisons at each level. This could easily make - each single lookup become 3-4 times slower. The Unicode book - considers this a big issue, and recommends against variable-sized - tables for this reason; however, they almost certainly have in - mind applications that primarily involve conversion of large - amounts of data. Most Unicode strings that are translated in - XEmacs are fairly small. The only place where this might matter - is in loading large files -- e.g. a 3-megabyte Unicode-encoded - file. So think about this, and maybe do a trial implementation - where you don't worry too much about the intricacies of (2) and - just implement some basic "multiply by 1.5" trick or something to - do the resizing. There is a very good FAQ on Unicode called - something like the Linux-Unicode How-To (it should be part of the - Linux How-To's, I think), that lists the url of a guy with a - whole bunch of unicode files you can use to stress-test your - implementations, and he's highly likely to have a good - multi-megabyte Unicode-encoded file (with normal text in it -- if - you created your own just by creating repeated strings of letters - and numbers, you probably wouldn't get accurate results). - */ - /* When MULE is not defined, we may still need some Unicode support -- in particular, some Windows API's always want Unicode, and the way we've set up the Unicode encapsulation, we may as well go ahead and @@ -189,7 +224,7 @@ }; static const struct memory_description to_unicode_level_1_desc_1[] = { - { XD_STRUCT_PTR, 0, 96, &to_unicode_level_0_desc }, + { XD_BLOCK_PTR, 0, 96, &to_unicode_level_0_desc }, { XD_END } }; @@ -198,8 +233,8 @@ }; static const struct memory_description to_unicode_description_1[] = { - { XD_STRUCT_PTR, 1, 96, &to_unicode_level_0_desc }, - { XD_STRUCT_PTR, 2, 96, &to_unicode_level_1_desc }, + { XD_BLOCK_PTR, 1, 96, &to_unicode_level_0_desc }, + { XD_BLOCK_PTR, 2, 96, &to_unicode_level_1_desc }, { XD_END } }; @@ -209,6 +244,12 @@ sizeof (void *), to_unicode_description_1 }; +/* Used only for to_unicode_blank_2 */ +static const struct memory_description to_unicode_level_2_desc_1[] = { + { XD_BLOCK_PTR, 0, 96, &to_unicode_level_1_desc }, + { XD_END } +}; + static const struct memory_description from_unicode_level_0_desc_1[] = { { XD_END } }; @@ -218,7 +259,7 @@ }; static const struct memory_description from_unicode_level_1_desc_1[] = { - { XD_STRUCT_PTR, 0, 256, &from_unicode_level_0_desc }, + { XD_BLOCK_PTR, 0, 256, &from_unicode_level_0_desc }, { XD_END } }; @@ -227,7 +268,7 @@ }; static const struct memory_description from_unicode_level_2_desc_1[] = { - { XD_STRUCT_PTR, 0, 256, &from_unicode_level_1_desc }, + { XD_BLOCK_PTR, 0, 256, &from_unicode_level_1_desc }, { XD_END } }; @@ -236,7 +277,7 @@ }; static const struct memory_description from_unicode_level_3_desc_1[] = { - { XD_STRUCT_PTR, 0, 256, &from_unicode_level_2_desc }, + { XD_BLOCK_PTR, 0, 256, &from_unicode_level_2_desc }, { XD_END } }; @@ -245,10 +286,10 @@ }; static const struct memory_description from_unicode_description_1[] = { - { XD_STRUCT_PTR, 1, 256, &from_unicode_level_0_desc }, - { XD_STRUCT_PTR, 2, 256, &from_unicode_level_1_desc }, - { XD_STRUCT_PTR, 3, 256, &from_unicode_level_2_desc }, - { XD_STRUCT_PTR, 4, 256, &from_unicode_level_3_desc }, + { XD_BLOCK_PTR, 1, 256, &from_unicode_level_0_desc }, + { XD_BLOCK_PTR, 2, 256, &from_unicode_level_1_desc }, + { XD_BLOCK_PTR, 3, 256, &from_unicode_level_2_desc }, + { XD_BLOCK_PTR, 4, 256, &from_unicode_level_3_desc }, { XD_END } }; @@ -258,6 +299,12 @@ sizeof (void *), from_unicode_description_1 }; +/* Used only for from_unicode_blank_4 */ +static const struct memory_description from_unicode_level_4_desc_1[] = { + { XD_BLOCK_PTR, 0, 256, &from_unicode_level_3_desc }, + { XD_END } +}; + static Lisp_Object_dynarr *unicode_precedence_dynarr; static const struct memory_description lod_description_1[] = { @@ -383,7 +430,8 @@ } { - XCHARSET_FROM_UNICODE_TABLE (charset) = create_new_from_unicode_table (1); + XCHARSET_FROM_UNICODE_TABLE (charset) = + create_new_from_unicode_table (1); XCHARSET_FROM_UNICODE_LEVELS (charset) = 1; } } @@ -1391,7 +1439,16 @@ if ((!ignore_first_column ? sscanf (p, "%i %i%n", &cp1, &cp2, &endcount) < 2 : sscanf (p, "%i %i %i%n", &dummy, &cp1, &cp2, &endcount) < 3) - || *(p + endcount + strspn (p + endcount, " \t\n\r\f"))) + /* #### Temporary code! Cygwin newlib fucked up scanf() handling + of numbers beginning 0x0... starting in 04/2004, in an attempt + to fix another bug. A partial fix for this was put in in + 06/2004, but as of 10/2004 the value of ENDCOUNT returned in + such case is still wrong. If this gets fixed soon, remove + this code. --ben */ +#ifndef CYGWIN_SCANF_BUG + || *(p + endcount + strspn (p + endcount, " \t\n\r\f")) +#endif + ) { warn_when_safe (Qunicode, Qwarning, "Unrecognized line in translation file %s:\n%s", @@ -2405,18 +2462,8 @@ } void -reinit_vars_of_unicode (void) -{ -#ifdef MULE - init_blank_unicode_tables (); -#endif /* MULE */ -} - -void vars_of_unicode (void) { - reinit_vars_of_unicode (); - Fprovide (intern ("unicode")); #ifdef MULE @@ -2427,7 +2474,30 @@ Vdefault_unicode_precedence_list = Qnil; unicode_precedence_dynarr = Dynarr_new (Lisp_Object); - dump_add_root_struct_ptr (&unicode_precedence_dynarr, + dump_add_root_block_ptr (&unicode_precedence_dynarr, &lisp_object_dynarr_description); + + init_blank_unicode_tables (); + + /* Note that the "block" we are describing is a single pointer, and hence + we could potentially use dump_add_root_block_ptr(). However, given + the way the descriptions are written, we couldn't use them, and would + have to write new descriptions for each of the pointers below, since + we would have to make use of a description with an XD_BLOCK_ARRAY + in it. */ + + dump_add_root_block (&to_unicode_blank_1, sizeof (void *), + to_unicode_level_1_desc_1); + dump_add_root_block (&to_unicode_blank_2, sizeof (void *), + to_unicode_level_2_desc_1); + + dump_add_root_block (&from_unicode_blank_1, sizeof (void *), + from_unicode_level_1_desc_1); + dump_add_root_block (&from_unicode_blank_2, sizeof (void *), + from_unicode_level_2_desc_1); + dump_add_root_block (&from_unicode_blank_3, sizeof (void *), + from_unicode_level_3_desc_1); + dump_add_root_block (&from_unicode_blank_4, sizeof (void *), + from_unicode_level_4_desc_1); #endif /* MULE */ }
--- a/src/win32.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/win32.c Thu Nov 04 23:08:28 2004 +0000 @@ -1,5 +1,5 @@ /* Utility routines for XEmacs on Windows 9x, NT and Cygwin. - Copyright (C) 2000, 2001, 2002 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2004 Ben Wing. This file is part of XEmacs. @@ -29,6 +29,19 @@ #include "syssignal.h" #include "systime.h" + + +/* + +Info on Windows issues: + + (Info-goto-node "(internals)Interface to MS Windows") + + ------- @file{src/config.h}.in vs. @file{nt/xemacs.mak} ------- + + See @file{src/config.h.in} more more info. +*/ + /* Control conversion of upper case file names to lower case. nil means no, t means yes. */ Lisp_Object Vmswindows_downcase_file_names; @@ -54,7 +67,7 @@ WIN32_TO_LOCAL_FILE_FORMAT (filename, filename); pseudo_url = xnew_array (Ibyte, 5 + qxestrlen (filename) + 1); - qxestrcpy_c (pseudo_url, "file:"); + qxestrcpy_ascii (pseudo_url, "file:"); qxestrcat (pseudo_url, filename); /* URL's only have /, no backslash */ for (filename = pseudo_url; *filename; filename++) @@ -256,7 +269,7 @@ TSTR_TO_C_STRING (lpMsgBuf, inres); len = qxestrlen (inres); /* Messages tend to end with a period and newline */ - if (len >= 3 && !qxestrcmp_c (inres + len - 3, ".\r\n")) + if (len >= 3 && !qxestrcmp_ascii (inres + len - 3, ".\r\n")) len -= 3; result = make_string (inres, len); @@ -665,7 +678,7 @@ } void -init_win32_very_early (void) +init_win32_very_very_early (void) { mswindows_windows9x_p = GetVersion () & 0x80000000; }
--- a/src/window.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/window.c Thu Nov 04 23:08:28 2004 +0000 @@ -170,7 +170,7 @@ }; static const struct memory_description face_cachel_description_1[] = { - { XD_STRUCT_PTR, offsetof (face_cachel, merged_faces), + { XD_BLOCK_PTR, offsetof (face_cachel, merged_faces), 1, &int_dynarr_description }, { XD_LISP_OBJECT, offsetof (face_cachel, face) }, { XD_LISP_OBJECT, offsetof (face_cachel, foreground) }, @@ -241,11 +241,11 @@ { XD_LISP_OBJECT_ARRAY, offsetof (struct window, slot), size }, #include "winslots.h" - { XD_STRUCT_PTR, offsetof (struct window, face_cachels), + { XD_BLOCK_PTR, offsetof (struct window, face_cachels), 1, &face_cachel_dynarr_description }, - { XD_STRUCT_PTR, offsetof (struct window, glyph_cachels), + { XD_BLOCK_PTR, offsetof (struct window, glyph_cachels), 1, &glyph_cachel_dynarr_description }, - { XD_STRUCT_PTR, offsetof (struct window, line_start_cache), + { XD_BLOCK_PTR, offsetof (struct window, line_start_cache), 1, &line_start_cache_dynarr_description }, { XD_END } }; @@ -422,9 +422,9 @@ { XD_LISP_OBJECT, offsetof (struct window_mirror, hchild) }, { XD_LISP_OBJECT, offsetof (struct window_mirror, vchild) }, - { XD_STRUCT_PTR, offsetof (struct window_mirror, current_display_lines), + { XD_BLOCK_PTR, offsetof (struct window_mirror, current_display_lines), 1, &display_line_dynarr_description }, - { XD_STRUCT_PTR, offsetof (struct window_mirror, desired_display_lines), + { XD_BLOCK_PTR, offsetof (struct window_mirror, desired_display_lines), 1, &display_line_dynarr_description }, { XD_LISP_OBJECT, offsetof (struct window_mirror, buffer) }, @@ -5488,8 +5488,6 @@ void vars_of_window (void) { - reinit_vars_of_window (); - DEFVAR_BOOL ("scroll-on-clipped-lines", &scroll_on_clipped_lines /* *Non-nil means to scroll if point lands on a line which is clipped. */ );
--- a/src/xgccache.c Thu Nov 04 22:51:31 2004 +0000 +++ b/src/xgccache.c Thu Nov 04 23:08:28 2004 +0000 @@ -166,7 +166,9 @@ #ifdef GCCACHE_HASH - if (gethash (&gcvm, cache->table, (const void **) &cell)) + /* The intermediate cast fools gcc into not outputting strict-aliasing + complaints */ + if (gethash (&gcvm, cache->table, (const void **) (void *) &cell)) #else /* !GCCACHE_HASH */