typedefstruct{
UCHAR (*const GetFunc)(void);
}UCHAR_CPMTS;
typedef struct{
UINT (*const GetFunc)(void);
}UINT_CPMTS;
typedefstruct{
void(*constSetFunc)(UCHAR);
}UCHAR_CPMTS_INIT;
typedefstruct{
void(*constSetFunc)(UINT);
}UINT_CPMTS_INIT;
static
const UCHAR_CPMTS UCHAR_GET_FUNC_LIST[] =#definePROD_SPEC_UCHAR_GET_FUNC_LIST \
GetButtonState \
NULL
using this pointers i can handle only functions having uchar,uint return types and as arguements.But i need to handle SCHAR, as well as functions with more no of arguements.How to handle them in generic way,Instead of creating one structure for every fuction type.Please help me.I need the solution very urgent.
Thanks,
Anuradha.
typedef void(FuncType)(void); typedef int(AnotherFuncType)(void); typedef void(YetAnotherFuncType)(int); typedef union { struct { FuncType func1; AnotherFuncType func2; YetAnotherFuncType func3; }; FuncType func_array[3]; } FuncTypeContainer; void func_a (void); int func_b (void); void func_c (int x); FuncTypeContainer ftc; ftc.func_array = { (void*)func_a, (void*)func_b, (void*)func_c };