home *** CD-ROM | disk | FTP | other *** search
- unit params;
- interface
- uses globals,util;
-
- procedure syntax_exit(msg:string);
- procedure parse_params;
-
- implementation
-
- procedure syntax_exit(msg:string);
- begin
- writeln(msg);
- writeln('Syntax:');
- writeln('INTRFC /options unit');
- writeln('where options are letters from the following:');
- writeln('B - emitted code bytes');
- writeln('C - initialized constant blocks');
- writeln('D - code blocks');
- writeln('E - routine entry records');
- writeln('G - emitted global const bytes');
- writeln('H - TPU header');
- writeln('I - implementation section (if $D was used in compilation)');
- writeln('L - proc/fn locals (if $L was used in compilation)');
- writeln('N - names in interface');
- writeln('O - object VMT records');
- writeln('R - relocation records');
- writeln('V - var blocks');
- writeln('A - turn all options on');
- writeln('Options are processed sequentially and toggle the display.');
- writeln('Use /Tpath to set the Turbo directory for TURBO.TPL and referenced');
- writeln(' units.');
- writeln('E.G. To see all but the relocation records in the system unit, use');
- writeln(' INTRFC /AR /T\turbo SYSTEM ');
- writeln('The default is just the names in the interface section.');
- halt(1);
- end;
-
- procedure toggle(o:option);
- begin
- if o in active_options then
- active_options := active_options - [o]
- else
- active_options := active_options + [o];
- end;
-
- procedure parse_params;
- var
- p : string;
- i : integer;
- begin
- i := 1;
- unitname := '';
- uses_path := '';
- for i := 1 to paramcount do
- begin
- p := paramstr(i);
- if p[1] <> '/' then
- unitname := upper(p)
- else
- begin
- p := copy(p,2,255); { strip off the / }
- while length(p) > 0 do
- begin
- case upcase(p[1]) of
- 'H' : toggle(do_header);
- 'N' : toggle(do_name_list);
- 'I' : toggle(do_implementation);
- 'E' : toggle(do_entry_pts);
- 'D' : toggle(do_code_blocks);
- 'C' : toggle(do_const_blocks);
- 'V' : toggle(do_var_blocks);
- 'U' : toggle(do_unit_blocks);
- 'B' : toggle(do_code);
- 'G' : toggle(do_const);
- 'R' : toggle(do_reloc);
- 'O' : toggle(do_vmt);
- 'L' : toggle(do_locals);
- 'A' : active_options := [do_header..do_locals];
- 'T' : begin
- uses_path := copy(p,2,255);
- if uses_path[length(uses_path)] <> '\' then
- uses_path := uses_path + '\';
- p := '';
- end;
- else
- syntax_exit('Unrecognized option '+paramstr(i)+'.');
- end;
- p := copy(p,2,255);
- end;
- end;
- end;
- end;
-
- end.