
B-66284EN/01 4.EMBEDDING OF C APPLICATIONS
- 363 -
(d) Library function which cannot be used by user function
The following functions cannot be used in a user function
for user screen display.
crt_setswt()
crt_setuserscrn()
crt_setuserskey()
crt_cncscrn()
(3) Registration of user function
Registration of a user function for user screen display is added to
the User_Pon_Func() function of USERFUNC.C. The
SetUserFunc() function is used to register a user function.
## Example> Registration of user function”usr_DispSample()” #############################
<< USERFUNC.C >>
void User_Pon_Func(void)
{
long ret;
ret = SetUserFunc(“usr_DispSample”, usr_DispSample);
switch (ret) {
case UFUNCERR_ALOC:
// Error processing
break;
case UFUNCERR_NAME:
// Error processing
break;
default:
break;
}
return;
}
####################################################################
Function specification of SetUserFunc()
[Function]
Registers a user function.
[Format]
long SetUserFunc(char *funcname, void (*funcadrs)())
[Arguments]
funcname Registered user function name
A function name must begin with "usr_" and be 30
characters or less.
Funcadrs Pointer of registered user function
[Retuen value]
0 normal return
-1 The result failed in the reservation of the registered area.
-2 The user function name is not correct.
-3 The user function name exceeds 30 characters.
[Attention]
The first eight characters of a user function for user screen
display must be "usr_Disp".