You should provide the crucial info on whether you have debug symbols for the binary in question or not. If you do have the debug symbols available, then it's a breeze. There are standard libraries for parsing those.
If you don't have debug symbols, then it can be really tough and you're basically better off with a visual exploratory tool like IDA Pro. There has been some research on automatically finding function signatures for stripped binaries (e.g. ftp://ftp.cs.wisc.edu/paradyn/papers/Jacobson11Unstrip.pdf), but the topic is still bleeding edge and whatever tool you use, expect it to fail at some point, because the problem is ultimately undecidable and all tools just resort to heuristics for reconstructing this info. The freely available chapter 12 of Chris Eagle's book (http://www.tinker.tv/download/idaPro_ch12.pdf) covers the way IDA does this.