XS_EUPXS(XS_Test_test); /* prototype to pass -Wmissing-prototypes */ XS_EUPXS(XS_Test_test) { dVAR; dXSARGS; if (items != 1) croak_xs_usage(cv, "value"); { geno_eye__LabelBind value; char* sv_text = SvPV_nolen(ST(0)); value = 0; if ( strstr(sv_text, "top") || strstr(sv_text, "TOP") ) { value |= geno_eye::LABEL_BIND_TOP; } else if (strstr(sv_text, "bottom") || strstr(sv_text, "BOTTOM")) { value |= geno_eye::LABEL_BIND_BOTTOM; } if (strstr(sv_text, "left") || strstr(sv_text, "LEFT")) { value |= geno_eye::LABEL_BIND_LEFT; } else if (strstr(sv_text, "right") || strstr(sv_text, "RIGHT")){ value |= geno_eye::LABEL_BIND_RIGHT; } ; #line 53 "test.xs" std::cout << "binary value: " << value << std::endl; #line 226 "test.cpp" } XSRETURN_EMPTY; }