NOTE: This patch has been committed.
This is a commit of one of my workspaces.
RECOMMEND 21.4:
I suggest the changes to README.packages, info.el, menubar-items.el,
xemacs/packages.texi, xemacs/xemacs-faq.texi and internals/internals.texi
go into 21.4. The changes in README.packages are predicated on my previous
change to configure.in, which I recommend for 21.4.
In general, the entire contents of xemacs-faq.texi and internals.texi
should be duplicated between 21.5 and 21.4.
ChangeLog addition:
2004-12-05 Ben Wing <ben(a)xemacs.org>
* README.packages:
Fix error in specifying standard package location.
Document --package-prefix.
lib-src/ChangeLog addition:
2004-12-05 Ben Wing <ben(a)xemacs.org>
* make-docfile.c (main):
* make-docfile.c (scan_c_file):
Use QXE_PATH_MAX.
lisp/ChangeLog addition:
2004-12-05 Ben Wing <ben(a)xemacs.org>
* info.el (Info-additional-search-directory-list):
Correct doc string giving example package path.
* menubar-items.el (default-menubar):
Move Prefix Rectangle command up one level.
man/ChangeLog addition:
2004-12-05 Ben Wing <ben(a)xemacs.org>
* xemacs/packages.texi (Packages):
* xemacs/packages.texi (Manually):
* xemacs/packages.texi (Building Packages):
* xemacs/packages.texi (Local.rules File):
* xemacs/packages.texi (Available Packages):
Add long form of Lisp Reference Manual to links.
Add links pointing to Lisp Reference Manual for more detailed
package discussion.
* xemacs/xemacs-faq.texi:
As per Adrian's suggestion, mention that Pitts Jarvis is deceased.
2004-12-05 Ben Wing <ben(a)xemacs.org>
* lispref/range-tables.texi (Range Tables):
* lispref/range-tables.texi (Introduction to Range Tables):
* lispref/range-tables.texi (Working With Range Tables):
Document range-table changes.
2004-12-05 Ben Wing <ben(a)xemacs.org>
* internals/internals.texi (A History of Emacs):
Update history section.
src/ChangeLog addition:
2004-12-05 Ben Wing <ben(a)xemacs.org>
* elhash.c:
* elhash.c (find_htentry):
* elhash.c (inchash_eq):
* elhash.h:
* profile.c (create_profile_tables):
* profile.c (profile_record_consing):
* profile.c (profile_record_about_to_call):
Create inchash_eq() to allow direct incrementing of hash-table
entry. Use in profile.c to try to reduce profiling overhead.
Increase initial size of profile hash tables to reduce profiling
overhead.
* buffer.c (init_initial_directory):
* device-msw.c (mswindows_handle_page_setup_dialog_box):
* dialog-msw.c (handle_directory_proc):
* dialog-msw.c (handle_file_dialog_box):
* dialog-msw.c:
* dired-msw.c (mswindows_format_file):
* dired-msw.c (mswindows_get_files):
* editfns.c (Ftemp_directory):
* event-msw.c (mswindows_wnd_proc):
* events.c (format_event_object):
* glyphs-msw.c (add_tab_item):
* glyphs-msw.c (add_tree_item):
* keymap.c (Fsingle_key_description):
* keymap.c (format_raw_keys):
* objects-msw.c (parse_font_spec):
* process-nt.c (nt_create_process):
* syswindows.h (build_tstr_string):
* syswindows.h (qxetcslen):
* text.c (eicmp_1):
* text.h (eicat_ascii):
* text.h (eicmp_ascii):
* text.h (eicpy_ascii):
* text.h (eicpy_ascii_len):
* text.h (eistr_ascii):
* text.h (eisub_ascii):
* text.h:
* unexnt.c (_start):
Rename xetcs* -> qxetcs* for consistency with qxestr*.
Rename ei*_c(_*) -> ei*_ascii(_*) since they work with ASCII-only
strings not "C strings", whatever those are. This is the last
place where "c" was incorrectly being used for "ascii".
* dialog-msw.c (handle_directory_proc):
* dialog-msw.c (handle_directory_dialog_box):
* dumper.c:
* event-msw.c (mswindows_wnd_proc):
* fileio.c (Ffile_truename):
* glyphs-gtk.c (font_instantiate):
* glyphs-x.c (font_instantiate):
* nt.c (Fmswindows_short_file_name):
* nt.c (mswindows_link):
* process-nt.c (nt_create_process):
* realpath.c (readlink_and_correct_case):
* realpath.c (qxe_realpath):
* sysdep.c (qxe_allocating_getcwd):
* sysfile.h:
* unexcw.c (unexec):
* unexnext.c (unexec):
* unexnt.c (_start):
Try to avoid differences in systems that do or do not include
final null byte in PATH_MAX. Create PATH_MAX_INTERNAL and
PATH_MAX_EXTERNAL and use them everywhere. Rewrite code in
dumper.c to avoid use of PATH_MAX. When necessary in nt.c,
use _MAX_PATH instead of MAX_PATH to be consistent with
other places.
* text.c (dfc_convert_to_internal_format):
Code to short-circuit when binary or Unicode was not working
due to EOL wrapping. Fix this code to work when either no
EOL autodetection or no CR's or LF's in the text.
* lisp.h:
* rangetab.c:
* rangetab.c (range_table_symbol_to_type):
* rangetab.c (range_table_type_to_symbol):
* rangetab.c (print_range_table):
* rangetab.c (verify_range_table):
* rangetab.c (get_range_table):
* rangetab.c (Frange_table_type):
* rangetab.c (Fcopy_range_table):
* rangetab.c (put_range_table):
* rangetab.c (Fput_range_table):
* rangetab.c (Fremove_range_table):
* rangetab.c (rangetab_type_validate):
* rangetab.c (rangetab_instantiate):
* rangetab.c (syms_of_rangetab):
* rangetab.c (structure_type_create_rangetab):
* rangetab.h:
* rangetab.h (enum range_table_type):
* regex.c (vars_of_regex):
* search.c (vars_of_search):
Implement different types of ranges (open/closed start and end).
Change default to be start-closed, end-open.
build source patch:
Diff command: bash -ci "cvs-diff --show-c-function -no-changelog "
Files affected: src/unexnt.c src/unexnext.c src/unexcw.c src/text.h src/text.c src/syswindows.h src/sysfile.h src/sysdep.c src/symbols.c src/search.c src/regex.c src/realpath.c src/rangetab.h src/rangetab.c src/profile.c src/process-nt.c src/objects-msw.c src/nt.c src/lisp.h src/keymap.c src/glyphs-x.c src/glyphs-msw.c src/glyphs-gtk.c src/fileio.c src/events.c src/event-msw.c src/eval.c src/elhash.h src/elhash.c src/editfns.c src/dumper.c src/dired-msw.c src/dialog-msw.c src/device-msw.c src/buffer.c man/xemacs/packages.texi man/lispref/range-tables.texi man/internals/internals.texi man/xemacs-faq.texi lisp/menubar-items.el lisp/info.el lib-src/make-docfile.c README.packages
cvs server: Diffing .
Index: README.packages
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/README.packages,v
retrieving revision 1.15
diff -u -p -r1.15 README.packages
--- README.packages 2003/08/27 18:06:54 1.15
+++ README.packages 2004/12/05 22:09:10
@@ -32,15 +32,15 @@ A. You can grab all the packages at once
Q. How do I tell XEmacs where to find the packages?
-A. Normally, you put the packages under $prefix/lib/packages, where
+A. Normally, you put the packages under $prefix/lib/xemacs, where
$prefix is specified using the `--prefix' parameter to `configure'.
(See `Package hierarchies' below). However, if you have the packages
somewhere else (e.g. you're a developer and are compiling the packages
yourself, and want your own private copy of everything), use the
- `--package-path' parameter, something like this:
+ `--package-prefix' parameter to `configure' to specify the directory prefix
+ under which you have placed the `xemacs-packages' and (if MULE support
+ exists) `mule-packages' directories.
- configure --package-path="~/.xemacs::/src/xemacs/site-packages:/src/xemacs/xemacs-packages:/src/xemacs/mule-packages" ...
-
Q. After installing, I want XEmacs to do `foo', but when I invoke it
(or click the toolbar button or select the menu item), nothing (or
an error) happens, and it used to work.
@@ -97,10 +97,9 @@ automatically find them at startup; howe
somewhere else (e.g. you're a developer and are compiling the packages
yourself, and want your own private copy of everything), you can tell
XEmacs specifically where to look for the packages by using the
-`--package-path' parameter to the 'configure' script. Normally, it looks
-like this:
-
-configure --package-path="~/.xemacs::/src/xemacs/site-packages:/src/xemacs/xemacs-packages:/src/xemacs/mule-packages" ...
+`--package-prefix' parameter to 'configure' to specify the directory prefix
+under which you have placed the `xemacs-packages' and (if MULE support
+exists) `mule-packages' directories.
See `configure.usage' for more info about the format of this parameter.
cvs server: Diffing dynodump
cvs server: Diffing dynodump/i386
cvs server: Diffing dynodump/ppc
cvs server: Diffing dynodump/sparc
cvs server: Diffing etc
cvs server: Diffing etc/custom
cvs server: Diffing etc/custom/example-themes
cvs server: Diffing etc/eos
cvs server: Diffing etc/idd
cvs server: Diffing etc/photos
cvs server: Diffing etc/sparcworks
cvs server: Diffing etc/tests
cvs server: Diffing etc/tests/external-widget
cvs server: Diffing etc/toolbar
cvs server: Diffing etc/unicode
cvs server: Diffing etc/unicode/ibm
cvs server: Diffing etc/unicode/mule-ucs
cvs server: Diffing etc/unicode/other
cvs server: Diffing etc/unicode/unicode-consortium
cvs server: Diffing info
cvs server: Diffing lib-src
Index: lib-src/make-docfile.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lib-src/make-docfile.c,v
retrieving revision 1.15
diff -u -p -r1.15 make-docfile.c
--- lib-src/make-docfile.c 2004/09/20 19:19:10 1.15
+++ lib-src/make-docfile.c 2004/12/05 22:09:11
@@ -220,11 +220,11 @@ main (int argc, char **argv)
/* Allow a file containing files to process, for use w/MS Windows
(where command-line length limits are more problematic) */
FILE *argfile = fopen (argv[i] + 1, READ_TEXT);
- char arg[PATH_MAX];
+ char arg[QXE_PATH_MAX];
if (!argfile)
fatal ("Unable to open argument file %s", argv[i] + 1);
- while (fgets (arg, PATH_MAX, argfile))
+ while (fgets (arg, QXE_PATH_MAX, argfile))
{
if (arg[strlen (arg) - 1] == '\n')
arg[strlen (arg) - 1] = '\0'; /* chop \n */
@@ -640,10 +640,10 @@ scan_c_file (const char *filename, const
register int defvarflag;
int minargs, maxargs;
int l = strlen (filename);
- char f[PATH_MAX];
+ char f[QXE_PATH_MAX];
/* XEmacs change: different method for checking filename extension */
- if (l > PATH_MAX - 1)
+ if (l > QXE_PATH_MAX - 1)
{
#ifdef ENAMETOOLONG
errno = ENAMETOOLONG;
cvs server: Diffing lisp
Index: lisp/info.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/info.el,v
retrieving revision 1.33
diff -u -p -r1.33 info.el
--- lisp/info.el 2004/01/21 09:54:27 1.33
+++ lisp/info.el 2004/12/05 22:09:23
@@ -392,7 +392,7 @@ This variable is ignored unless running
"*List of additional directories to search for Info documentation
files. These directories are not searched for merging the `dir'
file. An example might be something like:
-\"/usr/local/lib/xemacs/packages/lisp/calc/\""
+\"/usr/local/lib/xemacs/xemacs-packages/lisp/calc/\""
:type '(repeat directory)
:group 'info)
Index: lisp/menubar-items.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/menubar-items.el,v
retrieving revision 1.43
diff -u -p -r1.43 menubar-items.el
--- lisp/menubar-items.el 2004/11/08 14:17:03 1.43
+++ lisp/menubar-items.el 2004/12/05 22:09:24
@@ -504,13 +504,13 @@ Write your filter like this:
)
"---"
["%_Cut Rectangle" kill-rectangle]
+ ["%_Prefix Rectangle..." string-rectangle]
("Other %_Rectangles/Register"
["%_Yank Rectangle" yank-rectangle]
["Rectangle %_to Register" copy-rectangle-to-register]
["Rectangle %_from Register" insert-register]
["%_Delete Rectangle" clear-rectangle]
["%_Open Rectangle" open-rectangle]
- ["%_Prefix Rectangle..." string-rectangle]
["Rectangle %_Mousing"
(customize-set-variable 'mouse-track-rectangle-p
(not mouse-track-rectangle-p))
@@ -555,7 +555,7 @@ Write your filter like this:
["Edit Ta%_b Stops" edit-tab-stops]
)
"---"
- ("S%_pell-Check"
+ ("Spell-Chec%_k"
["%_Buffer" ispell-buffer
:active (fboundp 'ispell-buffer)]
"---"
cvs server: Diffing lisp/mule
cvs server: Diffing lisp/term
cvs server: Diffing lock
cvs server: Diffing lwlib
cvs server: Diffing man
Index: man/xemacs-faq.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/xemacs-faq.texi,v
retrieving revision 1.79
diff -u -p -r1.79 xemacs-faq.texi
--- man/xemacs-faq.texi 2004/12/05 08:48:12 1.79
+++ man/xemacs-faq.texi 2004/12/05 22:09:28
@@ -1255,9 +1255,9 @@ code in it.
There is also a port of XEmacs 19.14 that works on all recent versions
of MacOS, from 8.1 through MacOS X, by @email{pjarvis@(a)ispchannel.com,
-Pitts Jarvis}. It runs in an equivalent of TTY mode only (one single
-Macintosh window, 25 colors), but has a large number of Mac-specific
-additions. It's available at
+Pitts Jarvis} (recently deceased). It runs in an equivalent of TTY
+mode only (one single Macintosh window, 25 colors), but has a large
+number of Mac-specific additions. It's available at
@uref{http://homepage.mac.com/pjarvis/xemacs.html}.
@node Q1.1.7, Q1.1.8, Q1.1.6, Introduction
cvs server: Diffing man/internals
Index: man/internals/internals.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/internals/internals.texi,v
retrieving revision 1.54
diff -u -p -r1.54 internals.texi
--- man/internals/internals.texi 2004/11/26 07:37:51 1.54
+++ man/internals/internals.texi 2004/12/05 22:09:42
@@ -964,21 +964,34 @@ basically no changes for Xemacs.
@cindex Free Software Foundation
XEmacs is a powerful, customizable text editor and development
-environment. It began as Lucid Emacs, which was in turn derived from
-GNU Emacs, a program written by Richard Stallman of the Free Software
-Foundation. GNU Emacs dates back to the 1970's, and was modelled
-after a package called ``Emacs'', written in 1976, that was a set of
-macros on top of TECO, an old, old text editor written at MIT on the
-DEC PDP 10 under one of the earliest time-sharing operating systems,
-ITS (Incompatible Timesharing System). (ITS dates back well before
-Unix.) ITS, TECO, and Emacs were products of a group of people at MIT
-who called themselves ``hackers'', who shared an idealistic belief
-system about the free exchange of information and were fanatical in
-their devotion to and time spent with computers. (The hacker
-subculture dates back to the late 1950's at MIT and is described in
-detail in Steven Levy's book @cite{Hackers}. This book also includes
-a lot of information about Stallman himself and the development of
-Lisp, a programming language developed at MIT that underlies Emacs.)
+environment. It began in 1991 as Lucid Emacs, which was in turn
+derived from GNU Emacs, a program written by Richard Stallman of the
+Free Software Foundation. GNU Emacs dates back to 1985 and was
+modelled after Unipress Emacs, an editor written by James Gosling in
+1981 and based on a series of other "Emacs"-like editors, including
+EINE (EINE Is Not EMACS), c. 1976, by Dan Weinreb, which run on the
+MIT Lisp Machine and was the first Emacs written in Lisp; ZWEI (ZWEI
+Was EINE Initially), c. 1978, by Dan Weinreb and Mike McMahon; Multics
+Emacs, c. 1978, by Bernie Greenberg, which was written in MacLisp and
+also used Lisp as its extension language; and ZMACS, c. 1980, a direct
+descendant of ZWEI that on ran the Symbolics LM-2, LMI LispM, and
+later, TI Explorer (1983-1989). These in turn were inspired by the
+first Emacs, a package called EMACS, written in 1976 by Richard
+Stallman, Guy Steele, and Dave Moon. This was a merger of TECMAC and
+TMACS, a pair of "TECO-macro realtime editors" written by Guy Steele,
+Dave Moon, Richard Greenblatt, Charles Frankston, et al., and added a
+dynamic loader and Meta-key cmds. It ran under ITS (the Incompatible
+Timesharing System) on a DEC PDP 10 and under TWENEX on a Tops-20 and
+was written in TECO and PDP 10 assembly. ITS was one of the first
+time-sharing operating systems and dates back well before Unix. ITS,
+TECO, and Emacs were products of a group of people at MIT who called
+themselves ``hackers'', who shared an idealistic belief system about
+the free exchange of information and were fanatical in their devotion
+to and time spent with computers. (The hacker subculture dates back to
+the late 1950's at MIT and is described in detail in Steven Levy's
+book @cite{Hackers}. This book also includes a lot of information
+about Stallman himself and the development of Lisp, a programming
+language developed at MIT that underlies Emacs.)
@menu
* Through Version 18:: Unification prevails.
cvs server: Diffing man/lispref
Index: man/lispref/range-tables.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/lispref/range-tables.texi,v
retrieving revision 1.2
diff -u -p -r1.2 range-tables.texi
--- man/lispref/range-tables.texi 2001/04/12 18:22:19 1.2
+++ man/lispref/range-tables.texi 2004/12/05 22:09:44
@@ -13,12 +13,17 @@ ranges of integers.
Note that range tables have a read syntax, like this:
@example
-#s(range-table data ((-3 2) foo (5 20) bar))
+#s(range-table type start-closed-end-open data ((-3 2) foo (5 20) bar))
@end example
-This maps integers in the range (-3, 2) to @code{foo} and integers
-in the range (5, 20) to @code{bar}.
+This maps integers in the range [-3, 2) to @code{foo} and integers
+in the range [5, 20) to @code{bar}.
+By default, range tables have a @var{type} of
+@code{start-closed-end-open}. (@strong{NOTE}: This is a change from
+21.4 and earlier, where there was no @var{type} and range tables were always
+closed on both ends.) This makes them work like text properties.
+
@defun range-table-p object
Return non-@code{nil} if @var{object} is a range table.
@end defun
@@ -32,8 +37,35 @@ Return non-@code{nil} if @var{object} is
@node Introduction to Range Tables
@section Introduction to Range Tables
-@defun make-range-table
+@defun make-range-table &optional type
Make a new, empty range table.
+
+@var{type} is a symbol indicating how ranges are assumed to function
+at their ends. It can be one of
+
+@example
+SYMBOL RANGE-START RANGE-END
+------ ----------- ---------
+`start-closed-end-open' (the default) closed open
+`start-closed-end-closed' closed closed
+`start-open-end-open' open open
+`start-open-end-closed' open closed
+@end example
+
+A @dfn{closed} endpoint of a range means that the number at that end
+is included in the range. For an @dfn{open} endpoint, the number
+would not be included.
+
+For example, a closed-open range from 5 to 20 would be indicated as
+@samp{[5, 20)} where a bracket indicates a closed end and a
+parenthesis an open end, and would mean `all the numbers between 5 and
+20', including 5 but not 20. This seems a little strange at first but
+is in fact extremely common in the outside world as well as in
+computers and makes things work sensibly. For example, if I say
+"there are seven days between today and next week today", I'm
+including today but not next week today; if I included both, there
+would be eight days. Similarly, there are 15 (= 20 - 5) elements in
+the range @samp{[5, 20)}, but 16 in the range @samp{[5, 20]}.
@end defun
@defun copy-range-table range-table
@@ -49,11 +81,20 @@ themselves be copied.
This function finds value for position @var{pos} in @var{range-table}.
If there is no corresponding value, return @var{default} (defaults to
@code{nil}).
+
+@strong{NOTE}: If you are working with ranges that are closed at the
+start and open at the end (the default), and you put a value for a
+range with @var{start} equal to @var{end}, @code{get-range-table} will
+@strong{not} return that value! You would need to set @var{end} one
+greater than @var{start}.
@end defun
@defun put-range-table start end value range-table
This function sets the value for range (@var{start}, @var{end}) to be
@var{value} in @var{range-table}.
+
+@strong{NOTE}: Unless you are working with ranges that are closed at
+both ends, nothing will happen if @var{start} equals @var{end}.
@end defun
@defun remove-range-table start end range-table
cvs server: Diffing man/new-users-guide
cvs server: Diffing man/xemacs
Index: man/xemacs/packages.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/xemacs/packages.texi,v
retrieving revision 1.23
diff -u -p -r1.23 packages.texi
--- man/xemacs/packages.texi 2003/08/27 18:07:10 1.23
+++ man/xemacs/packages.texi 2004/12/05 22:09:44
@@ -15,6 +15,9 @@ packages to install; the actual installa
This gives an installer the ability to tailor an XEmacs installation for
local needs with safe removal of unnecessary code.
+@emph{NOTE}: For detailed information about how the package
+hierarchies work, @xref{Package Overview,,,lispref, XEmacs Lisp Reference Manual}.
+
@menu
* Package Terminology:: Understanding different kinds of packages.
* Installing Packages:: How to install packages.
@@ -301,7 +304,7 @@ have the form @file{name-<version>-pkg.t
a fresh install it is sufficient to untar the file at the top of the
package hierarchy.
-Note: If you are upgrading packages already installed, it's best to
+@emph{NOTE}: If you are upgrading packages already installed, it's best to
remove the old package first @ref{Removing Packages}.
For example if we are installing the @file{xemacs-base}
@@ -330,6 +333,9 @@ Or if you have GNU tar, the last step ca
tar zxvf /path/to/mule-base-1.37-pkg.tar.gz RET
@end example
+@emph{NOTE}: For more detailed information about how the package
+hierarchies work, @xref{Package Overview,,,lispref, XEmacs Lisp Reference Manual}.
+
@node Sumo, Which Packages, Manually, Installing Packages
@comment node-name, next, previous, up
@cindex sumo package install
@@ -431,7 +437,7 @@ tarballs for installation into your own
distributing to others.
For a list and description of the different @file{Makefile} targets,
-@xref{Makefile Targets,,,lispref}.
+@xref{Makefile Targets,,,lispref, XEmacs Lisp Reference Manual}.
@node Local.rules File, Available Packages, Building Packages, Packages
@comment node-name, next, previous, up
@@ -443,7 +449,7 @@ file, @file{Local.rules.template}. Simp
@file{Local.rules} and edit it to suit your needs.
For a complete discussion of the @file{Local.rules} file,
-(a)xref{Local.rules File,,,lispref}.
+(a)xref{Local.rules File,,,lispref, XEmacs Lisp Reference Manual}.
@node Available Packages, , Local.rules File, Packages
@comment node-name, next, previous, up
cvs server: Diffing modules
cvs server: Diffing modules/base64
cvs server: Diffing modules/common
cvs server: Diffing modules/ldap
cvs server: Diffing modules/postgresql
cvs server: Diffing modules/sample
cvs server: Diffing modules/sample/external
cvs server: Diffing modules/sample/internal
cvs server: Diffing modules/zlib
cvs server: Diffing netinstall
cvs server: Diffing nt
cvs server: Diffing nt/installer
cvs server: Diffing nt/installer/Wise
Index: src/buffer.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/buffer.c,v
retrieving revision 1.67
diff -u -p -r1.67 buffer.c
--- src/buffer.c 2004/11/04 23:06:15 1.67
+++ src/buffer.c 2004/12/05 22:10:00
@@ -2912,7 +2912,7 @@ init_initial_directory (void)
Extbyte *modname = mswindows_get_module_file_name ();
assert (modname);
- p = xetcsrchr (modname, '\\');
+ p = qxetcsrchr (modname, '\\');
assert (p);
XECOPY_TCHAR (p, '\0');
Index: src/device-msw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/device-msw.c,v
retrieving revision 1.54
diff -u -p -r1.54 device-msw.c
--- src/device-msw.c 2004/11/04 23:06:19 1.54
+++ src/device-msw.c 2004/12/05 22:10:00
@@ -916,7 +916,7 @@ mswindows_handle_page_setup_dialog_box (
qxeGetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_IMEASURE,
measure, sizeof (measure) / XETCHAR_SIZE);
- data = xetcscmp (measure, XETEXT ("0"));
+ data = qxetcscmp (measure, XETEXT ("0"));
memset (&pd, 0, sizeof (pd));
pd.lStructSize = sizeof (pd);
Index: src/dialog-msw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dialog-msw.c,v
retrieving revision 1.31
diff -u -p -r1.31 dialog-msw.c
--- src/dialog-msw.c 2004/11/04 23:06:20 1.31
+++ src/dialog-msw.c 2004/12/05 22:10:00
@@ -1,6 +1,6 @@
/* Implements elisp-programmable dialog boxes -- MS Windows interface.
Copyright (C) 1998 Kirill M. Katsnelson <kkm(a)kis.ru>
- Copyright (C) 2000, 2001, 2002, 2003 Ben Wing.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004 Ben Wing.
This file is part of XEmacs.
@@ -344,7 +344,7 @@ static int
CALLBACK handle_directory_proc (HWND hwnd, UINT msg,
LPARAM lParam, LPARAM lpData)
{
- Extbyte szDir[MAX_PATH * MAX_XETCHAR_SIZE];
+ Extbyte szDir[PATH_MAX_EXTERNAL];
struct param_data *pd = (struct param_data *) lpData;
switch (msg)
@@ -365,7 +365,7 @@ CALLBACK handle_directory_proc (HWND hwn
if (pd->validate)
return TRUE;
else
- pd->unknown_fname = xetcsdup ((Extbyte *) lParam);
+ pd->unknown_fname = qxetcsdup ((Extbyte *) lParam);
break;
default:
@@ -430,7 +430,7 @@ handle_directory_dialog_box (struct fram
pidl = qxeSHBrowseForFolder (&bi);
if (pidl)
{
- Extbyte *szDir = alloca_extbytes (MAX_PATH * MAX_XETCHAR_SIZE);
+ Extbyte *szDir = alloca_extbytes (PATH_MAX_EXTERNAL);
if (qxeSHGetPathFromIDList (pidl, szDir))
ret = tstr_to_local_file_format (szDir);
@@ -466,7 +466,7 @@ handle_file_dialog_box (struct frame *f,
ofn.hwndOwner = FRAME_MSWINDOWS_HANDLE (f);
ofn.lpstrFile = (XELPTSTR) fnbuf;
ofn.nMaxFile = sizeof (fnbuf) / XETCHAR_SIZE;
- xetcscpy (fnbuf, XETEXT (""));
+ qxetcscpy (fnbuf, XETEXT (""));
LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil),
ofn.lpstrInitialDir);
@@ -480,7 +480,7 @@ handle_file_dialog_box (struct frame *f,
CHECK_STRING (value);
LOCAL_FILE_FORMAT_TO_TSTR (value, fnout);
- xetcscpy (fnbuf, fnout);
+ qxetcscpy (fnbuf, fnout);
}
else if (EQ (key, Q_title))
{
Index: src/dired-msw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dired-msw.c,v
retrieving revision 1.17
diff -u -p -r1.17 dired-msw.c
--- src/dired-msw.c 2004/11/04 23:06:21 1.17
+++ src/dired-msw.c 2004/12/05 22:10:01
@@ -212,8 +212,8 @@ mswindows_get_files (Lisp_Object dirfile
{
Charcount len = eicharlen (win32pattern) - 1;
if (!IS_DIRECTORY_SEP (eigetch_char (win32pattern, len)))
- eicat_c (win32pattern, "\\");
- eicat_c (win32pattern, "*");
+ eicat_ascii (win32pattern, "\\");
+ eicat_ascii (win32pattern, "*");
}
eito_external (win32pattern, Qmswindows_tstr);
@@ -312,17 +312,17 @@ mswindows_format_file (Win32_file *file,
file_size =
file->nFileSizeHigh * (double)UINT_MAX + file->nFileSizeLow;
#if INDENT_LISTING
- eicat_c (puta, " ");
+ eicat_ascii (puta, " ");
#endif
if (display_size)
{
sprintf (buf, "%6d ", (int)((file_size + 1023.) / 1024.));
- eicat_c (puta, buf);
+ eicat_ascii (puta, buf);
}
if (file->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
- eicat_c (puta, "d");
+ eicat_ascii (puta, "d");
else
- eicat_c (puta, "-");
+ eicat_ascii (puta, "-");
buf[0] = buf[3] = buf[6] = 'r';
if (file->dwFileAttributes & FILE_ATTRIBUTE_READONLY)
buf[1] = buf[4] = buf[7] = '-';
@@ -355,11 +355,11 @@ mswindows_format_file (Win32_file *file,
buf[2] = buf[5] = buf[8] = '-';
}
buf[9] = '\0';
- eicat_c (puta, buf);
+ eicat_ascii (puta, buf);
if (file->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
- eicat_c (puta, " 2 ");
+ eicat_ascii (puta, " 2 ");
else
- eicat_c (puta, " 1 ");
+ eicat_ascii (puta, " 1 ");
luser = Fuser_login_name (Qnil);
if (!STRINGP (luser))
sprintf (buf, "%-9d", 0);
@@ -427,10 +427,10 @@ mswindows_format_file (Win32_file *file,
}
}
- eicat_c (puta, buf);
+ eicat_ascii (puta, buf);
eicat_raw (puta, file->cFileName, qxestrlen (file->cFileName));
if (add_newline)
- eicat_c (puta, "\n");
+ eicat_ascii (puta, "\n");
return eimake_string (puta);
}
Index: src/dumper.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dumper.c,v
retrieving revision 1.20
diff -u -p -r1.20 dumper.c
--- src/dumper.c 2004/11/04 23:06:22 1.20
+++ src/dumper.c 2004/12/05 22:10:01
@@ -1873,15 +1873,32 @@ pdump_file_try (Wexttext *exe_path)
int
pdump_load (const Wexttext *argv0)
{
- Wexttext exe_path[PATH_MAX];
#ifdef WIN32_NATIVE
- qxeGetModuleFileName (NULL, (Extbyte *) exe_path, PATH_MAX);
+ Wexttext *exe_path = NULL;
+ int bufsize = 4096;
+ int cchpathsize;
+
+ /* Copied from mswindows_get_module_file_name (). Not clear if it's
+ kosher to malloc() yet. */
+ while (1)
+ {
+ exe_path = alloca_array (Wexttext, bufsize);
+ cchpathsize = qxeGetModuleFileName (NULL, (Extbyte *) exe_path,
+ bufsize);
+ if (!cchpathsize)
+ goto fail;
+ if (cchpathsize + 1 <= bufsize)
+ break;
+ bufsize *= 2;
+ }
+
if (!XEUNICODE_P)
{
Wexttext *wexe = MULTIBYTE_TO_WEXTTEXT ((Extbyte *) exe_path);
wext_strcpy (exe_path, wexe);
}
#else /* !WIN32_NATIVE */
+ Wexttext *exe_path;
Wexttext *w;
const Wexttext *dir, *p;
@@ -1914,6 +1931,7 @@ pdump_load (const Wexttext *argv0)
{
/* invocation-name includes a directory component -- presumably it
is relative to cwd, not $PATH */
+ exe_path = alloca_array (Wexttext, 1 + wext_strlen (dir));
wext_strcpy (exe_path, dir);
}
else
@@ -1921,6 +1939,9 @@ pdump_load (const Wexttext *argv0)
const Wexttext *path = wext_getenv ("PATH"); /* not egetenv --
not yet init. */
const Wexttext *name = p;
+ exe_path = alloca_array (Wexttext,
+ 10 + max (wext_strlen (name),
+ wext_strlen (path)));
for (;;)
{
p = path;
@@ -1954,7 +1975,7 @@ pdump_load (const Wexttext *argv0)
wext_sprintf (exe_path, "./%s", name);
break;
}
- path = p+1;
+ path = p + 1;
}
}
#endif /* WIN32_NATIVE */
@@ -1977,6 +1998,8 @@ pdump_load (const Wexttext *argv0)
}
pdump_free ();
}
+
+fail:
#endif
in_pdump = 0;
Index: src/editfns.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/editfns.c,v
retrieving revision 1.50
diff -u -p -r1.50 editfns.c
--- src/editfns.c 2004/11/04 23:06:23 1.50
+++ src/editfns.c 2004/12/05 22:10:02
@@ -607,7 +607,7 @@ On Unix it is obtained from TMPDIR, with
DECLARE_EISTRING (eipath);
Ibyte *path;
- eicpy_c (eipath, "/tmp/");
+ eicpy_ascii (eipath, "/tmp/");
eicat_rawz (eipath, login_name);
path = eidata (eipath);
if (qxe_lstat (path, &st) < 0 && errno == ENOENT)
@@ -618,7 +618,7 @@ On Unix it is obtained from TMPDIR, with
else
{
eicpy_rawz (eipath, egetenv ("HOME"));
- eicat_c (eipath, "/tmp/");
+ eicat_ascii (eipath, "/tmp/");
path = eidata (eipath);
if (qxe_stat (path, &st) < 0 && errno == ENOENT)
{
@@ -627,7 +627,7 @@ On Unix it is obtained from TMPDIR, with
qxe_mkdir (path, 0700); /* ignore retvals */
eicpy_ei (eiwarnpath, eipath);
- eicat_c (eiwarnpath, ".created_by_xemacs");
+ eicat_ascii (eiwarnpath, ".created_by_xemacs");
if ((fd = qxe_open (eidata (eiwarnpath),
O_WRONLY | O_CREAT, 0644)) > 0)
{
Index: src/elhash.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/elhash.c,v
retrieving revision 1.37
diff -u -p -r1.37 elhash.c
--- src/elhash.c 2004/11/04 23:06:23 1.37
+++ src/elhash.c 2004/12/05 22:10:02
@@ -1,6 +1,6 @@
/* Implementation of the hash table lisp object type.
Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
- Copyright (C) 1995, 1996, 2002 Ben Wing.
+ Copyright (C) 1995, 1996, 2002, 2004 Ben Wing.
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of XEmacs.
@@ -402,9 +402,7 @@ print_hash_table (Lisp_Object obj, Lisp_
if (print_readably)
write_c_string (printcharfun, ")");
else
- {
- write_fmt_string (printcharfun, " 0x%x>", ht->header.uid);
- }
+ write_fmt_string (printcharfun, " 0x%x>", ht->header.uid);
}
static void
@@ -790,12 +788,8 @@ hash_table_instantiate (Lisp_Object plis
Lisp_Object weakness = Qnil;
Lisp_Object data = Qnil;
- while (!NILP (plist))
+ PROPERTY_LIST_LOOP_3 (key, value, plist)
{
- Lisp_Object key, value;
- key = XCAR (plist); plist = XCDR (plist);
- value = XCAR (plist); plist = XCDR (plist);
-
if (EQ (key, Qtest)) test = value;
else if (EQ (key, Qsize)) size = value;
else if (EQ (key, Qrehash_size)) rehash_size = value;
@@ -1063,6 +1057,35 @@ find_htentry (Lisp_Object key, const Lis
break;
return probe;
+}
+
+/* A version of Fputhash() that increments the value by the specified
+ amount and dispenses will all error checks. Assumes that tables does
+ comparison using EQ. Used by the profiling routines to avoid
+ overhead -- profiling overhead was being recorded at up to 15% of the
+ total time. */
+
+void
+inchash_eq (Lisp_Object key, Lisp_Object table, EMACS_INT offset)
+{
+ Lisp_Hash_Table *ht = XHASH_TABLE (table);
+ htentry *entries = ht->hentries;
+ htentry *probe = entries + HASHCODE (key, ht);
+
+ LINEAR_PROBING_LOOP (probe, entries, ht->size)
+ if (EQ (probe->key, key))
+ break;
+
+ if (!HTENTRY_CLEAR_P (probe))
+ probe->value = make_int (XINT (probe->value) + offset);
+ else
+ {
+ probe->key = key;
+ probe->value = make_int (offset);
+
+ if (++ht->count >= ht->rehash_count)
+ enlarge_hash_table (ht);
+ }
}
DEFUN ("gethash", Fgethash, 2, 3, 0, /*
Index: src/elhash.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/elhash.h,v
retrieving revision 1.13
diff -u -p -r1.13 elhash.h
--- src/elhash.h 2003/01/12 11:08:12 1.13
+++ src/elhash.h 2004/12/05 22:10:02
@@ -97,4 +97,6 @@ void prune_weak_hash_tables (void);
void pdump_reorganize_hash_table (Lisp_Object);
+void inchash_eq (Lisp_Object key, Lisp_Object table, EMACS_INT offset);
+
#endif /* INCLUDED_elhash_h_ */
Index: src/eval.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/eval.c,v
retrieving revision 1.83
diff -u -p -r1.83 eval.c
--- src/eval.c 2004/11/04 23:06:25 1.83
+++ src/eval.c 2004/12/05 22:10:04
@@ -1,7 +1,7 @@
/* Evaluator for XEmacs Lisp interpreter.
Copyright (C) 1985-1987, 1992-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.
@@ -1154,25 +1154,24 @@ The return value of the `setq' form is t
(args))
{
/* This function can GC */
- Lisp_Object symbol, tail, val = Qnil;
int nargs;
- struct gcpro gcpro1;
+ Lisp_Object retval = Qnil;
GET_LIST_LENGTH (args, nargs);
if (nargs & 1) /* Odd number of arguments? */
Fsignal (Qwrong_number_of_arguments, list2 (Qsetq, make_int (nargs)));
-
- GCPRO1 (val);
- PROPERTY_LIST_LOOP (tail, symbol, val, args)
+ GC_PROPERTY_LIST_LOOP_3 (symbol, val, args)
{
val = Feval (val);
Fset (symbol, val);
+ retval = val;
}
- UNGCPRO;
- return val;
+ END_GC_PROPERTY_LIST_LOOP (symbol);
+
+ return retval;
}
DEFUN ("quote", Fquote, 1, UNEVALLED, 0, /*
@@ -4825,7 +4824,8 @@ flagged_a_squirmer (Lisp_Object error_co
(struct call_trapping_problems *) get_opaque_ptr (opaque);
if (!(inhibit_flags & INHIBIT_WARNING_ISSUE)
- && !warning_will_be_discarded (current_warning_level ()))
+ && !warning_will_be_discarded (current_warning_level ())
+ && !EQ (error_conditions, Qquit))
{
struct gcpro gcpro1;
Lisp_Object lstream = Qnil;
@@ -4898,7 +4898,7 @@ issue_call_trapping_problems_warning (Li
p->thrown_tag, p->thrown_value);
warn_when_safe_lispobj (Qerror, current_warning_level (), errstr);
}
- else if (p->caught_error)
+ else if (p->caught_error && !EQ (p->error_conditions, Qquit))
{
Lisp_Object errstr;
/* #### This should call
Index: src/event-msw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-msw.c,v
retrieving revision 1.100
diff -u -p -r1.100 event-msw.c
--- src/event-msw.c 2004/11/04 23:06:26 1.100
+++ src/event-msw.c 2004/12/05 22:10:06
@@ -3207,7 +3207,7 @@ mswindows_wnd_proc (HWND hwnd, UINT mess
may be copying an ANSI string into it. Easiest to just
zero the whole thing. */
xzero (*tttextw->szText);
- xetcsncpy ((Extbyte *) tttextw->szText, btextext, 79);
+ qxetcsncpy ((Extbyte *) tttextw->szText, btextext, 79);
}
else
tttextw->lpszText = NULL;
@@ -3782,7 +3782,7 @@ mswindows_wnd_proc (HWND hwnd, UINT mess
Extbyte *fname_unicode;
WIN32_FIND_DATAW wfd;
LPWSTR resolved =
- alloca_array (WCHAR, PATH_MAX + 1);
+ alloca_array (WCHAR, PATH_MAX_EXTERNAL + 1);
TO_EXTERNAL_FORMAT (DATA, (fname, fnamelen),
C_STRING_ALLOCA,
@@ -3806,10 +3806,10 @@ mswindows_wnd_proc (HWND hwnd, UINT mess
/* Another Cygwin prototype error,
fixed in v2.2 of w32api */
XECOMCALL4 (psl, GetPath, (LPSTR) resolved,
- PATH_MAX, &wfd, 0)
+ PATH_MAX_EXTERNAL, &wfd, 0)
#else
XECOMCALL4 (psl, GetPath, resolved,
- PATH_MAX, &wfd, 0)
+ PATH_MAX_EXTERNAL, &wfd, 0)
#endif
== S_OK)
TO_INTERNAL_FORMAT (C_STRING, resolved,
@@ -3842,7 +3842,7 @@ mswindows_wnd_proc (HWND hwnd, UINT mess
Extbyte *fname_unicode;
WIN32_FIND_DATAA wfd;
LPSTR resolved =
- alloca_array (CHAR, PATH_MAX + 1);
+ alloca_array (CHAR, PATH_MAX_EXTERNAL + 1);
/* Always Unicode. Not obvious from the
IPersistFile documentation, but look under
@@ -3856,7 +3856,7 @@ mswindows_wnd_proc (HWND hwnd, UINT mess
(LPWSTR) fname_unicode,
STGM_READ) == S_OK
&& XECOMCALL4 (psl, GetPath, resolved,
- PATH_MAX, &wfd, 0) == S_OK)
+ PATH_MAX_EXTERNAL, &wfd, 0) == S_OK)
TO_INTERNAL_FORMAT (C_STRING, resolved,
ALLOCA, (fname, fnamelen),
Qmswindows_tstr);
Index: src/events.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/events.c,v
retrieving revision 1.62
diff -u -p -r1.62 events.c
--- src/events.c 2004/11/04 23:06:27 1.62
+++ src/events.c 2004/12/05 22:10:06
@@ -1542,20 +1542,20 @@ format_event_object (Eistring *buf, Lisp
UNGCPRO;
return;
}
- case magic_eval_event: eicat_c (buf, "magic-eval"); return;
- case pointer_motion_event: eicat_c (buf, "motion"); return;
- case misc_user_event: eicat_c (buf, "misc-user"); return;
- case eval_event: eicat_c (buf, "eval"); return;
- case process_event: eicat_c (buf, "process"); return;
- case timeout_event: eicat_c (buf, "timeout"); return;
- case empty_event: eicat_c (buf, "empty"); return;
- case dead_event: eicat_c (buf, "DEAD-EVENT"); return;
+ case magic_eval_event: eicat_ascii (buf, "magic-eval"); return;
+ case pointer_motion_event: eicat_ascii (buf, "motion"); return;
+ case misc_user_event: eicat_ascii (buf, "misc-user"); return;
+ case eval_event: eicat_ascii (buf, "eval"); return;
+ case process_event: eicat_ascii (buf, "process"); return;
+ case timeout_event: eicat_ascii (buf, "timeout"); return;
+ case empty_event: eicat_ascii (buf, "empty"); return;
+ case dead_event: eicat_ascii (buf, "DEAD-EVENT"); return;
default:
abort ();
return;
}
#define modprint(x,y) \
- do { if (brief) eicat_c (buf, (y)); else eicat_c (buf, (x)); } while (0)
+ do { if (brief) eicat_ascii (buf, (y)); else eicat_ascii (buf, (x)); } while (0)
if (mod & XEMACS_MOD_CONTROL) modprint ("control-", "C-");
if (mod & XEMACS_MOD_META) modprint ("meta-", "M-");
if (mod & XEMACS_MOD_SUPER) modprint ("super-", "S-");
@@ -1564,7 +1564,7 @@ format_event_object (Eistring *buf, Lisp
if (mod & XEMACS_MOD_SHIFT) modprint ("shift-", "Sh-");
if (mouse_p)
{
- eicat_c (buf, "button");
+ eicat_ascii (buf, "button");
--mouse_p;
}
@@ -1586,14 +1586,14 @@ format_event_object (Eistring *buf, Lisp
else if (EQ (key, QKbackspace)) str = "BS";
}
if (str)
- eicat_c (buf, str);
+ eicat_ascii (buf, str);
else
eicat_lstr (buf, XSYMBOL (key)->name);
}
else
abort ();
if (mouse_p)
- eicat_c (buf, "up");
+ eicat_ascii (buf, "up");
}
void
Index: src/fileio.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/fileio.c,v
retrieving revision 1.101
diff -u -p -r1.101 fileio.c
--- src/fileio.c 2004/11/04 23:06:29 1.101
+++ src/fileio.c 2004/12/05 22:10:08
@@ -1341,7 +1341,7 @@ No component of the resulting pathname w
}
{
- Ibyte resolved_path[PATH_MAX];
+ Ibyte resolved_path[PATH_MAX_INTERNAL];
Bytecount elen = XSTRING_LENGTH (expanded_name);
Ibyte *path;
Ibyte *p;
Index: src/glyphs-gtk.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-gtk.c,v
retrieving revision 1.27
diff -u -p -r1.27 glyphs-gtk.c
--- src/glyphs-gtk.c 2004/11/04 23:06:33 1.27
+++ src/glyphs-gtk.c 2004/12/05 22:10:08
@@ -1701,7 +1701,7 @@ font_instantiate (Lisp_Object image_inst
Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
GdkColor fg, bg;
GdkFont *source, *mask;
- char source_name[PATH_MAX], mask_name[PATH_MAX], dummy;
+ char source_name[PATH_MAX_INTERNAL], mask_name[PATH_MAX_INTERNAL], dummy;
int source_char, mask_char;
int count;
Lisp_Object foreground, background;
Index: src/glyphs-msw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-msw.c,v
retrieving revision 1.53
diff -u -p -r1.53 glyphs-msw.c
--- src/glyphs-msw.c 2004/11/04 23:06:33 1.53
+++ src/glyphs-msw.c 2004/12/05 22:10:09
@@ -2486,7 +2486,7 @@ static HTREEITEM add_tree_item (Lisp_Obj
else
LISP_STRING_TO_TSTR (item, tvitem.item.pszText);
- tvitem.item.cchTextMax = xetcslen ((Extbyte *) tvitem.item.pszText);
+ tvitem.item.cchTextMax = qxetcslen ((Extbyte *) tvitem.item.pszText);
if ((ret = (HTREEITEM) qxeSendMessage (wnd, TVM_INSERTITEM,
0, (LPARAM) &tvitem)) == 0)
@@ -2605,7 +2605,7 @@ add_tab_item (Lisp_Object image_instance
LISP_STRING_TO_TSTR (item, tcitem.pszText);
}
- tcitem.cchTextMax = xetcslen ((Extbyte *) tcitem.pszText);
+ tcitem.cchTextMax = qxetcslen ((Extbyte *) tcitem.pszText);
if ((ret = qxeSendMessage (wnd, TCM_INSERTITEM, i, (LPARAM) &tcitem)) < 0)
gui_error ("error adding tab entry", item);
Index: src/glyphs-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-x.c,v
retrieving revision 1.80
diff -u -p -r1.80 glyphs-x.c
--- src/glyphs-x.c 2004/11/04 23:06:34 1.80
+++ src/glyphs-x.c 2004/12/05 22:10:10
@@ -1838,7 +1838,7 @@ font_instantiate (Lisp_Object image_inst
Display *dpy;
XColor fg, bg;
Font source, mask;
- Ibyte source_name[PATH_MAX], mask_name[PATH_MAX], dummy;
+ Ibyte source_name[PATH_MAX_INTERNAL], mask_name[PATH_MAX_INTERNAL], dummy;
int source_char, mask_char;
int count;
Lisp_Object foreground, background;
Index: src/keymap.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/keymap.c,v
retrieving revision 1.52
diff -u -p -r1.52 keymap.c
--- src/keymap.c 2004/11/04 23:06:38 1.52
+++ src/keymap.c 2004/12/05 22:10:12
@@ -3335,26 +3335,26 @@ of a key read from the user rather than
LIST_LOOP (rest, key)
{
Lisp_Object keysym = XCAR (rest);
- if (EQ (keysym, Qcontrol)) eicat_c (bufp, "C-");
- else if (EQ (keysym, Qctrl)) eicat_c (bufp, "C-");
- else if (EQ (keysym, Qmeta)) eicat_c (bufp, "M-");
- else if (EQ (keysym, Qsuper)) eicat_c (bufp, "S-");
- else if (EQ (keysym, Qhyper)) eicat_c (bufp, "H-");
- else if (EQ (keysym, Qalt)) eicat_c (bufp, "A-");
- else if (EQ (keysym, Qshift)) eicat_c (bufp, "Sh-");
+ if (EQ (keysym, Qcontrol)) eicat_ascii (bufp, "C-");
+ else if (EQ (keysym, Qctrl)) eicat_ascii (bufp, "C-");
+ else if (EQ (keysym, Qmeta)) eicat_ascii (bufp, "M-");
+ else if (EQ (keysym, Qsuper)) eicat_ascii (bufp, "S-");
+ else if (EQ (keysym, Qhyper)) eicat_ascii (bufp, "H-");
+ else if (EQ (keysym, Qalt)) eicat_ascii (bufp, "A-");
+ else if (EQ (keysym, Qshift)) eicat_ascii (bufp, "Sh-");
else if (CHAR_OR_CHAR_INTP (keysym))
eicat_ch (bufp, XCHAR_OR_CHAR_INT (keysym));
else
{
CHECK_SYMBOL (keysym);
#if 0 /* This is bogus */
- if (EQ (keysym, QKlinefeed)) eicat_c (bufp, "LFD");
- else if (EQ (keysym, QKtab)) eicat_c (bufp, "TAB");
- else if (EQ (keysym, QKreturn)) eicat_c (bufp, "RET");
- else if (EQ (keysym, QKescape)) eicat_c (bufp, "ESC");
- else if (EQ (keysym, QKdelete)) eicat_c (bufp, "DEL");
- else if (EQ (keysym, QKspace)) eicat_c (bufp, "SPC");
- else if (EQ (keysym, QKbackspace)) eicat_c (bufp, "BS");
+ if (EQ (keysym, QKlinefeed)) eicat_ascii (bufp, "LFD");
+ else if (EQ (keysym, QKtab)) eicat_ascii (bufp, "TAB");
+ else if (EQ (keysym, QKreturn)) eicat_ascii (bufp, "RET");
+ else if (EQ (keysym, QKescape)) eicat_ascii (bufp, "ESC");
+ else if (EQ (keysym, QKdelete)) eicat_ascii (bufp, "DEL");
+ else if (EQ (keysym, QKspace)) eicat_ascii (bufp, "SPC");
+ else if (EQ (keysym, QKbackspace)) eicat_ascii (bufp, "BS");
else
#endif
eicat_lstr (bufp, XSYMBOL (keysym)->name);
@@ -3567,7 +3567,7 @@ format_raw_keys (Lisp_Key_Data *keys, in
XSET_EVENT_KEY_MODIFIERS (event, KEY_DATA_MODIFIERS (&keys[i]));
format_event_object (buf, event, 1);
if (i < count - 1)
- eicat_c (buf, " ");
+ eicat_ascii (buf, " ");
}
Fdeallocate_event (event);
}
Index: src/lisp.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lisp.h,v
retrieving revision 1.116
diff -u -p -r1.116 lisp.h
--- src/lisp.h 2004/11/04 23:06:39 1.116
+++ src/lisp.h 2004/12/05 22:10:14
@@ -2205,13 +2205,29 @@ EXTERNAL_PROPERTY_LIST_LOOP_7 (key, valu
((void) signal_circular_property_list_error (list)) : \
((void) 0)))))
-#define PROPERTY_LIST_LOOP(tail, key, value, plist) \
- for (tail = plist; \
- NILP (tail) ? 0 : \
- (key = XCAR (tail), tail = XCDR (tail), \
- value = XCAR (tail), tail = XCDR (tail), 1); \
+#define PRIVATE_PROPERTY_LIST_LOOP_4(tail, key, value, plist) \
+ for (tail = plist; \
+ NILP (tail) ? 0 : \
+ (key = XCAR (tail), tail = XCDR (tail), \
+ value = XCAR (tail), tail = XCDR (tail), 1); \
)
+#define PROPERTY_LIST_LOOP_3(key, value, plist) \
+ Lisp_Object key, value, tail_##key; \
+ PRIVATE_PROPERTY_LIST_LOOP_4 (tail_##key, key, value, plist)
+
+#define GC_PROPERTY_LIST_LOOP_3(key, value, plist) \
+do { \
+ XGCDECL3 (key); \
+ Lisp_Object key, value, tail_##key; \
+ XGCPRO3 (key, key, value, tail_##key); \
+ PRIVATE_PROPERTY_LIST_LOOP_4 (tail_##key, key, value, plist)
+
+#define END_GC_PROPERTY_LIST_LOOP(key) \
+ XUNGCPRO (key); \
+} \
+while (0)
+
/* Return 1 if LIST is properly acyclic and nil-terminated, else 0. */
DECLARE_INLINE_HEADER (
int
@@ -4595,8 +4611,13 @@ void internal_object_printer (Lisp_Objec
/* Defined in rangetab.c */
EXFUN (Fclear_range_table, 1);
EXFUN (Fget_range_table, 3);
-EXFUN (Fmake_range_table, 0);
+EXFUN (Fmake_range_table, 1);
EXFUN (Fput_range_table, 4);
+
+extern Lisp_Object Qstart_closed_end_open;
+extern Lisp_Object Qstart_open_end_open;
+extern Lisp_Object Qstart_closed_end_closed;
+extern Lisp_Object Qstart_open_end_closed;
void put_range_table (Lisp_Object, EMACS_INT, EMACS_INT, Lisp_Object);
int unified_range_table_bytes_needed (Lisp_Object);
Index: src/nt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/nt.c,v
retrieving revision 1.44
diff -u -p -r1.44 nt.c
--- src/nt.c 2004/11/04 23:06:44 1.44
+++ src/nt.c 2004/12/05 22:10:15
@@ -1084,12 +1084,12 @@ mswindows_link (const Ibyte *old, const
struct
{
WIN32_STREAM_ID wid;
- WCHAR wbuffer[MAX_PATH]; /* extra space for link name */
+ WCHAR wbuffer[_MAX_PATH]; /* extra space for link name */
} data;
TO_EXTERNAL_FORMAT (C_STRING, new,
ALLOCA, (newuni, wlen), Qmswindows_unicode);
- if (wlen / sizeof (WCHAR) < MAX_PATH)
+ if (wlen / sizeof (WCHAR) < _MAX_PATH)
{
LPVOID context = NULL;
DWORD wbytes = 0;
@@ -1998,7 +1998,7 @@ All path elements in FILENAME are conver
*/
(filename))
{
- Extbyte shortname[MAX_PATH * MAX_XETCHAR_SIZE];
+ Extbyte shortname[PATH_MAX_EXTERNAL];
Extbyte *fileext;
Ibyte *shortint;
Index: src/objects-msw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-msw.c,v
retrieving revision 1.43
diff -u -p -r1.43 objects-msw.c
--- src/objects-msw.c 2004/11/04 23:06:45 1.43
+++ src/objects-msw.c 2004/12/05 22:10:15
@@ -1492,7 +1492,7 @@ parse_font_spec (const Ibyte *namestr,
C_STRING_TO_TSTR (fontname, extfontname);
if (logfont)
{
- xetcsncpy ((Extbyte *) logfont->lfFaceName, extfontname,
+ qxetcsncpy ((Extbyte *) logfont->lfFaceName, extfontname,
LF_FACESIZE - 1);
logfont->lfFaceName[LF_FACESIZE - 1] = 0;
}
Index: src/process-nt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/process-nt.c,v
retrieving revision 1.35
diff -u -p -r1.35 process-nt.c
--- src/process-nt.c 2004/11/04 23:06:46 1.35
+++ src/process-nt.c 2004/12/05 22:10:16
@@ -771,7 +771,7 @@ nt_create_process (Lisp_Process *p,
{
DECLARE_EISTRING (progext);
eicpy_lstr (progext, program);
- eicat_c (progext, ".exe");
+ eicat_ascii (progext, ".exe");
eito_external (progext, Qmswindows_tstr);
image_type = qxeSHGetFileInfo (eiextdata (progext), 0, NULL, 0,
SHGFI_EXETYPE);
@@ -950,7 +950,7 @@ nt_create_process (Lisp_Process *p,
while leaving the real app name as argv[0]. */
if (is_dos_app)
{
- cmdname = alloca_ibytes (PATH_MAX);
+ cmdname = alloca_ibytes (PATH_MAX_INTERNAL);
if (egetenv ("CMDPROXY"))
qxestrcpy (cmdname, egetenv ("CMDPROXY"));
else
Index: src/profile.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/profile.c,v
retrieving revision 1.21
diff -u -p -r1.21 profile.c
--- src/profile.c 2004/11/04 23:06:47 1.21
+++ src/profile.c 2004/12/05 22:10:16
@@ -128,16 +128,16 @@ create_profile_tables (void)
create_timing_profile_table ();
if (NILP (Vtotal_timing_profile_table))
Vtotal_timing_profile_table =
- make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
+ make_lisp_hash_table (1000, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
if (NILP (Vcall_count_profile_table))
Vcall_count_profile_table =
- make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
+ make_lisp_hash_table (1000, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
if (NILP (Vgc_usage_profile_table))
Vgc_usage_profile_table =
- make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
+ make_lisp_hash_table (1000, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
if (NILP (Vtotal_gc_usage_profile_table))
Vtotal_gc_usage_profile_table =
- make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
+ make_lisp_hash_table (1000, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
}
static Lisp_Object
@@ -178,13 +178,8 @@ current_profile_function (void)
void
profile_record_consing (EMACS_INT size)
{
- Lisp_Object fun;
- Lisp_Object count;
-
in_profiling++;
- fun = current_profile_function ();
- count = Fgethash (fun, Vgc_usage_profile_table, Qzero);
- Fputhash (fun, make_int (size + XINT (count)), Vgc_usage_profile_table);
+ inchash_eq (current_profile_function (), Vgc_usage_profile_table, size);
in_profiling--;
}
@@ -228,11 +223,7 @@ profile_record_about_to_call (struct bac
/* See comments in create_timing_profile_table(). */
pregrow_hash_table_if_necessary (big_profile_table, EXTRA_BREATHING_ROOM);
profiling_lock = 0;
- Fputhash (*bt->function,
- make_int (1 + XINT (Fgethash (*bt->function,
- Vcall_count_profile_table,
- Qzero))),
- Vcall_count_profile_table);
+ inchash_eq (*bt->function, Vcall_count_profile_table, 1);
/* This may be set if the function was in its preamble at the time that
`start-profiling' was called. If so, we shouldn't reset the values
because we may get inconsistent results, since we have already started
Index: src/rangetab.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/rangetab.c,v
retrieving revision 1.17
diff -u -p -r1.17 rangetab.c
--- src/rangetab.c 2004/11/04 23:06:48 1.17
+++ src/rangetab.c 2004/12/05 22:10:16
@@ -1,6 +1,6 @@
/* XEmacs routines to deal with range tables.
Copyright (C) 1995 Sun Microsystems, Inc.
- Copyright (C) 1995, 2002 Ben Wing.
+ Copyright (C) 1995, 2002, 2004 Ben Wing.
This file is part of XEmacs.
@@ -30,11 +30,55 @@ Boston, MA 02111-1307, USA. */
Lisp_Object Qrange_tablep;
Lisp_Object Qrange_table;
+Lisp_Object Qstart_closed_end_open;
+Lisp_Object Qstart_open_end_open;
+Lisp_Object Qstart_closed_end_closed;
+Lisp_Object Qstart_open_end_closed;
+
/************************************************************************/
/* Range table object */
/************************************************************************/
+static enum range_table_type
+range_table_symbol_to_type (Lisp_Object symbol)
+{
+ if (NILP (symbol))
+ return RANGE_START_CLOSED_END_OPEN;
+
+ CHECK_SYMBOL (symbol);
+ if (EQ (symbol, Qstart_closed_end_open))
+ return RANGE_START_CLOSED_END_OPEN;
+ if (EQ (symbol, Qstart_closed_end_closed))
+ return RANGE_START_CLOSED_END_CLOSED;
+ if (EQ (symbol, Qstart_open_end_open))
+ return RANGE_START_OPEN_END_OPEN;
+ if (EQ (symbol, Qstart_open_end_closed))
+ return RANGE_START_OPEN_END_CLOSED;
+
+ invalid_constant ("Unknown range table type", symbol);
+ RETURN_NOT_REACHED (RANGE_START_CLOSED_END_OPEN);
+}
+
+static Lisp_Object
+range_table_type_to_symbol (enum range_table_type type)
+{
+ switch (type)
+ {
+ case RANGE_START_CLOSED_END_OPEN:
+ return Qstart_closed_end_open;
+ case RANGE_START_CLOSED_END_CLOSED:
+ return Qstart_closed_end_closed;
+ case RANGE_START_OPEN_END_OPEN:
+ return Qstart_open_end_open;
+ case RANGE_START_OPEN_END_CLOSED:
+ return Qstart_open_end_closed;
+ }
+
+ abort ();
+ return Qnil;
+}
+
/* We use a sorted array of ranges.
#### We should be using the gap array stuff from extents.c. This
@@ -58,20 +102,37 @@ print_range_table (Lisp_Object obj, Lisp
Lisp_Range_Table *rt = XRANGE_TABLE (obj);
int i;
- write_c_string (printcharfun, "#s(range-table data (");
+ if (print_readably)
+ write_fmt_string_lisp (printcharfun, "#s(range-table type %s data (",
+ 1, range_table_type_to_symbol (rt->type));
+ else
+ write_c_string (printcharfun, "#<range-table ");
for (i = 0; i < Dynarr_length (rt->entries); i++)
{
struct range_table_entry *rte = Dynarr_atp (rt->entries, i);
+ int so, ec;
if (i > 0)
write_c_string (printcharfun, " ");
- if (rte->first == rte->last)
- write_fmt_string (printcharfun, "%ld ", (long) (rte->first));
- else
- write_fmt_string (printcharfun, "(%ld %ld) ", (long) (rte->first),
- (long) (rte->last));
+ switch (rt->type)
+ {
+ case RANGE_START_CLOSED_END_OPEN: so = 0, ec = 0; break;
+ case RANGE_START_CLOSED_END_CLOSED: so = 0, ec = 1; break;
+ case RANGE_START_OPEN_END_OPEN: so = 1, ec = 0; break;
+ case RANGE_START_OPEN_END_CLOSED: so = 1; ec = 1; break;
+ default: abort (); so = 0, ec = 0; break;
+ }
+ write_fmt_string (printcharfun, "%c%ld %ld%c ",
+ print_readably ? '(' : so ? '(' : '[',
+ (long) (rte->first - so),
+ (long) (rte->last - ec),
+ print_readably ? ')' : ec ? ']' : ')'
+ );
print_internal (rte->val, printcharfun, 1);
}
- write_c_string (printcharfun, "))");
+ if (print_readably)
+ write_c_string (printcharfun, "))");
+ else
+ write_fmt_string (printcharfun, " 0x%x>", rt->header.uid);
}
static int
@@ -180,7 +241,7 @@ verify_range_table (Lisp_Range_Table *rt
struct range_table_entry *rte = Dynarr_atp (rt->entries, i);
assert (rte->last >= rte->first);
if (i > 0)
- assert (Dynarr_at (rt->entries, i - 1).last < rte->first);
+ assert (Dynarr_at (rt->entries, i - 1).last <= rte->first);
}
}
@@ -207,8 +268,8 @@ get_range_table (EMACS_INT pos, int nent
of the list), so NEWPOS must round down. */
int newpos = (left + right) >> 1;
struct range_table_entry *entry = tab + newpos;
- if (pos > entry->last)
- left = newpos+1;
+ if (pos >= entry->last)
+ left = newpos + 1;
else if (pos < entry->first)
right = newpos;
else
@@ -226,16 +287,50 @@ Return non-nil if OBJECT is a range tabl
return RANGE_TABLEP (object) ? Qt : Qnil;
}
-DEFUN ("make-range-table", Fmake_range_table, 0, 0, 0, /*
+DEFUN ("range-table-type", Frange_table_type, 1, 1, 0, /*
+Return non-nil if OBJECT is a range table.
+*/
+ (range_table))
+{
+ CHECK_RANGE_TABLE (range_table);
+ return range_table_type_to_symbol (XRANGE_TABLE (range_table)->type);
+}
+
+DEFUN ("make-range-table", Fmake_range_table, 0, 1, 0, /*
Return a new, empty range table.
You can manipulate it using `put-range-table', `get-range-table',
`remove-range-table', and `clear-range-table'.
+Range tables allow you to efficiently set values for ranges of integers.
+
+ TYPE is a symbol indicating how ranges are assumed to function at their
+ ends. It can be one of
+
+ SYMBOL RANGE-START RANGE-END
+ ------ ----------- ---------
+ `start-closed-end-open' (the default) closed open
+ `start-closed-end-closed' closed closed
+ `start-open-end-open' open open
+ `start-open-end-closed' open closed
+
+ A `closed' endpoint of a range means that the number at that end is included
+ in the range. For an `open' endpoint, the number would not be included.
+
+ For example, a closed-open range from 5 to 20 would be indicated as [5,
+ 20) where a bracket indicates a closed end and a parenthesis an open end,
+ and would mean `all the numbers between 5 and 20', including 5 but not 20.
+ This seems a little strange at first but is in fact extremely common in
+ the outside world as well as in computers and makes things work sensibly.
+ For example, if I say "there are seven days between today and next week
+ today", I'm including today but not next week today; if I included both,
+ there would be eight days. Similarly, there are 15 (= 20 - 5) elements in
+ the range [5, 20), but 16 in the range [5, 20].
*/
- ())
+ (type))
{
Lisp_Range_Table *rt = alloc_lcrecord_type (Lisp_Range_Table,
&lrecord_range_table);
rt->entries = Dynarr_new (range_table_entry);
+ rt->type = range_table_symbol_to_type (type);
return wrap_range_table (rt);
}
@@ -253,6 +348,7 @@ The values will not themselves be copied
rtnew = alloc_lcrecord_type (Lisp_Range_Table, &lrecord_range_table);
rtnew->entries = Dynarr_new (range_table_entry);
+ rtnew->type = rt->type;
Dynarr_add_many (rtnew->entries, Dynarr_atp (rt->entries, 0),
Dynarr_length (rt->entries));
@@ -284,6 +380,24 @@ put_range_table (Lisp_Object table, EMAC
int insert_me_here = -1;
Lisp_Range_Table *rt = XRANGE_TABLE (table);
+ /* Fix up the numbers in accordance with the open/closedness to make
+ them behave like default open/closed. */
+
+ switch (rt->type)
+ {
+ case RANGE_START_CLOSED_END_OPEN: break;
+ case RANGE_START_CLOSED_END_CLOSED: last++; break;
+ case RANGE_START_OPEN_END_OPEN: first++; break;
+ case RANGE_START_OPEN_END_CLOSED: first++, last++; break;
+ }
+
+ if (first == last)
+ return;
+ if (first > last)
+ /* This will happen if originally first == last and both ends are
+ open. #### Should we signal an error? */
+ return;
+
/* Now insert in the proper place. This gets tricky because
we may be overlapping one or more existing ranges and need
to fix them up. */
@@ -304,44 +418,55 @@ put_range_table (Lisp_Object table, EMAC
/* completely after the new range. No more possibilities of
finding overlapping ranges. */
break;
+ /* At this point the existing ENTRY overlaps or touches the new one. */
if (entry->first < first && entry->last <= last)
{
/* looks like:
+
+ [ NEW )
+ [ EXISTING )
- [ NEW ]
- [ EXISTING ]
+ or
+ [ NEW )
+ [ EXISTING )
+
*/
/* truncate the end off of it. */
- entry->last = first - 1;
+ entry->last = first;
}
else if (entry->first < first && entry->last > last)
/* looks like:
- [ NEW ]
- [ EXISTING ]
+ [ NEW )
+ [ EXISTING )
*/
/* need to split this one in two. */
{
struct range_table_entry insert_me_too;
- insert_me_too.first = last + 1;
+ insert_me_too.first = last;
insert_me_too.last = entry->last;
insert_me_too.val = entry->val;
- entry->last = first - 1;
+ entry->last = first;
Dynarr_insert_many (rt->entries, &insert_me_too, 1, i + 1);
}
- else if (entry->last > last)
+ else if (entry->last >= last)
{
/* looks like:
+
+ [ NEW )
+ [ EXISTING )
- [ NEW ]
- [ EXISTING ]
+ or
+ [ NEW )
+ [ EXISTING )
+
*/
/* truncate the start off of it. */
- entry->first = last + 1;
+ entry->first = last;
}
else
{
@@ -377,7 +502,7 @@ put_range_table (Lisp_Object table, EMAC
{
struct range_table_entry *entry = Dynarr_atp (rt->entries,
insert_me_here - 1);
- if (EQ (val, entry->val) && entry->last == first - 1)
+ if (EQ (val, entry->val) && entry->last == first)
{
entry->last = last;
Dynarr_delete_many (rt->entries, insert_me_here, 1);
@@ -392,7 +517,7 @@ put_range_table (Lisp_Object table, EMAC
{
struct range_table_entry *entry = Dynarr_atp (rt->entries,
insert_me_here + 1);
- if (EQ (val, entry->val) && entry->first == last + 1)
+ if (EQ (val, entry->val) && entry->first == last)
{
entry->first = first;
Dynarr_delete_many (rt->entries, insert_me_here, 1);
@@ -401,7 +526,7 @@ put_range_table (Lisp_Object table, EMAC
}
DEFUN ("put-range-table", Fput_range_table, 4, 4, 0, /*
-Set the value for range (START, END) to be VALUE in RANGE-TABLE.
+Set the value for range START .. END to be VALUE in RANGE-TABLE.
*/
(start, end, value, range_table))
{
@@ -421,7 +546,7 @@ Set the value for range (START, END) to
}
DEFUN ("remove-range-table", Fremove_range_table, 3, 3, 0, /*
-Remove the value for range (START, END) in RANGE-TABLE.
+Remove the value for range START .. END in RANGE-TABLE.
*/
(start, end, range_table))
{
@@ -491,6 +616,15 @@ exactly once) if FUNCTION modifies or de
/************************************************************************/
static int
+rangetab_type_validate (Lisp_Object UNUSED (keyword), Lisp_Object value,
+ Error_Behavior UNUSED (errb))
+{
+ /* #### should deal with ERRB */
+ range_table_symbol_to_type (value);
+ return 1;
+}
+
+static int
rangetab_data_validate (Lisp_Object UNUSED (keyword), Lisp_Object value,
Error_Behavior UNUSED (errb))
{
@@ -509,27 +643,31 @@ rangetab_data_validate (Lisp_Object UNUS
}
static Lisp_Object
-rangetab_instantiate (Lisp_Object data)
+rangetab_instantiate (Lisp_Object plist)
{
- Lisp_Object rangetab = Fmake_range_table ();
+ Lisp_Object data = Qnil, type = Qnil;
- if (!NILP (data))
+ PROPERTY_LIST_LOOP_3 (key, value, plist)
{
- data = Fcar (Fcdr (data)); /* skip over 'data keyword */
- while (!NILP (data))
- {
- Lisp_Object range = Fcar (data);
- Lisp_Object val = Fcar (Fcdr (data));
-
- data = Fcdr (Fcdr (data));
- if (CONSP (range))
- Fput_range_table (Fcar (range), Fcar (Fcdr (range)), val,
- rangetab);
- else
- Fput_range_table (range, range, val, rangetab);
- }
+ if (EQ (key, Qtype)) type = value;
+ else if (EQ (key, Qdata)) data = value;
+ else
+ abort ();
}
+ Lisp_Object rangetab = Fmake_range_table (type);
+
+ {
+ PROPERTY_LIST_LOOP_3 (range, val, data)
+ {
+ if (CONSP (range))
+ Fput_range_table (Fcar (range), Fcar (Fcdr (range)), val,
+ rangetab);
+ else
+ Fput_range_table (range, range, val, rangetab);
+ }
+ }
+
return rangetab;
}
@@ -733,7 +871,13 @@ syms_of_rangetab (void)
DEFSYMBOL_MULTIWORD_PREDICATE (Qrange_tablep);
DEFSYMBOL (Qrange_table);
+ DEFSYMBOL (Qstart_closed_end_open);
+ DEFSYMBOL (Qstart_open_end_open);
+ DEFSYMBOL (Qstart_closed_end_closed);
+ DEFSYMBOL (Qstart_open_end_closed);
+
DEFSUBR (Frange_table_p);
+ DEFSUBR (Frange_table_type);
DEFSUBR (Fmake_range_table);
DEFSUBR (Fcopy_range_table);
DEFSUBR (Fget_range_table);
@@ -751,4 +895,5 @@ structure_type_create_rangetab (void)
st = define_structure_type (Qrange_table, 0, rangetab_instantiate);
define_structure_type_keyword (st, Qdata, rangetab_data_validate);
+ define_structure_type_keyword (st, Qtype, rangetab_type_validate);
}
Index: src/rangetab.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/rangetab.h,v
retrieving revision 1.5
diff -u -p -r1.5 rangetab.h
--- src/rangetab.h 2002/03/29 04:48:22 1.5
+++ src/rangetab.h 2004/12/05 22:10:16
@@ -1,6 +1,6 @@
/* XEmacs routines to deal with range tables.
Copyright (C) 1995 Sun Microsystems, Inc.
- Copyright (C) 1995 Ben Wing.
+ Copyright (C) 1995, 2004 Ben Wing.
This file is part of XEmacs.
@@ -39,10 +39,19 @@ typedef struct
Dynarr_declare (range_table_entry);
} range_table_entry_dynarr;
+enum range_table_type
+{
+ RANGE_START_CLOSED_END_OPEN,
+ RANGE_START_CLOSED_END_CLOSED,
+ RANGE_START_OPEN_END_CLOSED,
+ RANGE_START_OPEN_END_OPEN
+};
+
struct Lisp_Range_Table
{
struct lcrecord_header header;
range_table_entry_dynarr *entries;
+ enum range_table_type type;
};
typedef struct Lisp_Range_Table Lisp_Range_Table;
Index: src/realpath.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/realpath.c,v
retrieving revision 1.19
diff -u -p -r1.19 realpath.c
--- src/realpath.c 2004/11/04 23:06:48 1.19
+++ src/realpath.c 2004/12/05 22:10:16
@@ -105,7 +105,7 @@ readlink_and_correct_case (const Ibyte *
errno = ENOENT;
return -1;
}
- else if (qxestrlen (name) >= PATH_MAX)
+ else if (qxestrlen (name) >= PATH_MAX_INTERNAL)
{
errno = ENAMETOOLONG;
return -1;
@@ -170,12 +170,12 @@ readlink_and_correct_case (const Ibyte *
Ibyte *
qxe_realpath (const Ibyte *path, Ibyte *resolved_path)
{
- Ibyte copy_path[PATH_MAX];
+ Ibyte copy_path[PATH_MAX_INTERNAL];
Ibyte *new_path = resolved_path;
Ibyte *max_path;
#if defined (HAVE_READLINK) || defined (WIN32_ANY)
int readlinks = 0;
- Ibyte link_path[PATH_MAX];
+ Ibyte link_path[PATH_MAX_INTERNAL];
int n;
int abslen = abs_start (path);
#endif
@@ -185,7 +185,7 @@ qxe_realpath (const Ibyte *path, Ibyte *
/* Make a copy of the source path since we may need to modify it. */
qxestrcpy (copy_path, path);
path = copy_path;
- max_path = copy_path + PATH_MAX - 2;
+ max_path = copy_path + PATH_MAX_INTERNAL - 2;
if (0)
;
@@ -216,14 +216,14 @@ qxe_realpath (const Ibyte *path, Ibyte *
/* No drive letter, but a beginning slash? Prepend drive letter. */
else if (abslen == 1)
{
- get_initial_directory (new_path, PATH_MAX - 1);
+ get_initial_directory (new_path, PATH_MAX_INTERNAL - 1);
new_path += 3;
path++;
}
/* Just a path name, prepend the current directory */
else
{
- get_initial_directory (new_path, PATH_MAX - 1);
+ get_initial_directory (new_path, PATH_MAX_INTERNAL - 1);
new_path += qxestrlen (new_path);
if (!IS_DIRECTORY_SEP (new_path[-1]))
*new_path++ = DIRECTORY_SEP;
@@ -232,7 +232,7 @@ qxe_realpath (const Ibyte *path, Ibyte *
/* If it's a relative pathname use get_initial_directory for starters. */
else if (abslen == 0)
{
- get_initial_directory (new_path, PATH_MAX - 1);
+ get_initial_directory (new_path, PATH_MAX_INTERNAL - 1);
new_path += qxestrlen (new_path);
if (!IS_DIRECTORY_SEP (new_path[-1]))
*new_path++ = DIRECTORY_SEP;
@@ -297,7 +297,7 @@ qxe_realpath (const Ibyte *path, Ibyte *
/* See if latest pathname component is a symlink or needs case
correction. */
*new_path = '\0';
- n = readlink_and_correct_case (resolved_path, link_path, PATH_MAX - 1);
+ n = readlink_and_correct_case (resolved_path, link_path, PATH_MAX_INTERNAL - 1);
if (n < 0)
{
@@ -337,7 +337,7 @@ qxe_realpath (const Ibyte *path, Ibyte *
assert (new_path > resolved_path);
/* Safe sex check. */
- if (qxestrlen (path) + n >= PATH_MAX)
+ if (qxestrlen (path) + n >= PATH_MAX_INTERNAL)
{
errno = ENAMETOOLONG;
return NULL;
Index: src/regex.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/regex.c,v
retrieving revision 1.53
diff -u -p -r1.53 regex.c
--- src/regex.c 2004/11/04 23:06:50 1.53
+++ src/regex.c 2004/12/05 22:10:18
@@ -419,7 +419,7 @@ Lisp_Object Vthe_lisp_rangetab;
void
vars_of_regex (void)
{
- Vthe_lisp_rangetab = Fmake_range_table ();
+ Vthe_lisp_rangetab = Fmake_range_table (Qstart_closed_end_closed);
staticpro (&Vthe_lisp_rangetab);
}
Index: src/search.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/search.c,v
retrieving revision 1.44
diff -u -p -r1.44 search.c
--- src/search.c 2004/11/04 23:06:51 1.44
+++ src/search.c 2004/12/05 22:10:19
@@ -3173,6 +3173,6 @@ occur and a back reference to one of the
*/ );
warn_about_possibly_incompatible_back_references = 1;
- Vskip_chars_range_table = Fmake_range_table ();
+ Vskip_chars_range_table = Fmake_range_table (Qstart_closed_end_closed);
staticpro (&Vskip_chars_range_table);
}
Index: src/symbols.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/symbols.c,v
retrieving revision 1.46
diff -u -p -r1.46 symbols.c
--- src/symbols.c 2004/11/04 23:06:54 1.46
+++ src/symbols.c 2004/12/05 22:10:20
@@ -2100,9 +2100,8 @@ of previous SYMBOLs.
(args))
{
/* This function can GC */
- Lisp_Object symbol, tail, val = Qnil;
int nargs;
- struct gcpro gcpro1;
+ Lisp_Object retval = Qnil;
GET_LIST_LENGTH (args, nargs);
@@ -2110,16 +2109,15 @@ of previous SYMBOLs.
Fsignal (Qwrong_number_of_arguments,
list2 (Qsetq_default, make_int (nargs)));
- GCPRO1 (val);
-
- PROPERTY_LIST_LOOP (tail, symbol, val, args)
+ GC_PROPERTY_LIST_LOOP_3 (symbol, val, args)
{
val = Feval (val);
Fset_default (symbol, val);
+ retval = val;
}
- UNGCPRO;
- return val;
+ END_GC_PROPERTY_LIST_LOOP (symbol);
+ return retval;
}
/* Lisp functions for creating and removing buffer-local variables. */
Index: src/sysdep.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysdep.c,v
retrieving revision 1.77
diff -u -p -r1.77 sysdep.c
--- src/sysdep.c 2004/11/04 23:06:55 1.77
+++ src/sysdep.c 2004/12/05 22:10:22
@@ -3139,7 +3139,7 @@ qxe_allocating_getcwd (void)
}
}
#else
- Extbyte chingame_limitos_arbitrarios[PATH_MAX];
+ Extbyte chingame_limitos_arbitrarios[PATH_MAX_EXTERNAL];
Ibyte *ret2;
if (!getwd (chingame_limitos_arbitrarios))
Index: src/sysfile.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysfile.h,v
retrieving revision 1.18
diff -u -p -r1.18 sysfile.h
--- src/sysfile.h 2004/11/04 23:06:55 1.18
+++ src/sysfile.h 2004/12/05 22:10:22
@@ -1,6 +1,6 @@
/*
Copyright (C) 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.
@@ -267,19 +267,42 @@ Boston, MA 02111-1307, USA. */
#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
#endif
-/* Client .c files should simply use `PATH_MAX'. */
-#ifndef PATH_MAX
-# if defined (_MAX_PATH)
+/* Determining the maximum pathname length.
+
+ NOTE: IN GENERAL, YOU SHOULD NOT USE THIS.
+ If at all possible, avoid using fixed-length buffers of any sort.
+ You cannot guarantee on many systems that pathnames won't exceed
+ these limits for one reason or another.
+
+ Unfortunately, there is no universal agreement over whether these
+ values should include a final null-terminator or not. Even recent
+ versions of Linux (circa 2002) are switching from the not-including-
+ terminator kind to the including-terminator kind. So we assume that
+ the including-terminator kind will be even (usually is), and round
+ up as necessary. */
+
+#define ROUND_UP_TO_EVEN_NUMBER(val) (((val + 1) >> 1) << 1)
+#ifdef PATH_MAX
+# define QXE_PATH_MAX ROUND_UP_TO_EVEN_NUMBER (PATH_MAX)
+#elif defined (_MAX_PATH)
/* MS Win -- and preferable to _POSIX_PATH_MAX, which is also defined */
-# define PATH_MAX _MAX_PATH
-# elif defined (_POSIX_PATH_MAX)
-# define PATH_MAX _POSIX_PATH_MAX
-# elif defined (MAXPATHLEN)
-# define PATH_MAX MAXPATHLEN
-# else
-# define PATH_MAX 1024
-# endif
-#endif
+# define QXE_PATH_MAX ROUND_UP_TO_EVEN_NUMBER (_MAX_PATH)
+#elif defined (_POSIX_PATH_MAX)
+# define QXE_PATH_MAX ROUND_UP_TO_EVEN_NUMBER (_POSIX_PATH_MAX)
+#elif defined (MAXPATHLEN)
+# define QXE_PATH_MAX ROUND_UP_TO_EVEN_NUMBER (MAXPATHLEN)
+#else
+# define QXE_PATH_MAX 1024
+#endif
+
+/* Client .c files should use PATH_MAX_INTERNAL or PATH_MAX_EXTERNAL
+ if they must use either one at all. */
+
+/* Use for internally formatted text, which can potentially have up to
+ four bytes per character */
+#define PATH_MAX_INTERNAL (QXE_PATH_MAX * MAX_ICHAR_LEN)
+/* Use for externally formatted text. */
+#define PATH_MAX_EXTERNAL (QXE_PATH_MAX * MAX_XETCHAR_SIZE)
/* The following definitions are needed under Windows, at least */
#ifndef X_OK
Index: src/syswindows.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/syswindows.h,v
retrieving revision 1.23
diff -u -p -r1.23 syswindows.h
--- src/syswindows.h 2004/11/04 23:06:55 1.23
+++ src/syswindows.h 2004/12/05 22:10:22
@@ -760,26 +760,26 @@ extern int mswindows_windows9x_p;
#define XETEXT(arg) XETEXT1(arg)
#define XECOPY_TCHAR(ptr, ch) \
(XEUNICODE_P ? (* (LPWSTR) (ptr) = L##ch) : (* (LPSTR) (ptr) = (ch)))
-#define xetcslen(arg) \
+#define qxetcslen(arg) \
(XEUNICODE_P ? wcslen ((wchar_t *) arg) : strlen (arg))
-#define xetcsbytelen(arg) \
+#define qxetcsbytelen(arg) \
(XEUNICODE_P ? wcslen ((wchar_t *) arg) * XETCHAR_SIZE : strlen (arg))
-#define xetcscmp(s1, s2) \
+#define qxetcscmp(s1, s2) \
(XEUNICODE_P ? wcscmp ((wchar_t *) s1, (wchar_t *) s2) \
: strcmp (s1, s2))
-#define xetcscpy(s1, s2) \
+#define qxetcscpy(s1, s2) \
(XEUNICODE_P ? (char *) wcscpy ((wchar_t *) s1, (wchar_t *) s2) \
: strcpy (s1, s2))
-#define xetcsncpy(s1, s2, n) \
+#define qxetcsncpy(s1, s2, n) \
(XEUNICODE_P ? (char *) wcsncpy ((wchar_t *) s1, (wchar_t *) s2, n) \
: strncpy (s1, s2, n))
-#define xetcschr(s, ch) \
+#define qxetcschr(s, ch) \
(XEUNICODE_P ? (char *) wcschr ((wchar_t *) s, (WCHAR) ch) \
: strchr (s, ch))
-#define xetcsrchr(s, ch) \
+#define qxetcsrchr(s, ch) \
(XEUNICODE_P ? (char *) wcsrchr ((wchar_t *) s, (WCHAR) ch) \
: strrchr (s, ch))
-#define xetcsdup(s) \
+#define qxetcsdup(s) \
(XEUNICODE_P ? (char *) wcsdup ((wchar_t *) s) \
: xstrdup (s))
@@ -793,7 +793,7 @@ extern int mswindows_windows9x_p;
EXTERNAL_TO_C_STRING_MALLOC (in, out, Qmswindows_tstr)
#define build_tstr_string(in) \
- make_ext_string (in, xetcsbytelen ((Extbyte *) in), Qmswindows_tstr)
+ make_ext_string (in, qxetcsbytelen ((Extbyte *) in), Qmswindows_tstr)
#define MAX_ANSI_CHAR_LEN 1
#define MAX_UNICODE_CHAR_LEN 2
Index: src/text.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/text.c,v
retrieving revision 1.22
diff -u -p -r1.22 text.c
--- src/text.c 2004/11/13 06:32:25 1.22
+++ src/text.c 2004/12/05 22:10:23
@@ -2136,7 +2136,7 @@ eito_malloc_1 (Eistring *ei)
int
eicmp_1 (Eistring *ei, Bytecount off, Charcount charoff,
Bytecount len, Charcount charlen, const Ibyte *data,
- const Eistring *ei2, int is_c, int fold_case)
+ const Eistring *ei2, int is_ascii, int fold_case)
{
assert ((off < 0) != (charoff < 0));
if (off < 0)
@@ -2153,7 +2153,7 @@ eicmp_1 (Eistring *ei, Bytecount off, Ch
assert (off >= 0 && off <= ei->bytelen_);
assert (len >= 0 && off + len <= ei->bytelen_);
assert ((data == 0) != (ei == 0));
- assert ((is_c != 0) == (data != 0));
+ assert ((is_ascii != 0) == (data != 0));
assert (fold_case >= 0 && fold_case <= 2);
{
@@ -2171,7 +2171,7 @@ eicmp_1 (Eistring *ei, Bytecount off, Ch
dstlen = ei2->bytelen_;
}
- if (is_c)
+ if (is_ascii)
ASSERT_ASCTEXT_ASCII_LEN ((Ascbyte *) dst, dstlen);
return (fold_case == 0 ? qxememcmp4 (src, len, dst, dstlen) :
@@ -4253,6 +4253,7 @@ dfc_convert_to_internal_format (dfc_conv
places. */
int count;
Ibyte_dynarr *conversion_in_dynarr;
+ Lisp_Object underlying_cs;
PROFILE_DECLARE ();
assert (!inhibit_non_essential_conversion_operations);
@@ -4277,18 +4278,37 @@ dfc_convert_to_internal_format (dfc_conv
internal_bind_int (&dfc_convert_to_internal_format_in_use,
dfc_convert_to_internal_format_in_use + 1);
- coding_system = get_coding_system_for_text_file (coding_system, 1);
+ /* The second call does the equivalent of both calls, but we need
+ the result after the first call (which wraps just a to-text
+ converter) as well as the result after the second call (which
+ also wraps an EOL-detection converter). */
+ underlying_cs = get_coding_system_for_text_file (coding_system, 0);
+ coding_system = get_coding_system_for_text_file (underlying_cs, 1);
if (source_type != DFC_TYPE_LISP_LSTREAM &&
sink_type != DFC_TYPE_LISP_LSTREAM &&
- coding_system_is_binary (coding_system))
+ coding_system_is_binary (underlying_cs))
{
#ifdef MULE
- const Ibyte *ptr = (const Ibyte *) source->data.ptr;
+ const Ibyte *ptr;
Bytecount len = source->data.len;
- const Ibyte *end = ptr + len;
+ const Ibyte *end;
+
+ /* Make sure no EOL conversion is needed. With a little work we
+ could handle EOL conversion as well but it may not be needed as an
+ optimization. */
+ if (!EQ (coding_system, underlying_cs))
+ {
+ for (ptr = (const Ibyte *) source->data.ptr, end = ptr + len;
+ ptr < end; ptr++)
+ {
+ if (*ptr == '\r' || *ptr == '\n')
+ goto the_hard_way;
+ }
+ }
- for (; ptr < end; ptr++)
+ for (ptr = (const Ibyte *) source->data.ptr, end = ptr + len;
+ ptr < end; ptr++)
{
Ibyte c = *ptr;
@@ -4314,25 +4334,38 @@ dfc_convert_to_internal_format (dfc_conv
involved */
else if (source_type != DFC_TYPE_LISP_LSTREAM &&
sink_type != DFC_TYPE_LISP_LSTREAM &&
- dfc_coding_system_is_unicode (coding_system))
+ dfc_coding_system_is_unicode (underlying_cs))
{
- const Ibyte *ptr = (const Ibyte *) source->data.ptr + 1;
+ const Ibyte *ptr;
Bytecount len = source->data.len;
- const Ibyte *end = ptr + len;
+ const Ibyte *end;
if (len & 1)
goto the_hard_way;
- for (; ptr < end; ptr += 2)
+ /* Make sure only ASCII/Latin-1 is involved */
+ for (ptr = (const Ibyte *) source->data.ptr + 1, end = ptr + len;
+ ptr < end; ptr += 2)
{
if (*ptr)
goto the_hard_way;
}
- ptr = (const Ibyte *) source->data.ptr;
- end = ptr + len;
+ /* Make sure no EOL conversion is needed. With a little work we
+ could handle EOL conversion as well but it may not be needed as an
+ optimization. */
+ if (!EQ (coding_system, underlying_cs))
+ {
+ for (ptr = (const Ibyte *) source->data.ptr, end = ptr + len;
+ ptr < end; ptr += 2)
+ {
+ if (*ptr == '\r' || *ptr == '\n')
+ goto the_hard_way;
+ }
+ }
- for (; ptr < end; ptr += 2)
+ for (ptr = (const Ibyte *) source->data.ptr, end = ptr + len;
+ ptr < end; ptr += 2)
{
Ibyte c = *ptr;
@@ -4360,9 +4393,9 @@ dfc_convert_to_internal_format (dfc_conv
Lisp_Object instream, outstream;
Lstream *reader, *writer;
-#ifdef WIN32_ANY
+#if defined (WIN32_ANY) || defined (MULE)
the_hard_way:
-#endif /* WIN32_ANY */
+#endif
delete_count = 0;
if (source_type == DFC_TYPE_LISP_LSTREAM)
instream = source->lisp_object;
Index: src/text.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/text.h,v
retrieving revision 1.25
diff -u -p -r1.25 text.h
--- src/text.h 2004/11/12 15:09:17 1.25
+++ src/text.h 2004/12/05 22:10:26
@@ -1420,10 +1420,10 @@ next_string_index (Lisp_Object s, Byteco
... 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 Ascbyte *c_string);
+ void eicpy_ascii (Eistring *eistr, const Ascbyte *ascstr);
... 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 Ascbyte *c_string, len);
+ void eicpy_ascii_len (Eistring *eistr, const Ascbyte *ascstr, 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,
@@ -1563,7 +1563,7 @@ next_string_index (Lisp_Object s, Byteco
void eicat_ei (Eistring *eistr, Eistring *eistr2);
... from another Eistring.
- void eicat_c (Eistring *eistr, Ascbyte *c_string);
+ void eicat_ascii (Eistring *eistr, Ascbyte *ascstr);
... 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);
@@ -1592,8 +1592,8 @@ next_string_index (Lisp_Object s, Byteco
void eisub_ei (Eistring *eistr, Bytecount off, Charcount charoff,
Bytecount len, Charcount charlen, Eistring *eistr2);
... with another Eistring.
- void eisub_c (Eistring *eistr, Bytecount off, Charcount charoff,
- Bytecount len, Charcount charlen, Ascbyte *c_string);
+ void eisub_ascii (Eistring *eistr, Bytecount off, Charcount charoff,
+ Bytecount len, Charcount charlen, Ascbyte *ascstr);
... 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,
@@ -1660,17 +1660,17 @@ next_string_index (Lisp_Object s, Byteco
Charcount eirstr_ei_off_char (Eistring *eistr, Eistring *eistr2,
Bytecount off, Charcount charoff);
- 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,
+ Bytecount eistr_ascii (Eistring *eistr, Ascbyte *ascstr);
+ Charcount eistr_ascii_char (Eistring *eistr, Ascbyte *ascstr);
+ Bytecount eistr_ascii_off (Eistring *eistr, Ascbyte *ascstr, Bytecount off,
Charcount charoff);
- Charcount eistr_c_off_char (Eistring *eistr, Ascbyte *c_string,
+ Charcount eistr_ascii_off_char (Eistring *eistr, Ascbyte *ascstr,
Bytecount off, Charcount charoff);
- 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 eirstr_ascii (Eistring *eistr, Ascbyte *ascstr);
+ Charcount eirstr_ascii_char (Eistring *eistr, Ascbyte *ascstr);
+ Bytecount eirstr_ascii_off (Eistring *eistr, Ascbyte *ascstr,
Bytecount off, Charcount charoff);
- Charcount eirstr_c_off_char (Eistring *eistr, Ascbyte *c_string,
+ Charcount eirstr_ascii_off_char (Eistring *eistr, Ascbyte *ascstr,
Bytecount off, Charcount charoff);
@@ -1711,17 +1711,17 @@ next_string_index (Lisp_Object s, Byteco
Charcount charoff, Bytecount len,
Charcount charlen, Eistring *eistr2);
- int eicmp_c (Eistring *eistr, Ascbyte *c_string);
- int eicmp_off_c (Eistring *eistr, Bytecount off, Charcount charoff,
- 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,
+ int eicmp_ascii (Eistring *eistr, Ascbyte *ascstr);
+ int eicmp_off_ascii (Eistring *eistr, Bytecount off, Charcount charoff,
+ Bytecount len, Charcount charlen, Ascbyte *ascstr);
+ int eicasecmp_ascii (Eistring *eistr, Ascbyte *ascstr);
+ int eicasecmp_off_ascii (Eistring *eistr, Bytecount off, Charcount charoff,
Bytecount len, Charcount charlen,
- Ascbyte *c_string);
- int eicasecmp_i18n_c (Eistring *eistr, Ascbyte *c_string);
- int eicasecmp_i18n_off_c (Eistring *eistr, Bytecount off, Charcount charoff,
+ Ascbyte *ascstr);
+ int eicasecmp_i18n_ascii (Eistring *eistr, Ascbyte *ascstr);
+ int eicasecmp_i18n_off_ascii (Eistring *eistr, Bytecount off, Charcount charoff,
Bytecount len, Charcount charlen,
- Ascbyte *c_string);
+ Ascbyte *ascstr);
**********************************************
@@ -1982,17 +1982,17 @@ do { \
EI_ALLOC_AND_COPY (ei, ei12p2, ei12p2len, 1); \
} while (0)
-#define eicpy_c(ei, c_string) \
+#define eicpy_ascii(ei, ascstr) \
do { \
- const Ascbyte *ei4 = (c_string); \
+ const Ascbyte *ei4 = (ascstr); \
\
ASSERT_ASCTEXT_ASCII (ei4); \
eicpy_ext (ei, ei4, Qbinary); \
} while (0)
-#define eicpy_c_len(ei, c_string, c_len) \
+#define eicpy_ascii_len(ei, ascstr, c_len) \
do { \
- const Ascbyte *ei6 = (c_string); \
+ const Ascbyte *ei6 = (ascstr); \
int ei6len = (c_len); \
\
ASSERT_ASCTEXT_ASCII_LEN (ei6, ei6len); \
@@ -2207,9 +2207,9 @@ do { \
eicat_1 (ei, ei9->data_, ei9->bytelen_, ei9->charlen_); \
} while (0)
-#define eicat_c(ei, c_string) \
+#define eicat_ascii(ei, ascstr) \
do { \
- const Ascbyte *ei15 = (c_string); \
+ const Ascbyte *ei15 = (ascstr); \
int ei15len = strlen (ei15); \
\
ASSERT_ASCTEXT_ASCII_LEN (ei15, ei15len); \
@@ -2286,9 +2286,9 @@ do { \
ei19->charlen_); \
} while (0)
-#define eisub_c(ei, off, charoff, len, charlen, c_string) \
+#define eisub_ascii(ei, off, charoff, len, charlen, ascstr) \
do { \
- const Ascbyte *ei20 = (c_string); \
+ const Ascbyte *ei20 = (ascstr); \
int ei20len = strlen (ei20); \
ASSERT_ASCTEXT_ASCII_LEN (ei20, ei20len); \
eisub_1 (ei, off, charoff, len, charlen, ei20, ei20len, -1); \
@@ -2369,21 +2369,21 @@ do { \
#define eirstr_ei_off_char(eistr, eistr2, off, charoff) \
NOT YET IMPLEMENTED
-#define eistr_c(eistr, c_string) \
+#define eistr_ascii(eistr, ascstr) \
NOT YET IMPLEMENTED
-#define eistr_c_char(eistr, c_string) \
+#define eistr_ascii_char(eistr, ascstr) \
NOT YET IMPLEMENTED
-#define eistr_c_off(eistr, c_string, off, charoff) \
+#define eistr_ascii_off(eistr, ascstr, off, charoff) \
NOT YET IMPLEMENTED
-#define eistr_c_off_char(eistr, c_string, off, charoff) \
+#define eistr_ascii_off_char(eistr, ascstr, off, charoff) \
NOT YET IMPLEMENTED
-#define eirstr_c(eistr, c_string) \
+#define eirstr_ascii(eistr, ascstr) \
NOT YET IMPLEMENTED
-#define eirstr_c_char(eistr, c_string) \
+#define eirstr_ascii_char(eistr, ascstr) \
NOT YET IMPLEMENTED
-#define eirstr_c_off(eistr, c_string, off, charoff) \
+#define eirstr_ascii_off(eistr, ascstr, off, charoff) \
NOT YET IMPLEMENTED
-#define eirstr_c_off_char(eistr, c_string, off, charoff) \
+#define eirstr_ascii_off_char(eistr, ascstr, off, charoff) \
NOT YET IMPLEMENTED
@@ -2406,18 +2406,18 @@ int eicmp_1 (Eistring *ei, Bytecount off
#define eicasecmp_i18n_off_ei(eistr, off, charoff, len, charlen, eistr2) \
eicmp_1 (eistr, off, charoff, len, charlen, 0, eistr2, 0, 2)
-#define eicmp_c(eistr, c_string) \
- eicmp_1 (eistr, 0, -1, -1, -1, c_string, 0, 1, 0)
-#define eicmp_off_c(eistr, off, charoff, len, charlen, c_string) \
- eicmp_1 (eistr, off, charoff, len, charlen, c_string, 0, 1, 0)
-#define eicasecmp_c(eistr, c_string) \
- eicmp_1 (eistr, 0, -1, -1, -1, c_string, 0, 1, 1)
-#define eicasecmp_off_c(eistr, off, charoff, len, charlen, c_string) \
- eicmp_1 (eistr, off, charoff, len, charlen, c_string, 0, 1, 1)
-#define eicasecmp_i18n_c(eistr, c_string) \
- eicmp_1 (eistr, 0, -1, -1, -1, c_string, 0, 1, 2)
-#define eicasecmp_i18n_off_c(eistr, off, charoff, len, charlen, c_string) \
- eicmp_1 (eistr, off, charoff, len, charlen, c_string, 0, 1, 2)
+#define eicmp_ascii(eistr, ascstr) \
+ eicmp_1 (eistr, 0, -1, -1, -1, (const Ibyte *) ascstr, 0, 1, 0)
+#define eicmp_off_ascii(eistr, off, charoff, len, charlen, ascstr) \
+ eicmp_1 (eistr, off, charoff, len, charlen, (const Ibyte *) ascstr, 0, 1, 0)
+#define eicasecmp_ascii(eistr, ascstr) \
+ eicmp_1 (eistr, 0, -1, -1, -1, (const Ibyte *) ascstr, 0, 1, 1)
+#define eicasecmp_off_ascii(eistr, off, charoff, len, charlen, ascstr) \
+ eicmp_1 (eistr, off, charoff, len, charlen, (const Ibyte *) ascstr, 0, 1, 1)
+#define eicasecmp_i18n_ascii(eistr, ascstr) \
+ eicmp_1 (eistr, 0, -1, -1, -1, (const Ibyte *) ascstr, 0, 1, 2)
+#define eicasecmp_i18n_off_ascii(eistr, off, charoff, len, charlen, ascstr) \
+ eicmp_1 (eistr, off, charoff, len, charlen, (const Ibyte *) ascstr, 0, 1, 2)
/* ----- Case-changing the Eistring ----- */
Index: src/unexcw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unexcw.c,v
retrieving revision 1.15
diff -u -p -r1.15 unexcw.c
--- src/unexcw.c 2004/09/20 19:20:05 1.15
+++ src/unexcw.c 2004/12/05 22:10:26
@@ -102,7 +102,7 @@ unexec (char *out_name, char *in_name, u
{
/* ugly nt hack - should be in lisp */
int a_new, a_out = -1;
- char new_name[PATH_MAX], a_name[PATH_MAX];
+ char new_name[PATH_MAX_EXTERNAL], a_name[PATH_MAX_EXTERNAL];
char *ptr;
/* Make sure that the input and output filenames have the
Index: src/unexnext.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unexnext.c,v
retrieving revision 1.2
diff -u -p -r1.2 unexnext.c
--- src/unexnext.c 2002/03/13 08:53:02 1.2
+++ src/unexnext.c 2004/12/05 22:10:26
@@ -279,7 +279,7 @@ static void unexec_doit(int infd,int out
void unexec(char *outfile,char *infile)
{
- char tmpfile[PATH_MAX];
+ char tmpfile[PATH_MAX_EXTERNAL];
int infd,outfd;
if ((infd=open(infile, O_RDONLY, 0))<0)
Index: src/unexnt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unexnt.c,v
retrieving revision 1.18
diff -u -p -r1.18 unexnt.c
--- src/unexnt.c 2004/11/04 23:06:57 1.18
+++ src/unexnt.c 2004/12/05 22:10:27
@@ -133,11 +133,11 @@ _start (void)
won't work.) */
if (heap_state == HEAP_UNLOADED)
{
- Extbyte executable_path[MAX_PATH * MAX_XETCHAR_SIZE];
+ Extbyte executable_path[PATH_MAX_EXTERNAL];
/* Don't use mswindows_get_module_file_name() because it uses
xmalloc() */
- if (qxeGetModuleFileName (NULL, executable_path, MAX_PATH) == 0)
+ if (qxeGetModuleFileName (NULL, executable_path, _MAX_PATH) == 0)
{
exit (1);
}
@@ -150,8 +150,8 @@ _start (void)
/* To allow profiling, make sure executable_path names the .exe
file, not the file created by the profiler */
- p = xetcsrchr (executable_path, '\\');
- xetcscpy (p + 1, XETEXT (PATH_PROGNAME ".exe"));
+ p = qxetcsrchr (executable_path, '\\');
+ qxetcscpy (p + 1, XETEXT (PATH_PROGNAME ".exe"));
}
#endif
cvs server: Diffing src/m
cvs server: Diffing src/s
cvs server: Diffing tests
cvs server: Diffing tests/DLL
cvs server: Diffing tests/Dnd
cvs server: Diffing tests/automated
cvs server: Diffing tests/gtk
cvs server: Diffing tests/mule
cvs server: Diffing tests/tooltalk