I think you might solve your problem with the Omni Completion function working with a program like exuberant ctags.
The idea is to generate a tags file containing the different classes, constants, fields, etc... of your code and letting Vim use this list to generate the autocomplete suggestions.
To do so:
Install exuberant ctags:
$ sudo apt-get install exuberant-ctags (or the equivalent command for your distribution).
Generate the tags file:
$ ctags *.c *.h a file named
tagsshoud be generated on your folder.
Let Vim knows where is your tags file:
:tags=./tags,tags with these settings Vim looks for a tags file in the directory of the current file
and in the working directory. Note that you can use
:set tags? to check your current configuration.
Call the Tag Completion: Now when writing a word and hitting
<C-x><C-]> Vim will use this tags list to autocomplete your word.
Bonus: As you might have noticed your tags file will not update automatically, which means that when you write new prototypes the tag completion will not suggest them. If your codebase isn't too big you could put this line in your
:autocmd BufWritePost * call system("ctags -R")
That will simply regenerate the tags file each time you save a file. It is important to note that if your codebase is important, this trick might considerably slow down your workflow.