Pár perce olvasgattam egy Gtk tutoriált, és megakadt a szemem ezen:
gtk_builder_connect_signals (builder, NULL);
Ez ugye automatikusan beállítja a callback fv-eket (aka. signal connect).
A kérdés csak az, hogy hogyan?
Dynamic lib-nél még olvasható lenne a szimbólumtábla, de itt csak egy futtatható állomány van. Mégis hogy működik ez?
- 964 megtekintés
Hozzászólások
Nem tudom, hogy pontosan hogy működik, de futás közben is értelmezhető a symtable a dynamic linker segítségével (lásd pl pluginok). Szerintem ha dlopen-el megnyitod argv[0]-át, az is menni fog. (Tipp)
- A hozzászóláshoz be kell jelentkezni
A tipp majdnem jó:
"The function dlopen() loads the dynamic library file named by the null-terminated string filename and returns an opaque "handle" for the dynamic library. If filename is NULL, then the returned handle is for the main program."
Már csak egy kérdés maradt:
Végig lehet iterálni valahogy a szimbólumtábla bejegyzésein?
"...handing C++ to the average programmer seems roughly comparable to handing a loaded .45 to a chimpanzee."
-- Ted Ts'o
- A hozzászóláshoz be kell jelentkezni
This function uses GModule, a part of GLib used to dynamically load modules, to look at our applications symbol table (function names, variable names, etc.) to find the function name that matches the handler name we specified in Glade.
http://www.micahcarrick.com/01-01-2008/gtk-glade-tutorial-part-3.html#5
--
A gyors gondolat többet ér, mint a gyors mozdulat.
- A hozzászóláshoz be kell jelentkezni
Pont az a kérdés, hogy a GModule hogy működik. Mert itt nincs semmilyen modul.
"...handing C++ to the average programmer seems roughly comparable to handing a loaded .45 to a chimpanzee."
-- Ted Ts'o
- A hozzászóláshoz be kell jelentkezni
Eszerint -> http://library.gnome.org/devel/glib/unstable/glib-Dynamic-Loading-of-Mo…
dlopen()-t használva.
Még hasznosnak tűnő kulcsszavak: libelf, nlist()
--
A gyors gondolat többet ér, mint a gyors mozdulat.
- A hozzászóláshoz be kell jelentkezni