[anjuta] symbol-db: Removed more dead code
- From: Naba Kumar <naba src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] symbol-db: Removed more dead code
- Date: Mon, 10 May 2010 22:34:57 +0000 (UTC)
commit 46666dca1b7813c73b7caa06419a5bae79749fd1
Author: Naba Kumar <naba gnome org>
Date: Tue May 11 01:13:55 2010 +0300
symbol-db: Removed more dead code
plugins/symbol-db/symbol-db-engine-core.c | 8 -
plugins/symbol-db/symbol-db-engine-priv.h | 2 -
plugins/symbol-db/symbol-db-engine-queries.c | 372 --------------------------
plugins/symbol-db/symbol-db-engine-queries.h | 28 --
4 files changed, 0 insertions(+), 410 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-engine-core.c b/plugins/symbol-db/symbol-db-engine-core.c
index 1d37a5b..366bbb4 100644
--- a/plugins/symbol-db/symbol-db-engine-core.c
+++ b/plugins/symbol-db/symbol-db-engine-core.c
@@ -2499,10 +2499,6 @@ sdb_engine_init (SymbolDBEngine * object)
FALSE);
DYN_QUERY_POPULATE_INIT_NODE(sdbe->priv->dyn_query_list,
- DYN_PREP_QUERY_GET_SCOPE_MEMBERS,
- FALSE);
-
- DYN_QUERY_POPULATE_INIT_NODE(sdbe->priv->dyn_query_list,
DYN_PREP_QUERY_GET_CURRENT_SCOPE,
FALSE);
@@ -2531,10 +2527,6 @@ sdb_engine_init (SymbolDBEngine * object)
TRUE);
DYN_QUERY_POPULATE_INIT_NODE(sdbe->priv->dyn_query_list,
- DYN_PREP_QUERY_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED,
- TRUE);
-
- DYN_QUERY_POPULATE_INIT_NODE(sdbe->priv->dyn_query_list,
DYN_PREP_QUERY_GET_FILES_FOR_PROJECT,
TRUE);
diff --git a/plugins/symbol-db/symbol-db-engine-priv.h b/plugins/symbol-db/symbol-db-engine-priv.h
index 8c5cc95..b15ec5c 100644
--- a/plugins/symbol-db/symbol-db-engine-priv.h
+++ b/plugins/symbol-db/symbol-db-engine-priv.h
@@ -198,7 +198,6 @@ typedef struct _static_query_node
typedef enum {
DYN_PREP_QUERY_GET_CLASS_PARENTS = 0,
DYN_PREP_QUERY_GET_CLASS_PARENTS_BY_SYMBOL_ID,
- DYN_PREP_QUERY_GET_SCOPE_MEMBERS,
DYN_PREP_QUERY_GET_CURRENT_SCOPE,
DYN_PREP_QUERY_GET_SYMBOL_INFO_BY_ID,
DYN_PREP_QUERY_FIND_SYMBOL_NAME_BY_PATTERN,
@@ -206,7 +205,6 @@ typedef enum {
DYN_PREP_QUERY_FIND_SYMBOL_BY_NAME_PATTERN_FILE,
DYN_PREP_QUERY_FIND_SYMBOL_IN_SCOPE,
DYN_PREP_QUERY_GET_SCOPE_MEMBERS_BY_SYMBOL_ID,
- DYN_PREP_QUERY_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED,
DYN_PREP_QUERY_GET_FILES_FOR_PROJECT,
DYN_PREP_QUERY_COUNT
diff --git a/plugins/symbol-db/symbol-db-engine-queries.c b/plugins/symbol-db/symbol-db-engine-queries.c
index fa33910..71c0b9d 100644
--- a/plugins/symbol-db/symbol-db-engine-queries.c
+++ b/plugins/symbol-db/symbol-db-engine-queries.c
@@ -539,260 +539,6 @@ symbol_db_engine_get_class_parents (SymbolDBEngine *dbe, const gchar *klass_name
priv->project_directory);
}
-/**
- * Personalized GTree mapping:
- * Considering that a gint on a x86 is 4 bytes: we'll reserve:
- * 3 bytes to map the main parameters.
- * 1 byte is for filter_kinds number, so you'll be able to filter up to 255 parameters.
- * |--------------------------------|-------------|
- * main parameters [3 bytes] extra [1 byte]
- */
-#define DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED_EXTRA_PAR_LIMIT 0x0100
-#define DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED_EXTRA_PAR_OFFSET 0x0200
-#define DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED_EXTRA_PAR_INCLUDE_KINDS_YES 0x0400
-#define DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED_EXTRA_PAR_INCLUDE_KINDS_NO 0x0800
-
-SymbolDBEngineIterator *
-symbol_db_engine_get_scope_members_by_symbol_id_filtered (SymbolDBEngine *dbe,
- gint scope_parent_symbol_id,
- SymType filter_kinds,
- gboolean include_kinds,
- gint results_limit,
- gint results_offset,
- SymExtraInfo sym_info)
-{
- SymbolDBEnginePriv *priv;
- gchar *query_str;
- GdaDataModel *data;
- GString *info_data;
- GString *join_data;
- GString *filter_str;
- gchar *limit = "";
- gboolean limit_free = FALSE;
- gchar *offset = "";
- gboolean offset_free = FALSE;
- gint other_parameters;
- const DynChildQueryNode *dyn_node = NULL;
- GdaHolder *param;
- GValue *ret_value;
- gboolean ret_bool;
- GPtrArray *filter_kinds_array;
-
- g_return_val_if_fail (dbe != NULL, NULL);
- priv = dbe->priv;
-
- SDB_LOCK(priv);
-
- if (scope_parent_symbol_id <= 0)
- {
- SDB_UNLOCK(priv);
- return NULL;
- }
-
- /* syminfo kind is already included in results */
- sym_info = sym_info & ~SYMINFO_KIND;
-
- /* determine the filter_kinds thing */
- if (filter_kinds == SYMTYPE_UNDEF)
- filter_kinds_array = NULL;
- else
- filter_kinds_array = symbol_db_util_fill_type_array (filter_kinds);
-
- /* init parameters */
- other_parameters = 0;
-
- if (results_limit > 0)
- {
- limit = g_strdup_printf ("LIMIT ## /* name:'limit' type:gint */");
- limit_free = TRUE;
- other_parameters |=
- DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED_EXTRA_PAR_LIMIT;
- }
-
- if (results_offset > 0)
- {
- offset = g_strdup_printf ("OFFSET ## /* name:'offset' type:gint */");
- offset_free = TRUE;
- other_parameters |=
- DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED_EXTRA_PAR_OFFSET;
- }
-
- /* build filter string */
- if (include_kinds == TRUE)
- {
- other_parameters |=
- DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED_EXTRA_PAR_INCLUDE_KINDS_YES;
- }
- else
- {
- other_parameters |=
- DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED_EXTRA_PAR_INCLUDE_KINDS_NO;
- }
-
- /* we'll take into consideration the number of filter_kinds only it the number
- * is fillable in a byte.
- */
- if (filter_kinds_array != NULL && filter_kinds_array->len < 255
- && filter_kinds_array->len > 0)
- {
- /* set the number of parameters in the less important byte */
- other_parameters |= filter_kinds_array->len;
- }
-
- if ((dyn_node = sdb_engine_get_dyn_query_node_by_id (dbe,
- DYN_PREP_QUERY_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED, sym_info,
- other_parameters)) == NULL)
- {
- gint i;
-
- /* info_data contains the stuff after SELECT and befor FROM */
- info_data = g_string_new ("");
-
- /* join_data contains the optionals joins to do to retrieve new data on other
- * tables.
- */
- join_data = g_string_new ("");
-
- /* fill info_data and join data with optional sql */
- sdb_engine_prepare_symbol_info_sql (dbe, info_data, join_data, sym_info);
-
- filter_str = g_string_new ("");
- if (include_kinds == TRUE)
- {
- filter_str = g_string_append (filter_str ,
- "AND sym_kind.kind_name IN (## /* name:'filter0' type:gchararray */");
- }
- else
- {
- filter_str = g_string_append (filter_str ,
- "AND sym_kind.kind_name NOT IN (## /* name:'filter0' type:gchararray */");
- }
-
- for (i = 1; i < filter_kinds_array->len; i++)
- {
- g_string_append_printf (filter_str ,
- ",## /* name:'filter%d' type:gchararray */", i);
- }
- filter_str = g_string_append (filter_str , ")");
-
- /* ok, beware that we use an 'alias hack' to accomplish compatibility with
- * sdb_engine_prepare_symbol_info_sql () function. In particular we called
- * the first joining table 'a', the second one 'symbol', where there is the info we
- * want
- */
- query_str = g_strdup_printf ("SELECT symbol.symbol_id AS symbol_id, "
- "symbol.name AS name, "
- "symbol.file_position AS file_position, "
- "symbol.is_file_scope AS is_file_scope, symbol.signature AS signature, "
- "symbol.returntype AS returntype, "
- "sym_kind.kind_name AS kind_name %s "
- "FROM symbol a, symbol symbol "
- "%s JOIN sym_kind ON symbol.kind_id = sym_kind.sym_kind_id "
- "WHERE a.symbol_id = ## /* name:'scopeparentsymid' type:gint */ "
- "AND symbol.scope_id = a.scope_definition_id "
- "AND symbol.scope_id > 0 %s order by name %s %s", info_data->str, join_data->str,
- filter_str->str, limit, offset);
-
- dyn_node = sdb_engine_insert_dyn_query_node_by_id (dbe,
- DYN_PREP_QUERY_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED,
- sym_info, other_parameters,
- query_str);
-
- g_free (query_str);
- g_string_free (join_data, TRUE);
- g_string_free (info_data, TRUE);
- g_string_free (filter_str, TRUE);
- }
-
- if (limit_free)
- g_free (limit);
-
- if (offset_free)
- g_free (offset);
-
- if (dyn_node == NULL)
- {
- SDB_UNLOCK(priv);
- return NULL;
- }
-
- if (other_parameters & DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED_EXTRA_PAR_LIMIT)
- {
- if ((param = gda_set_get_holder ((GdaSet*)dyn_node->plist, "limit")) == NULL)
- {
- SDB_UNLOCK(priv);
- return NULL;
- }
-
- MP_SET_HOLDER_BATCH_INT(priv, param, results_limit, ret_bool, ret_value);
- }
-
- if (other_parameters & DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED_EXTRA_PAR_OFFSET)
- {
- if ((param = gda_set_get_holder ((GdaSet*)dyn_node->plist, "offset")) == NULL)
- {
- SDB_UNLOCK(priv);
- return NULL;
- }
-
- MP_SET_HOLDER_BATCH_INT(priv, param, results_offset, ret_bool, ret_value);
- }
-
- if (other_parameters &
- DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED_EXTRA_PAR_INCLUDE_KINDS_YES ||
- other_parameters &
- DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_FILTERED_EXTRA_PAR_INCLUDE_KINDS_NO)
- {
- gint i;
- for (i = 0; i < filter_kinds_array->len; i++)
- {
- gchar *curr_str = g_strdup_printf ("filter%d", i);
- param = gda_set_get_holder ((GdaSet*)dyn_node->plist, curr_str);
-
- MP_SET_HOLDER_BATCH_STR(priv, param, g_ptr_array_index (filter_kinds_array, i),
- ret_bool, ret_value);
- g_free (curr_str);
- }
- }
-
- if ((param = gda_set_get_holder ((GdaSet*)dyn_node->plist, "scopeparentsymid")) == NULL)
- {
- SDB_UNLOCK(priv);
- return NULL;
- }
-
- MP_SET_HOLDER_BATCH_INT(priv, param, scope_parent_symbol_id, ret_bool, ret_value);
-
-
- /* execute the query with parametes just set */
- data = gda_connection_statement_execute_select (priv->db_connection,
- (GdaStatement*)dyn_node->stmt,
- (GdaSet*)dyn_node->plist, NULL);
- MP_RESET_PLIST(dyn_node->plist);
-
- /* free the filter kinds, if it's not null */
- if (filter_kinds_array)
- {
- g_ptr_array_foreach (filter_kinds_array, (GFunc)g_free, NULL);
- g_ptr_array_free (filter_kinds_array, TRUE);
- }
-
- if (!GDA_IS_DATA_MODEL (data) ||
- gda_data_model_get_n_rows (GDA_DATA_MODEL (data)) <= 0)
- {
- if (data != NULL)
- g_object_unref (data);
-
- SDB_UNLOCK(priv);
- return NULL;
- }
-
- SDB_UNLOCK(priv);
- return (SymbolDBEngineIterator *)symbol_db_engine_iterator_new (data,
- priv->sym_type_conversion_hash,
- priv->project_directory);
-}
-
#define DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_EXTRA_PAR_LIMIT 1
#define DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_EXTRA_PAR_OFFSET 2
#define DYN_GET_SCOPE_MEMBERS_BY_SYMBOL_ID_EXTRA_PAR_FILE_PATH 4
@@ -1004,124 +750,6 @@ select b.* from symbol a, symbol b where a.symbol_id = 348 and
}
SymbolDBEngineIterator *
-symbol_db_engine_get_scope_members_by_path (SymbolDBEngine *dbe,
- const GPtrArray* scope_path,
- SymExtraInfo sym_info)
-{
-/*
-simple scope
-
-select * from symbol where scope_id = (
- select scope.scope_id from scope
- inner join sym_type on scope.type_id = sym_type.type_id
- where sym_type.type = 'class'
- and scope.scope_name = 'MyClass'
- );
-
-select * from symbol where scope_id = (
- select scope.scope_id from scope
- inner join sym_type on scope.type_id = sym_type.type_id
- where sym_type.type = 'struct'
- and scope.scope_name = '_faa_1');
-
-
-es. scope_path = First, namespace, Second, namespace, NULL,
- symbol_name = Second_1_class
-*/
- SymbolDBEnginePriv *priv;
- gchar *query_str;
- GdaDataModel *data;
- gint final_definition_id;
- GString *info_data;
- GString *join_data;
- GdaHolder *param;
- GValue *ret_value;
- gboolean ret_bool;
- const DynChildQueryNode *dyn_node;
-
- g_return_val_if_fail (dbe != NULL, NULL);
- priv = dbe->priv;
-
- SDB_LOCK(priv);
-
- final_definition_id = sdb_engine_walk_down_scope_path (dbe, scope_path);
-
- if (final_definition_id <= 0)
- {
- SDB_UNLOCK(priv);
- return NULL;
- }
-
- if ((dyn_node = sdb_engine_get_dyn_query_node_by_id (dbe,
- DYN_PREP_QUERY_GET_SCOPE_MEMBERS, sym_info, 0)) == NULL)
- {
- /* info_data contains the stuff after SELECT and befor FROM */
- info_data = g_string_new ("");
-
- /* join_data contains the optionals joins to do to retrieve new data on other
- * tables.
- */
- join_data = g_string_new ("");
-
- /* fill info_data and join data with optional sql */
- sdb_engine_prepare_symbol_info_sql (dbe, info_data, join_data, sym_info);
-
- query_str = g_strdup_printf ("SELECT symbol.symbol_id AS symbol_id, "
- "symbol.name AS name, symbol.file_position AS file_position, "
- "symbol.is_file_scope AS is_file_scope, symbol.signature AS signature, "
- "symbol.returntype AS returntype "
- "%s FROM symbol "
- "%s WHERE scope_id = ## /* name:'defid' type:gint */",
- info_data->str, join_data->str);
-
- dyn_node = sdb_engine_insert_dyn_query_node_by_id (dbe,
- DYN_PREP_QUERY_GET_SCOPE_MEMBERS,
- sym_info, 0,
- query_str);
-
- g_free (query_str);
- g_string_free (info_data, TRUE);
- g_string_free (join_data, TRUE);
- }
-
- if (dyn_node == NULL)
- {
- SDB_UNLOCK(priv);
- return NULL;
- }
-
- if ((param = gda_set_get_holder ((GdaSet*)dyn_node->plist, "defid")) == NULL)
- {
- SDB_UNLOCK(priv);
- return NULL;
- }
-
- MP_SET_HOLDER_BATCH_INT(priv, param, final_definition_id, ret_bool, ret_value);
-
- /* execute the query with parametes just set */
- data = gda_connection_statement_execute_select (priv->db_connection,
- (GdaStatement*)dyn_node->stmt,
- (GdaSet*)dyn_node->plist, NULL);
- MP_RESET_PLIST(dyn_node->plist);
-
- if (!GDA_IS_DATA_MODEL (data) ||
- gda_data_model_get_n_rows (data) <= 0)
- {
- if (data != NULL)
- g_object_unref (data);
-
- SDB_UNLOCK(priv);
- return NULL;
- }
-
-
- SDB_UNLOCK(priv);
- return (SymbolDBEngineIterator *)symbol_db_engine_iterator_new (data,
- priv->sym_type_conversion_hash,
- priv->project_directory);
-}
-
-SymbolDBEngineIterator *
symbol_db_engine_get_current_scope (SymbolDBEngine *dbe, const gchar* full_local_file_path,
gulong line, SymExtraInfo sym_info)
{
diff --git a/plugins/symbol-db/symbol-db-engine-queries.h b/plugins/symbol-db/symbol-db-engine-queries.h
index 658ce1f..19793a2 100644
--- a/plugins/symbol-db/symbol-db-engine-queries.h
+++ b/plugins/symbol-db/symbol-db-engine-queries.h
@@ -231,17 +231,6 @@ symbol_db_engine_get_scope_chain_by_file_line (SymbolDBEngine *dbe,
gulong line,
SymExtraInfo sym_info);
-
-/**
- * scope_path cannot be NULL.
- * scope_path will be something like "scope1_kind", "scope1_name", "scope2_kind",
- * "scope2_name", NULL
- */
-SymbolDBEngineIterator *
-symbol_db_engine_get_scope_members_by_path (SymbolDBEngine *dbe,
- const GPtrArray* scope_path,
- SymExtraInfo sym_info);
-
/**
* Sometimes it's useful going to query just with ids [and so integers] to have
* a little speed improvement.
@@ -257,23 +246,6 @@ symbol_db_engine_get_scope_members_by_symbol_id (SymbolDBEngine *dbe,
SymExtraInfo sym_info);
/**
- * A filtered version of the symbol_db_engine_get_scope_members_by_symbol_id ().
- * You can specify which kind of symbols to retrieve, and if to include them or exclude.
- * Kinds are 'namespace', 'class' etc.
- * @param filter_kinds Can be set to SYMTYPE_UNDEF. In that case these filters will not be taken into consideration.
- * @param results_limit Limit results to an upper bound. -1 If you don't want to use this par.
- * @param results_offset Skip results_offset results. -1 If you don't want to use this par.
- */
-SymbolDBEngineIterator *
-symbol_db_engine_get_scope_members_by_symbol_id_filtered (SymbolDBEngine *dbe,
- gint scope_parent_symbol_id,
- SymType filter_kinds,
- gboolean include_kinds,
- gint results_limit,
- gint results_offset,
- SymExtraInfo sym_info);
-
-/**
* Use this function to get infos about a symbol.
*/
SymbolDBEngineIterator *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]