All pastes #403766 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-20 16:45 UTC
rendered paste body
namespace eval Modules::Config {	
	proc addModuleConfig {ModuleID ModuleName FunctionNr Program} {
		array set ::[namespace current]::ModuleDef$ModuleID {
			ID			$ModuleID
			Name		$ModuleName
			FunctionNr	$FunctionNr
		}
	}
	
	proc addChannelConfig {ModuleID ChannelID ChannelName Prio SendBuf RecvBuf} {
		array set [format "::%s::Module%dChannel%d" [namespace current] $ModuleID $ChannelID] {
			Name	$ChannelNanme
			ID		$ChannelID
			SendBuf $SendBuf
			RecvBuf $RecvBuf
			Prio	$Prio
		}
	}

	proc createTestConfig {} {

		set tmpModule [addModuleConfig 2 "GenApp" 7 "genapp.out"]
		
		addChannelConfig 2 0 "Generic Channel" 16 40 40 
		addChannelConfig 2 1 "Devel Channel" 16 40 40
	}