Ok. I've created a serv_python.c which registers a command "SCRP" that
takes as its paramaters (1) Module to import (2) function to run (3)
arbitrary number of paramaters.
The function is expected to return an integer otherwise it segfaults (whee), I'll try and wrap my head around that sucker later.
As it stands, Ill have it so the function expects the parameters to be
strings. Im just not too sure how to magically divine the parameter
type being passed. But if everything is a string, then as long as the
function understands that, all is grooby
also for some whacky reason the script has to be in the python lib directory. I'll try and figure that one out later.
Some questions;-
I note that theres a bunch of hooks that can be used , in a similar
method to registering the command (ie session start/close/etc). Where
do I find where these are defined?
Also, as it stands the script cant really interact with the server, so
I'll wrap a couple of test functions, like the log print command and a
couple of others, and that should at least provide clues for others to
start wrapping the rest. I'll investigate to see if theres anything to
automate this.
Also you guys might have to figure out how to make autoconf pick up the
correct location for the python lib AND header (Its supposed to be
#include <python.h> but I'm having to #include
<python2.3/python.h>)
But all in all, this is going to work. I'll upload the sample code soon.
