apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mattias EngdegÄrd <matti...@bredband.net>
Subject [PATCH] getopt error codes
Date Sat, 07 Dec 2013 20:21:29 GMT
The error messages of getopt are tricky to localise properly, since  
they are served as fprintf-like function invocations only. Since there  
is only very few distinct messages, the best solution is to introduce  
some sort of codes that the application can do whatever it wants with.

Here is a patch that does exactly that. It is entirely source and, by  
virtue of a slightly sleazy hack, binary compatible. That hack can be  
eliminated if we get to break binary compatibility; source  
compatibility would still be retained. I'd suggest using the hack in  
1.x and doing it cleanly (by adding a apr_getopt_t member) in 2.x.

The getopt code is ancient and it shows: nobody would have exposed a  
struct like that in an API design today, but it's what we have to work  

Please review, and tell me if I should supply a commit message,  
CHANGES addition and so on. The patch is against trunk.

View raw message