FS#11399 by me: fix r26998 for text_viewer
[kugel-rb.git] / apps / plugins / text_viewer / tv_text_reader.h
blob5162892f4baf65c5df422f74fa106045ea7c72d7
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 * [In/Out] buf
30 * the start pointer of the buffer
32 * [In/Out] size
33 * enabled buffer size
35 * return
36 * true initialize success
37 * false initialize failure
39 bool tv_init_text_reader(unsigned char **buf, size_t *bufsize);
41 /* finalize the text reader module */
42 void tv_finalize_text_reader(void);
45 * set the read conditions
47 * [In] blocks
48 * block count
50 * [In] width
51 * block width
53 void tv_set_read_conditions(int blocks, int width);
56 * return the total text size
58 * return
59 * the total text size
61 off_t tv_get_total_text_size(void);
64 * get the text of the next line
66 * [Out] buf
67 * the pointer of the pointer which store the text
69 * return
70 * true next line exists
71 * false next line does not exist
73 bool tv_get_next_line(const unsigned char **buf);
76 * start to read lines
78 * [In] block
79 * the index of block to read text
81 * [In] is_multi
82 * true read 2 blocks
83 * false read 1 block
85 void tv_read_start(int block, bool is_multi);
88 * end to read lines
90 * return
91 * read text size
93 int tv_read_end(void);
95 /* seek to the head of the file */
96 void tv_seek_top(void);
98 #endif