Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  read from csv file
« previous next »
  • Print
Pages: [1]

Author Topic: read from csv file  (Read 2862 times)

Offline JamClerk

  • Member
  • *
  • Posts: 9
read from csv file
« on: July 17, 2012, 09:00:30 AM »
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
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: read from csv file
« Reply #1 on: July 17, 2012, 10:34:32 AM »
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.
Logged

Offline JamClerk

  • Member
  • *
  • Posts: 9
Re: read from csv file
« Reply #2 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
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: read from csv file
« Reply #3 on: July 17, 2012, 02:25:32 PM »
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

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. 
Logged

Offline JamClerk

  • Member
  • *
  • Posts: 9
Re: read from csv file
« Reply #4 on: July 20, 2012, 07:04:29 AM »
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
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: read from csv file
« Reply #5 on: July 23, 2012, 05:50:20 AM »
Rockbox does not have a complete C library; only the parts someone has found a need for. If it's not there in the plugin API it's not available for plugins, and if it's not there in the headers in firmware/export then it's probably not available at all.

If you can't avoid using things like that in your plugin, the easy way is to find a suitable implementation in a BSD/GPL-licensed C library and copy it into your plugin's source dir. There's not much point in them being added to Rockbox as they are not generally useful.
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  read from csv file
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.075 seconds with 15 queries.