#include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #define SI_NOT 0x01 #define SI_REV 0x02 MODULE = String::Index PACKAGE = String::Index int cindex(SV *str, SV *cc, ...) PROTOTYPE: $$;$ ALIAS: ncindex = 1 crindex = 2 ncrindex = 3 CODE: { /* you use the 'ix' variable in here to determine which alias of the function was called. ix = 0 means 'cindex', 1 means ncindex, and so on */ }