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 CUNLNORM (normalization). The mapping of the parameter area supplied by the header file cunhc.h is listed in Mapping of parameters in C. A sample program, CUNSNSMC, is provided in SYS1.SAMPLIB.

#include<cunhc.h>
#define SLEN 10 
#define WLEN 40 
#define TLEN 40 
.....
unsigned char Sourcebuffer[SLEN]=
{'\x00','\x41','\x00','\x41','\x00','\xC0','\x00','\x41','\x00','\x41'};
unsigned char Workbuffer [WLEN ];
unsigned char Targetbuffer [TLEN ];

unsigned char DDA [CUNBNPRM_DDA_REQ ];
CUNBNPRM myparm ={CUNBNPRM_DEFAULT};

myparm.Src_Buf_Ptr=Sourcebuffer;
myparm.Wrk_Buf_Ptr=Workbuffer;
myparm.Targ_Buf_Ptr=Targetbuffer;

myparm.Targ_Buf_Len=TLEN;
myparm.Wrk_Buf_Len=WLEN;
myparm.Src_Buf_Len=SLEN;

myparm.DDA_Buf_Ptr=DDA;
myparm.DDA_Buf_Length=CUNBNPRM_DDA_REQ;
myparm.Norm_Type=CUNBNPRM_D;
CUNLNORM ( & myparm );
if((myparm.Return_Code !=CUN_RC_OK)......

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014