Programming Guide |
Processes a handling method property
#include <tmusubs.h>int sm_tm_handling(int prop);
prop
- One of the property constants.
- ·
TM_PROCEED
if the property value specifies something other than function invocation or doing nothing, or ifdm_tm_listing_sql
is being done.
sm_tm_handling
analyzes and, in some cases, processes the handling specified (indirectly) by theprop
parameter for the specified table view. If the parameter isDM_SEL_FUNC_NAME
,DM_INS_FUNC_NAME
,DM_UPD_FUNC_NAME
orDM_DEL_FUNC_NAME
, the handling is that of the correspondingPR_xxx_HANDLING
property. Ifprop
isDM_CONTINUE_FUNC_NAME
, the choice of behavior is based onDM_SELECT_HANDLING
, but the function invoked, if any, is theCONTINUE
function. Ifprop
isDM_SAVE_FUNC_NAME
, the function (if any) specified by that property is invoked if any of the insert, update or delete handling properties specify function invocation. OtherwiseTM_OK
is returned.If the property value specifies to do nothing, this routine simply returns
TM_OK
.If the property value specifies to invoke a function, this routine calls it; the function has no parameters. If the function returns a non-zero integer, and the
TM_STATUS
member ofsm_tm_curinfo
is zero, this routine puts that value there; it similarly proposes a generalized error message, if none has been set up. The return value from this routine isTM_FAILURE
(for an error on the function call or a non-zero return from the function), orTM_OK
for a successful call with a zero value returned by the function. Absence of the corresponding function name value is an error, except forCONTINUE
andSAVE
functions. However, inability to find a function whose name has been specified as a property value is always an error. For this and other serious processing errors in function invocation, this routine reports an error and displays an error message.Otherwise this routine returns
TM_PROCEED
.Since the handling properties are stored internally as strings, the property API access functions are used to get the more convenient
PV_
integers.If
dm_tm_listing_sql
is being done, this routine always returnsTM_PROCEED
.