+/* Implement a macro to handle multiple formats (integer, float, and array
+ * containing seconds and nanoseconds). */
+#define PULL_TIME(st, st_xtim, svp) \
+{ \
+ SV *sv = svp; \
+ if (SvROK(sv)) { \
+ AV *av = (AV *)SvRV(sv); \
+ if (SvTYPE((SV *)av) != SVt_PVAV) { \
+ Perl_croak_nocontext("Reference was not array ref"); \
+ } \
+ if (av_len(av) != 1) { \
+ Perl_croak_nocontext("Array of incorrect dimension"); \
+ } \
+ (st)->st_xtim##e = SvIV(*(av_fetch(av, 0, FALSE))); \
+ STAT_NSEC(st, st_xtim) = SvIV(*(av_fetch(av, 1, FALSE))); \
+ } \
+ else if (SvNOK(sv) || SvIOK(sv)) { \
+ double tm = SvNV(sv); \
+ (st)->st_xtim##e = (int)tm; \
+ STAT_NSEC(st, st_xtim) = (tm - (int)tm) * 1000000000; \
+ } \
+ else { \
+ Perl_croak_nocontext("Invalid data type passed"); \
+ } \
+}
+