tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

cgrep for basesystem?



I've discovered and ported cgrep from Coherent to NetBSD.

https://github.com/krytarowski/cgrep

It's a grep-like program for discovering C identifiers.

 $ ./cgrep usage /usr/src/bin/ls/*.c
/usr/src/bin/ls/ls.c: usage(void)
/usr/src/bin/ls/ls.c:                   usage();

$ ./cgrep x /usr/src/bin/ls/*.c
/usr/src/bin/ls/cmp.c: #define ATIMENSEC_CMP(x, op, y)
((x)->st_atimensec op (y)->st_atimensec)
/usr/src/bin/ls/cmp.c: #define CTIMENSEC_CMP(x, op, y)
((x)->st_ctimensec op (y)->st_ctimensec)
/usr/src/bin/ls/cmp.c: #define MTIMENSEC_CMP(x, op, y)
((x)->st_mtimensec op (y)->st_mtimensec)
/usr/src/bin/ls/cmp.c: #define ATIMENSEC_CMP(x, op, y) \
/usr/src/bin/ls/cmp.c:  ((x)->st_atimespec.tv_nsec op
(y)->st_atimespec.tv_nsec)
/usr/src/bin/ls/cmp.c: #define CTIMENSEC_CMP(x, op, y) \
/usr/src/bin/ls/cmp.c:  ((x)->st_ctimespec.tv_nsec op
(y)->st_ctimespec.tv_nsec)
/usr/src/bin/ls/cmp.c: #define MTIMENSEC_CMP(x, op, y) \
/usr/src/bin/ls/cmp.c:  ((x)->st_mtimespec.tv_nsec op
(y)->st_mtimespec.tv_nsec)

I find this program useful, however it should be refreshed or rewritten
for modern times. Its switches and usage is not compatible with modern
grep(1) and the implementation is pretty simplistic.

If someone would be interested to pick this project it would be great.
Personally, due to lack of extra time in the foreseeable time, I use
this program locally and I don't find it suitable in the current form
for base.

An extra project would be to integrate cgrep with git for 'git cgrep'.

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index