* message loading fixes from Sergey (merged)

This commit is contained in:
peter 2001-03-13 20:59:56 +00:00
parent 6a694bf11f
commit 939f49375f
4 changed files with 43 additions and 34 deletions

View File

@ -1740,7 +1740,7 @@ option_too_many_cfg_files=11008_F_Too many config files nested
% You can only nest up to 16 config files.
option_unable_open_file=11009_F_Unable to open file $1
% The option file cannot be found.
option_reading_further_from=11010_N_Reading further options from $1
option_reading_further_from=11010_D_Reading further options from $1
% Displayed when you have notes turned on, and the compiler switches
% to another options file.
option_target_is_already_set=11011_W_Target is already set to: $1
@ -1788,7 +1788,7 @@ option_using_env=11027_T_Reading options from environment $1
% Options are also read from this environment string
option_handling_option=11028_D_Handling option "$1"
% Debug info that an option is found and will be handled
option_help_press_enter=11029__*** press enter ***
option_help_press_enter=11029__*** press enter ***
%\end{description}
# EndOfTeX

View File

@ -614,7 +614,7 @@ const msgtxt : array[0..000136,1..240] of char=(
'11007_H_-? writes help pages'#000+
'11008_F_Too many config files nested'#000+
'11009_F_Unable to open file $1'#000+
'11010_N_Reading further options from $1'#000+
'11010_D_Reading further options from $1'#000+
'11011_W_Target is already set to: $1'#000+
'11012_W_Shared libs not ','supported on DOS platform, reverting to stat'+
'ic'#000+

View File

@ -1,4 +1,3 @@
{
$Id$
Copyright (c) 1998-2000 by Florian Klaempfl and Peter Vreman
@ -89,7 +88,6 @@ var
asm_is_set : boolean; { -T also change initoutputformat if not set idrectly }
fpcdir,
ppccfg,
msgfilename,
param_file : string; { file to compile specified on the commandline }
{****************************************************************************
@ -118,17 +116,6 @@ begin
end;
procedure MaybeLoadMessageFile;
begin
{ Load new message file }
if (msgfilename<>'') then
begin
LoadMsgFile(msgfilename);
msgfilename:='';
end;
end;
procedure set_default_link_type;
begin
if (target_os.id=os_i386_win32) then
@ -181,7 +168,6 @@ procedure Toption.WriteInfo;
var
p : pchar;
begin
MaybeLoadMessageFile;
p:=MessagePchar(option_info);
while assigned(p) do
Comment(V_Normal,GetMsgLine(p));
@ -209,7 +195,6 @@ var
s : string;
p : pchar;
begin
MaybeLoadMessageFile;
WriteLogo;
Lines:=4;
Message1(option_usage,system.paramstr(0));
@ -1018,7 +1003,7 @@ begin
end
else
begin
if (opts[1]='-') then
if (opts[1]='-') or (opts[1]='@') then
begin
if (not skip[level]) then
interpret_option(opts,false);
@ -1104,17 +1089,17 @@ begin
opts:=system.paramstr(paramindex);
case opts[1] of
'@' :
if not firstpass then
begin
Delete(opts,1,1);
if not firstpass then
Message1(option_reading_further_from,opts);
Message1(option_reading_further_from,opts);
interpret_file(opts);
end;
'!' :
if not firstpass then
begin
Delete(opts,1,1);
if not firstpass then
Message1(option_reading_further_from,'(env) '+opts);
Message1(option_reading_further_from,'(env) '+opts);
interpret_envvar(opts);
end;
else
@ -1140,17 +1125,17 @@ begin
Delete(cmd,1,i);
case opts[1] of
'@' :
if not firstpass then
begin
Delete(opts,1,1);
if not firstpass then
Message1(option_reading_further_from,opts);
Message1(option_reading_further_from,opts);
interpret_file(opts);
end;
'!' :
if not firstpass then
begin
Delete(opts,1,1);
if not firstpass then
Message1(option_reading_further_from,'(env) '+opts);
Message1(option_reading_further_from,'(env) '+opts);
interpret_envvar(opts);
end;
'"' :
@ -1450,9 +1435,6 @@ begin
end;
end;
{ Reload the messages file if necessary }
MaybeLoadMessageFile;
{ write logo if set }
if option.DoWriteLogo then
option.WriteLogo;
@ -1572,7 +1554,10 @@ finalization
end.
{
$Log$
Revision 1.35 2001-03-10 13:19:10 peter
Revision 1.36 2001-03-13 20:59:56 peter
* message loading fixes from Sergey (merged)
Revision 1.35 2001/03/10 13:19:10 peter
* don't check messagefile for numbers, this allows the usage of
1.1 msgfiles with a 1.0.x compiler

View File

@ -67,11 +67,12 @@ Const
var
msg : pmessage;
const
msgfilename : string = '';
procedure SetRedirectFile(const fn:string);
function SetVerbosity(const s:string):boolean;
procedure LoadMsgFile(const fn:string);
procedure SetCompileModule(p:tmodulebase);
procedure Stop;
procedure ShowStatus;
@ -289,6 +290,17 @@ var
end;
procedure MaybeLoadMessageFile;
begin
{ Load new message file }
if (msgfilename<>'') then
begin
LoadMsgFile(msgfilename);
msgfilename:='';
end;
end;
procedure SetCompileModule(p:tmodulebase);
begin
current_module:=p;
@ -523,30 +535,35 @@ var
function MessagePchar(w:longint):pchar;
begin
MaybeLoadMessageFile;
MessagePchar:=msg^.GetPchar(w)
end;
procedure Message(w:longint);
begin
MaybeLoadMessageFile;
Msg2Comment(msg^.Get(w));
end;
procedure Message1(w:longint;const s1:string);
begin
MaybeLoadMessageFile;
Msg2Comment(msg^.Get1(w,s1));
end;
procedure Message2(w:longint;const s1,s2:string);
begin
MaybeLoadMessageFile;
Msg2Comment(msg^.Get2(w,s1,s2));
end;
procedure Message3(w:longint;const s1,s2,s3:string);
begin
MaybeLoadMessageFile;
Msg2Comment(msg^.Get3(w,s1,s2,s3));
end;
@ -557,6 +574,7 @@ var
begin
oldpos:=aktfilepos;
aktfilepos:=pos;
MaybeLoadMessageFile;
Msg2Comment(msg^.Get(w));
aktfilepos:=oldpos;
end;
@ -568,6 +586,7 @@ var
begin
oldpos:=aktfilepos;
aktfilepos:=pos;
MaybeLoadMessageFile;
Msg2Comment(msg^.Get1(w,s1));
aktfilepos:=oldpos;
end;
@ -579,6 +598,7 @@ var
begin
oldpos:=aktfilepos;
aktfilepos:=pos;
MaybeLoadMessageFile;
Msg2Comment(msg^.Get2(w,s1,s2));
aktfilepos:=oldpos;
end;
@ -590,6 +610,7 @@ var
begin
oldpos:=aktfilepos;
aktfilepos:=pos;
MaybeLoadMessageFile;
Msg2Comment(msg^.Get3(w,s1,s2,s3));
aktfilepos:=oldpos;
end;
@ -630,7 +651,10 @@ var
end.
{
$Log$
Revision 1.11 2000-12-26 15:58:29 peter
Revision 1.12 2001-03-13 20:59:56 peter
* message loading fixes from Sergey (merged)
Revision 1.11 2000/12/26 15:58:29 peter
* check for verbosity in verbose instead of comphook
Revision 1.10 2000/12/25 00:07:30 peter