Read the API documentation:
ALSA project - the C library reference: Main Page

Also this should probably go to the Linux coding forum.