doubts in glib - Linux

This is a discussion on doubts in glib - Linux ; hi people.. dont know if this the right forum for this doubt ... so sorry if i am mis-posting... i was looking at the way glib 2.10.3 does export optimization using a list of "to be exposed" function names in ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: doubts in glib

  1. doubts in glib

    hi people..
    dont know if this the right forum for this doubt ... so sorry if i am
    mis-posting...
    i was looking at the way glib 2.10.3 does export optimization using a
    list of "to be exposed" function names in a file caleed glib.symbols.
    this file is used by a perl script to generate a header a .c file
    ( galias.h and galiasdefs.c). This files essentially enusres default
    visibility for these functions (using the __attribute__((default))__
    option) , while building the rest of the functions with -
    fvisibility=hidden.
    i have two doubt regarding this.
    1> in the generated header galias.h there is a syntax
    #define IN_FILE(x) 1
    #define IN_HEADER defined

    #if IN_HEADER(__G_ARRAY_H__)
    #if IN_FILE(__G_ARRAY_C__)
    extern __typeof (g_array_append_vals) IA__g_array_append_vals
    __attribute((visibility("hidden")));
    #define g_array_append_vals IA__g_array_append_vals
    ....
    ......
    #endif
    #endif

    whnat does #define IN_HEADER defined mean.. and how is it used
    in this context.

    2> secondly , how does glib maintain the glib.symbols list .. is it
    manual or does it use some kind of a parser to parse through the
    include folder of glib to come up with the list...
    hope i have been able to clearly state my doubts....
    thanks in advance for the replies and help...
    BR
    Rahul

  2. Re: doubts in glib

    On Jun 29, 6:50*pm, "ramasubramanian.ra...@gmail.com"
    wrote:

    > whnat does * * #define IN_HEADER defined * * mean..


    It causes 'IN_HEADER' to be a defined preprocessor symbol, with a
    replacement of "defined".

    > and how is it used
    > in this context.


    It is simply tested for existence, and then '#define' makes it exist.

    > 2> secondly , how does glib maintain the glib.symbols list .. is it
    > manual or does it use some kind of a parser to parse through the
    > include folder of glib to come up with the list...
    > hope i have been able to clearly state my doubts....
    > thanks in advance for the replies and help...


    I believe it is manual. A change to the defined external interface of
    a library is a significant change that is always made by a human. I
    requires changes to documentation and in several other places.

    It's possible the glib.symbols list is built from a documentation file
    by an automated process so that adding a new interface function's
    interface specification causes the symbol list to update. That
    documentation may be embedded in the code. I'm not sure in the
    specific case of glib which of those methods it uses.

    DS

  3. Re: doubts in glib

    thanks DS

  4. Re: doubts in glib

    Real message restored

    ramasubramanian.rahul@gmail.com wrote:
    > thanks DS


+ Reply to Thread