[anjuta/cxxparser] symbol-db: added symbol_db_engine_get_parent_scope_by_symbol_id ().



commit 85aa790a76075ed4ebcf3f94b8adbcb53d37c116
Author: Massimo Corà <mcora src gnome org>
Date:   Sat Aug 1 12:31:52 2009 +0200

    symbol-db: added symbol_db_engine_get_parent_scope_by_symbol_id ().

 plugins/symbol-db/symbol-db-engine-queries.c |   17 +++++++++++++++++
 plugins/symbol-db/symbol-db-engine-queries.h |   15 +++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-engine-queries.c b/plugins/symbol-db/symbol-db-engine-queries.c
index 9711418..00d6b52 100644
--- a/plugins/symbol-db/symbol-db-engine-queries.c
+++ b/plugins/symbol-db/symbol-db-engine-queries.c
@@ -1949,6 +1949,23 @@ select * from symbol where scope_definition_id = (
 	return res;
 }
 
+SymbolDBEngineIterator *
+symbol_db_engine_get_parent_scope_by_symbol_id (SymbolDBEngine *dbe, 
+									gint scoped_symbol_id,
+									const gchar* db_file,
+    								SymExtraInfo sym_info)
+{
+	/* no need to lock */
+	gint parent_sym_id = symbol_db_engine_get_parent_scope_id_by_symbol_id (dbe,
+	    								scoped_symbol_id, db_file);
+
+	if (parent_sym_id < 0)
+		return NULL;
+	
+	/* get the info now */
+	return symbol_db_engine_get_symbol_info_by_id (dbe, parent_sym_id, sym_info);
+}
+
 static GdaDataModel *
 sdb_engine_get_symbol_info_by_id_1 (SymbolDBEngine *dbe, 
 									gint sym_id, SymExtraInfo sym_info)
diff --git a/plugins/symbol-db/symbol-db-engine-queries.h b/plugins/symbol-db/symbol-db-engine-queries.h
index 33ef24c..28763c9 100644
--- a/plugins/symbol-db/symbol-db-engine-queries.h
+++ b/plugins/symbol-db/symbol-db-engine-queries.h
@@ -198,6 +198,21 @@ symbol_db_engine_get_parent_scope_id_by_symbol_id (SymbolDBEngine *dbe,
 									gint scoped_symbol_id,
 									const gchar* db_file);
 
+/** 
+ * This is the same version as symbol_db_engine_get_parent_scope_id_by_symbol_id () 
+ * but with an Iterator as return type. 
+ * It includes the calls to symbol_db_engine_get_parent_scope_id_by_symbol_id () and
+ * symbol_db_engine_get_symbol_info_by_id (). It's a sort of facade.
+ * @param scoped_symbol_id Symbol you want to know the parent of.
+ * @param db_file db-relative filename path. eg. /src/foo.c Can be NULL.
+ * @return NULL on error or if nothing is found as parent.
+ */
+SymbolDBEngineIterator *
+symbol_db_engine_get_parent_scope_by_symbol_id (SymbolDBEngine *dbe, 
+									gint scoped_symbol_id,
+									const gchar* db_file,
+    								SymExtraInfo sym_info);
+
 /**
  * Walk the path up to the root scope given a scoped_symbol_id parameter.
  * The returned iterator will be populated with SymbolDBEngineIteratorNode(s)



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