this is the condensed code
Code: Select all
typedef struct{
video_info draw_inf; //tells video info for window
void *func_ptrs[256]; //data ptr for event interrupts
void *draw_buffer; //this is where the drawing buffer is
void *owner;
char *title; //this is the shown title
unsigned int x,y; //where on the screen the window is
// the drawing buffer has all the characters/pixels for the window and is updated to its parent window which is eventually
// updated to the video memory
unsigned int attributes; //attributes for everything
unsigned int rnumber; //what the registered number is, populated by RegisterWindow
}WINDOW;
WINDOW mcon;
void init(){
mcon.func_ptrs[7]=&gotkey;
}
void test_func(){
call_evh(mcon,7,0);
}
typedef void(*EvhFunc)(unsigned char,unsigned int);
void call_evh(WINDOW win,unsigned char event,unsigned int parameter){ //this is the problem i think
EvhFunc tmp;
tmp=win.func_ptrs[event];
tmp(event,parameter);
}