z/OS Unicode Services User's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Using the C interface

z/OS Unicode Services User's Guide and Reference
SA38-0680-00

This is the call syntax in C for calling the stub routine CUNLCNV (character conversion). The mapping of the parameter area supplied by the header file cunhc.h is listed in Mapping of parameters in C. A sample program, CUNSCSMC, is provided in SYS1.SAMPLIB.

#include<cunhc.h>
#define SLEN 1000
#define WLEN 1000
#define TLEN 4096
.....
unsigned char Sourcebuffer [SLEN ];
unsigned char Targetbuffer [TLEN ];
unsigned char Workbuffer [WLEN ];
unsigned char DDA [CUNBCPRM_DDA_REQ ];

CUNBCPRM myparm ={CUNBCPRM_DEFAULT};
myparm.Src_Buf_Ptr=Sourcebuffer;
myparm.Targ_Buf_Ptr=Targetbuffer;
myparm.Targ_Buf_Len=TLEN;
myparm.Src_Buf_Len=SLEN;
myparm.Src_CCSID=850;
myparm.Targ_CCSID=1047;
memcpy(myparm.Technique,"LMER",4);
myparm.Wrk_Buf_Ptr=Workbuffer;
myparm.Wrk_Buf_Len=WLEN;
myparm.DDA_Buf_Ptr=DDA;
myparm.DDA_Buf_Len=CUNBCPRM_DDA_REQ;
CUNLCNV ( & myparm );
if((myparm.Return_Code !=CUN_RC_OK)......

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014