|
@@ -114,7 +114,7 @@ begin
|
|
|
UnicodeString(TextRec(t).FullName):=S;
|
|
|
{$endif USE_FILEREC_FULLNAME}
|
|
|
{$endif FPC_ANSI_TEXTFILEREC}
|
|
|
- { null terminate, since the name array is regularly used as p(wide)char }
|
|
|
+ { null terminate, since the name array is regularly used as p(wide)AnsiChar }
|
|
|
TextRec(t).Name[high(TextRec(t).Name)]:=#0;
|
|
|
end;
|
|
|
{$endif FPC_HAS_FEATURE_WIDESTRINGS}
|
|
@@ -138,7 +138,7 @@ Begin
|
|
|
UnicodeString(TextRec(t).FullName):=S;
|
|
|
{$endif USE_FILEREC_FULLNAME}
|
|
|
{$endif FPC_ANSI_TEXTFILEREC}
|
|
|
- { null terminate, since the name array is regularly used as p(wide)char }
|
|
|
+ { null terminate, since the name array is regularly used as p(wide)AnsiChar }
|
|
|
TextRec(t).Name[high(TextRec(t).Name)]:=#0;
|
|
|
End;
|
|
|
{$endif FPC_HAS_FEATURE_ANSISTRINGS}
|
|
@@ -152,7 +152,7 @@ Begin
|
|
|
InitText(t);
|
|
|
{ warning: no encoding support }
|
|
|
TextRec(t).Name:=s;
|
|
|
- { null terminate, since the name array is regularly used as p(wide)char }
|
|
|
+ { null terminate, since the name array is regularly used as p(wide)AnsiChar }
|
|
|
TextRec(t).Name[high(TextRec(t).Name)]:=#0;
|
|
|
{$endif FPC_HAS_FEATURE_ANSISTRINGS}
|
|
|
End;
|
|
@@ -389,11 +389,11 @@ Begin
|
|
|
End;
|
|
|
{$else FPC_HAS_FEATURE_ANSISTRINGS}
|
|
|
var
|
|
|
- p : array[0..255] Of Char;
|
|
|
+ p : array[0..255] Of AnsiChar;
|
|
|
Begin
|
|
|
Move(s[1],p,Length(s));
|
|
|
p[Length(s)]:=#0;
|
|
|
- Rename(t,Pchar(@p));
|
|
|
+ Rename(t,PAnsiChar(@p));
|
|
|
End;
|
|
|
{$endif FPC_HAS_FEATURE_ANSISTRINGS}
|
|
|
|
|
@@ -591,7 +591,7 @@ Begin
|
|
|
TextRec(f).BufEnd:=0;
|
|
|
End;
|
|
|
|
|
|
-Procedure SetTextLineEnding(Var f:Text; Ending:string);
|
|
|
+Procedure SetTextLineEnding(Var f:Text; Ending: string);
|
|
|
Begin
|
|
|
TextRec(F).LineEnd:=Ending;
|
|
|
End;
|
|
@@ -675,7 +675,7 @@ begin
|
|
|
end;
|
|
|
|
|
|
|
|
|
-Procedure fpc_textinit_filename_iso(var t : Text;nr : DWord;const filename : string);compilerproc;
|
|
|
+Procedure fpc_textinit_filename_iso(var t : Text;nr : DWord;const filename : shortstring);compilerproc;
|
|
|
begin
|
|
|
{$ifdef FPC_HAS_FEATURE_COMMANDARGS}
|
|
|
if paramstr(nr)='' then
|
|
@@ -708,11 +708,11 @@ end;
|
|
|
|
|
|
Procedure fpc_WriteBuffer(var f:Text;const b;len:SizeInt);
|
|
|
var
|
|
|
- p : pchar;
|
|
|
+ p : pansichar;
|
|
|
left,
|
|
|
idx : SizeInt;
|
|
|
begin
|
|
|
- p:=pchar(@b);
|
|
|
+ p:=pansichar(@b);
|
|
|
idx:=0;
|
|
|
left:=TextRec(f).BufSize-TextRec(f).BufPos;
|
|
|
while len>left do
|
|
@@ -772,7 +772,7 @@ begin
|
|
|
end;
|
|
|
|
|
|
|
|
|
-Procedure fpc_Write_Text_ShortStr(Len : Longint;var f : Text;const s : String); iocheck; [Public,Alias:'FPC_WRITE_TEXT_SHORTSTR']; compilerproc;
|
|
|
+Procedure fpc_Write_Text_ShortStr(Len : Longint;var f : Text;const s : ShortString); iocheck; [Public,Alias:'FPC_WRITE_TEXT_SHORTSTR']; compilerproc;
|
|
|
Begin
|
|
|
If (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -789,7 +789,7 @@ Begin
|
|
|
End;
|
|
|
|
|
|
|
|
|
-Procedure fpc_Write_Text_ShortStr_Iso(Len : Longint;var f : Text;const s : String); iocheck; [Public,Alias:'FPC_WRITE_TEXT_SHORTSTR_ISO']; compilerproc;
|
|
|
+Procedure fpc_Write_Text_ShortStr_Iso(Len : Longint;var f : Text;const s : ShortString); iocheck; [Public,Alias:'FPC_WRITE_TEXT_SHORTSTR_ISO']; compilerproc;
|
|
|
Begin
|
|
|
If (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -815,22 +815,22 @@ End;
|
|
|
|
|
|
|
|
|
{ provide local access to write_str }
|
|
|
-procedure Write_Str(Len : Longint;var f : Text;const s : String); iocheck; [external name 'FPC_WRITE_TEXT_SHORTSTR'];
|
|
|
+procedure Write_Str(Len : Longint;var f : Text;const s : ShortString); iocheck; [external name 'FPC_WRITE_TEXT_SHORTSTR'];
|
|
|
|
|
|
{ provide local access to write_str_iso }
|
|
|
-procedure Write_Str_Iso(Len : Longint;var f : Text;const s : String); iocheck; [external name 'FPC_WRITE_TEXT_SHORTSTR_ISO'];
|
|
|
+procedure Write_Str_Iso(Len : Longint;var f : Text;const s : ShortString); iocheck; [external name 'FPC_WRITE_TEXT_SHORTSTR_ISO'];
|
|
|
|
|
|
-Procedure fpc_Write_Text_Pchar_as_Array(Len : Longint;var f : Text;const s : array of char; zerobased: boolean = true); iocheck; compilerproc;
|
|
|
+Procedure fpc_Write_Text_Pchar_as_Array(Len : Longint;var f : Text;const s : array of ansichar; zerobased: boolean = true); iocheck; compilerproc;
|
|
|
var
|
|
|
ArrayLen : longint;
|
|
|
- p : pchar;
|
|
|
+ p : pansichar;
|
|
|
Begin
|
|
|
If (InOutRes<>0) then
|
|
|
exit;
|
|
|
case TextRec(f).mode of
|
|
|
fmOutput { fmAppend gets changed to fmOutPut in do_open (JM) }:
|
|
|
begin
|
|
|
- p:=pchar(@s);
|
|
|
+ p:=pansichar(@s);
|
|
|
if zerobased then
|
|
|
begin
|
|
|
{ can't use StrLen, since that one could try to read past the end }
|
|
@@ -852,17 +852,17 @@ Begin
|
|
|
End;
|
|
|
|
|
|
|
|
|
-Procedure fpc_Write_Text_Pchar_as_Array_Iso(Len : Longint;var f : Text;const s : array of char; zerobased: boolean = true); iocheck; compilerproc;
|
|
|
+Procedure fpc_Write_Text_Pchar_as_Array_Iso(Len : Longint;var f : Text;const s : array of ansichar; zerobased: boolean = true); iocheck; compilerproc;
|
|
|
var
|
|
|
ArrayLen : longint;
|
|
|
- p : pchar;
|
|
|
+ p : pansichar;
|
|
|
Begin
|
|
|
If (InOutRes<>0) then
|
|
|
exit;
|
|
|
case TextRec(f).mode of
|
|
|
fmOutput { fmAppend gets changed to fmOutPut in do_open (JM) }:
|
|
|
begin
|
|
|
- p:=pchar(@s);
|
|
|
+ p:=pansichar(@s);
|
|
|
if zerobased then
|
|
|
begin
|
|
|
{ can't use StrLen, since that one could try to read past the end }
|
|
@@ -893,7 +893,7 @@ Begin
|
|
|
End;
|
|
|
|
|
|
|
|
|
-Procedure fpc_Write_Text_PChar_As_Pointer(Len : Longint;var f : Text;p : PChar); iocheck; compilerproc;
|
|
|
+Procedure fpc_Write_Text_PChar_As_Pointer(Len : Longint;var f : Text;p : PAnsiChar); iocheck; compilerproc;
|
|
|
var
|
|
|
PCharLen : longint;
|
|
|
Begin
|
|
@@ -1013,7 +1013,7 @@ end;
|
|
|
|
|
|
Procedure fpc_Write_Text_SInt(Len : Longint;var t : Text;l : ValSInt); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : String;
|
|
|
+ s : ShortString;
|
|
|
Begin
|
|
|
If (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1024,7 +1024,7 @@ End;
|
|
|
|
|
|
Procedure fpc_Write_Text_UInt(Len : Longint;var t : Text;l : ValUInt); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : String;
|
|
|
+ s : ShortString;
|
|
|
Begin
|
|
|
If (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1035,7 +1035,7 @@ End;
|
|
|
|
|
|
Procedure fpc_Write_Text_SInt_Iso(Len : Longint;var t : Text;l : ValSInt); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : String;
|
|
|
+ s : ShortString;
|
|
|
Begin
|
|
|
If (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1123,7 +1123,7 @@ end;
|
|
|
{$if defined(CPU16) or defined(CPU8)}
|
|
|
procedure fpc_write_text_longword(len : longint;var t : text;q : longword); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : string;
|
|
|
+ s : shortstring;
|
|
|
begin
|
|
|
if (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1134,7 +1134,7 @@ end;
|
|
|
|
|
|
procedure fpc_write_text_longint(len : longint;var t : text;i : longint); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : string;
|
|
|
+ s : shortstring;
|
|
|
begin
|
|
|
if (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1145,7 +1145,7 @@ end;
|
|
|
|
|
|
procedure fpc_write_text_longword_iso(len : longint;var t : text;q : longword); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : string;
|
|
|
+ s : shortstring;
|
|
|
begin
|
|
|
if (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1161,7 +1161,7 @@ end;
|
|
|
|
|
|
procedure fpc_write_text_longint_iso(len : longint;var t : text;i : longint); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : string;
|
|
|
+ s : shortstring;
|
|
|
begin
|
|
|
if (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1177,7 +1177,7 @@ end;
|
|
|
|
|
|
procedure fpc_write_text_word(len : longint;var t : text;q : word); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : string;
|
|
|
+ s : shortstring;
|
|
|
begin
|
|
|
if (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1188,7 +1188,7 @@ end;
|
|
|
|
|
|
procedure fpc_write_text_smallint(len : longint;var t : text;i : smallint); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : string;
|
|
|
+ s : shortstring;
|
|
|
begin
|
|
|
if (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1199,7 +1199,7 @@ end;
|
|
|
|
|
|
procedure fpc_write_text_word_iso(len : longint;var t : text;q : word); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : string;
|
|
|
+ s : shortstring;
|
|
|
begin
|
|
|
if (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1215,7 +1215,7 @@ end;
|
|
|
|
|
|
procedure fpc_write_text_smallint_iso(len : longint;var t : text;i : smallint); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : string;
|
|
|
+ s : shortstring;
|
|
|
begin
|
|
|
if (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1232,7 +1232,7 @@ end;
|
|
|
{$ifndef FPUNONE}
|
|
|
Procedure fpc_Write_Text_Float(rt,fixkomma,Len : Longint;var t : Text;r : ValReal); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : String;
|
|
|
+ s : shortString;
|
|
|
Begin
|
|
|
If (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1243,7 +1243,7 @@ End;
|
|
|
|
|
|
Procedure fpc_Write_Text_Float_iso(rt,fixkomma,Len : Longint;var t : Text;r : ValReal); iocheck; compilerproc;
|
|
|
var
|
|
|
- s : String;
|
|
|
+ s : shortString;
|
|
|
Begin
|
|
|
If (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1255,7 +1255,7 @@ End;
|
|
|
procedure fpc_write_text_enum(typinfo,ord2strindex:pointer;len:sizeint;var t:text;ordinal:longint); iocheck; compilerproc;
|
|
|
|
|
|
var
|
|
|
- s:string;
|
|
|
+ s:shortstring;
|
|
|
|
|
|
begin
|
|
|
{$ifdef EXCLUDE_COMPLEX_PROCS}
|
|
@@ -1283,7 +1283,7 @@ Procedure fpc_Write_Text_Currency(fixkomma,Len : Longint;var t : Text;c : Curren
|
|
|
end;
|
|
|
{$else EXCLUDE_COMPLEX_PROCS}
|
|
|
var
|
|
|
- s : String;
|
|
|
+ s : shortstring;
|
|
|
Begin
|
|
|
If (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1319,7 +1319,7 @@ Begin
|
|
|
End;
|
|
|
|
|
|
|
|
|
-Procedure fpc_Write_Text_Char(Len : Longint;var t : Text;c : Char); iocheck; compilerproc;
|
|
|
+Procedure fpc_Write_Text_Char(Len : Longint;var t : Text;c : AnsiChar); iocheck; compilerproc;
|
|
|
Begin
|
|
|
If (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1340,7 +1340,7 @@ Begin
|
|
|
End;
|
|
|
|
|
|
|
|
|
-Procedure fpc_Write_Text_Char_Iso(Len : Longint;var t : Text;c : Char); iocheck; compilerproc;
|
|
|
+Procedure fpc_Write_Text_Char_Iso(Len : Longint;var t : Text;c : AnsiChar); iocheck; compilerproc;
|
|
|
Begin
|
|
|
If (InOutRes<>0) then
|
|
|
exit;
|
|
@@ -1400,7 +1400,7 @@ End;
|
|
|
Read(Ln)
|
|
|
*****************************************************************************}
|
|
|
|
|
|
-Function NextChar(var f:Text;var s:string):Boolean;
|
|
|
+Function NextChar(var f:Text;var s:shortstring):Boolean;
|
|
|
begin
|
|
|
NextChar:=false;
|
|
|
if (TextRec(f).BufPos<TextRec(f).BufEnd) then
|
|
@@ -1408,7 +1408,7 @@ begin
|
|
|
begin
|
|
|
if length(s)<high(s) then
|
|
|
begin
|
|
|
- inc(s[0]);
|
|
|
+ SetLength(s,Length(s)+1);
|
|
|
s[length(s)]:=TextRec(f).BufPtr^[TextRec(f).BufPos];
|
|
|
end;
|
|
|
Inc(TextRec(f).BufPos);
|
|
@@ -1425,7 +1425,7 @@ Function IgnoreSpaces(var f:Text):Boolean;
|
|
|
the buffer is empty
|
|
|
}
|
|
|
var
|
|
|
- s : string;
|
|
|
+ s : shortstring;
|
|
|
begin
|
|
|
s:='';
|
|
|
IgnoreSpaces:=false;
|
|
@@ -1449,7 +1449,7 @@ begin
|
|
|
end;
|
|
|
|
|
|
|
|
|
-procedure ReadNumeric(var f:Text;var s:string);
|
|
|
+procedure ReadNumeric(var f:Text;var s:shortstring);
|
|
|
{
|
|
|
Read numeric input, if buffer is empty then return True
|
|
|
}
|
|
@@ -1483,7 +1483,7 @@ begin
|
|
|
end;
|
|
|
|
|
|
|
|
|
-procedure ReadInteger(var f:Text;var s:string);
|
|
|
+procedure ReadInteger(var f:Text;var s:shortstring);
|
|
|
{
|
|
|
Ignore leading blanks (incl. EOF) and return the first characters matching
|
|
|
an integer in the format recognized by the Val procedure:
|
|
@@ -1541,7 +1541,7 @@ begin
|
|
|
end;
|
|
|
|
|
|
|
|
|
-procedure ReadReal(var f:Text;var s:string);
|
|
|
+procedure ReadReal(var f:Text;var s:shortstring);
|
|
|
{
|
|
|
Ignore leading blanks (incl. EOF) and return the first characters matching
|
|
|
a float number in the format recognized by the Val procedure:
|
|
@@ -1615,7 +1615,7 @@ end;
|
|
|
|
|
|
|
|
|
Procedure fpc_ReadLn_End(var f : Text);[Public,Alias:'FPC_READLN_END']; iocheck; compilerproc;
|
|
|
-var prev: char;
|
|
|
+var prev: AnsiChar;
|
|
|
Begin
|
|
|
If not CheckRead(f) then
|
|
|
exit;
|
|
@@ -1667,7 +1667,7 @@ End;
|
|
|
|
|
|
|
|
|
Procedure fpc_ReadLn_End_Iso(var f : Text);[Public,Alias:'FPC_READLN_END_ISO']; iocheck; compilerproc;
|
|
|
-var prev: char;
|
|
|
+var prev: AnsiChar;
|
|
|
Begin
|
|
|
If not CheckRead(f) then
|
|
|
exit;
|
|
@@ -1724,10 +1724,10 @@ Begin
|
|
|
End;
|
|
|
|
|
|
|
|
|
-Function ReadPCharLen(var f:Text;s:pchar;maxlen:longint):longint;
|
|
|
+Function ReadPCharLen(var f:Text;s:pansichar;maxlen:longint):longint;
|
|
|
var
|
|
|
sPos,len : Longint;
|
|
|
- p,startp,maxp : pchar;
|
|
|
+ p,startp,maxp : pansichar;
|
|
|
end_of_string:boolean;
|
|
|
Begin
|
|
|
{$ifdef EXCLUDE_COMPLEX_PROCS}
|
|
@@ -1778,23 +1778,28 @@ Begin
|
|
|
End;
|
|
|
|
|
|
|
|
|
-Procedure fpc_Read_Text_ShortStr(var f : Text;out s : String); iocheck; compilerproc;
|
|
|
+Procedure fpc_Read_Text_ShortStr(var f : Text;out s : ShortString); iocheck; compilerproc;
|
|
|
+
|
|
|
+var
|
|
|
+ Len : Longint;
|
|
|
+
|
|
|
Begin
|
|
|
- s[0]:=chr(ReadPCharLen(f,pchar(@s[1]),high(s)));
|
|
|
+ Len:=ReadPCharLen(f,pansichar(@s[1]),high(s));
|
|
|
+ SetLength(S,Len);
|
|
|
End;
|
|
|
|
|
|
|
|
|
-Procedure fpc_Read_Text_PChar_As_Pointer(var f : Text; const s : PChar); iocheck; compilerproc;
|
|
|
+Procedure fpc_Read_Text_PChar_As_Pointer(var f : Text; const s : PAnsiChar); iocheck; compilerproc;
|
|
|
Begin
|
|
|
- pchar(s+ReadPCharLen(f,s,$7fffffff))^:=#0;
|
|
|
+ pansichar(s+ReadPCharLen(f,s,$7fffffff))^:=#0;
|
|
|
End;
|
|
|
|
|
|
|
|
|
-Procedure fpc_Read_Text_PChar_As_Array(var f : Text;out s : array of char; zerobased: boolean = false); iocheck; compilerproc;
|
|
|
+Procedure fpc_Read_Text_PChar_As_Array(var f : Text;out s : array of ansichar; zerobased: boolean = false); iocheck; compilerproc;
|
|
|
var
|
|
|
len: longint;
|
|
|
Begin
|
|
|
- len := ReadPCharLen(f,pchar(@s),high(s)+1);
|
|
|
+ len := ReadPCharLen(f,pansichar(@s),high(s)+1);
|
|
|
if zerobased and
|
|
|
(len > high(s)) then
|
|
|
len := high(s);
|
|
@@ -1812,7 +1817,7 @@ Begin
|
|
|
Repeat
|
|
|
// SetLength will reallocate the length.
|
|
|
SetLength(s,slen+255);
|
|
|
- len:=ReadPCharLen(f,pchar(Pointer(s)+slen),255);
|
|
|
+ len:=ReadPCharLen(f,pansichar(Pointer(s)+slen),255);
|
|
|
inc(slen,len);
|
|
|
Until len<255;
|
|
|
// Set actual length
|
|
@@ -1861,7 +1866,7 @@ Begin
|
|
|
End;
|
|
|
{$endif FPC_WIDESTRING_EQUAL_UNICODESTRING}
|
|
|
|
|
|
-procedure fpc_Read_Text_Char(var f : Text; out c: char); [public, alias: 'FPC_READ_TEXT_CHAR']; iocheck; compilerproc;
|
|
|
+procedure fpc_Read_Text_Char(var f : Text; out c: AnsiChar); [public, alias: 'FPC_READ_TEXT_CHAR']; iocheck; compilerproc;
|
|
|
Begin
|
|
|
c:=#0;
|
|
|
If not CheckRead(f) then
|
|
@@ -1875,10 +1880,10 @@ Begin
|
|
|
inc(TextRec(f).BufPos);
|
|
|
end;
|
|
|
|
|
|
-procedure fpc_Read_Text_Char_intern(var f : Text; out c: char); iocheck; [external name 'FPC_READ_TEXT_CHAR'];
|
|
|
+procedure fpc_Read_Text_Char_intern(var f : Text; out c: AnsiChar); iocheck; [external name 'FPC_READ_TEXT_CHAR'];
|
|
|
|
|
|
|
|
|
-function fpc_GetBuf_Text(var f : Text) : pchar; iocheck; compilerproc;
|
|
|
+function fpc_GetBuf_Text(var f : Text) : pansichar; iocheck; compilerproc;
|
|
|
Begin
|
|
|
Result:=@TextRec(f).Bufptr^[TextRec(f).BufEnd];
|
|
|
if TextRec(f).mode=fmOutput then
|
|
@@ -1897,7 +1902,7 @@ var
|
|
|
ws: widestring;
|
|
|
i: longint;
|
|
|
{ maximum code point length is 6 characters (with UTF-8) }
|
|
|
- str: array[0..5] of char;
|
|
|
+ str: array[0..5] of AnsiChar;
|
|
|
Begin
|
|
|
fillchar(str[0],sizeof(str),0);
|
|
|
for i:=low(str) to high(str) do
|
|
@@ -1936,7 +1941,7 @@ end;
|
|
|
{$endif FPC_HAS_FEATURE_WIDESTRINGS}
|
|
|
|
|
|
|
|
|
-procedure fpc_Read_Text_Char_Iso(var f : Text; out c: char); iocheck;compilerproc;
|
|
|
+procedure fpc_Read_Text_Char_Iso(var f : Text; out c: AnsiChar); iocheck;compilerproc;
|
|
|
Begin
|
|
|
c:=' ';
|
|
|
If not CheckRead(f) then
|
|
@@ -1981,7 +1986,7 @@ end;
|
|
|
|
|
|
Procedure fpc_Read_Text_SInt(var f : Text; out l : ValSInt); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : String;
|
|
|
+ hs : shortstring;
|
|
|
code : ValSInt;
|
|
|
Begin
|
|
|
l:=0;
|
|
@@ -2011,7 +2016,7 @@ End;
|
|
|
|
|
|
Procedure fpc_Read_Text_SInt_Iso(var f : Text; out l : ValSInt); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : String;
|
|
|
+ hs : shortstring;
|
|
|
code : ValSInt;
|
|
|
Begin
|
|
|
l:=0;
|
|
@@ -2028,7 +2033,7 @@ End;
|
|
|
|
|
|
Procedure fpc_Read_Text_UInt(var f : Text; out u : ValUInt); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : String;
|
|
|
+ hs : shortstring;
|
|
|
code : ValSInt;
|
|
|
Begin
|
|
|
u:=0;
|
|
@@ -2055,7 +2060,7 @@ End;
|
|
|
|
|
|
Procedure fpc_Read_Text_UInt_Iso(var f : Text; out u : ValUInt); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : String;
|
|
|
+ hs : shortstring;
|
|
|
code : ValSInt;
|
|
|
Begin
|
|
|
u:=0;
|
|
@@ -2072,7 +2077,7 @@ End;
|
|
|
{$ifndef FPUNONE}
|
|
|
procedure fpc_Read_Text_Float(var f : Text; out v : ValReal); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : string;
|
|
|
+ hs : shortstring;
|
|
|
code : Word;
|
|
|
begin
|
|
|
v:=0.0;
|
|
@@ -2095,7 +2100,7 @@ end;
|
|
|
|
|
|
procedure fpc_Read_Text_Float_Iso(var f : Text; out v : ValReal); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : string;
|
|
|
+ hs : shortstring;
|
|
|
code : Word;
|
|
|
begin
|
|
|
v:=0.0;
|
|
@@ -2115,7 +2120,7 @@ procedure fpc_read_text_enum(str2ordindex:pointer;var t:text;out ordinal:longint
|
|
|
procedure fpc_read_text_enum_longint(str2ordindex:pointer;var t:text;out ordinal:longint); iocheck;compilerproc;
|
|
|
{$endif VER3_2}
|
|
|
|
|
|
-var s:string;
|
|
|
+var s:shortstring;
|
|
|
code:valsint;
|
|
|
|
|
|
begin
|
|
@@ -2137,7 +2142,7 @@ end;
|
|
|
{$ifndef VER3_2}
|
|
|
procedure fpc_read_text_enum_smallint(str2ordindex:pointer;var t:text;out ordinal:smallint); iocheck;compilerproc;
|
|
|
|
|
|
-var s:string;
|
|
|
+var s:shortstring;
|
|
|
code:valsint;
|
|
|
|
|
|
begin
|
|
@@ -2158,7 +2163,7 @@ end;
|
|
|
|
|
|
procedure fpc_read_text_enum_shortint(str2ordindex:pointer;var t:text;out ordinal:shortint); iocheck;compilerproc;
|
|
|
|
|
|
-var s:string;
|
|
|
+var s:shortstring;
|
|
|
code:valsint;
|
|
|
|
|
|
begin
|
|
@@ -2180,7 +2185,7 @@ end;
|
|
|
|
|
|
procedure fpc_Read_Text_Currency(var f : Text; out v : Currency); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : string;
|
|
|
+ hs : shortstring;
|
|
|
code : ValSInt;
|
|
|
begin
|
|
|
{$ifdef FPUNONE}
|
|
@@ -2207,7 +2212,7 @@ end;
|
|
|
|
|
|
procedure fpc_Read_Text_Currency_Iso(var f : Text; out v : Currency); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : string;
|
|
|
+ hs : shortstring;
|
|
|
code : ValSInt;
|
|
|
begin
|
|
|
v:=0;
|
|
@@ -2225,7 +2230,7 @@ end;
|
|
|
|
|
|
procedure fpc_Read_Text_QWord(var f : text; out q : qword); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : String;
|
|
|
+ hs : shortstring;
|
|
|
code : longint;
|
|
|
Begin
|
|
|
q:=0;
|
|
@@ -2247,7 +2252,7 @@ End;
|
|
|
|
|
|
procedure fpc_Read_Text_QWord_Iso(var f : text; out q : qword); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : String;
|
|
|
+ hs : shortstring;
|
|
|
code : longint;
|
|
|
Begin
|
|
|
q:=0;
|
|
@@ -2262,7 +2267,7 @@ End;
|
|
|
|
|
|
procedure fpc_Read_Text_Int64(var f : text; out i : int64); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : String;
|
|
|
+ hs : shortstring;
|
|
|
code : Longint;
|
|
|
Begin
|
|
|
i:=0;
|
|
@@ -2284,7 +2289,7 @@ End;
|
|
|
|
|
|
procedure fpc_Read_Text_Int64_Iso(var f : text; out i : int64); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : String;
|
|
|
+ hs : shortstring;
|
|
|
code : Longint;
|
|
|
Begin
|
|
|
i:=0;
|
|
@@ -2303,7 +2308,7 @@ End;
|
|
|
{$if defined(CPU16) or defined(CPU8)}
|
|
|
procedure fpc_Read_Text_LongWord(var f : text; out q : longword); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : String;
|
|
|
+ hs : shortstring;
|
|
|
code : longint;
|
|
|
Begin
|
|
|
q:=0;
|
|
@@ -2325,7 +2330,7 @@ End;
|
|
|
|
|
|
procedure fpc_Read_Text_LongInt(var f : text; out i : longint); iocheck; compilerproc;
|
|
|
var
|
|
|
- hs : String;
|
|
|
+ hs : shortstring;
|
|
|
code : Longint;
|
|
|
Begin
|
|
|
i:=0;
|
|
@@ -2353,13 +2358,13 @@ End;
|
|
|
*****************************************************************************}
|
|
|
|
|
|
const
|
|
|
- { pointer to target string }
|
|
|
+ { pointer to target shortstring }
|
|
|
StrPtrIndex = 1;
|
|
|
{ temporary destination for writerstr, because the original value of the
|
|
|
destination may be used in the writestr expression }
|
|
|
TempWriteStrDestIndex = 9;
|
|
|
ShortStrLenIndex = 17;
|
|
|
- { how many bytes of the string have been processed already (used for readstr) }
|
|
|
+ { how many bytes of the shortstring have been processed already (used for readstr) }
|
|
|
BytesReadIndex = 17;
|
|
|
|
|
|
procedure WriteStrShort(var t: textrec);
|
|
@@ -2379,7 +2384,7 @@ begin
|
|
|
{$ifdef writestr_iolencheck}
|
|
|
// GPC only gives an io error if {$no-truncate-strings} is active
|
|
|
// FPC does not have this setting (it never gives errors when a
|
|
|
- // a string expression is truncated)
|
|
|
+ // a shortstring expression is truncated)
|
|
|
|
|
|
{ "disk full" }
|
|
|
inoutres:=101;
|
|
@@ -2393,12 +2398,12 @@ end;
|
|
|
|
|
|
procedure WriteStrShortFlush(var t: textrec);
|
|
|
begin
|
|
|
- { move written data from internal buffer to temporary string (don't move
|
|
|
- directly from buffer to final string, because the temporary string may
|
|
|
- already contain data in case the textbuf was smaller than the string
|
|
|
+ { move written data from internal buffer to temporary shortstring (don't move
|
|
|
+ directly from buffer to final shortstring, because the temporary shortstring may
|
|
|
+ already contain data in case the textbuf was smaller than the shortstring
|
|
|
length) }
|
|
|
WriteStrShort(t);
|
|
|
- { move written data to original string }
|
|
|
+ { move written data to original shortstring }
|
|
|
move(PPointer(@t.userdata[TempWriteStrDestIndex])^^,
|
|
|
PPointer(@t.userdata[StrPtrIndex])^^,
|
|
|
t.userdata[ShortStrLenIndex]+1);
|
|
@@ -2446,7 +2451,7 @@ begin
|
|
|
{ we don't care about combining diacritical marks here: we just want a
|
|
|
valid UTF-8 codepoint that we can translate to UTF-16. The combining
|
|
|
diacritical marks can be translated separately }
|
|
|
- codepointlen:=Utf8CodePointLen(pchar(@t.bufptr^[i]),(t.bufpos-1-i)+1,false);
|
|
|
+ codepointlen:=Utf8CodePointLen(pansichar(@t.bufptr^[i]),(t.bufpos-1-i)+1,false);
|
|
|
{ complete codepoint -> flush till here }
|
|
|
if codepointlen>0 then
|
|
|
begin
|
|
@@ -2577,7 +2582,7 @@ begin
|
|
|
SetupWriteStrCommon(TextRec(ReadWriteStrText),cp);
|
|
|
PPointer(@TextRec(ReadWriteStrText).userdata[StrPtrIndex])^:=@s;
|
|
|
|
|
|
- { temp destination ansistring, nil = empty string }
|
|
|
+ { temp destination ansistring, nil = empty shortstring }
|
|
|
PPointer(@TextRec(ReadWriteStrText).userdata[TempWriteStrDestIndex])^:=nil;
|
|
|
|
|
|
TextRec(ReadWriteStrText).InOutFunc:=@WriteStrAnsi;
|
|
@@ -2592,7 +2597,7 @@ begin
|
|
|
SetupWriteStrCommon(TextRec(ReadWriteStrText),CP_UTF8);
|
|
|
PPointer(@TextRec(ReadWriteStrText).userdata[StrPtrIndex])^:=@s;
|
|
|
|
|
|
- { temp destination unicodestring, nil = empty string }
|
|
|
+ { temp destination unicodestring, nil = empty shortstring }
|
|
|
PPointer(@TextRec(ReadWriteStrText).userdata[TempWriteStrDestIndex])^:=nil;
|
|
|
|
|
|
TextRec(ReadWriteStrText).InOutFunc:=@WriteStrUnicode;
|
|
@@ -2625,7 +2630,7 @@ end;
|
|
|
{$endif FPC_HAS_FEATURE_ANSISTRINGS}
|
|
|
|
|
|
|
|
|
-procedure ReadStrCommon(var t: textrec; strdata: pchar; len: sizeint);
|
|
|
+procedure ReadStrCommon(var t: textrec; strdata: pansichar; len: sizeint);
|
|
|
var
|
|
|
newbytes: sizeint;
|
|
|
begin
|
|
@@ -2688,8 +2693,8 @@ begin
|
|
|
*********************
|
|
|
Apart from the restrictions imposed by requirements given in this clause,
|
|
|
the execution of readstr(e,v 1 ,...,v n ) where e denotes a
|
|
|
- string-expression and v 1 ,...,v n denote variable-accesses possessing the
|
|
|
- char-type (or a subrange of char-type), the integer-type (or a subrange of
|
|
|
+ shortstring-expression and v 1 ,...,v n denote variable-accesses possessing the
|
|
|
+ AnsiChar-type (or a subrange of AnsiChar-type), the integer-type (or a subrange of
|
|
|
integer-type), the real-type, a fixed-string-type, or a
|
|
|
variable-string-type, shall be equivalent to
|
|
|
|