home *** CD-ROM | disk | FTP | other *** search
- /* Edge macro: hn_readerr
- **
- ** $VER: hn_readerr.edge 1.6 (Saturday 23-Oct-93 13:22:24)
- **
- ** Usage: hn_readerr [<errorfile>|PROJECT|COMPILE|LINK],[<filename>],[0|1|LINK]
- ** <errorfile> : input from errorfile
- ** PROJECT : read errors from current build-errorfile
- ** COMPILE : read errors from current compile-errorfile
- ** <filename> : source-filename
- ** LINK : Supress requesters if all is OK..
- ** Default : COMPILE,<currentfile>,0
- **
- ** Synopsis: Read errors to current file
- ** Select errorfile and parser according to current filename
- ** and arguments.
- **
- ** Author: Henrik Nordström
- ** Ängsvägen 1
- ** S 756 45 Uppsala
- */
-
- options results
-
- parse arg mode,filename,linkflag
-
- parse source . . . rexxfile .
- st=lastpos('/',rexxfile)
- if st=0 then st=lastpos(':',rexxfile)
- rexxdir=left(rexxfile,st)
-
- 'clearerr'
-
- /*FS:Init*/
- mode=upper(mode)
- linkflag=upper(linkflag)
-
- if mode="" then mode="COMPILE"
- if mode='LINKONLY' then mode='LINK' /* simplify checking a bit...*/
-
- if linkflag="" then
- if mode='LINK' then linkflag=1
- else linkflag=0
- if linkflag='LINK' then linkflag=1
-
- if filename="" then do
- 'getenvvar _fe_name'
- filename = result
- end
- parse var filename name '.' type
- type=upper(type)
-
- select
- when mode='PROJECT' then do
- 'getenvvar _fe_user9'
- parse var result dir ',' name ',' arguments
- if name=="" then do /* Get name from last component in path */
- name=strip(dir,'T','/');st=lastpos('/',name)
- if st==0 then st=lastpos(':',name)
- name=substr(name,st+1)
- end
- errorname='t:build_'||name
- end
- when mode='COMPILE' | mode='LINK' then do
- errorname='t:cm_'||name
- end
- otherwise errorname=mode
- end
- /*FE:Init*/
-
- /*FS:Translate 'Equal' modes */
- select
- when type='C' then type='C'
- when type='ASM' then type='ASM'
- when type='S' then type='ASM'
- when type='A' then type='ASM'
- otherwise type=type
- end
- /*FE:Translate...*/
-
- /*FS:Call errorparser */
- if exists(rexxdir'hn_readerr_'type'.edge') then do
- interpret call ''''rexxdir'hn_readerr_'type'.edge''('''errorname''','''filename''','''linkflag''')'
- compilefail=RESULT
- end
- else do
- 'adderr 1 0 "can''t parse errors: No errorparser found for filetype **.'type'"'
- 'requestnotify "can''t parse errors:*nNo errorparser found for filetype **.'type'"'
- compilefail=RC+5
- end
- /*FE:Call...*/
-
- return compilefail
-