473,783 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

some doubts in glib code

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=hid den.
i have two doubt regarding this.
1in the generated header galias.h there is a syntax
#define IN_FILE(x) 1
#define IN_HEADER defined

#if IN_HEADER(__G_A RRAY_H__)
#if IN_FILE(__G_ARR AY_C__)
extern __typeof (g_array_append _vals) IA__g_array_app end_vals
__attribute((vi sibility("hidde n")));
#define g_array_append_ vals IA__g_array_app end_vals
....
......
#endif
#endif

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

2secondly , 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

Jun 29 '08 #1
1 1787
On Sun, 29 Jun 2008 04:26:20 -0700 (PDT),
"ra************ *******@gmail.c om" <ra************ *******@gmail.c om>
wrote:
>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=hi dden.
i have two doubt regarding this.
1in the generated header galias.h there is a syntax
#define IN_FILE(x) 1
#define IN_HEADER defined

#if IN_HEADER(__G_A RRAY_H__)
#if IN_FILE(__G_ARR AY_C__)
extern __typeof (g_array_append _vals) IA__g_array_app end_vals
__attribute((v isibility("hidd en")));
#define g_array_append_ vals IA__g_array_app end_vals
...
.....
#endif
#endif

whnat does #define IN_HEADER defined mean.. and how is it used
in this context.
It tells the compiler that whenever it sees the token
IN_HEADER
it should substitute the token
defined

Consequently, the directive
#if IN_HEADER(__G_A RRAY_H__)
is processed as if it were
#if defined(__G_ARR AY_H__)

It takes some reasonably obvious syntax and obfuscates it by adding an
alias. In my opinion, this is one of those bad ideas along the lines
of
#define BEGIN {
>
2secondly , 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....
Ask in a glib group.
Remove del for email
Jun 29 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2649
by: Arjan | last post by:
Hi, I want to open a serial port (COM1) in my Windows program (C), and I would like to use the Glib IOchannels to do this. Does anybody know how to do this? Examples maybe? Thanks in advance, Arjan
6
1369
by: Chua Wen Ching | last post by:
Hi there, I have some questions to ask... just say i have this xml file: Scenario :- Script.xml ======== <software> <settings>
8
1786
by: lovecreatesbeauty | last post by:
Hello experts, I have seen following the code snippet given by Marc Boyer (with slight changes by me for a better format), and have doubts on it. I am so grateful if you can give me your kindly help and hints on this problem. 1. Does the function call `foo(3, 3, tab);' refer to the data outside the array `int tab;'. The available subscription for a 3X3 2-D array should be 0..2 X 0..2, I think.
7
1986
by: ramasubramanian.rahul | last post by:
hi i was trying to see how the compiler hides the static golbals from the linker and allows golbal varibale to be visable to the linker.i managed to figure out how it did that ( the .lcomm and .comm sections) but the assembly code for the c program raised a few more doubts . i am enclosing the .c and the .s files .. if someonce could expain what the starred statements in the .s file mean.. i would be greatful the .c file is as follows
1
5687
by: Loic Mahe | last post by:
Hello, I would like to compile GLib as a static library on Windows XP with MinGW if possible. I downloaded GLib and needed librairies, but only the .dll files are included in the zip file. I manage to create a static lib project with CodeBlocks IDE. and I manage to use Glib as a dynamic lib but not as a static one.
1
2249
by: lumpybanana247 | last post by:
~~~"glib.h: No such file or directory. "~~~ I am using DevC++ to compile a program and it says "glib.h: No such file or directory. " I do not have any parameters set up, but it does appear that i have the glib files i would need in my compilers directory. what would i change with my program to fix this?
10
3862
by: akappa | last post by:
Hi, I want to serialize a glib data type (an hash), but I don't want to access directly to the fields of the various structs, since it's an opaque data type: there is one "more-or-less standard way to do it" that it's more efficient than read all the fields with the iterator, saves them on file and successively recreating the hash putting them once per time? Thanks in advice.
37
9058
by: Michael Palmer | last post by:
As anyone knows, the state of Python GUI programming is a little fractured at this time, with many toolkits, wrappers and meta-wrappers dead and alive, with or without documentation. I've come across two projects that have the appeal of striving for simple, pythonic APIs: PyGUI and wax. The latter is a wrapper around wxPython. It is lacking documentation but actually quite usable and concise. The other, PyGUI, has an even nicer API and...
4
4636
by: MN | last post by:
Hi all, I'm learning how to use some Glib-functions for simple linked list. I wrote a small program that prepends 2 data (let's say to integers "1" and "2") in list, display them, count total number of elements and returns index of each element. How to avoid these warnings? warning: passing argument 1 of ‘g_list_nth’ from incompatible pointer type warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘struct GList *’
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.