shared library in C
- by sasayins
Hi,
I am creating a shared library in C but don't know what is the correct implementation of the source codes.
I want to create an API like for example, printHello,
int printHello( char * text );
This printHello function will call another function:
In source file, libprinthello.c,
void printHello( char * text )
{
printHi();
printf("%s", text);
}
Since this printHello function is the interface for the user or application:
In header file libprinthello.h,
extern void printHello( char * text);
Then in the source file of the printHi function, printhi.c
void printHi()
{
printf("Hi\n");
}
Then my problem is, since printHello is the only function that I want to expose in the user, what implementation should I do in printHi function?