Assuming this is a C source file called file.c.
Using ctags:
$ ctags file.c
This creates a file called tags:
$ cat tags
init_DB file.c /^init_DB(DB *database, char *params[])$/
load_DB file.c /^FILE * load_DB(const char * exppath, const char * /
prep_DB file.c /^prep_DB() {$/
This may be used with vi or vim to automatically jump to the function definitions.
You may also parse this file with cut and grep:
$ cut -f 1 tags | grep '_DB$'
init_DB
load_DB
prep_DB
On Ubuntu systems, installing ctags will actually install exuberant-ctags which provides a more verbose tags output:
$ cat tags
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.9~svn20110310 //
init_DB file.c /^init_DB(DB *database, char *params[])$/;" f
load_DB file.c /^FILE * load_DB(const char * exppath, const char * expfname)$/;" f
prep_DB file.c /^prep_DB() {$/;" f
Here we can be sure to only get function definitions with
$ awk '$NF == "f" && $1 ~ /_DB$/ { print $1 }' tags
init_DB
load_DB
prep_DB
The point here is that you're better off using a dedicated C language parser than trying to account for all possible programming styles in an awk script or a regular expression with grep that parses C code.
You can also do
$ ctags -x file.c
init_DB function 3 file.c init_DB(DB *database, char *params[])
load_DB function 12 file.c FILE * load_DB(const char * exppath, const char * expfname)
prep_DB function 8 file.c prep_DB() {
and then parse/filter that in whatever way you need. The number is the line number of the definition. It all comes down to what you mean by "want to find".