You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/09/08 11:03:17 UTC

svn commit: r812404 - in /commons/sandbox/runtime/trunk/src/main/native: Makefile.in Makefile.msc.in include/acr.h include/acr_port.h

Author: mturk
Date: Tue Sep  8 09:03:16 2009
New Revision: 812404

URL: http://svn.apache.org/viewvc?rev=812404&view=rev
Log:
Add base and dirname function to the port API

Modified:
    commons/sandbox/runtime/trunk/src/main/native/Makefile.in
    commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in
    commons/sandbox/runtime/trunk/src/main/native/include/acr.h
    commons/sandbox/runtime/trunk/src/main/native/include/acr_port.h

Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.in?rev=812404&r1=812403&r2=812404&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.in (original)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.in Tue Sep  8 09:03:16 2009
@@ -210,6 +210,8 @@
 	$(SRCDIR)/os/hpux/os.$(OBJ)
 
 PPORT_OBJS=\
+	$(SRCDIR)/port/basename.$(OBJ) \
+	$(SRCDIR)/port/dirname.$(OBJ) \
 	$(SRCDIR)/port/fnmatch.$(OBJ) \
 	$(SRCDIR)/port/rijndael.$(OBJ) \
 	$(SRCDIR)/port/pmatch.$(OBJ) \

Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in?rev=812404&r1=812403&r2=812404&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in (original)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in Tue Sep  8 09:03:16 2009
@@ -130,6 +130,8 @@
 	$(SRCDIR)/os/win32/wusec.$(OBJ)
 
 PPORT_OBJS=\
+	$(SRCDIR)/port/basename.$(OBJ) \
+	$(SRCDIR)/port/dirname.$(OBJ) \
 	$(SRCDIR)/port/fnmatch.$(OBJ) \
 	$(SRCDIR)/port/rijndael.$(OBJ) \
 	$(SRCDIR)/port/pmatch.$(OBJ) \

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr.h?rev=812404&r1=812403&r2=812404&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr.h Tue Sep  8 09:03:16 2009
@@ -222,6 +222,7 @@
 typedef  HANDLE             acr_osd_t;
 #define ACR_INT64_C(val)   (val##I64)
 #define ACR_UINT64_C(val)  (val##UI64)
+#define ACR_PPATH_MAX       1024
 #else /* !_MSC_VER */
 typedef  ssize_t            acr_ssize_t;
 #ifdef _LP64 /* 64-bit Solaris */
@@ -251,6 +252,7 @@
 #define ACR_INT64_C(val)   (val##LL)
 #define ACR_UINT64_C(val)  (val##ULL)
 #endif
+#define ACR_PPATH_MAX       PATH_MAX
 #endif /* _MSC_VER */
 
 #if CC_SIZEOF_VOIDP == 8

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_port.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_port.h?rev=812404&r1=812403&r2=812404&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr_port.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr_port.h Tue Sep  8 09:03:16 2009
@@ -43,6 +43,17 @@
  * Function prototypes for the portable layer
  */
 
+/**
+ * Reentrant version of dirname.
+ * If buffer is NULL it uses static buffer.
+ */
+char *dirname_r(const char *, char *, size_t);
+/**
+ * Reentrant version of basename
+ * If buffer is NULL it uses static buffer.
+ */
+char *basename_r(const char *, char *, size_t);
+
 #if defined(ACR_WANT_STRSIGNAL)
 char *strsignal(int);
 #endif
@@ -65,7 +76,8 @@
  *  Return 1 on substring match.
  *  Return 0 on no match.
  *  Return -1 on error.
- * *estr will point to the end of the longest exact or substring match.
+ * *estr will point to the end of the longest exact or substring match
+ * *estr can be NULL if end pointer is not needed.
  */
 #define ACR_PMATCH_NONE     0
 #define ACR_PMATCH_SUBSTR   1