##
## Compiler2 - Config - Default
##
## (C) IPN - Ingenieurbuero fuer Praezisionsnumerik
##
## Dipl.-Ing. Andreas Otto
## Ulmenstrasse 3
## D-34289 Zierenberg
## mailto:aotto@t-online.de
## http://tclcompiler.sourceforge.net
##
## Alle Rechte vorbehalten
##
namespace eval ::Config::Default {
variable DATA ; ## array of DEFAULT values
##
## -------------------------------------------------------------------------------------------------------
## Key Action Typ Default Proc(nU) Arguments
## -------------------------------------------------------------------------------------------------------
##
array set DATA [list \
[list ROOT REPOSITORY] [list %VALUE% %REP% Master DEFAULT ] \
\
[list ROOT PACKAGE] [list %SLINK% %PKG% %NULL% DEFAULT ] \
\
[list PACKAGE MAJOR] [list %VALUE% %INT% 0 DEFAULT ] \
[list PACKAGE MINOR] [list %VALUE% %FLOAT% 1 DEFAULT ] \
[list PACKAGE DEBUGMODE] [list %VALUE% %BOOL% no DEFAULT ] \
[list PACKAGE C_INSTDIR] [list %VALUE% %DIR% . DEFAULT ] \
[list PACKAGE TCL_INSTDIR] [list %VALUE% %DIR% . DEFAULT ] \
[list PACKAGE TCL_FILE] [list %SLINK% %FILE% %NULL% DEFAULT FILE ] \
[list PACKAGE C_FILE] [list %SLINK% %FILE% %NULL% DEFAULT FILE ] \
[list PACKAGE STRIP] [list %VALUE% %BOOL% yes DEFAULT ] \
\
[list TCL_FILE HEADER] [list %VALUE% %FLIST% [list] DEFAULT ] \
[list C_FILE HEADER] [list %VALUE% %FLIST% [list] DEFAULT ] \
[list C_FILE USE_INIT] [list %VALUE% %BOOL% no DEFAULT ] \
\
[list TCL_FILE TCL2META] [list %HLINK% %CODE% %NULL% DEFAULT ] \
[list TCL2META TEST] [list %VALUE% %BOOL% no DEFAULT ] \
[list TCL2META PRINT] [list %VALUE% %BOOL% no DEFAULT ] \
[list TCL2META SAFE] [list %VALUE% %BOOL% no DEFAULT ] \
[list TCL2META CMD] [list %VALUE% %SLIST% [list] DEFAULT ] \
[list TCL2META PKG_REQUIRE] [list %VALUE% %SLIST% [list] DEFAULT ] \
\
[list TCL_FILE META2C] [list %HLINK% %CODE% %NULL% DEFAULT ] \
[list META2C PRINT] [list %VALUE% %BOOL% no DEFAULT ] \
[list META2C DEBUG] [list %VALUE% %BOOL% no DEFAULT ] \
[list META2C SKIP] [list %VALUE% %ALL% [list] DEFAULT ] \
[list META2C OPTIMIZATION] [list %VALUE% %LIST% 1 DEFAULT 0 1 ] \
\
[list TCL_FILE META2TCL] [list %HLINK% %CODE% %NULL% DEFAULT ] \
[list META2TCL PRINT] [list %VALUE% %BOOL% no DEFAULT ] \
]
array set DATA [ list {ROOT CCT_VERSION} [ list %VALUE% %FLOAT% [ package require Config ] DEFAULT ] ]
namespace export -clear Get*
}
##
## -----------------------------------------------------------------
##
proc ::Config::Default::Create {} {
variable DATA
variable DATA_TYPE
variable DATA_DEFA
variable DATA_ARGS
variable DATA_PROC
variable DATA_KEY
variable DATA_ACTION
## init
set _DATA_TYPE {}
set _DATA_DEFA {}
set _DATA_ARGS {}
## fill
foreach { Key Val } [ array get DATA ] {
foreach { K1 K2 } $Key break
foreach { Act Typ Def Prc } $Val break
lappend _DATA_TYPE $Key $Typ
lappend _DATA_DEFA $Key $Def
lappend _DATA_ACTION $Key $Act
lappend _DATA_PROC $Key $Prc
lappend _DATA_ARGS $Key [ lrange $Val 4 end ]
lappend DATA_KEY($K1) $K2
}
## set
array set DATA_TYPE $_DATA_TYPE
array set DATA_DEFA $_DATA_DEFA
array set DATA_ARGS $_DATA_ARGS
array set DATA_PROC $_DATA_PROC
array set DATA_ACTION $_DATA_ACTION
}
proc ::Config::Default::Delete {} {
variable DATA_TYPE ; ## TYPE index
variable DATA_DEFA ; ## DEFA index
variable DATA_ARGS ; ## ARGS index
variable DATA_KEY ; ## KEY index
variable DATA_ACTION ; ## ACTION index
array unset DATA_TYPE
array unset DATA_DEFA
array unset DATA_ARGS
array unset DATA_KEY
array unset DATA_ACTION
}
##
## -----------------------------------------------------------------
##
proc ::Config::Default::GetKey { Key } {
variable DATA_KEY
if {[ info exists DATA_KEY($Key) ]} {
return $DATA_KEY($Key)
} else {
return {}
}
}
proc ::Config::Default::GetType { Grp } {
variable DATA_TYPE
return $DATA_TYPE($Grp)
}
proc ::Config::Default::GetAction { Grp } {
variable DATA_ACTION
return $DATA_ACTION($Grp)
}
proc ::Config::Default::GetArgs { Grp } {
variable DATA_ARGS
return $DATA_ARGS($Grp)
}
proc ::Config::Default::GetDefa { Grp } {
variable DATA_DEFA
return $DATA_DEFA($Grp)
}
proc ::Config::Default::GetProc { Grp } {
variable DATA_PROC
return $DATA_PROC($Grp)
}