home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
ne_config.tcl
< prev
next >
Wrap
Text File
|
1996-12-12
|
6KB
|
240 lines
#---------------------------------------------------------------------------
#
# Copyright (c) 1994-1995 by Cadre Technologies Inc.
#
# This software is furnished under a license and may be used only in
# accordance with the terms of such license and with the inclusion of
# the above copyright notice. This software or any other copies thereof
# may not be provided or otherwise made available to any other person.
# No title to and ownership of the software is hereby transferred.
#
# The information in this software is subject to change without notice
# and should not be construed as a commitment by Cadre Technologies Inc.
#
#---------------------------------------------------------------------------
#
# File : @(#)ne_config.tcl /main/titanic/2
# Original date : 27-10-1994
# Description : Configuration variables / functions
# for NewEra and Westmount class library
#
#---------------------------------------------------------------------------
#
#
# Configuration variables
#
# directory search path for external sources
# could be a list separated by a search path separator
global exsrc_searchpath
# example usage:
# set exsrc_searchpath "c:;c:\\temp"
global string::name
set string::name ixString
#
# RefSet configuration
#
global set::name
set set::name RefSet
global set::add
set set::add add
global set::add_retval
set set::add_retval BOOLEAN
global set::size
set set::size size
global set::remove
set set::remove remove
proc set::iter {decl_sect impl_sect name type action} {
set s_name [uncap [set_name $name]]
set riv [uncap [reference_name $name]]
expand_text $decl_sect {
VARIABLE ~$riv ~$type
}
expand_text $impl_sect {
LET ~$riv = ~$s_name.first() CAST ~$type
WHILE ~$riv IS NOT NULL
~[eval $action $riv]
LET ~$riv = ~$s_name.next() CAST ~$type
END WHILE
}
}
#
# ORefSet configuration
#
global oset::name
set oset::name ORefSet
global oset::add
set oset::add append
global oset::add_retval
set oset::add_retval INTEGER
global oset::size
set oset::size size
global oset::remove
set oset::remove remove
proc oset::iter {decl_sect impl_sect name type action} {
set os_name [uncap [oset_name $name]]
set cnt ${os_name}Cnt
expand_text $decl_sect {
VARIABLE $cnt INTEGER
}
expand_text $impl_sect {
FOR ~$cnt = 1 TO ~$os_name.size()
~[eval $action $os_name.get(~$cnt)]
END FOR
}
}
#
# RefDict configuration
#
global dict::name
set dict::name RefDict
global dict::set
set dict::set set
global dict::size
set dict::size size
global dict::remove
set dict::remove remove
# 'return_type' not used here
proc dict::get_and_return {sect name key return_type} {
expand_text $sect {
RETURN ~$name.get(~$key) CAST ~$return_type
}
}
proc dict::get_test_and_act {sect name key return_type action} {
set dct_name [uncap [dict_name $name]]
set ref_name [uncap [reference_name $return_type]]
expand_text $sect {
IF ~$dct_name.get(~$key) IS NOT NULL THEN
~[eval $action ~$dct_name.get(~$key)]
END IF
}
}
proc dict::iter {decl_sect impl_sect name type qual_type action} {
set dct_name [uncap [dict_name $name]]
set riv [uncap [reference_name $name]]
expand_text $decl_sect {
VARIABLE ~$riv ~$type
}
expand_text $impl_sect {
LET ~$riv = ~$dct_name.firstValue() CAST ~$type
WHILE ~$riv IS NOT NULL
~[eval $action $riv]
LET ~$riv = ~$dct_name.nextValue() CAST ~$type
END WHILE
}
}
proc dict::initializer {name key value} {
# not used here
return ""
}
#
# RSetDict configuration
#
global rsdict::name
set rsdict::name RSetDict
global rsdict::add
set rsdict::add add
global rsdict::add_retval
set rsdict::add_retval BOOLEAN
global rsdict::size
set rsdict::size size
global rsdict::remove
set rsdict::remove remove
proc rsdict::get_and_return {sect name key return_type} {
set sdct_name [uncap [set_dict_name $name]]
expand_text $sect {
RETURN ~$sdct_name.get(~$key)
}
}
proc rsdict::iter {decl_sect impl_sect name type qual_type action} {
set sdct_name [uncap [set_dict_name $name]]
set riv [uncap [reference_name $name]]
set rtpnm [$type getName]
set rsiv [uncap [reference_name [set_name $name]]]
set rstpnm [set_type_name $type]
expand_text $decl_sect {
VARIABLE ~$rsiv ~$rstpnm
VARIABLE ~$riv ~$rtpnm
}
expand_text $impl_sect {
LET ~$rsiv = ~$sdct_name.firstValue() CAST ~$rstpnm
WHILE ~$rsiv IS NOT NULL
LET ~$riv = ~$rsiv.first() CAST ~$rtpnm
WHILE ~$riv IS NOT NULL
~[eval $action $riv]
LET ~$riv = ~$rsiv.next() CAST ~$rtpnm
END WHILE
LET ~$rsiv = ~$sdct_name.nextValue() CAST ~$rstpnm
END WHILE
}
}
proc rsdict::initializer {name key value} {
# not used here
return ""
}
#
# ORSetDict configuration
#
global orsdict::name
set orsdict::name ORSetDict
global orsdict::add
set orsdict::add append
global orsdict::add_retval
set orsdict::add_retval INTEGER
global orsdict::size
set orsdict::size size
global orsdict::remove
set orsdict::remove remove
proc orsdict::get_and_return {sect name key return_type} {
set osdct_name [uncap [oset_dict_name $name]]
expand_text $sect {
RETURN ~$osdct_name.get(~$key)
}
}
proc orsdict::iter {decl_sect impl_sect name type qual_type action} {
set osdct_name [uncap [oset_dict_name $name]]
set riv [uncap [reference_name $name]]
set orsiv [uncap [reference_name [oset_name $name]]]
set orstpnm [oset_type_name $type]
set cnt ${orsiv}Cnt
expand_text $decl_sect {
VARIABLE ~$orsiv ~orstpnm
VARIABLE ~$cnt INTEGER
}
expand_text $impl_sect {
LET ~$orsiv = ~$osdct_name.firstValue() CAST ~$orstpnm
WHILE ~$orsiv IS NOT NULL
FOR ~$cnt = 1 TO ~$orsiv->size()
~[eval $action $orsiv.get($cnt)]
END FOR
LET ~$orsiv = ~$osdct_name.nextValue() CAST ~$orstpnm
END WHILE
}
}
proc orsdict::initializer {name key value} {
# not used here
return ""
}