[vlc-devel] [RFC] Regarding the use of *_Control()

Pierre d'Herbemont pdherbemont at free.fr
Mon Apr 14 16:28:07 CEST 2008


On Apr 14, 2008, at 3:20 PM, Rémi Denis-Courmont wrote:
> Le lundi 14 avril 2008, Pierre d'Herbemont a écrit :
>> I do understand that to do subclassing, and to add new functionality
>> to Control() function without breaking the ABI is quite easy.
>>
>> I do doubt that this is a nice habit, and having internal function
>> pointers would have been much cleaner IMO. (no need to switch(), it's
>> easy to see if a function is supported or not, etc.)
>
> You cannot add _any_ new callback without breaking the ABI though. So
> the "cleaner" solution is simply impractical, I think.

Well, of course, that's the main advantage of *_Control(). But given  
that we nearly never add callbacks, the ABI would rarely change.

An other possibility is to maintain a separate private structure for  
the callback. Hence adding a callback won't break the ABI. That would  
be nicer.

(I don't plan to change that for now. Just privatize the *_Control()  
function and replace call to it by an accessor as described in first  
mail).

Thanks for the answer,

Pierre.


More information about the vlc-devel mailing list