[Devel] uri-map: what is the `map` parameter for?

David Robillard d at drobilla.net
Mon Jul 18 14:10:33 PDT 2011

On Sun, 2011-07-17 at 11:30 -0500, Gabriel Beddingfield wrote:
> Hi guys,
> Had a crash with SLV2 when calling...
>     UMF->uri_to_id(UMF->callback_data, // callback_data
>                    0,                  // map
>                    "http://lv2plug.in/ns/ext/midi#MidiEvent"); // uri
> Crashing because (map == 0) is a bug, but...
> Just what *is* this map parameter for?  Docs say:
> * @param map The 'context' of this URI.  Certain extensions may define a
> *        URI that must be passed here with certain restrictions on the
> *        return value (e.g. limited range).  This value may be NULL if
> *        the plugin needs an ID for a URI in general.
> Which doesn't give me any clues about what it's for... so I made it 
> NULL.  What I expect is a simple, global registry with URI ==> INT 
> mappings, so this 'context' thing has me befuddled.
> Any hints?

NULL should be legal.  Unfortunately this is a pretty bad bug in SLV2...
which I didn't plan to make any new releases of :/

However, this is related to a much deeper problem: the context argument
was, as it turns out, a very huge mistake.  Very unfortunately, though,
the event extension depends on it, so we are stuck.  The event extension
is probably the single most troublesome one to replace.  I don't know
what to do about this :(


More information about the Devel mailing list