How to look up a system type?



(This thread was posted to lang.c by mistake. I think here is the right
place...)

Hi experts,

I am new to linux and all the type definitions are driving me mad. What
is the best way to check a type definition in linux? When I use man
page to check some function definition, I may come across new types.
How do you guys look up their definitions?

I tried to lookup ssize_t, what I do is trace (grep in glibc source
code)
to 'typedef __ssize_t ssize_t;',
then '__STD_TYPE __SSIZE_T_TYPE __ssize_t;'
then '#define __SSIZE_T_TYPE __SWORD_TYPE'
and finally '# define __SWORD_TYPE int'.

So 'int' it is, but that took me about 10 minutes... What is a better
way to do so? (any man page, web search, magic glibc function or bash
command that can give me the definition right away?)

=====
Another question popped up when I was trying to do something like:
#define SIZE_OF_T(T) printf("size = %d\n", sizeof(T))
to make my life a bit easier. How can I use 'T' in the "size ="
formating string? I want to get something like
size of ssize_t = 4
as output. Can anyone help?

Thanks a lot x2 for two questions


Best Regards
Leo

.



Relevant Pages

  • Re: Libc for FPC FreeBSD port
    ... These type definitions should be available in the FPC ctypes ... Which is linux specific, BSD doesn't know it. ... Posix interface should be a priority. ...
    (comp.lang.pascal.misc)
  • Use macro parameter in string; Find type definition
    ... I am new to linux and all the type definitions are driving me mad. ... magic glibc function or bash command that can give me the definition ...
    (comp.lang.c)
  • Re: How to look up a system type?
    ... I am new to linux and all the type definitions are driving me mad. ... (any man page, web search, magic glibc function or bash ...
    (comp.unix.programmer)
  • Re: Use macro parameter in string; Find type definition
    ... I am new to linux and all the type definitions are driving me mad. ... As a general rule the type definitions are provided so you don't need to know what the actual type is. ... size_t is the type for describing how big objects are and counts of objects and is defined by the C standard and should be mentioned in any good text book. ... Cast to unsigned in and use the appropriate format string, see the manpage for printf for the format string for unsigned int. ...
    (comp.lang.c)