I am hoping to use inline functions in a piece of C code that I have, but I am a bit confused about their proper use and was hoping someone would be able to help me. As an example, assume that I have a header file foo.h containing the prototype of the function int func_foo() and a source file foo.c containing the declaration of the function func_foo(), e.g.

Assuming that func_foo() is a good candidate for inlining, I am a bit confused as to the proper way to define the inline function func_foo. Should I place the inline keyword in the function prototype in the header file, foo.h, or in the function declaration in foo.c or both? Also, i've had a look around and some people suggest using the extern keyword in the header file as well as the inline keyword?

Also, if we assume that func_bar() is also suitable for inlining and is called often, is it better for me to inline both func_foo() and func_bar() or just func_bar or func_foo by themselves?

Finally, if we consider an additional file, foobar.c which contains the function func_foobar, e.g.