1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 Gilles Roux
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
30 * the start pointer of the buffer
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
53 void tv_set_read_conditions(int blocks
, int width
);
56 * return the total text size
61 off_t
tv_get_total_text_size(void);
64 * get the text of the next line
67 * the pointer of the pointer which store the text
70 * true next line exists
71 * false next line does not exist
73 bool tv_get_next_line(const unsigned char **buf
);
79 * the index of block to read text
85 void tv_read_start(int block
, bool is_multi
);
93 int tv_read_end(void);
95 /* seek to the head of the file */
96 void tv_seek_top(void);