svn commit: trunk/uClibc/libc/misc/glob

psm at uclibc.org psm at uclibc.org
Thu Feb 16 01:11:23 UTC 2006


Author: psm
Date: 2006-02-15 17:10:52 -0800 (Wed, 15 Feb 2006)
New Revision: 14067

Log:
Change collated_compare/prefix_array to __x hidden, shrinks glob64 from 2352 to 2063

Modified:
   trunk/uClibc/libc/misc/glob/glob.c


Changeset:
Modified: trunk/uClibc/libc/misc/glob/glob.c
===================================================================
--- trunk/uClibc/libc/misc/glob/glob.c	2006-02-16 00:41:50 UTC (rev 14066)
+++ trunk/uClibc/libc/misc/glob/glob.c	2006-02-16 01:10:52 UTC (rev 14067)
@@ -44,6 +44,8 @@
 extern void (*__glob_closedir_hook) (__ptr_t stream) attribute_hidden;
 extern const char *(*__glob_readdir_hook) (__ptr_t stream) attribute_hidden;
 
+extern int __collated_compare (const __ptr_t a, const __ptr_t b) attribute_hidden;
+extern int __prefix_array (const char *dirname, char **array, size_t n, int add_slash) attribute_hidden;
 
 libc_hidden_proto(glob_pattern_p)
 #ifdef __GLOB64
@@ -88,12 +90,11 @@
     return 0;
 }
 libc_hidden_def(glob_pattern_p)
-#endif
 
 
 /* Do a collated comparison of A and B.  */
-static int
-collated_compare (const __ptr_t a, const __ptr_t b)
+int
+__collated_compare (const __ptr_t a, const __ptr_t b)
 {
   const char *const s1 = *(const char *const *) a;
   const char *const s2 = *(const char *const *) b;
@@ -114,8 +115,8 @@
    unless DIRNAME is just "/".  Each old element of ARRAY is freed.
    If ADD_SLASH is non-zero, allocate one character more than
    necessary, so that a slash can be appended later.  */
-static int
-prefix_array (const char *dirname, char **array, size_t n, int add_slash)
+int
+__prefix_array (const char *dirname, char **array, size_t n, int add_slash)
 {
   register size_t i;
   size_t dirlen = strlen (dirname);
@@ -145,6 +146,7 @@
 
   return 0;
 }
+#endif
 
 
 /* Like `glob', but PATTERN is a final pathname component,
@@ -407,7 +409,7 @@
 	    }
 
 	  /* Stick the directory on the front of each name.  */
-	  if (prefix_array (dirs.gl_pathv[i],
+	  if (__prefix_array (dirs.gl_pathv[i],
 			    &pglob->gl_pathv[oldcount],
 			    pglob->gl_pathc - oldcount,
 			    flags & GLOB_MARK))
@@ -467,7 +469,7 @@
       if (dirlen > 0)
 	{
 	  /* Stick the directory on the front of each name.  */
-	  if (prefix_array (dirname,
+	  if (__prefix_array (dirname,
 			    &pglob->gl_pathv[oldcount],
 			    pglob->gl_pathc - oldcount,
 			    flags & GLOB_MARK))
@@ -494,7 +496,7 @@
     /* Sort the vector.  */
     qsort ((__ptr_t) &pglob->gl_pathv[oldcount],
 	   pglob->gl_pathc - oldcount,
-	   sizeof (char *), (__compar_fn_t)collated_compare);
+	   sizeof (char *), (__compar_fn_t)__collated_compare);
 
   return 0;
 }




More information about the uClibc-cvs mailing list