Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Plugin API requests
From: Daniel Stenberg (daniel_at_haxx.se)
Date: 2003-07-04


On Thu, 3 Jul 2003, Garrett Derner wrote:

> Come to think of it, what I was suggesting (making _ctype[]_ available
> through the plugin API) would not work. Because then the array would not be
> called _ctype_[]. It would be rb->_ctype_[], or
> my_plugin_api_ptr->_ctype_[], whatever.

The isspace() macro and the other ones would then possibly be changed to look
like that.

I've already before been thinking about having ALL functions in the plugin API
redefined similar to:

#ifdef PLUGIN
#define strlen(x) rb->strlen(x)
#else
/* strlen() is used like normal */
#endif

... this would give several benefits:

 1. You can move code from "plain" rockbox to a plugin without changing it.

 2. You can select to build stuff as plugin OR as plain code. This would be
    very useful in the simulator, as debugging is a lot easier without
    plugins.

 3. It takes less documenting and getting-used-to by programmers.

The downsides:

 1. It redefines and hides what is actually done.

When I get back from my vacation, I'll see if this is doable/sensible.

-- 
 Daniel Stenberg -- http://rockbox.haxx.se/ -- http://daniel.haxx.se/



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa