definition module write_dynamic;

import read_dynamic, compute_graph;
import MarkUpText;

// Layout
SepSpaces	:== "  ";
s_SepSpaces :== 2;			// size of SepSpaces

s_offset_header	:== 8;

WriteDescriptorAddressTable :: !Int !Int !BinaryDynamic !DescriptorAddressTable !*File -> (!*File,!DescriptorAddressTable);
	
WriteHeader :: !BinaryDynamic !*File -> !*File;
	
WriteStringTable :: !BinaryDynamic !*File -> !*File;

//WriteGraph :: !DescriptorAddressTable !BinaryDynamic (Nodes a) !*File !*DDState -> ((Nodes a),!*File,!DescriptorAddressTable,!*DDState) | ToInfo a;
WriteGraph :: !*DescriptorAddressTable !BinaryDynamic *(Nodes NodeKind) !*File !*DDState -> *(*Nodes NodeKind,!*File,!*DescriptorAddressTable,!*DDState,[MarkUpCommand {#Char}]);

//WriteGraph2 :: !BinaryDynamicSelector !DescriptorAddressTable !DynamicInfo (Nodes NodeKind) !*File -> ((Nodes NodeKind),!*File,!DescriptorAddressTable);

WriteBlockTable :: !BinaryDynamic !*File -> !*File;

WriteDynamicInfo :: !.DynamicInfo !*File !*Files -> (!*File,!*Files);

