From d3cb19214bd22b699682e7d550bb3ce46cd5d5dc Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 19 Nov 2004 13:15:14 +0000 Subject: [PATCH] * external rework. Mostly done. --- rtl/bsd/baseunix.pp | 14 ++++++-- rtl/bsd/bunxfunc.inc | 15 ++++---- rtl/bsd/ossysch.inc | 19 +++++----- rtl/linux/baseunix.pp | 13 ++++--- rtl/linux/bunxfunc.inc | 19 +++++----- rtl/linux/ossysch.inc | 17 +++++---- rtl/unix/bunxh.inc | 82 ++++++++++++++++++++++++------------------ rtl/unix/bunxovl.inc | 7 ++-- rtl/unix/sysdeclh.inc | 9 +++-- rtl/unix/terminfo.pp | 17 ++++----- rtl/unix/unix.pp | 12 +++++-- 11 files changed, 137 insertions(+), 87 deletions(-) diff --git a/rtl/bsd/baseunix.pp b/rtl/bsd/baseunix.pp index ef59f5b58f..2378a0afa2 100644 --- a/rtl/bsd/baseunix.pp +++ b/rtl/bsd/baseunix.pp @@ -43,8 +43,13 @@ const clib = 'c'; {$i bunxh.inc} { Functions} {$ENDIF} +{$ifndef ver1_0} +function fpgeterrno:longint; external name 'FPC_SYS_GETERRNO'; +procedure fpseterrno(err:longint); external name 'FPC_SYS_SETERRNO'; +{$else} function fpgeterrno:longint; procedure fpseterrno(err:longint); +{$endif} {$ifndef ver1_0} property errno : cint read fpgeterrno write fpseterrno; @@ -57,8 +62,8 @@ implementation Uses Sysctl; {$ifndef ver1_0} -function fpgeterrno:longint; external name 'FPC_SYS_GETERRNO'; -procedure fpseterrno(err:longint); external name 'FPC_SYS_SETERRNO'; +//function fpgeterrno:longint; external name 'FPC_SYS_GETERRNO'; +//procedure fpseterrno(err:longint); external name 'FPC_SYS_SETERRNO'; {$else} // workaround for 1.0.10 bugs. @@ -84,7 +89,10 @@ end. { $Log$ - Revision 1.11 2004-11-14 12:21:08 marco + Revision 1.12 2004-11-19 13:15:14 marco + * external rework. Mostly done. + + Revision 1.11 2004/11/14 12:21:08 marco * moved some calls from unix to baseunix. Darwin untested. Revision 1.10 2004/05/31 18:03:51 jonas diff --git a/rtl/bsd/bunxfunc.inc b/rtl/bsd/bunxfunc.inc index a4c5938ea8..1b8d5adcf0 100644 --- a/rtl/bsd/bunxfunc.inc +++ b/rtl/bsd/bunxfunc.inc @@ -29,7 +29,7 @@ {$ifndef FPC_USE_LIBC} { $ ifndef ver1_0} -Function FpSigProcMask(how : cInt; Const nset : TSigSet; var oset : TSigSet): cInt; external name 'FPC_SYSC_SIGPROCMASK'; +// Function FpSigProcMask(how : cInt; Const nset : TSigSet; var oset : TSigSet): cInt; external name 'FPC_SYSC_SIGPROCMASK'; { $ endif} {$USER BLA!} @@ -155,7 +155,7 @@ begin time_to_sleep.tv_nsec := 0; if (FPnanosleep(@time_to_sleep, @time_remaining) <> -1) Then Exit(0); - if (geterrno <> ESysEINTR) Then // EAGAIN? + if (fpgeterrno <> ESysEINTR) Then // EAGAIN? Exit (seconds); { best guess } FPsleep:= time_remaining.tv_sec; if (time_remaining.tv_nsec <> 0) Then @@ -177,12 +177,12 @@ Begin mib[0] := val1; mib[1] := val2; len := pzsize; - oerrno := geterrno; + oerrno := fpgeterrno; if (FPsysctl(@mib, 2, pz, @len, NIL, 0) = -1) Then Begin - if (geterrno = ESysENOMEM) Then - seterrno(oerrno) + if (fpgeterrno = ESysENOMEM) Then + fpseterrno(oerrno) else rval := -1; End; @@ -558,7 +558,10 @@ end; { $Log$ - Revision 1.9 2004-11-14 12:21:08 marco + Revision 1.10 2004-11-19 13:15:14 marco + * external rework. Mostly done. + + Revision 1.9 2004/11/14 12:21:08 marco * moved some calls from unix to baseunix. Darwin untested. Revision 1.8 2004/01/22 13:46:14 marco diff --git a/rtl/bsd/ossysch.inc b/rtl/bsd/ossysch.inc index 3e385775f6..c91439aa9d 100644 --- a/rtl/bsd/ossysch.inc +++ b/rtl/bsd/ossysch.inc @@ -20,25 +20,28 @@ //Function Fpmunmap(start:pointer;len:size_t):cint; external name 'FPC_SYSC_MUNMAP'; //function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; external name 'FPC_SYSC_GETTIMEOFDAY'; -Function Fpmmap(start:pointer;len:size_t;prot:cint;flags:cint;fd:cint;offst:off_t):pointer; external name 'FPC_SYSC_MMAP'; -Function Fpmunmap(start:pointer;len:size_t):cint; external name 'FPC_SYSC_MUNMAP'; +// Function Fpmmap(start:pointer;len:size_t;prot:cint;flags:cint;fd:cint;offst:off_t):pointer; external name 'FPC_SYSC_MMAP'; +// Function Fpmunmap(start:pointer;len:size_t):cint; external name 'FPC_SYSC_MUNMAP'; {$ifndef FPC_USE_LIBC} -Function FpIOCtl(Handle:cint;Ndx: culong;Data: Pointer):cint; external name 'FPC_SYSC_IOCTL'; -Function FpGetPid:LongInt; external name 'FPC_SYSC_GETPID'; -Function FpReadLink(name,linkname:pchar;maxlen:size_t):cint; external name 'FPC_SYSC_READLINK'; +//Function FpIOCtl(Handle:cint;Ndx: culong;Data: Pointer):cint; external name 'FPC_SYSC_IOCTL'; +//Function FpGetPid:LongInt; external name 'FPC_SYSC_GETPID'; +//Function FpReadLink(name,linkname:pchar;maxlen:size_t):cint; external name 'FPC_SYSC_READLINK'; { Needed in both POSIX (for implementation of sleep()) as POSIX realtime extensions or Unix/freebsd} -Function FpNanoSleep (req : ptimespec;rem : ptimespec) : cint; external name 'FPC_SYSC_NANOSLEEP'; +//Function FpNanoSleep (req : ptimespec;rem : ptimespec) : cint; external name 'FPC_SYSC_NANOSLEEP'; { can be used for getdir?} -Function Fpgetcwd (path:pchar; siz:size_t):pchar; external name 'FPC_SYSC_GETCWD'; +//Function Fpgetcwd (path:pchar; siz:size_t):pchar; external name 'FPC_SYSC_GETCWD'; {$endif} { $Log$ - Revision 1.8 2004-11-14 12:21:08 marco + Revision 1.9 2004-11-19 13:15:14 marco + * external rework. Mostly done. + + Revision 1.8 2004/11/14 12:21:08 marco * moved some calls from unix to baseunix. Darwin untested. Revision 1.7 2003/12/30 12:26:21 marco diff --git a/rtl/linux/baseunix.pp b/rtl/linux/baseunix.pp index 5bb9d7e216..f99ac03bc9 100644 --- a/rtl/linux/baseunix.pp +++ b/rtl/linux/baseunix.pp @@ -44,9 +44,13 @@ const clib = 'c'; {$i bunxovlh.inc} +{$ifndef VER1_0} +function fpgeterrno:longint; external name 'FPC_SYS_GETERRNO'; +procedure fpseterrno(err:longint); external name 'FPC_SYS_SETERRNO'; +{$else} function fpgeterrno:longint; procedure fpseterrno(err:longint); - +{$endif} {$ifdef HASGLOBALPROPERTY} property errno : cint read fpgeterrno write fpseterrno; {$endif} @@ -72,15 +76,16 @@ begin intfpseterrno(err); end; {$else} -function fpgeterrno:longint; external name 'FPC_SYS_GETERRNO'; -procedure fpseterrno(err:longint); external name 'FPC_SYS_SETERRNO'; {$endif} end. { $Log$ - Revision 1.10 2004-11-14 12:21:08 marco + Revision 1.11 2004-11-19 13:15:14 marco + * external rework. Mostly done. + + Revision 1.10 2004/11/14 12:21:08 marco * moved some calls from unix to baseunix. Darwin untested. Revision 1.9 2004/03/04 22:15:16 marco diff --git a/rtl/linux/bunxfunc.inc b/rtl/linux/bunxfunc.inc index fcf78607df..511c72d9dd 100644 --- a/rtl/linux/bunxfunc.inc +++ b/rtl/linux/bunxfunc.inc @@ -48,7 +48,7 @@ begin end; {overload} -Function FpSigProcMask(how : cInt; Const nset : TSigSet; var oset : TSigSet): cInt; external name 'FPC_SYSC_SIGPROGMASK'; +//Function FpSigProcMask(how : cInt; Const nset : TSigSet; var oset : TSigSet): cInt; external name 'FPC_SYSC_SIGPROGMASK'; Function fpSigProcMask(how:cint;nset : pSigSet; oset : pSigSet):cint; [public, alias : 'FPC_SYSC_SIGPROGMASK']; { @@ -182,17 +182,17 @@ begin fpsigaddset (nset,SIGCHLD); if fpsigaction(SIGCHLD,NIL,@oact)<0 Then begin - oerrno:=geterrno; + oerrno:=fpgeterrno; fpsigprocmask(SIG_SETMASK,@oset,NIL); - seterrno(oerrno); + fpseterrno(oerrno); exit(cuint(-1)); End; if oact.sa_handler=signalhandler(SIG_IGN) Then Begin fpsleep:=fpnanosleep(@time_to_sleep, @time_remaining); - oerrno:=geterrno; + oerrno:=fpgeterrno; fpsigprocmask(SIG_SETMASK,@oset,NIL); - seterrno(oerrno); + fpseterrno(oerrno); End Else Begin @@ -411,10 +411,10 @@ begin fptimes:=Do_syscall(syscall_nr_times,TSysParam(@buffer)); end; -function fpgetcwd(path : pchar; siz:size_t):pchar; +function pfpgetcwd(path : pchar; siz:tsize):pchar; [public, alias : 'FPC_SYSC_GETCWD']; begin - fpgetcwd:=pchar(Do_Syscall(Syscall_nr_getcwd,TSysParam(Path),TSysParam(siz))); + pfpgetcwd:=pchar(Do_Syscall(Syscall_nr_getcwd,TSysParam(Path),TSysParam(siz))); end; Function fpSelect(N:cint;readfds,writefds,exceptfds:pfdSet;TimeOut:PTimeVal):cint; @@ -565,7 +565,10 @@ end; { $Log$ - Revision 1.13 2004-11-14 12:21:08 marco + Revision 1.14 2004-11-19 13:15:14 marco + * external rework. Mostly done. + + Revision 1.13 2004/11/14 12:21:08 marco * moved some calls from unix to baseunix. Darwin untested. Revision 1.12 2004/10/24 13:55:52 peter diff --git a/rtl/linux/ossysch.inc b/rtl/linux/ossysch.inc index 5be1e2e126..bdc1b863a4 100644 --- a/rtl/linux/ossysch.inc +++ b/rtl/linux/ossysch.inc @@ -15,17 +15,20 @@ **************************************************************************** } -Function Fpmmap(start:pointer;len:size_t;prot:cint;flags:cint;fd:cint;offst:off_t):pointer; external name 'FPC_SYSC_MMAP'; -Function Fpmunmap(start:pointer;len:size_t):cint; external name 'FPC_SYSC_MUNMAP'; +//Function Fpmmap(start:pointer;len:size_t;prot:cint;flags:cint;fd:cint;offst:off_t):pointer; external name 'FPC_SYSC_MMAP'; +//Function Fpmunmap(start:pointer;len:size_t):cint; external name 'FPC_SYSC_MUNMAP'; //function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; external name 'FPC_SYSC_GETTIMEOFDAY'; -Function fpReadLink(name,linkname:pchar;maxlen:size_t):cint; external name 'FPC_SYSC_READLINK'; -Function FpIOCtl(handle:cint;ndx:culong;Data: Pointer):cint; external name 'FPC_SYSC_IOCTL'; -Function FpGetPid:pid_t; external name 'FPC_SYSC_GETPID'; -Function FpNanoSleep(req : ptimespec;rem : ptimespec):cint; external name 'FPC_SYSC_NANOSLEEP'; +//Function fpReadLink(name,linkname:pchar;maxlen:size_t):cint; external name 'FPC_SYSC_READLINK'; +//Function FpIOCtl(handle:cint;ndx:culong;Data: Pointer):cint; external name 'FPC_SYSC_IOCTL'; +//Function FpGetPid:pid_t; external name 'FPC_SYSC_GETPID'; +//Function FpNanoSleep(req : ptimespec;rem : ptimespec):cint; external name 'FPC_SYSC_NANOSLEEP'; { $Log$ - Revision 1.7 2004-11-14 12:21:08 marco + Revision 1.8 2004-11-19 13:15:14 marco + * external rework. Mostly done. + + Revision 1.7 2004/11/14 12:21:08 marco * moved some calls from unix to baseunix. Darwin untested. Revision 1.6 2003/11/19 11:46:55 marco diff --git a/rtl/unix/bunxh.inc b/rtl/unix/bunxh.inc index ce9c9c8b8a..a2d4d684f8 100644 --- a/rtl/unix/bunxh.inc +++ b/rtl/unix/bunxh.inc @@ -21,8 +21,13 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds} // if you are looking for macro definitions or non C template overloaded versions, they are moved to bunxovlh.inc - Function FpSigProcMask(how : cInt; nset : pSigSet; oset : pSigSet): cInt; - Function FpSigProcMask(how : cInt; Const nset : TSigSet; var oset : TSigSet): cInt; +{$ifdef linux} + Function FpSigProcMask(how : cInt; nset : pSigSet; oset : pSigSet): cInt; + Function FpSigProcMask(how : cInt; Const nset : TSigSet; var oset : TSigSet): cInt; external name 'FPC_SYSC_SIGPROCMASK'; +{$else} + Function FpSigProcMask(how : cInt; nset : pSigSet; oset : pSigSet): cInt; external name 'FPC_SYSC_SIGPROCMASK'; + Function FpSigProcMask(how : cInt; Const nset : TSigSet; var oset : TSigSet): cInt; external name 'FPC_SYSC_SIGPROCMASK'; +{$endif} Function FpSigPending (var nset : TSigSet): cInt; Function FpSigSuspend (Const sigmask : TSigSet): cInt; @@ -33,15 +38,15 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds} Function FpChown (path : pChar; owner : TUid; group : TGid): cInt; Function FpUtime (path : pChar; times : putimbuf): cInt; Function FpPipe (var fildes : tfildes):cInt; - Function FpDup (fildes : cInt): cInt; - Function FpDup2 (fildes, fildes2 : cInt): cInt; + Function FpDup (fildes : cInt): cInt; external name 'FPC_SYSC_DUP'; + Function FpDup2 (fildes, fildes2 : cInt): cInt; external name 'FPC_SYSC_DUP2'; Function FpTimes (var buffer : tms): TClock; Function FpAlarm (seconds : cuint): cuint; Function FpPause : cInt; Function FpSleep (seconds : cuint): cuint; - Function FpGetpid : TPid; + Function FpGetpid : TPid; external name 'FPC_SYSC_GETPID'; Function FpGetppid : TPid; Function FpGetuid : TUid; Function FpGeteuid : TUid; @@ -56,52 +61,59 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds} Function FpFcntl (fildes : cInt; cmd : cInt; arg : cInt): cInt; Function FpFcntl (fildes : cInt; cmd : cInt; var arg : flock): cInt; - Function FpGetcwd (path:pChar; siz:TSize):pChar; - Function FpFork : TPid; - Function FpExecve (path : pChar; argv : ppChar; envp: ppChar): cInt; + Function FpGetcwd (path:pChar; siz:TSize):pChar; external name 'FPC_SYSC_GETCWD'; + Function FpFork : TPid; external name 'FPC_SYSC_FORK'; + Function FpExecve (path : pChar; argv : ppChar; envp: ppChar): cInt; + // external name 'FPC_SYSC_EXECVE'; Function FpExecv (path : pChar; argv : ppChar): cInt; - Function FpWaitpid (pid : TPid; stat_loc : pcInt; options: cInt): TPid; + Function FpWaitpid (pid : TPid; stat_loc : pcInt; options: cInt): TPid; external name 'FPC_SYSC_WAITPID'; Function FpWait (var stat_loc : cInt): TPid; - Procedure FpExit (Status : cInt); + Procedure FpExit (Status : cInt); external name 'FPC_SYSC_EXIT'; Function FpKill (pid : TPid; sig: cInt): cInt; Function FpUname (var name: utsname): cInt; - Function FpOpendir (dirname : pChar): pDir; - Function FpReaddir (var dirp : Dir) : pDirent; - Function FpClosedir (var dirp : Dir): cInt; - Function FpChdir (path : pChar): cInt; - Function FpOpen (path : pChar; flags : cInt; Mode: TMode):cInt; - Function FpMkdir (path : pChar; Mode: TMode):cInt; - Function FpUnlink (path : pChar): cInt; - Function FpRmdir (path : pChar): cInt; - Function FpRename (old : pChar; newpath: pChar): cInt; - Function FpFStat (fd : cInt; var sb : stat): cInt; - Function FpStat (path: pChar; var buf : stat): cInt; - Function FpAccess (pathname : pChar; aMode : cInt): cInt; - Function FpClose (fd : cInt): cInt; - Function FpRead (fd : cInt; buf: pChar; nbytes : TSize): TSsize; - Function FpWrite (fd : cInt; buf:pChar; nbytes : TSize): TSsize; - Function FpLseek (fd : cInt; offset : TOff; whence : cInt): TOff; - Function FpTime (var tloc : TTime): TTime; - Function FpFtruncate (fd : cInt; flength : TOff): cInt; - Function FPSigaction (sig: cInt; act : pSigActionRec; oact : pSigActionRec): cint; + Function FpOpendir (dirname : pChar): pDir; external name 'FPC_SYSC_OPENDIR'; + Function FpReaddir (var dirp : Dir) : pDirent; external name 'FPC_SYSC_READDIR'; + Function FpClosedir (var dirp : Dir): cInt; external name 'FPC_SYSC_CLOSEDIR'; + Function FpChdir (path : pChar): cInt; external name 'FPC_SYSC_CHDIR'; + Function FpOpen (path : pChar; flags : cInt; Mode: TMode):cInt; external name 'FPC_SYSC_OPEN'; + Function FpMkdir (path : pChar; Mode: TMode):cInt; external name 'FPC_SYSC_MKDIR'; + Function FpUnlink (path : pChar): cInt; external name 'FPC_SYSC_UNLINK'; + Function FpRmdir (path : pChar): cInt; external name 'FPC_SYSC_RMDIR'; + Function FpRename (old : pChar; newpath: pChar): cInt; external name 'FPC_SYSC_RENAME'; + Function FpFStat (fd : cInt; var sb : stat): cInt; external name 'FPC_SYSC_FSTAT'; + Function FpStat (path: pChar; var buf : stat): cInt; external name 'FPC_SYSC_STAT'; + Function FpAccess (pathname : pChar; aMode : cInt): cInt; external name 'FPC_SYSC_ACCESS'; + Function FpClose (fd : cInt): cInt; external name 'FPC_SYSC_CLOSE'; + + Function FpRead (fd : cInt; buf: pChar; nbytes : TSize): TSsize; external name 'FPC_SYSC_READ'; + Function FpWrite (fd : cInt; buf:pChar; nbytes : TSize): TSsize; external name 'FPC_SYSC_WRITE'; + Function FpLseek (fd : cInt; offset : TOff; whence : cInt): TOff; external name 'FPC_SYSC_LSEEK'; + Function FpTime (var tloc : TTime): TTime; external name 'FPC_SYSC_TIME'; + Function FpFtruncate (fd : cInt; flength : TOff): cInt; external name 'FPC_SYSC_FTRUNCATE'; + Function FPSigaction (sig: cInt; act : pSigActionRec; oact : pSigActionRec): cint; external name 'FPC_SYSC_SIGACTION'; Function FPSelect (N:cint;readfds,writefds,exceptfds:pfdSet;TimeOut:PTimeVal):cint; - Function FpIOCtl (Handle:cint;Ndx: culong;Data: Pointer):cint; - Function FpNanoSleep (req : ptimespec;rem : ptimespec):cint; + Function FpIOCtl (Handle:cint;Ndx: culong;Data: Pointer):cint; external name 'FPC_SYSC_IOCTL'; + Function FpNanoSleep (req : ptimespec;rem : ptimespec):cint; external name 'FPC_SYSC_NANOSLEEP'; Function fpLstat(path:pchar;Info:pstat):cint; Function fpLstat(Filename: ansistring;Info:pstat):cint; Function fpSymlink(oldname,newname:pchar):cint; - Function fpReadLink(name,linkname:pchar;maxlen:size_t):cint; + Function fpReadLink(name,linkname:pchar;maxlen:size_t):cint; external name 'FPC_SYSC_READLINK'; + function fpNice(N:cint):cint; Function fpGetPriority(Which,Who:cint):cint; Function fpSetPriority(Which,Who,What:cint):cint; - Function Fpmmap(start:pointer;len:size_t;prot:cint;flags:cint;fd:cint;offst:off_t):pointer; - Function Fpmunmap(start:pointer;len:size_t):cint; + Function Fpmmap(start:pointer;len:size_t;prot:cint;flags:cint;fd:cint;offst:off_t):pointer; external name 'FPC_SYSC_MMAP'; + Function Fpmunmap(start:pointer;len:size_t):cint; external name 'FPC_SYSC_MUNMAP'; + Function FpGetEnv (name : pChar): pChar; { $Log$ - Revision 1.12 2004-11-14 12:21:08 marco + Revision 1.13 2004-11-19 13:15:14 marco + * external rework. Mostly done. + + Revision 1.12 2004/11/14 12:21:08 marco * moved some calls from unix to baseunix. Darwin untested. Revision 1.11 2003/12/30 12:24:01 marco diff --git a/rtl/unix/bunxovl.inc b/rtl/unix/bunxovl.inc index e525fececf..1ad5956390 100644 --- a/rtl/unix/bunxovl.inc +++ b/rtl/unix/bunxovl.inc @@ -48,7 +48,7 @@ End; Function FpGetcwd (path:AnsiString; siz:TSize):AnsiString; Begin - FpGetcwd:=FpGetcwd(pchar(path),siz); + FpGetcwd:=ansistring(pchar(FpGetcwd(pchar(path),siz))); End; Function FpExecve (path : AnsiString; argv : ppchar; envp: ppchar): cInt; @@ -361,7 +361,10 @@ end; { $Log$ - Revision 1.13 2004-11-14 12:21:08 marco + Revision 1.14 2004-11-19 13:15:14 marco + * external rework. Mostly done. + + Revision 1.13 2004/11/14 12:21:08 marco * moved some calls from unix to baseunix. Darwin untested. Revision 1.12 2004/11/02 14:49:48 florian diff --git a/rtl/unix/sysdeclh.inc b/rtl/unix/sysdeclh.inc index 2b40d44b5b..69e6dda794 100644 --- a/rtl/unix/sysdeclh.inc +++ b/rtl/unix/sysdeclh.inc @@ -14,7 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ***********************************************************************} - +{ {$ifdef BSD} function FPSigProcMask(how:cint;nset : psigset;oset : psigset):cint; external name 'FPC_SYSC_SIGPROCMASK'; {$endif} @@ -45,10 +45,13 @@ function fpDup (fildes:cint):cint; external name 'FPC_SYSC_DUP'; function fpDup2 (fildes:cint;fildes2:cint):cint; external name 'FPC_SYSC_DUP2'; function geterrno : cint; external name 'FPC_SYS_GETERRNO'; procedure seterrno (i:cint); external name 'FPC_SYS_SETERRNO'; - +} { $Log$ - Revision 1.3 2003-10-26 17:01:35 marco + Revision 1.4 2004-11-19 13:15:14 marco + * external rework. Mostly done. + + Revision 1.3 2003/10/26 17:01:35 marco * moved sigprocmask to system for BSD. (needed for reenablesig) Revision 1.2 2003/09/20 12:38:29 marco diff --git a/rtl/unix/terminfo.pp b/rtl/unix/terminfo.pp index 6f601ff1cc..76ec136f34 100644 --- a/rtl/unix/terminfo.pp +++ b/rtl/unix/terminfo.pp @@ -619,11 +619,11 @@ const { structure, not just to the common parts. However, since this structure } { differs for different versions of ncurses,it's impossible to give a } { general declaration here which is correct (JM) } -function set_curterm(term: TerminalCommon_ptr1): TerminalCommon_ptr1;cdecl; +function set_curterm(term: TerminalCommon_ptr1): TerminalCommon_ptr1;cdecl; external curseslib name 'set_curterm'; function del_curterm(term: TerminalCommon_ptr1): Longint; { sets whether to use environment variables for LINES and COLUMNS } -procedure use_env(B: Longint);cdecl; +procedure use_env(B: Longint); cdecl; external curseslib name 'use_env'; function putp(Ndx: Longint): Longint; @@ -631,7 +631,7 @@ function putp(Ndx: Longint): Longint; function setupterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint; { reinitialize lib } -function restartterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint;cdecl; +function restartterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint; cdecl; external curseslib name 'restartterm'; {function tgetent(P1, P2: PChar): Longint; function tgetflag(P: PChar): Longint; @@ -671,11 +671,9 @@ begin tputs := F(P); end; -function set_curterm(term: TerminalCommon_ptr1): TerminalCommon_ptr1; cdecl; external curseslib; +//function set_curterm(term: TerminalCommon_ptr1): TerminalCommon_ptr1; cdecl; external curseslib; -procedure use_env(B: Longint); cdecl; external curseslib; - -function restartterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint; cdecl; external curseslib; +// function restartterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint; cdecl; external curseslib; function setuptermC(Term: PChar; fd: Longint; var ErrCode: Longint): Longint; cdecl; external curseslib name 'setupterm'; @@ -747,7 +745,10 @@ function tparam(const char *, char *, int, ...): PChar; cdecl; external;} end. { $Log$ - Revision 1.6 2004-03-05 22:18:15 jonas + Revision 1.7 2004-11-19 13:15:15 marco + * external rework. Mostly done. + + Revision 1.6 2004/03/05 22:18:15 jonas * fixed declaration for cur_term for darwin now that the importing of variables from shared libraries works diff --git a/rtl/unix/unix.pp b/rtl/unix/unix.pp index 72f411dd77..51301917cb 100644 --- a/rtl/unix/unix.pp +++ b/rtl/unix/unix.pp @@ -1185,7 +1185,7 @@ stringhandling overhead at the same time. } Var - NewDir : ansistring; + mydir,NewDir : ansistring; p1 : cint; Info : Stat; i,j : cint; @@ -1212,7 +1212,10 @@ Begin i:=length(dirlist); j:=1; Repeat - NewDir:=ansistring(p)+'/'+Path; + mydir:=ansistring(p); + if (length(mydir)>0) and (mydir[length(mydir)]<>'/') then + mydir:=mydir+'/'; + NewDir:=mydir+Path; if (FpStat(NewDir,Info)>=0) and (not fpS_ISDIR(Info.st_Mode)) then Begin @@ -1251,7 +1254,10 @@ End. { $Log$ - Revision 1.76 2004-11-03 15:00:43 marco + Revision 1.77 2004-11-19 13:15:15 marco + * external rework. Mostly done. + + Revision 1.76 2004/11/03 15:00:43 marco * Pathstr eliminated Revision 1.75 2004/10/30 20:55:54 marco