XS(_wrap_c_function) { { BOW_USHORT arg1 ; BOW_UCHAR *arg2 = (BOW_UCHAR *) 0 ; unsigned short val1 ; int ecode1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; int argvi = 0; BOW_SHORT result; dXSARGS; ... a bunch of code to validate parameters ... result = c_function(arg1,arg2); ... a bunch of code to handle return ... } }