Get the numeric ID of a URI from the host.
|callback_data ||Must be the callback_data member of this struct. |
|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. |
|uri ||The URI to be mapped to an integer ID.|
This function is referentially transparent - any number of calls with the same arguments is guaranteed to return the same value over the life of a plugin instance (though the same URI may return different values with a different map parameter). However, this function is not necessarily very fast: plugins should cache any IDs they might need in performance critical situations. The return value 0 is reserved and means an ID for that URI could not be created for whatever reason. Extensions may define more precisely what this means, but in general plugins should gracefully handle 0 and consider whatever they wanted the URI for "unsupported".