definition module ToAndFromGraph;

//1.3
from StdFile import FileEnv, Files, FileSystem;
from StdString import String;
from StdDynamicVersion import Version;
from StdMaybe import Maybe;
from StdDynamicDefaultElem import DefaultElemU;
//3.1
/*2.0
from StdFile import class FileEnv, ::Files, class FileSystem;
from StdDynamicVersion import ::Version;
from StdMaybe import ::Maybe;
from StdDynamicDefaultElem import class DefaultElemU;
0.2*/

:: *ToAndFromGraphTable
	= {
		tafgt_n_from_graphs	:: !Int
	,	tafgt_from_graphs	:: !*{#ToAndFromGraphEntry}
	
	,	tafgt_n_to_graphs	:: !Int
	,	tafgt_to_graphs		:: !*{#ToAndFromGraphEntry}
	};
	
instance DefaultElemU ToAndFromGraphTable;

:: ToAndFromGraphEntryIndex
	:== Int;

:: ToAndFromGraphEntry
	= {
		tafge_version		:: !Version
	,	tafge_conversion	:: !Maybe !Int				// from graph to string (address)
	};

init_to_and_from_graph_table :: !String !*env -> (!ToAndFromGraphTable,!*env) | FileEnv, FileSystem env;

get_from_graph_function_address :: (!Maybe !Version) !*ToAndFromGraphTable -> (ToAndFromGraphEntry,ToAndFromGraphEntryIndex,!*ToAndFromGraphTable);
