44 ms·
I learned of a cute side effect when one puts the function name on its own line, like above. In BSD of yore and modern contemporaries, one could often perform
by winocm 2y ago
I learned of a cute side effect when one puts the function name on its own line, like above.
In BSD of yore and modern contemporaries, one could often perform `grep '^function'` and end up finding the source file quite easily. I think it also makes using ctags(1) a bit easier too, but not entirely sure on that bit.
- Iwan-Zotow 2y agoyou could grep `grep '^auto function'` with the same efforts
- 3836293648 2y agoNo, that clashes with variable declarations. Sure, you could have a naming scheme that doesn't have that issue, but that doesn't help with library code.
- winocm 2y agoPretty much. Here's some declarations from an ancient UNIX (remember, UNIX(R) is a registered trademark of "The Open Group") ctags file to help show how that type of scheme works: ISDOT rm.c /^#define ISDOT(a) ((a)[0] == '.' && (!(a)[1] || (a)/ Mrm rm.c /^main(argc, argv)$/ PASS rm.c /^#define PASS(byte) { \\$/ check rm.c /^check(path, name, sp)$/ checkdot rm.c /^checkdot(argv)$/ rm_file rm.c /^rm_file(argv)$/ rm_overwrite rm.c /^rm_overwrite(file, sbp)$/ rm_tree rm.c /^rm_tree(argv)$/ usage rm.c /^usage()$/ Side note: https://unix.org/trademark.html https://unix.org/trademark.html