summaryrefslogtreecommitdiff
path: root/library.h
diff options
context:
space:
mode:
authorDima Kogan <dima@secretsauce.net>2014-06-25 22:22:12 -0700
committerChanho Park <chanho61.park@samsung.com>2014-08-22 20:38:26 +0900
commit2cdae45b59ef73f7128e123fa24de24941de8f26 (patch)
treedf375fecdfd4135c20f309a6bc59626e07ef126e /library.h
parent0d0ef961855b7aefa4529c49d05e1785c968131f (diff)
downloadltrace-2cdae45b59ef73f7128e123fa24de24941de8f26.tar.gz
ltrace-2cdae45b59ef73f7128e123fa24de24941de8f26.tar.bz2
ltrace-2cdae45b59ef73f7128e123fa24de24941de8f26.zip
library_exported_names_each_alias(), library_exported_names_each() now restartable
These function now takes a *start_after, and return a pointer to the first failing key, like the other ltrace iterators
Diffstat (limited to 'library.h')
-rw-r--r--library.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/library.h b/library.h
index f8a5cf8..71ac4db 100644
--- a/library.h
+++ b/library.h
@@ -265,22 +265,42 @@ int library_exported_names_push(struct library_exported_names *names,
/* Iterates through the a library's export list. The callback is called for
* every symbol a library exports. Symbol aliases do not apply here. If multiple
- * symbols are defined at the same address, each is reported here. Returns true
- * on success. If the callback fails at any point, this returns false
+ * symbols are defined at the same address, each is reported here.
+ *
+ * If we want to iterate through the whole list, set name_start_after=NULL. If
+ * we want to start iterating immediately past a particular symbol name, pass a
+ * pointer to this symbol name in name_start_after. This must be a pointer in
+ * the internal dict, preferably returned by an earlier call to this function
+ *
+ * If the callback fails at any point, a pointer to the failing key is returned.
+ * On success, returns NULL. The returned pointer can be passed back to this
+ * function in name_start_after to resume skipping this element
*/
-bool library_exported_names_each(const struct library_exported_names *names,
- enum callback_status (*cb)(const char *,
- void *),
- void *data);
+const char** library_exported_names_each(
+ const struct library_exported_names *names,
+ const char **name_start_after,
+ enum callback_status (*cb)(const char *,
+ void *),
+ void *data);
/* Iterates through the a library's export list, reporting each symbol that is
* an alias of the given 'aliasname' symbol. This 'aliasname' symbol itself is
* NOT reported, so if this symbol is unique, the callback is not called at all.
- * Returns true on success
+ *
+ * If we want to iterate through the whole alias list, set
+ * name_start_after=NULL. If we want to start iterating immediately past a
+ * particular symbol name, pass a pointer to this symbol name in
+ * name_start_after. This must be a pointer in the internal dict, preferably
+ * returned by an earlier call to this function
+ *
+ * If the callback fails at any point, a pointer to the failing key is returned.
+ * On success, returns NULL. The returned pointer can be passed back to this
+ * function in name_start_after to resume skipping this element
*/
-bool library_exported_names_each_alias(
+const char** library_exported_names_each_alias(
const struct library_exported_names *names,
const char *aliasname,
+ const char **name_start_after,
enum callback_status (*cb)(const char *,
void *),
void *data);