[anjuta/sdb-queries] symbol-db: Removed old code



commit 07e247023bdec7ba3e75c4a384ac2a5c896abad3
Author: Naba Kumar <naba gnome org>
Date:   Fri Jun 18 16:28:28 2010 +0300

    symbol-db: Removed old code

 plugins/symbol-db/benchmark/benchmark.c            |   55 +-
 .../symbol-db/libgda-extra/gda-data-model-concat.c |  366 ---
 .../symbol-db/libgda-extra/gda-data-model-concat.h |   62 -
 plugins/symbol-db/symbol-db-engine-iterator-node.c |  502 ----
 plugins/symbol-db/symbol-db-engine-iterator-node.h |  104 -
 plugins/symbol-db/symbol-db-engine-iterator.c      |  412 ----
 plugins/symbol-db/symbol-db-engine-iterator.h      |  100 -
 plugins/symbol-db/symbol-db-engine-queries.c       | 2573 --------------------
 plugins/symbol-db/symbol-db-engine-queries.h       |  227 --
 plugins/symbol-db/symbol-db-engine-utils.c         |  236 --
 plugins/symbol-db/symbol-db-engine-utils.h         |   46 -
 plugins/symbol-db/symbol-db-iface.c                |  737 ------
 plugins/symbol-db/symbol-db-iface.h                |  190 --
 plugins/symbol-db/symbol-db-search-command.c       |  319 ---
 plugins/symbol-db/symbol-db-search-command.h       |   91 -
 plugins/symbol-db/symbol-db-view-search.c          |  705 ------
 plugins/symbol-db/symbol-db-view-search.h          |   75 -
 17 files changed, 54 insertions(+), 6746 deletions(-)
---
diff --git a/plugins/symbol-db/benchmark/benchmark.c b/plugins/symbol-db/benchmark/benchmark.c
index aa9925f..541c6d5 100644
--- a/plugins/symbol-db/benchmark/benchmark.c
+++ b/plugins/symbol-db/benchmark/benchmark.c
@@ -4,6 +4,59 @@
 #include "../symbol-db-engine.h"
 #include <gtk/gtk.h>
 
+static GPtrArray * 
+get_source_files_by_mime (const gchar* dir, const GHashTable *mimes)
+{
+	GPtrArray* files = g_ptr_array_new();
+	GFile *file;
+	GFileEnumerator *enumerator;
+	GFileInfo* info;
+	GError *error = NULL;
+	gchar *buildable_dir;
+
+	g_return_val_if_fail (dir != NULL, NULL);
+	g_return_val_if_fail (mimes != NULL, NULL);
+		
+	if ((file = g_file_new_for_commandline_arg (dir)) == NULL)
+		return NULL;
+		
+	enumerator = g_file_enumerate_children (file, 
+			G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
+			G_FILE_ATTRIBUTE_STANDARD_NAME,
+			G_FILE_QUERY_INFO_NONE,
+			NULL, &error);
+	
+	if (!enumerator)
+	{
+		g_warning ("Could not enumerate: %s %s\n", 
+				g_file_get_path (file),
+				error->message);
+		g_error_free (error);
+		g_object_unref (file);
+		return files;
+	}
+
+	buildable_dir = g_file_get_path (file);
+		
+	for (info = g_file_enumerator_next_file (enumerator, NULL, NULL); info != NULL; 
+			info = g_file_enumerator_next_file (enumerator, NULL, NULL))
+	{
+		const gchar *mime_type = g_file_info_get_content_type (info);
+		if (!mime_type)
+			continue;
+		if (g_hash_table_lookup ((GHashTable*)mimes, mime_type) != NULL)
+		{
+			g_ptr_array_add (files, g_build_filename (buildable_dir, g_file_info_get_name (info), NULL));
+		}
+	}
+
+	g_free (buildable_dir);
+	g_object_unref (enumerator);
+	g_object_unref (file);
+		
+	return files;
+}
+
 static void on_single_file_scan_end (SymbolDBEngine* engine, GPtrArray* files)
 {
 	static int i = 0;
@@ -65,7 +118,7 @@ int main (int argc, char** argv)
 	g_hash_table_insert (mimes, "text/x-c++src", "text/x-c++src");
 	g_hash_table_insert (mimes, "text/x-c+++hdr", "text/x-c++hdr");
 	
-	files = symbol_db_util_get_source_files_by_mime (root_dir, mimes);
+	files = get_source_files_by_mime (root_dir, mimes);
 	g_hash_table_destroy (mimes);
 
 	for (i = 0; i < files->len; i++)
diff --git a/plugins/symbol-db/symbol-db-engine-utils.c b/plugins/symbol-db/symbol-db-engine-utils.c
index 9004d21..88fc10a 100644
--- a/plugins/symbol-db/symbol-db-engine-utils.c
+++ b/plugins/symbol-db/symbol-db-engine-utils.c
@@ -272,239 +272,3 @@ symbol_db_util_get_pixbuf  (const gchar *node_type, const gchar *node_access)
 	
 	return pix;
 }
-
-gboolean
-symbol_db_util_is_pattern_exact_match (const gchar *pattern)
-{
-	gint i;
-	g_return_val_if_fail (pattern != NULL, FALSE);
-	gint str_len = strlen (pattern);
-	gboolean found_sequence = FALSE;
-	gint count = 0;
-	
-	for (i = 0; i < str_len; i++)
-	{
-		gchar c = pattern[i];
-		gint j = i;
-		
-		while (c == '%')
-		{
-			found_sequence = TRUE;
-			count++;
-			/* grab the next one */
-			if (j + 1 < str_len)
-			{				
-				c = pattern[j+1];
-				j++;
-			}
-			else 
-			{
-				break;
-			}			
-		}
-		
-		if (found_sequence)
-			break;
-	}
-
-	return (count % 2 == 1) ? FALSE : TRUE;
-}
-
-GPtrArray *
-symbol_db_util_fill_type_array (SymType match_types)
-{
-	GPtrArray *filter_array;
-	filter_array = g_ptr_array_new ();
-
-	if (match_types & IANJUTA_SYMBOL_TYPE_CLASS)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("class"));
-	}
-
-	if (match_types & IANJUTA_SYMBOL_TYPE_ENUM)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("enum"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_ENUMERATOR)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("enumerator"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_FIELD)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("field"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_FUNCTION)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("function"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_INTERFACE)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("interface"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_MEMBER)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("member"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_METHOD)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("method"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_NAMESPACE)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("namespace"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_PACKAGE)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("package"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_PROTOTYPE)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("prototype"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_STRUCT)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("struct"));
-	}
-
-	if (match_types & IANJUTA_SYMBOL_TYPE_TYPEDEF)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("typedef"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_STRUCT)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("struct"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_UNION)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("union"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_VARIABLE)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("variable"));
-	}
-				
-	if (match_types & IANJUTA_SYMBOL_TYPE_EXTERNVAR)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("externvar"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_MACRO)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("macro"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_MACRO_WITH_ARG)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("macro_with_arg"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_FILE)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("file"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_VARIABLE)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("variable"));
-	}
-	
-	if (match_types & IANJUTA_SYMBOL_TYPE_OTHER)
-	{
-		g_ptr_array_add (filter_array, g_strdup ("other"));
-	}
-
-	return filter_array;
-}
-
-const GHashTable*
-symbol_db_util_get_sym_type_conversion_hash (SymbolDBEngine *dbe)
-{
-	SymbolDBEnginePriv *priv;
-	g_return_val_if_fail (dbe != NULL, NULL);
-	
-	priv = dbe->priv;
-		
-	return priv->sym_type_conversion_hash;
-}
-
-GPtrArray* 
-symbol_db_util_get_c_source_files (const gchar* dir)
-{
-	GHashTable *mimes;
-	GPtrArray *res;
-
-	mimes = g_hash_table_new (g_str_hash, g_str_equal);
-	g_hash_table_insert (mimes, "text/x-csrc", "text/x-csrc");
-	g_hash_table_insert (mimes, "text/x-chdr", "text/x-chdr");
-
-	res = symbol_db_util_get_source_files_by_mime (dir, mimes);
-	
-	g_hash_table_destroy (mimes);
-	return res;
-}
-
-GPtrArray * 
-symbol_db_util_get_source_files_by_mime (const gchar* dir, const GHashTable *mimes)
-{
-	GPtrArray* files = g_ptr_array_new();
-	GFile *file;
-	GFileEnumerator *enumerator;
-	GFileInfo* info;
-	GError *error = NULL;
-	gchar *buildable_dir;
-
-	g_return_val_if_fail (dir != NULL, NULL);
-	g_return_val_if_fail (mimes != NULL, NULL);
-		
-	if ((file = g_file_new_for_commandline_arg (dir)) == NULL)
-		return NULL;
-		
-	enumerator = g_file_enumerate_children (file, 
-			G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
-			G_FILE_ATTRIBUTE_STANDARD_NAME,
-			G_FILE_QUERY_INFO_NONE,
-			NULL, &error);
-	
-	if (!enumerator)
-	{
-		g_warning ("Could not enumerate: %s %s\n", 
-				g_file_get_path (file),
-				error->message);
-		g_error_free (error);
-		g_object_unref (file);
-		return files;
-	}
-
-	buildable_dir = g_file_get_path (file);
-		
-	for (info = g_file_enumerator_next_file (enumerator, NULL, NULL); info != NULL; 
-			info = g_file_enumerator_next_file (enumerator, NULL, NULL))
-	{
-		const gchar *mime_type = g_file_info_get_content_type (info);
-		if (!mime_type)
-			continue;
-		if (g_hash_table_lookup ((GHashTable*)mimes, mime_type) != NULL)
-		{
-			g_ptr_array_add (files, g_build_filename (buildable_dir, g_file_info_get_name (info), NULL));
-		}
-	}
-
-	g_free (buildable_dir);
-	g_object_unref (enumerator);
-	g_object_unref (file);
-		
-	return files;
-}
diff --git a/plugins/symbol-db/symbol-db-engine-utils.h b/plugins/symbol-db/symbol-db-engine-utils.h
index 604b708..a02705c 100644
--- a/plugins/symbol-db/symbol-db-engine-utils.h
+++ b/plugins/symbol-db/symbol-db-engine-utils.h
@@ -60,19 +60,6 @@ symbol_db_util_get_full_local_path (SymbolDBEngine *dbe, const gchar* db_file);
 const gchar *
 symbol_db_util_get_file_db_path (SymbolDBEngine *dbe, const gchar* full_local_file_path);
 
-/** 
- * Hash table that converts from a char like 'class' 'struct' etc to an 
- * IANJUTA_SYMBOL_TYPE
- */
-const GHashTable *
-symbol_db_util_get_sym_type_conversion_hash (SymbolDBEngine *dbe);
-
-/**
- * @return a GPtrArray that must be freed from caller.
- */
-GPtrArray *
-symbol_db_util_fill_type_array (SymType match_types);
-
 /**
  * Try to get all the files with zero symbols: these should be the ones
  * excluded by an abort on population process.
@@ -89,37 +76,4 @@ symbol_db_util_get_files_with_zero_symbols (SymbolDBEngine *dbe);
 const GdkPixbuf *
 symbol_db_util_get_pixbuf  (const gchar *node_type, const gchar *node_access);
 
-/**
- * @param pattern The pattern you want to test to check if it's an exact pattern 
- * or not. An exact pattern can be "foo_function", while a LIKE pattern can be
- * "foo_func%". You can escape the '%' by prefixing it with another '%', e.g. 
- * "strange_search_%%_yeah"
- */
-gboolean
-symbol_db_util_is_pattern_exact_match (const gchar *pattern);
-
-/**
- * This function gets all the .c/.h source files in the specified dir and returns
- * the GPtrArray associated.
- * 
- * @param dir Directory of the files
- * @return A GPtrArray composed by gchar * strings like "dir + g_file_info_get_name ()"
- */
-GPtrArray * 
-symbol_db_util_get_c_source_files (const gchar* dir);
-
-/**
- * This function gets all the source files in the specified dir that match mime type
- * specified in the hashtable and returns the GPtrArray associated.
- * 
- * @param dir Directory of the files
- * @param mimes Hash table where the keys must be the mimes of the source files.
- * for convenience set the values to the same value of the keys.
- * @return A GPtrArray composed by gchar * strings like "dir + g_file_info_get_name ()"
- */
-GPtrArray * 
-symbol_db_util_get_source_files_by_mime (const gchar* dir, const GHashTable *mimes);
-
-
-
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]