[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problem with mutt sources - unknown C syntax?



On Sat, Jan 08, 2000 at 02:50:14PM +0000, Paul J. Keenan wrote:
> On Sat, Jan 08, 2000 at 12:24:26PM +0100, Wojciech Zabolotny wrote:
> > Hi All, 
> > 
> > The problem is that I don't know what does mean the underscore preceeding
> > the paranthesis around the string definition?
> > Is it a GCC extension?
> > -- 
> > 			Wojciech Zabolotny
> > 			http://www.ise.pw.edu.pl/~wzab
> 
> I don't have the mutt sources, but I just did a test, and underscore
> is a perfectly valid (if somewhat terse!) function name.  Look for a
> function definition returning a char * called _ in the source - it
> is probably used for preprocessing the string before printing it,
> perhaps to add "mutt[PID]: " to the beginning or something.

Now I do have the sources for mutt to do something unrelated, so looked at 
this again.  I tracked the definition to mutt.h :

#ifdef ENABLE_NLS
# include <libintl.h>
# define _(a) (gettext (a))

So it's a macro which defines _ as an alias to calling gettext, presumably
to keep the code less busy.  The gettext function returns the translation
of the text in the target language if you are using internationalisation.

-- 
Regards,
Paul


Reply to: