Re: quantlib spreadsheet integration
Posted by Jody Goldberg-2 on
URL: http://quantlib.414.s1.nabble.com/quantlib-spreadsheet-integration-tp2880p2887.html
On Thu, Apr 08, 2004 at 01:01:19AM +0100, erik wrote:
>
> I didn't know about C plugins for Gnumeric, this sounds distinctly more
> promising than Quantlib<->Python<->Gnumeric. Is this interface
> documented anywhere?
There is documentation in
gnumeric/doc/developer/writing-functions.sgml
Unfortuantely the recent security breach on gnome.org has forced the
sys admin team to disable most of the gnumeric web site so I can't
give you a web link right now. However, I should note that the
majority of or functions are in plugins, so there are lots of
examples.
Here's an example of a simple one in
gnumeric/plugins/fn-info/functions.c
static char const *help_isnumber = {
N_("@FUNCTION=ISNUMBER\n"
"@SYNTAX=ISNUMBER(value)\n"
.... I'll abridge the help text in the interest of clarity
static GnmValue *
gnumeric_isnumber (FunctionEvalInfo *ei, GnmValue **argv)
{
return value_new_bool (argv[0] != NULL &&
(argv[0]->type == VALUE_INTEGER || argv[0]->type == VALUE_FLOAT));
}
An entry in the descriptor table
{ "isnumber", "B", N_("value"), &help_isnumber,
gnumeric_isnumber, NULL, NULL, NULL, NULL,
GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_COMPLETE, GNM_FUNC_TEST_STATUS_BASIC },
And an entry in the plugin's decriptor file 'plugin.xml.in'
<function name="isnumber"/>
> Very tough to say how a Gnumeric C plugin would compare to an OpenOffice
> C++ Addin. It would depend heavily on the design of each, on your
> criteria... the first approach might be better at some things and the
> second at others... there are a lot of variables.
Definitely. I suspect that Gnumeric will be significantly simpler
to use initialially, but OOo will have more power for manipulating
external objects like reports in wordprocessors via it's UNO
technology. As you say it depends on your needs. OOo is a suite
and has the capabilities that come with that, but my bet is that
Gnumeric is a better spreadsheet if you compare them head to head.
Then again, I'm biased. I think my kids are cute too :-)