diff options
Diffstat (limited to 'src/model/count.c')
-rw-r--r-- | src/model/count.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/model/count.c b/src/model/count.c new file mode 100644 index 0000000..02f6a33 --- /dev/null +++ b/src/model/count.c @@ -0,0 +1,33 @@ +#include <sys/types.h> +#include <libelfu/libelfu.h> + + + +size_t elfu_countSections(ElfuElf *me) +{ + ElfuScn *ms; + size_t i = 0; + + for (ms = me->scnList.cqh_first; + ms != (void *)&me->scnList; + ms = ms->elem.cqe_next) { + i++; + } + + return i; +} + + +size_t elfu_countPHDRs(ElfuElf *me) +{ + ElfuPhdr *mp; + size_t i = 0; + + for (mp = me->phdrList.cqh_first; + mp != (void *)&me->phdrList; + mp = mp->elem.cqe_next) { + i++; + } + + return i; +} |