> > I had a strange problem with an error when linking the libs with the lua plugin, but the error vanished somehow. I hope the makefiles work for others, too.
> >
> > BTW, Luis I noticed that your "Hello World" demo doesn't print anything anywhere, even not into the debug window, when using it with ethereal. tethereal works fine with lua. Is this windows specific or is the print function not supported in ethereal?
>
> I think writing to stdout does not work with eteheral on windows, the
> more, just yesterday while working on main.c I've skim-read some
> comment that hinted me that writing to stdout might cause problems to
> the capture child on windows.
>
> Ulf, can you confirm that?
I don't know the exact "lua way", I'll explain the "C way".
The problem is, if you simply use:
printf("Hello World!");
you won't see anything, as no console is opened. You can change this by setting the Preference Setting "Open a console window" to "Always" (which is set to "Never" by default). The setting "Automatic" will open a console the first time one of the glibs logging functions are called (e.g. g_warning).
Of course, if the printf is done before the Preferences are read in, you still won't see anything. I don't know at which time the lua script is processed.
While using tethereal, theres obviously a console available, so the problem doesn't appear.
The current code uses the same main function for both Ethereal as the main application and as a capture child task. The communication between the main and the child task is done using a pipe which in turn uses stdout.
You shouldn't put anything to stdout in the main function until capture_loop_start() is called (main.c lines 1857-2638, including all subfunctions called)!
This will change if I'll find the time to change it, so we use dumpcap instead of Ethereal for the capturing task.
>
> In that case I I'll have override lua's "print" and write our own that
> uses g_log instead of printf and make sure that stdout is not directly
> accessible from Lua when running ethereal (at least on Windows).
>
For the reasons above this sounds like a good idea.
However, as the default setting for the console is "Never", the common user still won't see anything for Ethereal on Windows.
Regards, ULFL
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193