Compare commits

..

21 Commits

Author SHA1 Message Date
Janet B. Anderson
e4f741f97c Changed release to R3.14.10. 2008-10-27 19:41:22 +00:00
Janet B. Anderson
0e08b62f34 R3.14.10 2008-10-27 19:39:04 +00:00
Janet B. Anderson
2b37a8f746 Added make -j option ifeq before creating arch dependancies on host_arch. 2008-10-27 19:24:45 +00:00
Andrew Johnson
f5967d268c False assertion removed. 2008-10-24 23:04:11 +00:00
Andrew Johnson
078e30b7b9 Mantis #311 fix; generate an interactive flex scanner. 2008-10-23 21:21:43 +00:00
Andrew Johnson
01349a9448 Add epicsShare decorators for visibility in a Cygwin DLL. 2008-10-23 19:27:24 +00:00
Andrew Johnson
dd2ef6d47a Reformatting, wording improvements. 2008-10-22 15:20:50 +00:00
Jeff Hill
2d51fbc3c7 fixed mantis 325 2008-10-21 20:50:26 +00:00
Jeff Hill
c5f15a3e17 fixed bug introduced after R3.14.9, but before R3.14.10-RC1 and R3.14.10-RC2 2008-10-21 20:26:48 +00:00
Andrew Johnson
cdd2748c98 Allow multiple slashes as path seperators, since we used to.
Also fixed perldoc comment formatting.
2008-10-20 18:32:47 +00:00
Andrew Johnson
6789814826 Remove space after -I option for osf-alpha. 2008-10-20 15:39:32 +00:00
Andrew Johnson
b3abcbb52e Don't fail if epicsSnprintf returns less than the buffer size needed. 2008-10-20 15:35:10 +00:00
W. Eric Norum
3274519a82 Add note about RTEMS version. 2008-10-20 15:33:27 +00:00
Janet B. Anderson
95b708a40b post-RC1 versions... 2008-10-17 19:45:00 +00:00
W. Eric Norum
3b2bbd50e5 Cleaner version of wait with timeout fix. 2008-10-16 13:38:14 +00:00
W. Eric Norum
ab765613ec Add note about RTEMS epicsEventWaitWithTimeout. 2008-10-16 13:17:57 +00:00
W. Eric Norum
ba5080d6f4 Return TIMEOUT status even when delay time is 0. 2008-10-15 19:40:57 +00:00
W. Eric Norum
a6ed0d3a53 RTEMS newlib version of strtod handles INF/NAN. 2008-10-15 19:40:00 +00:00
Andrew Johnson
edc141f98a Added checks for NULL callbacks and record pointers. 2008-10-13 14:08:35 +00:00
W. Eric Norum
7245f8127c Arrange for compatability with compile-time and run-time linking. 2008-10-11 16:40:46 +00:00
Andrew Johnson
ba37f17c89 Updated version number in title. 2008-10-10 15:50:08 +00:00
16 changed files with 142 additions and 116 deletions

View File

@@ -38,8 +38,9 @@ EPICS_PATCH_LEVEL = 0
#EPICS_CVS_SNAPSHOT=-pre1-CVS
#EPICS_CVS_SNAPSHOT=-RC1
#EPICS_CVS_SNAPSHOT=-RC1-CVS
EPICS_CVS_SNAPSHOT=-RC2
#EPICS_CVS_SNAPSHOT=
#EPICS_CVS_SNAPSHOT=-RC2
#EPICS_CVS_SNAPSHOT=-RC2-CVS
EPICS_CVS_SNAPSHOT=
# No changes should be needed below here

View File

@@ -299,10 +299,12 @@ ARCMD = $(AR) $(ARFLAGS) $(USR_ARFLAGS) $@ $(LIBRARY_LD_OBJS)
MUNCH_CMD = $(LD) -o $@ $^
#--------------------------------------------------
# LEX default option (valid for EPICS base 3.13.0.beta12 and later)
# LEX default options
#
# to allow characters that are not plain 7bit standard ASCII
LEXOPT += -8
# Allow 8-bit characters
LEXOPT += -8
# Generate an "interactive" scanner, solves problems at EOF.
LEXOPT += -I
#--------------------------------------------------
# Build compile line here

View File

@@ -42,6 +42,8 @@ buildDirs = $(addprefix O.,$(BUILD_ARCHS))
CROSS_ARCHS += $(CROSS1) $(CROSS2)
ifeq ($(findstring j,$(MAKEFLAGS)),j)
define DEP_template
$(2): $$(EPICS_HOST_ARCH)
$(1)$$(DIVIDER)$(2): $(1)$$(DIVIDER)$$(EPICS_HOST_ARCH)
@@ -50,6 +52,8 @@ endef
$(foreach action, $(ACTIONS), $(foreach arch,\
$(CROSS_ARCHS),$(eval $(call DEP_template,$(action),$(arch)))))
endif
#*************************************************************************
$(actionArchTargets) : $(buildDirs) O.Common

View File

@@ -7,14 +7,23 @@
</head>
<body lang="en">
<h1 align="center">EPICS Base Release 3.14.10-RC1</h1>
<h1 align="center">EPICS Base Release 3.14.10</h1>
<h2 align="center">Changes between 3.14.9 and 3.14.10</h2>
<!-- Insert new items below here ... -->
<h4>RTEMS Release</h4>
<p>RTEMS release 4.9 or newer is required. If you are using the RTEMS NFS time provider you need to use RTEMS 4.9.1 or newer.</p>
<h4>RTEMS epicsEventWaitWithTimeout</h4>
<p>Correctly return epicsEventWaitTimeout when event is not pending and timeout value is 0.0 secondsmore agressive.</p>
<h4>epicsRingPointer, epicsRingBytes</h4>
<p>Fixed race condition exposed by compilers with more agressive optimization.</p>
<p>Fixed a race condition exposed by compilers with more agressive
optimization.</p>
<h4>camonitor timestamp support</h4>
@@ -259,14 +268,18 @@ should not affect the contents of <tt>Makefile</tt>s or any applications
using Base. They do however require that the version of GNU Make used be 3.81
or later. These changes are briefly:</p>
<ul>
<li><p>A new tool is provided that expands out <tt>@VAR@</tt> macros. By
default it knows the value of <tt>@TOP@</tt>, <tt>@ARCH@</tt> and any
paths defined in the application's <tt>configure/RELEASE</tt> file, but
additional macros can be defined in the <tt>Makefile</tt> that uses it by
adding to the <tt>EXPAND_VARS</tt> macro like the example following,
which creates an <tt>@EXE@</tt> macro that expands out to <tt>.exe</tt>
on windows and to nothing on other platforms:</p>
paths defined in the application's <tt>configure/RELEASE</tt> file such
as @EPICS_BASE@, but additional macros can be defined in the
<tt>Makefile</tt> that uses it by adding to the <tt>EXPAND_VARS</tt>
variable like the example following, which creates an <tt>@EXE@</tt>
macro that expands out to <tt>.exe</tt> on windows targets and to
nothing on other platforms:</p>
<pre> EXPAND_VARS += EXE=$(EXE)</pre>
<p>Files that contain <tt>@VAR@</tt> macros to be substituted must have
an at sign <tt><b>@</b></tt> as the last character of their name and be
listed in the <tt>EXPAND</tt> variable of their <tt>Makefile</tt>. The
@@ -274,24 +287,29 @@ or later. These changes are briefly:</p>
<tt><b>@</b></tt> suffix removed, and is then available for compiling or
installing using any other build mechanism.</p>
</li>
<li><p>Support has been added for installing Perl library modules. The
<tt>Makefile</tt> variable <tt>PERL_MODULES</tt> can be set to a list of
names of files to be installed into the <tt>$(TOP)/lib/perl</tt>
directory. The above macro expansion facility can then be used in perl
programs that use these libraries to set the perl search path to include
that directory. The syntax for this is as follows:</p>
<pre> use lib '@TOP@/lib/perl';
use MyModule;</pre>
<p>The filenames listed in <tt>PERL_MODULES</tt> can include subdirectory
path components and the build system will preserve these in the installed
result.</p>
</li>
<li>The Perl scripts that were in <tt>configure/tools</tt> are now found in
the new <tt>src/tools</tt> directory, and get installed into the
appropriate <tt>bin/<i>hostarch</i></tt> directory at build time. Some of
these scripts are no longer required and have been removed, and others
are being modified to make them more modular, extracting common routines
into perl library modules.</li>
<li>The generated files that were created by running make in the
<tt>configure</tt> directory are no longer required, having been replaced
by additional mechanisms inside the build system files. This removes a

View File

@@ -51,9 +51,6 @@ void tzset(void);
int fileno(FILE *);
int main(int argc, char **argv);
rtems_interval rtemsTicksPerSecond;
double rtemsTicksPerSecond_double, rtemsTicksPerTwoSeconds_double;
static void
logReset (void)
{
@@ -81,6 +78,8 @@ logReset (void)
static void
delayedPanic (const char *msg)
{
extern rtems_interval rtemsTicksPerSecond;
rtems_task_wake_after (rtemsTicksPerSecond);
rtems_panic (msg);
}
@@ -421,13 +420,6 @@ Init (rtems_task_argument ignored)
rtems_status_code sc;
rtems_time_of_day now;
/*
* Get configuration
*/
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &rtemsTicksPerSecond);
rtemsTicksPerSecond_double = rtemsTicksPerSecond;
rtemsTicksPerTwoSeconds_double = rtemsTicksPerSecond_double * 2.0;
/*
* Explain why we're here
*/

View File

@@ -28,7 +28,7 @@ endif
Cap5_SRCS = Cap5.xs
Cap5_LIBS = ca Com
Cap5_INCLUDES = -I $(shell $(PERL) ../perlConfig.pl archlib)/CORE
Cap5_INCLUDES = -I$(shell $(PERL) ../perlConfig.pl archlib)/CORE
Cap5_CFLAGS = $(shell $(PERL) ../perlConfig.pl ccflags)
ifeq ($(findstring Host,$(VALID_BUILDS)),Host)

View File

@@ -1413,8 +1413,9 @@ caStatus casStrmClient::createChanResponse (
this->chanTable.remove ( *pChan->pChanI );
this->chanList.remove ( *pChan->pChanI );
pChan->pChanI->uninstallFromPV ( this->eventSys );
pChan->getPV()->pPVI->deleteSignal ();
casPVI * pPVI = pChan->getPV()->pPVI;
delete pChan->pChanI;
pPVI->deleteSignal ();
}
return status;

View File

@@ -147,10 +147,15 @@ void callbackInit(void)
/* This routine can be called from interrupt context */
void callbackRequest(CALLBACK *pcallback)
{
int priority = pcallback->priority;
int priority;
int pushOK;
int lockKey;
if (!pcallback) {
epicsPrintf("callbackRequest called with NULL pcallback\n");
return;
}
priority = pcallback->priority;
if (priority < 0 || priority >= NUM_CALLBACK_PRIORITIES) {
epicsPrintf("callbackRequest called with invalid priority\n");
return;
@@ -174,6 +179,7 @@ static void ProcessCallback(CALLBACK *pcallback)
dbCommon *pRec;
callbackGetUser(pRec, pcallback);
if (!pRec) return;
dbScanLock(pRec);
(*pRec->rset->process)(pRec);
dbScanUnlock(pRec);

View File

@@ -234,7 +234,7 @@ void epicsShareAPI dbCaRemoveLink(struct link *plink)
{
caLink *pca = (caLink *)plink->value.pv_link.pvt;
assert(pca);
if (!pca) return;
epicsMutexMustLock(pca->lock);
pca->plink = 0;
plink->value.pv_link.pvt = 0;

View File

@@ -150,7 +150,7 @@ static void ipAddrToAsciiEngineShutdownRequest ( void * )
}
if ( deleteGlobalMutexCondDetected ) {
delete ipAddrToAsciiEnginePrivate :: pGlobalMutex;
ipAddrToAsciiEnginePrivate :: pEngine = 0;
ipAddrToAsciiEnginePrivate :: pGlobalMutex = 0;
}
}
@@ -225,11 +225,13 @@ void ipAddrToAsciiEnginePrivate::release ()
if ( ipAddrToAsciiEnginePrivate::numberOfReferences == 0u ) {
deleteGlobalMutexCondDetected =
ipAddrToAsciiEnginePrivate :: shutdownRequest;
delete ipAddrToAsciiEnginePrivate :: pEngine;
ipAddrToAsciiEnginePrivate :: pEngine = 0;
}
}
if ( deleteGlobalMutexCondDetected ) {
delete ipAddrToAsciiEnginePrivate :: pGlobalMutex;
ipAddrToAsciiEnginePrivate :: pEngine = 0;
ipAddrToAsciiEnginePrivate :: pGlobalMutex = 0;
}
}

View File

@@ -18,8 +18,9 @@
#ifndef INCdevLibh
#define INCdevLibh 1
#include <dbDefs.h>
#include <osdVME.h>
#include "dbDefs.h"
#include "osdVME.h"
#include "shareLib.h"
#ifdef __cplusplus
extern "C" {
@@ -44,14 +45,14 @@ typedef enum {
*/
extern const char *epicsAddressTypeName[];
long devAddressMap(void); /* print an address map */
epicsShareFunc long devAddressMap(void); /* print an address map */
/*
* devBusToLocalAddr()
*
* OSI routine to translate bus addresses their local CPU address mapping
*/
long devBusToLocalAddr (
epicsShareFunc long devBusToLocalAddr (
epicsAddressType addrType,
size_t busAddr,
volatile void **ppLocalAddr);
@@ -61,7 +62,8 @@ long devBusToLocalAddr (
* a bus error safe "wordSize" read at the specified address which returns
* unsuccessful status if the device isnt present
*/
long devReadProbe (unsigned wordSize, volatile const void *ptr, void *pValueRead);
epicsShareFunc long devReadProbe (
unsigned wordSize, volatile const void *ptr, void *pValueRead);
/*
* devNoResponseProbe()
@@ -73,7 +75,7 @@ long devReadProbe (unsigned wordSize, volatile const void *ptr, void *pValueRead
* Checks all naturally aligned word sizes between char and long for
* the entire specified range of bytes.
*/
long devNoResponseProbe(
epicsShareFunc long devNoResponseProbe(
epicsAddressType addrType,
size_t base,
size_t size
@@ -85,16 +87,17 @@ long devNoResponseProbe(
* a bus error safe "wordSize" write at the specified address which returns
* unsuccessful status if the device isnt present
*/
long devWriteProbe (unsigned wordSize, volatile void *ptr, const void *pValueWritten);
epicsShareFunc long devWriteProbe (
unsigned wordSize, volatile void *ptr, const void *pValueWritten);
long devRegisterAddress(
epicsShareFunc long devRegisterAddress(
const char *pOwnerName,
epicsAddressType addrType,
size_t logicalBaseAddress,
size_t size, /* bytes */
volatile void **pPhysicalAddress);
long devUnregisterAddress(
epicsShareFunc long devUnregisterAddress(
epicsAddressType addrType,
size_t logicalBaseAddress,
const char *pOwnerName);
@@ -102,7 +105,7 @@ long devUnregisterAddress(
/*
* allocate and register an unoccupied address block
*/
long devAllocAddress(
epicsShareFunc long devAllocAddress(
const char *pOwnerName,
epicsAddressType addrType,
size_t size,
@@ -112,7 +115,7 @@ long devAllocAddress(
/*
* connect ISR to a VME interrupt vector
*/
long devConnectInterruptVME(
epicsShareFunc long devConnectInterruptVME(
unsigned vectorNumber,
void (*pFunction)(void *),
void *parameter);
@@ -122,7 +125,7 @@ long devConnectInterruptVME(
* (not implemented)
* (API should be reviewed)
*/
long devConnectInterruptISA(
epicsShareFunc long devConnectInterruptISA(
unsigned interruptLevel,
void (*pFunction)(void *),
void *parameter);
@@ -132,7 +135,7 @@ long devConnectInterruptISA(
* (not implemented)
* (API should be reviewed)
*/
long devConnectInterruptPCI(
epicsShareFunc long devConnectInterruptPCI(
unsigned bus,
unsigned device,
unsigned function,
@@ -146,7 +149,7 @@ long devConnectInterruptPCI(
* was connected. It is used as a key to prevent a driver from inadvertently
* removing an interrupt handler that it didn't install
*/
long devDisconnectInterruptVME(
epicsShareFunc long devDisconnectInterruptVME(
unsigned vectorNumber,
void (*pFunction)(void *));
@@ -159,7 +162,7 @@ long devDisconnectInterruptVME(
* was connected. It is used as a key to prevent a driver from inadvertently
* removing an interrupt handler that it didn't install
*/
long devDisconnectInterruptISA(
epicsShareFunc long devDisconnectInterruptISA(
unsigned interruptLevel,
void (*pFunction)(void *));
@@ -172,7 +175,7 @@ long devDisconnectInterruptISA(
* was connected. It is used as a key to prevent a driver from inadvertently
* removing an interrupt handler that it didn't install
*/
long devDisconnectInterruptPCI(
epicsShareFunc long devDisconnectInterruptPCI(
unsigned bus,
unsigned device,
unsigned function,
@@ -183,7 +186,7 @@ long devDisconnectInterruptPCI(
*
* returns boolean
*/
int devInterruptInUseVME (unsigned vectorNumber);
epicsShareFunc int devInterruptInUseVME (unsigned vectorNumber);
/*
* determine if an ISA interrupt level is in use
@@ -191,7 +194,7 @@ int devInterruptInUseVME (unsigned vectorNumber);
*
* returns boolean
*/
int devInterruptLevelInUseISA (unsigned interruptLevel);
epicsShareFunc int devInterruptLevelInUseISA (unsigned interruptLevel);
/*
* determine if a PCI interrupt is in use
@@ -199,7 +202,7 @@ int devInterruptLevelInUseISA (unsigned interruptLevel);
*
* returns boolean
*/
int devInterruptInUsePCI (unsigned bus, unsigned device,
epicsShareFunc int devInterruptInUsePCI (unsigned bus, unsigned device,
unsigned function);
typedef enum {intVME, intVXI, intISA} epicsInterruptType;
@@ -207,42 +210,42 @@ typedef enum {intVME, intVXI, intISA} epicsInterruptType;
/*
* enable VME interrupt level
*/
long devEnableInterruptLevelVME (unsigned level);
epicsShareFunc long devEnableInterruptLevelVME (unsigned level);
/*
* enable ISA interrupt level
*/
long devEnableInterruptLevelISA (unsigned level);
epicsShareFunc long devEnableInterruptLevelISA (unsigned level);
/*
* not implemented - API needs to be reviewed
*/
long devEnableInterruptLevelPCI (unsigned level,
epicsShareFunc long devEnableInterruptLevelPCI (unsigned level,
unsigned bus, unsigned device, unsigned function);
/*
* disable VME interrupt level
*/
long devDisableInterruptLevelVME (unsigned level);
epicsShareFunc long devDisableInterruptLevelVME (unsigned level);
/*
* disable ISA interrupt level
*/
long devDisableInterruptLevelISA (unsigned level);
epicsShareFunc long devDisableInterruptLevelISA (unsigned level);
/*
* not implemented - API needs to be reviewed
*/
long devDisableInterruptLevelPCI (unsigned level,
epicsShareFunc long devDisableInterruptLevelPCI (unsigned level,
unsigned bus, unsigned device, unsigned function);
/*
* Routines to allocate and free memory in the A24 memory region.
*
*/
void *devLibA24Malloc(size_t);
void *devLibA24Calloc(size_t);
void devLibA24Free(void *pBlock);
epicsShareFunc void *devLibA24Malloc(size_t);
epicsShareFunc void *devLibA24Calloc(size_t);
epicsShareFunc void devLibA24Free(void *pBlock);
/*
* Normalize a digital value and convert it to type TYPE
@@ -327,7 +330,7 @@ typedef struct devLibVirtualOS {
void (*pDevA24Free)(void *pBlock);
long (*pDevInit)(void);
}devLibVirtualOS;
extern devLibVirtualOS *pdevLibVirtualOS;
epicsShareExtern devLibVirtualOS *pdevLibVirtualOS;
/*
* error codes (and messages) associated with devLib.c
@@ -378,7 +381,7 @@ extern devLibVirtualOS *pdevLibVirtualOS;
* devConnectInterruptISA etc. devConnectInterrupt will be removed
* in a future release.
*/
long devConnectInterrupt(
epicsShareFunc long devConnectInterrupt(
epicsInterruptType intType,
unsigned vectorNumber,
void (*pFunction)(void *),
@@ -392,10 +395,10 @@ long devConnectInterrupt(
* devDisconnectInterruptISA etc. devDisconnectInterrupt will be removed
* in a future release.
*/
long devDisconnectInterrupt(
epicsShareFunc long devDisconnectInterrupt(
epicsInterruptType intType,
unsigned vectorNumber,
void (*pFunction)(void *));
void (*pFunction)(void *));
/*
* NOTE: this routine has been deprecated. It exists
@@ -405,7 +408,8 @@ long devDisconnectInterrupt(
* devEnableInterruptLevelISA etc. devEnableInterruptLevel will be removed
* in a future release.
*/
long devEnableInterruptLevel(epicsInterruptType intType, unsigned level);
epicsShareFunc long devEnableInterruptLevel(
epicsInterruptType intType, unsigned level);
/*
* NOTE: this routine has been deprecated. It exists
@@ -415,7 +419,8 @@ long devEnableInterruptLevel(epicsInterruptType intType, unsigned level);
* devDisableInterruptLevelPCI etc. devDisableInterruptLevel will be removed
* in a future release.
*/
long devDisableInterruptLevel (epicsInterruptType intType, unsigned level);
epicsShareFunc long devDisableInterruptLevel (
epicsInterruptType intType, unsigned level);
/*
* NOTE: this routine has been deprecated. It exists
@@ -424,7 +429,7 @@ long devDisableInterruptLevel (epicsInterruptType intType, unsigned level);
* Please use devNoResponseProbe(). locationProbe() will be removed
* in a future release.
*/
long locationProbe (epicsAddressType addrType, char *pLocation);
epicsShareFunc long locationProbe (epicsAddressType addrType, char *pLocation);
/*
* Some vxWorks convenience routines

View File

@@ -131,22 +131,16 @@ epicsEventWaitWithTimeout(epicsEventId id, double timeOut)
{
rtems_id sid = (rtems_id)id;
rtems_status_code sc;
uint32_t wait;
rtems_interval delay;
extern double rtemsTicksPerSecond_double;
if (timeOut <= 0.0)
return epicsEventTryWait(id);
SEMSTAT(1)
if (timeOut <= 0.0) {
wait = RTEMS_NO_WAIT;
delay = 0;
}
else {
wait = RTEMS_WAIT;
delay = timeOut * rtemsTicksPerSecond_double;
if (delay == 0)
delay++;
}
sc = rtems_semaphore_obtain (sid, wait, delay);
delay = timeOut * rtemsTicksPerSecond_double;
if (delay == 0)
delay++;
sc = rtems_semaphore_obtain (sid, RTEMS_WAIT, delay);
if (sc == RTEMS_SUCCESSFUL)
return epicsEventWaitOK;
else if (sc == RTEMS_TIMEOUT)

View File

@@ -6,10 +6,6 @@
\*************************************************************************/
/*
* This header fragment is intended to be included as part of epicsString.h
* epicsStrtod() for systems with working strtod() routine
*/
/*
* epicsStrtod() for systems with broken strtod() routine
*/
epicsShareFunc double epicsStrtod(const char *str, char **endp);
#define epicsStrtod strtod

View File

@@ -104,6 +104,9 @@ int epicsTime_localtime ( const time_t *clock, struct tm *result )
}
}
rtems_interval rtemsTicksPerSecond;
double rtemsTicksPerSecond_double, rtemsTicksPerTwoSeconds_double;
} // extern "C"
/*
@@ -119,6 +122,11 @@ static int staticTimeRegister(void)
{
if (rtemsTicksPerSecond != 0)
osdTimeRegister();
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &rtemsTicksPerSecond);
rtemsTicksPerSecond_double = rtemsTicksPerSecond;
rtemsTicksPerTwoSeconds_double = rtemsTicksPerSecond_double * 2.0;
return 1;
}
static int done = staticTimeRegister();

View File

@@ -46,7 +46,9 @@ static void testEpicsSnprintf() {
for (size = 1; size < strlen(expected) + 5; ++size) {
rtn = epicsSnprintf(buffer, size, format, ivalue, fvalue, svalue);
testOk(rtn == rlen-1, "epicsSnprintf(size=%d) = %d", size, rtn);
testOk(rtn <= rlen-1, "epicsSnprintf(size=%d) = %d", size, rtn);
if (rtn != rlen-1)
testDiag("Return value does not indicate buffer size needed");
testOk(strncmp(buffer, expected, size - 1) == 0,
"buffer = '%s'", buffer);
rtn = strlen(buffer);

View File

@@ -17,19 +17,19 @@ EPICS::Path - Path-handling utilities for EPICS tools
=head1 SYNOPSIS
use lib '@EPICS_BASE@/lib/perl';
use EPICS::Path;
use lib '@EPICS_BASE@/lib/perl';
use EPICS::Path;
my $dir = UnixPath('C:\Program Files\EPICS');
print LocalPath($dir), "\n";
print AbsPath('../lib', $dir);
my $dir = UnixPath('C:\Program Files\EPICS');
print LocalPath($dir), "\n";
print AbsPath('../lib', $dir);
=head1 DESCRIPTION
C<EPICS::Path> provides functions for processing pathnames that are
commonly needed by EPICS tools. Windows is not the only culprit, some
older automount daemons insert strange prefixes into absolute directory
paths that we have to remove before storing the result for use later.
C<EPICS::Path> provides functions for processing pathnames that are commonly
needed by EPICS tools. Windows is not the only culprit, some older automount
daemons insert strange prefixes into absolute directory paths that we have to
remove before storing the result for use later.
=head1 FUNCTIONS
@@ -38,12 +38,11 @@ paths that we have to remove before storing the result for use later.
=item UnixPath( I<PATH> )
C<UnixPath> should be used on any pathnames provided by external
tools to convert them into a form that Perl understands.
C<UnixPath> should be used on any pathnames provided by external tools to
convert them into a form that Perl understands.
On cygwin we convert Windows drive specs to the equivalent cygdrive
path, and on Windows we switch directory separators from back-slash
to forward slashes.
On cygwin we convert Windows drive specs to the equivalent cygdrive path, and on
Windows we switch directory separators from back-slash to forward slashes.
=cut
@@ -60,16 +59,14 @@ sub UnixPath {
=item LocalPath( I<PATH> )
C<LocalPath> should be used when generating pathnames for external
tools or to put into a file. It converts paths from the Unix form
that Perl understands to any necessary external representation, and
also removes automounter prefixes to put the path into its canonical
form.
C<LocalPath> should be used when generating pathnames for external tools or to
put into a file. It converts paths from the Unix form that Perl understands to
any necessary external representation, and also removes automounter prefixes to
put the path into its canonical form.
On cygwin we convert cygdrive paths to their equivalent Windows
drive specs. Before Leopard, the Mac OS X automounter inserted a
verbose prefix, and in case anyone is still using SunOS it adds its
own prefix as well.
On cygwin we convert cygdrive paths to their equivalent Windows drive specs.
Before Leopard, the Mac OS X automounter inserted a verbose prefix, and in case
anyone is still using SunOS it adds its own prefix as well.
=cut
@@ -91,17 +88,15 @@ sub LocalPath {
=item AbsPath( I<PATH>, I<CWD> )
The C<abs_path()> function in Perl's C<Cwd> module doesn't like
non-existent path components other than in the final position, but
EPICS tools needs to be able to handle them in paths like
F<$(TOP)/lib/$(T_A)> before the F<$(TOP)/lib> directory has been
created.
The C<abs_path()> function in Perl's C<Cwd> module doesn't like non-existent
path components other than in the final position, but EPICS tools needs to be
able to handle them in paths like F<$(TOP)/lib/$(T_A)> before the F<$(TOP)/lib>
directory has been created.
C<AbsPath> takes a path I<PATH> and optionally an absolute path to a
directory that first is relative to; if the second argument is not
provided the current working directory is used. The result returned
has been filtered through C<LocalPath()> to remove any automounter
prefixes.
C<AbsPath> takes a path I<PATH> and optionally an absolute path to a directory
that first is relative to; if the second argument is not provided the current
working directory is used. The result returned has been filtered through
C<LocalPath()> to remove any automounter prefixes.
=cut
@@ -118,7 +113,7 @@ sub AbsPath {
}
# Move leading ./ and ../ components from $path to $cwd
if (my ($dots, $not) = ($path =~ m[^ ( (?: \. \.? / )+ ) ( .* ) $]x)) {
if (my ($dots, $not) = ($path =~ m[^ ( (?: \. \.? /+ )+ ) ( .* ) $]x)) {
$cwd .= "/$dots";
$path = $not;
}