# Copyright (c) 2002-05 Peter Guntert. All rights reserved. ## 7MACROS: init - CYANA macro ## ## Parameters: none ## ## Contains commands that are executed automatically at the start-up time of ## Prosa, e.g. the setting of important variables and the definition of some ## aliases. After the general init macro, a user-defined init macro in the ## current directory is executed, if available. var echo args k m echo := off path := $libdir/macro,. prompt := prosa> info := normal alias . system alias ls "system ls" alias lt "system ls -lat | head" alias pwd "print \$getcwd" alias cat "system cat" alias vi "system vi" alias less "system less" alias ? "print \"\%{*}\"" alias ?? "print \"\%*\"" alias q quit command execcmds var echo k syntax cmd=*= echo:=off cmd:="$$cmd" do k=index('$cmd',';') if (k.eq.0) then $cmd break else $cmd(1:k-1) if (k.eq.lenstr('$cmd')) break cmd:=$cmd(k+1:) end if end do end m=maxsize print "Memory size : $m(I10) words (${m/256} kbytes)" m=maxwork print "Workspace size: $m(I10) words (${m/256} kbytes)" print args='$getenv('PROSAARG')' k=index(args,'.pro') if (k.gt.1) then if (index(args(1:k),' ').le.0) args=args(1:k-1)//args(k+4:) end if if (args.ne.' ') then if (args(1:2).eq.'-c') then args=args(4:) else erract:=quit args=args//'; quit' end if if (existmacro('./init')) ./init execcmds args else if (existmacro('./init')) ./init end if