in reply to XSUBs PROTOTYPE: ?

The prototype says that the function takes one scalar argument plus another optional scalar argument. Did you read the perlsub documentation?