[xml] EBCDIC API



Hi,

I need to use lib xml in an EBCDIC program. lib xml is obviously prepared to be compiled with a compiler that handles strings in ASCII.
Has someone already done something the area?

For me the best idea seems to write a wrapper that will wrap the API calls and do in each call the needed conversions.
The ideas is the following:
* -For each API call that needs conversion redefine the API call to *_ascii. For example:
+++
#define xmlReadMemory xmlReadMemory_ascii
+++
Then compile the lib xml in ASCII.
- Have a wrapper routine with normal API call name that does the conversion. For example:
+++
sxmlDocPtr      xmlReadMemory           (const char * buffer,
                                         int size,
                                         const char * URL,
                                         const char * encoding,
                                         int options)
{
        sxmlDocPtr ret;
        e2a(URL);
        e2a(encoding);
        ret = xmlReadMemory_ascii(buffer,size,URL,encoding,options);
        if (ret is_ok)
          a2e(buffer);
        a2e(URL);
        a2e(encoding);
        return(ret);
}
+++
Any comments?

Cheers

Jean-Frederic




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