Now let's see how a simple interface can be written. Suppose that you would like to build an interface for your own version of memcpy. Interfaces call the functions for which they are named, but before they call the library function, they check the parameters passed to it. Interfaces can also check if the parameters passed to the function are in the right ranges. In our case we check if n is a non-negative value.
Interfaces can also check the return code from the function.
We did not do this here. Once an interface is written, it can be stored in any file together with other interfaces. Once all of them have been written, the interfaces should be compiled. Let's assume that the interfaces are stored in file foo.c. Assume now that we not only want to check if the function is called with correct parameters, but we also want to build our function ourselves.