How to write API program
I like to know how to write a program which would export some API function.

For ex: Suppose I have few function, lets take add(int x,int y), mul(int x,int y) sub(int x, int y).

How can I write a daemon in c such that this will export above API to external world.

And how can I access these APIs from other program?

I am expecting from code point of view... Thanks in advance...
How to write API program
===

I like to know how to write a program which would export some API function.

For ex: Suppose I have few function, lets take add(int x,int y), mul(int x,int y) sub(int x, int y).

How can I write a daemon in c such that this will export above API to external world.

And how can I access these APIs from other program?

I am expecting from code point of view... Thanks in advance...