Question: I am trying to write a generic library in pure c , just some data structures like stack, queue...

In my stack.h when giving name to those functions. I have questions about that.

1. Can I use such name, for example "init" as the function name to init a stack. Will there be something wrong?
2. I know maybe there exist other functions which just do other things and have the same name as "init". Then would the program be confused, especially when i both include the different init's headers.

3.I know my worry may be unnecessary, but i still want to know the principle.

Any help is appreciated, thanks.

Answer: 
1. init() might be okay (if you're including your library into something else as an actual library, rather than compiling its source in), but it's better practice to use something like stack\_init(), and to prefix your library's functions with stack\_ or queue\_, etc.
2. A program using your library may get confused, depending on the order the libraries are included, see #1.

As far as the principles go, the linker (on Linux, anyway) will look for symbols, and there's an ordering to how those symbols will be found. For more information, you can check out the man page for dlsym(), and specifically for RTLD\_NEXT.
Function names in C are global. If two functions in a program have the same name, the program should fail to compile. (Well, sometimes it fails at link time, but the idea still holds.)

Generally, you get around this problem by using some sort of prefix or suffix on the function names in your library. "apporc\_stack\_init()" is much less likely to collide with something than "init()" is.