9

I use the following dspcat command on AIX and can dump message catalogs created with the gencat command:

dspcat –g  /u/is/bin/I18N/l/lib/libca/libcalifornia.117.cat >> /tmp/message.smc

I have spent a good solid hour looking for hints on how to dump one of these catalogs on Linux but this command does not seem to be available. Any help would be appreciated.

ojblass
  • 343
  • 2
  • 10
  • I am not seeing much out there either. Would the ``strings`` command be enough to get what you need? Maybe with a little post processing? – Sean Perry Jun 13 '14 at 22:02
  • the strings are likely encoded... i'm not entirely sure if a shiftjis string would properly fall out of a stringed catalog file... I can try some testing. – ojblass Jun 13 '14 at 22:51
  • The format is likely not too hard to reverse engineer if the contents are valuable. – Sean Perry Jun 14 '14 at 01:32

1 Answers1

3

I found the source code for dspcat.c: http://www.smart.net/~rlhamil/. Specifically in this tarball. I tried compiling it and was missing a variable:

$ make
cc -O -DSOLARIS    dspcat.c   -o dspcat
dspcat.c: In function ‘format_msg’:
dspcat.c:11:23: error: ‘NL_TEXTMAX’ undeclared (first use in this function)
    static char result[NL_TEXTMAX*2+1];
                       ^
dspcat.c:11:23: note: each undeclared identifier is reported only once for each function it appears in
dspcat.c: In function ‘print_file’:
dspcat.c:240:23: error: ‘NL_SETMAX’ undeclared (first use in this function)
    int setlo=1, sethi=NL_SETMAX, msglo=1, msghi=NL_MSGMAX, x, y;
                       ^
dspcat.c:240:49: error: ‘NL_MSGMAX’ undeclared (first use in this function)
    int setlo=1, sethi=NL_SETMAX, msglo=1, msghi=NL_MSGMAX, x, y;
                                                 ^
dspcat.c: In function ‘main’:
dspcat.c:338:30: error: ‘NL_MSGMAX’ undeclared (first use in this function)
       if (msg_nr<1 || msg_nr>NL_MSGMAX) {
                              ^
dspcat.c:353:32: error: ‘NL_SETMAX’ undeclared (first use in this function)
       if (msg_set<1 || msg_set>NL_SETMAX) {
                                ^
make: *** [dspcat] Error 1

The variable NL_SETMAX does not appear to be defined on my system. I did locate this header file, bits/xopen_lim.h that did have this variable so I added this to the list of headers on a whim.

$ make
cc -O -DSOLARIS    dspcat.c   -o dspcat
dspcat.c: In function ‘format_msg’:
dspcat.c:11:33: warning: integer overflow in expression [-Woverflow]
    static char result[NL_TEXTMAX*2+1];
                                 ^
dspcat.c:11:16: error: size of array ‘result’ is negative
    static char result[NL_TEXTMAX*2+1];
                ^
dspcat.c:11:16: error: storage size of ‘result’ isn’t constant
dspcat.c:15:29: warning: integer overflow in expression [-Woverflow]
    for (x=0; x < (NL_TEXTMAX*2) && *s != '\0'; s++)
                             ^
make: *** [dspcat] Error 1

If I have more time I'll play with this, but I believe if you statically set that variable within the code directly you may be able to compile this yourself.

slm
  • 363,520
  • 117
  • 767
  • 871