+void libvlc_retain( libvlc_instance_t *p_instance )
+{
+ assert( p_instance != NULL );
+ assert( p_instance->ref_count < UINT_MAX );
+
+ vlc_mutex_lock( &p_instance->instance_lock );
+ p_instance->ref_count++;
+ vlc_mutex_unlock( &p_instance->instance_lock );
+}
+
+void libvlc_release( libvlc_instance_t *p_instance )
+{
+ vlc_mutex_t *lock = &p_instance->instance_lock;
+ int refs;
+
+ vlc_mutex_lock( lock );
+ assert( p_instance->ref_count > 0 );
+ refs = --p_instance->ref_count;
+ vlc_mutex_unlock( lock );
+
+ if( refs == 0 )
+ {
+ vlc_mutex_destroy( lock );
+ if( p_instance->libvlc_vlm.pf_release )
+ p_instance->libvlc_vlm.pf_release( p_instance );
+ libvlc_InternalCleanup( p_instance->p_libvlc_int );
+ libvlc_InternalDestroy( p_instance->p_libvlc_int );
+ free( p_instance );
+ libvlc_deinit_threads ();
+ }
+}
+
+int libvlc_add_intf( libvlc_instance_t *p_i, const char *name )
+{
+ return libvlc_InternalAddIntf( p_i->p_libvlc_int, name ) ? -1 : 0;
+}
+
+void libvlc_wait( libvlc_instance_t *p_i )
+{
+ libvlc_int_t *p_libvlc = p_i->p_libvlc_int;
+ libvlc_InternalWait( p_libvlc );
+}
+
+const char * libvlc_get_version(void)
+{
+ return VLC_Version();
+}
+
+const char * libvlc_get_compiler(void)
+{
+ return VLC_Compiler();
+}
+
+const char * libvlc_get_changeset(void)
+{
+ extern const char psz_vlc_changeset[];
+ return psz_vlc_changeset;
+}
+
+/* export internal libvlc_instance for ugly hacks with libvlccore */
+vlc_object_t *libvlc_get_vlc_instance( libvlc_instance_t* p_instance )