[vlc-commits] lib: remove libvlc_event_type_name()
Rémi Denis-Courmont
git at videolan.org
Sun Jul 15 14:16:30 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 11 20:33:16 2018 +0300| [e5432f1b133b101e662799762f515282b4543a49] | committer: Rémi Denis-Courmont
lib: remove libvlc_event_type_name()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e5432f1b133b101e662799762f515282b4543a49
---
include/vlc/libvlc.h | 7 ----
include/vlc/libvlc_events.h | 2 +-
lib/event.c | 94 ---------------------------------------------
lib/libvlc.sym | 1 -
4 files changed, 1 insertion(+), 103 deletions(-)
diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
index b6ee2efc50..a97055b9da 100644
--- a/include/vlc/libvlc.h
+++ b/include/vlc/libvlc.h
@@ -346,13 +346,6 @@ LIBVLC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
libvlc_callback_t f_callback,
void *p_user_data );
-/**
- * Get an event's type name.
- *
- * \param event_type the desired event
- */
-LIBVLC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
-
/** @} */
/** \defgroup libvlc_log LibVLC logging
diff --git a/include/vlc/libvlc_events.h b/include/vlc/libvlc_events.h
index e7083a7983..24bdec0852 100644
--- a/include/vlc/libvlc_events.h
+++ b/include/vlc/libvlc_events.h
@@ -47,7 +47,7 @@ typedef struct libvlc_renderer_item_t libvlc_renderer_item_t;
enum libvlc_event_e {
/* Append new event types at the end of a category.
* Do not remove, insert or re-order any entry.
- * Keep this in sync with lib/event.c:libvlc_event_type_name(). */
+ */
/**
* Metadata of a \link #libvlc_media_t media item\endlink changed
diff --git a/lib/event.c b/lib/event.c
index 7ac9d37886..8c64cacac3 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -126,100 +126,6 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
* Public libvlc functions
*/
-#define DEF( a ) { libvlc_##a, #a, },
-
-typedef struct
-{
- int type;
- const char name[40];
-} event_name_t;
-
-static const event_name_t event_list[] = {
- DEF(MediaMetaChanged)
- DEF(MediaSubItemAdded)
- DEF(MediaDurationChanged)
- DEF(MediaParsedChanged)
- DEF(MediaFreed)
- DEF(MediaStateChanged)
- DEF(MediaSubItemTreeAdded)
-
- DEF(MediaPlayerMediaChanged)
- DEF(MediaPlayerNothingSpecial)
- DEF(MediaPlayerOpening)
- DEF(MediaPlayerBuffering)
- DEF(MediaPlayerPlaying)
- DEF(MediaPlayerPaused)
- DEF(MediaPlayerStopped)
- DEF(MediaPlayerForward)
- DEF(MediaPlayerBackward)
- DEF(MediaPlayerEndReached)
- DEF(MediaPlayerEncounteredError)
- DEF(MediaPlayerTimeChanged)
- DEF(MediaPlayerPositionChanged)
- DEF(MediaPlayerSeekableChanged)
- DEF(MediaPlayerPausableChanged)
- DEF(MediaPlayerTitleChanged)
- DEF(MediaPlayerSnapshotTaken)
- DEF(MediaPlayerLengthChanged)
- DEF(MediaPlayerVout)
- DEF(MediaPlayerScrambledChanged)
- DEF(MediaPlayerESAdded)
- DEF(MediaPlayerESDeleted)
- DEF(MediaPlayerESSelected)
- DEF(MediaPlayerCorked)
- DEF(MediaPlayerUncorked)
- DEF(MediaPlayerMuted)
- DEF(MediaPlayerUnmuted)
- DEF(MediaPlayerAudioVolume)
- DEF(MediaPlayerAudioDevice)
- DEF(MediaPlayerChapterChanged)
-
- DEF(MediaListItemAdded)
- DEF(MediaListWillAddItem)
- DEF(MediaListItemDeleted)
- DEF(MediaListWillDeleteItem)
- DEF(MediaListEndReached)
-
- DEF(MediaListViewItemAdded)
- DEF(MediaListViewWillAddItem)
- DEF(MediaListViewItemDeleted)
- DEF(MediaListViewWillDeleteItem)
-
- DEF(MediaListPlayerPlayed)
- DEF(MediaListPlayerNextItemSet)
- DEF(MediaListPlayerStopped)
-
- DEF(VlmMediaAdded)
- DEF(VlmMediaRemoved)
- DEF(VlmMediaChanged)
- DEF(VlmMediaInstanceStarted)
- DEF(VlmMediaInstanceStopped)
- DEF(VlmMediaInstanceStatusInit)
- DEF(VlmMediaInstanceStatusOpening)
- DEF(VlmMediaInstanceStatusPlaying)
- DEF(VlmMediaInstanceStatusPause)
- DEF(VlmMediaInstanceStatusEnd)
- DEF(VlmMediaInstanceStatusError)
-};
-#undef DEF
-
-static const char unknown_event_name[] = "Unknown Event";
-
-static int evcmp( const void *a, const void *b )
-{
- return (*(const int *)a) - ((event_name_t *)b)->type;
-}
-
-const char * libvlc_event_type_name( int event_type )
-{
- const event_name_t *p;
-
- p = bsearch( &event_type, event_list,
- sizeof(event_list)/sizeof(event_list[0]), sizeof(*p),
- evcmp );
- return p ? p->name : unknown_event_name;
-}
-
/**************************************************************************
* libvlc_event_attach (public) :
*
diff --git a/lib/libvlc.sym b/lib/libvlc.sym
index cdbcec9dc9..9e98014cd7 100644
--- a/lib/libvlc.sym
+++ b/lib/libvlc.sym
@@ -49,7 +49,6 @@ libvlc_dialog_set_callbacks
libvlc_dialog_set_context
libvlc_event_attach
libvlc_event_detach
-libvlc_event_type_name
libvlc_free
libvlc_get_changeset
libvlc_get_compiler
More information about the vlc-commits
mailing list