Release 95 bulk changes
# Copyright (C) 2000 John Eikenberry
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# version 2 along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
scope "/pliant/language/" "/pliant/install/"
field Int number
function 'cast CChar' c -> cc
arg Char c ; arg CChar cc
cc number := c number
function 'cast Char' cc -> c
arg CChar cc ; arg Char c
c := character cc:number
method data 'to string' options -> s
arg CChar data ; arg Str options ; arg Str s
s set (memory_allocate 1 addressof:s) 1 true
s 0 := character data:number
# Now change 'number' field to read only
gvar Pointer:Int a :> ((the_function '. number' CChar -> Int) arg 1) access
a := a .and. .not. access_result_write+access_result_consistent
a := a .or. access_result_read
export 'CChar' '. number' 'cast CChar' 'cast Char'