GP32 gpstdio.h


jlebrech

UFO Robot
Joined
Feb 25, 2003
Messages
899
Age
41
Can anyone show me a example how to use these functions

ERR_CODE GpFileOpen (const char * p_file_name, ulong fopen_mode, F_HANDLE *p_handle);

ERR_CODE GpFileRead (F_HANDLE h_file, void * p_buf, ulong buf_size, ulong * p_read_count);


is it like this:


F_HANDLE myhandle;

GpFileOpen('filename', OPEN_R, myhandle);
GpFileRead(myhandle, &buffer, 360*240,

but what is p_read_count for?
 
I've never used these functions but I'll try to guess. Since p_read_count is a pointer to an unsiged long then this could return the number of bytes succesfully read.
How close am I?
 
oh right thanks, i can just put a variable and just ignore it. cool!!
 
Yeah that's exactly what it's supposed to do. I've had a problem relating to using these functions - if I try to read a lot at a time (in this case just over 32K) it reboots my machine! Splitting it into reads of 512 bytes seems to fix it. Damn weird. <_<
 
Back
Top