shared library in C
Posted
by sasayins
on Stack Overflow
See other posts from Stack Overflow
or by sasayins
Published on 2010-05-26T07:19:02Z
Indexed on
2010/05/26
7:21 UTC
Read the original article
Hit count: 381
c
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?
© Stack Overflow or respective owner