+/*
+ * Threads subsystem
+ */
+int vlc_threads_init( void );
+void vlc_threads_end( void );
+vlc_object_t *vlc_threadobj (void);
+#ifdef LIBVLC_REFCHECK
+void vlc_refcheck (vlc_object_t *obj);
+#else
+# define vlc_refcheck( obj ) (void)0
+#endif
+
+/*
+ * CPU capabilities
+ */
+extern uint32_t cpu_flags;
+uint32_t CPUCapabilities( void );
+
+/*
+ * Message/logging stuff
+ */
+
+typedef struct msg_queue_t
+{
+ /** Message queue lock */
+ vlc_mutex_t lock;
+ bool b_overflow;
+
+ /* Message queue */
+ msg_item_t msg[VLC_MSG_QSIZE]; /**< message queue */
+ int i_start;
+ int i_stop;
+
+ /* Subscribers */
+ int i_sub;
+ msg_subscription_t **pp_sub;
+
+ /* Logfile for WinCE */
+#ifdef UNDER_CE
+ FILE *logfile;
+#endif
+} msg_queue_t;
+
+/**
+ * Store all data required by messages interfaces.
+ */
+typedef struct msg_bank_t
+{
+ vlc_mutex_t lock;
+ msg_queue_t queue;
+} msg_bank_t;
+
+void msg_Create (libvlc_int_t *);
+void msg_Flush (libvlc_int_t *);
+void msg_Destroy (libvlc_int_t *);
+
+/** Internal message stack context */
+typedef struct
+{
+ int i_code;
+ char * psz_message;
+} msg_context_t;
+
+void msg_StackSet ( int, const char*, ... );
+void msg_StackAdd ( const char*, ... );
+const char* msg_StackMsg ( void );
+/** The global thread var for msg stack context
+ * We store this as a static global variable so we don't need a vlc_object_t
+ * everywhere.
+ * This key is created in vlc_threads_init and is therefore ready to use at
+ * the very beginning of the universe */
+extern vlc_threadvar_t msg_context_global_key;
+void msg_StackDestroy (void *);
+
+/*
+ * Unicode stuff
+ */
+char *vlc_fix_readdir (const char *);
+
+/*
+ * LibVLC objects stuff
+ */
+
+/**
+ * Creates a VLC object.
+ *
+ * Note that because the object name pointer must remain valid, potentially
+ * even after the destruction of the object (through the message queues), this
+ * function CANNOT be exported to plugins as is. In this case, the old
+ * vlc_object_create() must be used instead.
+ *
+ * @param p_this an existing VLC object
+ * @param i_size byte size of the object structure
+ * @param i_type object type, usually VLC_OBJECT_CUSTOM
+ * @param psz_type object type name
+ * @return the created object, or NULL.
+ */
+extern void *
+__vlc_custom_create (vlc_object_t *p_this, size_t i_size, int i_type,
+ const char *psz_type);
+#define vlc_custom_create(o, s, t, n) \
+ __vlc_custom_create(VLC_OBJECT(o), s, t, n)
+
+/**