GNOME Bugzilla – Bug 337797
Command line parsing to enable debug output
Last modified: 2006-04-10 18:18:32 UTC
According to Michael Rickmann, debug output doesn't work properly on win32.
Created attachment 63017 [details] [review] Michael Rickmann's solution
I don't like to have new command-line parsing code. Why doesn't GOption work to do that ?
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
Created attachment 63103 [details] [review] adds msvcrt.dll command line parsing to Win32 Ekiga
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
It didn't apply well because it depended on an SDL patch, but I made it apply anyway, since I really liked it :-)