|
@@ -59,54 +59,29 @@ Var
|
|
|
|
|
|
{$ifdef FPC_HAS_FEATURE_FILEIO}
|
|
{$ifdef FPC_HAS_FEATURE_FILEIO}
|
|
{ Untyped file support }
|
|
{ Untyped file support }
|
|
-
|
|
|
|
- {$ifdef FPC_UNICODE_RTL}
|
|
|
|
Procedure AssignFile(out f:File;const Name:UnicodeString);
|
|
Procedure AssignFile(out f:File;const Name:UnicodeString);
|
|
Procedure AssignFile(out f:File;const Name:RawByteString);
|
|
Procedure AssignFile(out f:File;const Name:RawByteString);
|
|
- {$else}
|
|
|
|
- Procedure AssignFile(out f:File;const Name:string);
|
|
|
|
- Procedure AssignFile(out f:File;p:pchar);
|
|
|
|
- Procedure AssignFile(out f:File;c:char);
|
|
|
|
- {$endif}
|
|
|
|
Procedure CloseFile(var f:File);
|
|
Procedure CloseFile(var f:File);
|
|
{$endif FPC_HAS_FEATURE_FILEIO}
|
|
{$endif FPC_HAS_FEATURE_FILEIO}
|
|
|
|
|
|
{$ifdef FPC_HAS_FEATURE_TEXTIO}
|
|
{$ifdef FPC_HAS_FEATURE_TEXTIO}
|
|
{ Text file support }
|
|
{ Text file support }
|
|
- {$ifdef FPC_UNICODE_RTL}
|
|
|
|
Procedure AssignFile(out f:Text;const Name:UnicodeString);
|
|
Procedure AssignFile(out f:Text;const Name:UnicodeString);
|
|
Procedure AssignFile(out f:Text;const Name:RawByteString);
|
|
Procedure AssignFile(out f:Text;const Name:RawByteString);
|
|
- {$else}
|
|
|
|
- Procedure AssignFile(out t:Text;const s:string);
|
|
|
|
- Procedure AssignFile(out t:Text;p:pchar);
|
|
|
|
- Procedure AssignFile(out t:Text;c:char);
|
|
|
|
- {$endif}
|
|
|
|
Procedure CloseFile(Var t:Text);
|
|
Procedure CloseFile(Var t:Text);
|
|
{$endif FPC_HAS_FEATURE_TEXTIO}
|
|
{$endif FPC_HAS_FEATURE_TEXTIO}
|
|
|
|
|
|
{$ifdef FPC_HAS_FEATURE_FILEIO}
|
|
{$ifdef FPC_HAS_FEATURE_FILEIO}
|
|
{ Typed file supoort }
|
|
{ Typed file supoort }
|
|
- {$ifdef FPC_UNICODE_RTL}
|
|
|
|
Procedure AssignFile(out f:TypedFile;const Name:UnicodeString);
|
|
Procedure AssignFile(out f:TypedFile;const Name:UnicodeString);
|
|
Procedure AssignFile(out f:TypedFile;const Name:RawByteString);
|
|
Procedure AssignFile(out f:TypedFile;const Name:RawByteString);
|
|
- {$else}
|
|
|
|
- Procedure AssignFile(out f:TypedFile;const Name:string);
|
|
|
|
- Procedure AssignFile(out f:TypedFile;p:pchar);
|
|
|
|
- Procedure AssignFile(out f:TypedFile;c:char);
|
|
|
|
- {$endif}
|
|
|
|
{$endif FPC_HAS_FEATURE_FILEIO}
|
|
{$endif FPC_HAS_FEATURE_FILEIO}
|
|
|
|
|
|
{$if defined(FPC_HAS_FEATURE_COMMANDARGS) }
|
|
{$if defined(FPC_HAS_FEATURE_COMMANDARGS) }
|
|
{ ParamStr should return also an ansistring }
|
|
{ ParamStr should return also an ansistring }
|
|
- Function ParamStr(Param : Integer) : UnicodeString;
|
|
|
|
|
|
+ Function ParamStr(Param : Integer) : AnsiString;
|
|
{$endif FPC_HAS_FEATURE_COMMANDARGS}
|
|
{$endif FPC_HAS_FEATURE_COMMANDARGS}
|
|
|
|
|
|
-{$if defined(FPC_HAS_FEATURE_FILEIO) and defined(FPC_HAS_FEATURE_ANSISTRINGS) and not defined(FPC_UNICODE_RTL)}
|
|
|
|
- Procedure MkDir(s:ansistring);overload;
|
|
|
|
- Procedure RmDir(s:ansistring);overload;
|
|
|
|
- Procedure ChDir(s:ansistring);overload;
|
|
|
|
-{$endif defined(FPC_HAS_FEATURE_FILEIO) and defined(FPC_HAS_FEATURE_ANSISTRINGS)}
|
|
|
|
-
|
|
|
|
{****************************************************************************
|
|
{****************************************************************************
|
|
Resource strings.
|
|
Resource strings.
|
|
****************************************************************************}
|
|
****************************************************************************}
|
|
@@ -144,15 +119,8 @@ Var
|
|
****************************************************************************}
|
|
****************************************************************************}
|
|
|
|
|
|
{$ifdef FPC_HAS_FEATURE_FILEIO}
|
|
{$ifdef FPC_HAS_FEATURE_FILEIO}
|
|
-{$ifndef FPC_UNICODE_RTL}
|
|
|
|
-Procedure MkDirpchar(s: pchar;len:sizeuint);[IOCheck]; external name 'FPC_SYS_MKDIR';
|
|
|
|
-Procedure ChDirpchar(s: pchar;len:sizeuint);[IOCheck]; external name 'FPC_SYS_CHDIR';
|
|
|
|
-Procedure RmDirpchar(s: pchar;len:sizeuint);[IOCheck]; external name 'FPC_SYS_RMDIR';
|
|
|
|
-{$endif}
|
|
|
|
|
|
|
|
-{ Untyped file support }
|
|
|
|
-{$ifdef FPC_UNICODE_RTL}
|
|
|
|
-Procedure AssignFile(out f:File;const Name:RawBytestring);
|
|
|
|
|
|
+ Procedure AssignFile(out f:File;const Name:RawBytestring);
|
|
begin
|
|
begin
|
|
System.Assign (F,Name);
|
|
System.Assign (F,Name);
|
|
end;
|
|
end;
|
|
@@ -161,23 +129,7 @@ Procedure AssignFile(out f:File;const Name:UnicodeString);
|
|
begin
|
|
begin
|
|
System.Assign (F,Name);
|
|
System.Assign (F,Name);
|
|
end;
|
|
end;
|
|
-{$else}
|
|
|
|
-Procedure AssignFile(out f:File;const Name:string);
|
|
|
|
-begin
|
|
|
|
- System.Assign (F,Name);
|
|
|
|
-end;
|
|
|
|
|
|
|
|
-Procedure AssignFile(out f:File;p:pchar);
|
|
|
|
-begin
|
|
|
|
- System.Assign (F,P);
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-Procedure AssignFile(out f:File;c:char);
|
|
|
|
-
|
|
|
|
-begin
|
|
|
|
- System.Assign (F,C);
|
|
|
|
-end;
|
|
|
|
-{$endif}
|
|
|
|
Procedure CloseFile(Var f:File); [IOCheck];
|
|
Procedure CloseFile(Var f:File); [IOCheck];
|
|
|
|
|
|
begin
|
|
begin
|
|
@@ -189,7 +141,6 @@ end;
|
|
{$ifdef FPC_HAS_FEATURE_TEXTIO}
|
|
{$ifdef FPC_HAS_FEATURE_TEXTIO}
|
|
{ Text file support }
|
|
{ Text file support }
|
|
|
|
|
|
-{$ifdef FPC_UNICODE_RTL}
|
|
|
|
Procedure AssignFile(out f:Text;const Name:RawBytestring);
|
|
Procedure AssignFile(out f:Text;const Name:RawBytestring);
|
|
begin
|
|
begin
|
|
System.Assign (F,Name);
|
|
System.Assign (F,Name);
|
|
@@ -199,26 +150,6 @@ Procedure AssignFile(out f:Text;const Name:UnicodeString);
|
|
begin
|
|
begin
|
|
System.Assign (F,Name);
|
|
System.Assign (F,Name);
|
|
end;
|
|
end;
|
|
-{$else}
|
|
|
|
-
|
|
|
|
-Procedure AssignFile(out t:Text;const s:string);
|
|
|
|
-
|
|
|
|
-begin
|
|
|
|
- System.Assign (T,S);
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-Procedure AssignFile(out t:Text;p:pchar);
|
|
|
|
-
|
|
|
|
-begin
|
|
|
|
- System.Assign (T,P);
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-Procedure AssignFile(out t:Text;c:char);
|
|
|
|
-
|
|
|
|
-begin
|
|
|
|
- System.Assign (T,C);
|
|
|
|
-end;
|
|
|
|
-{$endif}
|
|
|
|
|
|
|
|
Procedure CloseFile(Var t:Text); [IOCheck];
|
|
Procedure CloseFile(Var t:Text); [IOCheck];
|
|
|
|
|
|
@@ -231,7 +162,6 @@ end;
|
|
{$ifdef FPC_HAS_FEATURE_FILEIO}
|
|
{$ifdef FPC_HAS_FEATURE_FILEIO}
|
|
{ Typed file support }
|
|
{ Typed file support }
|
|
|
|
|
|
-{$ifdef FPC_UNICODE_RTL}
|
|
|
|
Procedure AssignFile(out f:TypedFile;const Name:RawBytestring);
|
|
Procedure AssignFile(out f:TypedFile;const Name:RawBytestring);
|
|
begin
|
|
begin
|
|
System.Assign (F,Name);
|
|
System.Assign (F,Name);
|
|
@@ -241,32 +171,13 @@ Procedure AssignFile(out f:TypedFile;const Name:UnicodeString);
|
|
begin
|
|
begin
|
|
System.Assign (F,Name);
|
|
System.Assign (F,Name);
|
|
end;
|
|
end;
|
|
-{$else}
|
|
|
|
-Procedure AssignFile(out f:TypedFile;const Name:string);
|
|
|
|
-
|
|
|
|
-begin
|
|
|
|
- system.Assign(F,Name);
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-Procedure AssignFile(out f:TypedFile;p:pchar);
|
|
|
|
-
|
|
|
|
-begin
|
|
|
|
- system.Assign (F,p);
|
|
|
|
-end;
|
|
|
|
|
|
|
|
-Procedure AssignFile(out f:TypedFile;c:char);
|
|
|
|
-
|
|
|
|
-begin
|
|
|
|
- system.Assign (F,C);
|
|
|
|
-end;
|
|
|
|
-{$endif}
|
|
|
|
{$endif FPC_HAS_FEATURE_FILEIO}
|
|
{$endif FPC_HAS_FEATURE_FILEIO}
|
|
|
|
|
|
{$if defined(FPC_HAS_FEATURE_COMMANDARGS) }
|
|
{$if defined(FPC_HAS_FEATURE_COMMANDARGS) }
|
|
-Function ParamStr(Param : Integer) : unicodestring;
|
|
|
|
|
|
+Function ParamStr(Param : Integer) : ansistring;
|
|
|
|
|
|
Var Len : longint;
|
|
Var Len : longint;
|
|
- s : ansistring;
|
|
|
|
begin
|
|
begin
|
|
{
|
|
{
|
|
Paramstr(0) should return the name of the binary.
|
|
Paramstr(0) should return the name of the binary.
|
|
@@ -283,40 +194,15 @@ begin
|
|
Len:=0;
|
|
Len:=0;
|
|
While Argv[Param][Len]<>#0 do
|
|
While Argv[Param][Len]<>#0 do
|
|
Inc(len);
|
|
Inc(len);
|
|
- SetLength(s,Len);
|
|
|
|
|
|
+ SetLength(result,Len);
|
|
If Len>0 then
|
|
If Len>0 then
|
|
- Move(Argv[Param][0],s[1],Len);
|
|
|
|
- result:=s;
|
|
|
|
|
|
+ Move(Argv[Param][0],result[1],Len);
|
|
end
|
|
end
|
|
else
|
|
else
|
|
Result:='';
|
|
Result:='';
|
|
end;
|
|
end;
|
|
{$endif FPC_HAS_FEATURE_COMMANDARGS}
|
|
{$endif FPC_HAS_FEATURE_COMMANDARGS}
|
|
|
|
|
|
-
|
|
|
|
-{$if defined(FPC_HAS_FEATURE_FILEIO) and defined(FPC_HAS_FEATURE_ANSISTRINGS) and not defined(FPC_UNICODE_RTL)}
|
|
|
|
-{ xxDirPChar procedures can adjust directory separators in supplied string (at least
|
|
|
|
- Windows implementation does so). Therefore full copy of argument is needed,
|
|
|
|
- just passing by value isn't enough because it won't copy a string literal. }
|
|
|
|
-Procedure MkDir(s:ansistring);[IOCheck];
|
|
|
|
-begin
|
|
|
|
- UniqueString(s);
|
|
|
|
- mkdirpchar(pchar(s),length(s));
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-Procedure RmDir(s:ansistring);[IOCheck];
|
|
|
|
-begin
|
|
|
|
- UniqueString(s);
|
|
|
|
- RmDirpchar(pchar(s),length(s));
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-Procedure ChDir(s:ansistring);[IOCheck];
|
|
|
|
-begin
|
|
|
|
- UniqueString(s);
|
|
|
|
- ChDirpchar(pchar(s),length(s));
|
|
|
|
-end;
|
|
|
|
-{$endif defined(FPC_HAS_FEATURE_FILEIO) and defined(FPC_HAS_FEATURE_ANSISTRINGS)}
|
|
|
|
-
|
|
|
|
{$ifdef FPC_HAS_FEATURE_RESOURCES}
|
|
{$ifdef FPC_HAS_FEATURE_RESOURCES}
|
|
{ ---------------------------------------------------------------------
|
|
{ ---------------------------------------------------------------------
|
|
ResourceString support
|
|
ResourceString support
|