[anjuta] symbol-db: added symbol_db_engine_get_parent_scope_by_symbol_id ().
- From: Massimo Cora' <mcora src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [anjuta] symbol-db: added symbol_db_engine_get_parent_scope_by_symbol_id ().
- Date: Sat, 1 Aug 2009 12:55:38 +0000 (UTC)
commit cf420392e595ae00b17cbc8addadaa7a7ace3491
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 | 17 ++++++++++++++++-
2 files changed, 33 insertions(+), 1 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-engine-queries.c b/plugins/symbol-db/symbol-db-engine-queries.c
index b809b48..2a798b0 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 1d41557..28763c9 100644
--- a/plugins/symbol-db/symbol-db-engine-queries.h
+++ b/plugins/symbol-db/symbol-db-engine-queries.h
@@ -191,13 +191,28 @@ symbol_db_engine_get_global_members_filtered (SymbolDBEngine *dbe,
/**
* No iterator for now. We need the quickest query possible.
* @param scoped_symbol_id Symbol you want to know the parent of.
- * @param db_file db-relative filename path. eg. /src/foo.c
+ * @param db_file db-relative filename path. eg. /src/foo.c Can be NULL.
*/
gint
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]