Mohan R wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Sujith wrote:
> > 
> > http://www.gnu.org/software/libc/
> 
> Also this,
> 
> http://www.gnu.org/software/libc/manual/pdf/libc.pdf
> 
> If you need source, download the tarball.
> 
> http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2.
> 
> I have a question, is there any way that I can list all the functions
> declared in a header? or header files?
> 
> Until now, I'm using the below one, but don't know whether this is right
> or wrong?
> 
> $ grep '^extern' /usr/include/stdio.h
> $ find /usr/include/X11 -name '*.h' | xargs grep '^extern'
> 
> Do we need to declare all the functions as 'extern'? is this a standard?
>  and do we need to define all functions as 'static'? what is the impact
> if I don't declare my function as static? on the whole, what is mean by
> 'namespace'?

You can use a better regexp to get all the functions in a header file,
since it isn't needed to declare all the function prototypes as either
'extern' or 'static'. Tools like ctags/cscope would be helpful.

'Namespaces' are purely a C++ thing, and since the standard libc headers can
be included from C++ programs too, appropriate enclosures have to be used to
make the C++ compiler (g++, for example) happy. Namespaces are comparatively
new when compared with the old extern "C" { /* bleh_function_in_C() */ } 
construct.

Sujith
-- 
http://sujith-m.blogspot.com
_______________________________________________
To unsubscribe, email [email protected] with 
"unsubscribe <password> <address>"
in the subject or body of the message.  
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to