I know that it is always the main () function being executed first, then function calls will direct the program to other functions. What if functions were called *before* the main () function? When will they be executed?\
I had a program (I downloaded from the Internet) and there were function calls before main( ).
Now I don't know what they are for if execution is only done in main () (and the the functions called inside main).
HERE IS THE FRAGMENT OF THE PROGRAM:
static void set_level_indices (VideoParameters *p_Vid);
static void chroma_mc_setup (VideoParameters *p_Vid);
static void init_img (VideoParameters *p_Vid);
static void init_encoder (VideoParameters *p_Vid, InputParameters *p_Inp);
static int init_global_buffers (VideoParameters *p_Vid, InputParameters *p_Inp);
static void free_global_buffers (VideoParameters *p_Vid, InputParameters *p_Inp);
static void free_img (VideoParameters *p_Vid, InputParameters *p_Inp);
static void free_params (InputParameters *p_Inp);
static void encode_sequence (VideoParameters *p_Vid, InputParameters *p_Inp);
*(SOME FUNCTION DECLARATIONS OMITTED)*
int main(int argc, char **argv)
{
init_time();
#if MEMORY_DEBUG
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif
alloc_encoder(&p_Enc);
Configure (p_Enc->p_Vid, p_Enc->p_Inp, argc, argv);
// init encoder
init_encoder(p_Enc->p_Vid, p_Enc->p_Inp);
// encode sequence
encode_sequence(p_Enc->p_Vid, p_Enc->p_Inp);
// terminate sequence
free_encoder_memory(p_Enc->p_Vid, p_Enc->p_Inp);
free_params (p_Enc->p_Inp);
free_encoder(p_Enc);
return 0;
}
Now that I thought of it, is the static has something to do with these calls done before main () being okay?
This is the encoder of H.264 in its reference software.
EDIT
Are the codes above main () function calls, function prototypes or a function declaration. You all give different answers. Please choose one and explain why by presenting the format. I really thought these statements are in the form of function calls. Furthermore, can function prototypes be included in a source code and not in the header file? Thank you!