cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c
c	UBBS utilities - Init_mess.for
c	This program initializes the message file for creating UBBS.
c	Dale Miller - UALR
c	14-Nov-1985
c
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
	implicit none
	character*80 spaces/' '/
	integer i
	include 'bbs_inc.for'
	
	record/mail_header_structure/ mh

	open(unit=2,file='message.hed',status='new',
	1   organization='relative',access='direct',
	2   recordtype='fixed',recl=48)

	open(unit=3,file='message.dat',status='new',	
	1   organization='relative',access='direct',
	2   recordtype='fixed',recl=20)

c	write the first record in the message header file
	last_header=1
	last_data=0
	first_mnum=0
	last_mnum=0
	write(2,rec=1)last_header,last_data,first_mnum,last_mnum

c	write the rest of the records
	mh.mail_to=' '
	mh.mail_from=' '
	mh.mail_subject=' '
	mh.mail_date=' '
	mh.mail_time=' '
	mh.mail_section=0
	mh.mail_first=0
	mh.mail_last=0
	mh.mail_messnum=9999999
	mh.mail_private=.false.
	mh.mail_read=.false.
	mh.mail_deleted=.true.
	mh.mail_person=.false.
	mh.mail_reply_to=0
	do i=1,10
	    mh.mail_replys(i)=0
	    end do

	do i=2,1000
	    write(2,rec=i)mh
	    end do

	do i=1,5000
	    write(3,rec=i)spaces
	    end do

	print*,'The message files have been initialized.'
	stop
	end
