Fix buffer size used for realpath() call
[maemo-rb.git] / apps / plugins / text_viewer / tv_bookmark.h
blob85b52b2c4f36f8d2bfed244073f93657438b0e85
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_BOOKMARK_H
24 #define PLUGIN_TEXT_VIEWER_BOOKMARK_H
26 #include "tv_screen_pos.h"
28 /* stuff for the bookmarking */
30 /* Maximum amount of register possible bookmarks */
31 #define TV_MAX_BOOKMARKS 16
32 #define SERIALIZE_BOOKMARK_SIZE 8
35 * initialize the bookmark module
37 * [In/Out] buf
38 * the start pointer of the buffer
40 * [In/Out] size
41 * buffer size
43 * return
44 * true initialize success
45 * false initialize failure
47 bool tv_init_bookmark(unsigned char **buf, size_t *size);
49 /* finalize the bookmark module */
50 void tv_finalize_bookmark(void);
53 * get the positions which registered bookmarks
55 * [Out] pos_array
56 * the array which store positions of all bookmarks
58 * return
59 * bookmark count
61 int tv_get_bookmark_positions(struct tv_screen_pos *pos_array);
64 * the function that a bookmark add when there is not a bookmark in the given position
65 * or the bookmark remove when there exist a bookmark in the given position.
67 void tv_toggle_bookmark(void);
70 * The menu that can select registered bookmarks is displayed, one is selected from
71 * among them, and moves to the page which selected bookmarks.
73 void tv_select_bookmark(void);
75 /* creates system bookmark */
76 void tv_create_system_bookmark(void);
79 * serialize the bookmark array
81 * [In] fd
82 * the file descripter which is stored the result.
84 * Return
85 * the size of the result
87 int tv_serialize_bookmarks(unsigned char *buf);
90 * deserialize the bookmark array
92 * [In] fd
93 * the file descripter which is stored the serialization of the bookmark array.
95 * Return
96 * true success
97 * false failure
99 bool tv_deserialize_bookmarks(int fd);
101 #endif