Parcourir la source

* Changed some functions to use rtlstring.

git-svn-id: branches/unicodertl@12140 -
yury il y a 17 ans
Parent
commit
c6bfed610d

+ 2 - 2
rtl/inc/fexpand.inc

@@ -50,7 +50,7 @@
  {$DEFINE FPC_FEXPAND_UPDIR_HELPER}
  {$DEFINE FPC_FEXPAND_UPDIR_HELPER}
 {$ENDIF FPC_FEXPAND_DIRSEP_IS_UPDIR}
 {$ENDIF FPC_FEXPAND_DIRSEP_IS_UPDIR}
 
 
-procedure GetDirIO (DriveNr: byte; var Dir: String);
+procedure GetDirIO (DriveNr: byte; var Dir: RtlString);
 
 
 (* GetDirIO is supposed to return the root of the given drive   *)
 (* GetDirIO is supposed to return the root of the given drive   *)
 (* in case of an error for compatibility of FExpand with TP/BP. *)
 (* in case of an error for compatibility of FExpand with TP/BP. *)
@@ -67,7 +67,7 @@ end;
 
 
 {$IFDEF FPC_FEXPAND_VOLUMES}
 {$IFDEF FPC_FEXPAND_VOLUMES}
  {$IFNDEF FPC_FEXPAND_NO_DEFAULT_PATHS}
  {$IFNDEF FPC_FEXPAND_NO_DEFAULT_PATHS}
-procedure GetDirIO (const VolumeName: OpenString; var Dir: string);
+procedure GetDirIO (const VolumeName: OpenString; var Dir: RtlString);
 
 
 var
 var
   OldInOutRes: word;
   OldInOutRes: word;

+ 5 - 5
rtl/objpas/sysutils/diskh.inc

@@ -15,9 +15,9 @@
 
 
 Function  DiskFree(drive: byte) : int64;
 Function  DiskFree(drive: byte) : int64;
 Function  DiskSize(drive: byte) : int64;
 Function  DiskSize(drive: byte) : int64;
-Function GetCurrentDir : String;
-Function SetCurrentDir (Const NewDir : String) : Boolean;
-Function CreateDir (Const NewDir : String) : Boolean;
-Function RemoveDir (Const Dir : String) : Boolean;
-Function ForceDirectories(Const Dir: string): Boolean;
+Function GetCurrentDir : RtlString;
+Function SetCurrentDir (Const NewDir : RtlString) : Boolean;
+Function CreateDir (Const NewDir : RtlString) : Boolean;
+Function RemoveDir (Const Dir : RtlString) : Boolean;
+Function ForceDirectories(Const Dir: RtlString): Boolean;
 
 

+ 30 - 26
rtl/objpas/sysutils/fina.inc

@@ -20,7 +20,7 @@
     System Utilities For Free Pascal
     System Utilities For Free Pascal
 }
 }
 
 
-function ChangeFileExt(const FileName, Extension: string): string;
+function ChangeFileExt(const FileName, Extension: RtlString): RtlString;
 var
 var
   i : longint;
   i : longint;
   EndSep : Set of Char;
   EndSep : Set of Char;
@@ -34,7 +34,7 @@ begin
   Result := Copy(FileName, 1, I - 1) + Extension;
   Result := Copy(FileName, 1, I - 1) + Extension;
 end;
 end;
 
 
-function ExtractFilePath(const FileName: string): string;
+function ExtractFilePath(const FileName: RtlString): RtlString;
 var
 var
   i : longint;
   i : longint;
   EndSep : Set of Char;
   EndSep : Set of Char;
@@ -49,7 +49,7 @@ begin
     Result:='';
     Result:='';
 end;
 end;
 
 
-function ExtractFileDir(const FileName: string): string;
+function ExtractFileDir(const FileName: RtlString): RtlString;
 var
 var
   i : longint;
   i : longint;
   EndSep : Set of Char;
   EndSep : Set of Char;
@@ -64,7 +64,7 @@ begin
   Result := Copy(FileName, 1, I);
   Result := Copy(FileName, 1, I);
 end;
 end;
 
 
-function ExtractFileDrive(const FileName: string): string;
+function ExtractFileDrive(const FileName: RtlString): RtlString;
 
 
 var
 var
   i,l: longint;
   i,l: longint;
@@ -86,7 +86,7 @@ begin
     end;
     end;
 end;
 end;
 
 
-function ExtractFileName(const FileName: string): string;
+function ExtractFileName(const FileName: RtlString): RtlString;
 var
 var
   i : longint;
   i : longint;
   EndSep : Set of Char;
   EndSep : Set of Char;
@@ -98,7 +98,7 @@ begin
   Result := Copy(FileName, I + 1, MaxInt);
   Result := Copy(FileName, I + 1, MaxInt);
 end;
 end;
 
 
-function ExtractFileExt(const FileName: string): string;
+function ExtractFileExt(const FileName: RtlString): RtlString;
 var
 var
   i : longint;
   i : longint;
   EndSep : Set of Char;
   EndSep : Set of Char;
@@ -113,28 +113,32 @@ begin
     Result := '';
     Result := '';
 end;
 end;
 
 
-function ExtractShortPathName(Const FileName : String) : String;
-
+function ExtractShortPathName(Const FileName : RtlString) : RtlString;
+{$ifdef MSWINDOWS}
+var
+  res: UnicodeString;
+{$endif}
 begin
 begin
 {$ifdef MSWINDOWS}
 {$ifdef MSWINDOWS}
-  SetLength(Result,Max_Path);
-  SetLength(Result,GetShortPathName(PChar(FileName), Pchar(Result),Length(Result)));
+  SetLength(res,Max_Path);
+  SetLength(res,GetShortPathNameW(_W(FileName), PWideChar(res),Length(res)));
+  Result:=res;
 {$else}
 {$else}
   Result:=FileName;
   Result:=FileName;
 {$endif}
 {$endif}
 end;
 end;
 
 
 type
 type
-  PathStr=string;
+  PathStr=RtlString;
 
 
 {$DEFINE FPC_FEXPAND_SYSUTILS}
 {$DEFINE FPC_FEXPAND_SYSUTILS}
 
 
 {$I fexpand.inc}
 {$I fexpand.inc}
 
 
 
 
-function ExpandFileName (Const FileName : string): String;
+function ExpandFileName (Const FileName : RtlString): RtlString;
 
 
-Var S : String;
+Var S : RtlString;
 
 
 Begin
 Begin
  S:=FileName;
  S:=FileName;
@@ -144,7 +148,7 @@ end;
 
 
 
 
 {$ifndef HASEXPANDUNCFILENAME}
 {$ifndef HASEXPANDUNCFILENAME}
-function ExpandUNCFileName (Const FileName : string): String;
+function ExpandUNCFileName (Const FileName : RtlString): RtlString;
 begin
 begin
   Result:=ExpandFileName (FileName);
   Result:=ExpandFileName (FileName);
   //!! Here should follow code to replace the drive: part with UNC...
   //!! Here should follow code to replace the drive: part with UNC...
@@ -155,11 +159,11 @@ end;
 Const
 Const
   MaxDirs = 129;
   MaxDirs = 129;
 
 
-function ExtractRelativepath (Const BaseName,DestName : String): String;
+function ExtractRelativepath (Const BaseName,DestName : RtlString): RtlString;
 
 
-Var Source, Dest : String;
+Var Source, Dest : RtlString;
     Sc,Dc,I,J    : Longint;
     Sc,Dc,I,J    : Longint;
-    SD,DD        : Array[1..MaxDirs] of PChar;
+    SD,DD        : Array[1..MaxDirs] of PRtlChar;
 
 
 Const OneLevelBack = '..'+DirectorySeparator;
 Const OneLevelBack = '..'+DirectorySeparator;
 
 
@@ -176,7 +180,7 @@ begin
   I:=1;
   I:=1;
   While (I<=DC) and (I<=SC) do
   While (I<=DC) and (I<=SC) do
     begin
     begin
-    If StrIcomp(DD[i],SD[i])=0 then
+    If AnsiCompareText(DD[i],SD[i])=0 then
       Inc(i)
       Inc(i)
     else
     else
       Break;
       Break;
@@ -187,7 +191,7 @@ begin
   Result:=Result+ExtractFileName(DestNAme);
   Result:=Result+ExtractFileName(DestNAme);
 end;
 end;
 
 
-Procedure DoDirSeparators (Var FileName : String);
+Procedure DoDirSeparators (Var FileName : RtlString);
 
 
 VAr I : longint;
 VAr I : longint;
 
 
@@ -198,7 +202,7 @@ begin
 end;
 end;
 
 
 
 
-Function SetDirSeparators (Const FileName : string) : String;
+Function SetDirSeparators (Const FileName : RtlString) : RtlString;
 
 
 begin
 begin
   Result:=FileName;
   Result:=FileName;
@@ -212,7 +216,7 @@ end;
   if none were found.
   if none were found.
 }
 }
 
 
-Function GetDirs (Var DirName : String; Var Dirs : Array of pchar) : Longint;
+Function GetDirs (Var DirName : RtlString; Var Dirs : Array of PRtlChar) : Longint;
 
 
 Var I : Longint;
 Var I : Longint;
 
 
@@ -234,7 +238,7 @@ begin
   If Result>-1 then inc(Result);
   If Result>-1 then inc(Result);
 end;
 end;
 
 
-function IncludeTrailingPathDelimiter(Const Path : String) : String;
+function IncludeTrailingPathDelimiter(Const Path : RtlString) : RtlString;
 
 
 Var
 Var
   l : Integer;
   l : Integer;
@@ -246,19 +250,19 @@ begin
     Result:=Result+DirectorySeparator;
     Result:=Result+DirectorySeparator;
 end;
 end;
 
 
-function IncludeTrailingBackslash(Const Path : String) : String;
+function IncludeTrailingBackslash(Const Path : RtlString) : RtlString;
 
 
 begin
 begin
   Result:=IncludeTrailingPathDelimiter(Path);
   Result:=IncludeTrailingPathDelimiter(Path);
 end;
 end;
 
 
-function ExcludeTrailingBackslash(Const Path: string): string;
+function ExcludeTrailingBackslash(Const Path: RtlString): RtlString;
 
 
 begin
 begin
   Result:=ExcludeTrailingPathDelimiter(Path);
   Result:=ExcludeTrailingPathDelimiter(Path);
 end;
 end;
 
 
-function ExcludeTrailingPathDelimiter(Const Path: string): string;
+function ExcludeTrailingPathDelimiter(Const Path: RtlString): RtlString;
 
 
 Var
 Var
   L : Integer;
   L : Integer;
@@ -270,7 +274,7 @@ begin
   Result:=Copy(Path,1,L);
   Result:=Copy(Path,1,L);
 end;
 end;
 
 
-function IsPathDelimiter(Const Path: string; Index: Integer): Boolean;
+function IsPathDelimiter(Const Path: RtlString; Index: Integer): Boolean;
 
 
 begin
 begin
   Result:=(Index>0) and (Index<=Length(Path)) and (Path[Index] in AllowDirectorySeparators);
   Result:=(Index>0) and (Index<=Length(Path)) and (Path[Index] in AllowDirectorySeparators);

+ 19 - 19
rtl/objpas/sysutils/finah.inc

@@ -20,23 +20,23 @@
     System Utilities For Free Pascal
     System Utilities For Free Pascal
 }
 }
 
 
-function ChangeFileExt(const FileName, Extension: string): string;
-function ExtractFilePath(const FileName: string): string;
-function ExtractFileDrive(const FileName: string): string;
-function ExtractFileName(const FileName: string): string;
-function ExtractFileExt(const FileName: string): string;
-function ExtractFileDir(Const FileName : string): string;
-function ExtractShortPathName(Const FileName : String) : String;
-function ExpandFileName (Const FileName : string): String;
-function ExpandUNCFileName (Const FileName : string): String;
-function ExtractRelativepath (Const BaseName,DestNAme : String): String;
-function IncludeTrailingPathDelimiter(Const Path : String) : String;
-function IncludeTrailingBackslash(Const Path : String) : String;
-function ExcludeTrailingBackslash(Const Path: string): string;
-function ExcludeTrailingPathDelimiter(Const Path: string): string;
-function IsPathDelimiter(Const Path: string; Index: Integer): Boolean;
-Procedure DoDirSeparators (Var FileName : String);
-Function SetDirSeparators (Const FileName : String) : String;
-Function GetDirs (Var DirName : String; Var Dirs : Array of pchar) : Longint;
-Function SameFileName(const S1, S2: string): Boolean;
+function ChangeFileExt(const FileName, Extension: RtlString): RtlString;
+function ExtractFilePath(const FileName: RtlString): RtlString;
+function ExtractFileDrive(const FileName: RtlString): RtlString;
+function ExtractFileName(const FileName: RtlString): RtlString;
+function ExtractFileExt(const FileName: RtlString): RtlString;
+function ExtractFileDir(Const FileName : RtlString): RtlString;
+function ExtractShortPathName(Const FileName : RtlString) : RtlString;
+function ExpandFileName (Const FileName : RtlString): RtlString;
+function ExpandUNCFileName (Const FileName : RtlString): RtlString;
+function ExtractRelativepath (Const BaseName,DestNAme : RtlString): RtlString;
+function IncludeTrailingPathDelimiter(Const Path : RtlString) : RtlString;
+function IncludeTrailingBackslash(Const Path : RtlString) : RtlString;
+function ExcludeTrailingBackslash(Const Path: RtlString): RtlString;
+function ExcludeTrailingPathDelimiter(Const Path: RtlString): RtlString;
+function IsPathDelimiter(Const Path: RtlString; Index: Integer): Boolean;
+Procedure DoDirSeparators (Var FileName : RtlString);
+Function SetDirSeparators (Const FileName : RtlString) : RtlString;
+Function GetDirs (Var DirName : RtlString; Var Dirs : Array of PRtlChar) : Longint;
+Function SameFileName(const S1, S2: RtlString): Boolean;
 
 

+ 1 - 1
rtl/objpas/sysutils/osutilsh.inc

@@ -33,7 +33,7 @@ Function GetTempDir : String;
 Function GetTempFileName(Const Dir,Prefix : String) : String;
 Function GetTempFileName(Const Dir,Prefix : String) : String;
 Function GetTempFileName : String;
 Function GetTempFileName : String;
 { For windows compatibility }
 { For windows compatibility }
-function GetTempFileName(Dir,Prefix: PChar; uUnique: DWORD; TempFileName: PChar):DWORD;
+function GetTempFileName(Dir,Prefix: PRtlChar; uUnique: DWORD; TempFileName: PRtlChar):DWORD;
 Function GetAppConfigDir(Global : Boolean) : String;
 Function GetAppConfigDir(Global : Boolean) : String;
 Function GetAppConfigFile(Global : Boolean) : String;
 Function GetAppConfigFile(Global : Boolean) : String;
 Function GetAppConfigFile(Global : Boolean; SubDir : Boolean) : String;
 Function GetAppConfigFile(Global : Boolean; SubDir : Boolean) : String;

+ 2 - 2
rtl/objpas/sysutils/sysansi.inc

@@ -18,7 +18,7 @@
     *********************************************************************
     *********************************************************************
 }
 }
 
 
-Function AnsiCompareFileName(const S1, S2: string): SizeInt;
+Function AnsiCompareFileName(const S1, S2: RtlString): SizeInt;
 
 
 begin
 begin
   If FileNameCaseSensitive then
   If FileNameCaseSensitive then
@@ -27,7 +27,7 @@ begin
     Result:=AnsiCompareText(S1,S2); // Compare case insensitive. No MBCS yet.
     Result:=AnsiCompareText(S1,S2); // Compare case insensitive. No MBCS yet.
 end;
 end;
 
 
-Function SameFileName(const S1, S2: string): Boolean;
+Function SameFileName(const S1, S2: RtlString): Boolean;
 
 
 begin
 begin
   Result:=AnsiCompareFileName(S1,S2)=0;
   Result:=AnsiCompareFileName(S1,S2)=0;

+ 1 - 1
rtl/objpas/sysutils/sysansih.inc

@@ -18,7 +18,7 @@
     *********************************************************************
     *********************************************************************
 }
 }
 
 
-function AnsiCompareFileName(const S1, S2 : string) : SizeInt;
+function AnsiCompareFileName(const S1, S2 : RtlString) : SizeInt;
 function AnsiLowerCaseFileName(const s : string) : string;
 function AnsiLowerCaseFileName(const s : string) : string;
 function AnsiUpperCaseFileName(const s : string) : string;
 function AnsiUpperCaseFileName(const s : string) : string;
 function AnsiPos(const substr,s : string) : SizeInt;
 function AnsiPos(const substr,s : string) : SizeInt;

+ 6 - 6
rtl/objpas/sysutils/sysutils.inc

@@ -531,16 +531,16 @@ end;
     Diskh functions, OS independent.
     Diskh functions, OS independent.
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
 
 
-function ForceDirectories(Const Dir: string): Boolean;
+function ForceDirectories(Const Dir: RtlString): Boolean;
 
 
 var
 var
   E: EInOutError;
   E: EInOutError;
-  ADrv : String;
+  ADrv : RtlString;
 
 
-function DoForceDirectories(Const Dir: string): Boolean;
+function DoForceDirectories(Const Dir: RtlString): Boolean;
 var
 var
-  ADir : String;
-  APath: String;
+  ADir : RtlString;
+  APath: RtlString;
 begin
 begin
   Result:=True;
   Result:=True;
   ADir:=ExcludeTrailingPathDelimiter(Dir);
   ADir:=ExcludeTrailingPathDelimiter(Dir);
@@ -557,7 +557,7 @@ begin
     end;
     end;
 end;
 end;
 
 
-function IsUncDrive(const Drv: String): Boolean;
+function IsUncDrive(const Drv: RtlString): Boolean;
 begin
 begin
   Result := (Length(Drv) > 2) and (Drv[1] = PathDelim) and (Drv[2] = PathDelim);
   Result := (Length(Drv) > 2) and (Drv[1] = PathDelim) and (Drv[2] = PathDelim);
 end;
 end;

+ 30 - 26
rtl/win/sysutils.pp

@@ -56,7 +56,7 @@ function CheckWin32Version(Major,Minor : Integer ): Boolean;
 function CheckWin32Version(Major : Integer): Boolean;
 function CheckWin32Version(Major : Integer): Boolean;
 Procedure RaiseLastWin32Error;
 Procedure RaiseLastWin32Error;
 
 
-function GetFileVersion(const AFileName: string): Cardinal;
+function GetFileVersion(const AFileName: RtlString): Cardinal;
 
 
 procedure GetFormatSettings;
 procedure GetFormatSettings;
 
 
@@ -65,6 +65,11 @@ implementation
   uses
   uses
     sysconst;
     sysconst;
 
 
+function _W(const s: RtlString): PWideChar; inline;
+begin
+  Result:=PWideChar(UnicodeString(s));
+end;
+
 function WinCheck(res:boolean):boolean;
 function WinCheck(res:boolean):boolean;
   begin
   begin
     if not res then
     if not res then
@@ -98,12 +103,12 @@ function CheckWin32Version(Major,Minor: Integer): Boolean;
   end;
   end;
 
 
 
 
-function GetFileVersion(const AFileName:string):Cardinal;
+function GetFileVersion(const AFileName:RtlString):Cardinal;
   var
   var
     { usefull only as long as we don't need to touch different stack pages }
     { usefull only as long as we don't need to touch different stack pages }
     buf : array[0..3071] of byte;
     buf : array[0..3071] of byte;
     bufp : pointer;
     bufp : pointer;
-    fn : string;
+    fn : RtlString;
     valsize,
     valsize,
     size : DWORD;
     size : DWORD;
     h : DWORD;
     h : DWORD;
@@ -112,12 +117,12 @@ function GetFileVersion(const AFileName:string):Cardinal;
     result:=$fffffff;
     result:=$fffffff;
     fn:=AFileName;
     fn:=AFileName;
     UniqueString(fn);
     UniqueString(fn);
-    size:=GetFileVersionInfoSize(pchar(fn),@h);
+    size:=GetFileVersionInfoSizeW(_W(fn),@h);
     if size>sizeof(buf) then
     if size>sizeof(buf) then
       begin
       begin
         getmem(bufp,size);
         getmem(bufp,size);
         try
         try
-          if GetFileVersionInfo(pchar(fn),h,size,bufp) then
+          if GetFileVersionInfoW(_W(fn),h,size,bufp) then
             if VerQueryValue(bufp,'\',valrec,valsize) then
             if VerQueryValue(bufp,'\',valrec,valsize) then
               result:=valrec^.dwFileVersionMS;
               result:=valrec^.dwFileVersionMS;
         finally
         finally
@@ -143,16 +148,15 @@ function GetFileVersion(const AFileName:string):Cardinal;
 
 
 { Include platform independent implementation part }
 { Include platform independent implementation part }
 {$i sysutils.inc}
 {$i sysutils.inc}
-
-function SysGetTempFileName(lpPathName:LPCSTR;
-                            lpPrefixString:LPCSTR;
+{
+function SysGetTempFileName(lpPathName:LPWSTR;
+                            lpPrefixString:LPWSTR;
                             uUnique:UINT;
                             uUnique:UINT;
-                            lpTempFileName:LPSTR):UINT;stdcall;external 'kernel32' name 'GetTempFileNameA';
-
-function GetTempFileName(Dir,Prefix: PChar; uUnique: DWORD; TempFileName: PChar):DWORD;
-
+                            lpTempFileName:LPWTR):UINT;stdcall;external 'kernel32' name 'GetTempFileNameW';
+}
+function GetTempFileName(Dir,Prefix: PRtlChar; uUnique: DWORD; TempFileName: PRtlChar):DWORD;
 begin
 begin
-  Result:=SysGetTempFileName(Dir,Prefix,uUnique,TempFileName);
+  Result:=Windows.GetTempFileNameW(_W(Dir),_W(Prefix),uUnique,TempFileName);
 end;
 end;
 
 
 
 
@@ -166,13 +170,13 @@ begin
 end;
 end;
 
 
 
 
-function ExpandUNCFileName (const filename:string) : string;
+function ExpandUNCFileName (const filename:RtlString) : RtlString;
 { returns empty string on errors }
 { returns empty string on errors }
 var
 var
-  s    : ansistring;
+  s    : RtlString;
   size : dword;
   size : dword;
   rc   : dword;
   rc   : dword;
-  buf : pchar;
+  buf : PWideChar;
 begin
 begin
   s := ExpandFileName (filename);
   s := ExpandFileName (filename);
 
 
@@ -182,15 +186,15 @@ begin
   getmem(buf,size);
   getmem(buf,size);
 
 
   try
   try
-    rc := WNetGetUniversalName (pchar(s), UNIVERSAL_NAME_INFO_LEVEL, buf, @size);
+    rc := WNetGetUniversalNameW(_W(s), UNIVERSAL_NAME_INFO_LEVEL, buf, @size);
 
 
     if rc=ERROR_MORE_DATA then
     if rc=ERROR_MORE_DATA then
       begin
       begin
         buf:=reallocmem(buf,size);
         buf:=reallocmem(buf,size);
-        rc := WNetGetUniversalName (pchar(s), UNIVERSAL_NAME_INFO_LEVEL, buf, @size);
+        rc := WNetGetUniversalNameW(_W(s), UNIVERSAL_NAME_INFO_LEVEL, buf, @size);
       end;
       end;
     if rc = NO_ERROR then
     if rc = NO_ERROR then
-      Result := PRemoteNameInfo(buf)^.lpUniversalName
+      Result := buf
     else if rc = ERROR_NOT_CONNECTED then
     else if rc = ERROR_NOT_CONNECTED then
       Result := filename
       Result := filename
     else
     else
@@ -556,27 +560,27 @@ begin
 end;
 end;
 
 
 
 
-Function GetCurrentDir : String;
+Function GetCurrentDir : RtlString;
 begin
 begin
   GetDir(0, result);
   GetDir(0, result);
 end;
 end;
 
 
 
 
-Function SetCurrentDir (Const NewDir : String) : Boolean;
+Function SetCurrentDir (Const NewDir : RtlString) : Boolean;
 begin
 begin
-  Result:=SetCurrentDirectory(PChar(NewDir));
+  Result:=SetCurrentDirectoryW(_W(NewDir));
 end;
 end;
 
 
 
 
-Function CreateDir (Const NewDir : String) : Boolean;
+Function CreateDir (Const NewDir : RtlString) : Boolean;
 begin
 begin
-  Result:=CreateDirectory(PChar(NewDir),nil);
+  Result:=CreateDirectoryW(_W(NewDir),nil);
 end;
 end;
 
 
 
 
-Function RemoveDir (Const Dir : String) : Boolean;
+Function RemoveDir (Const Dir : RtlString) : Boolean;
 begin
 begin
-  Result:=RemoveDirectory(PChar(Dir));
+  Result:=RemoveDirectoryW(_W(Dir));
 end;
 end;