;cut notes off from c-files
		include	"baselibs.i"
		include	"baselibs1.i"
		include	"string.i"
		include	"baseexec.i"

	#define	LIMIT,128
	#define	PUBLIC,1

	DATAAREA
	{
begintext	dc.b	";macro assambler,",LF,LF
		dc.b	"	include	'"'baselibs.i'"'",LF
		dc.b	"	include	'"'baselibs1.i'"'",LF
		dc.b	"	include	'"'baseexec.i'"'",LF
		dc.b	"	include	'"'baseintuition.i'"'",LF
		dc.b	"	include	'"'basegfx.i'"'",LF
		dc.b	"	include	'"'string.i'"'",LF,0

	#define	SPACE,32
	#define	NULL,0

data	dc.b	"	DATAAREA",LF
	dc.b	"	{",LF,0

vari	dc.b	"	}",LF
	dc.b	"	variables",LF,0

	}

	variables

	CPTR	source,endsource,destination
	array	char,globalvar,32,LIMIT
	array	char,filename,64
	array	char,temp,64


	main()	argv,argc


	CPTR	_temp
	CPTR	_filename
	CPTR	tempdestination
	int	size,lenght
	int	destsize
	int	count,error,flag
	char	tempchar,tempchar1

	{
	pointer	_temp,=&,temp
	pointer	_filename,=&,filename
	func	size,=,filesize,argv1
	if	size,!=,0,1
		{
		print	argv1
		func	source,=,AllocMem,size,PUBLIC	
		if	source,==,0,2
			{
			printf	<"no memory",LF>
			exit	5
			}
			ifend	2
		printf	<"size %ld %s",LF>,size,argv1

		loadfile	argv1,source
		calc	endsource,=,source,+,size
		calc	destsize,=,size,*,2
		calc	destsize,=,destsize,+,512
		func	destination,=,AllocMem,destsize,PUBLIC
		calc	tempdestination,=,destination
		if	destination,==,0,3
			{
			printf	<"no memory",LF>
			exit	5
			}
			ifend	3
	calc	count,0	
	while	endsource,!=,source,w1
		{
		calc	flag,=,0
		peek	tempchar,=,source,++
		switch	tempchar
			{
			case	'/',1		;/
				peek	tempchar1,=,source
				if	tempchar1,==,'*',11	;*
					{
					func	source,=,ROUTINE,noteover,source
					}
					calc	flag,=,1
					ifend	11

				break	1,1
			case	'#',2		;#	
				ROUTINE	includedefine,source
				break	2,1

				}	1
		if	flag,==,0,4
			{
			memput	tempdestination,++,=,tempchar		
			calc	count,++
			}
			ifend	4
		}	w1
		printf	<"source %lx endsource %lx count %ld",LF>,source,endsource,count	
			calc	tempchar,=,NULL
			memput	tempdestination,=,tempchar
		func	error,=,savefile,argv2,destination,count
		if	error,==,0,5
			{
			print	<"no a destination file",LF>
			print	<"c-notes off from a file",LF>
			exit	0
			}
			ifend	5

		}
		else	1
		{
		printf	<"no found a source file",LF>
		exit	5
		}
		ifend	1

	}

	VOID	noteover,source
	CPTR	source
	char	letter
	
	{
	calc	source,++
	while	source,!=,endsource,n1
		{
		calc	letter,=,0
		while	letter,!=,'*',n2
			{
			peek	letter,=,source,++
			}	n2
		peek	letter,=,source
		if	letter,==,'/',n1
			{
			calc	source,++
			return	source
			{
			else	n1
			calc	letter,=,0
			}	
			ifend	n1
		if	source,==,endsource,n2
			{
			return	source
			}
			ifend	n2
		}	n1
	}


	VOID	includedefine
	
	{
	}
	end
