Hello Experts,
I have a structure shown below
typedef struct
{
XDAS_Int16 count;
XDAS_Int Value;
void *ptr;
} Sample;
and i am this declaring the structure as a member in the <module>_<vendor>_obj this structure
typedef struct <module>_<vendor>_obj
{
IALG_Obj alg;
Sample *st_ptr;
}<module>_<vendor>_obj;
after declaring the structure as a member in the <module>_<vendor>_Obj then i am assigning the memory in the <module>_<vendor>_alloc() function like
<module>_<vendor>_alloc(const IALG *algParams, IALG_Fxns **pf, IALG_MemRec memTab[])
{
memTab[0] = sizeof(<module>_<vendor>_obj);
memTab[1] = sizeof(Sample *);
}
after defining the memory i am assigning the memory in the initObj() function
<module>_<vendor>_initObj()
{
<module>_<vendor>_Obj *obj = (<module>_<vendor>_Obj *)handle;
obj->st_ptr = memTab[1].base;
}
My Question :
1. What the procedure i followed is correct ?
2. can i declare memory for a structure pointer which i have shown above ?
Please help me
Thank you,
Raju