From f805aa763fad3156428866a02de95ba9b67079a7 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 17 Aug 2022 10:11:15 +0200 Subject: grepc, grepc.1: -tg, -tgp, -tgd: Add more support for glibc internal names of libc functions Signed-off-by: Alejandro Colomar --- bin/grepc | 52 ++++++++++++++++++++++++++++++++++++++++++++++++-- share/man/man1/grepc.1 | 12 ++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/bin/grepc b/bin/grepc index e42b158..df15953 100755 --- a/bin/grepc +++ b/bin/grepc @@ -16,6 +16,9 @@ t_func_def='no'; t_func_syscall='no'; t_func_syscall_proto='no'; t_func_syscall_def='no'; +t_func_glibc='no'; +t_func_glibc_proto='no'; +t_func_glibc_def='no'; t_macro='no'; t_type='no'; t_use='no'; @@ -78,6 +81,15 @@ grepc_parse_cmd() fsd) t_func_syscall_def='yes'; ;; + fg) + t_func_glibc='yes'; + ;; + fgp) + t_func_glibc_proto='yes'; + ;; + fgd) + t_func_glibc_def='yes'; + ;; m) t_macro='yes'; ;; @@ -207,15 +219,41 @@ grepc_func_def() } -grepc_glibc_func_math() +grepc_glibc_func_libm_def() { grepc_func_def "M_DECL_FUNC \(__$1\)"; } +grepc_glibc_func_libio_proto() +{ + grepc_func_proto "_IO_$1"; +} + + +grepc_glibc_func_libio_def() +{ + grepc_func_def "_IO_$1"; +} + + +grepc_glibc_func_proto() +{ + grepc_glibc_func_libio_proto "$1"; +} + + +grepc_glibc_func_def() +{ + grepc_glibc_func_libm_def "$1"; + grepc_glibc_func_libio_def "$1"; +} + + grepc_glibc_func() { - grepc_glibc_func_math "$1"; + grepc_glibc_func_proto "$1"; + grepc_glibc_func_def "$1"; } @@ -458,6 +496,16 @@ grepc_search() grepc_linux_func_syscall_def "$1"; fi; fi; + if [ "$t_func_glibc" = 'yes' ]; then + grepc_glibc_func "$1"; + else + if [ "$t_func_glibc_proto" = 'yes' ]; then + grepc_glibc_func_proto "$1"; + fi; + if [ "$t_func_glibc_def" = 'yes' ]; then + grepc_glibc_func_def "$1"; + fi; + fi; fi; if [ "$t_macro" = 'yes' ]; then grepc_macro "$1"; diff --git a/share/man/man1/grepc.1 b/share/man/man1/grepc.1 index aa69c7b..2f7e3b1 100644 --- a/share/man/man1/grepc.1 +++ b/share/man/man1/grepc.1 @@ -64,6 +64,18 @@ Linux kernel system call prototypes. .B fsd Linux kernel system call definitions. .RE +.TP +.B fg +Glibc internal names of libc functions. +This can be further subdivided into: +.RS +.TP +.B fgp +Glibc prototypes. +.TP +.B fgd +Glibc definitions. +.RE .RE .TP .B m -- cgit v1.2.3