definition module ddState;

import StdEnv;
import memory;
import read_dynamic;
import MarkUpText;

:: *DDState = {
		file_name					:: !String				// filename of dynamic
	,	project_name				:: !String				// filename of application using that dynamic
	,	first_time					:: !Bool				// first time
	,	mem							:: *Mem
	
	//
	,	int_descP					:: !Int
	,	char_descP					:: !Int
	,	bool_descP					:: !Int
	,	real_descP					:: !Int
	,	string_descP				:: !Int
	,	array_descP					:: !Int
	,	e__StdDynamic__rDynamicTemp	:: !Int
	,	build_block_label			:: !Int
	,	build_lazy_block_label		:: !Int
	
	,	background_colour			:: !Colour
	};
		
DefaultDDState :: !*Mem -> !*DDState;

//InitialDDState :: !*Mem -> (!Bool,!String,!*DDState);
InitialDDState :: !*Mem !Colour -> (!Bool,!String,!*DDState);
	
//do_dynamic :: !*DDState !*File !*a -> *(!*DDState,!*File,*a) | FileEnv a;
do_dynamic :: !*DDState !*File !*a -> *(!BinaryDynamic,!*DDState,!*File,*a,[MarkUpCommand {#Char}]) | FileEnv a;

replace_command_line :: !String -> !Bool;


