Going to need a way to pass arguments into the XS function anyway, so might as well do the entire arg parsing step in XS while we're at it. Provides a significant speedup for tiny inputs as well, but I don't find that too interesting.
15 lines
272 B
Text
15 lines
272 B
Text
#define PERL_NO_GET_CONTEXT
|
|
#include "EXTERN.h"
|
|
#include "perl.h"
|
|
#include "XSUB.h"
|
|
|
|
#include "c/common.c"
|
|
#include "c/jsonfmt.c"
|
|
|
|
MODULE = FU PACKAGE = FU::XS
|
|
|
|
PROTOTYPES: DISABLE
|
|
|
|
void json_format(SV *val, ...)
|
|
CODE:
|
|
ST(0) = fujson_fmt_xs(aTHX_ ax, items, val);
|