summaryrefslogtreecommitdiff
path: root/firmware/common
AgeCommit message (Collapse)Author
2010-05-06Move c/h files implementing/defining standard library stuff into a new libc ↵Thomas Martitz
directory, also standard'ify some parts of the code base (almost entirely #include fixes). This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Make open() posix compliant api-wise. A few calls (those with O_CREAT) need ↵Thomas Martitz
the additional optional mode parameter so add it. Impact for the core is almost zero, as open() is a wrapper macro for the real open function which doesn't take the variable parameter. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25844 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Make creat() posix compliant API-wise. Shouldn't affect the core as it's ↵Thomas Martitz
wrapped via a static inline. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25843 a1c6a512-1295-4272-9138-f99709370657
2010-04-22dircache: increase stack size to handle the worse case path during rebuild ↵Amaury Pouly
(dircache->fat->ata-sd-pp+sdhc) and allows directory with depth up to 20 approximately git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25697 a1c6a512-1295-4272-9138-f99709370657
2010-04-07FS#11187 - diacritic.c is in 'drivers' but it does not belong thereTomer Shalev
- Move diacritic.c to firmware/common - The function is_diacritic returns bool now git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25526 a1c6a512-1295-4272-9138-f99709370657
2010-04-03Add IO priority handling. Currently all IO has equal priority, except the ↵Frank Gevaerts
dircache scanning thread which is lower. This fixes the slow boot problem for me, with the added benefit that actual audio playback also starts faster. Lots of the changes are due to changing storage_(read|write)sectors() from macros to wrapper functions. This means that they have to be called with IF_MD2(drive,) again. Flyspray: FS#11167 Author: Frank Gevaerts git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25459 a1c6a512-1295-4272-9138-f99709370657
2010-03-15dir_uncached: fix opendir_uncached to have opened directories keep enough ↵Amaury Pouly
information to update metadata; this is necessary because of the way rmdir_uncached is implemented FS#11107: should be fixed now git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25203 a1c6a512-1295-4272-9138-f99709370657
2010-03-10Get rid of the parent_dir field in dir_uncached.c by using the same FAT ↵Amaury Pouly
trick as in dircache. This should save ~20KB on 512B/sector targets and ~80KB on 2K/sector ones. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25105 a1c6a512-1295-4272-9138-f99709370657
2010-02-22Remove tabs in firmware path (taking into account the original spacing).Andree Buschmann
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24864 a1c6a512-1295-4272-9138-f99709370657
2010-02-21Fix a dircache NULL-pointer dereference.Amaury Pouly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24835 a1c6a512-1295-4272-9138-f99709370657
2010-02-17Fix error handling in dircache generation.Amaury Pouly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24730 a1c6a512-1295-4272-9138-f99709370657
2010-02-16-Cosmetic change in a comparisonAmaury Pouly
-Move fat_dir structure out of dircache stack to RAM. Reduce dircache stack size (max level depth should stay be around 20). This should fix nano2g dircache stkov of FS#10679 -Change the structure returned by readdir_cached to match the one returned by readdir_uncached: remove useless fields to save space and avoid any potential incoherence -Remove one field from the internal structure used by {opend,read,close}dir_cached because it was mostly redundant. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24708 a1c6a512-1295-4272-9138-f99709370657
2010-02-14Rewrite dircache generation to take advantage for the FAT code. Reduce RAM ↵Amaury Pouly
usage by ~30Kb and binsize by at least several hundreds bytes. Also remove the directory depth limit of dircache. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24657 a1c6a512-1295-4272-9138-f99709370657
2010-02-07Remove a file that mcuelenaere forgot to delete (see r23763 and r23767).Amaury Pouly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24543 a1c6a512-1295-4272-9138-f99709370657
2010-02-07Optimize (size and speed) strncasecmp (based on a newlib patch).Amaury Pouly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24542 a1c6a512-1295-4272-9138-f99709370657
2010-02-01Various dircache improvements: reduce size of a path buffer to MAX_PATH and ↵Amaury Pouly
rewrote copy_path to improve stack usage. Also simplified get_entry. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24445 a1c6a512-1295-4272-9138-f99709370657
2010-01-31Fix a dircache bug (opening a directory opens the first file of that ↵Amaury Pouly
directory). Also clarify the behaviour of dircache_get_entry. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24420 a1c6a512-1295-4272-9138-f99709370657
2010-01-03Final removal of tabs in firmware pathAndree Buschmann
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24158 a1c6a512-1295-4272-9138-f99709370657
2010-01-02Add strlcat to core to match strlcpy (also add to plugin api). Some uses of ↵Torne Wuff
strcat could probably do with being changed to this. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24141 a1c6a512-1295-4272-9138-f99709370657
2010-01-01FS#9409: fix rename which didn't close file handles on error and enventually ↵Amaury Pouly
cause cut/paste to fail between volumes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24134 a1c6a512-1295-4272-9138-f99709370657
2009-12-23Make read() and write() return -1/EISDIR on directoriesFrank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24106 a1c6a512-1295-4272-9138-f99709370657
2009-12-23only get the file pointer if fd is actually valid.Frank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24105 a1c6a512-1295-4272-9138-f99709370657
2009-11-26Move strip_volume() to filefuncs.c and set properties.Maurus Cuelenaere
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23767 a1c6a512-1295-4272-9138-f99709370657
2009-11-26Forgot fileMaurus Cuelenaere
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23763 a1c6a512-1295-4272-9138-f99709370657
2009-11-26 - Split off strip_volume() to a separate fileMaurus Cuelenaere
- fix some yellows git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23762 a1c6a512-1295-4272-9138-f99709370657
2009-11-26Merge branch 'hotswap'Maurus Cuelenaere
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23759 a1c6a512-1295-4272-9138-f99709370657
2009-11-03Rename vfnprintf to vuprintf (u stands for user for the user callback and ↵Thomas Martitz
data passed to it) to avoid confusion with file and buffer size related functions from the printf-family, and add a comment to its declaration. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23503 a1c6a512-1295-4272-9138-f99709370657
2009-10-25Little bit of const correctnessNils Wallménius
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23343 a1c6a512-1295-4272-9138-f99709370657
2009-10-18Use wrap-safe TIME_BEFORE/TIME_AFTER macros to compare times with ↵Bertrik Sikken
current_time, instead of comparing them directly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23246 a1c6a512-1295-4272-9138-f99709370657
2009-10-02Patch #1 from FS#10633 (Nano 2G developments) by Michael Sparmann - Allows ↵Dave Chapman
targets to set a different sector size than 512 for the storage system. Should not affect any other target. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22874 a1c6a512-1295-4272-9138-f99709370657
2009-09-26FS#10569 RTC driver cleanupNils Wallménius
Change the RTC drivers so that the rtc_(read|write)_datetime functions now deal directly with the tm struct instead of passing a string of bcd digits to/from (set|get)_time . This simplifies drivers for rtc's that do not use a bcd representation internally and cleans up some target specific code and #ifdefs in generic code. Implement simple stubs for the sim to avoid #ifdefing for that too. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22839 a1c6a512-1295-4272-9138-f99709370657
2009-08-21A new implementation of logf, logfdisplay and logfdump.Maurus Cuelenaere
Flyspray: FS#10528 Author: Amaury Pouly git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22462 a1c6a512-1295-4272-9138-f99709370657
2009-08-12Remove dead codeAlexander Levin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22268 a1c6a512-1295-4272-9138-f99709370657
2009-08-12Change the function name in strnatsort so that the code doesn't contradict ↵Alexander Levin
itself git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22267 a1c6a512-1295-4272-9138-f99709370657
2009-08-11Move yearday_to_daymonth() to usb_storage.c. It's the only user, this ↵Frank Gevaerts
function is pretty specific, and it seems to be the cleanest way to avoid ram usage increases for unrelated targets git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22259 a1c6a512-1295-4272-9138-f99709370657
2009-08-11Consolidate day of week calculationFrank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22258 a1c6a512-1295-4272-9138-f99709370657
2009-08-11rework new time handling functions a bit to be more memory efficientFrank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22257 a1c6a512-1295-4272-9138-f99709370657
2009-08-11Add support for setting the clock using a special SCSI command. This is the ↵Frank Gevaerts
same method that itunes uses, and there are host-side tools for it (e.g. libgpod) Flyspray: FS#10514 Author: Laurent Papier and myself git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22255 a1c6a512-1295-4272-9138-f99709370657
2009-08-04Fix for:Thomas Martitz
FS#10031 - "improper sorting of names with underscores when Interpret numbers when sorting is used" and FS#10200 - "Incorrect sorting of roman numerals when whole numbers selected" a) By using tolower instead of toupper for case-insensitive sorting b) By not ignoring spaces (which isn't really what we aimed for anyway). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22153 a1c6a512-1295-4272-9138-f99709370657
2009-07-17Commit FS#9545, storage cleanup and multi-driver supportFrank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21933 a1c6a512-1295-4272-9138-f99709370657
2009-07-14FS#10080Nils Wallménius
* Move strncpy() from core to the pluginlib * Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins * Drop strncpy() from the codec api as no codec used it * Bump codec and plugin api versions git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
2009-06-29Fix yellow introduced in r21561Alexander Levin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21563 a1c6a512-1295-4272-9138-f99709370657
2009-06-29Make the get_time on non-RTC sims behave like target, i.e. always return a ↵Alexander Levin
constant time (FS#10390) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21561 a1c6a512-1295-4272-9138-f99709370657
2009-03-22Add missing #includes for the ondas.Bertrik Sikken
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20457 a1c6a512-1295-4272-9138-f99709370657
2009-03-17Update the comment about our changes too.Thomas Martitz
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20341 a1c6a512-1295-4272-9138-f99709370657
2009-03-17Restore behavior of the original implementation strnatcmp to not ignore ↵Thomas Martitz
leading zeros. Fixes FS#10029 (Files being sorted incorrectly in latest builds), leads to better sorting of decimal numbers. It also doesn't sort 2 before 03 (but still before 10) anymore. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20340 a1c6a512-1295-4272-9138-f99709370657
2009-03-09Make strnatcmp() and strnatcasecmp() call strcmp() or strcasecmp() if ↵Frank Gevaerts
strings otherwise sort the same. This is done to make sure that strings always sort the same. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20265 a1c6a512-1295-4272-9138-f99709370657
2009-03-02Make sure that sorting works both for signed and unsigned char (it depends ↵Alexander Levin
on the platform/compiler used) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20183 a1c6a512-1295-4272-9138-f99709370657
2009-03-02Make natural sorting work properly with cyrillic chars: they should be ↵Alexander Levin
placed after the latin ones (FS#9975). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20180 a1c6a512-1295-4272-9138-f99709370657
2009-03-02Actually apply the patch...thanks again to Bryan Vandyke (and Tom Ross for ↵Thomas Martitz
notifying me about my commit-fail). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20167 a1c6a512-1295-4272-9138-f99709370657