grepc_c(1)
๐ NAME ๐
okay so we're reading the grepc_c(1) page from the General Commands Manual, and the whole point of grepc_c is printing PCRE patterns for searching C code. that's it. that's the gig. โจ
๐ฆ SYNOPSIS ๐ฆ
grepc_c [option ...] pattern
๐ธ DESCRIPTION ๐ธ
so bestie, grepc_c(1) is a driver for grepc(1). what it actually does is print out the PCRE patterns that grepc(1) is gonna use to search for declarations, definitions, and/or uses of pattern in C source code. it's giving personal assistant energy, honestly. ๐
pattern is a PCRE pattern. it normally represents a C identifier, and word boundaries get implicitly added to it in most cases. sneaky little boundaries. ๐
๐ซถ Types of code ๐ซถ
this program can produce PCRE patterns for several types of code. you pass the following arguments to the -t option to select which types of code will get searched:
eโ enum constant definitions. ๐fโ function prototypes and definitions. and this one? it subdivides, bestie:fpโ function prototypes.fdโ function definitions.flโ Linux kernel system calls. and that can be further subdivided into:flpโ Linux kernel system call prototypes.fldโ Linux kernel system call definitions.
fgโ glibc internal names of libc functions. which also subdivides into:fgpโ glibc prototypes.fgdโ glibc definitions.
mโ macro definitions.mfโ function-like macro definitions.moโ other macro definitions.
tโ type definitions.uโ uses. it searches for occurrences of pattern within enums, function bodies, macro replacements, and type definitions, and prints the whole enum, function, macro, and/or type definition. and lowkey important: in this case there are no word boundaries set by default, so if pattern isopen, thenfopenwill also get found. that's intentional, it's so you can search for patterns containing any sequence of characters. iconic behaviour tbh. ๐ueโ uses within enum definitions (except as an enum constant).ufโ uses within function definition bodies.umโ uses within macro replacements.utโ uses within type definitions (except enum; that is:typedef,struct, orunion).
โจ OPTIONS โจ
-ttype โ restrict the search to a specific type of code (see Types of code under DESCRIPTION, bestie, it's right up there ๐ซถ). this option can be passed multiple times to search for various types of code. Default:e f m t.
๐ EXAMPLES ๐
alx@devuan:~$ grepc_c -tm alignof;
(?s)^[ \t]*#\s*define\s[\s\\]*alignof\(.*?[^\\]$
(?s)^[ \t]*#\s*define\s[\s\\]*alignof\b(?!\().*?(?<!\\)$
alx@devuan:~$ cd /usr/lib/gcc/;
alx@devuan:/usr/lib/gcc$ pcre2grep -rnMf <(grepc_c -tm alignof) .;
./x86_64-linux-gnu/15/include/stdalign.h:33:#define alignof _Alignof
๐ SEE ALSO ๐
okay that's the whole page, bestie, we ate and left no crumbs ๐ โจ this little number is from Linux man-pages 6.20, dated 2026-01-06 โ go forth and grep your C code, mwah ๐๐
๐ฆ where this page comes from
- arch rolling: man-pages-utils 6.20-1 ยท GPL-3.0-or-later
- nixpkgs unstable: man-pages 6.20
- ๐ the page's license: Linux-man-pages-copyleft
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms