Discussion:
wanted: dspcat (reverse of gencat(1))
Richard L. Hamilton
2008-07-24 14:47:28 UTC
Permalink
Tru64/OSF1 and AIX have this; it's handy to re-create an alternative, translated,
or extended version of a message catalog as produced by gencat(1), when one
only has the binary message catalog. Google for gencat to see the existing
implementations' man pages.

The only problem is that there is no standard function to enumerate the messages
in a catalog, only catopen(3c), catgets(3c), and catclose(3c).

I have created an implementation, that can be either compiled portably (which implies
attempting catgets(3c) with all legal values for set_num and msg_num; a very
slow brute-force approach), or with Solaris-specific code that is sufficiently aware
of the implementation of the existing functions to be able to efficiently enumerate
a message catalog. I even have a man page.

The usage (from the Tru64 man page) is
dspcat [ -g ] message_catalog [ set_number ]
or
dspcat message_catalog [ set_number [ msg_number ] ]
with as that implies, -g and msg_number being mutually exclusive. With -g,
the output can be fed back into gencat. Without it, the output format is
unspecified (because I have no samples of output from the existing implementations).

Is there sufficient interest to justify actually filing an RFE, getting a sponsor, etc?
Since this depends on internals of catgets() and friends, it should probably go into ON,
and a comment into catgets.c to the effect that dspcat.c also depends
on implementation details.

Loading...