Rockbox Development > Starting Development and Compiling

read from csv file

(1/2) > >>

JamClerk:
Hi
i am trying to create a plugin that can read data from a csv file - its purpose is to display information to the user when booting up

i am new to c development and also to developing in ubuntu - normally use visual studio and windows xp, so don't totally understand how everything works yet

i have created a scipt that i am able to compile and run through ubuntu terminal to display info from a csv file on my desktop - so now i want to implement something similar within rockbox but getting errors when running make command,

i am missing these header files: unistd.h, sys/stat.h, pwd.h and dirent.h

can somebody tell me where i can get these header files and do i just copy and paste them into include folder or how do i add them into rockbox?

thanks

saratoga:
Those files don't exist in Rockbox. They're used on Linux and other more complicated operating systems. Instead you need to use the file functions in the Rockbox api, probably open and read. The battery bench plugin might be a good example since it writes to CSV file.

JamClerk:
thanks, i will take a look at that,

is there any documentation on rockbox api? the link provided on HowtoWritePlugins page doesn't work

saratoga:

--- Quote from: JamClerk on July 17, 2012, 11:06:45 AM ---thanks, i will take a look at that,

is there any documentation on rockbox api? the link provided on HowtoWritePlugins page doesn't work

--- End quote ---

Ah, thats because we switched to git:  http://git.rockbox.org/?p=rockbox.git;a=blob;f=apps/plugin.h;h=bb2778164b9be4003e6ab90740d21d3972358ce1;hb=HEAD

I'll fix that link, but if you have the source code you shouldn't need to use the web interface to look at it. 

JamClerk:
have managed to read data from file and split it using rb->strtok_r,
now i need to convert char from the file to a date, and compare it to the current date to get number of days between the two,

how do i convert the char array to a struct so that i can pass this to mktime(struct)? (something similar to linux strptime function)

and also is there any functions to compare dates? (similar to linux difftime function)

thanks

Navigation

[0] Message Index

[#] Next page

Go to full version