my_sprintf
#if !defined(my_sprintf) #if { NEED my_sprintf }
int my_sprintf(char *buffer, const char* pat, ...) { va_list args; va_start(args, pat); vsprintf(buffer, pat, args); va_end(args); return strlen(buffer); }
#endif #endif
#define NEED_my_sprintf
void my_sprintf() PREINIT: char buf[128]; int len; PPCODE: len = my_sprintf(buf, "foo%s%d", "bar", 42); mXPUSHi(len); mXPUSHs(newSVpv(buf, 0)); XSRETURN(2);
my($l, $s) = Devel::PPPort::my_sprintf(); ok($l, 8); ok($s, "foobar42");
5 POD Errors
The following errors were encountered while parsing the POD:
- Around line 12:
Unknown directive: =provides
- Around line 16:
Unknown directive: =implementation
- Around line 34:
Unknown directive: =xsinit
- Around line 38:
Unknown directive: =xsubs
- Around line 51:
Unknown directive: =tests