projects
/
centaur.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
274b9d8f3d36f45d4116f7d2801dda00c0bb6c35
[centaur.git]
/
src
/
model
/
count.c
1
#include <assert.h>
2
#include <sys/types.h>
3
#include <libelfu/libelfu.h>
4
5
6
7
/* NULL section is not counted! */
8
size_t elfu_countSections(ElfuElf *me)
9
{
10
ElfuScn *ms;
11
size_t i = 0;
12
13
assert(me);
14
15
CIRCLEQ_FOREACH(ms, &me->scnList, elem) {
16
i++;
17
}
18
19
return i;
20
}
21
22
23
size_t elfu_countPHDRs(ElfuElf *me)
24
{
25
ElfuPhdr *mp;
26
size_t i = 0;
27
28
assert(me);
29
30
CIRCLEQ_FOREACH(mp, &me->phdrList, elem) {
31
i++;
32
}
33
34
return i;
35
}