Reading a Large Library or Program
I like to look at source code whenever I can, but I can never figure out where to start. Obviously, the first step is to find main and then read on from there. Libraries are a different story, and I am still not sure where to start reading. Does anyone have any tips for looking over a large library that you have never seen before?
Re: Reading a Large Library or Program
Quote:
Originally Posted by binarybob0001
I like to look at source code whenever I can, but I can never figure out where to start. Obviously, the first step is to find main and then read on from there. Libraries are a different story, and I am still not sure where to start reading. Does anyone have any tips for looking over a large library that you have never seen before?
It's no different than "normal" source code.
The library must have some function that gets called first, second, third, etc. to make the library useful, just as a regular C++ program has a main() function, that calls other functions.
Regards,
Paul McKenzie
Re: Reading a Large Library or Program
So there is no magic tool that helps you find the first, second and third functions, just hard work?
Re: Reading a Large Library or Program
Quote:
Originally Posted by binarybob0001
So there is no magic tool that helps you find the first, second and third functions, just hard work?
The way you figure out library source code is to look at the sample programs that use the library. That's how you know what function is being called first, second, third, etc.
Just looking at the library code, with no context as to how to call the functions in the library and which functions to call, isn't the way to go about understanding the library.
Regards,
Paul McKenzie
Re: Reading a Large Library or Program