]> git.sesse.net Git - vlc/blob - modules/codec/cmml/history.h
Merge branch 'master' of git@git.videolan.org:vlc
[vlc] / modules / codec / cmml / history.h
1 /*****************************************************************************
2  * history.h: vlc_history_t (web-browser-like back/forward history) handling
3  *****************************************************************************
4  * Copyright (C) 2004 Commonwealth Scientific and Industrial Research
5  *                    Organisation (CSIRO) Australia
6  * Copyright (C) 2004 the VideoLAN team
7  *
8  * $Id$
9  *
10  * Authors: Andre Pang <Andre.Pang@csiro.au>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25  *****************************************************************************/
26
27 #ifndef __VLC_HISTORY_H__
28 #define __VLC_HISTORY_H__
29
30 #define XARRAY_EMBED_IN_HOST_C_FILE
31 #include "xarray.h"
32
33 struct history_item_t
34 {
35     char * psz_name;
36     char * psz_uri;
37 };
38
39 struct history_t
40 {
41     unsigned int i_index; /* current index into history */
42     XArray * p_xarray;
43 };
44
45 typedef struct history_item_t history_item_t;
46 typedef struct history_t history_t;
47
48
49 /*****************************************************************************
50  * Exported prototypes
51  *****************************************************************************/
52 history_t       * history_New                        ( void );
53 bool        history_GoBackSavingCurrentItem    ( history_t *,
54                                                        history_item_t * );
55 bool        history_GoForwardSavingCurrentItem ( history_t *,
56                                                        history_item_t * );
57 bool        history_CanGoBack                  ( history_t * );
58 bool        history_CanGoForward               ( history_t * );
59 history_item_t  * history_Item                       ( history_t * );
60 void              history_Prune                      ( history_t * );
61 void              history_PruneAndInsert             ( history_t *,
62                                                        history_item_t * );
63 unsigned int      history_Count                      ( history_t * );
64 unsigned int      history_Index                      ( history_t * );
65
66 history_item_t  * historyItem_New                    ( char *, char * );
67
68 #endif /* __VLC_HISTORY_H__ */
69