Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
7ee2435d
Commit
7ee2435d
authored
Oct 16, 2002
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ./include/variables.h, ./src/misc/variables.c: implemented variable
callbacks.
parent
ec8c6318
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
243 additions
and
63 deletions
+243
-63
include/variables.h
include/variables.h
+42
-28
include/vlc_common.h
include/vlc_common.h
+10
-1
src/misc/variables.c
src/misc/variables.c
+191
-34
No files found.
include/variables.h
View file @
7ee2435d
...
...
@@ -2,7 +2,7 @@
* variables.h: variables handling
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: variables.h,v 1.
3 2002/10/14 19:04:51
sam Exp $
* $Id: variables.h,v 1.
4 2002/10/16 19:39:42
sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -21,17 +21,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/* Variable types - probably very incomplete */
#define VLC_VAR_BOOL 0x0100
#define VLC_VAR_INTEGER 0x0200
#define VLC_VAR_STRING 0x0300
#define VLC_VAR_MODULE 0x0301
#define VLC_VAR_FILE 0x0302
#define VLC_VAR_FLOAT 0x0400
#define VLC_VAR_TIME 0x0500
#define VLC_VAR_ADDRESS 0x0600
#define VLC_VAR_COMMAND 0x0700
#define VLC_VAR_MUTEX 0x0800
typedef
struct
callback_entry_t
callback_entry_t
;
/*****************************************************************************
* vlc_value_t is the common union for variable values; variable_t is the
...
...
@@ -39,18 +29,35 @@
*****************************************************************************/
struct
variable_t
{
u32
i_hash
;
char
*
psz_name
;
/* The variable's exported value */
vlc_value_t
val
;
/* The variable unique name, (almost) unique hashed value, and type */
char
*
psz_name
;
u32
i_hash
;
int
i_type
;
vlc_value_t
val
;
/* Lots of other things that can be added */
int
i_usage
;
vlc_bool_t
b_set
;
vlc_bool_t
b_active
;
int
i_entries
;
callback_entry_t
*
p_entries
;
};
/*****************************************************************************
* Variable types - probably very incomplete
*****************************************************************************/
#define VLC_VAR_BOOL 0x0100
#define VLC_VAR_INTEGER 0x0200
#define VLC_VAR_STRING 0x0300
#define VLC_VAR_MODULE 0x0301
#define VLC_VAR_FILE 0x0302
#define VLC_VAR_FLOAT 0x0400
#define VLC_VAR_TIME 0x0500
#define VLC_VAR_ADDRESS 0x0600
#define VLC_VAR_COMMAND 0x0700
#define VLC_VAR_MUTEX 0x0800
/*****************************************************************************
* Prototypes
*****************************************************************************/
...
...
@@ -61,18 +68,25 @@ VLC_EXPORT( int, __var_Type, ( vlc_object_t *, const char * ) );
VLC_EXPORT
(
int
,
__var_Set
,
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
)
);
VLC_EXPORT
(
int
,
__var_Get
,
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
*
)
);
#define var_Create(a,b,c)
\
__var_Create( VLC_OBJECT(a), b, c
)
#define var_Create(a,b,c)
__var_Create( VLC_OBJECT(a), b, c )
#define var_Destroy(a,b) __var_Destroy( VLC_OBJECT(a), b
)
#define var_Destroy(a,b) \
__var_Destroy( VLC_OBJECT(a), b )
#define var_Type(a,b) __var_Type( VLC_OBJECT(a), b )
#define var_Set(a,b,c) __var_Set( VLC_OBJECT(a), b, c )
#define var_Get(a,b,c) __var_Get( VLC_OBJECT(a), b, c )
#define var_Type(a,b) \
__var_Type( VLC_OBJECT(a), b )
#define var_Set(a,b,c) \
__var_Set( VLC_OBJECT(a), b, c )
/*****************************************************************************
* Variable callbacks
*****************************************************************************
* int MyCallback( vlc_object_t *p_this,
* char const *psz_variable,
* vlc_value_t oldvalue,
* vlc_value_t newvalue,
* void *p_data);
*****************************************************************************/
VLC_EXPORT
(
int
,
__var_AddCallback
,
(
vlc_object_t
*
,
const
char
*
,
vlc_callback_t
,
void
*
)
);
VLC_EXPORT
(
int
,
__var_DelCallback
,
(
vlc_object_t
*
,
const
char
*
,
vlc_callback_t
,
void
*
)
);
#define var_
Get(a,b,c) \
__var_Get( VLC_OBJECT(a), b, c
)
#define var_
AddCallback(a,b,c,d) __var_AddCallback( VLC_OBJECT(a), b, c, d )
#define var_DelCallback(a,b,c,d) __var_DelCallback( VLC_OBJECT(a), b, c, d
)
include/vlc_common.h
View file @
7ee2435d
...
...
@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.3
0 2002/10/16 15:10:39
sam Exp $
* $Id: vlc_common.h,v 1.3
1 2002/10/16 19:39:42
sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
...
...
@@ -236,6 +236,15 @@ typedef struct bit_stream_t bit_stream_t;
typedef
struct
network_socket_t
network_socket_t
;
typedef
struct
iso639_lang_t
iso639_lang_t
;
/*****************************************************************************
* Variable callbacks
*****************************************************************************/
typedef
int
(
*
vlc_callback_t
)
(
vlc_object_t
*
,
/* variable's object */
char
const
*
,
/* variable name */
vlc_value_t
,
/* old value */
vlc_value_t
,
/* new value */
void
*
);
/* callback data */
/*****************************************************************************
* Plug-in stuff
*****************************************************************************/
...
...
src/misc/variables.c
View file @
7ee2435d
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment