+#include <assert.h>
+
+/* This API is terminally broken.
+ * First, it does not implement any kind of notification.
+ * Second, the iterating scheme is hermetic to any kind of thread-safety
+ * owing to its constant pointer constraints.
+ * -- Courmisch
+ *
+ * "If you break your leg, don't run to me for sympathy"
+ * -- some character, Beneath a Steel Sky
+ */
+
+struct msg_cb_data_t
+{
+ vlc_spinlock_t lock;
+ msg_item_t *items[VLC_MSG_QSIZE];
+ unsigned count;
+ int verbosity;
+};
+
+static void handler( msg_cb_data_t *d, msg_item_t *p_item, unsigned i_drop )
+{
+ if (p_item->i_type > d->verbosity)
+ return;
+
+ vlc_spin_lock (&d->lock);
+ if (d->count < VLC_MSG_QSIZE)
+ {
+ d->items[d->count++] = p_item;
+ msg_Hold (p_item);
+ }
+ vlc_spin_unlock (&d->lock);
+ (void)i_drop;
+}