[GRASS-SVN] r34423 - grass/branches/develbranch_6/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 21 09:01:38 EST 2008


Author: neteler
Date: 2008-11-21 09:01:38 -0500 (Fri, 21 Nov 2008)
New Revision: 34423

Modified:
   grass/branches/develbranch_6/lib/gis/ls.c
Log:
glynn: Add G_set_ls_exclude_filter() (merge from trunk, #34405)

Modified: grass/branches/develbranch_6/lib/gis/ls.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/ls.c	2008-11-21 13:42:08 UTC (rev 34422)
+++ grass/branches/develbranch_6/lib/gis/ls.c	2008-11-21 14:01:38 UTC (rev 34423)
@@ -33,6 +33,9 @@
 static ls_filter_func *ls_filter;
 static void *ls_closure;
 
+static ls_filter_func *ls_ex_filter;
+static void *ls_ex_closure;
+
 static int cmp_names(const void *aa, const void *bb)
 {
     char *const *a = (char *const *)aa;
@@ -60,6 +63,12 @@
     ls_closure = closure;
 }
 
+void G_set_ls_exclude_filter(ls_filter_func *func, void *closure)
+{
+    ls_ex_filter = func;
+    ls_ex_closure = closure;
+}
+
 /**
  * \brief Stores a sorted directory listing in an array
  * 
@@ -91,6 +100,8 @@
 	    continue;
 	if (ls_filter && !(*ls_filter)(dp->d_name, ls_closure))
 	    continue;
+	if (ls_ex_filter && (*ls_ex_filter)(dp->d_name, ls_ex_closure))
+	    continue;
 	dir_listing = (char **)G_realloc(dir_listing, (1 + n) * sizeof(char *));
 	dir_listing[n] = G_store(dp->d_name);
 	n++;



More information about the grass-commit mailing list