summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
* bin/grepc: Simplify (remove grepc_glibc_func())Alejandro Colomar2023-11-03-20/+11
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* bin/grepc: Simplify (remove grepc_linux_func())Alejandro Colomar2023-11-03-20/+11
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* bin/grepc: Simplify (remove grepc_func())Alejandro Colomar2023-11-03-36/+28
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* bin/grepc: Simplify (remove grepc_search_default())Alejandro Colomar2023-11-03-56/+50
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* Use pcre2grep(1) instead of pcregrep(1)Alejandro Colomar2023-11-02-4/+4
| | | | | | PCRE are EOL. Long live PCRE2. Signed-off-by: Alejandro Colomar <alx@kernel.org>
* Use recursion to improve matching of function parameter listsAlejandro Colomar2023-01-08-4/+4
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* Support parenthesized function namesAlejandro Colomar2023-01-08-2/+2
| | | | | | | This creates some false positives, but with appropriate flags, those can be removed. Signed-off-by: Alejandro Colomar <alx@kernel.org>
* grepc, grepc.1: -tg, -tgp, -tgd: Add more support for glibc internal names ↵Alejandro Colomar2022-08-17-2/+62
| | | | | | of libc functions Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: -tm: Fix finding macros defined as emptyAlejandro Colomar2022-06-24-2/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: -c: Add flag to color usesAlejandro Colomar2022-05-25-11/+45
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: Remove constraints in the file prefilteringAlejandro Colomar2022-05-25-1/+1
| | | | | | | To make -tu work correctly, which doesn't have the word-boundary constraint. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: -tut: Fix regex for braces in the same line as 'struct'Alejandro Colomar2022-05-25-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: Read in the helperAlejandro Colomar2022-05-25-35/+19
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: Don't search underlying structure of a typedefAlejandro Colomar2022-05-25-14/+0
| | | | | | | | In some cases it might be nice, but in some other cases, it might cause a lot of code to be printed. Let the user explicitly search for it or not in a separate run. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: Fix glitch with incorrectly indented codeAlejandro Colomar2022-05-25-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid this glich from glibc: ./sysdeps/unix/sysv/linux/x86/sys/ucontext.h:133: typedef struct { gregset_t __ctx(gregs); /* Note that fpregs is a pointer. */ fpregset_t __ctx(fpregs); __extension__ unsigned long long __reserved1 [8]; } mcontext_t; /* Userlevel context. */ typedef struct ucontext_t { unsigned long int __ctx(uc_flags); struct ucontext_t *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; __extension__ unsigned long long int __ssp[4]; } ucontext_t; Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: Fix some typedef corner casesAlejandro Colomar2022-05-24-3/+3
| | | | | | | - Typedefs to arrays of structures. - Typedefs to structures of the same name. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* CONTRIBUTING: Github repo was removedAlejandro Colomar2022-05-24-4/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: Improve regexesAlejandro Colomar2022-05-24-16/+16
| | | | | | | | - Use the same ammount of spaces for the closing brace as for the opening brace. - Fix position of attributes. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: bugfixAlejandro Colomar2022-05-22-2/+2
| | | | | | | SC2068: Double quote array expansions to avoid re-splitting elements. Reported-by: shellcheck(1) Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: srcfixAlejandro Colomar2022-05-22-1/+1
| | | | | | | SC2124: Use $* instead of $@ to concatenate. Reported-by: shellcheck(1) Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: srcfixAlejandro Colomar2022-05-22-1/+1
| | | | | | | SC2004: $/${} is unnecessary on arithmetic variables. Reported-by: shellcheck(1) Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Add -i flag as in grep(1)Alejandro Colomar2022-05-22-8/+16
| | | | | | Also, add some symmetry between ${iflag} and ${lflag}. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Remove -tu from the defaultsAlejandro Colomar2022-05-22-3/+2
| | | | | | | | | | | Normally, one either wants to see a declaration/definition, or its uses, but not both at the same time. Also, there are usually many more use sites than than definitions, and therefore definitions are shadowed between all the noise. Restrict the default to declarations and definitions, which in my experience seems to be the most common use case. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: -tu: Allow searching special charactersAlejandro Colomar2022-05-20-14/+22
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: Fix grepc_type_typedef_underlying_struct_union_enumAlejandro Colomar2022-05-20-26/+43
| | | | | | | | | | | When it calls grepc_type_struct_union_enum(), it needs to use a different file list, since it's searching for an identifier different from the one passed in the command line. Also, while at it, improve the quoting of the pattern passed to pcregrep(1). Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: -tt: Find typedefs to function pointersAlejandro Colomar2022-05-17-0/+10
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: tfixAlejandro Colomar2022-05-17-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* examples/README: Fix commandAlejandro Colomar2022-05-17-2/+2
| | | | | | | `grepc '<filename>'` no longer produces that output (it now finds more things). Use appropriate flags to keep the examples correct. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* COPYING: Remove relative pathAlejandro Colomar2022-05-17-2/+0
| | | | | | | | | We have <share/licenses/> and <LICENSES/> in the repo, which should be enough to let people find the license. Anyway, when installed, different systems will likely have licenses installed in different places. Let's remove probably incorrect data. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* README: Remove pointer to examples/Alejandro Colomar2022-05-17-3/+0
| | | | | | | | | | | It contained a relative path, that would need a complex Makefile to keep correct after installation. Let's assume that <share/doc/grepc/> is easy to find, as it follows FHS, and a bit of intuition should do the rest. Anyway, the manual page contains an example. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* README, CONTRIBUTING: Move contrib info to CONTRIBUTINGAlejandro Colomar2022-05-17-16/+17
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: srcfixAlejandro Colomar2022-05-16-1/+1
| | | | | | Sort alphabetically the optstring. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: Allow a pattern to start with '-'Alejandro Colomar2022-05-15-5/+5
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: -t...: Allow more granularityAlejandro Colomar2022-05-15-2/+105
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc.1: wfixAlejandro Colomar2022-05-15-2/+2
|
* grepc, grepc.1: wfixAlejandro Colomar2022-05-15-12/+12
| | | | | | | Rename functions to have different starting letters. Also rename the macro functions to more closely match ISO C nomenclature. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: -tu: Search also within enum and type definitionsAlejandro Colomar2022-05-15-2/+51
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: grepc_enum_constant: Fix edge casesAlejandro Colomar2022-05-15-3/+3
| | | | | | Most importantly, typedef enum. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Add -l flag as in grep(1)Alejandro Colomar2022-05-14-3/+19
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: grepc_use_macro: tfixAlejandro Colomar2022-05-13-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc.1: ffixAlejandro Colomar2022-05-13-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Add -tu to search for usesAlejandro Colomar2022-05-13-1/+63
| | | | | Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: grepc_macro_*: Remove a few false positivesAlejandro Colomar2022-05-13-2/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: srcfixAlejandro Colomar2022-05-13-13/+13
| | | | | | Use alphabetic order. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Add -k option for a more compact outputAlejandro Colomar2022-05-12-3/+16
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Add -t option to restrict the search to a type of code.Alejandro Colomar2022-05-12-3/+78
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc: srcfixAlejandro Colomar2022-05-12-43/+43
| | | | | | | Improve grouping so that adding flags for running the different functions is simple. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* examples/: ffixAlejandro Colomar2022-05-11-58/+0
| | | | | | Remove the leading blank lines. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Makefile, examples/: Remove files with '\' in the filenameAlejandro Colomar2022-05-11-293/+2
| | | | | | Those are nice examples, but are a nightmare as filenames. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Don't print leading blank lines.Alejandro Colomar2022-05-11-12/+13
| | | | | | | Also, update the manual page EXAMPLES regarding blank lines. Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>