Notice: A non well formed numeric value encountered in /sites/ on line 96 Notice: A non well formed numeric value encountered in /sites/ on line 96 Notice: A non well formed numeric value encountered in /sites/ on line 96 Deprecated: Function create_function() is deprecated in /sites/ on line 104 Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /sites/ on line 845 Deprecated: Function create_function() is deprecated in /sites/ on line 111 FS#6697 : New dict plugin



FS#6697 - New dict plugin

Attached to Project: Rockbox
Opened by Timo Horstschäfer (x1jmp) - Sunday, 25 February 2007, 19:43 GMT
Task Type Patches
Category Plugins
Status Unconfirmed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 5
Private No


This is an almost complete rewrite of the current dict plugin.

It is based on the stardict dictionary file format and acts as a viewer for .idx files.

Most important features are:
- fuzzy search by showing all articles that start with a certain word
- quite fast search (binary search, same as the current dict plugin)
- scrolling for long descriptions
- handles even huge dictionaries (e.g. Wikipedia)

When first opening a dictionary, an offset table is created to provide random access to the index file.

Stardict dictionaries can be used almost directly but all files have to be uncompressed.

I created another patch, which adds a "Dicionaries" entry to the root menu (FS# 6630). It shows all dictionaries placed in "/dicts".

Some more information may be found in a thread about an older version on MisticRiver

Some dictionary ressources:
- Stardict Website:
- Wikipedia dumps:
- english:
- german:
This task depends upon

Comment by Hepdog (007quick) - Monday, 26 February 2007, 23:58 GMT
I keep getting the error "failed to open description file"
I patched the dict.patch but the other one doesn't work
I extracted a couple of star dics and it lets me select them and search but when I select an entry it says that msg above.
Great work though I'm prob doing something wrong!
Comment by Timo Horstschäfer (x1jmp) - Tuesday, 27 February 2007, 12:57 GMT
The plugin looks for an uncompressed description file with a .dict extension. Most dictionaries are compressed by default and have the extension
So uncompress the description file e.g. with

gunzip -S .dz *

It's just that there must be a .dict file with the same name.

The second patch requires the root menu patch (FS# 6630) to be applied as well.

I hope it'll work for you.
Comment by Timo Horstschäfer (x1jmp) - Friday, 02 March 2007, 23:23 GMT
New version that parses #redirects from MediaWiki.
Comment by Robert Kukla (roolku) - Sunday, 04 March 2007, 17:44 GMT
shuffled some things around and added a workaround for gcc wanting to use memcpy in plugins
Comment by Robert Kukla (roolku) - Sunday, 04 March 2007, 18:04 GMT
oops. fixed path to dict.c in patch
Comment by Timo Horstschäfer (x1jmp) - Sunday, 04 March 2007, 21:10 GMT
Fixed a bug, which caused the redirect parser to not find some articles.
Comment by Robert Kukla (roolku) - Sunday, 04 March 2007, 23:33 GMT
I am afraid the bug that overwrites the font data happened again. This time it was a search for Napier in the german Wikipedia and again it happened when selecting the term.

Also I had the problem that after scrolling down to the bottom of the text the next press on up cleared the screen apart from a number of squares in the top row. Pressing the menu button got me out of the mess.

Unfortunately I haven't found a way to reproduce the problems reliably. :(
Comment by Timo Horstschäfer (x1jmp) - Monday, 05 March 2007, 12:30 GMT
In the tests I did in the simulator I never had such a problem (I'm lacking a hdd for my DAP).
But I don't know how much different the memory management on the player and the sim is.

Furthermore, there was another bug. After exiting the menu, the first page of the article was drawn instead of the one you were viewing before going into the menu.
Comment by Adam Gashlin (AdamGashlin) - Saturday, 10 March 2007, 08:29 GMT
Just fyi, freqmod and I have done some work on a wikimedia-specific viewer here: 4755
I'm going to take a good hard look at your plugin to see if I can come away with anything interesting...
Where do you get the wikipedia dump in the format that you have for download? A lot of work we've been doing has been on a converter from the XML dumps to an archive with each article gzipped and with control codes for things like links and formatting.
Comment by Timo Horstschäfer (x1jmp) - Thursday, 15 March 2007, 21:59 GMT
I knew about your wikimedia viewer, as I'm the one who initially opened that feature request.
However, at the beginning I didn't like it, because it was iPod only, though this has changed now and that it's limited to Wikipedia ATM.

My intention was to write a new search-only dict plugin and create a general document viewer for the articles.
I think working on a viewer is more attracting than working on a Wikipedia-only plugin.

The wikipedia dump was converted using the converter from stardict-tools. It doesn't support any kind of formatting.
Also the plugin doesn't support compression. I looked at the mww dumps and the size of the English Wikipedia with each article gzipped was around 800 MB less then uncompressed.
The Stardict (not the one for Rockbox) itself as well as the DICT project use special, but still standard-compliant, gzip files to allow random access to them. Compressing the whole dump should decrease the size much better, but I'm not sure, whether compression is needed at all.

I would very like to join the two wikimedia programs, on concentrate working on one. It's definitely a great feature for Rockbox and everyone who may want to switch to Rockbox.

In the last days I wrote such a viewer and added a basic formatting engine to Rockbox. It's now possible to pass formatting arguments to the lcd_puts_style function or to let it interpret some of the ANSI escape codes (the ones, that also control the style on your xterm, see
At least in the sim it works on all displays, even thar Player and the remotes. Some of them don't support all styles, of course. They just ignore styles and escape sequences, so that the API is the same on every device.

For example, the output, that finally comes out of the man command, should be direclty readable with the viewer function, as it's the same 'markup language'.

Patch Rockbox with dict_all.patch (it changes a lot, so I recommend to use a clean build) and have a look at the plugin test_styles (also for example code).
Then download the formatting_demo dictionary and search it for the article "Rockbox". It's a hand-formatted article, as I'm lacking a converter.

Please drop some feedback, because I still can only test with the sim.
Comment by Hepdog (007quick) - Friday, 16 March 2007, 22:37 GMT
Hate to say this but your patch just went out of sync. Been using your patch in my custom builds and it's great.
Comment by Timo Horstschäfer (x1jmp) - Friday, 16 March 2007, 23:58 GMT
Damn, was just one day old. Synced.
Comment by Hepdog (007quick) - Saturday, 17 March 2007, 01:19 GMT
Strange thing , I applied your patch fine and made a build fine for my h10 5gb but when I made it for the 20gb it failed. something with the screen stuff.
make[2]: *** No rule to make target `rockboxlogo.160x128x16.bmp', needed by `/mnt/other/rockbox/build/h20/apps/bitmaps/native/rockboxlogo.160x128x16.c'. Stop.

make[1]: *** No rule to make target `/mnt/other/rockbox/build/h20/apps/dep-apps', needed by `/mnt/other/rockbox/build/h20/apps/rockbox.elf'. Stop.
make: *** [all] Error 2
Those come in that order. I then removed the patch and it built fine. then again patched it and it didn't work! sry for the news!
Comment by Timo Horstschäfer (x1jmp) - Saturday, 17 March 2007, 08:05 GMT
Someone asked me to create a build with a custom logo.
I forgot to take that out. This patch should be fine.
Comment by Hepdog (007quick) - Saturday, 17 March 2007, 15:12 GMT
Hunk #2 FAILED at 18.
1 out of 2 hunks FAILED -- saving rejects to file apps/plugins/dict.c.rej
LOL. some1 must be trying to put your patch out! lol
Comment by Timo Horstschäfer (x1jmp) - Saturday, 17 March 2007, 16:06 GMT
It went out of sync again, too bad... :)
The changes only made the patch program unhappy. Keeping your old dict.c would result in the same.

Comment by Hepdog (007quick) - Saturday, 17 March 2007, 16:42 GMT
I think you got someother stuff mixed in there too becasue it won't apply clean. this time most of the hunks failed. sorry for the bad news. you must be doing somthing wrong!
Comment by Timo Horstschäfer (x1jmp) - Saturday, 17 March 2007, 16:55 GMT
I'm having no problems applying the patch on a recent svn.
Maybe you have other patches applied (e.g. a former dict patch) which conflict with it or your repository isn't up to date.
Comment by Hepdog (007quick) - Saturday, 17 March 2007, 17:16 GMT
My bad!
Comment by Enmar (Enmar) - Monday, 26 March 2007, 09:02 GMT
I believe it went out of sync :(
oh well I don't need a thesaurus or an encyclopedia for a while :(
Comment by Hepdog (007quick) - Monday, 26 March 2007, 17:24 GMT
I would have made a sync for you, but unfortunetly, They removed the last file in your patch. LOL. Really out of sync!
Comment by Timo Horstschäfer (x1jmp) - Monday, 26 March 2007, 18:02 GMT
Synced and fixed a small bug.
Comment by Hepdog (007quick) - Tuesday, 27 March 2007, 21:05 GMT
Your patch doesn't compile for the H10 20gb again. I think you were working on your custom boot image again!
Comment by Timo Horstschäfer (x1jmp) - Tuesday, 27 March 2007, 21:45 GMT
Oh damn, I took it out now. Sorry for the problem.
Comment by Robin (Poopje) - Wednesday, 28 March 2007, 07:23 GMT
Thanks alot for all the effort you put in to this. Wikipedia on your mp3 player is just awesome! I've compiled rockbox for my iPod photo yesterday. It all works fine, but when I open a dictionary (English-Spanish for instance) it makes an index file and then I'm ready to type in a word. But after 1 or 2 letters rockbox crashes. After that it's not possible to reboot into Rockbox again. When I remove the nvram.bin file I'm able to get in again, but the same problem occurs, because the nvram.bin file is being created again.

Is it a bug, or is it just me :)
Comment by dirk (mr.pi) - Thursday, 29 March 2007, 17:10 GMT
hello timo,

i use the mad cow build for my toshiba gigabeat. he included your dict patch. now i saw on installing that all headlines are with a shadow font and i can hardly read these headlines.

my question could you offer 2 version of your dict patch with your font style and with the old font style?

thank you

the pi
Comment by Robert Kukla (roolku) - Thursday, 29 March 2007, 17:15 GMT
I really like the wiki plugin and the new styles. But I have a couple of problems:

- id doesn't seem to be rebuilding the indexes in .rockbox anymore but instead says: "failed to open index" when you try and search
- the scroll bug seems to be back (where the status line is not taken into account when scrolling.)

Also would it be possible to split the different bits of functionality into different patches? The all in one currently causes some confusion:
Comment by Timo Horstschäfer (x1jmp) - Thursday, 29 March 2007, 19:51 GMT
Poopje, the text input is a rockbox function not from the dict plugin. Do you experience the same problem when renaming a file for example?

The headline style's purpose was actually just to demonstrate the style feature. I changed this to bold only, but you may disable it in apps/gui/list.c.

The plugin does not create the index files, just an offset table (.oft files in /.rockbox/). Not to find the index therefor sounds quite strange.

A tried to split up the patch into its funtionalities, but IMHO it's not worth the effort, because the dict plugin depends on most of the other patches.

styles.patch and viewer.patch are necessary for the dict plugin.
Additionaly dict_all.patch consists of all other patch, just as usual.
Comment by Robert Kukla (roolku) - Friday, 30 March 2007, 12:44 GMT
Just to let you know it is working fine now.
Comment by Timo Horstschäfer (x1jmp) - Saturday, 31 March 2007, 22:18 GMT
Today I got a version of my new converter running. It's uses expat to process mediawiki dumps on converts the english Wikipedia in ~7 minutes.
A problem I discovered is that the current english Wikipedia (4.9GiB) is too big to be used as a stardict dictionary at all. It uses uses uint32_t for the article offsets in the description file.
The old dumps are working because the converter seems to have missed some articles :-)

Some ideas to address articles over 4 GiB? Using a 64 bit type would break compatibility with stardict.

The converter also doesn't format the articles, it just copies the raw source. Have a look at mediawiki_format.c and feel free to enhance it!
Comment by Robin (Poopje) - Sunday, 01 April 2007, 21:23 GMT
Robert: I made a new build from the 30th of march source and your dict_all patch. I can use it with the wikipedia dictionary without any problems. But after a reset I'm not able to get into Rockbox. It hangs on the boot screen. I don't think that has anything to do with your patch, just a general memory problem (I haven't looked into it yet). Keep up the good work!
Comment by Hepdog (007quick) - Monday, 02 April 2007, 20:35 GMT
Out of sync. I hope I did this right. Please tell me what I did wrong if it is wrong!
Comment by Hepdog (007quick) - Tuesday, 03 April 2007, 18:04 GMT
I didn't do it right! Needs a sync to SVN!
Comment by Timo Horstschäfer (x1jmp) - Tuesday, 03 April 2007, 18:44 GMT
It looks like you just forgot to add the additional files created by the patch to your repository.
Use `svn add` to add these:

Synced and added support for .lidx (index file with 64 bit offsets) to be able to use huge dictionaries (>4 GiB), though this is more like a temporary solution.

Have a look at the README in stardict-mediawiki.tar.bz2 to learn how to make your own Wikipedia dumps.
Comment by Hepdog (007quick) - Tuesday, 03 April 2007, 19:40 GMT
I am still getting an error with ansi.c Actually, it has multiple errors! It patches fine but doesn't compile.
Comment by Timo Horstschäfer (x1jmp) - Wednesday, 04 April 2007, 13:56 GMT
Remember that patch creates a new file it just adds content to it. So if the file is already existant, patch will add the content again. This results in a file with twice the content and breaks compiling.

You might run svn-clean ( patching to get rid of _all_ files that don't belong to the repository.
Comment by Hepdog (007quick) - Tuesday, 10 April 2007, 18:23 GMT
Needs a sync! I tried but some of the functions were the old patch went are gone now! Good Luck!
Comment by Timo Horstschäfer (x1jmp) - Tuesday, 10 April 2007, 22:52 GMT
Finally synced and fixed some silly bugs :P
It's now fully usable with the H1x0 remote (at least).
Comment by Hepdog (007quick) - Tuesday, 10 April 2007, 23:27 GMT
Synced!!!!!!!!!!!!!!!!!!!!! Works too!
Comment by Hepdog (007quick) - Tuesday, 10 April 2007, 23:28 GMT
Oh man, you beat me. Everyone use Timo's patch, not mine!
Comment by Hepdog (007quick) - Thursday, 12 April 2007, 16:40 GMT
Synced, some change in root_menu.c
Comment by Alex Margolis (almargolis) - Friday, 13 April 2007, 10:56 GMT
The patch works on a clean svn but doesn't patch on top of the scrolling margins patch. Is there any way to fix this?
Comment by denis (perldiver) - Friday, 13 April 2007, 12:27 GMT
Loadable icons patch breaks this one as well.
Comment by Hepdog (007quick) - Friday, 13 April 2007, 14:26 GMT
Usually, any combining of patches is totally up to you! There is no efficent way of making them combinable except for someone to make a patch of all of the patches!
Comment by Pascal Briehl (ColdSphinX) - Friday, 13 April 2007, 19:30 GMT
My build works with loadable icons, you just have to put the iconname in apps/gui/icon.h and put the icon in the right place in the bmp.
An other thing. With your new styles ther is an bug with the scrolling lines in the lists (Scrolling line one line above the line to scroll). Today I reseted my Database and after the clearing of the DB and befor I reinitialised it, it worked. So I don'T know is it because of the initialised database? mysic mysic, tomorow I try to reproduce.
Comment by Pascal Briehl (ColdSphinX) - Saturday, 14 April 2007, 16:29 GMT
Could reproduce it, deleted the database files and the scrollbug was gone.
Comment by Timo Horstschäfer (x1jmp) - Sunday, 15 April 2007, 00:28 GMT
It sounds like the scroll bug caused by FS 6747, which appeared only in older versions of the dict patch.
I have no clue how the database could cause it, it's working fine on my player with the database initialized.

Btw, synced.
Comment by Pascal Briehl (ColdSphinX) - Sunday, 15 April 2007, 13:56 GMT
right, I commented out the lines with the marginreset in tree.c and now it works. thanks
Comment by denis (perldiver) - Tuesday, 17 April 2007, 00:20 GMT
Needs sync with the loadable icons commit.
Comment by Pascal Briehl (ColdSphinX) - Tuesday, 17 April 2007, 15:04 GMT
ups i saw that i said a false thing...i commented out in apps/gui/list.c
Comment by Enmar (Enmar) - Wednesday, 18 April 2007, 03:31 GMT
out of sync
I would sync it if I knew how. :(
anyone know where I can learn?
Comment by Hepdog (007quick) - Thursday, 19 April 2007, 03:28 GMT
I managed to sync it though it is not done properly, as some functions have been removed. It should work, but someone will have to do a proper job on it!
Comment by Timo Horstschäfer (x1jmp) - Thursday, 19 April 2007, 20:21 GMT
Do icons still work in your patch?
The external bitmap icons are less friendly to patches than the old system. I think I'll include them inleave them out in the next patches, as it requires to replace around 10 bitmaps to make it work on all targets.
Comment by Hepdog (007quick) - Thursday, 19 April 2007, 20:59 GMT
No there are no icons, but it still functions correctly!
Comment by Timo Horstschäfer (x1jmp) - Sunday, 22 April 2007, 19:33 GMT
Synced and bugfixed a little bit :)
It doesn't include its own icons, but that's barely remarkable.
Comment by Hepdog (007quick) - Sunday, 06 May 2007, 21:47 GMT
Would it be possible to create a wiki page, or just post here about how to get a wikipedia dump to work. I have lots of people asking and i'm not sure exactly how to do it myself. Alls I know is that you need to extract the stardictionaries. But what about wikipedia?
Comment by Enmar (Enmar) - Tuesday, 08 May 2007, 01:34 GMT
Out of sync again. :(
Comment by Robert Kukla (roolku) - Tuesday, 08 May 2007, 07:49 GMT
Comment by Scott (aardbarkie) - Monday, 14 May 2007, 02:42 GMT
resync'd (i think)
Comment by Scott (aardbarkie) - Monday, 14 May 2007, 02:47 GMT
I take that back. Previous patch doesn't sync properly =/
Comment by Scott (aardbarkie) - Monday, 14 May 2007, 15:16 GMT
Sync'd. Tested. It works this time =]
Comment by Scott (aardbarkie) - Monday, 14 May 2007, 15:38 GMT
Eek. Sorry for giving your hopes up. The patch doesn't work.

I'm not sure why. When I manually make the changes to dict.c (adding in #include "oldmenuapi.h" and removing several rb-->) everything compiles correctly. However, a patch, the patch doesn't seem to want to compile. Boo.
Comment by Oleg G (MadCow15) - Thursday, 17 May 2007, 02:43 GMT
Could somebody please make a stripped down version of this patch? All I need is the ability to read stardict files, I don't need any fancy font effects and ansi stuff. I'm sick of all those parts always getting out of sync and causing compile problems. I'm sure I'm not the only one who thinks this way.
Comment by Timo Horstschäfer (x1jmp) - Thursday, 17 May 2007, 18:22 GMT
I synced, adapted to the new menu-api and ripped out the font style feature, as it isn't really used at the moment.
The first patch will do no changes to Rockbox itself, only the plugins.
Comment by Oleg G (MadCow15) - Thursday, 17 May 2007, 19:56 GMT
Thanks, but it's saying it need viewer.c and viewer.h. viewer.c is in the "plugins" dir, bot the "lib" dir, and viewer.h doesn't exist. I tried this on clean, unpatched source and it still didn't work.
Comment by Timo Horstschäfer (x1jmp) - Thursday, 17 May 2007, 20:12 GMT
Eh, right, I forgot to add the to SVN when I created the patch.
Comment by Oleg G (MadCow15) - Thursday, 17 May 2007, 20:42 GMT
That works now. Thanks again.
Comment by Enmar (Enmar) - Saturday, 19 May 2007, 06:19 GMT
It says that "patch: **** Can't open patch file nary : No such file or directory"
what happened in under one day... They must really want your patch gone, which is crazy because I think it is wonderful
Comment by Enmar (Enmar) - Saturday, 19 May 2007, 06:42 GMT
wait this is happening with all my patches what is going on did the patch system change????
Comment by Enmar (Enmar) - Wednesday, 23 May 2007, 04:24 GMT
sorry about the last two comments, the issue is resolved, but I believe there is a problem when patching the "dict.c" file hunk #2 fails... don't tell me anything over an amateur would not know... you know like I do not know virtually anything about C++, C or any other programming language.

probably unsynced... or it may work fine but I have spent most of the day with the nary problem and I ended up just re-downloading the source to Rockbox and I do not want to have to do it again.
Comment by Enmar (Enmar) - Sunday, 27 May 2007, 08:59 GMT
it is out of sync
Comment by Enmar (Enmar) - Sunday, 10 June 2007, 02:29 GMT
okay is anyone listening or is everyone deaf. It is out of sync, someone try to fix it or tell me how to...
Comment by Timo Horstschäfer (x1jmp) - Sunday, 10 June 2007, 14:26 GMT
Sorry for the lack of updates.
After some time I added some features to the viewer and rewrote some code.
Some new features:
- Search function to search within articles (case insensitive)
- Enhancement of the search algorithm (offset files will be recreated, but should be slightly faster)
- custom backlight setting
- REC button (iRiver, Sansa) as a configurable shortcut

Works with the current svn build.

If the patch doesn't work with dict.c, try to replace it with a previously patched dict.c.
Comment by Enmar (Enmar) - Thursday, 14 June 2007, 05:13 GMT
I was thinking about doing that but I did not have enough spare time to do so, (school finals and what not) thank you for the patch, very useful.
Comment by Matthew Schneider (mschneider) - Saturday, 16 June 2007, 19:25 GMT
Just FYI, this patch is incompatible with the scrolling margins patch.
Comment by Frank M. (framo) - Thursday, 21 June 2007, 20:27 GMT
"Data abort at 01F218C"
Entering and searching for a word works fine on my iPod Nano, I get a list as a result.
But as soon as I try to browse to an article in this list, I get the following errors:
"illegal redirect (string)" followed immediately by a "Data abort at 01F218C (or another address)"
I'm using r13681M-070621 and I try to open wikipedia (both enwiki-20061130 and dewiki).
I have this problem for several months already and hoped that it would go away with a newer version of rockbox or dict_all, but it doesn't.
Am I doing something wrong or do others also have this problem?
Comment by Timo Horstschäfer (x1jmp) - Saturday, 23 June 2007, 10:51 GMT
I never got an error like this on my device, so it's hard for me to figure it out.
The "Illegal redirect" should only occur when there's a redirect (#redirect [[somarticle]]) to a non-existing article.

If your a bit familiar with C, then please try to find out the line in the code, where it happens by putting some
rb->splash(HZ, "sometext");
into the plugin code.

As the scrolling margins patch does some changes to Rockbox, the plugin can only be compatible to either the original RB or RB with scrolling margins patch.
I don't use this patch, but this should be the only change to make it work with scrolling margins:
- rb->lcd_setmargins(VIEWER_SCROLLBAR_WIDTH, 0);
+ rb->lcd_setmargins(VIEWER_SCROLLBAR_WIDTH, 0, 0);
Comment by Enmar (Enmar) - Saturday, 23 June 2007, 23:31 GMT
To Frank

I get the same error as I am also using rockbox on an ipod nano
It is not just you...
Comment by Enmar (Enmar) - Saturday, 23 June 2007, 23:34 GMT
quick edit of my last post I only get the data abort part.
Comment by Frank M. (framo) - Sunday, 24 June 2007, 15:59 GMT
The "illegal redirect" error only appears sometimes - most of the time I also get directly the "data abort" error.
Unfortunately I don't know C well so I'm not sure where to best insert the splash command, but I tried a few other things and noticed the folloing:
- I get the same "data abort" errors on an iPod Video G5 (60GB disk)
- When I compiled the patch for the Nano UISimulator, then the wikipedia files worked fine and I didn't get any "data abort" errors using the plugin.
- the problem does not seem to be with the .oft files as they look identical when built with the physical iPod or the UISimulator
Comment by Enmar (Enmar) - Monday, 06 August 2007, 08:43 GMT
Needs resync..
debian:~/rockbox# patch --binary -p0 < Dict.patch
(Stripping trailing CRs from patch.)
patching file apps/lang/english.lang
Hunk #1 succeeded at 4939 (offset -6040 lines).
[b]Hunk #2 FAILED at 4980.[/b]
1 out of 2 hunks FAILED -- saving rejects to file apps/lang/english.lang.rej
(Stripping trailing CRs from patch.)
patching file apps/plugins/viewers.config
(Stripping trailing CRs from patch.)
patching file apps/plugins/dict.c
Hunk #1 succeeded at 7 with fuzz 2.
[b]Hunk #2 FAILED at 18.[/b]
[b]1 out of 2 hunks FAILED -- saving rejects to file apps/plugins/dict.c.rej[/b]
(Stripping trailing CRs from patch.)
patching file apps/plugins/lib/pluginlib_actions.h
Hunk #1 succeeded at 88 (offset 41 lines).
[b]Hunk #2 FAILED at 235.[/b]
[B]1 out of 2 hunks FAILED -- saving rejects to file apps/plugins/lib/pluginlib_actions.h.rej[/b]
(Stripping trailing CRs from patch.)
patching file apps/plugins/lib/viewer.c
(Stripping trailing CRs from patch.)
patching file apps/plugins/lib/SOURCES
Hunk #1 succeeded at 30 (offset 1 line).
(Stripping trailing CRs from patch.)
patching file apps/plugins/lib/viewer.h
(Stripping trailing CRs from patch.)
patching file apps/settings.h
(Stripping trailing CRs from patch.)
patching file apps/filetree.c
Hunk #1 succeeded at 265 (offset -1 lines).
Hunk #2 succeeded at 572 (offset -1 lines).
(Stripping trailing CRs from patch.)
patching file apps/root_menu.c
Hunk #1 succeeded at 179 with fuzz 1 (offset 7 lines).
Hunk #2 succeeded at 294 (offset 8 lines).
Hunk #3 succeeded at 308 (offset 8 lines).
Hunk #4 succeeded at 361 (offset 8 lines).
(Stripping trailing CRs from patch.)
patching file apps/root_menu.h
Comment by Timo Horstschäfer (x1jmp) - Monday, 13 August 2007, 21:53 GMT
Synced and renamed into the plugin into dict2.c to make the patch independent from the original dict plugin.

If you apply the ata_wakeup patch from  FS#7588  you can comment out the rb->ata_wakeup() on line 853 in dict2.c. This will save some seconds when doing a new search while viewing an article (disk already spins up while you type the new search).
Comment by Enmar (Enmar) - Tuesday, 14 August 2007, 06:44 GMT
ok well it seems that the most resent patch patches cleanly but breaks the compiling
Comment by Timo Horstschäfer (x1jmp) - Tuesday, 14 August 2007, 10:14 GMT
A small change brought it out of sync again.

But it compiles for me, did you patch the clean svn source?
Comment by Enmar (Enmar) - Friday, 17 August 2007, 20:59 GMT
okay it compiles now but i STILL get the data abort error like this
Data abort
Comment by Frank M. (framo) - Friday, 17 August 2007, 21:12 GMT
Below the results of the tests I did so far with the dict plugin:
ipod nano simulator - works fine
ipod nano - data abort (I tried several versions over the last 3 months)
ipod video 5.5 30GB - data abort
sansa 280 - data abort
While the fuzzy search seems to works well on all these models, the data abort error appears when trying to open a topic.
Comment by Donald Carr (sirspudd) - Friday, 24 August 2007, 01:59 GMT
I can second this report :

60 gig 5th generation ipod

source : synced from svn today (10 minutes ago)

dict2_all.patch applied, compiles fine and :

"data abort" at (hex address)

is all I get. This looks really really nice, and I am gagging for it. I just wish the input methods contended with the Ipod Linux stuff, which looked pretty funky
Comment by Timo Horstschäfer (x1jmp) - Thursday, 30 August 2007, 13:48 GMT
Bugfix update, but good news for Sansa/iPod users.
The data abort (due to an unaligned memory access) is fixed. Thanks to parafin :)
Comment by Frank M. (framo) - Thursday, 30 August 2007, 21:48 GMT
Not sure why but I'm still getting data aborts (I am testing with dewiki.dict and .idx from 24/12/06).
Compilation is fine and fuzzy search too, the errors appear when trying to browse to an article.
It happens only for 1 out of 2 searches on my Nano, whereas it seems to happen on every search on my Sansa.
Comment by parafin (parafin) - Thursday, 30 August 2007, 22:42 GMT
Hmm, i didn't test much new version before, but it appears that i have data aborts sometimes too. It's pretty rare - around 10% of time. I tried to change alignment step to 8, but still got data aborts... Strange.
Also, scrolling is reversed on my ipod video - scrolling forward scrolls up instead of down.
Comment by Timo Horstschäfer (x1jmp) - Friday, 31 August 2007, 13:14 GMT
Next try, seems to work fine.
Comment by Frank M. (framo) - Sunday, 02 September 2007, 06:48 GMT
Wiki is now working very well for both Nano and Sansa, thank you so much Timo :)
Comment by Enmar (Enmar) - Wednesday, 28 November 2007, 07:50 GMT
Needs resync
Comment by Enmar (Enmar) - Wednesday, 28 November 2007, 09:01 GMT
Nevermind I should probably have checked it before posting
Comment by Enmar (Enmar) - Wednesday, 28 November 2007, 16:04 GMT
Actually there is a problem the data abort error is back.
Comment by Enmar (Enmar) - Wednesday, 02 January 2008, 06:18 GMT
I found out that when listing 80+ articles at once you get the data abort error and a hex address followed undefined instruction and a hex address.
Listing less than 80 articles causes no errors and this occurs on the ipod nano as far as I know.
Comment by Tri Nguyen (tri170391) - Wednesday, 02 January 2008, 06:58 GMT
I can confirm this. If I search the word "sin" when using default config -> Data Abort
If I change the topic limit to 15 and do it again -> No Data Abort
Comment by Isaac (Izzeh) - Saturday, 02 February 2008, 22:22 GMT
Needs resync I believe.. anyone?
Comment by Robert Kukla (roolku) - Saturday, 02 February 2008, 22:47 GMT
here you go
Comment by Isaac (Izzeh) - Saturday, 02 February 2008, 23:39 GMT
Thank you very much - works perfect!
Comment by Rafa? (RvX) - Monday, 18 February 2008, 13:24 GMT
Works fine. I would like to have links in Wikipedia articles active; for example, when I use >> key, it highlights a link in article text and with select button I can move to that linked article. Hitting >> button will highlight first link in actually viewed page i.e. in the middle of article.
Also, I would like to have Undo | Redo function. For example: I read one article from my search, and want to go back to search results and read next article from the list. I simply hit one button and go there. :)
Comment by Isaac (Izzeh) - Monday, 18 February 2008, 20:58 GMT

Is that what you are looking for? lol...
Comment by Rafa? (RvX) - Monday, 18 February 2008, 21:40 GMT
Yes, I am looking for something like that but in this patch, because it's very easy to install new dictionaries, encyclopedias for it. I'll be happy when such enhancement is provided.
Comment by Thomas Martitz (kugel.) - Monday, 24 March 2008, 23:27 GMT
synced. I only changed 1 hunk, so no new patch file.
Comment by Martin H*** (webtaz) - Sunday, 06 April 2008, 16:55 GMT
i think it needs to be synced
it brings up failed hunk while patching
Comment by Martin H*** (webtaz) - Sunday, 04 May 2008, 00:48 GMT
I tried to sync it on my own and it patched and also compiled without errors.
Feel free to try it, and shout out if anything is not ok with it.
and thx to Kugel who had to have a lot of nerve with me^^
Comment by Martin H*** (webtaz) - Sunday, 04 May 2008, 00:48 GMT
I tried to sync it on my own and it patched and also compiled without errors.
Feel free to try it, and shout out if anything is not ok with it.
and thx to Kugel who had to have a lot of nerve with me^^
Comment by Thomas Martitz (kugel.) - Saturday, 17 May 2008, 18:50 GMT
Sync, also removed the DEBUGF stuff. No functional change.
Comment by Thomas Martitz (kugel.) - Saturday, 17 May 2008, 18:51 GMT
I'd like to know if this patch has a chance for inclusion into SVN. I'm not very familiar witht he original dict plugin (i.e. I never used it) so I can't really give a comment on which is better.
Comment by Thomas Martitz (kugel.) - Saturday, 17 May 2008, 22:27 GMT
This one is slightly better. Remove more DEBUGF and replace some tabs with spaces.

The DEBUGF's mostly caused warnings, that's why I removed them.
Comment by Thomas Martitz (kugel.) - Sunday, 18 May 2008, 02:57 GMT
Forget the previous patch.

I'm not sure how that could happen, but I seem to have missed some struct plugin_api -> const struct plugin_api conversions.

This should work, it compiles cleanly.
Comment by Marcoen Hirschberg (marcoen) - Monday, 19 May 2008, 10:17 GMT
I just tried this plugin for the first time, really nice! I noticed that word-wrap doesn't always work correctly, but I haven't tried to find the problem in the code yet.

(look at 'white' and 'live' in the screendump)
Comment by Thomas Martitz (kugel.) - Saturday, 24 May 2008, 18:40 GMT
Hmm, the converted wikipedia dumps seem to be down/unavailable. The stardict page says, that the most common wikis are too big to convert them into the stardict format. Is there a way now to get wikipedia running with this plugin?
Comment by Martin H*** (webtaz) - Monday, 26 May 2008, 22:28 GMT
Wikipedia was/is running on my player for months. I dont know how they converted the dump into dict format, but i'll try to bring the Dump online again, most likely on a One-Click Hoster
Comment by Timo Horstschäfer (x1jmp) - Monday, 26 May 2008, 23:05 GMT
Hm… I tried to make converting wikipedia dumps as easy as I could achieve :)

Have a look at the last "stardict-mediawiki.tar.bz2" I uploaded, it allows you - once installed properly – to download convert wikipedia dumps with just one command, a URL to a pages-articles.xml.bz2 and enough disk space.

The archive has a README included that shows an example of how to use script (though the example URL is outdated and therefor doesn't work…)
Comment by Martin H*** (webtaz) - Wednesday, 28 May 2008, 17:02 GMT Comment by Martin H*** (webtaz) - Wednesday, 28 May 2008, 20:57 GMT Comment by Hankó Gergely (hankog) - Sunday, 20 July 2008, 14:34 GMT
Margins have been removed from the SVN.
I've removed the undefined function from the viewer.c and introduced a left_margin variable instead to use with putsxy().
Now it works fine on my recorder.
Somebody please check if my soulution is correct because this is my first patch ever. I hope it's ok.

This plugin is very useful! Thanks for it!

Comment by Thomas Martitz (kugel.) - Sunday, 20 July 2008, 14:43 GMT
I investigated this issue too. Removing that line is also just fine.

In fact, any change will work just fine. I couldn't get the function in lib/viewer.c to be actually used! (Note that there's also a viewer.c in plugins/, a rename would probably nice).

On the other hand, I'm not too into this patch.
Comment by Hankó Gergely (hankog) - Sunday, 20 July 2008, 15:54 GMT
The simple removing of the function call not enough because the scrollbar overlaps with the main screen so and mess up the first column.
I agree with that the renaming of the viewer.c would be nice.
Comment by Thomas Martitz (kugel.) - Sunday, 20 July 2008, 17:20 GMT
Well, I thought that too. But tests on my e200 didn't show any difference.
Comment by Taylore (trailblaze) - Monday, 25 August 2008, 22:22 GMT
I would love 2 use this patch, as only seeing half the results on my small ipod nano 1st gen screen is very annoying.. It patches fine, with no HUNK errors or any visible problems, but when i "make" it says "viewer.c: In function 'viewer_menu_search':""viewer.c:447:error too many arguements to function 'rb-> splash'" then theres some other stuff that ill type if you need it..
Comment by Timo Horstschäfer (x1jmp) - Tuesday, 26 August 2008, 17:59 GMT
I dont understand why you can only see half of the results... but to get it running replace all the splash() calls mentioned by the compiler with splashf() or use the attached patch :)
Comment by Taylore (trailblaze) - Tuesday, 26 August 2008, 19:53 GMT
Thank you! I will try it now.. Well the ipod nano screen the original dict plugin in rockbox does not show all results since my screen is so small.. And in this dict patch upgrade it said scrolling for large definitions.. All the other resutls appeal 2 me 2 not just that... For example: for the seacrh of "A" it says 1."long defintion"2."long defintion"3. the basic unit of ?????.. So i can not see 3.. Thank you for this new patch !
Comment by Taylore (trailblaze) - Tuesday, 26 August 2008, 21:39 GMT
hmmm... This patch is working, thank you.. But a message pops up when search results pop up.. I get "Data Abort at 0004E7D8 (0)".. This is very persistent.. I can see the results for 2 seconds then they dissappear.. Hmphh just when things looked good.. Sorry for giving you more bad news, I dont know if this happens 2 everyone or just me..
Comment by Timo Horstschäfer (x1jmp) - Thursday, 28 August 2008, 20:52 GMT
I found the simulator on my computer crashing as you described when listing more than 74 results (my irive doesn't). Though I'm unable to say what's causing this behaviour, I limited the search results to 50.
Give it a try!
Comment by Taylore (trailblaze) - Thursday, 28 August 2008, 21:13 GMT
Thanxs a LOT... I wouldnt of been able 2 digagnose the problem like that! I wonder y it doesnt do it on you iriver? Ill tell u right away how it does :)
Comment by Taylore (trailblaze) - Thursday, 28 August 2008, 21:38 GMT
While is building, Is there a way 2 get the dictionary that comes with rockbox in this? since on the last build that didnt work, it wouldnt show that there were dictionary files in /dicts except wen i used stardicts... but stardict's dicts are way 2 large for the 2 gig on mi ipod but the rockbox 1 fits nicely???
Comment by Taylore (trailblaze) - Friday, 29 August 2008, 16:16 GMT
It works like a charm now, thank you!
Comment by Edward Hyer (ejhyer) - Thursday, 11 December 2008, 03:41 GMT
I am hoping to use this in conjunction with the wikipedia reader ( FS#4755 : I patched up the source, but make stopped with this error:
LD dict.rock
make: *** No rule to make target `pluginlib_actions.h', needed by `/home/ehyer/rockbox_ipod55/rockbox_source/build_20081210/apps/plugins/dict2.o'. Stop.

Also, <NOOB>, unclear to me how to revert to daily build after I screw things up patching. Does 'svn co' give me a fresh source tree?</NOOB>
Comment by Tri Nguyen (tri170391) - Thursday, 11 December 2008, 05:28 GMT
That can be fixed by add "lib/" to the #include's (except the plugin.h one), but I can't make a patch now.
Comment by Thomas Schott (scotty) - Sunday, 11 January 2009, 11:14 GMT
Sync to SVN.

Thank you for this patch!
Comment by Thomas Schott (scotty) - Saturday, 31 January 2009, 12:00 GMT
Sync to SVN (adopt to latest plugin and config API changes).
Removed memcpy from dict2.c (use memcpy in apps/plugins/lib/gcc-support.c now).
Comment by Robin Bertram (berti) - Wednesday, 11 March 2009, 18:42 GMT
sync to SVN (only minor changes)
Comment by David Kauffmann (BdN3504) - Tuesday, 17 March 2009, 11:00 GMT
i got a divide by zero on a gigabeat f 40 with r20293 and this patch. plus the device did not turn on normally, i had to move the battery switch to get it started.
Comment by Seth (froggyman) - Friday, 27 March 2009, 14:43 GMT
i tried the link above for where to download a pre converted wikipedia dump, but when i go to the site the download never seems to start, are there any other mirrors that have an encyclopedia in start dict format that i can use? or maybe some sites with dictionaries as well?
Comment by Tri Nguyen (tri170391) - Friday, 27 March 2009, 14:56 GMT
@Seth: Why don't you try the StarDict homepage (google it). They have some good dicts there, and medium to small wikipedia dump. But not big dimps like english ones :(
Comment by Seth (froggyman) - Friday, 27 March 2009, 15:19 GMT
ohh, i was looking for like a full wiki dump, i should have enough space for it on my iPod too!
because what i really want is a almost full wikipedia on my iPod
Comment by Seth (froggyman) - Friday, 27 March 2009, 15:20 GMT
ohh and in english
Comment by Thomas Schott (scotty) - Thursday, 09 July 2009, 16:13 GMT
sync to SVN
fixed warning in apps/lang/english.lang
Comment by Gman (Thecoolgman) - Wednesday, 15 July 2009, 22:28 GMT
needs a resync already
Comment by David Kauffmann (BdN3504) - Thursday, 13 August 2009, 23:27 GMT
First off: Synced to work with 3.3

See my forumthread to get your copy of a precompiled 3.3 build containing lots of GPL dicts from
Please let me know which player you have, so i can make a version for you and don't have to compile for every possible target.

Second: i'll sync to latest revision soon.
Comment by David Kauffmann (BdN3504) - Friday, 14 August 2009, 00:32 GMT
here's the sync to 22304.
i forgot to update the revision numbers in the last patch, it doesn't change the fact that it's working, though.
Comment by David Kauffmann (BdN3504) - Friday, 14 August 2009, 01:18 GMT
Sorry for posting prematurely, here's the real "working copy" ;)
Comment by David Kauffmann (BdN3504) - Friday, 14 August 2009, 01:23 GMT
ok, you better disregard my last two posts. i can't get the plugin to open the index files now anymore. will investigate. help welcome.
Comment by Gerritt Gonzales (GRaTT) - Sunday, 16 August 2009, 21:14 GMT
Fixed opening idx and desc files
Fixed missing last character at end of line.
still some bugs with moving between screens.
Comment by Timo Horstschäfer (x1jmp) - Sunday, 16 August 2009, 22:51 GMT
Very nice to read, that there's still interest in the plugin!

But I want to know that the plugin is kind of obsolete at least to me, as there's the wikipedia plugin ( FS#4755 ) which has quite the same purpose and works quite well, or better.
Though it is primarily written for viewing wikipedia, you can find a converter for stardict dictionaries I posted on its flyspray task (
Comment by Robin Bertram (berti) - Thursday, 24 September 2009, 20:47 GMT
I get a "failed to open index file" error with rockbox 3.4 and dict2_Aug12.patch
in the error message the last character of the index file before the extension is missing
and there's a double slash before the filename

e.g. /dicts//Oxfor.idx instead of /dicts/Oxford.idx

unfortunately I can't code... It might be an easy fix (hopefully)
Comment by Robin Bertram (berti) - Friday, 30 October 2009, 14:44 GMT
ok... this patch works for me on my e200v1 (against r23417)
Comment by Alex (Darkknight512) - Sunday, 28 February 2010, 01:56 GMT
The patch works but the root menu item just crashes my ipod.
Comment by Alex (Darkknight512) - Friday, 04 June 2010, 02:34 GMT
This doesn't compile anymore
Comment by Teruaki Kawashima (teru) - Friday, 18 June 2010, 15:10 GMT
synced to r26919. this works for me. this does not add "Dicionaries" to the root menu.
Comment by Robin Bertram (berti) - Saturday, 19 June 2010, 14:44 GMT
thanks, it works for me, too

I think the "Dictionaries" root menu shouldn't be part of this patch anyway, because
(1) it works for the "new dict plugin" and the "wikipedia plugin".
(2) I think, that a patch should be split up into its funtionalities.

perhaps the root menu item should even have it's own task
Comment by Hayden Pearce (St.) - Monday, 21 June 2010, 16:11 GMT
This patch applies cleanly, but doesn't compile due to recent changes in apps/plugins/libs/viewer.c
It is beyond my ability to resolve this issue.

If someone would be kind enough to sync this to current SVN I would be very appreciative.
I have been trying to push this for a commit on IRC with recent discussion, it is vastly superior to "dict.rock" which in my opinion shouldn't even be in SVN with the limitation is has currently (no search, no scroll).
Again, if this could be synced with current SVN I would be very appreciative.

Comment by Teruaki Kawashima (teru) - Tuesday, 22 June 2010, 04:00 GMT
judging from the output, it looks like you didn't revert previous patch or something like.
make sure following files are removed and apply the patch again.
- apps/plugins/dict2.c
- apps/plugins/lib/viewer.c
- apps/plugins/lib/viewer.h

by the way, current dict plugin should scroll the text now.
Comment by Hayden Pearce (St.) - Wednesday, 23 June 2010, 07:38 GMT
That was applied to clean SVN checkout, so not sure how that could be the case... :/

Comment by Alex (Darkknight512) - Thursday, 01 July 2010, 00:19 GMT
I have the same problem on the synced patch.
Comment by JoshuaChang (JoshuaChang) - Tuesday, 12 April 2011, 11:38 GMT
hope this helps, sync against svn r29706