I am new to C/C++ and i am not able to understand how the header files work in C i have a set of header files being used in various functions in my project and they have functions that are being called in my programs. When i go to see functions code in the header file I could only see the function defination but no body Header file contains only the varriable /Structure and function definations. where is the code that is getting executed.
here is one sample header file.
MOD EDIT: Added code tags. When posting code...USE CODE TAGS!!!
here is one sample header file.
#ifndef _SAMPLE_UTILS_H_
#define _SAMPLE_UTILS_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
int print_key_info (R_KM_KEY *key);
int print_security_obj_info(R_KM_KEY *key);
int print_symmetric_key_info(R_KM_KEY *key);
void print_buffer (char *label, unsigned char *buf, unsigned int bufLen,
char *indent);
int write_data_to_file (char *filename, unsigned char *input, unsigned long
inputLen);
int read_data_from_file (char *filename, unsigned char **pInput,
unsigned long *pInputLen);
int hex_string_to_binary (char *hex_str, unsigned char *bin_buf,
unsigned int *bin_len);
int fips_mode_string_to_int(char *mode_buffer, int *format);
int crypto_format_string_to_int(char *mode_buffer, int *format);
int get_substring_by_index(char *str, const char *delimiters, int index,
char **substr, unsigned int *substr_len);
int extract_key_alias_from_string(char *key_alias, int cnt,
unsigned char *alias_data, unsigned int alias_max_len,
unsigned int *alias_data_len);
int extract_key_attribute_name_from_string(char *key_attribute, int cnt,
char *attribute, unsigned int attr_max_len);
int extract_key_attribute_from_string(char *key_attribute, int cnt,
char *attr_name, unsigned int attr_name_max_len, int *attr_type,
int *is_private, unsigned char *attr_value, unsigned int attr_value_max_len,
unsigned int *attr_value_len);
int string_to_key_state_data(char *key_state, int *state, int *sub_state,
char *state_desc, unsigned int desc_max_len);
/* This has been lifted from RSA samples.*/
typedef struct km_util_config
{
char *init_file;
char *svc_file;
char *credential_password;
char *cache_password;
char *key_class;
char *key_alias;
char *key_alias_add;
char *key_alias_delete;
char *key_attribute;
char *key_attribute_add;
char *key_attribute_delete;
char *key_attribute_update;
char *key_state;
char *not_before;
char *key_infile;
char *key_digest_infile;
char *key_file;
int key_format;
char *uuid;
char *key_id;
char *in_file;
char *out_file;
char *iv_file;
int fips_mode;
int fips_mode_set;
int out_data_format;
int out_data_format_set;
char **header_name_string;
unsigned char **header_value_string;
int headers_added;
char *out_iv_file;
char *out_key_id_file;
char *in_mac_file;
char *unknown;
int threads;
int iterations;
} KM_UTIL_CONFIG;
int is_valid_option(char *valid_option_list[], char *option);
const char *get_key_source_desc (int source);
int parse_param(int argc, char *argv[], char *valid_option_list[],
KM_UTIL_CONFIG *km_util_config);
int initialise_kmc(R_KM_CTX **km_ctx, R_KM_KEY_CTX **km_key_ctx,
KM_UTIL_CONFIG *km_util_config);
int shutdown_kmc(R_KM_CTX *km_ctx, R_KM_KEY_CTX *km_key_ctx);
int concat_buffers(unsigned char *src1, unsigned int src1_len,
unsigned char *src2, unsigned int src2_len, unsigned char **dest,
unsigned int *dest_len);
#ifdef __cplusplus
}
#endif
#endif
MOD EDIT: Added code tags. When posting code...USE CODE TAGS!!!