Commit 45e63d59 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Factor variable operations, as they're always the same for a type

parent 7b67031a
...@@ -139,7 +139,6 @@ static inline void __vlc_fourcc_to_char( vlc_fourcc_t fcc, char *psz_fourcc ) ...@@ -139,7 +139,6 @@ static inline void __vlc_fourcc_to_char( vlc_fourcc_t fcc, char *psz_fourcc )
typedef struct vlc_list_t vlc_list_t; typedef struct vlc_list_t vlc_list_t;
typedef struct vlc_object_t vlc_object_t; typedef struct vlc_object_t vlc_object_t;
typedef struct libvlc_int_t libvlc_int_t; typedef struct libvlc_int_t libvlc_int_t;
typedef struct variable_t variable_t;
typedef struct date_t date_t; typedef struct date_t date_t;
typedef struct dict_entry_t dict_entry_t; typedef struct dict_entry_t dict_entry_t;
typedef struct dict_t dict_t; typedef struct dict_t dict_t;
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#ifndef LIBVLC_LIBVLC_H #ifndef LIBVLC_LIBVLC_H
# define LIBVLC_LIBVLC_H 1 # define LIBVLC_LIBVLC_H 1
typedef struct variable_t variable_t;
extern const char vlc_usage[]; extern const char vlc_usage[];
/* Hotkey stuff */ /* Hotkey stuff */
......
This diff is collapsed.
...@@ -30,6 +30,13 @@ ...@@ -30,6 +30,13 @@
typedef struct callback_entry_t callback_entry_t; typedef struct callback_entry_t callback_entry_t;
typedef struct variable_ops_t
{
int (*pf_cmp) ( vlc_value_t, vlc_value_t );
void (*pf_dup) ( vlc_value_t * );
void (*pf_free) ( vlc_value_t * );
} variable_ops_t;
/** /**
* The structure describing a variable. * The structure describing a variable.
* \note vlc_value_t is the common union for variable values * \note vlc_value_t is the common union for variable values
...@@ -46,12 +53,7 @@ struct variable_t ...@@ -46,12 +53,7 @@ struct variable_t
/** The variable display name, mainly for use by the interfaces */ /** The variable display name, mainly for use by the interfaces */
char * psz_text; char * psz_text;
/** A pointer to a comparison function */ const variable_ops_t *ops;
int ( * pf_cmp ) ( vlc_value_t, vlc_value_t );
/** A pointer to a duplication function */
void ( * pf_dup ) ( vlc_value_t * );
/** A pointer to a deallocation function */
void ( * pf_free ) ( vlc_value_t * );
/** Creation count: we only destroy the variable if it reaches 0 */ /** Creation count: we only destroy the variable if it reaches 0 */
int i_usage; int i_usage;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment