Fix memory leak in video_output on Mac OS X (close #6267)
[vlc/solaris.git] / src / misc / variables.h
blob2ab9a1e09c7b5c9ae2f4d02861677c666b60d38e
1 /*****************************************************************************
2 * variables.h: object variables typedefs
3 *****************************************************************************
4 * Copyright (C) 2002-2006 VLC authors and VideoLAN
5 * $Id$
7 * Authors: Samuel Hocevar <sam@zoy.org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef LIBVLC_VARIABLES_H
25 # define LIBVLC_VARIABLES_H 1
27 typedef struct callback_entry_t callback_entry_t;
29 typedef struct variable_ops_t
31 int (*pf_cmp) ( vlc_value_t, vlc_value_t );
32 void (*pf_dup) ( vlc_value_t * );
33 void (*pf_free) ( vlc_value_t * );
34 } variable_ops_t;
36 /**
37 * The structure describing a variable.
38 * \note vlc_value_t is the common union for variable values
40 struct variable_t
42 char * psz_name; /**< The variable unique name (must be first) */
44 /** The variable's exported value */
45 vlc_value_t val;
47 /** The variable display name, mainly for use by the interfaces */
48 char * psz_text;
50 const variable_ops_t *ops;
52 int i_type; /**< The type of the variable */
53 unsigned i_usage; /**< Reference count */
55 /** If the variable has min/max/step values */
56 vlc_value_t min, max, step;
58 /** Index of the default choice, if the variable is to be chosen in
59 * a list */
60 int i_default;
61 /** List of choices */
62 vlc_list_t choices;
63 /** List of friendly names for the choices */
64 vlc_list_t choices_text;
66 /** Set to TRUE if the variable is in a callback */
67 bool b_incallback;
69 /** Number of registered callbacks */
70 int i_entries;
71 /** Array of registered callbacks */
72 callback_entry_t * p_entries;
75 extern void var_DestroyAll( vlc_object_t * );
77 #endif