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 CUNLSTRP or CUN4LSTP (stringprep conversion). The mapping of the parameter area supplied by the header file cunhc.h is listed in Mapping of parameters in C.

#include<cunhc.h>
#define SLEN  1024
#define W1LEN 4096
#define W2LEN 4096
#define DDAL  4096
#define TLEN  4096
.....
unsigned char Sourcebuffer [SLEN];
unsigned char Workbuffer1  [W1LEN];
unsigned char Workbuffer2  [W2LEN];
unsigned char DDABuffer    [DDAL];
unsigned char Targetbuffer [TLEN];

#ifdef _LP64        /* 64 bit */
CUN4BPPR myparm ={CUN4BPPR_DEFAULT};
#else               /* 31 bit */
CUNBPPRM myparm ={CUNBPPRM_DEFAULT};
#endif

strcpy(Myparm.Profile_name,"CUNSTCIS");
Myparm.Src_Buf_Ptr  = Sourcebuffer;
myparm.Wrk1_Buf_Ptr = Workbuffer1;
myparm.Wrk2_Buf_Ptr = Workbuffer2;
myparm.Targ_Buf_Ptr = Targetbuffer;
Myparm.Src_Buf_Len  = SLEN;
Myparm.Wrk1_Buf_Len = W1LEN;
Myparm.Wrk2_Buf_Len = W2LEN;
myparm.Targ_Buf_Len = TLEN;

#ifndef _LP64       /* 31 bit */
CUNLSTRP(&myparm);
#else               /* 64 bit */
CUN4LSTP(&myparm);
#endif

if((myparm.Return_Code != CUN_RC_OK)......

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014