.\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .TH grepc_c 1 (date) "Linux man-pages (unreleased)" .SH NAME grepc_c \- print PCRE patterns for searching C code .SH SYNOPSIS .B grepc_c .RI [ option\~ .\|.\|.\&] .I pattern .SH DESCRIPTION .BR grepc_c (1) is a driver for .BR grepc (1). It prints PCRE patterns that .BR grepc (1) will use to search for declarations, definitions, and/or uses of .I pattern in C source code. .P .I pattern is a PCRE pattern. It normally represents a C identifier, and word boundaries are implicitly added to it in most cases. .SS Types of code This program can produce PCRE pattern for several types of code. The following arguments can be passed to the .B \-t option to select the types of code that will be searched. .TP .B e enum constant definitions. .TP .B f Function prototypes and definitions. This can be further subdivided into: .RS .TP .B fp Function prototypes. .TP .B fd Function definitions. .TP .B fl Linux kernel system calls. This can be further subdivided into: .RS .TP .B flp Linux kernel system call prototypes. .TP .B fld Linux kernel system call definitions. .RE .TP .B fg Glibc internal names of libc functions. This can be further subdivided into: .RS .TP .B fgp Glibc prototypes. .TP .B fgd Glibc definitions. .RE .RE .TP .B m Macro definitions. .RS .TP .B mf Function-like macro definitions. .TP .B mo Other macro definitions. .RE .TP .B t Type definitions. .TP .B u Uses. Searches occurences of .I pattern within enums, function bodies, macro replacements, and type definitions, and prints the whole enum, function, macro, and/or type definitions. In this case there are no word boundaries set by default, so if .I pattern is .BR open , .B fopen will also be found; that's to allow searching for patterns containing any sequence of characters. .IP This can be further subdivided into: .RS .TP .B ue Uses within enum definitions (except as an enum constant). .TP .B uf Uses within function definition bodies. .TP .B um Uses within macro replacements. .TP .B ut Uses within type definitions (except enum; that is: typedef, struct, or union). .RE .SH OPTIONS .TP .BI \-t " type" Restrict the search to a specific .I type of code (see Types of code under DESCRIPTION). This option can be passed multiple times to search for various types of code. Default: .BR "e f m t" . .SH EXAMPLES .EX .RB alx@devuan:\[ti]$ " grepc_c \-tm alignof" ; (?s)\[ha][ \[rs]t]*#\[rs]s*define\[rs]s[\[rs]s\[rs]\[rs]]*alignof\[rs](.*?[\[ha]\[rs]\[rs]]$ (?s)\[ha][ \[rs]t]*#\[rs]s*define\[rs]s[\[rs]s\[rs]\[rs]]*alignof\[rs]b(?!\[rs]().*?(?