ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Dear All,
As we can see the device driver programs or even the programs which are system specific we can see that in those programs there are certain fixed files are included like:
can anybody tell me the purpose of these files? or can anybody show me the tutorial where i can show the functions of these files, which can help me in my project to move faster.
In any program that relies upon some extra code (that is some code which is not in the file being compiled, such as code written by those device driver gurus) the compiler needs to know about these functions. The purpose of the #include is to tell the compiler where to look for the functions.
What the #include actually refers to is the header file which is a description of what the function will look like (the name of the function, what is returned and what needs to be passed into the function - the signature). This means that the compiler can check that you are calling the function correctly.
The linker will put all of the pieces together and so it is the linker that will need to add the actual code from these external function and your functions, creating your executable program.
In any program that relies upon some extra code (that is some code which is not in the file being compiled, such as code written by those device driver gurus) the compiler needs to know about these functions. The purpose of the #include is to tell the compiler where to look for the functions.
What the #include actually refers to is the header file which is a description of what the function will look like (the name of the function, what is returned and what needs to be passed into the function - the signature). This means that the compiler can check that you are calling the function correctly.
The linker will put all of the pieces together and so it is the linker that will need to add the actual code from these external function and your functions, creating your executable program.
Dear Graemef,
Thanks for the info dude, and you are right about the #include, but i want to know about the files which are included with the #include like <linux/init.h> and <linux/module.h> etc..., and as infestator, told me that there are comments available in the header about the functions available, i have to go that way if any option is not available, but that is a long way....
you can simply look at them in /usr/include/linux. generally there's a lot of commets for every function in header files.
Dear Infestator,
You are right that comments are available in the header file itself about the functions made in the file, but that could be the long way, that i ll visit each and every file and each function, instead i want the overview of those files, cos as i think these files are common, they wont do different works in each program where they are included?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.