home *** CD-ROM | disk | FTP | other *** search
- /* convert a .fd file to format used by AmigaLibHost */
-
- parse arg infile ' ' outfile
-
- if open('MyIn',infile,'Read') = 0 then exit 10
- if open('MyOut',outfile,'Write') = 0 then exit 10
-
- say 'running...'
- say
-
- bias = -30
- public = 1
-
- do i = 1 while eof('MyIn') = 0
- inline = readln('MyIn')
-
- if left(inline,1,'*') == '*' then iterate i
-
- if left(inline,2,' ') == '##' then do
- if (substr(inline,3,4) == 'base') then do
- libname = strip(substr(inline,9))
- outline = '/* ' || libname || ' */'
- writeln('MyOut',upper(outline))
- writeln('MyOut',"")
- end
- if (substr(inline,3,4) == 'bias') then bias = '-' || strip(substr(inline,8))
- if (substr(inline,3,6) == 'public') then public = 1
- if (substr(inline,3,6) == 'private') then public = 0
- iterate i
- end
-
- if public = 1 then do
- at = index(inline,'(')
- fname = left(inline,at-1)
-
- outline = fname || '.BASE = ' || libname
- writeln('MyOut',upper(outline))
-
- outline = fname || '.LVO = ' || bias
- writeln('MyOut',upper(outline))
-
- outline = fname || '.CALL = ' || "'" || substr(inline,at) || "'"
- writeln('MyOut',upper(outline))
-
- writeln('MyOut',"")
- end
-
- bias = bias - 6
- end
-
- say 'done...'
-