Preprocessor directives and gettext - patch for pidgin-mtn/pidgin/gtkmain.c

Ethan Blanton elb at pidgin.im
Thu Sep 20 16:32:33 EDT 2007


Etan Reisner spake unto us the following wisdom:
> Thinking about this again, if we simply set opterr to 0 (so getopt stops
> bailing on unknown arguments for us) and then check to see if anything is
> left in argv/argc after we call gtk_init_check I *think* we can only parse
> arguments once ourselves, let GTK+ options propagate to GTK+, and keep our
> current die-on-unrecognized-arguments behaviour. That is of course
> assuming that both getopt and GTK+ remove arguments that they have
> handled, which I know is the case for GTK+ but I am unsure about for
> getopt.

getopt does not remove arguments it has handled, but it rearranges the
argument list so that they are at the beginning, and updates 'optind'
to point at the first unrecognized argument.  What we should be able
to do is parse our arguments, store optind, then let Gtk+ at its
arguments, and check that argv[optind] == NULL.

Ethan

-- 
The laws that forbid the carrying of arms are laws [that have no remedy
for evils].  They disarm only those who are neither inclined nor
determined to commit crimes.
		-- Cesare Beccaria, "On Crimes and Punishments", 1764
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://pidgin.im/pipermail/devel/attachments/20070920/1de5c717/attachment.sig>


More information about the Devel mailing list