ctags: Support writing to stdout instead of a file.
- Understand "-" to mean stdout as per convention.
- Check that the output is a regular file and ignore -u if not, otherwise we might try to rm /dev/stdout.
- As a bonus, if -u was specified but the output file does not exist, proceed as if -u had not been specified instead of erroring out.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: cracauer, debdrup
Differential Revision: https://reviews.freebsd.org/D40237
(cherry picked from commit 430d064ba5b0cb2e91a26af34c15df48d290e417)
ctags: Recognize attribute in function declarations.
MFC after: 1 week
Obtained from: NetBSD
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D40264
(cherry picked from commit 9f35eb8f96a55aac92fc0c7d08f4b6ab0ae9bc39)
ctags: Don't undercount lines when handling // comments.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D40374
(cherry picked from commit 7ba6119e22b54c2104b1948f0e8a4157d4112958)