[crossfire] Plugin API
Nicolas Weeger
nicolas.weeger at laposte.net
Mon Mar 5 13:43:04 CST 2007
Hello.
I'd like to propose changes to the plugin API.
Currently, plugins call eg char* directory = cfapi_system_directory(&val, 3)
to get a directory information.
I'd like to change that to the general format: int result =
cfapi_system_directory(&val, 3, &directory, sizeof(directory)) with result a
plugin-specific code (0 => no error, 1 => invalid parameter, ...)
Basically, to wrap a server function
object* get_split_ob(object* ob, int nrof)
one should call
cfapi_object_get_split(&val, ob, nrof, &split)
with object* split.
This way, the plugin layer could return some information (object was lost,
invalid parameter).
It would also avoid having static variables used to return int/float values.
If no one objects, I'd feel like doing that starting around next week :)
Nicolas
--
http://nicolas.weeger.free.fr [Petit site d'images, de textes, de code, bref
de l'aléatoire !]
More information about the crossfire
mailing list