NAME
irDynSwitch, irDynSwitchAdd, irDynSwitchCheck, irVA-
DynSwitch, irVADynSwitchAdd, irVADynSwitchCheck,
irDynSwitchAll - execute/add/check functions in dynamic
switch tables
SYNOPSIS
#include <irapi.h>
#include <dynSwitch.h>
int irDynSwitch (IRI_DYN_SW *swp, int val, void * ptr1, void
* ptr2, int arg);
int irDynSwitchAdd (IRI_DYN_SW *swp, int val, int
(*funcp)(void *ptr1, void *ptr2, int arg));
int irDynSwitchCheck (IRI_DYN_SW *swp, int val);
int irVADynSwitch (IRI_VA_DYN_SW *swp, int val, int id,
va_list args);
int irVADynSwitchAdd (IRI_VA_DYN_SW *swp, int val, int
(*funcp)(int id, va_list args));
int irVADynSwitchCheck (IRI_VA_DYN_SW *swp, int val);
int irVADynSwitchAll (IRI_VA_DYN_SW *swp, int id, va_list
args);
DESCRIPTION
The function irDynSwitch searches the dynamic switch table
pointed by swp for a val field matching the val argument.
If a matching val is found then then the function funcp
corresponding to val is executed with the argument list
ptr1, ptr2, arg The return code from irDynSwitch is the
return code from funcp. If no match for val is found and
there is an entry in the table with a val of
IRID_DEFAULT_CASE then the function corresonding to
IRID_DEFAULT_CASE is executed.
The function irDynSwitchAdd searches the dynamic switch
table pointed by swp for a val field matching the val argu-
ment. If a matching val is found then then the function
funcp corresponding to val is replaced with the funcp argu-
ment passed to irDynSwitchAdd. If there is no match for val
and there is room for a new entry a new entry is added to
the dynamic switch table consisting of val and funcp.
The function irDynSwitchCheck searches the dynamic switch
table pointed by swp for a val field matching the val
argument. If a matching val is found then irDynSwitchCheck
returns IRR_OK. If no match is found and the
IRID_DEFAULT_CASE is reached before the end of the table
then IRR_FAIL is returned and irError is set to
IRER_ENDOFTABLE. If the IRID_DEFAULT_CASE is not reached
before the end of the table irDynSwitchCheck returns
IRR_FAIL and sets irError to IRER_OVERFLOW.
The function irVADynSwitch searches the dynamic switch table
pointed bo by swp for a val field matching the val argument.
If a matching val is found then then the function funcp
corresponding to val is executed with the argument list id,
args The return code from irVADynSwitch is the return code
from funcp. If no match for val is found and there is an
entry in the table with a val of IRID_DEFAULT_CASE then the
function corresonding to IRID_DEFAULT_CASE is executed.
The function irVADynSwitchAdd searches the dynamic switch
table pointed to by swp for a val field matching the val
argument. If a matching val is found then then the function
funcp corresponding to val is replaced with the funcp argu-
ment passed to irVADynSwitchAdd. If there is no match for
val and there is room for a new entry a new entry is added
to the dynamic switch table consisting of val and funcp.
The function irVADynSwitchCheck searches the dynamic switch
table pointed to by swp for a val field matching the val
argument. If a matching val is found then
irVADynSwitchCheck returns IRR_OK. If no match is found and
the IRID_DEFAULT_CASE is reached before the end of the table
then IRR_FAIL is returned and irError is set to
IRER_ENDOFTABLE. If the IRID_DEFAULT_CASE is not reached
before the end of the table irVADynSwitchCheck returns
IRR_FAIL and sets irError to IRER_OVERFLOW.
The function irVADynSwitchAll executes every function in the
dynamic switch table pointed to by swp except for the func-
tion corresponding to IRID_DEFAULT_CASE. The argument list
each sub-function receives is id args The return code for
irVADynSwitchAll is IRR_OK if the return code from each
sub-function is IRR_OK otherwise, the return code is
IRR_FAIL.
RETURN VALUE
IRR_OK is returned on success. IRR_FAIL is returned on
failure.
CAVAET
These functions should be used only for dynamic switch
tables documented in IrEXTEND.
SEE ALSO
IrEXTEND(4IRAPI)
VERSION
This is version 11/25/02 of this man page.