I have used EE for topic, please change it OT if you feel this does not belong here. I have a friend who is trying to access the IrDA port on a Radix unit, the manufacturer sent him a C code example; however, he is coding in Pascal. I know C but not Pascal. The C code uses function pointers and if there are any ideas how to convert it to Pascal I will appriciate it. This is the definitions: enum { /* normal application use */ C_OPEN=1,C_CLOSE,C_READ,C_WRITE,C_GCTL,C_SCTL,C_GSPD,C_SSPD,C_STAT, C_DISCOV,C_IASREQ,C_CONN,C_DISC, }; typedef int (FAR *FPI)(); static char sig[] = "RadixIrDA"; FPI comm_entry = 0L; The FPI is giving him the trouble. Below is the function to find the function: /* * locate IrDA interrupt and save entry point in comm_entry */ static int find_irda(void) { int i; void FAR *p; char FAR *s; if (comm_entry != 0) return 1; /* already located */ for (i=0x60;i<=0x67;i++) { /* else look for it */ p = MAKEFAR(0,(i<<2)); if ((s = *(char FAR * FAR *)p) != 0L) { if (!strcmpf(s+3,sig)) { comm_entry = (FPI)s; return 1; } } } return 0; } The confusing lines are: p = MAKEFAR(0,(i<<2)); if ((s = *(char FAR * FAR *)p) != 0L) After this function is called, they use the following functions to access the port: int IrDA_open(void) { if (find_irda()) { hport = comm_entry(C_OPEN); } return hport; } int IrDA_recv(int portid,char *buffer,int len) { if (portid != hport) return -1; return comm_entry(C_READ,portid,(char FAR *)buffer,len); } They are accesing the comm_entry with different number of parameters which confuses him. I have told him that comm_entry is a function pointer and the first parameter points to the actual function, comm_entry is not a function itself. I hope this is correct. Any pointers are appriciated, Regards, Omer _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist