+1999-03-12 XEmacs Build Bot <builds@cvs.xemacs.org>
+
+ * XEmacs 21.2.13 is released
+
+1999-03-10 Martin Buchholz <martin@xemacs.org>
+
+ * fakemail.c (add_a_stream): Always use full ANSI prototypes.
+
+1999-03-06 Martin Buchholz <martin@xemacs.org>
+
+ * fakemail.c (main): Ansify.
+ (xmalloc): Ansify.
+ (xrealloc): Ansify.
+ (get_keyword): use paranoid casts ((int) (unsigned char) c) for
+ islower, toupper, isspace.
+
1999-03-05 XEmacs Build Bot <builds@cvs.xemacs.org>
* XEmacs 21.2.12 is released
#include <../src/config.h>
#if defined (BSD) && !defined (BSD4_1) && !defined (USE_FAKEMAIL)
-/* This program isnot used in BSD, so just avoid loader complaints. */
+/* This program is not used in BSD, so just avoid loader complaints. */
int
-main ()
+main (int argc, char *argv[])
{
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int
-main ()
+main (int argc, char *argv[])
{
/* Linux /bin/mail, if it exists, is NOT the Unix v7 mail that
fakemail depends on! This causes garbled mail. Better to
#else /* not BSD 4.2 (or newer) */
#ifdef MSDOS
int
-main ()
+main (int argc, char *argv[])
{
return 0;
}
struct header_record *previous;
};
typedef struct header_record *header;
-
+
struct stream_record
{
FILE *handle;
- int (*action)();
+ int (*action)(FILE *);
struct stream_record *rest_streams;
};
typedef struct stream_record *stream_list;
/* Like malloc but get fatal error if memory is exhausted. */
static char *
-xmalloc (size)
- size_t size;
+xmalloc (size_t size)
{
char *result = malloc (((unsigned) size));
if (result == ((char *) NULL))
}
static char *
-xrealloc (ptr, size)
- char *ptr;
- size_t size;
+xrealloc (char *ptr, size_t size)
{
char *result = realloc (ptr, ((unsigned) size));
if (result == ((char *) NULL))
}
/* Read a line of text from `stream' into `linebuffer'.
- * Return the length of the line.
+ * Return the length of the line.
*/
static long
ptr = &keyword[0];
c = *field++;
- if ((isspace (c)) || (c == ':'))
- return ((char *) NULL);
- *ptr++ = ((islower (c)) ? (toupper (c)) : c);
- while (((c = *field++) != ':') && (!(isspace (c))))
- *ptr++ = ((islower (c)) ? (toupper (c)) : c);
+ if ((isspace ((int) (unsigned char) c)) || (c == ':'))
+ return (char *) NULL;
+ *ptr++ = ((islower ((int) (unsigned char) c)) ?
+ (toupper ((int) (unsigned char) c)) : c);
+ while (((c = *field++) != ':') &&
+ (!(isspace ((int) (unsigned char) c))))
+ *ptr++ = ((islower ((int) (unsigned char) c)) ?
+ (toupper ((int) (unsigned char) c)) : c);
*ptr++ = '\0';
- while (isspace (c)) c = *field++;
- if (c != ':') return ((char *) NULL);
+ while (isspace ((int) (unsigned char) c)) c = *field++;
+ if (c != ':') return (char *) NULL;
*rest = field;
return &keyword[0];
}
}
static void
-add_a_stream (FILE *the_stream, int (*closing_action)())
+add_a_stream (FILE *the_stream, int (*closing_action)(FILE *))
{
stream_list old = the_streams;
the_streams = new_stream ();
*where = '\0';
return;
}
-\f
+\f
static header
read_header (void)
{
}
\f
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char *argv[])
{
char *command_line;
header the_header;
args_size (the_header)));
strcpy (command_line, mail_program_name);
parse_header (the_header, &command_line[name_length]);
-
+
the_pipe = popen (command_line, "w");
if (the_pipe == ((FILE *) NULL))
fatal ("cannot open pipe to real mailer", (char *) 0);
+1999-03-12 XEmacs Build Bot <builds@cvs.xemacs.org>
+
+ * XEmacs 21.2.13 is released
+
+1999-03-12 SL Baur <steve@xemacs.org>
+
+ * simple.el (delete-key-deletes-forward): Revert to previous
+ behavior.
+
+1999-01-18 Didier Verna <verna@inf.enst.fr>
+
+ * menubar-items.el (xemacs-splash-buffer): handle the case of
+ multiple elements in the splash buffer body.
+
+ * startup.el (splash-frame-timeout): new constant: interval
+ between splash buffer elements.
+ (command-line-1): handle splash buffer with multiple elements (use
+ a timeout).
+ (splash-frame-body): Originally `startup-splash-frame-body'.
+ Rewrote a cleaner and more readable version. This can now be array,
+ in which case each element is displayed in turn in the splash buffer.
+ (splash-frame-static-body): new constant. Persistent information
+ across all splash buffer elements (preserves the possibility to give
+ it in different languages.
+ (circulate-splash-frame-elements): new function. Used as a timeout
+ to circulate through all splash frame elements and display them in
+ sequence.
+ (display-splash-frame): originally `startup-splash-frame'. Handle
+ the case of multiple elements in the splash buffer body. Now
+ returns a timeout id if multiple elements to display, or nil.
+
+1999-02-19 Jan Vroonhof <vroonhof@math.ethz.ch>
+
+ * x-faces.el (x-init-global-faces): Add default tag to specifiers,
+ so they can be overridden by x-init-face-from-resources.
+ Additionally specify the font name also with an x tag.
+
+1999-03-08 Andy Piper <andy@xemacs.org>
+
+ * package-get.el (package-get-base): autoload.
+
+ * menubar-items.el (default-menubar): add update menu item. Fix
+ custom menu to only be activated when package-base is available.
+
+ * package-get.el (package-get-custom): don't load
+ package-get-custom as it is auto-generated. Fix group definition.
+
+1999-03-05 Didier Verna <verna@inf.enst.fr>
+
+ * cus-dep.el (Custom-make-dependencies): use `prin1-to-string'
+ instead of `symbol-name' (Thanks Kyle).
+
+ * cus-edit.el (custom-save-variables): use `prin1' instead of
+ princ to write symbols.
+
1999-03-05 XEmacs Build Bot <builds@cvs.xemacs.org>
* XEmacs 21.2.12 is released
-;;; alist.el --- utility functions about assoc-list
+;;; alist.el --- utility functions about association-list
-;; Copyright (C) 1993,1994,1995,1996 Free Software Foundation, Inc.
+;; Copyright (C) 1993,1994,1995,1996,1998 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version:
-;; $Id: alist.el,v 0.0 1997/02/28 02:18:23 tmorioka Exp $
;; Keywords: alist
-;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
+;; This file is part of APEL (A Portable Emacs Library).
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;;; Code:
+;;;###autoload
(defun put-alist (item value alist)
"Modify ALIST to set VALUE to ITEM.
If there is a pair whose car is ITEM, replace its cdr by VALUE.
(cons (cons item value) alist)
)))
+;;;###autoload
(defun del-alist (item alist)
"If there is a pair whose key is ITEM, delete it from ALIST.
\[tomo's ELIS emulating function]"
)
alist))))
+;;;###autoload
(defun set-alist (symbol item value)
"Modify a alist indicated by SYMBOL to set VALUE to ITEM."
(or (boundp symbol)
(set symbol (put-alist item value (symbol-value symbol)))
)
+;;;###autoload
(defun remove-alist (symbol item)
"Remove ITEM from the alist indicated by SYMBOL."
(and (boundp symbol)
(set symbol (del-alist item (symbol-value symbol)))
))
+;;;###autoload
(defun modify-alist (modifier default)
"Modify alist DEFAULT into alist MODIFIER."
(mapcar (function
modifier)
default)
+;;;###autoload
(defun set-modified-alist (sym modifier)
"Modify a value of a symbol SYM into alist MODIFIER.
The symbol SYM should be alist. If it is not bound,
;;;***
\f
+;;;### (autoloads (set-modified-alist modify-alist remove-alist set-alist del-alist put-alist) "alist" "lisp/alist.el")
+
+(autoload 'put-alist "alist" "\
+Modify ALIST to set VALUE to ITEM.
+If there is a pair whose car is ITEM, replace its cdr by VALUE.
+If there is not such pair, create new pair (ITEM . VALUE) and
+return new alist whose car is the new pair and cdr is ALIST.
+[tomo's ELIS like function]" nil nil)
+
+(autoload 'del-alist "alist" "\
+If there is a pair whose key is ITEM, delete it from ALIST.
+[tomo's ELIS emulating function]" nil nil)
+
+(autoload 'set-alist "alist" "\
+Modify a alist indicated by SYMBOL to set VALUE to ITEM." nil nil)
+
+(autoload 'remove-alist "alist" "\
+Remove ITEM from the alist indicated by SYMBOL." nil nil)
+
+(autoload 'modify-alist "alist" "\
+Modify alist DEFAULT into alist MODIFIER." nil nil)
+
+(autoload 'set-modified-alist "alist" "\
+Modify a value of a symbol SYM into alist MODIFIER.
+The symbol SYM should be alist. If it is not bound,
+its value regard as nil." nil nil)
+
+;;;***
+\f
;;;### (autoloads (apropos-documentation apropos-value apropos apropos-command) "apropos" "lisp/apropos.el")
(fset 'command-apropos 'apropos-command)
\f
;;;### (autoloads (package-get-custom package-get-package-provider package-get package-get-dependencies package-get-all package-get-update-all package-get-delete-package package-get-save-base package-get-update-base-from-buffer package-get-update-base package-get-update-base-entry package-get-require-base package-get-download-menu) "package-get" "lisp/package-get.el")
+(defvar package-get-base nil "\
+List of packages that are installed at this site.
+For each element in the alist, car is the package name and the cdr is
+a plist containing information about the package. Typical fields
+kept in the plist are:
+
+version - version of this package
+provides - list of symbols provided
+requires - list of symbols that are required.
+ These in turn are provided by other packages.
+filename - name of the file.
+size - size of the file (aka the bundled package)
+md5sum - computed md5 checksum
+description - What this package is for.
+type - Whether this is a 'binary (default) or 'single file package
+
+More fields may be added as needed. An example:
+
+'(
+ (name
+ (version \"<version 2>\"
+ file \"filename\"
+ description \"what this package is about.\"
+ provides (<list>)
+ requires (<list>)
+ size <integer-bytes>
+ md5sum \"<checksum\"
+ type single
+ )
+ (version \"<version 1>\"
+ file \"filename\"
+ description \"what this package is about.\"
+ provides (<list>)
+ requires (<list>)
+ size <integer-bytes>
+ md5sum \"<checksum\"
+ type single
+ )
+ ...
+ ))
+
+For version information, it is assumed things are listed in most
+recent to least recent -- in other words, the version names don't have to
+be lexically ordered. It is debatable if it makes sense to have more than
+one version of a package available.")
+
(autoload 'package-get-download-menu "package-get" "\
Build the `Add Download Site' menu." nil nil)
(if found
(insert " ")
(insert "(custom-add-loads '"
- (symbol-name sym) " '("))
+ (prin1-to-string sym) " '("))
(prin1 where (current-buffer))
(push where found)))
(when found
(not (get symbol 'force-value)))))))
(when value
(princ "\n '(")
- (princ symbol)
+ (prin1 symbol)
(princ " ")
(prin1 (car value))
(cond (requests
;; Don't print default face here.
value)
(princ "\n '(")
- (princ symbol)
+ (prin1 symbol)
(princ " ")
(prin1 value)
(if (or (get symbol 'face-defface-spec)
(custom-add-loads 'isearch '("isearch-mode"))
(custom-add-loads 'font-lock-faces '("font-lock"))
(custom-add-loads 'modeline '("modeline"))
-(custom-add-loads 'editing '("simple" "abbrev" "fill" "mouse" "cus-edit" "dragdrop"))
+(custom-add-loads 'editing '("simple" "abbrev" "fill" "mouse" "dragdrop" "cus-edit"))
(custom-add-loads 'matching '("simple" "isearch-mode" "hyper-apropos"))
(custom-add-loads 'i18n '("cus-edit"))
(custom-add-loads 'info '("toolbar-items" "info"))
(package-get-download-menu)))
["Update Package Index" package-get-update-base]
["List & Install" pui-list-packages]
- ("Using Custom"
- ("Select" :filter (lambda (&rest junk)
- (cdr (custom-menu-create 'packages))))
- ["Update" package-get-custom])
+ ["Update Installed Packages" package-get-update-all]
+ ;; hack-o-matic, we can't force a laod of package-base here
+ ;; since it triggers dialog box interactions which we can't
+ ;; deal while using a menu
+ ("Using Custom"
+ :filter (lambda (&rest junk)
+ (if package-get-base
+ (cdr (custom-menu-create 'packages))
+ '(["Please load Package Index" (lamda (&rest junk) ()) nil]))))
+
["Help" (Info-goto-node "(xemacs)Packages")])
"---"
(defun xemacs-splash-buffer ()
"Redisplay XEmacs splash screen in a buffer."
(interactive)
- (let ((buffer (get-buffer-create "*Splash*")))
+ (let ((buffer (get-buffer-create "*Splash*"))
+ tmout)
(set-buffer buffer)
+ (setq buffer-read-only t)
(erase-buffer buffer)
- (startup-splash-frame)
+ (setq tmout (display-splash-frame))
+ (when tmout
+ (make-local-hook 'kill-buffer-hook)
+ (add-hook 'kill-buffer-hook
+ `(lambda ()
+ (disable-timeout ,tmout))
+ nil t))
(pop-to-buffer buffer)
(delete-other-windows)))
"Automatic Package Fetcher and Installer."
:prefix "package-get"
:group 'package-tools)
-
+
+;;;###autoload
(defvar package-get-base nil
"List of packages that are installed at this site.
For each element in the alist, car is the package name and the cdr is
"Fetch and install the latest versions of all customized packages."
(interactive)
(package-get-require-base t)
- ;; Load a fresh copy
- (load "package-get-custom.el")
(mapcar (lambda (pkg)
(if (eval (intern (concat (symbol-name (car pkg)) "-package")))
(package-get (car pkg) nil))
(custom-var (intern (concat (symbol-name package) "-package")))
(description (plist-get props 'description)))
(when (not (memq group package-get-custom-groups))
- (setq package-get-custom-groups (cons package
+ (setq package-get-custom-groups (cons group
package-get-custom-groups))
(eval `(defgroup ,group nil
,(concat category " package group")
(and overwrite-mode (not (eolp))
(save-excursion (insert-char ?\ arg))))
-(defcustom delete-key-deletes-forward t
+(defcustom delete-key-deletes-forward nil
"*If non-nil, the DEL key will erase one character forwards.
If nil, the DEL key will erase one character backwards."
:type 'boolean
(defvar command-line-processed nil "t once command line has been processed")
(defconst startup-message-timeout 12000) ; More or less disable the timeout
+(defconst splash-frame-timeout 7) ; interval between splash frame elements
(defconst inhibit-startup-message nil
"*Non-nil inhibits the initial startup message.
(when (string= (buffer-name) "*scratch*")
(unless (or inhibit-startup-message
(input-pending-p))
- (let ((timeout nil))
+ (let (tmout circ-tmout)
(unwind-protect
;; Guts of with-timeout
- (catch 'timeout
- (setq timeout (add-timeout startup-message-timeout
- (lambda (ignore)
- (condition-case nil
- (throw 'timeout t)
- (error nil)))
- nil))
- (startup-splash-frame)
+ (catch 'tmout
+ (setq tmout (add-timeout startup-message-timeout
+ (lambda (ignore)
+ (condition-case nil
+ (throw 'tmout t)
+ (error nil)))
+ nil))
+ (setq circ-tmout (display-splash-frame))
(or nil;; (pos-visible-in-window-p (point-min))
(goto-char (point-min)))
(sit-for 0)
(setq unread-command-event (next-command-event)))
- (when timeout (disable-timeout timeout)))))
+ (when tmout (disable-timeout tmout))
+ (when circ-tmout (disable-timeout circ-tmout)))))
(with-current-buffer (get-buffer "*scratch*")
;; In case the XEmacs server has already selected
;; another buffer, erase the one our message is in.
(symbol-name e)))
(defun splash-frame-present-hack (e v)
- ;; (set-extent-property e 'mouse-face 'highlight)
- ;; (set-extent-property e 'keymap
- ;; startup-presentation-hack-keymap)
- ;; (set-extent-property e 'startup-presentation-hack v)
- ;; (set-extent-property e 'help-echo
- ;; 'startup-presentation-hack-help))
+ ;; (set-extent-property e 'mouse-face 'highlight)
+ ;; (set-extent-property e 'keymap
+ ;; startup-presentation-hack-keymap)
+ ;; (set-extent-property e 'startup-presentation-hack v)
+ ;; (set-extent-property e 'help-echo
+ ;; 'startup-presentation-hack-help)
)
(defun splash-hack-version-string ()
(+ left-margin
(round (/ (/ (- fill-area-width glyph-pixwidth) 2) avg-pixwidth)))))
-(defun startup-splash-frame-body ()
- `("\n" ,(emacs-version) "\n"
- ,@(if (string-match "beta" emacs-version)
- `( (face (bold blue) ( "This is an Experimental version of XEmacs. "
- " Type " (key describe-beta)
- " to see what this means.\n")))
- `( "\n"))
- (face bold-italic "\
-Copyright (C) 1985-1998 Free Software Foundation, Inc.
-Copyright (C) 1990-1994 Lucid, Inc.
-Copyright (C) 1993-1997 Sun Microsystems, Inc. All Rights Reserved.
-Copyright (C) 1994-1996 Board of Trustees, University of Illinois
-Copyright (C) 1995-1996 Ben Wing\n\n")
-
- ,@(if (featurep 'sparcworks)
- `( "\
+(defun splash-frame-body ()
+ `[((face (blue bold underline)
+ "\nDistribution, copying license, warranty:\n\n")
+ "Please visit the XEmacs website at http://www.xemacs.org !\n\n"
+ ,@(if (featurep 'sparcworks)
+ `( "\
Sun provides support for the WorkShop/XEmacs integration package only.
-All other XEmacs packages are provided to you \"AS IS\".
-For full details, type " (key describe-no-warranty)
-" to refer to the GPL Version 2, dated June 1991.\n\n"
-,@(let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES") (getenv "LANG"))))
- (if (and
- (not (featurep 'mule)) ; Already got mule?
- (not (eq 'tty (console-type))) ; No Mule support on tty's yet
- lang ; Non-English locale?
- (not (string= lang "C"))
- (not (string-match "^en" lang))
- (locate-file "xemacs-mule" exec-path)) ; Comes with Sun WorkShop
- '( "\
+All other XEmacs packages are provided to you \"AS IS\".\n"
+ ,@(let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES")
+ (getenv "LANG"))))
+ (if (and
+ (not (featurep 'mule)) ;; Already got mule?
+ ;; No Mule support on tty's yet
+ (not (eq 'tty (console-type)))
+ lang ;; Non-English locale?
+ (not (string= lang "C"))
+ (not (string-match "^en" lang))
+ ;; Comes with Sun WorkShop
+ (locate-file "xemacs-mule" exec-path))
+ '( "\
This version of XEmacs has been built with support for Latin-1 languages only.
To handle other languages you need to run a Multi-lingual (`Mule') version of
XEmacs, by either running the command `xemacs-mule', or by using the X resource
-`ESERVE*defaultXEmacsPath: xemacs-mule' when starting XEmacs from Sun WorkShop.\n\n"))))
-
- '("XEmacs comes with ABSOLUTELY NO WARRANTY; type "
- (key describe-no-warranty) " for full details.\n"))
+`ESERVE*defaultXEmacsPath: xemacs-mule' when starting XEmacs from Sun WorkShop.
+\n")))))
+ ((key describe-no-warranty)
+ ": "(face (red bold) "XEmacs comes with ABSOLUTELY NO WARRANTY\n"))
+ ((key describe-copying)
+ ": conditions to give out copies of XEmacs\n")
+ ((key describe-distribution)
+ ": how to get the latest version\n")
+ "\n--\n"
+ (face italic "\
+Copyright (C) 1985-1998 Free Software Foundation, Inc.
+Copyright (C) 1990-1994 Lucid, Inc.
+Copyright (C) 1993-1997 Sun Microsystems, Inc. All Rights Reserved.
+Copyright (C) 1994-1996 Board of Trustees, University of Illinois
+Copyright (C) 1995-1996 Ben Wing\n"))
- "You may give out copies of XEmacs; type "
- (key describe-copying) " to see the conditions.\n"
- "Type " (key describe-distribution)
- " for information on getting the latest version.\n\n"
-
- "Type " (key help-command) " or use the " (face bold "Help") " menu to get help.\n"
- "Type " (key advertised-undo) " to undo changes (`C-' means use the Control key).\n"
- "To get out of XEmacs, type " (key save-buffers-kill-emacs) ".\n"
- "Type " (key help-with-tutorial) " for a tutorial on using XEmacs.\n"
- "Type " (key info) " to enter Info, "
- "which you can use to read online documentation.\n"
- (face (bold red) ( "\
-For tips and answers to frequently asked questions, see the XEmacs FAQ.
-\(It's on the Help menu, or type " (key xemacs-local-faq) " [a capital F!].\)"))))
+ ((face (blue bold underline) "\nInformation, on-line help:\n\n")
+ "XEmacs comes with plenty of documentation...\n\n"
+ ,@(if (string-match "beta" emacs-version)
+ `((key describe-beta)
+ ": " (face (red bold)
+ "This is an Experimental version of XEmacs.\n"))
+ `( "\n"))
+ ((key xemacs-local-faq)
+ ": read the XEmacs FAQ (a " (face underline "capital") " F!)\n")
+ ((key help-with-tutorial)
+ ": read the XEmacs tutorial (also available through the "
+ (face bold "Help") " menu)\n")
+ ((key help-command)
+ ": get help on using XEmacs (also available through the "
+ (face bold "Help") " menu)\n")
+ ((key info) ": read the on-line documentation\n\n")
+ ((key describe-project) ": read about the GNU project\n")
+ ((key about-xemacs) ": see who's developping XEmacs\n"))
+
+ ((face (blue bold underline) "\nUseful stuff:\n\n")
+ "Things that you should know rather quickly...\n\n"
+ ((key find-file) ": visit a file\n")
+ ((key save-buffer) ": save changes\n")
+ ((key advertised-undo) ": undo changes\n")
+ ((key save-buffers-kill-emacs) ": exit XEmacs\n"))
+ ])
;; I really hate global variables, oh well.
;(defvar xemacs-startup-logo-function nil
; "If non-nil, function called to provide the startup logo.
;This function should return an initialized glyph if it is used.")
-(defun startup-splash-frame ()
- (let ((p (point))
-; (logo (cond (xemacs-startup-logo-function
-; (funcall xemacs-startup-logo-function))
-; (t xemacs-logo)))
- (logo xemacs-logo)
+;; This will hopefully go away when gettext is functionnal.
+(defconst splash-frame-static-body
+ `(,(emacs-version) "\n\n"
+ (face italic "`C-' means the control key,`M-' means the meta key\n\n")))
+
+
+(defun circulate-splash-frame-elements (client-data)
+ (with-current-buffer (aref client-data 2)
+ (let ((buffer-read-only nil)
+ (elements (aref client-data 3))
+ (indice (aref client-data 0)))
+ (goto-char (aref client-data 1))
+ (delete-region (point) (point-max))
+ (splash-frame-present (aref elements indice))
+ (set-buffer-modified-p nil)
+ (aset client-data 0
+ (if (= indice (- (length elements) 1))
+ 0
+ (1+ indice )))
+ )))
+
+;; ### This function now returns the (possibly nil) timeout circulating the
+;; splash-frame elements
+(defun display-splash-frame ()
+ (let ((logo xemacs-logo)
+ (buffer-read-only nil)
(cramped-p (eq 'tty (console-type))))
(unless cramped-p (insert "\n"))
(indent-to (startup-center-spaces logo))
(set-extent-begin-glyph (make-extent (point) (point)) logo)
- (insert (if cramped-p "\n" "\n\n"))
- (splash-frame-present-hack (make-extent p (point)) 'about-xemacs))
-
- (let ((after-change-functions nil)) ; no font-lock, thank you
- (dolist (l (startup-splash-frame-body))
- (splash-frame-present l)))
- (splash-hack-version-string)
- (set-buffer-modified-p nil))
+ ;;(splash-frame-present-hack (make-extent p (point)) 'about-xemacs))
+ (insert "\n\n")
+ (splash-frame-present splash-frame-static-body)
+ (splash-hack-version-string)
+ (goto-char (point-max))
+ (let* ((after-change-functions nil) ; no font-lock, thank you
+ (elements (splash-frame-body))
+ (client-data `[ 1 ,(point) ,(current-buffer) ,elements ])
+ tmout)
+ (if (listp elements) ;; A single element to display
+ (splash-frame-present (splash-frame-body))
+ ;; several elements to rotate
+ (splash-frame-present (aref elements 0))
+ (setq tmout (add-timeout splash-frame-timeout
+ 'circulate-splash-frame-elements
+ client-data splash-frame-timeout)))
+ (set-buffer-modified-p nil)
+ tmout)))
;; (let ((present-file
;; #'(lambda (f)
(defun x-init-global-faces ()
(or (face-font 'default 'global)
(set-face-font 'default
- "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*")
- 'global)
+ "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*"
+ 'global '(x default)))
(or (face-foreground 'default 'global)
- (set-face-foreground 'default "black" 'global 'x))
+ (set-face-foreground 'default "black" 'global '(x default)))
(or (face-background 'default 'global)
- (set-face-background 'default "gray80" 'global 'x)))
+ (set-face-background 'default "gray80" 'global '(x default))))
;;; x-init-device-faces is responsible for initializing default
;;; values for faces on a newly created device.
+1999-03-12 XEmacs Build Bot <builds@cvs.xemacs.org>
+
+ * XEmacs 21.2.13 is released
+
1999-03-05 XEmacs Build Bot <builds@cvs.xemacs.org>
* XEmacs 21.2.12 is released
+1999-03-12 XEmacs Build Bot <builds@cvs.xemacs.org>
+
+ * XEmacs 21.2.13 is released
+
1999-03-05 XEmacs Build Bot <builds@cvs.xemacs.org>
* XEmacs 21.2.12 is released
+1999-03-12 XEmacs Build Bot <builds@cvs.xemacs.org>
+
+ * XEmacs 21.2.13 is released
+
+1999-03-07 Jonathan Harris <jhar@tardis.ed.ac.uk>
+
+ * xemacs.mak:
+ Don't link lib-src programs incrementally.
+ Don't include debug info in release builds.
+ Put intermediate files in the appropriate directories.
+ Make "distclean" target delete all intermediate files.
+
+1999-03-07 Jonathan Harris <jhar@tardis.ed.ac.uk>
+
+ * xemacs.mak:
+ Fix building on Windows 95/98 by conditionalising escape
+ character '^'.
+ Only put mule-packages in package path on MULE builds.
+ Only build source browser files on debug builds.
+ Build source browser database before link so that it's
+ available even if link fails.
+
1999-03-05 XEmacs Build Bot <builds@cvs.xemacs.org>
* XEmacs 21.2.12 is released
# Synched up with: Not in FSF.
#
+# Shell escape character. Used for escaping ', ` and " in commands.
+ESC=^
+
XEMACS=..
LISP=$(XEMACS)\lisp
MODULES=$(XEMACS)\modules
NT=$(XEMACS)\nt
+OUTDIR=$(NT)\obj
# Program name and version
INSTALL_DIR=c:\Program Files\XEmacs\XEmacs-$(XEMACS_VERSION_STRING)
! endif
!endif
+!if !defined(HAVE_MULE)
+HAVE_MULE=0
+!endif
!if !defined(PACKAGE_PATH)
! if !defined(PACKAGE_PREFIX)
PACKAGE_PREFIX=c:\Program Files\XEmacs
! endif
+! if $(HAVE_MULE)
PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\mule-packages;$(PACKAGE_PREFIX)\xemacs-packages
+! else
+PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\xemacs-packages
+! endif
!endif
PATH_PACKAGEPATH="$(PACKAGE_PATH:\=\\)"
!if !defined(HAVE_MSW)
!if !defined(HAVE_X)
HAVE_X=0
!endif
-!if !defined(HAVE_MULE)
-HAVE_MULE=0
-!endif
!if !defined(HAVE_XPM)
HAVE_XPM=0
!endif
#
# System configuration
#
-!if !defined(PROCESSOR_ARCHITECTURE) && "$(OS)" != "Windows_NT"
+!if !defined(OS)
+OS=Windows_95/98
+# command.com doesn't like or need '^' as an escape character
+ESC=
EMACS_CONFIGURATION=i586-pc-win32
!else if "$(PROCESSOR_ARCHITECTURE)" == "x86"
EMACS_CONFIGURATION=i586-pc-win32
CONFIG_ERROR=1
!endif
!if $(HAVE_MSW) && $(HAVE_TOOLBARS) && !$(HAVE_XPM)
-!error Toolbars require XPM support
+!message Toolbars require XPM support
CONFIG_ERROR=1
!endif
!if $(CONFIG_ERROR)
!if $(DEBUG_XEMACS)
OPT=-Od -Zi
!else
-OPT=-O2 -G5 -Zi
+OPT=-O2 -G5
!endif
CFLAGS=-nologo -W3 $(OPT)
!if $(DEBUG_XEMACS)
DEBUG_DEFINES=-DDEBUG_XEMACS -D_DEBUG
-DEBUG_FLAGS= -debugtype:both -debug:full
+DEBUG_FLAGS=-debug:full
!endif
!if $(USE_MINIMAL_TAGBITS)
-DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -DWINDOWSNT -Demacs \
-DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES)
-OUTDIR=obj
-
#
# Creating simplified versions of Installation and Installation.el
#
# to create a legal string in LISP for Installation.el.
#
!if [echo OS: $(OS)>Installation] ||\
-[echo XEmacs $(XEMACS_VERSION_STRING) $(xemacs_codename:"=\") configured for ^`$(EMACS_CONFIGURATION)^'.>>Installation] ||\
+[echo XEmacs $(XEMACS_VERSION_STRING) $(xemacs_codename:"=\") configured for $(ESC)`$(EMACS_CONFIGURATION)$(ESC)'.>>Installation] ||\
[echo Where should the build process find the source code?>>Installation] ||\
[echo $(MAKEDIR:\=\\)>>Installation]
!endif
!if [echo MS Windows>>Installation]
!endif
!endif
-!if (!defined (HAVE_MSW) && !defined (HAVE_X))
-!if [echo Please specify at least one HAVE_MSW^=1 and^/or HAVE_X^=1>>Installation]
-!endif
-!endif
# Creation of Installation.el
!if [type Installation] ||\
-[echo (setq Installation-string ^">Installation.el] ||\
+[echo (setq Installation-string $(ESC)">Installation.el] ||\
[type Installation >>Installation.el] ||\
-[echo ^")>>Installation.el]
+[echo $(ESC)")>>Installation.el]
!endif
!if [echo Creating $(CONFIG_VALUES) && echo ;;; Do not edit this file!>$(CONFIG_VALUES)]
!endif
# MAKEDIR has to be made into a string.
-!if [echo blddir>>$(CONFIG_VALUES) && echo ^"$(MAKEDIR:\=\\)\\..^">>$(CONFIG_VALUES)]
+!if [echo blddir>>$(CONFIG_VALUES) && echo $(ESC)"$(MAKEDIR:\=\\)\\..$(ESC)">>$(CONFIG_VALUES)]
!endif
-!if [echo CC>>$(CONFIG_VALUES) && echo ^"$(CC:\=\\)^">>$(CONFIG_VALUES)]
+!if [echo CC>>$(CONFIG_VALUES) && echo $(ESC)"$(CC:\=\\)$(ESC)">>$(CONFIG_VALUES)]
!endif
-!if [echo CFLAGS>>$(CONFIG_VALUES) && echo ^"$(CFLAGS:\=\\)^">>$(CONFIG_VALUES)]
+!if [echo CFLAGS>>$(CONFIG_VALUES) && echo $(ESC)"$(CFLAGS:\=\\)$(ESC)">>$(CONFIG_VALUES)]
!endif
-!if [echo CPP>>$(CONFIG_VALUES) && echo ^"$(CPP:\=\\)^">>$(CONFIG_VALUES)]
+!if [echo CPP>>$(CONFIG_VALUES) && echo $(ESC)"$(CPP:\=\\)$(ESC)">>$(CONFIG_VALUES)]
!endif
-!if [echo CPPFLAGS>>$(CONFIG_VALUES) && echo ^"$(CPPFLAGS:\=\\)^">>$(CONFIG_VALUES)]
+!if [echo CPPFLAGS>>$(CONFIG_VALUES) && echo $(ESC)"$(CPPFLAGS:\=\\)$(ESC)">>$(CONFIG_VALUES)]
!endif
-!if [echo LISPDIR>>$(CONFIG_VALUES) && echo ^"$(MAKEDIR:\=\\)\\$(LISP:\=\\)^">>$(CONFIG_VALUES)]
+!if [echo LISPDIR>>$(CONFIG_VALUES) && echo $(ESC)"$(MAKEDIR:\=\\)\\$(LISP:\=\\)$(ESC)">>$(CONFIG_VALUES)]
!endif
# PATH_PACKAGEPATH is already a quoted string.
!if [echo PACKAGE_PATH>>$(CONFIG_VALUES) && echo $(PATH_PACKAGEPATH)>>$(CONFIG_VALUES)]
# Inferred rule
{$(LIB_SRC)}.c{$(LIB_SRC)}.exe :
@cd $(LIB_SRC)
- $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $**
+ $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** -link -incremental:no
@cd $(NT)
# Individual dependencies
$(LIB_SRC)/etags.exe : $(LIB_SRC)/etags.c $(ETAGS_DEPS)
$(LIB_SRC)/movemail.exe: $(LIB_SRC)/movemail.c $(LIB_SRC)/pop.c $(ETAGS_DEPS)
@cd $(LIB_SRC)
- $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** wsock32.lib
+ $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** wsock32.lib -link -incremental:no
@cd $(NT)
LIB_SRC_TOOLS = \
RUNEMACS = $(XEMACS)\src\runxemacs.exe
$(RUNEMACS): $(LIB_SRC)\run.c $(LIB_SRC)\run.res
- $(CCV) -I$(LIB_SRC) -O2 -Fe$@ $** kernel32.lib user32.lib
+ $(CCV) -I$(LIB_SRC) $(CFLAGS) -Fe$@ -Fo$(LIB_SRC) -Fd$(LIB_SRC)\ $** kernel32.lib user32.lib -link -incremental:no
$(LIB_SRC)\run.res: $(LIB_SRC)\run.rc
- rc -I$(LIB_SRC) -FO$(LIB_SRC)\run.res $(LIB_SRC)\run.rc
+ rc -I$(LIB_SRC) -Fo$@ $**
#------------------------------------------------------------------------------
LASTFILE=$(OUTDIR)\lastfile.lib
LASTFILE_SRC=$(XEMACS)\src
-LASTFILE_FLAGS=$(CFLAGS) $(INCLUDES) -Fo$@ -c
+LASTFILE_FLAGS=$(CFLAGS) $(INCLUDES) -Fo$@ -Fd$* -c
LASTFILE_OBJS= \
$(OUTDIR)\lastfile.obj
$(OUTDIR)\xlwscrollbar.obj
$(LWLIB): $(LWLIB_OBJS)
- link.exe -lib -nologo $(DEBUG_FLAGS) -out:$@ $(LWLIB_OBJS)
+ link.exe -lib -nologo -out:$@ $(LWLIB_OBJS)
$(OUTDIR)\lwlib-config.obj: $(LWLIB_SRC)\lwlib-config.c
$(CCV) $(LWLIB_FLAGS) $**
-stack:0x800000 -entry:_start -subsystem:console\
-pdb:$(TEMACS_DIR)\temacs.pdb -map:$(TEMACS_DIR)\temacs.map \
-heap:0x00100000 -out:$@
-TEMACS_CPP_FLAGS=-ML -c $(CFLAGS) $(INCLUDES) $(DEFINES) $(DEBUG_DEFINES) \
+TEMACS_CPP_FLAGS=-ML -c \
+ $(CFLAGS) $(INCLUDES) $(DEFINES) $(DEBUG_DEFINES) \
-DEMACS_MAJOR_VERSION=$(emacs_major_version) \
-DEMACS_MINOR_VERSION=$(emacs_minor_version) \
$(EMACS_BETA_VERSION) \
$(OUTDIR)\vm-limit.obj \
$(OUTDIR)\widget.obj \
$(OUTDIR)\window.obj \
- $(NT)\xemacs.res
+ $(OUTDIR)\xemacs.res
# Rules
.SUFFIXES: .c
# nmake rule
+!if $(DEBUG_XEMACS)
+{$(TEMACS_SRC)}.c{$(OUTDIR)}.obj:
+ $(CCV) $(TEMACS_CPP_FLAGS) $< -Fo$@ -Fr$*.sbr -Fd$(OUTDIR)\temacs.pdb
+!else
{$(TEMACS_SRC)}.c{$(OUTDIR)}.obj:
- $(CCV) $(TEMACS_CPP_FLAGS) $< -Fo$@ -Fr$*.sbr
+ $(CCV) $(TEMACS_CPP_FLAGS) $< -Fo$@
+!endif
$(OUTDIR)\TopLevelEmacsShell.obj: $(TEMACS_SRC)\EmacsShell-sub.c
$(CCV) $(TEMACS_CPP_FLAGS) -DDEFINE_TOP_LEVEL_EMACS_SHELL $** -Fo$@
# !"cd $(TEMACS_SRC); cp paths.h.in paths.h"
$(TEMACS): $(TEMACS_INCLUDES) $(TEMACS_OBJS)
+!if $(DEBUG_XEMACS)
+ @dir /b/s $(OUTDIR)\*.sbr > bscmake.tmp
+ bscmake -nologo -o$(TEMACS_BROWSE) @bscmake.tmp
+ @del bscmake.tmp
+!endif
link.exe @<<
$(TEMACS_LFLAGS) $(TEMACS_OBJS) $(TEMACS_LIBS)
<<
-$(NT)\xemacs.res: xemacs.rc
- rc xemacs.rc
-
-# MSDEV Source Broswer file. "*.sbr" is too inclusive but this is harmless
-$(TEMACS_BROWSE): $(TEMACS_OBJS)
- @dir /b/s $(OUTDIR)\*.sbr > bscmake.tmp
- bscmake -nologo -o$@ @bscmake.tmp
- @del bscmake.tmp
+$(OUTDIR)\xemacs.res: xemacs.rc
+ rc -Fo$@ xemacs.rc
#------------------------------------------------------------------------------
# use this rule to build the complete system
all: $(OUTDIR)\nul $(LASTFILE) $(LWLIB) $(LIB_SRC_TOOLS) $(RUNEMACS) \
- $(TEMACS) $(TEMACS_BROWSE) update-elc $(DOC) dump-xemacs
+ $(TEMACS) update-elc $(DOC) dump-xemacs
temacs: $(TEMACS)
del *.bak
del *.orig
del *.rej
- del *.pdb
del *.tmp
+ del Installation
+ del Installation.el
cd $(OUTDIR)
+ del *.lib
del *.obj
+ del *.pdb
+ del *.res
del *.sbr
- del *.lib
cd $(XEMACS)\$(TEMACS_DIR)
del puresize-adjust.h
del config.h
del *.orig
del *.rej
del *.exe
+ del *.obj
+ del *.pdb
+ del *.res
del $(CONFIG_VALUES)
cd $(LISP)
-del /s /q *.bak *.elc *.orig *.rej
puresize-adjust.h
sheap-adjust.h
temacs
+xemacs
SATISFIED
update-elc.stamp
+1999-03-12 XEmacs Build Bot <builds@cvs.xemacs.org>
+
+ * XEmacs 21.2.13 is released
+
+1999-03-12 SL Baur <steve@xemacs.org>
+
+ * file-coding.c: Guard ucs table initialization with ifdef MULE.
+
+1999-03-10 Stephen J. Turnbull <turnbull@sk.tsukuba.ac.jp>
+
+ * file-coding.c: docstring and comment improvements.
+ (decode_ucs4) flag possible data loss with comment.
+
+1999-03-10 Martin Buchholz <martin@xemacs.org>
+
+ * file-coding.c (Fset_ucs_char): add CHECK_INT, CHECK_CHAR
+ (ucs_to_char):
+ (Fucs_char):
+ (Fset_char_ucs):
+ (decode_coding_ucs4):
+ (encode_coding_ucs4):
+ (detect_coding_utf8):
+ (decode_coding_utf8):
+ (encode_utf8):
+ (encode_coding_utf8):
+ Add CHECK_* macros where needed to avoid crashes.
+ #ifdef out all composite character support using
+ #ifdef ENABLE_COMPOSITE_CHARS
+ Use normal XEmacs coding standards.
+ Fix docstrings.
+ Remove CODING_STREAM_COMPOSE, CODING_STREAM_DECOMPOSE.
+
+1998-09-08 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * file-coding.c (make-coding-system): Add description about
+ `ucs-4' and `utf-8'.
+ (detection_state): Modify to implement ucs-4 and utf-8.
+ (detect_coding_type): Likewise.
+ (detect_coding_ucs4): New implementation.
+ (detect_coding_utf8): New implementation.
+ (encode_utf8): fixed.
+ (syms_of_mule_coding): Rename `ucs4' and `utf8' to `ucs-4' and
+ `utf-8'.
+
+1998-09-08 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * file-coding.c (mule_char_to_ucs4): Encode 94x94 chars in ISO
+ 2022 registry to private area.
+
+1998-09-07 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * file-coding.c (encode_utf8): New function.
+ (encode_coding_utf8): New implementation.
+
+1998-09-07 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * file-coding.c (ucs_to_mule_table): New variable; abolish
+ `Vucs_to_mule_table'
+ (mule_to_ucs_table): renamed from `Vmule_to_ucs_table'.
+ (set-ucs-char): New function.
+ (ucs_to_char): New function.
+ (ucs-char): New function.
+ (set-char-ucs): New function.
+ (char-ucs): New function.
+ (decode_ucs4): Use `ucs_to_char'.
+ (complex_vars_of_mule_coding): Abolish `ucs-to-mule-table' and
+ `mule-to-ucs-table'.
+
+1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * chartab.h: EXFUN `Fget_char_table'.
+
+ * file-coding.c (encode_ucs4): New function.
+ (encode_coding_ucs4): Use `encode_ucs4'.
+
+1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * file-coding.c (decode_coding_ucs4): New implementation.
+
+1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * file-coding.c (decode_coding_ucs4): fixed.
+
+ * file-coding.c (Vmule_to_ucs_table): New variable.
+ (mule_char_to_ucs4): New function.
+ (encode_coding_ucs4): New implementation.
+ (complex_vars_of_mule_coding): Define variable
+ `mule-to-ucs-table'.
+
+1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * file-coding.c (decode_coding_utf8): New implementation.
+
+1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * file-coding.c (decode_coding_utf8): fixed.
+
+1998-09-06 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * file-coding.c (Vucs_to_mule_table): New variable.
+ (decode_ucs4): Refer `Vucs_to_mule_table'.
+ (complex_vars_of_mule_coding): Define variable
+ `ucs-to-mule-table'.
+
+1998-09-04 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * file-coding.c (detect_coding_ucs4): New function (not
+ implemented yet).
+ (decode_coding_ucs4): New function.
+ (encode_coding_ucs4): New function (not implemented yet).
+ (detect_coding_utf8): New function (not implemented yet).
+ (decode_coding_utf8): New function.
+ (encode_coding_utf8): New function (not implemented yet).
+ (make-coding-system): New type `ucs4' and `utf8'.
+ (coding-system-type): Likewise.
+ (detection_state): Add `ucs4' and `utf8'.
+ (detect_coding_type): Likewise.
+ (mule_decode): Use `decode_coding_ucs4' and `decode_coding_utf8'.
+ (mule_encode): Use `encode_coding_ucs4' and `encode_coding_utf8'.
+ (decode_ucs4): New function (very incomplete).
+ (syms_of_mule_coding): Add `ucs4' and `utf8'.
+
+ * file-coding.h: Add definitions for UCS-4 and UTF-8.
+
+1999-03-08 Martin Buchholz <martin@xemacs.org>
+
+ * mule-charset.c:
+ (non_ascii_valid_char_p):
+ (lookup_composite_char):
+ (composite_char_string):
+ (make-composite-char):
+ (composite-char-string):
+ (syms_of_mule_charset):
+ (complex_vars_of_mule_charset):
+ * mule-charset.h (LEADING_BYTE_COMPOSITE):
+ (CHAR_LEADING_BYTE):
+ (MAKE_CHAR):
+ * file-coding.h (CODING_STATE_COMPOSITE):
+ (CODING_STATE_ISO2022_LOCK):
+ (iso_esc_flag):
+ (LEADING_BYTE_COMPOSITE):
+ * file-coding.c (struct iso2022_decoder):
+ (decoding_closer):
+ (reset_iso2022):
+ (parse_iso2022_esc):
+ (encode_coding_iso2022):
+ #ifdef out all composite character support using
+ #ifdef ENABLE_COMPOSITE_CHARS
+
+ * alloc.c: Define lrecord_coding_system only if ! FILE_CODING
+
+1999-03-04 Takeshi YAMADA <yamada@cslab.kecl.ntt.co.jp>
+
+ * fns.c (Fbase64_encode_string): Calculate `allength' in the same
+ way of `Fbase64_encode_region'.
+
+1999-02-18 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * fns.c (base64_encode_1): Don't add a newline at the tail.
+
+1999-03-08 Andy Piper <andy@xemacs.org>
+
+ * menubar-msw.c (displayable_menu_item): correct off-by-one &
+ handling.
+
+1999-03-07 Martin Buchholz <martin@xemacs.org>
+
+ * console-stream.h (struct stream_console):
+ * event-unixoid.c (event_stream_unixoid_select_console):
+ (event_stream_unixoid_unselect_console):
+ * print.c (Fexternal_debugging_output):
+ * sysdep.c (reset_one_device):
+ * console-stream.c (stream_init_console):
+ (stream_delete_console):
+ (allocate_stream_console_struct): move into stream_init_console.
+ (free_stream_console_struct): move into stream_delete_console.
+ Use `fd' only for file descriptors.
+ Therefore, rename members of struct stream_console.
+
+ * systime.h: Unix98 says sys/time.h should define select(), but
+ some systems define that in unistd.h. So include that file always.
+
+ * glyphs.h (MAYBE_IIFORMAT_METH): Don't use leading `_'. Avoid
+ multiple evaluation of first arg. Do proper do {} while (0) wrapping.
+ (HAS_IIFORMAT_METH_P): Prevent macro from being used in
+ non-boolean context
+ (MAYBE_IIFORMAT_DEVMETH): Use standard internal macro naming convention.
+
+ * EmacsShell.c:
+ * balloon_help.c:
+ Add #include <stdio.h>.
+ Some versions of assert.h use printf() without #include'ing stdio.h
+
+ * free-hook.c (blocktype): Add gcpro5_type to blocktype.
+ (log_gcpro): Remove unused variable FRAME.
+ (show_gcprohist): Ansify.
+ Comment the #endif's
+
+ * frame-x.c (x_delete_frame): Don't use FRAME_X_SHELL_WIDGET(f)
+ after it's just been XtDestroy'ed!
+
+1999-02-18 Martin Buchholz <martin@xemacs.org>
+
+ * opaque.c (print_opaque):
+ (sizeof_opaque):
+ (equal_opaque):
+ (hash_opaque):
+ Egcs 1.1.1 seems to have a bug where
+ INTP (p->size_or_chain)
+ will crash XEmacs. Fix by introducing intermediate variable.
+
+ * sound.c (Fdevice_sound_enabled_p): Fix compiler warning.
+
+ * dired.c (Fdirectory_files):
+ (Ffile_name_completion):
+ (Ffile_name_all_completions):
+ (file_name_completion):
+ - Use `directory' instead of `dirname' to sync with FSF Emacs and
+ avoid compiler warnings.
+ - Fix up docstrings so that C variables match documentation.
+
+1999-03-05 Martin Buchholz <martin@xemacs.org>
+
+ * alloc.c: (garbage_collect_1): Reorg code to make scope of local
+ variables as small as possible to help out the compiler and the maintainer.
+
+ * alloc.c: (disksave_object_finalization):
+ Set all the *-load-path variables to
+ nil, not just load-path itself. This gets the locate-file hash
+ tables garbage collected BEFORE dump, and has the side effect of
+ preventing crashes on OSF4.0+egcs.
+
+ * alloc.c:
+ * gdbinit:
+ * dbxrc:
+ - Clean up gdb/dbx debugging support.
+ - Storing an EMACS_INT in an enum is not 64-bit clean!
+ - So change the enum to a set of separate variables.
+ - Add test cases to help debug the debugging support!
+ - Add `lisp-shadows' and `run-temacs' targets for dbx.
+ - Both dbx and gdb have been tested now.
+
1999-03-05 XEmacs Build Bot <builds@cvs.xemacs.org>
* XEmacs 21.2.12 is released
* s/cygwin32.h (BROKEN_SIGIO): don't define this as it causes
major lockups.
+1999-02-16 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * fns.c (Fbase64_encode_string): New optional argument
+ `NO_LINE_BREAK'.
+
1999-02-16 Martin Buchholz <martin@xemacs.org>
* gdbinit: Fix up commands to run temacs. Add lisp-shadows command.
#include <config.h>
+#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <X11/StringDefs.h>
/************************************************************************/
/* Debugger support */
/************************************************************************/
-/* Give gdb/dbx enough information to decode Lisp Objects.
- We make sure certain symbols are defined, so gdb doesn't complain
- about expressions in src/gdbinit. Values are randomly chosen.
- See src/gdbinit or src/dbxrc to see how this is used. */
+/* Give gdb/dbx enough information to decode Lisp Objects. We make
+ sure certain symbols are always defined, so gdb doesn't complain
+ about expressions in src/gdbinit. See src/gdbinit or src/dbxrc to
+ see how this is used. */
-enum dbg_constants
-{
#ifdef USE_MINIMAL_TAGBITS
- dbg_valmask = (EMACS_INT) (((1UL << VALBITS) - 1) << GCBITS),
- dbg_typemask = (EMACS_INT) ((1UL << GCTYPEBITS) - 1),
- dbg_USE_MINIMAL_TAGBITS = 1,
- dbg_Lisp_Type_Int = 100,
-#else /* ! USE_MIMIMAL_TAGBITS */
- dbg_valmask = (EMACS_INT) ((1UL << VALBITS) - 1),
- dbg_typemask = (EMACS_INT) (((1UL << GCTYPEBITS) - 1) << (VALBITS + GCMARKBITS)),
- dbg_USE_MINIMAL_TAGBITS = 0,
- dbg_Lisp_Type_Int = Lisp_Type_Int,
-#endif /* ! USE_MIMIMAL_TAGBITS */
+EMACS_UINT dbg_valmask = ((1UL << VALBITS) - 1) << GCBITS;
+EMACS_UINT dbg_typemask = (1UL << GCTYPEBITS) - 1;
+unsigned char dbg_USE_MINIMAL_TAGBITS = 1;
+unsigned char Lisp_Type_Int = 100;
+#else
+EMACS_UINT dbg_valmask = (1UL << VALBITS) - 1;
+EMACS_UINT dbg_typemask = ((1UL << GCTYPEBITS) - 1) << (VALBITS + GCMARKBITS);
+unsigned char dbg_USE_MINIMAL_TAGBITS = 0;
+#endif
#ifdef USE_UNION_TYPE
- dbg_USE_UNION_TYPE = 1,
+unsigned char dbg_USE_UNION_TYPE = 1;
#else
- dbg_USE_UNION_TYPE = 0,
+unsigned char dbg_USE_UNION_TYPE = 0;
#endif
#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION
- dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 1,
+unsigned char dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 1;
#else
- dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 0,
+unsigned char dbg_USE_INDEXED_LRECORD_IMPLEMENTATION = 0;
#endif
- dbg_Lisp_Type_Char = Lisp_Type_Char,
- dbg_Lisp_Type_Record = Lisp_Type_Record,
#ifdef LRECORD_CONS
- dbg_Lisp_Type_Cons = 101,
+unsigned char Lisp_Type_Cons = 101;
#else
- dbg_Lisp_Type_Cons = Lisp_Type_Cons,
- lrecord_cons = 201,
+unsigned char lrecord_cons;
#endif
+
#ifdef LRECORD_STRING
- dbg_Lisp_Type_String = 102,
+unsigned char Lisp_Type_String = 102;
#else
- dbg_Lisp_Type_String = Lisp_Type_String,
- lrecord_string = 202,
+unsigned char lrecord_string;
#endif
+
#ifdef LRECORD_VECTOR
- dbg_Lisp_Type_Vector = 103,
+unsigned char Lisp_Type_Vector = 103;
#else
- dbg_Lisp_Type_Vector = Lisp_Type_Vector,
- lrecord_vector = 203,
+unsigned char lrecord_vector;
#endif
+
#ifdef LRECORD_SYMBOL
- dbg_Lisp_Type_Symbol = 104,
+unsigned char Lisp_Type_Symbol = 104;
#else
- dbg_Lisp_Type_Symbol = Lisp_Type_Symbol,
- lrecord_symbol = 204,
+unsigned char lrecord_symbol;
#endif
+
#ifndef MULE
- lrecord_char_table_entry = 205,
- lrecord_charset = 206,
- lrecord_coding_system = 207,
+unsigned char lrecord_char_table_entry;
+unsigned char lrecord_charset;
+#ifndef FILE_CODING
+unsigned char lrecord_coding_system;
#endif
+#endif
+
#ifndef HAVE_TOOLBARS
- lrecord_toolbar_button = 208,
+unsigned char lrecord_toolbar_button;
#endif
-#ifndef HAVE_TOOLTALK
- lrecord_tooltalk_message = 210,
- lrecord_tooltalk_pattern = 211,
+
+#ifndef TOOLTALK
+unsigned char lrecord_tooltalk_message;
+unsigned char lrecord_tooltalk_pattern;
#endif
+
#ifndef HAVE_DATABASE
- lrecord_database = 212,
+unsigned char lrecord_database;
#endif
- dbg_valbits = VALBITS,
- dbg_gctypebits = GCTYPEBITS
- /* If we don't have an actual object of this enum, pgcc (and perhaps
- other compilers) might optimize away the entire type declaration :-( */
-} dbg_dummy;
-/* A few macros turned into functions for ease of debugging.
+unsigned char dbg_valbits = VALBITS;
+unsigned char dbg_gctypebits = GCTYPEBITS;
+
+/* Macros turned into functions for ease of debugging.
Debuggers don't know about macros! */
int dbg_eq (Lisp_Object obj1, Lisp_Object obj2);
int
Vexec_path = Qnil;
Vload_path = Qnil;
/* Vdump_load_path = Qnil; */
+ /* Release hash tables for locate_file */
+ Fset (intern ("early-package-load-path"), Qnil);
+ Fset (intern ("late-package-load-path"), Qnil);
+ Fset (intern ("last-package-load-path"), Qnil);
uncache_home_directory();
#if defined(LOADHIST) && !(defined(LOADHIST_DUMPED) || \
char stack_top_variable;
extern char *stack_bottom;
#endif
- int i;
struct frame *f;
int speccount;
int cursor_changed;
cleanup_specifiers ();
/* Mark all the special slots that serve as the roots of accessibility. */
- {
- struct gcpro *tail;
- struct catchtag *catch;
- struct backtrace *backlist;
- struct specbinding *bind;
+ { /* staticpro() */
+ int i;
for (i = 0; i < staticidx; i++)
- {
- mark_object (*(staticvec[i]));
- }
+ mark_object (*(staticvec[i]));
+ }
+ { /* GCPRO() */
+ struct gcpro *tail;
+ int i;
for (tail = gcprolist; tail; tail = tail->next)
- {
- for (i = 0; i < tail->nvars; i++)
- mark_object (tail->var[i]);
- }
+ for (i = 0; i < tail->nvars; i++)
+ mark_object (tail->var[i]);
+ }
+ { /* specbind() */
+ struct specbinding *bind;
for (bind = specpdl; bind != specpdl_ptr; bind++)
{
mark_object (bind->symbol);
mark_object (bind->old_value);
}
+ }
+ {
+ struct catchtag *catch;
for (catch = catchlist; catch; catch = catch->next)
{
mark_object (catch->tag);
mark_object (catch->val);
}
+ }
+ {
+ struct backtrace *backlist;
for (backlist = backtrace_list; backlist; backlist = backlist->next)
{
int nargs = backlist->nargs;
+ int i;
mark_object (*backlist->function);
if (nargs == UNEVALLED || nargs == MANY)
for (i = 0; i < nargs; i++)
mark_object (backlist->args[i]);
}
-
- mark_redisplay (mark_object);
- mark_profiling_info (mark_object);
}
+ mark_redisplay (mark_object);
+ mark_profiling_info (mark_object);
+
/* OK, now do the after-mark stuff. This is for things that
are only marked when something else is marked (e.g. weak hash tables).
There may be complex dependencies between such objects -- e.g.
#include <config.h>
#include <string.h>
#include <stdlib.h>
+#include <stdio.h>
#include <assert.h>
#include <X11/Xlib.h>
EXFUN (Fcopy_char_table, 1);
EXFUN (Fmake_char_table, 1);
EXFUN (Fput_char_table, 3);
+EXFUN (Fget_char_table, 2);
extern Lisp_Object Vall_syntax_tables;
Lisp_Object Vstdio_str;
static void
-allocate_stream_console_struct (struct console *con)
-{
- if (!CONSOLE_STREAM_DATA (con))
- CONSOLE_STREAM_DATA (con) = xnew_and_zero (struct stream_console);
- else
- xzero (*CONSOLE_STREAM_DATA (con));
-}
-
-static void
stream_init_console (struct console *con, Lisp_Object params)
{
Lisp_Object tty = CONSOLE_CONNECTION (con);
- FILE *infd, *outfd, *errfd;
+ struct stream_console *stream_con;
- /* Open the specified console */
+ if (CONSOLE_STREAM_DATA (con) == NULL)
+ CONSOLE_STREAM_DATA (con) = xnew (struct stream_console);
+
+ stream_con = CONSOLE_STREAM_DATA (con);
+ stream_con->needs_newline = 0;
+
+ /* Open the specified console */
if (NILP (tty) || internal_equal (tty, Vstdio_str, 0))
{
- infd = stdin;
- outfd = stdout;
- errfd = stderr;
+ stream_con->in = stdin;
+ stream_con->out = stdout;
+ stream_con->err = stderr;
}
else
{
CHECK_STRING (tty);
- infd = outfd = errfd =
+ stream_con->in = stream_con->out = stream_con->err =
fopen ((char *) XSTRING_DATA (tty), "r+");
- if (!infd)
+ if (!stream_con->in)
error ("Unable to open tty %s", XSTRING_DATA (tty));
}
-
- allocate_stream_console_struct (con);
- CONSOLE_STREAM_DATA (con)->infd = infd;
- CONSOLE_STREAM_DATA (con)->outfd = outfd;
- CONSOLE_STREAM_DATA (con)->errfd = errfd;
}
static void
{
struct console *con = XCONSOLE (DEVICE_CONSOLE (d));
- DEVICE_INFD (d) = fileno (CONSOLE_STREAM_DATA (con)->infd);
- DEVICE_OUTFD (d) = fileno (CONSOLE_STREAM_DATA (con)->outfd);
+ DEVICE_INFD (d) = fileno (CONSOLE_STREAM_DATA (con)->in);
+ DEVICE_OUTFD (d) = fileno (CONSOLE_STREAM_DATA (con)->out);
init_baud_rate (d);
init_one_device (d);
}
return noninteractive && initialized;
}
-static void
-free_stream_console_struct (struct console *con)
-{
- if (CONSOLE_STREAM_DATA (con))
- {
- xfree (CONSOLE_STREAM_DATA (con));
- CONSOLE_STREAM_DATA (con) = NULL;
- }
-}
-
extern int stdout_needs_newline;
static void
stream_delete_console (struct console *con)
{
- if (/* CONSOLE_STREAM_DATA (con)->needs_newline */
- stdout_needs_newline) /* #### clean this up */
+ struct stream_console *stream_con = CONSOLE_STREAM_DATA (con);
+ if (stream_con)
{
- fputc ('\n', CONSOLE_STREAM_DATA (con)->outfd);
- fflush (CONSOLE_STREAM_DATA (con)->outfd);
+ if (/* stream_con->needs_newline */
+ stdout_needs_newline) /* #### clean this up */
+ {
+ fputc ('\n', stream_con->out);
+ fflush (stream_con->out);
+ }
+ if (stream_con->in != stdin)
+ fclose (stream_con->in);
+
+ xfree (stream_con);
+ CONSOLE_STREAM_DATA (con) = NULL;
}
- if (CONSOLE_STREAM_DATA (con)->infd != stdin)
- fclose (CONSOLE_STREAM_DATA (con)->infd);
- free_stream_console_struct (con);
}
Lisp_Object
static void
stream_clear_region (Lisp_Object window, struct device* d, struct frame * f,
face_index findex, int x, int y,
- int width, int height, Lisp_Object fcolor, Lisp_Object bcolor,
+ int width, int height, Lisp_Object fcolor, Lisp_Object bcolor,
Lisp_Object background_pixmap)
{
}
stream_ring_bell (struct device *d, int volume, int pitch, int duration)
{
struct console *c = XCONSOLE (DEVICE_CONSOLE (d));
- fputc (07, CONSOLE_STREAM_DATA (c)->outfd);
- fflush (CONSOLE_STREAM_DATA (c)->outfd);
+ fputc (07, CONSOLE_STREAM_DATA (c)->out);
+ fflush (CONSOLE_STREAM_DATA (c)->out);
}
\f
struct stream_console
{
- FILE *infd, *outfd, *errfd;
+ FILE *in;
+ FILE *out;
+ FILE *err;
int needs_newline;
};
if FILES-ONLY is nil (the default) then both files and subdirectories will
be returned.
*/
- (dirname, full, match, nosort, files_only))
+ (directory, full, match, nosort, files_only))
{
/* This function can GC */
DIR *d;
Lisp_Object list = Qnil;
- Bytecount dirnamelen;
+ Bytecount directorylen;
Lisp_Object handler;
struct re_pattern_buffer *bufp = NULL;
int speccount = specpdl_depth ();
char *statbuf, *statbuf_tail;
struct gcpro gcpro1, gcpro2;
- GCPRO2 (dirname, list);
+ GCPRO2 (directory, list);
/* If the file name has special constructs in it,
call the corresponding file handler. */
- handler = Ffind_file_name_handler (dirname, Qdirectory_files);
+ handler = Ffind_file_name_handler (directory, Qdirectory_files);
if (!NILP (handler))
{
UNGCPRO;
if (!NILP (files_only))
- return call6 (handler, Qdirectory_files, dirname, full, match, nosort,
- files_only);
+ return call6 (handler, Qdirectory_files, directory, full, match,
+ nosort, files_only);
else
- return call5 (handler, Qdirectory_files, dirname, full, match,
+ return call5 (handler, Qdirectory_files, directory, full, match,
nosort);
}
/* #### why do we do Fexpand_file_name after file handlers here,
but earlier everywhere else? */
- dirname = Fexpand_file_name (dirname, Qnil);
- dirname = Ffile_name_as_directory (dirname);
- dirnamelen = XSTRING_LENGTH (dirname);
+ directory = Fexpand_file_name (directory, Qnil);
+ directory = Ffile_name_as_directory (directory);
+ directorylen = XSTRING_LENGTH (directory);
- statbuf = (char *)alloca (dirnamelen + MAXNAMLEN + 1);
- memcpy (statbuf, XSTRING_DATA (dirname), dirnamelen);
- statbuf_tail = statbuf + dirnamelen;
+ statbuf = (char *)alloca (directorylen + MAXNAMLEN + 1);
+ memcpy (statbuf, XSTRING_DATA (directory), directorylen);
+ statbuf_tail = statbuf + directorylen;
/* XEmacs: this should come after Ffile_name_as_directory() to avoid
potential regexp cache smashage. It comes before the opendir()
/* Do this opendir after anything which might signal an error.
NOTE: the above comment is old; previously, there was no
unwind-protection in case of error, but now there is. */
- d = opendir ((char *) XSTRING_DATA (dirname));
+ d = opendir ((char *) XSTRING_DATA (directory));
if (!d)
- report_file_error ("Opening directory", list1 (dirname));
+ report_file_error ("Opening directory", list1 (directory));
record_unwind_protect (close_directory_unwind, make_opaque_ptr ((void *)d));
overrun. */
if (len > MAXNAMLEN)
{
- cur_statbuf = (char *)xmalloc (dirnamelen + len + 1);
- memcpy (cur_statbuf, statbuf, dirnamelen);
- cur_statbuf_tail = cur_statbuf + dirnamelen;
+ cur_statbuf = (char *)xmalloc (directorylen + len + 1);
+ memcpy (cur_statbuf, statbuf, directorylen);
+ cur_statbuf_tail = cur_statbuf + directorylen;
}
memcpy (cur_statbuf_tail, dp->d_name, len);
cur_statbuf_tail[len] = 0;
Lisp_Object name =
make_string ((Bufbyte *)dp->d_name, len);
if (!NILP (full))
- name = concat2 (dirname, name);
+ name = concat2 (directory, name);
list = Fcons (name, list);
}
}
\f
static Lisp_Object file_name_completion (Lisp_Object file,
- Lisp_Object dirname,
+ Lisp_Object directory,
int all_flag, int ver_flag);
DEFUN ("file-name-completion", Ffile_name_completion, 2, 2, 0, /*
-Complete file name FILE in directory DIR.
-Returns the longest string common to all filenames in DIR
+Complete file name FILE in directory DIRECTORY.
+Returns the longest string common to all filenames in DIRECTORY
that start with FILE.
If there is only one and FILE matches it exactly, returns t.
-Returns nil if DIR contains no name starting with FILE.
+Returns nil if DIRECTORY contains no name starting with FILE.
Filenames which end with any member of `completion-ignored-extensions'
are not considered as possible completions for FILE unless there is no
other possible completion. `completion-ignored-extensions' is not applied
to the names of directories.
*/
- (file, dirname))
+ (file, directory))
{
/* This function can GC. GC checked 1996.04.06. */
Lisp_Object handler;
/* If the directory name has special constructs in it,
call the corresponding file handler. */
- handler = Ffind_file_name_handler (dirname, Qfile_name_completion);
+ handler = Ffind_file_name_handler (directory, Qfile_name_completion);
if (!NILP (handler))
- return call3 (handler, Qfile_name_completion, file, dirname);
+ return call3 (handler, Qfile_name_completion, file, directory);
/* If the file name has special constructs in it,
call the corresponding file handler. */
handler = Ffind_file_name_handler (file, Qfile_name_completion);
if (!NILP (handler))
- return call3 (handler, Qfile_name_completion, file, dirname);
+ return call3 (handler, Qfile_name_completion, file, directory);
- return file_name_completion (file, dirname, 0, 0);
+ return file_name_completion (file, directory, 0, 0);
}
DEFUN ("file-name-all-completions", Ffile_name_all_completions, 2, 2, 0, /*
-Return a list of all completions of file name FILE in directory DIR.
-These are all file names in directory DIR which begin with FILE.
+Return a list of all completions of file name FILE in directory DIRECTORY.
+These are all file names in directory DIRECTORY which begin with FILE.
-Filenames which end with any member of `completion-ignored-extensions'
+File names which end with any member of `completion-ignored-extensions'
are not considered as possible completions for FILE unless there is no
other possible completion. `completion-ignored-extensions' is not applied
to the names of directories.
*/
- (file, dirname))
+ (file, directory))
{
/* This function can GC. GC checked 1997.06.04. */
Lisp_Object handler;
struct gcpro gcpro1;
- GCPRO1 (dirname);
- dirname = Fexpand_file_name (dirname, Qnil);
+ GCPRO1 (directory);
+ directory = Fexpand_file_name (directory, Qnil);
/* If the file name has special constructs in it,
call the corresponding file handler. */
- handler = Ffind_file_name_handler (dirname, Qfile_name_all_completions);
+ handler = Ffind_file_name_handler (directory, Qfile_name_all_completions);
UNGCPRO;
if (!NILP (handler))
return call3 (handler, Qfile_name_all_completions, file,
- dirname);
+ directory);
- return file_name_completion (file, dirname, 1, 0);
+ return file_name_completion (file, directory, 1, 0);
}
static int
-file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp,
+file_name_completion_stat (Lisp_Object directory, DIRENTRY *dp,
struct stat *st_addr)
{
Bytecount len = NAMLEN (dp);
- Bytecount pos = XSTRING_LENGTH (dirname);
+ Bytecount pos = XSTRING_LENGTH (directory);
int value;
char *fullname = (char *) alloca (len + pos + 2);
- memcpy (fullname, XSTRING_DATA (dirname), pos);
+ memcpy (fullname, XSTRING_DATA (directory), pos);
if (!IS_DIRECTORY_SEP (fullname[pos - 1]))
fullname[pos++] = DIRECTORY_SEP;
}
static Lisp_Object
-file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag,
+file_name_completion (Lisp_Object file, Lisp_Object directory, int all_flag,
int ver_flag)
{
/* This function can GC */
Lisp_Object locative;
struct gcpro gcpro1, gcpro2, gcpro3;
- GCPRO3 (file, dirname, bestmatch);
+ GCPRO3 (file, directory, bestmatch);
CHECK_STRING (file);
#ifdef FILE_SYSTEM_CASE
file = FILE_SYSTEM_CASE (file);
#endif
- dirname = Fexpand_file_name (dirname, Qnil);
+ directory = Fexpand_file_name (directory, Qnil);
file_name_length = XSTRING_CHAR_LENGTH (file);
/* With passcount = 0, ignore files that end in an ignored extension.
for (passcount = !!all_flag; NILP (bestmatch) && passcount < 2; passcount++)
{
- d = opendir ((char *) XSTRING_DATA (Fdirectory_file_name (dirname)));
+ d = opendir ((char *) XSTRING_DATA (Fdirectory_file_name (directory)));
if (!d)
- report_file_error ("Opening directory", list1 (dirname));
+ report_file_error ("Opening directory", list1 (directory));
XCAR (locative) = make_opaque_ptr ((void *)d);
/* Loop reading blocks */
|| 0 <= scmp (d_name, XSTRING_DATA (file), file_name_length))
continue;
- if (file_name_completion_stat (dirname, dp, &st) < 0)
+ if (file_name_completion_stat (directory, dp, &st) < 0)
continue;
directoryp = ((st.st_mode & S_IFMT) == S_IFDIR);
}
}
- /* If this dirname all matches,
+ /* If this directory all matches,
see if implicit following slash does too. */
if (directoryp
&& compare == matchsize
{
/* This function can GC. GC checked 1997.06.04. */
Lisp_Object values[12];
- Lisp_Object dirname = Qnil;
+ Lisp_Object directory = Qnil;
struct stat s;
char modes[10];
Lisp_Object handler;
struct gcpro gcpro1, gcpro2;
- GCPRO2 (filename, dirname);
+ GCPRO2 (filename, directory);
filename = Fexpand_file_name (filename, Qnil);
/* If the file name has special constructs in it,
}
#ifdef BSD4_2
- dirname = Ffile_name_directory (filename);
+ directory = Ffile_name_directory (filename);
#endif
#ifdef MSDOS
{
struct stat sdir;
- if (!NILP (dirname) && stat ((char *) XSTRING_DATA (dirname), &sdir) == 0)
+ if (!NILP (directory) && stat ((char *) XSTRING_DATA (directory), &sdir) == 0)
values[9] = (sdir.st_gid != s.st_gid) ? Qt : Qnil;
else /* if we can't tell, assume worst */
values[9] = Qt;
int infd;
if (CONSOLE_STREAM_P (con))
- infd = fileno (CONSOLE_STREAM_DATA (con)->infd);
+ infd = fileno (CONSOLE_STREAM_DATA (con)->in);
else
{
assert (CONSOLE_TTY_P (con));
int infd;
if (CONSOLE_STREAM_P (con))
- infd = fileno (CONSOLE_STREAM_DATA (con)->infd);
+ infd = fileno (CONSOLE_STREAM_DATA (con)->in);
else
{
assert (CONSOLE_TTY_P (con));
#include "lstream.h"
#ifdef MULE
#include "mule-ccl.h"
+#include "chartab.h"
#endif
#include "file-coding.h"
Lisp_Object Qpre_write_conversion;
#ifdef MULE
+Lisp_Object Qucs4, Qutf8;
Lisp_Object Qbig5, Qshift_jis;
Lisp_Object Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3;
Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output;
/* Index for next byte to store in ISO escape sequence. */
int esc_bytes_index;
+#ifdef ENABLE_COMPOSITE_CHARS
/* Stuff seen so far when composing a string. */
unsigned_char_dynarr *composite_chars;
+#endif
/* If we saw an invalid designation sequence for a particular
register, we flag it here and switch to ASCII. The next time we
static void encode_coding_big5 (Lstream *encoding,
CONST unsigned char *src,
unsigned_char_dynarr *dst, unsigned int n);
+static int detect_coding_ucs4 (struct detection_state *st,
+ CONST unsigned char *src,
+ unsigned int n);
+static void decode_coding_ucs4 (Lstream *decoding,
+ CONST unsigned char *src,
+ unsigned_char_dynarr *dst, unsigned int n);
+static void encode_coding_ucs4 (Lstream *encoding,
+ CONST unsigned char *src,
+ unsigned_char_dynarr *dst, unsigned int n);
+static int detect_coding_utf8 (struct detection_state *st,
+ CONST unsigned char *src,
+ unsigned int n);
+static void decode_coding_utf8 (Lstream *decoding,
+ CONST unsigned char *src,
+ unsigned_char_dynarr *dst, unsigned int n);
+static void encode_coding_utf8 (Lstream *encoding,
+ CONST unsigned char *src,
+ unsigned_char_dynarr *dst, unsigned int n);
static int postprocess_iso2022_mask (int mask);
static void reset_iso2022 (Lisp_Object coding_system,
struct iso2022_decoder *iso);
static Lisp_Object
mark_coding_system (Lisp_Object obj, void (*markobj) (Lisp_Object))
{
- struct Lisp_Coding_System *codesys = XCODING_SYSTEM (obj);
+ Lisp_Coding_System *codesys = XCODING_SYSTEM (obj);
markobj (CODING_SYSTEM_NAME (codesys));
markobj (CODING_SYSTEM_DOC_STRING (codesys));
print_coding_system (Lisp_Object obj, Lisp_Object printcharfun,
int escapeflag)
{
- struct Lisp_Coding_System *c = XCODING_SYSTEM (obj);
+ Lisp_Coding_System *c = XCODING_SYSTEM (obj);
if (print_readably)
error ("printing unreadable object #<coding_system 0x%x>",
c->header.uid);
static void
finalize_coding_system (void *header, int for_disksave)
{
- struct Lisp_Coding_System *c = (struct Lisp_Coding_System *) header;
+ Lisp_Coding_System *c = (Lisp_Coding_System *) header;
/* Since coding systems never go away, this function is not
necessary. But it would be necessary if we changed things
so that coding systems could go away. */
}
static void
-setup_eol_coding_systems (struct Lisp_Coding_System *codesys)
+setup_eol_coding_systems (Lisp_Coding_System *codesys)
{
Lisp_Object codesys_obj;
int len = string_length (XSYMBOL (CODING_SYSTEM_NAME (codesys))->name);
return XCODING_SYSTEM_NAME (coding_system);
}
-static struct Lisp_Coding_System *
+static Lisp_Coding_System *
allocate_coding_system (enum coding_system_type type, Lisp_Object name)
{
- struct Lisp_Coding_System *codesys =
- alloc_lcrecord_type (struct Lisp_Coding_System, lrecord_coding_system);
+ Lisp_Coding_System *codesys =
+ alloc_lcrecord_type (Lisp_Coding_System, lrecord_coding_system);
zero_lcrecord (codesys);
CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = Qnil;
characters will only be present if you explicitly insert them.)
'shift-jis
Shift-JIS (a Japanese encoding commonly used in PC operating systems).
+'ucs-4
+ ISO 10646 UCS-4 encoding.
+'utf-8
+ ISO 10646 UTF-8 encoding.
'iso2022
Any ISO2022-compliant encoding. Among other things, this includes
JIS (the Japanese encoding commonly used for e-mail), EUC (the
*/
(name, type, doc_string, props))
{
- struct Lisp_Coding_System *codesys;
+ Lisp_Coding_System *codesys;
Lisp_Object rest, key, value;
enum coding_system_type ty;
int need_to_setup_eol_systems = 1;
else if (EQ (type, Qshift_jis)) { ty = CODESYS_SHIFT_JIS; }
else if (EQ (type, Qiso2022)) { ty = CODESYS_ISO2022; }
else if (EQ (type, Qbig5)) { ty = CODESYS_BIG5; }
+ else if (EQ (type, Qucs4)) { ty = CODESYS_UCS4; }
+ else if (EQ (type, Qutf8)) { ty = CODESYS_UTF8; }
else if (EQ (type, Qccl)) { ty = CODESYS_CCL; }
#endif
else if (EQ (type, Qno_conversion)) { ty = CODESYS_NO_CONVERSION; }
}
{
- struct Lisp_Coding_System *to = XCODING_SYSTEM (new_coding_system);
- struct Lisp_Coding_System *from = XCODING_SYSTEM (old_coding_system);
+ Lisp_Coding_System *to = XCODING_SYSTEM (new_coding_system);
+ Lisp_Coding_System *from = XCODING_SYSTEM (old_coding_system);
memcpy (((char *) to ) + sizeof (to->header),
((char *) from) + sizeof (from->header),
sizeof (*from) - sizeof (from->header));
static Lisp_Object
subsidiary_coding_system (Lisp_Object coding_system, enum eol_type type)
{
- struct Lisp_Coding_System *cs = XCODING_SYSTEM (coding_system);
+ Lisp_Coding_System *cs = XCODING_SYSTEM (coding_system);
Lisp_Object new_coding_system;
if (CODING_SYSTEM_EOL_TYPE (cs) != EOL_AUTODETECT)
case CODESYS_SHIFT_JIS: return Qshift_jis;
case CODESYS_ISO2022: return Qiso2022;
case CODESYS_BIG5: return Qbig5;
+ case CODESYS_UCS4: return Qucs4;
+ case CODESYS_UTF8: return Qutf8;
case CODESYS_CCL: return Qccl;
#endif
case CODESYS_NO_CONVERSION: return Qno_conversion;
struct
{
int mask;
+ int in_byte;
+ }
+ ucs4;
+
+ struct
+ {
+ int mask;
+ int in_byte;
+ }
+ utf8;
+
+ struct
+ {
+ int mask;
int initted;
struct iso2022_decoder iso;
unsigned int flags;
#ifdef MULE
st->shift_jis.mask = ~0;
st->big5.mask = ~0;
+ st->ucs4.mask = ~0;
+ st->utf8.mask = ~0;
st->iso2022.mask = ~0;
#endif
break;
st->shift_jis.mask = detect_coding_sjis (st, src, n);
if (!mask_has_at_most_one_bit_p (st->big5.mask))
st->big5.mask = detect_coding_big5 (st, src, n);
-
- st->mask = st->iso2022.mask | st->shift_jis.mask | st->big5.mask;
+ if (!mask_has_at_most_one_bit_p (st->utf8.mask))
+ st->utf8.mask = detect_coding_utf8 (st, src, n);
+ if (!mask_has_at_most_one_bit_p (st->ucs4.mask))
+ st->ucs4.mask = detect_coding_ucs4 (st, src, n);
+
+ st->mask
+ = st->iso2022.mask | st->shift_jis.mask | st->big5.mask
+ | st->utf8.mask | st->ucs4.mask;
#endif
{
int retval = mask_has_at_most_one_bit_p (st->mask);
struct decoding_stream
{
/* Coding system that governs the conversion. */
- struct Lisp_Coding_System *codesys;
+ Lisp_Coding_System *codesys;
/* Stream that we read the encoded data from or
write the decoded data to. */
}
Dynarr_free (str->runoff);
#ifdef MULE
+#ifdef ENABLE_COMPOSITE_CHARS
if (str->iso2022.composite_chars)
Dynarr_free (str->iso2022.composite_chars);
#endif
+#endif
return Lstream_close (str->other_end);
}
void
set_decoding_stream_coding_system (Lstream *lstr, Lisp_Object codesys)
{
- struct Lisp_Coding_System *cs = XCODING_SYSTEM (codesys);
+ Lisp_Coding_System *cs = XCODING_SYSTEM (codesys);
struct decoding_stream *str = DECODING_STREAM_DATA (lstr);
str->codesys = cs;
if (CODING_SYSTEM_EOL_TYPE (cs) != EOL_AUTODETECT)
case CODESYS_BIG5:
decode_coding_big5 (decoding, src, dst, n);
break;
+ case CODESYS_UCS4:
+ decode_coding_ucs4 (decoding, src, dst, n);
+ break;
+ case CODESYS_UTF8:
+ decode_coding_utf8 (decoding, src, dst, n);
+ break;
case CODESYS_CCL:
ccl_driver (&str->ccl, src, dst, n, 0);
break;
struct encoding_stream
{
/* Coding system that governs the conversion. */
- struct Lisp_Coding_System *codesys;
+ Lisp_Coding_System *codesys;
/* Stream that we read the encoded data from or
write the decoded data to. */
void
set_encoding_stream_coding_system (Lstream *lstr, Lisp_Object codesys)
{
- struct Lisp_Coding_System *cs = XCODING_SYSTEM (codesys);
+ Lisp_Coding_System *cs = XCODING_SYSTEM (codesys);
struct encoding_stream *str = ENCODING_STREAM_DATA (lstr);
str->codesys = cs;
reset_encoding_stream (str);
case CODESYS_BIG5:
encode_coding_big5 (encoding, src, dst, n);
break;
+ case CODESYS_UCS4:
+ encode_coding_ucs4 (encoding, src, dst, n);
+ break;
+ case CODESYS_UTF8:
+ encode_coding_utf8 (encoding, src, dst, n);
+ break;
case CODESYS_CCL:
ccl_driver (&str->ccl, src, dst, n, 0);
break;
/* Shift-JIS is a coding system encoding three character sets: ASCII, right
half of JISX0201-Kana, and JISX0208. An ASCII character is encoded
- as is. A character of JISX0201-Kana (TYPE94 character set) is
+ as is. A character of JISX0201-Kana (DIMENSION1_CHARS94 character set) is
encoded by "position-code + 0x80". A character of JISX0208
- (TYPE94x94 character set) is encoded in 2-byte but two
+ (DIMENSION2_CHARS94 character set) is encoded in 2-byte but two
position-codes are divided and shifted so that it fit in the range
below.
unsigned_char_dynarr *dst, unsigned int n)
{
unsigned char c;
- unsigned int flags, ch;
- enum eol_type eol_type;
struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
-
- CODING_STREAM_DECOMPOSE (str, flags, ch);
- eol_type = str->eol_type;
+ unsigned int flags = str->flags;
+ unsigned int ch = str->ch;
+ eol_type_t eol_type = str->eol_type;
while (n--)
{
DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst);
- CODING_STREAM_COMPOSE (str, flags, ch);
+ str->flags = flags;
+ str->ch = ch;
}
/* Convert internally-formatted data to Shift-JIS. */
{
unsigned char c;
struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
- unsigned int flags, ch;
- enum eol_type eol_type;
-
- CODING_STREAM_DECOMPOSE (str, flags, ch);
- eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
+ unsigned int flags = str->flags;
+ unsigned int ch = str->ch;
+ eol_type_t eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
while (n--)
{
}
}
- CODING_STREAM_COMPOSE (str, flags, ch);
+ str->flags = flags;
+ str->ch = ch;
}
DEFUN ("decode-shift-jis-char", Fdecode_shift_jis_char, 1, 1, 0, /*
Since the number of characters in Big5 is larger than maximum
characters in Emacs' charset (96x96), it can't be handled as one
charset. So, in Emacs, Big5 is divided into two: `charset-big5-1'
- and `charset-big5-2'. Both <type>s are TYPE94x94. The former
+ and `charset-big5-2'. Both <type>s are DIMENSION2_CHARS94. The former
contains frequently used characters and the latter contains less
frequently used characters. */
unsigned_char_dynarr *dst, unsigned int n)
{
unsigned char c;
- unsigned int flags, ch;
- enum eol_type eol_type;
struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
-
- CODING_STREAM_DECOMPOSE (str, flags, ch);
- eol_type = str->eol_type;
+ unsigned int flags = str->flags;
+ unsigned int ch = str->ch;
+ eol_type_t eol_type = str->eol_type;
while (n--)
{
DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst);
- CODING_STREAM_COMPOSE (str, flags, ch);
+ str->flags = flags;
+ str->ch = ch;
}
/* Convert internally-formatted data to Big5. */
{
unsigned char c;
struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
- unsigned int flags, ch;
- enum eol_type eol_type;
-
- CODING_STREAM_DECOMPOSE (str, flags, ch);
- eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
+ unsigned int flags = str->flags;
+ unsigned int ch = str->ch;
+ eol_type_t eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
while (n--)
{
ch = 0;
}
- CODING_STREAM_COMPOSE (str, flags, ch);
+ str->flags = flags;
+ str->ch = ch;
}
\f
/************************************************************************/
+/* UCS-4 methods */
+/* */
+/* UCS-4 character codes are implemented as nonnegative integers. */
+/* */
+/************************************************************************/
+
+Lisp_Object ucs_to_mule_table[65536];
+Lisp_Object mule_to_ucs_table;
+
+DEFUN ("set-ucs-char", Fset_ucs_char, 2, 2, 0, /*
+Map UCS-4 code CODE to Mule character CHARACTER.
+
+Return T on success, NIL on failure.
+*/
+ (code, character))
+{
+ unsigned int c;
+
+ CHECK_CHAR (character);
+ CHECK_INT (code);
+ c = XINT (code);
+
+ if (c < sizeof (ucs_to_mule_table))
+ {
+ ucs_to_mule_table[c] = character;
+ return Qt;
+ }
+ else
+ return Qnil;
+}
+
+static Lisp_Object
+ucs_to_char (unsigned long code)
+{
+ if (code < sizeof (ucs_to_mule_table))
+ {
+ return ucs_to_mule_table[code];
+ }
+ else if ((0xe00000 <= code) && (code <= 0xe00000 + 94 * 94 * 14))
+ {
+ unsigned int c;
+
+ code -= 0xe00000;
+ c = code % (94 * 94);
+ return make_char
+ (MAKE_CHAR (CHARSET_BY_ATTRIBUTES
+ (CHARSET_TYPE_94X94, code / (94 * 94) + '@',
+ CHARSET_LEFT_TO_RIGHT),
+ c / 94 + 33, c % 94 + 33));
+ }
+ else
+ return Qnil;
+}
+
+DEFUN ("ucs-char", Fucs_char, 1, 1, 0, /*
+Return Mule character corresponding to UCS code CODE (a positive integer).
+*/
+ (code))
+{
+ CHECK_NATNUM (code);
+ return ucs_to_char (XINT (code));
+}
+
+DEFUN ("set-char-ucs", Fset_char_ucs, 2, 2, 0, /*
+Map Mule character CHARACTER to UCS code CODE (a positive integer).
+*/
+ (character, code))
+{
+ /* #### Isn't this gilding the lily? Fput_char_table checks its args.
+ Fset_char_ucs is more restrictive on index arg, but should
+ check code arg in a char_table method. */
+ CHECK_CHAR (character);
+ CHECK_NATNUM (code);
+ return Fput_char_table (character, code, mule_to_ucs_table);
+}
+
+DEFUN ("char-ucs", Fchar_ucs, 1, 1, 0, /*
+Return the UCS code (a positive integer) corresponding to CHARACTER.
+*/
+ (character))
+{
+ return Fget_char_table (character, mule_to_ucs_table);
+}
+
+/* Decode a UCS-4 character into a buffer. If the lookup fails, use
+ JIS X 0208 double-width `=' instead.
+ #### do something more appropriate (use blob?)
+ Danger, Will Robinson! Data loss. Should we signal user? */
+static void
+decode_ucs4 (unsigned long ch, unsigned_char_dynarr *dst)
+{
+ Lisp_Object chr = ucs_to_char (ch);
+
+ if (! NILP (chr))
+ {
+ Bufbyte work[MAX_EMCHAR_LEN];
+ int len;
+
+ ch = XCHAR (chr);
+ len = (ch < 128) ?
+ simple_set_charptr_emchar (work, ch) :
+ non_ascii_set_charptr_emchar (work, ch);
+ Dynarr_add_many (dst, work, len);
+ }
+ else
+ {
+ Dynarr_add (dst, LEADING_BYTE_JAPANESE_JISX0208);
+ Dynarr_add (dst, 34 + 128);
+ Dynarr_add (dst, 46 + 128);
+ }
+}
+
+static unsigned long
+mule_char_to_ucs4 (Lisp_Object charset,
+ unsigned char h, unsigned char l)
+{
+ Lisp_Object code
+ = Fget_char_table (make_char (MAKE_CHAR (charset, h & 127, l & 127)),
+ mule_to_ucs_table);
+
+ if (INTP (code))
+ {
+ return XINT (code);
+ }
+ else if ( (XCHARSET_DIMENSION (charset) == 2) &&
+ (XCHARSET_CHARS (charset) == 94) )
+ {
+ unsigned char final = XCHARSET_FINAL (charset);
+
+ if ( ('@' <= final) && (final < 0x7f) )
+ {
+ return 0xe00000 + (final - '@') * 94 * 94
+ + ((h & 127) - 33) * 94 + (l & 127) - 33;
+ }
+ else
+ {
+ return '?';
+ }
+ }
+ else
+ {
+ return '?';
+ }
+}
+
+static void
+encode_ucs4 (Lisp_Object charset,
+ unsigned char h, unsigned char l, unsigned_char_dynarr *dst)
+{
+ unsigned long code = mule_char_to_ucs4 (charset, h, l);
+ Dynarr_add (dst, code >> 24);
+ Dynarr_add (dst, (code >> 16) & 255);
+ Dynarr_add (dst, (code >> 8) & 255);
+ Dynarr_add (dst, code & 255);
+}
+
+static int
+detect_coding_ucs4 (struct detection_state *st, CONST unsigned char *src,
+ unsigned int n)
+{
+ while (n--)
+ {
+ int c = *src++;
+ switch (st->ucs4.in_byte)
+ {
+ case 0:
+ if (c >= 128)
+ return 0;
+ else
+ st->ucs4.in_byte++;
+ break;
+ case 3:
+ st->ucs4.in_byte = 0;
+ break;
+ default:
+ st->ucs4.in_byte++;
+ }
+ }
+ return CODING_CATEGORY_UCS4_MASK;
+}
+
+static void
+decode_coding_ucs4 (Lstream *decoding, CONST unsigned char *src,
+ unsigned_char_dynarr *dst, unsigned int n)
+{
+ struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
+ unsigned int flags = str->flags;
+ unsigned int ch = str->ch;
+
+ while (n--)
+ {
+ unsigned char c = *src++;
+ switch (flags)
+ {
+ case 0:
+ ch = c;
+ flags = 3;
+ break;
+ case 1:
+ decode_ucs4 ( ( ch << 8 ) | c, dst);
+ ch = 0;
+ flags = 0;
+ break;
+ default:
+ ch = ( ch << 8 ) | c;
+ flags--;
+ }
+ }
+ if (flags & CODING_STATE_END)
+ DECODE_OUTPUT_PARTIAL_CHAR (ch);
+
+ str->flags = flags;
+ str->ch = ch;
+}
+
+static void
+encode_coding_ucs4 (Lstream *encoding, CONST unsigned char *src,
+ unsigned_char_dynarr *dst, unsigned int n)
+{
+ struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
+ unsigned int flags = str->flags;
+ unsigned int ch = str->ch;
+ unsigned char char_boundary = str->iso2022.current_char_boundary;
+ Lisp_Object charset = str->iso2022.current_charset;
+
+#ifdef ENABLE_COMPOSITE_CHARS
+ /* flags for handling composite chars. We do a little switcharoo
+ on the source while we're outputting the composite char. */
+ unsigned int saved_n = 0;
+ CONST unsigned char *saved_src = NULL;
+ int in_composite = 0;
+
+ back_to_square_n:
+#endif
+
+ while (n--)
+ {
+ unsigned char c = *src++;
+
+ if (BYTE_ASCII_P (c))
+ { /* Processing ASCII character */
+ ch = 0;
+ encode_ucs4 (Vcharset_ascii, c, 0, dst);
+ char_boundary = 1;
+ }
+ else if (BUFBYTE_LEADING_BYTE_P (c) || BUFBYTE_LEADING_BYTE_P (ch))
+ { /* Processing Leading Byte */
+ ch = 0;
+ charset = CHARSET_BY_LEADING_BYTE (c);
+ if (LEADING_BYTE_PREFIX_P(c))
+ ch = c;
+ char_boundary = 0;
+ }
+ else
+ { /* Processing Non-ASCII character */
+ char_boundary = 1;
+ if (EQ (charset, Vcharset_control_1))
+ {
+ encode_ucs4 (Vcharset_control_1, c, 0, dst);
+ }
+ else
+ {
+ switch (XCHARSET_REP_BYTES (charset))
+ {
+ case 2:
+ encode_ucs4 (charset, c, 0, dst);
+ break;
+ case 3:
+ if (XCHARSET_PRIVATE_P (charset))
+ {
+ encode_ucs4 (charset, c, 0, dst);
+ ch = 0;
+ }
+ else if (ch)
+ {
+#ifdef ENABLE_COMPOSITE_CHARS
+ if (EQ (charset, Vcharset_composite))
+ {
+ if (in_composite)
+ {
+ /* #### Bother! We don't know how to
+ handle this yet. */
+ Dynarr_add (dst, 0);
+ Dynarr_add (dst, 0);
+ Dynarr_add (dst, 0);
+ Dynarr_add (dst, '~');
+ }
+ else
+ {
+ Emchar emch = MAKE_CHAR (Vcharset_composite,
+ ch & 0x7F, c & 0x7F);
+ Lisp_Object lstr = composite_char_string (emch);
+ saved_n = n;
+ saved_src = src;
+ in_composite = 1;
+ src = XSTRING_DATA (lstr);
+ n = XSTRING_LENGTH (lstr);
+ }
+ }
+ else
+#endif /* ENABLE_COMPOSITE_CHARS */
+ {
+ encode_ucs4(charset, ch, c, dst);
+ }
+ ch = 0;
+ }
+ else
+ {
+ ch = c;
+ char_boundary = 0;
+ }
+ break;
+ case 4:
+ if (ch)
+ {
+ encode_ucs4 (charset, ch, c, dst);
+ ch = 0;
+ }
+ else
+ {
+ ch = c;
+ char_boundary = 0;
+ }
+ break;
+ default:
+ abort ();
+ }
+ }
+ }
+ }
+
+#ifdef ENABLE_COMPOSITE_CHARS
+ if (in_composite)
+ {
+ n = saved_n;
+ src = saved_src;
+ in_composite = 0;
+ goto back_to_square_n; /* Wheeeeeeeee ..... */
+ }
+#endif /* ENABLE_COMPOSITE_CHARS */
+
+ str->flags = flags;
+ str->ch = ch;
+ str->iso2022.current_char_boundary = char_boundary;
+ str->iso2022.current_charset = charset;
+
+ /* Verbum caro factum est! */
+}
+
+\f
+/************************************************************************/
+/* UTF-8 methods */
+/************************************************************************/
+
+static int
+detect_coding_utf8 (struct detection_state *st, CONST unsigned char *src,
+ unsigned int n)
+{
+ while (n--)
+ {
+ unsigned char c = *src++;
+ switch (st->utf8.in_byte)
+ {
+ case 0:
+ if (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO)
+ return 0;
+ else if (c >= 0xfc)
+ st->utf8.in_byte = 5;
+ else if (c >= 0xf8)
+ st->utf8.in_byte = 4;
+ else if (c >= 0xf0)
+ st->utf8.in_byte = 3;
+ else if (c >= 0xe0)
+ st->utf8.in_byte = 2;
+ else if (c >= 0xc0)
+ st->utf8.in_byte = 1;
+ else if (c >= 0x80)
+ return 0;
+ break;
+ default:
+ if ((c & 0xc0) != 0x80)
+ return 0;
+ else
+ st->utf8.in_byte--;
+ }
+ }
+ return CODING_CATEGORY_UTF8_MASK;
+}
+
+static void
+decode_coding_utf8 (Lstream *decoding, CONST unsigned char *src,
+ unsigned_char_dynarr *dst, unsigned int n)
+{
+ struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
+ unsigned int flags = str->flags;
+ unsigned int ch = str->ch;
+ eol_type_t eol_type = str->eol_type;
+
+ while (n--)
+ {
+ unsigned char c = *src++;
+ switch (flags)
+ {
+ case 0:
+ if ( c >= 0xfc )
+ {
+ ch = c & 0x01;
+ flags = 5;
+ }
+ else if ( c >= 0xf8 )
+ {
+ ch = c & 0x03;
+ flags = 4;
+ }
+ else if ( c >= 0xf0 )
+ {
+ ch = c & 0x07;
+ flags = 3;
+ }
+ else if ( c >= 0xe0 )
+ {
+ ch = c & 0x0f;
+ flags = 2;
+ }
+ else if ( c >= 0xc0 )
+ {
+ ch = c & 0x1f;
+ flags = 1;
+ }
+ else
+ {
+ DECODE_HANDLE_EOL_TYPE (eol_type, c, flags, dst);
+ decode_ucs4 (c, dst);
+ }
+ break;
+ case 1:
+ ch = ( ch << 6 ) | ( c & 0x3f );
+ decode_ucs4 (ch, dst);
+ ch = 0;
+ flags = 0;
+ break;
+ default:
+ ch = ( ch << 6 ) | ( c & 0x3f );
+ flags--;
+ }
+ label_continue_loop:;
+ }
+
+ if (flags & CODING_STATE_END)
+ DECODE_OUTPUT_PARTIAL_CHAR (ch);
+
+ str->flags = flags;
+ str->ch = ch;
+}
+
+static void
+encode_utf8 (Lisp_Object charset,
+ unsigned char h, unsigned char l, unsigned_char_dynarr *dst)
+{
+ unsigned long code = mule_char_to_ucs4 (charset, h, l);
+ if ( code <= 0x7f )
+ {
+ Dynarr_add (dst, code);
+ }
+ else if ( code <= 0x7ff )
+ {
+ Dynarr_add (dst, (code >> 6) | 0xc0);
+ Dynarr_add (dst, (code & 0x3f) | 0x80);
+ }
+ else if ( code <= 0xffff )
+ {
+ Dynarr_add (dst, (code >> 12) | 0xe0);
+ Dynarr_add (dst, ((code >> 6) & 0x3f) | 0x80);
+ Dynarr_add (dst, (code & 0x3f) | 0x80);
+ }
+ else if ( code <= 0x1fffff )
+ {
+ Dynarr_add (dst, (code >> 18) | 0xf0);
+ Dynarr_add (dst, ((code >> 12) & 0x3f) | 0x80);
+ Dynarr_add (dst, ((code >> 6) & 0x3f) | 0x80);
+ Dynarr_add (dst, (code & 0x3f) | 0x80);
+ }
+ else if ( code <= 0x3ffffff )
+ {
+ Dynarr_add (dst, (code >> 24) | 0xf8);
+ Dynarr_add (dst, ((code >> 18) & 0x3f) | 0x80);
+ Dynarr_add (dst, ((code >> 12) & 0x3f) | 0x80);
+ Dynarr_add (dst, ((code >> 6) & 0x3f) | 0x80);
+ Dynarr_add (dst, (code & 0x3f) | 0x80);
+ }
+ else
+ {
+ Dynarr_add (dst, (code >> 30) | 0xfc);
+ Dynarr_add (dst, ((code >> 24) & 0x3f) | 0x80);
+ Dynarr_add (dst, ((code >> 18) & 0x3f) | 0x80);
+ Dynarr_add (dst, ((code >> 12) & 0x3f) | 0x80);
+ Dynarr_add (dst, ((code >> 6) & 0x3f) | 0x80);
+ Dynarr_add (dst, (code & 0x3f) | 0x80);
+ }
+}
+
+static void
+encode_coding_utf8 (Lstream *encoding, CONST unsigned char *src,
+ unsigned_char_dynarr *dst, unsigned int n)
+{
+ struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
+ unsigned int flags = str->flags;
+ unsigned int ch = str->ch;
+ eol_type_t eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
+ unsigned char char_boundary = str->iso2022.current_char_boundary;
+ Lisp_Object charset = str->iso2022.current_charset;
+
+#ifdef ENABLE_COMPOSITE_CHARS
+ /* flags for handling composite chars. We do a little switcharoo
+ on the source while we're outputting the composite char. */
+ unsigned int saved_n = 0;
+ CONST unsigned char *saved_src = NULL;
+ int in_composite = 0;
+
+ back_to_square_n:
+#endif /* ENABLE_COMPOSITE_CHARS */
+
+ while (n--)
+ {
+ unsigned char c = *src++;
+
+ if (BYTE_ASCII_P (c))
+ { /* Processing ASCII character */
+ ch = 0;
+ if (c == '\n')
+ {
+ if (eol_type != EOL_LF && eol_type != EOL_AUTODETECT)
+ Dynarr_add (dst, '\r');
+ if (eol_type != EOL_CR)
+ Dynarr_add (dst, c);
+ }
+ else
+ encode_utf8 (Vcharset_ascii, c, 0, dst);
+ char_boundary = 1;
+ }
+ else if (BUFBYTE_LEADING_BYTE_P (c) || BUFBYTE_LEADING_BYTE_P (ch))
+ { /* Processing Leading Byte */
+ ch = 0;
+ charset = CHARSET_BY_LEADING_BYTE (c);
+ if (LEADING_BYTE_PREFIX_P(c))
+ ch = c;
+ char_boundary = 0;
+ }
+ else
+ { /* Processing Non-ASCII character */
+ char_boundary = 1;
+ if (EQ (charset, Vcharset_control_1))
+ {
+ encode_utf8 (Vcharset_control_1, c, 0, dst);
+ }
+ else
+ {
+ switch (XCHARSET_REP_BYTES (charset))
+ {
+ case 2:
+ encode_utf8 (charset, c, 0, dst);
+ break;
+ case 3:
+ if (XCHARSET_PRIVATE_P (charset))
+ {
+ encode_utf8 (charset, c, 0, dst);
+ ch = 0;
+ }
+ else if (ch)
+ {
+#ifdef ENABLE_COMPOSITE_CHARS
+ if (EQ (charset, Vcharset_composite))
+ {
+ if (in_composite)
+ {
+ /* #### Bother! We don't know how to
+ handle this yet. */
+ encode_utf8 (Vcharset_ascii, '~', 0, dst);
+ }
+ else
+ {
+ Emchar emch = MAKE_CHAR (Vcharset_composite,
+ ch & 0x7F, c & 0x7F);
+ Lisp_Object lstr = composite_char_string (emch);
+ saved_n = n;
+ saved_src = src;
+ in_composite = 1;
+ src = XSTRING_DATA (lstr);
+ n = XSTRING_LENGTH (lstr);
+ }
+ }
+ else
+#endif /* ENABLE_COMPOSITE_CHARS */
+ {
+ encode_utf8 (charset, ch, c, dst);
+ }
+ ch = 0;
+ }
+ else
+ {
+ ch = c;
+ char_boundary = 0;
+ }
+ break;
+ case 4:
+ if (ch)
+ {
+ encode_utf8 (charset, ch, c, dst);
+ ch = 0;
+ }
+ else
+ {
+ ch = c;
+ char_boundary = 0;
+ }
+ break;
+ default:
+ abort ();
+ }
+ }
+ }
+ }
+
+#ifdef ENABLE_COMPOSITE_CHARS
+ if (in_composite)
+ {
+ n = saved_n;
+ src = saved_src;
+ in_composite = 0;
+ goto back_to_square_n; /* Wheeeeeeeee ..... */
+ }
+#endif
+
+ str->flags = flags;
+ str->ch = ch;
+ str->iso2022.current_char_boundary = char_boundary;
+ str->iso2022.current_charset = charset;
+
+ /* Verbum caro factum est! */
+}
+
+\f
+/************************************************************************/
/* ISO2022 methods */
/************************************************************************/
/* The following note describes the coding system ISO2022 briefly.
- Since the intention of this note is to help understanding of the
- programs in this file, some parts are NOT ACCURATE or OVERLY
+ Since the intention of this note is to help understand the
+ functions in this file, some parts are NOT ACCURATE or OVERLY
SIMPLIFIED. For thorough understanding, please refer to the
original document of ISO2022.
ISO2022 provides many mechanisms to encode several character sets
- in 7-bit and 8-bit environments. If one chooses 7-bit environment,
- all text is encoded by codes of less than 128. This may make the
- encoded text a little bit longer, but the text get more stability
- to pass through several gateways (some of them strip off MSB).
+ in 7-bit and 8-bit environments. For 7-bit environments, all text
+ is encoded using bytes less than 128. This may make the encoded
+ text a little bit longer, but the text passes more easily through
+ several gateways, some of which strip off MSB (Most Signigant Bit).
- There are two kind of character sets: control character set and
+ There are two kinds of character sets: control character set and
graphic character set. The former contains control characters such
as `newline' and `escape' to provide control functions (control
- functions are provided also by escape sequence). The latter
+ functions are also provided by escape sequences). The latter
contains graphic characters such as 'A' and '-'. Emacs recognizes
two control character sets and many graphic character sets.
- Graphic character sets are classified into one of four types,
- according to the dimension and number of characters in the set:
- TYPE94, TYPE96, TYPE94x94, and TYPE96x96. In addition, each
- character set is assigned an identification byte, unique for each
- type, called "final character" (denoted as <F> hereafter). The <F>
- of each character set is decided by ECMA(*) when it is registered
- in ISO. Code range of <F> is 0x30..0x7F (0x30..0x3F are for
- private use only).
+ Graphic character sets are classified into one of the following
+ four classes, according to the number of bytes (DIMENSION) and
+ number of characters in one dimension (CHARS) of the set:
+ - DIMENSION1_CHARS94
+ - DIMENSION1_CHARS96
+ - DIMENSION2_CHARS94
+ - DIMENSION2_CHARS96
+
+ In addition, each character set is assigned an identification tag,
+ unique for each set, called "final character" (denoted as <F>
+ hereafter). The <F> of each character set is decided by ECMA(*)
+ when it is registered in ISO. The code range of <F> is 0x30..0x7F
+ (0x30..0x3F are for private use only).
Note (*): ECMA = European Computer Manufacturers Association
Here are examples of graphic character set [NAME(<F>)]:
- o TYPE94 -- ASCII('B'), right-half-of-JISX0201('I'), ...
- o TYPE96 -- right-half-of-ISO8859-1('A'), ...
- o TYPE94x94 -- GB2312('A'), JISX0208('B'), ...
- o TYPE96x96 -- none for the moment
+ o DIMENSION1_CHARS94 -- ASCII('B'), right-half-of-JISX0201('I'), ...
+ o DIMENSION1_CHARS96 -- right-half-of-ISO8859-1('A'), ...
+ o DIMENSION2_CHARS94 -- GB2312('A'), JISX0208('B'), ...
+ o DIMENSION2_CHARS96 -- none for the moment
- A code area (1byte=8bits) is divided into 4 areas, C0, GL, C1, and GR.
+ A code area (1 byte = 8 bits) is divided into 4 areas, C0, GL, C1, and GR.
C0 [0x00..0x1F] -- control character plane 0
GL [0x20..0x7F] -- graphic character plane 0
C1 [0x80..0x9F] -- control character plane 1
these invocations and designations are omitted in encoded text.
In a 7-bit environment, only GL can be used.
- When a graphic character set of TYPE94 or TYPE94x94 is invoked to
- GL, codes 0x20 and 0x7F of the GL area work as control characters
- SPACE and DEL respectively, and code 0xA0 and 0xFF of GR area
- should not be used.
+ When a graphic character set of CHARS94 is invoked to GL, codes
+ 0x20 and 0x7F of the GL area work as control characters SPACE and
+ DEL respectively, and codes 0xA0 and 0xFF of the GR area should not
+ be used.
There are two ways of invocation: locking-shift and single-shift.
With locking-shift, the invocation lasts until the next different
- invocation, whereas with single-shift, the invocation works only
- for the following character and doesn't affect locking-shift.
- Invocations are done by the following control characters or escape
- sequences.
+ invocation, whereas with single-shift, the invocation affects the
+ following character only and doesn't affect the locking-shift
+ state. Invocations are done by the following control characters or
+ escape sequences:
----------------------------------------------------------------------
abbrev function cntrl escape seq description
----------------------------------------------------------------------
SI/LS0 (shift-in) 0x0F none invoke G0 into GL
SO/LS1 (shift-out) 0x0E none invoke G1 into GL
- LS1R (locking-shift-1 right) none ESC '~' invoke G1 into GR
LS2 (locking-shift-2) none ESC 'n' invoke G2 into GL
- LS2R (locking-shift-2 right) none ESC '}' invoke G2 into GR
LS3 (locking-shift-3) none ESC 'o' invoke G3 into GL
- LS3R (locking-shift 3 right) none ESC '|' invoke G3 into GR
+ LS1R (locking-shift-1 right) none ESC '~' invoke G1 into GR (*)
+ LS2R (locking-shift-2 right) none ESC '}' invoke G2 into GR (*)
+ LS3R (locking-shift 3 right) none ESC '|' invoke G3 into GR (*)
SS2 (single-shift-2) 0x8E ESC 'N' invoke G2 for one char
SS3 (single-shift-3) 0x8F ESC 'O' invoke G3 for one char
----------------------------------------------------------------------
- The first four are for locking-shift. Control characters for these
- functions are defined by macros ISO_CODE_XXX in `coding.h'.
+ (*) These are not used by any known coding system.
+
+ Control characters for these functions are defined by macros
+ ISO_CODE_XXX in `coding.h'.
- Designations are done by the following escape sequences.
+ Designations are done by the following escape sequences:
----------------------------------------------------------------------
escape sequence description
----------------------------------------------------------------------
- ESC '(' <F> designate TYPE94<F> to G0
- ESC ')' <F> designate TYPE94<F> to G1
- ESC '*' <F> designate TYPE94<F> to G2
- ESC '+' <F> designate TYPE94<F> to G3
- ESC ',' <F> designate TYPE96<F> to G0 (*)
- ESC '-' <F> designate TYPE96<F> to G1
- ESC '.' <F> designate TYPE96<F> to G2
- ESC '/' <F> designate TYPE96<F> to G3
- ESC '$' '(' <F> designate TYPE94x94<F> to G0 (**)
- ESC '$' ')' <F> designate TYPE94x94<F> to G1
- ESC '$' '*' <F> designate TYPE94x94<F> to G2
- ESC '$' '+' <F> designate TYPE94x94<F> to G3
- ESC '$' ',' <F> designate TYPE96x96<F> to G0 (*)
- ESC '$' '-' <F> designate TYPE96x96<F> to G1
- ESC '$' '.' <F> designate TYPE96x96<F> to G2
- ESC '$' '/' <F> designate TYPE96x96<F> to G3
+ ESC '(' <F> designate DIMENSION1_CHARS94<F> to G0
+ ESC ')' <F> designate DIMENSION1_CHARS94<F> to G1
+ ESC '*' <F> designate DIMENSION1_CHARS94<F> to G2
+ ESC '+' <F> designate DIMENSION1_CHARS94<F> to G3
+ ESC ',' <F> designate DIMENSION1_CHARS96<F> to G0 (*)
+ ESC '-' <F> designate DIMENSION1_CHARS96<F> to G1
+ ESC '.' <F> designate DIMENSION1_CHARS96<F> to G2
+ ESC '/' <F> designate DIMENSION1_CHARS96<F> to G3
+ ESC '$' '(' <F> designate DIMENSION2_CHARS94<F> to G0 (**)
+ ESC '$' ')' <F> designate DIMENSION2_CHARS94<F> to G1
+ ESC '$' '*' <F> designate DIMENSION2_CHARS94<F> to G2
+ ESC '$' '+' <F> designate DIMENSION2_CHARS94<F> to G3
+ ESC '$' ',' <F> designate DIMENSION2_CHARS96<F> to G0 (*)
+ ESC '$' '-' <F> designate DIMENSION2_CHARS96<F> to G1
+ ESC '$' '.' <F> designate DIMENSION2_CHARS96<F> to G2
+ ESC '$' '/' <F> designate DIMENSION2_CHARS96<F> to G3
----------------------------------------------------------------------
- In this list, "TYPE94<F>" means a graphic character set of type TYPE94
- and final character <F>, and etc.
+
+ In this list, "DIMENSION1_CHARS94<F>" means a graphic character set
+ of dimension 1, chars 94, and final character <F>, etc...
Note (*): Although these designations are not allowed in ISO2022,
Emacs accepts them on decoding, and produces them on encoding
- TYPE96 or TYPE96x96 character set in a coding system which is
- characterized as 7-bit environment, non-locking-shift, and
- non-single-shift.
+ CHARS96 character sets in a coding system which is characterized as
+ 7-bit environment, non-locking-shift, and non-single-shift.
Note (**): If <F> is '@', 'A', or 'B', the intermediate character
- '(' can be omitted. We call this as "short-form" here after.
+ '(' can be omitted. We refer to this as "short-form" hereafter.
Now you may notice that there are a lot of ways for encoding the
same multilingual text in ISO2022. Actually, there exist many
- coding systems such as Compound Text (used in X's inter client
+ coding systems such as Compound Text (used in X11's inter client
communication, ISO-2022-JP (used in Japanese internet), ISO-2022-KR
(used in Korean internet), EUC (Extended UNIX Code, used in Asian
localized platforms), and all of these are variants of ISO2022.
sequences: ISO6429's direction specification and Emacs' private
sequence for specifying character composition.
- ISO6429's direction specification takes the following format:
+ ISO6429's direction specification takes the following form:
o CSI ']' -- end of the current direction
o CSI '0' ']' -- end of the current direction
o CSI '1' ']' -- start of left-to-right text
o CSI '2' ']' -- start of right-to-left text
The control character CSI (0x9B: control sequence introducer) is
- abbreviated to the escape sequence ESC '[' in 7-bit environment.
+ abbreviated to the escape sequence ESC '[' in a 7-bit environment.
- Character composition specification takes the following format:
+ Character composition specification takes the following form:
o ESC '0' -- start character composition
o ESC '1' -- end character composition
- Since these are not standard escape sequences of any ISO, the use
- of them for these meanings is restricted to Emacs only. */
+ Since these are not standard escape sequences of any ISO standard,
+ their use with these meanings is restricted to Emacs only. */
static void
reset_iso2022 (Lisp_Object coding_system, struct iso2022_decoder *iso)
iso->invalid_switch_dir = 0;
iso->output_direction_sequence = 0;
iso->output_literally = 0;
+#ifdef ENABLE_COMPOSITE_CHARS
if (iso->composite_chars)
Dynarr_reset (iso->composite_chars);
+#endif
}
static int
reg = 3; half = 1;
goto locking_shift;
+#ifdef ENABLE_COMPOSITE_CHARS
/**** composite ****/
case '0':
*flags = (*flags & CODING_STATE_ISO2022_LOCK) &
~CODING_STATE_COMPOSITE;
return 1;
+#endif /* ENABLE_COMPOSITE_CHARS */
/**** directionality ****/
need to handle the CSI differently. */
static void
-restore_left_to_right_direction (struct Lisp_Coding_System *codesys,
+restore_left_to_right_direction (Lisp_Coding_System *codesys,
unsigned_char_dynarr *dst,
unsigned int *flags,
int internal_p)
need to handle the CSI differently. */
static void
-ensure_correct_direction (int direction, struct Lisp_Coding_System *codesys,
+ensure_correct_direction (int direction, Lisp_Coding_System *codesys,
unsigned_char_dynarr *dst, unsigned int *flags,
int internal_p)
{
decode_coding_iso2022 (Lstream *decoding, CONST unsigned char *src,
unsigned_char_dynarr *dst, unsigned int n)
{
- unsigned int flags, ch;
- enum eol_type eol_type;
struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
- Lisp_Object coding_system;
+ unsigned int flags = str->flags;
+ unsigned int ch = str->ch;
+ eol_type_t eol_type = str->eol_type;
+#ifdef ENABLE_COMPOSITE_CHARS
unsigned_char_dynarr *real_dst = dst;
+#endif
+ Lisp_Object coding_system;
- CODING_STREAM_DECOMPOSE (str, flags, ch);
- eol_type = str->eol_type;
XSETCODING_SYSTEM (coding_system, str->codesys);
+#ifdef ENABLE_COMPOSITE_CHARS
if (flags & CODING_STATE_COMPOSITE)
dst = str->iso2022.composite_chars;
+#endif /* ENABLE_COMPOSITE_CHARS */
while (n--)
{
{
switch (str->iso2022.esc)
{
+#ifdef ENABLE_COMPOSITE_CHARS
case ISO_ESC_START_COMPOSITE:
if (str->iso2022.composite_chars)
Dynarr_reset (str->iso2022.composite_chars);
Dynarr_add_many (dst, comstr, len);
break;
}
+#endif /* ENABLE_COMPOSITE_CHARS */
case ISO_ESC_LITERAL:
DECODE_ADD_BINARY_CHAR (c, dst);
if (flags & CODING_STATE_END)
DECODE_OUTPUT_PARTIAL_CHAR (ch);
- CODING_STREAM_COMPOSE (str, flags, ch);
+ str->flags = flags;
+ str->ch = ch;
}
iso2022_designate (Lisp_Object charset, unsigned char reg,
struct encoding_stream *str, unsigned_char_dynarr *dst)
{
- CONST char *inter94 = "()*+", *inter96= ",-./";
+ static CONST char inter94[] = "()*+";
+ static CONST char inter96[] = ",-./";
unsigned int type;
unsigned char final;
Lisp_Object old_charset = str->iso2022.charset[reg];
unsigned_char_dynarr *dst, unsigned int n)
{
unsigned char charmask, c;
- unsigned int flags, ch;
- enum eol_type eol_type;
unsigned char char_boundary;
struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
- struct Lisp_Coding_System *codesys = str->codesys;
+ unsigned int flags = str->flags;
+ unsigned int ch = str->ch;
+ Lisp_Coding_System *codesys = str->codesys;
+ eol_type_t eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
int i;
Lisp_Object charset;
int half;
+#ifdef ENABLE_COMPOSITE_CHARS
/* flags for handling composite chars. We do a little switcharoo
on the source while we're outputting the composite char. */
unsigned int saved_n = 0;
CONST unsigned char *saved_src = NULL;
int in_composite = 0;
+#endif /* ENABLE_COMPOSITE_CHARS */
- CODING_STREAM_DECOMPOSE (str, flags, ch);
- eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
char_boundary = str->iso2022.current_char_boundary;
charset = str->iso2022.current_charset;
half = str->iso2022.current_half;
+#ifdef ENABLE_COMPOSITE_CHARS
back_to_square_n:
+#endif
while (n--)
{
c = *src++;
if (LEADING_BYTE_PREFIX_P(c))
ch = c;
else if (!EQ (charset, Vcharset_control_1)
- && !EQ (charset, Vcharset_composite))
+#ifdef ENABLE_COMPOSITE_CHARS
+ && !EQ (charset, Vcharset_composite)
+#endif
+ )
{
int reg;
}
else if (ch)
{
+#ifdef ENABLE_COMPOSITE_CHARS
if (EQ (charset, Vcharset_composite))
{
if (in_composite)
}
}
else
+#endif /* ENABLE_COMPOSITE_CHARS */
{
Dynarr_add (dst, ch & charmask);
Dynarr_add (dst, c & charmask);
}
}
+#ifdef ENABLE_COMPOSITE_CHARS
if (in_composite)
{
n = saved_n;
Dynarr_add (dst, '1'); /* end composing */
goto back_to_square_n; /* Wheeeeeeeee ..... */
}
+#endif /* ENABLE_COMPOSITE_CHARS */
if (char_boundary && flags & CODING_STATE_END)
{
}
}
- CODING_STREAM_COMPOSE (str, flags, ch);
+ str->flags = flags;
+ str->ch = ch;
str->iso2022.current_char_boundary = char_boundary;
str->iso2022.current_charset = charset;
str->iso2022.current_half = half;
unsigned_char_dynarr *dst, unsigned int n)
{
unsigned char c;
- unsigned int flags, ch;
- enum eol_type eol_type;
struct decoding_stream *str = DECODING_STREAM_DATA (decoding);
-
- CODING_STREAM_DECOMPOSE (str, flags, ch);
- eol_type = str->eol_type;
+ unsigned int flags = str->flags;
+ unsigned int ch = str->ch;
+ eol_type_t eol_type = str->eol_type;
while (n--)
{
DECODE_HANDLE_END_OF_CONVERSION (flags, ch, dst);
- CODING_STREAM_COMPOSE (str, flags, ch);
+ str->flags = flags;
+ str->ch = ch;
}
static void
{
unsigned char c;
struct encoding_stream *str = ENCODING_STREAM_DATA (encoding);
- unsigned int flags, ch;
- enum eol_type eol_type;
-
- CODING_STREAM_DECOMPOSE (str, flags, ch);
- eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
+ unsigned int flags = str->flags;
+ unsigned int ch = str->ch;
+ eol_type_t eol_type = CODING_SYSTEM_EOL_TYPE (str->codesys);
while (n--)
{
}
}
- CODING_STREAM_COMPOSE (str, flags, ch);
+ str->flags = flags;
+ str->ch = ch;
}
\f
DEFSUBR (Fencode_shift_jis_char);
DEFSUBR (Fdecode_big5_char);
DEFSUBR (Fencode_big5_char);
+ DEFSUBR (Fset_ucs_char);
+ DEFSUBR (Fucs_char);
+ DEFSUBR (Fset_char_ucs);
+ DEFSUBR (Fchar_ucs);
#endif /* MULE */
defsymbol (&Qcoding_system_p, "coding-system-p");
defsymbol (&Qno_conversion, "no-conversion");
#ifdef MULE
defsymbol (&Qbig5, "big5");
defsymbol (&Qshift_jis, "shift-jis");
+ defsymbol (&Qucs4, "ucs-4");
+ defsymbol (&Qutf8, "utf-8");
defsymbol (&Qccl, "ccl");
defsymbol (&Qiso2022, "iso2022");
#endif /* MULE */
"shift-jis");
defsymbol (&coding_category_symbol[CODING_CATEGORY_BIG5],
"big5");
+ defsymbol (&coding_category_symbol[CODING_CATEGORY_UCS4],
+ "ucs-4");
+ defsymbol (&coding_category_symbol[CODING_CATEGORY_UTF8],
+ "utf-8");
defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_7],
"iso-7");
defsymbol (&coding_category_symbol[CODING_CATEGORY_ISO_8_DESIGNATE],
/* Need this for bootstrapping */
coding_category_system[CODING_CATEGORY_NO_CONVERSION] =
Fget_coding_system (Qno_conversion);
+
+#ifdef MULE
+ {
+ unsigned int i;
+
+ for (i = 0; i < 65536; i++)
+ ucs_to_mule_table[i] = Qnil;
+ }
+ staticpro (&mule_to_ucs_table);
+ mule_to_ucs_table = Fmake_char_table(Qgeneric);
+#endif /* MULE */
}
CODESYS_ISO2022, /* Any ISO2022-compliant coding system.
Includes JIS, EUC, CTEXT */
CODESYS_BIG5, /* BIG5 (used for Taiwanese). */
+ CODESYS_UCS4, /* ISO 10646 UCS-4 */
+ CODESYS_UTF8, /* ISO 10646 UTF-8 */
CODESYS_CCL, /* Converter written in CCL. */
#endif
CODESYS_NO_CONVERSION /* "No conversion"; used for binary files.
EOL_CRLF,
EOL_CR
};
+typedef enum eol_type eol_type_t;
#ifdef MULE
typedef struct charset_conversion_spec charset_conversion_spec;
} ccl;
#endif
};
+typedef struct Lisp_Coding_System Lisp_Coding_System;
DECLARE_LRECORD (coding_system, struct Lisp_Coding_System);
#define XCODING_SYSTEM(x) XRECORD (x, coding_system, struct Lisp_Coding_System)
EXFUN (Fset_coding_priority_list, 1);
EXFUN (Fsubsidiary_coding_system, 2);
+extern Lisp_Object Qucs4, Qutf8;
extern Lisp_Object Qbig5, Qbuffer_file_coding_system, Qccl, Qcharset_g0;
extern Lisp_Object Qcharset_g1, Qcharset_g2, Qcharset_g3, Qcoding_system_error;
extern Lisp_Object Qcoding_system_p, Qcr, Qcrlf, Qctext, Qdecode, Qencode;
CODING_STATE_SS2 overrides; but
this probably indicates an error
in the text encoding. */
+#ifdef ENABLE_COMPOSITE_CHARS
#define CODING_STATE_COMPOSITE (1 << 8) /* If set, we're currently processing
a composite character (i.e. a
character constructed by
overstriking two or more
characters). */
+#endif /* ENABLE_COMPOSITE_CHARS */
/* CODING_STATE_ISO2022_LOCK is the mask of flags that remain on until
explicitly turned off when in the ISO2022 encoder/decoder. Other flags are
turned off at the end of processing each character or escape sequence. */
+#ifdef ENABLE_COMPOSITE_CHARS
# define CODING_STATE_ISO2022_LOCK \
(CODING_STATE_END | CODING_STATE_COMPOSITE | CODING_STATE_R2L)
-#define CODING_STATE_BIG5_LOCK \
- CODING_STATE_END
+#else
+# define CODING_STATE_ISO2022_LOCK (CODING_STATE_END | CODING_STATE_R2L)
+#endif
+
+#define CODING_STATE_BIG5_LOCK CODING_STATE_END
/* Flags indicating what we've seen so far when parsing an
ISO2022 escape sequence. */
starts a directionality-control
sequence. The next character
must be 0, 1, 2, or ]. */
- ISO_ESC_5_11_0, /* We've seen 0x9B 0. The next
- character must be ]. */
- ISO_ESC_5_11_1, /* We've seen 0x9B 1. The next
- character must be ]. */
- ISO_ESC_5_11_2, /* We've seen 0x9B 2. The next
- character must be ]. */
+ ISO_ESC_5_11_0, /* We've seen 0x9B 0. The next character must be ]. */
+ ISO_ESC_5_11_1, /* We've seen 0x9B 1. The next character must be ]. */
+ ISO_ESC_5_11_2, /* We've seen 0x9B 2. The next character must be ]. */
/* Full sequences. */
+#ifdef ENABLE_COMPOSITE_CHARS
ISO_ESC_START_COMPOSITE, /* Private usage for START COMPOSING */
- ISO_ESC_END_COMPOSITE, /* Private usage for END COMPOSING */
+ ISO_ESC_END_COMPOSITE, /* Private usage for END COMPOSING */
+#endif /* ENABLE_COMPOSITE_CHARS */
ISO_ESC_SINGLE_SHIFT, /* We've seen a complete single-shift sequence. */
ISO_ESC_LOCKING_SHIFT,/* We've seen a complete locking-shift sequence. */
ISO_ESC_DESIGNATE, /* We've seen a complete designation sequence. */
#define ISO_CODE_CSI 0x9B /* control-sequence-introduce */
#endif /* MULE */
-/* Macros to access an encoding stream or decoding stream */
-
-#define CODING_STREAM_DECOMPOSE(str, flags, ch) \
-do { \
- flags = (str)->flags; \
- ch = (str)->ch; \
-} while (0)
-
-#define CODING_STREAM_COMPOSE(str, flags, ch) \
-do { \
- (str)->flags = flags; \
- (str)->ch = ch; \
-} while (0)
-
-
/* For detecting the encoding of text */
enum coding_category_type
{
two-dimension characters in the upper half. */
CODING_CATEGORY_ISO_LOCK_SHIFT, /* ISO2022 system using locking shift */
CODING_CATEGORY_BIG5,
+ CODING_CATEGORY_UCS4,
+ CODING_CATEGORY_UTF8,
#endif /* MULE */
CODING_CATEGORY_NO_CONVERSION
};
(1 << CODING_CATEGORY_ISO_LOCK_SHIFT)
#define CODING_CATEGORY_BIG5_MASK \
(1 << CODING_CATEGORY_BIG5)
+#define CODING_CATEGORY_UCS4_MASK \
+ (1 << CODING_CATEGORY_UCS4)
+#define CODING_CATEGORY_UTF8_MASK \
+ (1 << CODING_CATEGORY_UTF8)
#endif
#define CODING_CATEGORY_NO_CONVERSION_MASK \
(1 << CODING_CATEGORY_NO_CONVERSION)
#ifndef MULE
#define MIN_LEADING_BYTE 0x80
/* These need special treatment in a string and/or character */
+#ifdef ENABLE_COMPOSITE_CHARS
#define LEADING_BYTE_COMPOSITE 0x80 /* for a composite character */
+#endif
#define LEADING_BYTE_CONTROL_1 0x8F /* represent normal 80-9F */
#define LEADING_BYTE_LATIN_ISO8859_1 0x81 /* Right half of ISO 8859-1 */
#define BYTE_C1_P(c) ((unsigned int) ((unsigned int) (c) - 0x80) < 0x20)
*e++ = base64_value_to_char[0x3f & c];
}
- /* Complete last partial line. */
- if (line_break)
- if (counter > 0)
- *e++ = '\n';
-
return e - to;
}
#undef ADVANCE_INPUT
return make_int (encoded_length);
}
-DEFUN ("base64-encode-string", Fbase64_encode_string, 1, 1, 0, /*
+DEFUN ("base64-encode-string", Fbase64_encode_string, 1, 2, 0, /*
Base64 encode STRING and return the result.
*/
- (string))
+ (string, no_line_break))
{
Charcount allength, length;
Bytind encoded_length;
CHECK_STRING (string);
length = XSTRING_CHAR_LENGTH (string);
- allength = length + length/3 + 1 + 6;
+ allength = length + length/3 + 1;
+ allength += allength / MIME_LINE_LENGTH + 1 + 6;
input = make_lisp_string_input_stream (string, 0, -1);
XMALLOC_OR_ALLOCA (encoded, allength, Bufbyte);
- encoded_length = base64_encode_1 (XLSTREAM (input), encoded, 0);
+ encoded_length = base64_encode_1 (XLSTREAM (input), encoded,
+ NILP (no_line_break));
if (encoded_length > allength)
abort ();
Lstream_delete (XLSTREAM (input));
static void
x_delete_frame (struct frame *f)
{
+ Display *dpy;
+
#ifndef HAVE_SESSION
if (FRAME_X_TOP_LEVEL_FRAME_P (f))
x_wm_maybe_move_wm_command (f);
#endif /* HAVE_CDE */
assert (FRAME_X_SHELL_WIDGET (f) != 0);
+ dpy = XtDisplay (FRAME_X_SHELL_WIDGET (f));
#ifdef EXTERNAL_WIDGET
expect_x_error (XtDisplay (FRAME_X_SHELL_WIDGET (f)));
XtDestroyWidget (FRAME_X_SHELL_WIDGET (f));
/* make sure the windows are really gone! */
/* ### Is this REALLY necessary? */
- XFlush (XtDisplay (FRAME_X_SHELL_WIDGET (f)));
+ XFlush (dpy);
#endif /* EXTERNAL_WIDGET */
FRAME_X_SHELL_WIDGET (f) = 0;
/* Note: There is no more input blocking in XEmacs */
typedef enum {
block_type, unblock_type, totally_type,
- gcpro1_type, gcpro2_type, gcpro3_type, gcpro4_type, ungcpro_type
+ gcpro1_type, gcpro2_type, gcpro3_type, gcpro4_type, gcpro5_type,
+ ungcpro_type
} blocktype;
struct block_input_history_struct
typedef struct block_input_history_struct block_input_history;
-#endif
+#endif /* DEBUG_INPUT_BLOCKING || DEBUG_GCPRO */
#ifdef DEBUG_INPUT_BLOCKING
blhistptr = 0;
}
-#endif
+#endif /* DEBUG_INPUT_BLOCKING */
\f
#ifdef DEBUG_GCPRO
static void
log_gcpro (char *file, int line, struct gcpro *value, blocktype type)
{
- FRAME start_frame;
-
if (type == ungcpro_type)
{
if (value == gcprolist) goto OK;
gcprolist = gcpro1->next;
}
+
+/* To be called from the debugger */
+void show_gcprohist (void);
void
show_gcprohist (void)
{
fflush (stdout);
}
-#endif
+#endif /* DEBUG_GCPRO */
COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (XCDR (cons)));
GET_C_STRING_OS_DATA_ALLOCA (XCAR (cons), colortbl[j].name);
+ colortbl[j].name = xstrdup (colortbl[j].name); /* mustn't lose this when we return */
free_cons (XCONS (cons));
cons = results;
results = XCDR (results);
}
if (color_symbols)
- xfree(color_symbols);
+ {
+ while (nsymbols--)
+ {
+ xfree (color_symbols[nsymbols].name);
+ }
+ xfree(color_symbols);
+ }
/* build a bitmap from the eimage */
if (!(bmp_info=convert_EImage_to_DIBitmap (device, width, height, eimage,
/***** Calling an image-instantiator method *****/
-#define HAS_IIFORMAT_METH_P(mstruc, m) ((mstruc)->m##_method)
+#define HAS_IIFORMAT_METH_P(mstruc, m) (((mstruc)->m##_method) != 0)
#define IIFORMAT_METH(mstruc, m, args) (((mstruc)->m##_method) args)
/* Call a void-returning specifier method, if it exists */
-#define MAYBE_IIFORMAT_METH(mstruc, m, args) \
-if (mstruc) \
-do { \
- struct image_instantiator_methods *maybe_iiformat_meth_mstruc = (mstruc); \
- if (HAS_IIFORMAT_METH_P (maybe_iiformat_meth_mstruc, m)) \
- IIFORMAT_METH (maybe_iiformat_meth_mstruc, m, args); \
+#define MAYBE_IIFORMAT_METH(mstruc, m, args) \
+do { \
+ struct image_instantiator_methods *MIM_mstruc = (mstruc); \
+ if (MIM_mstruc && HAS_IIFORMAT_METH_P (MIM_mstruc, m)) \
+ IIFORMAT_METH (MIM_mstruc, m, args); \
} while (0)
-#define MAYBE_IIFORMAT_DEVMETH(device, mstruc, m, args) \
-do { \
- struct image_instantiator_methods *_mstruc = decode_ii_device (device, mstruc); \
- if (_mstruc) \
- MAYBE_IIFORMAT_METH(_mstruc, m, args); \
+#define MAYBE_IIFORMAT_DEVMETH(device, mstruc, m, args) \
+do { \
+ struct image_instantiator_methods *MID_mstruc = \
+ decode_ii_device (device, mstruc); \
+ if (MID_mstruc) \
+ MAYBE_IIFORMAT_METH(MID_mstruc, m, args); \
} while (0)
if (ll+2 >= MAX_MENUITEM_LENGTH)
signal_simple_error ("Menu item produces too long displayable string",
pgui_item->name);
- memmove (ptr+1, ptr, ll-(ptr-buf));
+ memmove (ptr+1, ptr, (ll-(ptr-buf))+1);
ll++;
ptr+=2;
}
Lisp_Object Vcharset_chinese_cns11643_1;
Lisp_Object Vcharset_chinese_cns11643_2;
Lisp_Object Vcharset_korean_ksc5601;
+
+#ifdef ENABLE_COMPOSITE_CHARS
Lisp_Object Vcharset_composite;
/* Hash tables for composite chars. One maps string representing
Lisp_Object Vcomposite_char_char2string_hash_table;
Lisp_Object Vcomposite_char_string2char_hash_table;
+static int composite_char_row_next;
+static int composite_char_col_next;
+
+#endif /* ENABLE_COMPOSITE_CHARS */
+
/* Table of charsets indexed by leading byte. */
Lisp_Object charset_by_leading_byte[128];
/* Table of charsets indexed by type/final-byte/direction. */
Lisp_Object charset_by_attributes[4][128][2];
-static int composite_char_row_next;
-static int composite_char_col_next;
-
/* Table of number of bytes in the string representation of a character
indexed by the first byte of that representation.
if (f2 < 0x20 || f3 < 0x20)
return 0;
+#ifdef ENABLE_COMPOSITE_CHARS
if (f1 + FIELD1_TO_OFFICIAL_LEADING_BYTE == LEADING_BYTE_COMPOSITE)
{
if (UNBOUNDP (Fgethash (make_int (ch),
return 0;
return 1;
}
+#endif /* ENABLE_COMPOSITE_CHARS */
if (f2 != 0x20 && f2 != 0x7F && f3 != 0x20 && f3 != 0x7F)
return 1;
}
\f
+#ifdef ENABLE_COMPOSITE_CHARS
/************************************************************************/
/* composite character functions */
/************************************************************************/
return str;
}
-DEFUN ("make-composite-char", Fmake_composite_char, 1, 1, 0, /*
+xxDEFUN ("make-composite-char", Fmake_composite_char, 1, 1, 0, /*
Convert a string into a single composite character.
The character is the result of overstriking all the characters in
the string.
XSTRING_LENGTH (string)));
}
-DEFUN ("composite-char-string", Fcomposite_char_string, 1, 1, 0, /*
+xxDEFUN ("composite-char-string", Fcomposite_char_string, 1, 1, 0, /*
Return a string of the characters comprising a composite character.
*/
(ch))
signal_simple_error ("Must be composite char", ch);
return composite_char_string (emch);
}
+#endif /* ENABLE_COMPOSITE_CHARS */
\f
/************************************************************************/
DEFSUBR (Fchar_charset);
DEFSUBR (Fchar_octet);
+#ifdef ENABLE_COMPOSITE_CHARS
DEFSUBR (Fmake_composite_char);
DEFSUBR (Fcomposite_char_string);
+#endif
defsymbol (&Qcharsetp, "charsetp");
defsymbol (&Qregistry, "registry");
CHARSET_LEFT_TO_RIGHT,
build_string ("KS C5601 (Hangul and Korean Hanja)"),
build_string ("ksc5601"));
+
+#ifdef ENABLE_COMPOSITE_CHARS
/* #### For simplicity, we put composite chars into a 96x96 charset.
This is going to lead to problems because you can run out of
room, esp. as we don't yet recycle numbers. */
make_lisp_hash_table (500, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
staticpro (&Vcomposite_char_string2char_hash_table);
staticpro (&Vcomposite_char_char2string_hash_table);
+#endif /* ENABLE_COMPOSITE_CHARS */
}
#define MIN_LEADING_BYTE 0x80
/* These need special treatment in a string and/or character */
#define LEADING_BYTE_ASCII 0x8E /* Omitted in a buffer */
+#ifdef ENABLE_COMPOSITE_CHARS
+#endif
#define LEADING_BYTE_COMPOSITE 0x80 /* for a composite character */
#define LEADING_BYTE_CONTROL_1 0x8F /* represent normal 80-9F */
else if (c < MIN_CHAR_COMPOSITION)
return CHAR_FIELD1 (c) + FIELD1_TO_PRIVATE_LEADING_BYTE;
else
- return LEADING_BYTE_COMPOSITE;
+ {
+#ifdef ENABLE_COMPOSITE_CHARS
+ return LEADING_BYTE_COMPOSITE;
+#else
+ abort();
+ return 0;
+#endif /* ENABLE_COMPOSITE_CHARS */
+ }
}
#define CHAR_CHARSET(c) CHARSET_BY_LEADING_BYTE (CHAR_LEADING_BYTE (c))
return c1;
else if (EQ (charset, Vcharset_control_1))
return c1 | 0x80;
+#ifdef ENABLE_COMPOSITE_CHARS
else if (EQ (charset, Vcharset_composite))
return (0x1F << 14) | ((c1) << 7) | (c2);
+#endif
else if (XCHARSET_DIMENSION (charset) == 1)
return ((XCHARSET_LEADING_BYTE (charset) -
FIELD2_TO_OFFICIAL_LEADING_BYTE) << 7) | (c1);
\f
+#ifdef ENABLE_COMPOSITE_CHARS
/************************************************************************/
/* Composite characters */
/************************************************************************/
Emchar lookup_composite_char (Bufbyte *str, int len);
Lisp_Object composite_char_string (Emchar ch);
+#endif /* ENABLE_COMPOSITE_CHARS */
\f
/************************************************************************/
static Lisp_Object
mark_opaque (Lisp_Object obj, void (*markobj) (Lisp_Object))
{
- Lisp_Opaque *p = XOPAQUE (obj);
- Lisp_Object size_or_chain = p->size_or_chain;
+ Lisp_Opaque *p = XOPAQUE (obj);
+ /* Egcs 1.1.1 sometimes crashes on INTP (p->size_or_chain) */
+ Lisp_Object size_or_chain = p->size_or_chain;
#ifdef ERROR_CHECK_GC
if (!in_opaque_list_marking)
/* size is non-int for objects on an opaque free list. We sure
print_opaque (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
CONST Lisp_Opaque *p = XOPAQUE (obj);
+ /* Egcs 1.1.1 sometimes crashes on INTP (p->size_or_chain) */
+ Lisp_Object size_or_chain = p->size_or_chain;
char buf[200];
char size_buf[50];
- if (INTP (p->size_or_chain))
+ if (INTP (size_or_chain))
sprintf (size_buf, "size=%lu", (unsigned long) OPAQUE_SIZE (p));
else
sprintf (size_buf, "freed");
sizeof_opaque (CONST void *header)
{
CONST Lisp_Opaque *p = (CONST Lisp_Opaque *) header;
+ /* Egcs 1.1.1 sometimes crashes on INTP (p->size_or_chain) */
+ Lisp_Object size_or_chain = p->size_or_chain;
return offsetof (Lisp_Opaque, data)
- + (GC_INTP (p->size_or_chain) ? XINT (p->size_or_chain) : 0);
+ + (GC_INTP (size_or_chain) ? XINT (size_or_chain) : 0);
}
/* Return an opaque object of size SIZE.
static int
equal_opaque (Lisp_Object obj1, Lisp_Object obj2, int depth)
{
- size_t size;
#ifdef DEBUG_XEMACS
- assert (!XOPAQUE_MARKFUN (obj1) && !XOPAQUE_MARKFUN (obj2));
- assert (INTP (XOPAQUE (obj1)->size_or_chain));
- assert (INTP (XOPAQUE (obj2)->size_or_chain));
+ {
+ /* Egcs 1.1.1 sometimes crashes on INTP (p->size_or_chain) */
+ Lisp_Object size_or_chain_1 = XOPAQUE (obj1)->size_or_chain;
+ Lisp_Object size_or_chain_2 = XOPAQUE (obj2)->size_or_chain;
+ assert (INTP (size_or_chain_1));
+ assert (INTP (size_or_chain_2));
+ assert (!XOPAQUE_MARKFUN (obj1) && !XOPAQUE_MARKFUN (obj2));
+ }
#endif
- return ((size = XOPAQUE_SIZE (obj1)) == XOPAQUE_SIZE (obj2) &&
- !memcmp (XOPAQUE_DATA (obj1), XOPAQUE_DATA (obj2), size));
+ {
+ size_t size;
+ return ((size = XOPAQUE_SIZE (obj1)) == XOPAQUE_SIZE (obj2) &&
+ !memcmp (XOPAQUE_DATA (obj1), XOPAQUE_DATA (obj2), size));
+ }
}
/* This will not work correctly for opaques with subobjects! */
hash_opaque (Lisp_Object obj, int depth)
{
#ifdef DEBUG_XEMACS
- assert (!XOPAQUE_MARKFUN (obj));
- assert (INTP (XOPAQUE (obj)->size_or_chain));
+ {
+ /* Egcs 1.1.1 sometimes crashes on INTP (p->size_or_chain) */
+ Lisp_Object size_or_chain = XOPAQUE (obj)->size_or_chain;
+ assert (INTP (size_or_chain));
+ assert (!XOPAQUE_MARKFUN (obj));
+ }
#endif
if (XOPAQUE_SIZE (obj) == sizeof (unsigned long))
- return *((unsigned long *) XOPAQUE_DATA(obj));
+ return *((unsigned long *) XOPAQUE_DATA (obj));
else
return memory_hash (XOPAQUE_DATA (obj), XOPAQUE_SIZE (obj));
}
Lisp_Opaque_List *li = XOPAQUE_LIST (opaque_list);
#ifdef ERROR_CHECK_GC
- assert (INTP (XOPAQUE (opaque)->size_or_chain));
+ {
+ /* Egcs 1.1.1 sometimes crashes on INTP (p->size_or_chain) */
+ Lisp_Object size_or_chain = XOPAQUE (opaque)->size_or_chain;
+ assert (INTP (size_or_chain));
+ }
#endif
XOPAQUE (opaque)->size_or_chain = li->free;
li->free = opaque;
if (DEVICE_TTY_P (XDEVICE (device)))
file = 0;
else if (!NILP (stdout_p))
- file = CONSOLE_STREAM_DATA (con)->outfd;
+ file = CONSOLE_STREAM_DATA (con)->out;
else
- file = CONSOLE_STREAM_DATA (con)->errfd;
+ file = CONSOLE_STREAM_DATA (con)->err;
}
if (STRINGP (char_or_string))
Play the named sound file on DEVICE's speaker at the specified volume
\(0-100, default specified by the `bell-volume' variable).
On Unix machines the sound file must be in the Sun/NeXT U-LAW format
-except under Linux where WAV files are also supported. On Microsoft
+except under Linux where WAV files are also supported. On Microsoft
Windows the sound file must be in WAV format.
DEVICE defaults to the selected device.
*/
*/
(device))
{
- struct device *d = decode_device(device);
-
#ifdef HAVE_NAS_SOUND
- if (DEVICE_CONNECTED_TO_NAS_P (d))
+ if (DEVICE_CONNECTED_TO_NAS_P (decode_device (device)))
return Qt;
#endif
#ifdef HAVE_NATIVE_SOUND
- if (DEVICE_ON_CONSOLE_P (d))
+ if (DEVICE_ON_CONSOLE_P (decode_device (device)))
return Qt;
#endif
return Qnil;
else
#endif
if (DEVICE_STREAM_P (d))
- fflush (CONSOLE_STREAM_DATA (XCONSOLE (DEVICE_CONSOLE (d)))->outfd);
+ fflush (CONSOLE_STREAM_DATA (XCONSOLE (DEVICE_CONSOLE (d)))->out);
#if defined(SIGIO) && !defined(BROKEN_SIGIO)
if (!DEVICE_STREAM_P (d))
{
#endif
#endif
+/* select() is supposed to be (Unix98) defined in sys/time.h,
+ but FreeBSD and Irix 5 put it in unistd.h instead.
+ If we have it, including it can't hurt. */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#if defined(WINDOWSNT) && defined(HAVE_X_WINDOWS)
/* Provides gettimeofday etc */
#include <X11/Xw32defs.h>
+1999-03-12 XEmacs Build Bot <builds@cvs.xemacs.org>
+
+ * XEmacs 21.2.13 is released
+
1999-03-05 XEmacs Build Bot <builds@cvs.xemacs.org>
* XEmacs 21.2.12 is released