Ethereal-dev: Re: [Ethereal-dev] where is the main entry of ethereal-GTK?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Guy Harris" <gharris@xxxxxxxxx>
Date: Thu, 2 Feb 2006 20:12:24 -0800 (PST)
MCG Zhou Rui wrote:

> I am a beginner of GTK-programmer,
> where is the main entry(ethereal-GTK version)?which file and which main
> function?

On UN*X, it's main(), in gtk/main.c, as Jaap Keuter noted.

On Windows, it's WinMain(), but Ethereal's WinMain() just sets an internal
flag and calls main(), so the code doesn't have to differ very much
between UN*X and Windows.

> how does GTK load the program and make response to the window events and
> messages?
> is it like WIN32?

"Like Win32" in what sense?

GTK+ doesn't load the program; the program is linked with GTK+, so, when
the OS starts the program, the GTK+ libraries are loaded with it.  (The
Win32 GUI libraries work the same way.)

As for how it responds to window events, etc., you should probably ask
that question on the gtk-list mailing list:

    http://www.gtk.org/mailinglists.html

as it's not an Ethereal question (and does not have a very simple answer).

> where is the main entry of ethereal(command version)which file and which
> main function?

The command-line version is called Tethereal, and the main entry point is
main() in tethereal.c.