+/**
+ * Add a set of types to our type map.
+ */
+void
+GSC_TYPEMAP_add (const uint16_t * types, unsigned int tlen)
+{
+ unsigned int i;
+ int changed;
+
+ changed = GNUNET_NO;
+ for (i = 0; i < tlen; i++)
+ {
+ if (0 == map_counters[types[i]]++)
+ {
+ my_type_map.bits[types[i] / 32] |= (1 << (types[i] % 32));
+ changed = GNUNET_YES;
+ }
+ }
+ if (GNUNET_YES == changed)
+ broadcast_my_type_map ();
+}
+
+
+/**
+ * Remove a set of types from our type map.
+ */
+void
+GSC_TYPEMAP_remove (const uint16_t * types, unsigned int tlen)
+{
+ unsigned int i;
+ int changed;
+
+ changed = GNUNET_NO;
+ for (i = 0; i < tlen; i++)
+ {
+ if (0 == --map_counters[types[i]])
+ {
+ my_type_map.bits[types[i] / 32] &= ~(1 << (types[i] % 32));
+ changed = GNUNET_YES;
+ }
+ }
+ if (GNUNET_YES == changed)
+ broadcast_my_type_map ();
+}
+
+
+/**
+ * Test if any of the types from the types array is in the
+ * given type map.
+ *
+ * @param tmap map to test
+ * @param types array of types
+ * @param tcnt number of entries in types
+ * @return GNUNET_YES if a type is in the map, GNUNET_NO if not
+ */
+int
+GSC_TYPEMAP_test_match (const struct GSC_TypeMap *tmap, const uint16_t * types,
+ unsigned int tcnt)
+{
+ unsigned int i;
+
+ if (NULL == tmap)
+ return GNUNET_NO;
+ if (0 == tcnt)
+ return GNUNET_YES; /* matches all */
+ for (i = 0; i < tcnt; i++)
+ if (0 != (tmap->bits[types[i] / 32] & (1 << (types[i] % 32))))
+ return GNUNET_YES;
+ return GNUNET_NO;
+}
+
+
+/**
+ * Add additional types to a given typemap.
+ *
+ * @param tmap map to extend (not changed)
+ * @param types array of types to add
+ * @param tcnt number of entries in types
+ * @return updated type map (fresh copy)
+ */
+struct GSC_TypeMap *
+GSC_TYPEMAP_extend (const struct GSC_TypeMap *tmap, const uint16_t * types,
+ unsigned int tcnt)
+{
+ struct GSC_TypeMap *ret;
+ unsigned int i;
+
+ ret = GNUNET_malloc (sizeof (struct GSC_TypeMap));
+ if (NULL != tmap)
+ memcpy (ret, tmap, sizeof (struct GSC_TypeMap));
+ for (i = 0; i < tcnt; i++)
+ ret->bits[types[i] / 32] |= (1 << (types[i] % 32));
+ return ret;
+}
+
+
+/**
+ * Create an empty type map.
+ *
+ * @return an empty type map
+ */
+struct GSC_TypeMap *
+GSC_TYPEMAP_create ()
+{
+ return GNUNET_malloc (sizeof (struct GSC_TypeMap));
+}
+
+
+/**
+ * Free the given type map.
+ *
+ * @param tmap a type map
+ */
+void
+GSC_TYPEMAP_destroy (struct GSC_TypeMap *tmap)
+{
+ GNUNET_free (tmap);
+}
+
+
+/**
+ * Initialize typemap subsystem.
+ */
+void
+GSC_TYPEMAP_init ()
+{
+ /* nothing to do */
+}
+
+
+/**
+ * Shutdown typemap subsystem.
+ */
+void
+GSC_TYPEMAP_done ()
+{
+ /* nothing to do */
+}