// createsys.sr

get "BRAVO1.DF"
get "COM.DF"
get "RN1.DF"
get "VM.DF"
get "MSG.DF"
get "ALTOFILESYS.D"
get "ST.DF"
get "DIR.DF"
get "CHAR.DF"

// incoming procedures
external
	[
	AppendRegion
	FtyOpen
	errhlta
	endofs
	gets
	]

// incoming statics
external
	[
	vrlfsys
	mpfnof
	]

// outgoing procedures
external
	[
	CreateVrldsys
	]

// outgoing statics
external
	[
	dcpendofdoc
	]

// local statics
static
	[
	dcpendofdoc
	]

// local manifests


let CreateVrldsys() be
[

if FtyOpen(fnrlf,"bravo.messages",false,false,vcNewest) eq ftyNil then
	errhlta(69);
let fcFirst = 0;
(mpfnof ! fnrlf) >> OF.pos = 0
until endofs(fnrlf) do
	if gets(fnrlf) eq $$ then
		[ let fcNext = (mpfnof ! fnrlf) >> OF.pos-1
		AppendRegion(vrlfsys, fcFirst, fcNext - fcFirst, 0)
		until gets(fnrlf) eq chcr do
			loop
		fcFirst = (mpfnof ! fnrlf) >> OF.pos
		] 
]