l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2006 Dec 26 20:17

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] strerror deprecated?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] strerror deprecated?

On Tue, Dec 26, 2006 at 03:55:34PM -0800, Richard Harke wrote:
> Just pragmatically, I'm afraid. I was going to suggest a short test program
> that ran through the error no's but that just covers english, and if you're 
> really determined, a small number of other languages. I expect that
> most languages will use short standard phrases but I have seen a few
> pathological translations (not from the computer field) that were wildly 
> different in length. Maybe Bill Kendrick could comment as his Tuxpaint
> is supported for a large number of languages.

Well, certainly supporting up to 4x the bytes would be necessary in
some cases (I allow strings to be encoded UTF-8, so each output character
may be between 1 and 4 bytes long).

Of course, I'm simply wrapping 'gettext()' calls around the strings,
and using the results in my own functions, e.g.:

  draw_tux_text(TUX_WAIT, gettext("Please wait..."), 1);

I don't need to worry about creating or destroying string buffers to hold
these... as gettext()'s man page says:

  "The resulting string is statically allocated and must not be
  modified or freed."

I DO need to worry about string buffers when doing any kind of manipulation,
just as I would with any other string... translated or not.
(e.g., if I want to strcat(), I need to malloc() the appropriate length to
hold all of the strings I'm concatenating)

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!