text_viewer: cleanup & bugfix
[kugel-rb.git] / apps / plugins / text_viewer / tv_text_reader.h
blob50059c8b3c3e0b24a05a080a100a86e235f647ba
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 Gilles Roux
11 * 2003 Garrett Derner
12 * 2010 Yoshihisa Uchida
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
23 #ifndef PLUGIN_TEXT_VIEWER_TEXT_READER_H
24 #define PLUGIN_TEXT_VIEWER_TEXT_READER_H
27 * initialize the text reader module
29 * return
30 * true initialize success
31 * false initialize failure
33 bool tv_init_text_reader(void);
35 /* finalize the text reader module */
36 void tv_finalize_text_reader(void);
39 * set the read conditions
41 * [In] blocks
42 * block count
44 * [In] width
45 * block width
47 void tv_set_read_conditions(int blocks, int width);
50 * return the total text size
52 * return
53 * the total text size
55 off_t tv_get_total_text_size(void);
58 * get the text of the next line
60 * [Out] buf
61 * the pointer of the pointer which store the text
63 * return
64 * true next line exists
65 * false next line does not exist
67 bool tv_get_next_line(const unsigned char **buf);
70 * start to read lines
72 * [In] block
73 * the index of block to read text
75 * [In] is_multi
76 * true read 2 blocks
77 * false read 1 block
79 void tv_read_start(int block, bool is_multi);
82 * end to read lines
84 * return
85 * read text size
87 int tv_read_end(void);
89 /* seek to the head of the file */
90 void tv_seek_top(void);
92 #endif