src/pl/tcl/pltcl.c
static int
pltcl_argisnull(ClientData cdata, Tcl_Interp *interp,
				int objc, Tcl_Obj *const objv[])
{
	int			argno;
	FunctionCallInfo fcinfo = pltcl_current_call_state->fcinfo;

	/************************************************************
	 * Check call syntax
	 ************************************************************/
	if (objc != 2)
	{
		Tcl_WrongNumArgs(interp, 1, objv, "argno");
		return TCL_ERROR;
	}

	/************************************************************
	 * Check that we're called as a normal function
	 ************************************************************/
	if (fcinfo == NULL)
	{
		Tcl_SetObjResult(interp,
						 Tcl_NewStringObj("argisnull cannot be used in triggers", -1));
		return TCL_ERROR;
	}

	/************************************************************
	 * Get the argument number
	 ************************************************************/
	if (Tcl_GetIntFromObj(interp, objv[1], &argno) != TCL_OK)
		return TCL_ERROR;

	/************************************************************
	 * Check that the argno is valid
	 ************************************************************/
	argno--;
	if (argno < 0 || argno >= fcinfo->nargs)
	{
		Tcl_SetObjResult(interp,
						 Tcl_NewStringObj("argno out of range", -1));
		return TCL_ERROR;
	}

	/************************************************************
	 * Get the requested NULL state
	 ************************************************************/
	Tcl_SetObjResult(interp, Tcl_NewBooleanObj(PG_ARGISNULL(argno)));
	return TCL_OK;
}
/**********************************************************************
 * pltcl_argisnull()	- determine if a specific argument is NULL
 **********************************************************************/
pltcl_argisnull()    - determine if a specific argument is NULL
pltcl_argisnull () - determine if a specific argument is NULL
static int
pltcl_argisnull(ClientData cdata, Tcl_Interp *interp,
				int objc, Tcl_Obj *const objv[])
{
	int			argno;
	FunctionCallInfo fcinfo = pltcl_current_call_state->fcinfo;
	if (objc != 2)
	{
		Tcl_WrongNumArgs(interp, 1, objv, "argno");
		return TCL_ERROR;
	}
	if (fcinfo == NULL)
	{
		Tcl_SetObjResult(interp,
						 Tcl_NewStringObj("argisnull cannot be used in triggers", -1));
		return TCL_ERROR;
	}
	if (Tcl_GetIntFromObj(interp, objv[1], &argno) != TCL_OK)
		return TCL_ERROR;
	argno--;
	if (argno < 0 || argno >= fcinfo->nargs)
	{
		Tcl_SetObjResult(interp,
						 Tcl_NewStringObj("argno out of range", -1));
		return TCL_ERROR;
	}
	Tcl_SetObjResult(interp, Tcl_NewBooleanObj(PG_ARGISNULL(argno)));
	return TCL_OK;
}
static int pltcl_argisnull ( ClientData cdata , Tcl_Interp * interp , int objc , Tcl_Obj * const objv [ ] ) { int argno ; FunctionCallInfo fcinfo = pltcl_current_call_state -> fcinfo ; if ( objc != 2 ) { Tcl_WrongNumArgs ( interp , 1 , objv , " " ) ; return TCL_ERROR ; } if ( fcinfo == NULL ) { Tcl_SetObjResult ( interp , Tcl_NewStringObj ( " " , -1 ) ) ; return TCL_ERROR ; } if ( Tcl_GetIntFromObj ( interp , objv [ 1 ] , & argno ) != TCL_OK ) return TCL_ERROR ; argno -- ; if ( argno < 0 || argno >= fcinfo -> nargs ) { Tcl_SetObjResult ( interp , Tcl_NewStringObj ( " " , -1 ) ) ; return TCL_ERROR ; } Tcl_SetObjResult ( interp , Tcl_NewBooleanObj ( PG_ARGISNULL ( argno ) ) ) ; return TCL_OK ; }
pltcl_argisnull()    - determine if a specific argument is NULL
pltcl_argisnull () - determine if a specific argument is NULL
/************************************************************
	 * Check call syntax
	 ************************************************************/ /************************************************************
	 * Check that we're called as a normal function
	 ************************************************************/ /************************************************************
	 * Get the argument number
	 ************************************************************/ /************************************************************
	 * Check that the argno is valid
	 ************************************************************/ /************************************************************
	 * Get the requested NULL state
	 ************************************************************/