Re: Calling C function with file handles
- Posted by stabmaster_ at HOTMAIL.COM Feb 24, 2001
- 382 views
This might not be the best solution, but here goes: Create an additional dll wich has 2 functions, openfile() and closefile(): FILE *openfile(char *fname) { return fopen(fname); } .you get the idea. Use these functions in your euphoria program to get a correct file pointer, e.g.: constant openfile = define_c_func(my_dll, "openfile", {C_POINTER}, C_INT) -- define closefile() here constant fname = allocate_string("mumbo.jumbo") atom filePointer filePointer = c_func(openfile, {fname}) -- do your stuff.. c_proc(closefile, {filePointer})