After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 337797 - Command line parsing to enable debug output
Command line parsing to enable debug output
Status: RESOLVED FIXED
Product: ekiga
Classification: Applications
Component: general
GIT master
Other Windows
: Normal normal
: ---
Assigned To: Snark
Ekiga maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-09 12:50 UTC by Snark
Modified: 2006-04-10 18:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Michael Rickmann's solution (2.21 KB, patch)
2006-04-09 12:51 UTC, Snark
none Details | Review
adds msvcrt.dll command line parsing to Win32 Ekiga (1.35 KB, patch)
2006-04-10 12:27 UTC, Michael Rickmann
none Details | Review

Description Snark 2006-04-09 12:50:10 UTC
According to Michael Rickmann, debug output doesn't work properly on win32.
Comment 1 Snark 2006-04-09 12:51:22 UTC
Created attachment 63017 [details] [review]
Michael Rickmann's solution
Comment 2 Snark 2006-04-09 13:03:52 UTC
I don't like to have new command-line parsing code.

Why doesn't GOption work to do that ?
Comment 3 Michael Rickmann 2006-04-09 19:26:29 UTC
I am no GOption expert. The only way I see to submit anything to GOption is through g_option_context_parse which requires argc and argv. Unfortunately Windows only provides you with a string. The lpCmdLine of WinMain does not even contain the program name. So we will have to use GetCommandLine () to get a complete string. There is a shell api function (forgotten the name), which returns argc and argv but in wide chars, i.e. Unicode, UTF-16 which is unusable for us. If you do not like parsing the argv, argc directly I can offer an alternative: a) copy that string while converting back into forward slashes, b) and have it parsed by  g_shell_parse_argv. This should work since Windows also accepts forward slashes in path names. g_shell_parse_argv filters out all not escaped backslashes. Perhaps it would be better to read once, count the backslashes, allocate string, read the second time while escaping, g_shell_parse_argv. I have to try.
Regards
Michael
Comment 4 Michael Rickmann 2006-04-10 12:27:24 UTC
Created attachment 63103 [details] [review]
adds msvcrt.dll command line parsing to Win32 Ekiga
Comment 5 Michael Rickmann 2006-04-10 12:52:01 UTC
Ok, above is a new solution to Win32 Ekiga's command line parsing: have msvcrt.dll do it for us. It is very short, but works, and we have msvcrt.dll on board anyhow. The MingW runtime does it similarly. I do not know wether you like the declarations at that place, they do not really fit to the others.
Regards
Michael
Comment 6 Snark 2006-04-10 18:18:32 UTC
It didn't apply well because it depended on an SDL patch, but I made it apply anyway, since I really liked it :-)