aboutsummaryrefslogtreecommitdiff
path: root/src/linked-list.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-11-12 14:09:49 +0200
committerSergey Poznyakoff <gray@gnu.org>2016-11-14 23:34:33 +0200
commit614eabb225a9f62d1dbfe50fe44e7b9db9c0467d (patch)
treeed0ae264afb6e4dc4b7bc3f3f908281ebd50f220 /src/linked-list.c
parentb92047ed10c4da784c296dfcf09da250b7b637c7 (diff)
downloadcflow-614eabb225a9f62d1dbfe50fe44e7b9db9c0467d.tar.gz
cflow-614eabb225a9f62d1dbfe50fe44e7b9db9c0467d.tar.bz2
Include static symbols as root points in inverted graphs.
* src/cflow.h (linked_list_size): New function. * src/linked-list.c (linked_list_size): New function. * src/symbol.c (collect_symbols): Include static symbols, if allowed by sel. * src/main.c (parse_opt): Exclude static symbols for --xref
Diffstat (limited to 'src/linked-list.c')
-rw-r--r--src/linked-list.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/linked-list.c b/src/linked-list.c
index 095b63e..3c57bf0 100644
--- a/src/linked-list.c
+++ b/src/linked-list.c
@@ -17,7 +17,7 @@
#include <cflow.h>
static struct linked_list *
-deref_linked_list (struct linked_list **plist)
+deref_linked_list(struct linked_list **plist)
{
if (!*plist) {
struct linked_list *list = xmalloc(sizeof(*list));
@@ -144,3 +144,16 @@ data_in_list(void *data, struct linked_list *list)
return 1;
return 0;
}
+
+size_t
+linked_list_size(struct linked_list *list)
+{
+ size_t size = 0;
+ if (list) {
+ struct linked_list_entry *p;
+ for (p = linked_list_head(list); p; p = p->next)
+ size++;
+ }
+ return size;
+}
+

Return to:

Send suggestions and report system problems to the System administrator.