mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-10 07:08:56 +02:00
* Use ansistrings for options. (bug ID 36892)
git-svn-id: trunk@44664 -
This commit is contained in:
parent
9753dd964b
commit
a678192c11
@ -14,9 +14,13 @@
|
||||
|
||||
**********************************************************************}
|
||||
unit getopts;
|
||||
Interface
|
||||
|
||||
{$modeswitch advancedrecords}
|
||||
{$modeswitch defaultparameters}
|
||||
{$h+}
|
||||
|
||||
Interface
|
||||
|
||||
Const
|
||||
No_Argument = 0;
|
||||
Required_Argument = 1;
|
||||
@ -51,11 +55,6 @@ Function GetLongOpts (ShortOpts : String;LongOpts : POption;var Longind : Longin
|
||||
Implementation
|
||||
|
||||
|
||||
Procedure TOption.SetOption(const aName:String;AHas_Arg:integer=0;AFlag:PChar=nil;AValue:Char=#0);
|
||||
begin
|
||||
Name:=aName; Has_Arg:=AHas_Arg; Flag:=AFlag; Value:=Avalue;
|
||||
end;
|
||||
|
||||
|
||||
{$IFNDEF FPC}
|
||||
{***************************************************************************
|
||||
@ -147,6 +146,20 @@ end;
|
||||
|
||||
{$ENDIF}
|
||||
|
||||
function strpas(p : pchar) : ansistring;
|
||||
|
||||
begin
|
||||
if p=nil then
|
||||
strpas:=''
|
||||
else
|
||||
strpas:=p;
|
||||
end;
|
||||
|
||||
Procedure TOption.SetOption(const aName:String;AHas_Arg:integer=0;AFlag:PChar=nil;AValue:Char=#0);
|
||||
begin
|
||||
Name:=aName; Has_Arg:=AHas_Arg; Flag:=AFlag; Value:=Avalue;
|
||||
end;
|
||||
|
||||
{***************************************************************************
|
||||
Real Getopts
|
||||
***************************************************************************}
|
||||
|
Loading…
Reference in New Issue
Block a user