Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
c2251f25
Commit
c2251f25
authored
Dec 03, 2003
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all:
* doxygenated parts of the messages system
parent
8cedcb3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
50 deletions
+73
-50
include/vlc_messages.h
include/vlc_messages.h
+36
-26
src/misc/messages.c
src/misc/messages.c
+37
-24
No files found.
include/vlc_messages.h
View file @
c2251f25
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* interface, such as message output.
* interface, such as message output.
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: vlc_messages.h,v 1.
8 2002/12/18 11:47:35 sam
Exp $
* $Id: vlc_messages.h,v 1.
9 2003/12/03 23:01:48 sigmunau
Exp $
*
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Samuel Hocevar <sam@zoy.org>
...
@@ -25,19 +25,25 @@
...
@@ -25,19 +25,25 @@
*****************************************************************************/
*****************************************************************************/
#include <stdarg.h>
#include <stdarg.h>
/**
* \defgroup messages Messages
* This library provides basic functions for threads to interact with user
* interface, such as message output.
*
* @{
*/
/*****************************************************************************
* msg_item_t
/**
*****************************************************************************
* Store a single message.
* Store a single message.
*
****************************************************************************
/
*/
typedef
struct
typedef
struct
{
{
int
i_type
;
/*
message type, see below */
int
i_type
;
/**<
message type, see below */
int
i_object_id
;
int
i_object_id
;
int
i_object_type
;
int
i_object_type
;
char
*
psz_module
;
char
*
psz_module
;
char
*
psz_msg
;
/*
the message itself */
char
*
psz_msg
;
/**<
the message itself */
#if 0
#if 0
mtime_t date; /* date of the message */
mtime_t date; /* date of the message */
...
@@ -48,25 +54,27 @@ typedef struct
...
@@ -48,25 +54,27 @@ typedef struct
}
msg_item_t
;
}
msg_item_t
;
/* Message types */
/* Message types */
#define VLC_MSG_INFO 0
/* standard messages */
/** standard messages */
#define VLC_MSG_ERR 1
/* error messages */
#define VLC_MSG_INFO 0
#define VLC_MSG_WARN 2
/* warning messages */
/** error messages */
#define VLC_MSG_DBG 3
/* debug messages */
#define VLC_MSG_ERR 1
/** warning messages */
/*****************************************************************************
#define VLC_MSG_WARN 2
* msg_bank_t
/** debug messages */
*****************************************************************************
#define VLC_MSG_DBG 3
/**
* Store all data requiered by messages interfaces.
* Store all data requiered by messages interfaces.
*
****************************************************************************
/
*/
struct
msg_bank_t
struct
msg_bank_t
{
{
/* Message queue lock */
/*
*
Message queue lock */
vlc_mutex_t
lock
;
vlc_mutex_t
lock
;
vlc_bool_t
b_configured
;
vlc_bool_t
b_configured
;
vlc_bool_t
b_overflow
;
vlc_bool_t
b_overflow
;
/* Message queue */
/* Message queue */
msg_item_t
msg
[
VLC_MSG_QSIZE
];
/*
message queue */
msg_item_t
msg
[
VLC_MSG_QSIZE
];
/**<
message queue */
int
i_start
;
int
i_start
;
int
i_stop
;
int
i_stop
;
...
@@ -80,11 +88,9 @@ struct msg_bank_t
...
@@ -80,11 +88,9 @@ struct msg_bank_t
#endif
#endif
};
};
/*****************************************************************************
/**
* msg_subscription_t
*****************************************************************************
* Used by interface plugins which subscribe to the message bank.
* Used by interface plugins which subscribe to the message bank.
*
****************************************************************************
/
*/
struct
msg_subscription_t
struct
msg_subscription_t
{
{
int
i_start
;
int
i_start
;
...
@@ -98,10 +104,10 @@ struct msg_subscription_t
...
@@ -98,10 +104,10 @@ struct msg_subscription_t
* Prototypes
* Prototypes
*****************************************************************************/
*****************************************************************************/
VLC_EXPORT
(
void
,
__msg_Generic
,
(
vlc_object_t
*
,
int
,
const
char
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
4
,
5
)
);
VLC_EXPORT
(
void
,
__msg_Generic
,
(
vlc_object_t
*
,
int
,
const
char
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
4
,
5
)
);
VLC_EXPORT
(
void
,
__msg_Info
,
(
v
oid
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
VLC_EXPORT
(
void
,
__msg_Info
,
(
v
lc_object_t
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
VLC_EXPORT
(
void
,
__msg_Err
,
(
v
oid
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
VLC_EXPORT
(
void
,
__msg_Err
,
(
v
lc_object_t
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
VLC_EXPORT
(
void
,
__msg_Warn
,
(
v
oid
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
VLC_EXPORT
(
void
,
__msg_Warn
,
(
v
lc_object_t
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
VLC_EXPORT
(
void
,
__msg_Dbg
,
(
v
oid
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
VLC_EXPORT
(
void
,
__msg_Dbg
,
(
v
lc_object_t
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
#ifdef HAVE_VARIADIC_MACROS
#ifdef HAVE_VARIADIC_MACROS
...
@@ -142,3 +148,7 @@ void __msg_Destroy ( vlc_object_t * );
...
@@ -142,3 +148,7 @@ void __msg_Destroy ( vlc_object_t * );
VLC_EXPORT
(
msg_subscription_t
*
,
__msg_Subscribe
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
msg_subscription_t
*
,
__msg_Subscribe
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
void
,
__msg_Unsubscribe
,
(
vlc_object_t
*
,
msg_subscription_t
*
)
);
VLC_EXPORT
(
void
,
__msg_Unsubscribe
,
(
vlc_object_t
*
,
msg_subscription_t
*
)
);
/**
* @}
*/
src/misc/messages.c
View file @
c2251f25
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* modules, especially intf modules. See config.h for output configuration.
* modules, especially intf modules. See config.h for output configuration.
*****************************************************************************
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* Copyright (C) 1998-2002 VideoLAN
* $Id: messages.c,v 1.3
5 2003/10/08 21:01:07 gbazin
Exp $
* $Id: messages.c,v 1.3
6 2003/12/03 23:01:48 sigmunau
Exp $
*
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Samuel Hocevar <sam@zoy.org>
...
@@ -67,12 +67,12 @@ static void QueueMsg ( vlc_object_t *, int , const char *,
...
@@ -67,12 +67,12 @@ static void QueueMsg ( vlc_object_t *, int , const char *,
static
void
FlushMsg
(
msg_bank_t
*
);
static
void
FlushMsg
(
msg_bank_t
*
);
static
void
PrintMsg
(
vlc_object_t
*
,
msg_item_t
*
);
static
void
PrintMsg
(
vlc_object_t
*
,
msg_item_t
*
);
/**
***************************************************************************
/**
*
msg_Create: i
nitialize messages interface
*
I
nitialize messages interface
*
****************************************************************************
*
* This functions has to be called before any call to other msg_* functions.
* This functions has to be called before any call to other msg_* functions.
* It set up the locks and the message queue if it is used.
* It set up the locks and the message queue if it is used.
*
****************************************************************************
/
*/
void
__msg_Create
(
vlc_object_t
*
p_this
)
void
__msg_Create
(
vlc_object_t
*
p_this
)
{
{
/* Message queue initialization */
/* Message queue initialization */
...
@@ -96,9 +96,9 @@ void __msg_Create( vlc_object_t *p_this )
...
@@ -96,9 +96,9 @@ void __msg_Create( vlc_object_t *p_this )
#endif
#endif
}
}
/**
***************************************************************************
/**
*
msg_Flush: f
lush the message queue
*
F
lush the message queue
*
****************************************************************************
/
*/
void
__msg_Flush
(
vlc_object_t
*
p_this
)
void
__msg_Flush
(
vlc_object_t
*
p_this
)
{
{
int
i_index
;
int
i_index
;
...
@@ -119,13 +119,13 @@ void __msg_Flush( vlc_object_t *p_this )
...
@@ -119,13 +119,13 @@ void __msg_Flush( vlc_object_t *p_this )
vlc_mutex_unlock
(
&
p_this
->
p_libvlc
->
msg_bank
.
lock
);
vlc_mutex_unlock
(
&
p_this
->
p_libvlc
->
msg_bank
.
lock
);
}
}
/**
***************************************************************************
/**
*
msg_Destroy: f
ree resources allocated by msg_Create
*
F
ree resources allocated by msg_Create
*
****************************************************************************
*
* This functions prints all messages remaining in queue, then free all the
* This functions prints all messages remaining in queue, then free all the
* resources allocated by msg_Create.
* resources allocated by msg_Create.
* No other messages interface functions should be called after this one.
* No other messages interface functions should be called after this one.
*
****************************************************************************
/
*/
void
__msg_Destroy
(
vlc_object_t
*
p_this
)
void
__msg_Destroy
(
vlc_object_t
*
p_this
)
{
{
if
(
p_this
->
p_libvlc
->
msg_bank
.
i_sub
)
if
(
p_this
->
p_libvlc
->
msg_bank
.
i_sub
)
...
@@ -151,9 +151,9 @@ void __msg_Destroy( vlc_object_t *p_this )
...
@@ -151,9 +151,9 @@ void __msg_Destroy( vlc_object_t *p_this )
vlc_mutex_destroy
(
&
p_this
->
p_libvlc
->
msg_bank
.
lock
);
vlc_mutex_destroy
(
&
p_this
->
p_libvlc
->
msg_bank
.
lock
);
}
}
/**
***************************************************************************
/**
*
msg_Subscribe: s
ubscribe to the message queue.
*
S
ubscribe to the message queue.
*
****************************************************************************
/
*/
msg_subscription_t
*
__msg_Subscribe
(
vlc_object_t
*
p_this
)
msg_subscription_t
*
__msg_Subscribe
(
vlc_object_t
*
p_this
)
{
{
msg_bank_t
*
p_bank
=
&
p_this
->
p_libvlc
->
msg_bank
;
msg_bank_t
*
p_bank
=
&
p_this
->
p_libvlc
->
msg_bank
;
...
@@ -175,9 +175,9 @@ msg_subscription_t *__msg_Subscribe( vlc_object_t *p_this )
...
@@ -175,9 +175,9 @@ msg_subscription_t *__msg_Subscribe( vlc_object_t *p_this )
return
p_sub
;
return
p_sub
;
}
}
/**
***************************************************************************
/**
*
msg_Unsubscribe: u
nsubscribe from the message queue.
*
U
nsubscribe from the message queue.
*
****************************************************************************
/
*/
void
__msg_Unsubscribe
(
vlc_object_t
*
p_this
,
msg_subscription_t
*
p_sub
)
void
__msg_Unsubscribe
(
vlc_object_t
*
p_this
,
msg_subscription_t
*
p_sub
)
{
{
msg_bank_t
*
p_bank
=
&
p_this
->
p_libvlc
->
msg_bank
;
msg_bank_t
*
p_bank
=
&
p_this
->
p_libvlc
->
msg_bank
;
...
@@ -231,7 +231,7 @@ void __msg_Generic( vlc_object_t *p_this, int i_type, const char *psz_module,
...
@@ -231,7 +231,7 @@ void __msg_Generic( vlc_object_t *p_this, int i_type, const char *psz_module,
/* Generic functions used when variadic macros are not available. */
/* Generic functions used when variadic macros are not available. */
#define DECLARE_MSG_FN( FN_NAME, FN_TYPE ) \
#define DECLARE_MSG_FN( FN_NAME, FN_TYPE ) \
void FN_NAME( v
oid
*p_this, const char *psz_format, ... ) \
void FN_NAME( v
lc_object_t
*p_this, const char *psz_format, ... ) \
{ \
{ \
va_list args; \
va_list args; \
va_start( args, psz_format ); \
va_start( args, psz_format ); \
...
@@ -240,20 +240,33 @@ void __msg_Generic( vlc_object_t *p_this, int i_type, const char *psz_module,
...
@@ -240,20 +240,33 @@ void __msg_Generic( vlc_object_t *p_this, int i_type, const char *psz_module,
va_end( args ); \
va_end( args ); \
} \
} \
struct _
struct _
/**
* Output an informational message.
* \note Do not use this for debug messages
* \see input_AddInfo
*/
DECLARE_MSG_FN
(
__msg_Info
,
VLC_MSG_INFO
);
DECLARE_MSG_FN
(
__msg_Info
,
VLC_MSG_INFO
);
/**
* Output an error message.
*/
DECLARE_MSG_FN
(
__msg_Err
,
VLC_MSG_ERR
);
DECLARE_MSG_FN
(
__msg_Err
,
VLC_MSG_ERR
);
/**
* Output a waring message
*/
DECLARE_MSG_FN
(
__msg_Warn
,
VLC_MSG_WARN
);
DECLARE_MSG_FN
(
__msg_Warn
,
VLC_MSG_WARN
);
/**
* Output a debug message
*/
DECLARE_MSG_FN
(
__msg_Dbg
,
VLC_MSG_DBG
);
DECLARE_MSG_FN
(
__msg_Dbg
,
VLC_MSG_DBG
);
/**
***************************************************************************
/**
*
QueueMsg: a
dd a message to a queue
*
A
dd a message to a queue
*
****************************************************************************
*
* This function provides basic functionnalities to other msg_* functions.
* This function provides basic functionnalities to other msg_* functions.
* It adds a message to a queue (after having printed all stored messages if it
* It adds a message to a queue (after having printed all stored messages if it
* is full). If the message can't be converted to string in memory, it issues
* is full). If the message can't be converted to string in memory, it issues
* a warning.
* a warning.
*
****************************************************************************
/
*/
static
void
QueueMsg
(
vlc_object_t
*
p_this
,
int
i_type
,
const
char
*
psz_module
,
static
void
QueueMsg
(
vlc_object_t
*
p_this
,
int
i_type
,
const
char
*
psz_module
,
const
char
*
psz_format
,
va_list
_args
)
const
char
*
psz_format
,
va_list
_args
)
{
{
...
...
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