[vdr] Feature request: suggestion for cPlugin

Klaus Schmidinger Klaus.Schmidinger at cadsoft.de
Sun Aug 21 15:32:36 CEST 2005

Udo Richter wrote:
> Klaus Schmidinger wrote:
>>Udo Richter wrote:
>>>Variants for this:
>>>1. Keep it as-is
>>>2. Drop the supported check from docs - each plugin can offer a check if
>>>it likes
>>>3. Introduce a constant handle, so Service("someid",QUERY_SERVICE) is
>>>the supported check
>>4. Service("?someid"), maybe...
> cwieninger at gmx.de wrote:
>>IMHO 3. is the best solution.
> Since I don't want to enforce extra supported checks, I tend to a
> variation of 2: Suggest to use NULL as install check without action.
> Enforcing an install check in docs and not using it is inconsistent.
> ----8<----
> <tt>Data</tt> points to a custom data structure. For each id string
> there should be a specification that describes the format of the data
> structure, and any change to the format should  be reflected by a change
> of the id string.
> <p>
> The function shall return true for any service ID string it handles, and
> false otherwise. The plugins have to agreee in which situations the
> service may be called, for example whether the service may be called
> from every thread, or just from the main thread. Plugins can implement a
> 'service supported' check by returning <tt>true</tt> without performing
> any actions when called with <tt>Data=NULL</tt>.
> ----8<----

Since the Data parameter in the function calls has NULL as default,
a plugin implementing Service() _must_ be prepared to handle this
case. This text makes it look like this is somehow optional and up
to the individual plugin. If you want it that way, then we'll have to
remove the NULL default parameter. Personally I'd rather keep it as it
is right now.


More information about the vdr mailing list