summaryrefslogtreecommitdiff
path: root/apps/plugins/text_viewer/tv_reader.c
diff options
context:
space:
mode:
authorYoshihisa Uchida <uchida@rockbox.org>2010-06-29 11:05:36 +0000
committerYoshihisa Uchida <uchida@rockbox.org>2010-06-29 11:05:36 +0000
commit07d03729ff537eca8429cea27c1f2d15f04ec54f (patch)
tree2f72e7d67f3da45710c2dd302f16654b80aa1016 /apps/plugins/text_viewer/tv_reader.c
parent7195f3a30cc73e1540a590c519c9a2ecec137952 (diff)
downloadrockbox-07d03729ff537eca8429cea27c1f2d15f04ec54f.zip
rockbox-07d03729ff537eca8429cea27c1f2d15f04ec54f.tar.gz
rockbox-07d03729ff537eca8429cea27c1f2d15f04ec54f.tar.bz2
rockbox-07d03729ff537eca8429cea27c1f2d15f04ec54f.tar.xz
text_viewer: callback functions are changed to the function that returns int value.
And the text viewer quits when the problem occurs by callback functions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27172 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/text_viewer/tv_reader.c')
-rw-r--r--apps/plugins/text_viewer/tv_reader.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/plugins/text_viewer/tv_reader.c b/apps/plugins/text_viewer/tv_reader.c
index 8403c30..b94dc17 100644
--- a/apps/plugins/text_viewer/tv_reader.c
+++ b/apps/plugins/text_viewer/tv_reader.c
@@ -132,7 +132,7 @@ void tv_seek(off_t offset, int whence)
}
}
-static void tv_change_preferences(const struct tv_preferences *oldp)
+static int tv_change_preferences(const struct tv_preferences *oldp)
{
unsigned char bom[BOM_SIZE];
int cur_start_file_pos = start_file_pos;
@@ -151,7 +151,7 @@ static void tv_change_preferences(const struct tv_preferences *oldp)
fd = rb->open(preferences->file_name, O_RDONLY);
if (fd < 0)
- return;
+ return TV_CALLBACK_ERROR;
}
/*
@@ -168,6 +168,7 @@ static void tv_change_preferences(const struct tv_preferences *oldp)
file_size = rb->filesize(fd) - start_file_pos;
tv_seek(cur_file_pos + cur_start_file_pos - start_file_pos, SEEK_SET);
+ return TV_CALLBACK_OK;
}
bool tv_init_reader(unsigned char **buf, size_t *size)