#| -*-Scheme-*-
-$Id: char.scm,v 14.26 2005/06/03 13:32:16 cph Exp $
+$Id: char.scm,v 14.27 2006/10/24 04:08:46 cph Exp $
Copyright 1986,1987,1988,1991,1995,1997 Massachusetts Institute of Technology
-Copyright 1998,2001,2003,2004,2005 Massachusetts Institute of Technology
+Copyright 1998,2001,2003,2004,2005,2006 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
(guarantee-char char 'CHAR-BITS)
(%char-bits char))
+(define (char-bits-set? bits char)
+ (guarantee-limited-index-fixnum bits char-bits-limit 'CHAR-BITS-SET?)
+ (guarantee-char char 'CHAR-BITS-SET?)
+ (fix:= bits (fix:and (%char-bits char) bits)))
+
+(define (char-bits-clear? bits char)
+ (guarantee-limited-index-fixnum bits char-bits-limit 'CHAR-BITS-CLEAR?)
+ (guarantee-char char 'CHAR-BITS-CLEAR?)
+ (fix:= 0 (fix:and (%char-bits char) bits)))
+
+(define (set-char-bits bits char)
+ (guarantee-limited-index-fixnum bits char-bits-limit 'SET-CHAR-BITS)
+ (guarantee-char char 'SET-CHAR-BITS)
+ (%make-char (%char-code char)
+ (fix:or (%char-bits char) bits)))
+
+(define (clear-char-bits bits char)
+ (guarantee-limited-index-fixnum bits char-bits-limit 'CLEAR-CHAR-BITS)
+ (guarantee-char char 'CLEAR-CHAR-BITS)
+ (%make-char (%char-code char)
+ (fix:andc (%char-bits char) bits)))
+
(define (char-ascii? char)
(guarantee-char char 'CHAR-ASCII?)
(let ((n (char->integer char)))
'((#x01 "M" "meta")
(#x02 "C" "control" "ctrl")
(#x04 "S" "super")
- (#x08 "H" "hyper")))
\ No newline at end of file
+ (#x08 "H" "hyper")))
+
+(define char-bit:meta #x01)
+(define char-bit:control #x02)
+(define char-bit:super #x04)
+(define char-bit:hyper #x08)
\ No newline at end of file
#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.598 2006/10/04 19:02:26 cph Exp $
+$Id: runtime.pkg,v 14.599 2006/10/24 04:08:58 cph Exp $
Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology
char->integer
char->name
char-ascii?
+ char-bit:control
+ char-bit:hyper
+ char-bit:meta
+ char-bit:super
char-bits
+ char-bits-clear?
char-bits-limit
+ char-bits-set?
char-ci<=?
char-ci<?
char-ci=?
char>?
char?
chars->ascii
+ clear-char-bits
code->char
digit->char
error:not-char
integer->char
make-char
name->char
- radix?)
+ radix?
+ set-char-bits)
(export (runtime string)
%char<?
downcase-table