tags:

views:

208

answers:

5

Hi all,

If you are windows programmer and you want to program something new where you are going to use some new API with which you are not that familiar then you can type MSDN on your web browser and you get immediately what you need. Nicely grouped API functions where you can see what to include and what to link.

I am looking for something similar in the Linux world. I want to sleep my function for some milliseconds and I type "man sleep" then I get the explanation of shell command "sleep". But I don't want that. I am programming and I just want see the programmatical usage of that function.

So the question is: Is there a central, clickable and browsable documentation of C, C++ standard libraries AND linux system calls which are not part of the C/C++ standard but quite often used in linux programming ?

Thanks in advance,

G.

+2  A: 

Well in your case you could have typed "man 3 sleep"...

Konqueror (the KDE web/file browser) lets you type "#XXX" in the bar to look up the man page for XXX, and "##XXX" to look up the info page for XXX. Unlike man, it gives you the choice between which man page you want to choose if there is more than one. They are interlinked together, so looking up "sleep", you will see in the "SEE ALSO" section, signal, and you can click it to go to its man page.

I don't know of anything like this for C++, but there are several good websites with documentation: http://www.cplusplus.com/reference/ http://www.sgi.com/tech/stl/

(just to name a few that I use regularly)

Greg Rogers
A: 

By default, man pages look under man 1, which is classified as "General Commands." You want man 3, which is "Subroutines."

For a list of all the man pages, and their topics, I use http://www.linuxmanpages.com/ a lot, which is just a copy of all the man pages online.

FreeMemory
+4  A: 

Man is broken down into sections If you type "man man" you can see them.

   1   Executable programs or shell commands
   2   System calls (functions provided by the kernel)
   3   Library calls (functions within program libraries)
   4   Special files (usually found in /dev)
   5   File formats and conventions eg /etc/passwd
   6   Games
   7   Miscellaneous (including macro  packages  and  conven‐
       tions), e.g. man(7), groff(7)
   8   System administration commands (usually only for root)
   9   Kernel routines [Non standard]

So since you wnat the library call version of sleep() you would write "man 3 sleep". Also "info" is another way to access the same information.

You can also do a search with "man -k sleep", which will list everything matching sleep.

There are hyperlinked man pages scattered around the internet if you want to bookmark them.

For C++ APIs there are some good sites that many people have bookmarked and open a good portion of the time.

The important thing to remember is that unlike Windows, no one really owns or controls Linux. You can build any kind of distribution you want with many different kernel options. It makes things less tidy in some ways but far more flexible in others.

Duck
Depending on the system, there may also be section n for Tcl, 0p/1p/3p for POSIX headers/programs/library calls (when they differ from the system's), 3perl for Perldoc, and more.
ephemient
A: 

man 3 sleep

You can also browse them online, http://www.kernel.org/doc/man-pages/

Man pages are nice for reference, but they do not substitute a book on unix programming.

However, many libraries maintain browsable and verbose documentation. Like Qt, Boost, and many others.

Some tools are stand-alone projects, like Valgrind, and it's up to you to choose tools. The freedom to choose tools has a cost: there is no central point of reference.

But Google is the ultimate place to search for the appropriate tools, manuals and references. Actually, it's very good in finding and indexing unix programming manuals. Ctrl+K in Firefox, unix sleep function, and here you go.

jetxee
A: 

I heard some project called LDN,but unfortunately I don't know how to use it right now,you google for it.

Oh by the way,I'll look for something like MSDN for a while,if no luck,I'll try to do it myself.

If you got luck,let me know,[email protected]

thanks in advance.

bevin