XIM_STR_CONVERSION_REPLY message is strange

Choe Hwanjin <[email protected]>
Newsgroups gmane.comp.xfree86.internationalization
Message-ID <20031226161030.GA8099@localhost>
Hello,

I have a question about XIM_STR_CONVERSION_REPLY message.
On XIM spec, XIM_STR_CONVERSION_REPLY is defined as:

    2  CARD16            input-method-ID
    2  CARD16            input-context-ID
    4  CARD32            XIMStringConversionFeedback
       XIMSTRCONVTEXT    XIMStringConversionText

but xfree86 source does not conform to this.
xc/lib/X11/imCallbk.c:394 is :

        _XimSetHeader((XPointer)buf, XIM_STR_CONVERSION_REPLY, 0, &buf_len);
        buf_len -= XIM_HEADER_SIZE; /* added by _XimSetHeader (HACK) */
        p = XIM_HEADER_SIZE;
        *(CARD16*)&buf[p] = (CARD16)im->private.proto.imid; p += sz_CARD16;
        *(CARD16*)&buf[p] = (CARD16)ic->private.proto.icid; p += sz_CARD16;
        *(CARD16*)&buf[p] = (CARD16)cbrec.text->length; p += sz_CARD16;
        ~~~~~~~~~~~~~~~~~
               +----> this is not XIMStringConversionFeedback

        memcpy(&buf[p],&cbrec.text->string.mbs,length_in_bytes);
        p += length_in_bytes;
        *(CARD16*)&buf[p] = (CARD16)(sz_CARD32*cbrec.text->length);
        p += XIM_PAD(2);
        for (i = 0; i < (int)cbrec.text->length; i++) {
            *(CARD32*)&buf[p] = (CARD32)cbrec.text->feedback[i];
            p += sz_CARD32;
        }

On the other hand, IMdkit comform to XIM spec, it define structure for 
XIM_STR_CONVERSION_REPLY as:

xim_externaldef XimFrameRec str_conversion_reply_fr[] =
{
    _FRAME(BIT16),              /* input-method-ID */
    _FRAME(BIT16),              /* input-context-ID */
    _FRAME(BIT32),              /* XIMStringConversionFeedback */
    _FRAME(BIT16),              /* length of the retrieved string */
    _FRAME(BARRAY),             /* retrieved string */
    _PAD4(2),
    _BYTE_COUNTER(BIT16, 2),    /* number of feedback array */
    _PAD4(1),
    _FRAME(ITER),               /* feedback array */
    _FRAME(BIT32),
    _FRAME(EOL),
};

Which is right?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.