mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 21:39:31 +02:00

http://peter@svn.freepascal.org/svn/fpc/trunk ........ r1704 | vincents | 2005-11-09 14:26:22 +0100 (Wed, 09 Nov 2005) | 1 line removed seek64bit define ........ r1711 | tom_at_work | 2005-11-10 16:01:00 +0100 (Thu, 10 Nov 2005) | 2 lines * signal handler update, uses uc_mcontext instead of sigcontext_struct in later Linux versions * syscalls update ........ r1712 | tom_at_work | 2005-11-10 16:04:28 +0100 (Thu, 10 Nov 2005) | 1 line * new constants for si_code field for FPU signals (required by commit 1710) ........ r1714 | tom_at_work | 2005-11-10 16:11:06 +0100 (Thu, 10 Nov 2005) | 1 line * removed "+0" offset generation in assembler writer ........ r1719 | michael | 2005-11-10 21:40:11 +0100 (Thu, 10 Nov 2005) | 1 line + Patch from Michalis Kamburelis to implement correct config dir, following basedir-spec ........ r1720 | marco | 2005-11-11 10:30:08 +0100 (Fri, 11 Nov 2005) | 2 lines * should now also ignore comment starting with ; (bug 45something) ........ r1721 | michael | 2005-11-11 12:24:30 +0100 (Fri, 11 Nov 2005) | 1 line + Added TFPHashTable object, implemented by Dean Zobec ........ r1725 | florian | 2005-11-12 12:01:27 +0100 (Sat, 12 Nov 2005) | 2 lines + writeidx program added ........ r1726 | florian | 2005-11-12 12:14:50 +0100 (Sat, 12 Nov 2005) | 2 lines * reset some variables which could be in an illegal state after an error, this is mainly important for the ide ........ r1729 | marco | 2005-11-13 15:56:35 +0100 (Sun, 13 Nov 2005) | 2 lines * patch with a _lot_ more constants from JP Mugaas (for Indy) ........ r1730 | marco | 2005-11-13 16:25:26 +0100 (Sun, 13 Nov 2005) | 2 lines * couple of redefs for bug #4509 ........ git-svn-id: branches/fixes_2_0@1747 -
92 lines
2.1 KiB
ObjectPascal
92 lines
2.1 KiB
ObjectPascal
{
|
|
Helper routines for installer
|
|
|
|
This file is part of the Free Pascal installer.
|
|
|
|
Copyright (c) 1993-2005 by Florian Klaempfl
|
|
member of the Free Pascal development team
|
|
|
|
See the file COPYING.FPC, included in this distribution,
|
|
for details about the copyright.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
**********************************************************************}
|
|
unit insthelp;
|
|
|
|
interface
|
|
|
|
function RTrim(const S: string): string;
|
|
function LTrim(const S: string): string;
|
|
function Trim(const S: string): string;
|
|
function CompareText(S1, S2: string): integer;
|
|
function ExtOf(const S: string): string;
|
|
function DirAndNameOf(const S: string): string;
|
|
function DirOf(const S: string): string;
|
|
|
|
implementation
|
|
|
|
uses
|
|
dos;
|
|
|
|
function RTrim(const S: string): string;
|
|
var
|
|
i : longint;
|
|
begin
|
|
i:=length(s);
|
|
while (i>0) and (s[i]=' ') do
|
|
dec(i);
|
|
RTrim:=Copy(s,1,i);
|
|
end;
|
|
|
|
function LTrim(const S: string): string;
|
|
var
|
|
i : longint;
|
|
begin
|
|
i:=1;
|
|
while (i<length(s)) and (s[i]=' ') do
|
|
inc(i);
|
|
LTrim:=Copy(s,i,255);
|
|
end;
|
|
|
|
function Trim(const S: string): string;
|
|
begin
|
|
Trim:=RTrim(LTrim(S));
|
|
end;
|
|
|
|
function CompareText(S1, S2: string): integer;
|
|
var R: integer;
|
|
begin
|
|
S1:=Upcase(S1);
|
|
S2:=Upcase(S2);
|
|
if S1<S2 then R:=-1 else
|
|
if S1>S2 then R:= 1 else
|
|
R:=0;
|
|
CompareText:=R;
|
|
end;
|
|
|
|
function ExtOf(const S: string): string;
|
|
var D: DirStr; E: ExtStr; N: NameStr;
|
|
begin
|
|
FSplit(S,D,N,E);
|
|
ExtOf:=E;
|
|
end;
|
|
|
|
function DirAndNameOf(const S: string): string;
|
|
var D: DirStr; E: ExtStr; N: NameStr;
|
|
begin
|
|
FSplit(S,D,N,E);
|
|
DirAndNameOf:=D+N;
|
|
end;
|
|
|
|
function DirOf(const S: string): string;
|
|
var D: DirStr; E: ExtStr; N: NameStr;
|
|
begin
|
|
FSplit(S,D,N,E);
|
|
DirOf:=D;
|
|
end;
|
|
|
|
end.
|