| 1 |
|
| /* |
| 2 |
|
| * This file was generated automatically by ExtUtils::ParseXS version 3.63 from the |
| 3 |
|
| * contents of Loop.xs. Do not edit this file, edit Loop.xs instead. |
| 4 |
|
| * |
| 5 |
|
| * ANY CHANGES MADE HERE WILL BE LOST! |
| 6 |
|
| * |
| 7 |
|
| */ |
| 8 |
|
| |
| 9 |
|
| #line 1 "Loop.xs" |
| 10 |
|
| /* |
| 11 |
|
| * Loop.xs - root XS file. |
| 12 |
|
| * |
| 13 |
|
| * Thin wrapper (the Chandra pattern): pull in the C implementation headers, |
| 14 |
|
| * then splice the per-component XS fragments via INCLUDE: so xsubpp compiles |
| 15 |
|
| * them all into one Loop.c / Loop.o - no EUMM subdir-object trouble. |
| 16 |
|
| * |
| 17 |
|
| * include/ - the C core (future, DBI executor, object dispatch) |
| 18 |
|
| * xs/ - the XS fragments, one per package |
| 19 |
|
| */ |
| 20 |
|
| |
| 21 |
|
| #define PERL_NO_GET_CONTEXT |
| 22 |
|
| #include "EXTERN.h" |
| 23 |
|
| #include "perl.h" |
| 24 |
|
| #include "XSUB.h" |
| 25 |
|
| |
| 26 |
|
| #include "dbil_compat.h" /* perl-version shims: must come first */ |
| 27 |
|
| |
| 28 |
|
| #include "dbil_future.h" /* DBIx::Loop::Future (C) */ |
| 29 |
|
| #include "dbil_run.h" /* run one DBI statement from C */ |
| 30 |
|
| #include "dbil_vt.h" /* pure-C loop seam (adapter vtable) */ |
| 31 |
|
| #include "dbil_pool.h" /* Backend B: forked worker pool */ |
| 32 |
|
| #include "dbil_txn.h" /* transactions pinned to a pool slot */ |
| 33 |
|
| #include "dbil_native.h" /* Backend A: native fd async (Pg) */ |
| 34 |
|
| #include "dbil_hm.h" /* Hyperman adapter over its C ABI */ |
| 35 |
|
| #include "dbil_obs.h" /* statement observers (v2); fired by dbil_loop */ |
| 36 |
|
| #include "dbil_obs_perl.h" /* ... and the Perl door onto that registry */ |
| 37 |
|
| #include "dbil_loop.h" /* driver-name, capability, dispatch */ |
| 38 |
|
| #include "dbil_abi.h" /* the public C ABI (installed header) */ |
| 39 |
|
| #include "dbil_abi_impl.h" /* ... and the provider side of it */ |
| 40 |
|
| |
| 41 |
|
| #line 42 "Loop.c" |
| 42 |
|
| #ifndef PERL_UNUSED_VAR |
| 43 |
|
| # define PERL_UNUSED_VAR(var) if (0) var = var |
| 44 |
|
| #endif |
| 45 |
|
| |
| 46 |
|
| #ifndef dVAR |
| 47 |
|
| # define dVAR dNOOP |
| 48 |
|
| #endif |
| 49 |
|
| |
| 50 |
|
| |
| 51 |
|
| /* This stuff is not part of the API! You have been warned. */ |
| 52 |
|
| #ifndef PERL_VERSION_DECIMAL |
| 53 |
|
| # define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s) |
| 54 |
|
| #endif |
| 55 |
|
| #ifndef PERL_DECIMAL_VERSION |
| 56 |
|
| # define PERL_DECIMAL_VERSION \ |
| 57 |
|
| PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION) |
| 58 |
|
| #endif |
| 59 |
|
| #ifndef PERL_VERSION_GE |
| 60 |
|
| # define PERL_VERSION_GE(r,v,s) \ |
| 61 |
|
| (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s)) |
| 62 |
|
| #endif |
| 63 |
|
| #ifndef PERL_VERSION_LE |
| 64 |
|
| # define PERL_VERSION_LE(r,v,s) \ |
| 65 |
|
| (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s)) |
| 66 |
|
| #endif |
| 67 |
|
| |
| 68 |
|
| /* XS_INTERNAL is the explicit static-linkage variant of the default |
| 69 |
|
| * XS macro. |
| 70 |
|
| * |
| 71 |
|
| * XS_EXTERNAL is the same as XS_INTERNAL except it does not include |
| 72 |
|
| * "static", ie. it exports XSUB symbols. You probably don't want that |
| 73 |
|
| * for anything but the BOOT XSUB. |
| 74 |
|
| * |
| 75 |
|
| * See XSUB.h in core! |
| 76 |
|
| */ |
| 77 |
|
| |
| 78 |
|
| |
| 79 |
|
| /* TODO: This might be compatible further back than 5.10.0. */ |
| 80 |
|
| #if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1) |
| 81 |
|
| # undef XS_EXTERNAL |
| 82 |
|
| # undef XS_INTERNAL |
| 83 |
|
| # if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING) |
| 84 |
|
| # define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name) |
| 85 |
|
| # define XS_INTERNAL(name) static XSPROTO(name) |
| 86 |
|
| # endif |
| 87 |
|
| # if defined(__SYMBIAN32__) |
| 88 |
|
| # define XS_EXTERNAL(name) EXPORT_C XSPROTO(name) |
| 89 |
|
| # define XS_INTERNAL(name) EXPORT_C static XSPROTO(name) |
| 90 |
|
| # endif |
| 91 |
|
| # ifndef XS_EXTERNAL |
| 92 |
|
| # if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus) |
| 93 |
|
| # define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__) |
| 94 |
|
| # define XS_INTERNAL(name) static void name(pTHX_ CV* cv __attribute__unused__) |
| 95 |
|
| # else |
| 96 |
|
| # ifdef __cplusplus |
| 97 |
|
| # define XS_EXTERNAL(name) extern "C" XSPROTO(name) |
| 98 |
|
| # define XS_INTERNAL(name) static XSPROTO(name) |
| 99 |
|
| # else |
| 100 |
|
| # define XS_EXTERNAL(name) XSPROTO(name) |
| 101 |
|
| # define XS_INTERNAL(name) static XSPROTO(name) |
| 102 |
|
| # endif |
| 103 |
|
| # endif |
| 104 |
|
| # endif |
| 105 |
|
| #endif |
| 106 |
|
| |
| 107 |
|
| /* perl >= 5.10.0 && perl <= 5.15.1 */ |
| 108 |
|
| |
| 109 |
|
| |
| 110 |
|
| /* The XS_EXTERNAL macro is used for functions that must not be static |
| 111 |
|
| * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL |
| 112 |
|
| * macro defined, the best we can do is assume XS is the same. |
| 113 |
|
| * Dito for XS_INTERNAL. |
| 114 |
|
| */ |
| 115 |
|
| #ifndef XS_EXTERNAL |
| 116 |
|
| # define XS_EXTERNAL(name) XS(name) |
| 117 |
|
| #endif |
| 118 |
|
| #ifndef XS_INTERNAL |
| 119 |
|
| # define XS_INTERNAL(name) XS(name) |
| 120 |
|
| #endif |
| 121 |
|
| |
| 122 |
|
| /* Now, finally, after all this mess, we want an ExtUtils::ParseXS |
| 123 |
|
| * internal macro that we're free to redefine for varying linkage due |
| 124 |
|
| * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use |
| 125 |
|
| * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to! |
| 126 |
|
| */ |
| 127 |
|
| |
| 128 |
|
| #undef XS_EUPXS |
| 129 |
|
| #if defined(PERL_EUPXS_ALWAYS_EXPORT) |
| 130 |
|
| # define XS_EUPXS(name) XS_EXTERNAL(name) |
| 131 |
|
| #else |
| 132 |
|
| /* default to internal */ |
| 133 |
|
| # define XS_EUPXS(name) XS_INTERNAL(name) |
| 134 |
|
| #endif |
| 135 |
|
| |
| 136 |
|
| #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE |
| 137 |
|
| #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params) |
| 138 |
|
| |
| 139 |
|
| /* prototype to pass -Wmissing-prototypes */ |
| 140 |
|
| static void |
| 141 |
|
| S_croak_xs_usage(const CV *const cv, const char *const params); |
| 142 |
|
| |
| 143 |
|
| static void |
| 144 |
|
| S_croak_xs_usage(const CV *const cv, const char *const params) |
| 145 |
|
| { |
| 146 |
|
| const GV *const gv = CvGV(cv); |
| 147 |
|
| |
| 148 |
|
| PERL_ARGS_ASSERT_CROAK_XS_USAGE; |
| 149 |
|
| |
| 150 |
|
| if (gv) { |
| 151 |
|
| const char *const gvname = GvNAME(gv); |
| 152 |
|
| const HV *const stash = GvSTASH(gv); |
| 153 |
|
| const char *const hvname = stash ? HvNAME(stash) : NULL; |
| 154 |
|
| |
| 155 |
|
| if (hvname) |
| 156 |
|
| Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params); |
| 157 |
|
| else |
| 158 |
|
| Perl_croak_nocontext("Usage: %s(%s)", gvname, params); |
| 159 |
|
| } else { |
| 160 |
|
| /* Pants. I don't think that it should be possible to get here. */ |
| 161 |
|
| Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params); |
| 162 |
|
| } |
| 163 |
|
| } |
| 164 |
|
| #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE |
| 165 |
|
| |
| 166 |
|
| #define croak_xs_usage S_croak_xs_usage |
| 167 |
|
| |
| 168 |
|
| #endif |
| 169 |
|
| |
| 170 |
|
| /* NOTE: the prototype of newXSproto() is different in versions of perls, |
| 171 |
|
| * so we define a portable version of newXSproto() |
| 172 |
|
| */ |
| 173 |
|
| #ifdef newXS_flags |
| 174 |
|
| #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0) |
| 175 |
|
| #else |
| 176 |
|
| #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv) |
| 177 |
|
| #endif /* !defined(newXS_flags) */ |
| 178 |
|
| |
| 179 |
|
| #if PERL_VERSION_LE(5, 21, 5) |
| 180 |
|
| # define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file) |
| 181 |
|
| #else |
| 182 |
|
| # define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b) |
| 183 |
|
| #endif |
| 184 |
|
| |
| 185 |
|
| /* simple backcompat versions of the TARGx() macros with no optimisation */ |
| 186 |
|
| #ifndef TARGi |
| 187 |
|
| # define TARGi(iv, do_taint) sv_setiv_mg(TARG, iv) |
| 188 |
|
| # define TARGu(uv, do_taint) sv_setuv_mg(TARG, uv) |
| 189 |
|
| # define TARGn(nv, do_taint) sv_setnv_mg(TARG, nv) |
| 190 |
|
| #endif |
| 191 |
|
| |
| 192 |
|
| #line 193 "Loop.c" |
| 193 |
|
| |
| 194 |
|
| /* INCLUDE: Including 'xs/loop.xs' from 'Loop.xs' */ |
| 195 |
|
| |
| 196 |
|
| |
| 197 |
|
| XS_EUPXS(XS_DBIx__Loop__capability); /* prototype to pass -Wmissing-prototypes */ |
| 198 |
5 |
| XS_EUPXS(XS_DBIx__Loop__capability) |
| 199 |
|
| { |
| 200 |
5 |
| dVAR; dXSARGS; |
| 201 |
5 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
5 |
5 |
|
| 202 |
0 |
| croak_xs_usage(cv, "driver_name"); |
| 203 |
|
| { |
| 204 |
5 |
▶ | SV * driver_name = ST(0) |
Branch: 1 branch
| Branch | True | False | Total |
| SV * driver_name = ST(0) |
5 |
0 |
5 |
|
| 205 |
|
| ; |
| 206 |
|
| SV * RETVAL; |
| 207 |
|
| #line 10 "./xs/loop.xs" |
| 208 |
|
| RETVAL = newSVpv(dbil_capability(aTHX_ SvOK(driver_name) ? driver_name : NULL), 0); |
| 209 |
|
| #line 210 "Loop.c" |
| 210 |
5 |
| RETVAL = sv_2mortal(RETVAL); |
| 211 |
5 |
| ST(0) = RETVAL; |
| 212 |
|
| } |
| 213 |
5 |
| XSRETURN(1); |
| 214 |
|
| } |
| 215 |
|
| |
| 216 |
|
| |
| 217 |
|
| XS_EUPXS(XS_DBIx__Loop_new); /* prototype to pass -Wmissing-prototypes */ |
| 218 |
21 |
| XS_EUPXS(XS_DBIx__Loop_new) |
| 219 |
|
| { |
| 220 |
21 |
| dVAR; dXSARGS; |
| 221 |
21 |
▶ | if (items < 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 1) |
0 |
21 |
21 |
|
| 222 |
0 |
| croak_xs_usage(cv, "class, ..."); |
| 223 |
|
| { |
| 224 |
21 |
▶ | SV * class = ST(0) |
Branch: 1 branch
| Branch | True | False | Total |
| SV * class = ST(0) |
0 |
21 |
21 |
|
| 225 |
|
| ; |
| 226 |
|
| SV * RETVAL; |
| 227 |
|
| #line 19 "./xs/loop.xs" |
| 228 |
|
| { |
| 229 |
|
| SV *dbh = NULL, *loop = NULL; |
| 230 |
|
| SV *dsn = NULL, *user = NULL, *pass = NULL, *attr = NULL; |
| 231 |
|
| int nworkers = 4; |
| 232 |
|
| int max_queue = 0; |
| 233 |
|
| int i; |
| 234 |
|
| const char *cls = (SvROK(class) && SvOBJECT(SvRV(class))) |
| 235 |
|
| ? HvNAME(SvSTASH(SvRV(class))) : SvPV_nolen(class); |
| 236 |
|
| for (i = 1; i + 1 < items; i += 2) { |
| 237 |
|
| STRLEN kl; const char *k = SvPV_const(ST(i), kl); |
| 238 |
|
| if (kl == 3 && memEQ(k, "dbh", 3)) dbh = ST(i + 1); |
| 239 |
|
| else if (kl == 4 && memEQ(k, "loop", 4)) loop = ST(i + 1); |
| 240 |
|
| else if (kl == 3 && memEQ(k, "dsn", 3)) dsn = ST(i + 1); |
| 241 |
|
| else if (kl == 4 && memEQ(k, "user", 4)) user = ST(i + 1); |
| 242 |
|
| else if (kl == 4 && memEQ(k, "pass", 4)) pass = ST(i + 1); |
| 243 |
|
| else if (kl == 4 && memEQ(k, "attr", 4)) attr = ST(i + 1); |
| 244 |
|
| else if (kl == 7 && memEQ(k, "workers", 7)) |
| 245 |
|
| nworkers = SvIV(ST(i + 1)) > 0 ? (int)SvIV(ST(i + 1)) : 1; |
| 246 |
|
| else if (kl == 9 && memEQ(k, "max_queue", 9)) |
| 247 |
|
| max_queue = SvIV(ST(i + 1)) > 0 ? (int)SvIV(ST(i + 1)) : 0; |
| 248 |
|
| /* other options (backend, ...) reserved for later phases */ |
| 249 |
|
| } |
| 250 |
|
| RETVAL = dbil_new(aTHX_ cls, dbh, loop, dsn, user, pass, attr, |
| 251 |
|
| nworkers, max_queue); |
| 252 |
|
| } |
| 253 |
|
| #line 254 "Loop.c" |
| 254 |
20 |
| RETVAL = sv_2mortal(RETVAL); |
| 255 |
20 |
| ST(0) = RETVAL; |
| 256 |
|
| } |
| 257 |
20 |
| XSRETURN(1); |
| 258 |
|
| } |
| 259 |
|
| |
| 260 |
|
| |
| 261 |
|
| XS_EUPXS(XS_DBIx__Loop_query); /* prototype to pass -Wmissing-prototypes */ |
| 262 |
98 |
| XS_EUPXS(XS_DBIx__Loop_query) |
| 263 |
|
| { |
| 264 |
98 |
| dVAR; dXSARGS; |
| 265 |
98 |
▶ | if (items < 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 2) |
0 |
98 |
98 |
|
| 266 |
0 |
| croak_xs_usage(cv, "self, sql, ..."); |
| 267 |
|
| { |
| 268 |
98 |
| SV * self = ST(0) |
| 269 |
|
| ; |
| 270 |
98 |
| SV * sql = ST(1) |
| 271 |
|
| ; |
| 272 |
|
| SV * RETVAL; |
| 273 |
|
| #line 53 "./xs/loop.xs" |
| 274 |
|
| { |
| 275 |
|
| AV *bind = (AV *)sv_2mortal((SV *)newAV()); |
| 276 |
|
| int i; |
| 277 |
|
| for (i = 2; i < items; i++) av_push(bind, newSVsv(ST(i))); |
| 278 |
|
| RETVAL = dbil_exec(aTHX_ self, 1, sql, bind); |
| 279 |
|
| } |
| 280 |
|
| #line 281 "Loop.c" |
| 281 |
98 |
| RETVAL = sv_2mortal(RETVAL); |
| 282 |
98 |
| ST(0) = RETVAL; |
| 283 |
|
| } |
| 284 |
98 |
| XSRETURN(1); |
| 285 |
|
| } |
| 286 |
|
| |
| 287 |
|
| |
| 288 |
|
| XS_EUPXS(XS_DBIx__Loop_do); /* prototype to pass -Wmissing-prototypes */ |
| 289 |
574 |
| XS_EUPXS(XS_DBIx__Loop_do) |
| 290 |
|
| { |
| 291 |
574 |
| dVAR; dXSARGS; |
| 292 |
574 |
▶ | if (items < 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 2) |
0 |
574 |
574 |
|
| 293 |
0 |
| croak_xs_usage(cv, "self, sql, ..."); |
| 294 |
|
| { |
| 295 |
574 |
| SV * self = ST(0) |
| 296 |
|
| ; |
| 297 |
574 |
| SV * sql = ST(1) |
| 298 |
|
| ; |
| 299 |
|
| SV * RETVAL; |
| 300 |
|
| #line 68 "./xs/loop.xs" |
| 301 |
|
| { |
| 302 |
|
| AV *bind = (AV *)sv_2mortal((SV *)newAV()); |
| 303 |
|
| int i; |
| 304 |
|
| for (i = 2; i < items; i++) av_push(bind, newSVsv(ST(i))); |
| 305 |
|
| RETVAL = dbil_exec(aTHX_ self, 0, sql, bind); |
| 306 |
|
| } |
| 307 |
|
| #line 308 "Loop.c" |
| 308 |
574 |
| RETVAL = sv_2mortal(RETVAL); |
| 309 |
574 |
| ST(0) = RETVAL; |
| 310 |
|
| } |
| 311 |
574 |
| XSRETURN(1); |
| 312 |
|
| } |
| 313 |
|
| |
| 314 |
|
| |
| 315 |
|
| XS_EUPXS(XS_DBIx__Loop_selectall_arrayref); /* prototype to pass -Wmissing-prototypes */ |
| 316 |
24 |
| XS_EUPXS(XS_DBIx__Loop_selectall_arrayref) |
| 317 |
|
| { |
| 318 |
24 |
| dVAR; dXSARGS; |
| 319 |
24 |
| dXSI32; |
| 320 |
24 |
▶ | if (items < 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 2) |
0 |
24 |
24 |
|
| 321 |
0 |
| croak_xs_usage(cv, "self, sql, ..."); |
| 322 |
|
| { |
| 323 |
24 |
| SV * self = ST(0) |
| 324 |
|
| ; |
| 325 |
24 |
| SV * sql = ST(1) |
| 326 |
|
| ; |
| 327 |
|
| SV * RETVAL; |
| 328 |
|
| #line 94 "./xs/loop.xs" |
| 329 |
|
| { |
| 330 |
|
| AV *bind = (AV *)sv_2mortal((SV *)newAV()); |
| 331 |
|
| SV *key = NULL; |
| 332 |
|
| SV *qf, *next; |
| 333 |
|
| int i = 2; |
| 334 |
|
| if (ix == DBIL_T_ALL_HASHREF) { |
| 335 |
|
| if (items < 3) |
| 336 |
|
| croak("DBIx::Loop->selectall_hashref: a key field is required"); |
| 337 |
|
| key = ST(2); |
| 338 |
|
| i = 3; |
| 339 |
|
| } |
| 340 |
|
| for (; i < items; i++) av_push(bind, newSVsv(ST(i))); |
| 341 |
|
| qf = sv_2mortal(dbil_exec(aTHX_ self, 1, sql, bind)); |
| 342 |
|
| next = dbil_future_new(aTHX_ "DBIx::Loop::Future"); |
| 343 |
|
| dbil_then_attach4(aTHX_ qf, next, sv_2mortal(newSViv((IV)ix)), |
| 344 |
|
| NULL, key); |
| 345 |
|
| RETVAL = next; |
| 346 |
|
| } |
| 347 |
|
| #line 348 "Loop.c" |
| 348 |
23 |
| RETVAL = sv_2mortal(RETVAL); |
| 349 |
23 |
| ST(0) = RETVAL; |
| 350 |
|
| } |
| 351 |
23 |
| XSRETURN(1); |
| 352 |
|
| } |
| 353 |
|
| |
| 354 |
|
| |
| 355 |
|
| XS_EUPXS(XS_DBIx__Loop_capability); /* prototype to pass -Wmissing-prototypes */ |
| 356 |
5 |
| XS_EUPXS(XS_DBIx__Loop_capability) |
| 357 |
|
| { |
| 358 |
5 |
| dVAR; dXSARGS; |
| 359 |
5 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
5 |
5 |
|
| 360 |
0 |
| croak_xs_usage(cv, "self"); |
| 361 |
|
| { |
| 362 |
5 |
| SV * self = ST(0) |
| 363 |
|
| ; |
| 364 |
|
| SV * RETVAL; |
| 365 |
|
| #line 119 "./xs/loop.xs" |
| 366 |
|
| { |
| 367 |
|
| SV *v = dbil_field(aTHX_ self, "capability", 10); |
| 368 |
|
| RETVAL = v ? newSVsv(v) : &PL_sv_undef; |
| 369 |
|
| } |
| 370 |
|
| #line 371 "Loop.c" |
| 371 |
5 |
| RETVAL = sv_2mortal(RETVAL); |
| 372 |
5 |
| ST(0) = RETVAL; |
| 373 |
|
| } |
| 374 |
5 |
| XSRETURN(1); |
| 375 |
|
| } |
| 376 |
|
| |
| 377 |
|
| |
| 378 |
|
| XS_EUPXS(XS_DBIx__Loop_loop); /* prototype to pass -Wmissing-prototypes */ |
| 379 |
3 |
| XS_EUPXS(XS_DBIx__Loop_loop) |
| 380 |
|
| { |
| 381 |
3 |
| dVAR; dXSARGS; |
| 382 |
3 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
3 |
3 |
|
| 383 |
0 |
| croak_xs_usage(cv, "self"); |
| 384 |
|
| { |
| 385 |
3 |
| SV * self = ST(0) |
| 386 |
|
| ; |
| 387 |
|
| SV * RETVAL; |
| 388 |
|
| #line 130 "./xs/loop.xs" |
| 389 |
|
| { |
| 390 |
|
| SV *v = dbil_field(aTHX_ self, "loop", 4); |
| 391 |
|
| RETVAL = v ? newSVsv(v) : &PL_sv_undef; |
| 392 |
|
| } |
| 393 |
|
| #line 394 "Loop.c" |
| 394 |
3 |
| RETVAL = sv_2mortal(RETVAL); |
| 395 |
3 |
| ST(0) = RETVAL; |
| 396 |
|
| } |
| 397 |
3 |
| XSRETURN(1); |
| 398 |
|
| } |
| 399 |
|
| |
| 400 |
|
| |
| 401 |
|
| XS_EUPXS(XS_DBIx__Loop_dbh); /* prototype to pass -Wmissing-prototypes */ |
| 402 |
0 |
| XS_EUPXS(XS_DBIx__Loop_dbh) |
| 403 |
|
| { |
| 404 |
0 |
| dVAR; dXSARGS; |
| 405 |
0 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
0 |
0 |
|
| 406 |
0 |
| croak_xs_usage(cv, "self"); |
| 407 |
|
| { |
| 408 |
0 |
| SV * self = ST(0) |
| 409 |
|
| ; |
| 410 |
|
| SV * RETVAL; |
| 411 |
|
| #line 141 "./xs/loop.xs" |
| 412 |
|
| { |
| 413 |
|
| SV *v = dbil_field(aTHX_ self, "dbh", 3); |
| 414 |
|
| RETVAL = v ? newSVsv(v) : &PL_sv_undef; |
| 415 |
|
| } |
| 416 |
|
| #line 417 "Loop.c" |
| 417 |
0 |
| RETVAL = sv_2mortal(RETVAL); |
| 418 |
0 |
| ST(0) = RETVAL; |
| 419 |
|
| } |
| 420 |
0 |
| XSRETURN(1); |
| 421 |
|
| } |
| 422 |
|
| |
| 423 |
|
| |
| 424 |
|
| XS_EUPXS(XS_DBIx__Loop_disconnect); /* prototype to pass -Wmissing-prototypes */ |
| 425 |
12 |
| XS_EUPXS(XS_DBIx__Loop_disconnect) |
| 426 |
|
| { |
| 427 |
12 |
| dVAR; dXSARGS; |
| 428 |
12 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
12 |
12 |
|
| 429 |
0 |
| croak_xs_usage(cv, "self"); |
| 430 |
|
| { |
| 431 |
12 |
▶ | SV * self = ST(0) |
Branch: 1 branch
| Branch | True | False | Total |
| SV * self = ST(0) |
12 |
0 |
12 |
|
| 432 |
|
| ; |
| 433 |
|
| #line 152 "./xs/loop.xs" |
| 434 |
|
| { |
| 435 |
|
| HV *h = (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV) |
| 436 |
|
| ? (HV *)SvRV(self) : NULL; |
| 437 |
|
| SV *dbh = dbil_field(aTHX_ self, "dbh", 3); |
| 438 |
|
| /* tear the pool down deterministically here (reap workers, drop fds) |
| 439 |
|
| * rather than at global destruction */ |
| 440 |
|
| if (h) { |
| 441 |
|
| SV **pp = hv_fetchs(h, "_pool", 0); |
| 442 |
|
| SV **np = hv_fetchs(h, "_native", 0); |
| 443 |
|
| if (pp && *pp && SvIOK(*pp)) { |
| 444 |
|
| dbil_pool_free(aTHX_ INT2PTR(dbil_pool *, SvIV(*pp))); |
| 445 |
|
| (void)hv_delete(h, "_pool", 5, G_DISCARD); |
| 446 |
|
| } |
| 447 |
|
| if (np && *np && SvIOK(*np)) { |
| 448 |
|
| dbil_native_free(aTHX_ INT2PTR(dbil_native *, SvIV(*np))); |
| 449 |
|
| (void)hv_delete(h, "_native", 7, G_DISCARD); |
| 450 |
|
| } |
| 451 |
|
| } |
| 452 |
|
| if (dbh && SvROK(dbh)) { |
| 453 |
|
| dSP; |
| 454 |
|
| ENTER; SAVETMPS; PUSHMARK(SP); |
| 455 |
|
| EXTEND(SP, 1); PUSHs(dbh); PUTBACK; |
| 456 |
|
| call_method("disconnect", G_VOID | G_DISCARD | G_EVAL); |
| 457 |
|
| SPAGAIN; PUTBACK; FREETMPS; LEAVE; |
| 458 |
|
| } |
| 459 |
|
| } |
| 460 |
|
| #line 461 "Loop.c" |
| 461 |
|
| } |
| 462 |
12 |
| XSRETURN_EMPTY; |
| 463 |
|
| } |
| 464 |
|
| |
| 465 |
|
| |
| 466 |
|
| XS_EUPXS(XS_DBIx__Loop_txn); /* prototype to pass -Wmissing-prototypes */ |
| 467 |
14 |
| XS_EUPXS(XS_DBIx__Loop_txn) |
| 468 |
|
| { |
| 469 |
14 |
| dVAR; dXSARGS; |
| 470 |
14 |
▶ | if (items != 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 2) |
0 |
14 |
14 |
|
| 471 |
0 |
| croak_xs_usage(cv, "self, block"); |
| 472 |
|
| { |
| 473 |
14 |
| SV * self = ST(0) |
| 474 |
|
| ; |
| 475 |
14 |
| SV * block = ST(1) |
| 476 |
|
| ; |
| 477 |
|
| SV * RETVAL; |
| 478 |
|
| #line 189 "./xs/loop.xs" |
| 479 |
|
| { |
| 480 |
|
| SV *cap = dbil_field(aTHX_ self, "capability", 10); |
| 481 |
|
| SV *cargs = dbil_field(aTHX_ self, "connect_args", 12); |
| 482 |
|
| if (!SvROK(block) || SvTYPE(SvRV(block)) != SVt_PVCV) |
| 483 |
|
| croak("DBIx::Loop->txn: need a coderef"); |
| 484 |
|
| if (!(cap && SvPOK(cap) && strEQ(SvPVX(cap), "pool") |
| 485 |
|
| && cargs && SvROK(cargs))) |
| 486 |
|
| croak("DBIx::Loop->txn: transactions need the pool backend " |
| 487 |
|
| "(connect() with a dsn); native-backend transactions arrive " |
| 488 |
|
| "with the native connection pool"); |
| 489 |
|
| RETVAL = dbil_txn_start(aTHX_ self, block, |
| 490 |
|
| dbil_pool_of(aTHX_ self, cargs)); |
| 491 |
|
| } |
| 492 |
|
| #line 493 "Loop.c" |
| 493 |
14 |
| RETVAL = sv_2mortal(RETVAL); |
| 494 |
14 |
| ST(0) = RETVAL; |
| 495 |
|
| } |
| 496 |
14 |
| XSRETURN(1); |
| 497 |
|
| } |
| 498 |
|
| |
| 499 |
|
| |
| 500 |
|
| XS_EUPXS(XS_DBIx__Loop__worker_pids); /* prototype to pass -Wmissing-prototypes */ |
| 501 |
16 |
| XS_EUPXS(XS_DBIx__Loop__worker_pids) |
| 502 |
|
| { |
| 503 |
16 |
| dVAR; dXSARGS; |
| 504 |
16 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
16 |
16 |
|
| 505 |
0 |
| croak_xs_usage(cv, "self"); |
| 506 |
|
| PERL_UNUSED_VAR(ax); /* -Wall */ |
| 507 |
16 |
| SP -= items; |
| 508 |
|
| { |
| 509 |
16 |
▶ | SV * self = ST(0) |
Branch: 1 branch
| Branch | True | False | Total |
| SV * self = ST(0) |
16 |
0 |
16 |
|
| 510 |
|
| ; |
| 511 |
|
| #line 210 "./xs/loop.xs" |
| 512 |
|
| { |
| 513 |
|
| if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV) { |
| 514 |
|
| SV **pp = hv_fetchs((HV *)SvRV(self), "_pool", 0); |
| 515 |
|
| if (pp && *pp && SvIOK(*pp)) { |
| 516 |
|
| dbil_pool *p = INT2PTR(dbil_pool *, SvIV(*pp)); |
| 517 |
|
| int i; |
| 518 |
|
| EXTEND(SP, p->nw); |
| 519 |
|
| for (i = 0; i < p->nw; i++) |
| 520 |
|
| mPUSHi((IV)p->w[i].pid); |
| 521 |
|
| } |
| 522 |
|
| } |
| 523 |
|
| } |
| 524 |
|
| #line 525 "Loop.c" |
| 525 |
16 |
| PUTBACK; |
| 526 |
16 |
| return; |
| 527 |
|
| } |
| 528 |
|
| } |
| 529 |
|
| |
| 530 |
|
| |
| 531 |
|
| XS_EUPXS(XS_DBIx__Loop_DESTROY); /* prototype to pass -Wmissing-prototypes */ |
| 532 |
21 |
| XS_EUPXS(XS_DBIx__Loop_DESTROY) |
| 533 |
|
| { |
| 534 |
21 |
| dVAR; dXSARGS; |
| 535 |
21 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
21 |
21 |
|
| 536 |
0 |
| croak_xs_usage(cv, "self"); |
| 537 |
|
| { |
| 538 |
21 |
▶ | SV * self = ST(0) |
Branch: 1 branch
| Branch | True | False | Total |
| SV * self = ST(0) |
21 |
0 |
21 |
|
| 539 |
|
| ; |
| 540 |
|
| #line 227 "./xs/loop.xs" |
| 541 |
|
| { |
| 542 |
|
| if (SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV) { |
| 543 |
|
| SV **pp = hv_fetchs((HV *)SvRV(self), "_pool", 0); |
| 544 |
|
| SV **np = hv_fetchs((HV *)SvRV(self), "_native", 0); |
| 545 |
|
| if (pp && *pp && SvIOK(*pp)) |
| 546 |
|
| dbil_pool_free(aTHX_ INT2PTR(dbil_pool *, SvIV(*pp))); |
| 547 |
|
| if (np && *np && SvIOK(*np)) |
| 548 |
|
| dbil_native_free(aTHX_ INT2PTR(dbil_native *, SvIV(*np))); |
| 549 |
|
| } |
| 550 |
|
| } |
| 551 |
|
| #line 552 "Loop.c" |
| 552 |
|
| } |
| 553 |
21 |
| XSRETURN_EMPTY; |
| 554 |
|
| } |
| 555 |
|
| |
| 556 |
|
| |
| 557 |
|
| /* INCLUDE: Returning to 'Loop.xs' from 'xs/loop.xs' */ |
| 558 |
|
| |
| 559 |
|
| |
| 560 |
|
| /* INCLUDE: Including 'xs/future.xs' from 'Loop.xs' */ |
| 561 |
|
| |
| 562 |
|
| |
| 563 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_new); /* prototype to pass -Wmissing-prototypes */ |
| 564 |
28 |
| XS_EUPXS(XS_DBIx__Loop__Future_new) |
| 565 |
|
| { |
| 566 |
28 |
| dVAR; dXSARGS; |
| 567 |
28 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
28 |
28 |
|
| 568 |
0 |
| croak_xs_usage(cv, "class"); |
| 569 |
|
| { |
| 570 |
28 |
▶ | SV * class = ST(0) |
Branch: 1 branch
| Branch | True | False | Total |
| SV * class = ST(0) |
0 |
28 |
28 |
|
| 571 |
|
| ; |
| 572 |
|
| SV * RETVAL; |
| 573 |
|
| #line 18 "./xs/future.xs" |
| 574 |
|
| RETVAL = dbil_future_new(aTHX_ |
| 575 |
|
| SvROK(class) ? sv_reftype(SvRV(class), 1) : SvPV_nolen(class)); |
| 576 |
|
| #line 577 "Loop.c" |
| 577 |
28 |
| RETVAL = sv_2mortal(RETVAL); |
| 578 |
28 |
| ST(0) = RETVAL; |
| 579 |
|
| } |
| 580 |
28 |
| XSRETURN(1); |
| 581 |
|
| } |
| 582 |
|
| |
| 583 |
|
| |
| 584 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_AWAIT_NEW_DONE); /* prototype to pass -Wmissing-prototypes */ |
| 585 |
2 |
| XS_EUPXS(XS_DBIx__Loop__Future_AWAIT_NEW_DONE) |
| 586 |
|
| { |
| 587 |
2 |
| dVAR; dXSARGS; |
| 588 |
2 |
▶ | if (items < 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 1) |
0 |
2 |
2 |
|
| 589 |
0 |
| croak_xs_usage(cv, "class, ..."); |
| 590 |
|
| { |
| 591 |
2 |
| SV * class = ST(0) |
| 592 |
|
| ; |
| 593 |
|
| SV * RETVAL; |
| 594 |
|
| #line 29 "./xs/future.xs" |
| 595 |
|
| { |
| 596 |
|
| dbil_future *f; |
| 597 |
|
| AV *res = newAV(); |
| 598 |
|
| int i; |
| 599 |
|
| RETVAL = dbil_future_new(aTHX_ |
| 600 |
|
| SvROK(class) ? sv_reftype(SvRV(class), 1) : SvPV_nolen(class)); |
| 601 |
|
| f = dbil_future_of(aTHX_ RETVAL); |
| 602 |
|
| for (i = 1; i < items; i++) av_push(res, newSVsv(ST(i))); |
| 603 |
|
| f->result = newRV_noinc((SV *)res); |
| 604 |
|
| f->state = 1; |
| 605 |
|
| } |
| 606 |
|
| #line 607 "Loop.c" |
| 607 |
2 |
| RETVAL = sv_2mortal(RETVAL); |
| 608 |
2 |
| ST(0) = RETVAL; |
| 609 |
|
| } |
| 610 |
2 |
| XSRETURN(1); |
| 611 |
|
| } |
| 612 |
|
| |
| 613 |
|
| |
| 614 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_AWAIT_NEW_FAIL); /* prototype to pass -Wmissing-prototypes */ |
| 615 |
1 |
| XS_EUPXS(XS_DBIx__Loop__Future_AWAIT_NEW_FAIL) |
| 616 |
|
| { |
| 617 |
1 |
| dVAR; dXSARGS; |
| 618 |
1 |
▶ | if (items < 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 1) |
0 |
1 |
1 |
|
| 619 |
0 |
| croak_xs_usage(cv, "class, ..."); |
| 620 |
|
| { |
| 621 |
1 |
▶ | SV * class = ST(0) |
Branch: 1 branch
| Branch | True | False | Total |
| SV * class = ST(0) |
0 |
1 |
1 |
|
| 622 |
|
| ; |
| 623 |
|
| SV * RETVAL; |
| 624 |
|
| #line 47 "./xs/future.xs" |
| 625 |
|
| { |
| 626 |
|
| dbil_future *f; |
| 627 |
|
| RETVAL = dbil_future_new(aTHX_ |
| 628 |
|
| SvROK(class) ? sv_reftype(SvRV(class), 1) : SvPV_nolen(class)); |
| 629 |
|
| f = dbil_future_of(aTHX_ RETVAL); |
| 630 |
|
| f->error = newSVsv(items > 1 ? ST(1) |
| 631 |
|
| : sv_2mortal(newSVpvs("Failed\n"))); |
| 632 |
|
| f->state = 2; |
| 633 |
|
| } |
| 634 |
|
| #line 635 "Loop.c" |
| 635 |
1 |
| RETVAL = sv_2mortal(RETVAL); |
| 636 |
1 |
| ST(0) = RETVAL; |
| 637 |
|
| } |
| 638 |
1 |
| XSRETURN(1); |
| 639 |
|
| } |
| 640 |
|
| |
| 641 |
|
| |
| 642 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_AWAIT_CLONE); /* prototype to pass -Wmissing-prototypes */ |
| 643 |
1 |
| XS_EUPXS(XS_DBIx__Loop__Future_AWAIT_CLONE) |
| 644 |
|
| { |
| 645 |
1 |
| dVAR; dXSARGS; |
| 646 |
1 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
1 |
1 |
|
| 647 |
0 |
| croak_xs_usage(cv, "self"); |
| 648 |
|
| { |
| 649 |
1 |
| SV * self = ST(0) |
| 650 |
|
| ; |
| 651 |
|
| SV * RETVAL; |
| 652 |
|
| #line 66 "./xs/future.xs" |
| 653 |
|
| (void)dbil_future_of(aTHX_ self); /* croak early if not one */ |
| 654 |
|
| RETVAL = dbil_future_new(aTHX_ sv_reftype(SvRV(self), 1)); |
| 655 |
|
| #line 656 "Loop.c" |
| 656 |
1 |
| RETVAL = sv_2mortal(RETVAL); |
| 657 |
1 |
| ST(0) = RETVAL; |
| 658 |
|
| } |
| 659 |
1 |
| XSRETURN(1); |
| 660 |
|
| } |
| 661 |
|
| |
| 662 |
|
| |
| 663 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_done); /* prototype to pass -Wmissing-prototypes */ |
| 664 |
17 |
| XS_EUPXS(XS_DBIx__Loop__Future_done) |
| 665 |
|
| { |
| 666 |
17 |
| dVAR; dXSARGS; |
| 667 |
17 |
| dXSI32; |
| 668 |
17 |
▶ | if (items < 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 1) |
0 |
17 |
17 |
|
| 669 |
0 |
| croak_xs_usage(cv, "self, ..."); |
| 670 |
|
| { |
| 671 |
17 |
| SV * self = ST(0) |
| 672 |
|
| ; |
| 673 |
|
| SV * RETVAL; |
| 674 |
|
| #line 77 "./xs/future.xs" |
| 675 |
|
| { |
| 676 |
|
| dbil_future *f = dbil_future_of(aTHX_ self); |
| 677 |
|
| AV *res = newAV(); |
| 678 |
|
| int i; |
| 679 |
|
| PERL_UNUSED_VAR(ix); |
| 680 |
|
| if (f->state) |
| 681 |
|
| croak("DBIx::Loop::Future: already settled"); |
| 682 |
|
| for (i = 1; i < items; i++) av_push(res, newSVsv(ST(i))); |
| 683 |
|
| f->result = newRV_noinc((SV *)res); |
| 684 |
|
| f->state = 1; |
| 685 |
|
| dbil_future_fire(aTHX_ self, f); |
| 686 |
|
| RETVAL = SvREFCNT_inc(self); |
| 687 |
|
| } |
| 688 |
|
| #line 689 "Loop.c" |
| 689 |
16 |
| RETVAL = sv_2mortal(RETVAL); |
| 690 |
16 |
| ST(0) = RETVAL; |
| 691 |
|
| } |
| 692 |
16 |
| XSRETURN(1); |
| 693 |
|
| } |
| 694 |
|
| |
| 695 |
|
| |
| 696 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_fail); /* prototype to pass -Wmissing-prototypes */ |
| 697 |
8 |
| XS_EUPXS(XS_DBIx__Loop__Future_fail) |
| 698 |
|
| { |
| 699 |
8 |
| dVAR; dXSARGS; |
| 700 |
8 |
| dXSI32; |
| 701 |
8 |
▶ | if (items < 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 1) |
0 |
8 |
8 |
|
| 702 |
0 |
| croak_xs_usage(cv, "self, ..."); |
| 703 |
|
| { |
| 704 |
8 |
▶ | SV * self = ST(0) |
Branch: 1 branch
| Branch | True | False | Total |
| SV * self = ST(0) |
1 |
7 |
8 |
|
| 705 |
|
| ; |
| 706 |
|
| SV * RETVAL; |
| 707 |
|
| #line 102 "./xs/future.xs" |
| 708 |
|
| { |
| 709 |
|
| dbil_future *f; |
| 710 |
|
| PERL_UNUSED_VAR(ix); |
| 711 |
|
| if (items < 2) |
| 712 |
|
| croak("Usage: DBIx::Loop::Future::fail(self, error)"); |
| 713 |
|
| f = dbil_future_of(aTHX_ self); |
| 714 |
|
| if (f->state) |
| 715 |
|
| croak("DBIx::Loop::Future: already settled"); |
| 716 |
|
| f->error = newSVsv(ST(1)); |
| 717 |
|
| f->state = 2; |
| 718 |
|
| dbil_future_fire(aTHX_ self, f); |
| 719 |
|
| RETVAL = SvREFCNT_inc(self); |
| 720 |
|
| } |
| 721 |
|
| #line 722 "Loop.c" |
| 722 |
7 |
| RETVAL = sv_2mortal(RETVAL); |
| 723 |
7 |
| ST(0) = RETVAL; |
| 724 |
|
| } |
| 725 |
7 |
| XSRETURN(1); |
| 726 |
|
| } |
| 727 |
|
| |
| 728 |
|
| |
| 729 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_on_ready); /* prototype to pass -Wmissing-prototypes */ |
| 730 |
9 |
| XS_EUPXS(XS_DBIx__Loop__Future_on_ready) |
| 731 |
|
| { |
| 732 |
9 |
| dVAR; dXSARGS; |
| 733 |
9 |
| dXSI32; |
| 734 |
9 |
▶ | if (items != 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 2) |
0 |
9 |
9 |
|
| 735 |
0 |
| croak_xs_usage(cv, "self, cb"); |
| 736 |
|
| { |
| 737 |
9 |
| SV * self = ST(0) |
| 738 |
|
| ; |
| 739 |
9 |
| SV * cb = ST(1) |
| 740 |
|
| ; |
| 741 |
|
| SV * RETVAL; |
| 742 |
|
| #line 125 "./xs/future.xs" |
| 743 |
|
| { |
| 744 |
|
| dbil_future *f = dbil_future_of(aTHX_ self); |
| 745 |
|
| PERL_UNUSED_VAR(ix); |
| 746 |
|
| if (!SvROK(cb) || SvTYPE(SvRV(cb)) != SVt_PVCV) |
| 747 |
|
| croak("DBIx::Loop::Future->on_ready: need a coderef"); |
| 748 |
|
| if (f->state) { |
| 749 |
|
| dSP; |
| 750 |
|
| ENTER; SAVETMPS; PUSHMARK(SP); |
| 751 |
|
| EXTEND(SP, 1); PUSHs(self); PUTBACK; |
| 752 |
|
| call_sv(cb, G_DISCARD | G_EVAL); |
| 753 |
|
| if (SvTRUE(ERRSV)) |
| 754 |
|
| warn("DBIx::Loop::Future: on_ready callback died: %s", |
| 755 |
|
| SvPV_nolen(ERRSV)); |
| 756 |
|
| FREETMPS; LEAVE; |
| 757 |
|
| } else { |
| 758 |
|
| av_push(f->cbs, newSVsv(cb)); |
| 759 |
|
| } |
| 760 |
|
| RETVAL = SvREFCNT_inc(self); |
| 761 |
|
| } |
| 762 |
|
| #line 763 "Loop.c" |
| 763 |
9 |
| RETVAL = sv_2mortal(RETVAL); |
| 764 |
9 |
| ST(0) = RETVAL; |
| 765 |
|
| } |
| 766 |
9 |
| XSRETURN(1); |
| 767 |
|
| } |
| 768 |
|
| |
| 769 |
|
| |
| 770 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_then); /* prototype to pass -Wmissing-prototypes */ |
| 771 |
2015 |
| XS_EUPXS(XS_DBIx__Loop__Future_then) |
| 772 |
|
| { |
| 773 |
2015 |
| dVAR; dXSARGS; |
| 774 |
2015 |
| dXSI32; |
| 775 |
2015 |
▶ | if (items < 1 || items > 3) |
Branch: 2 branches
| Branch | True | False | Total |
| if (items < 1 || items > 3) |
2015 |
0 |
2015 |
| if (items < 1 || items > 3) |
0 |
2015 |
2015 |
|
| 776 |
0 |
| croak_xs_usage(cv, "self, on_done = &PL_sv_undef, on_fail = &PL_sv_undef"); |
| 777 |
|
| { |
| 778 |
2015 |
| SV * self = ST(0) |
| 779 |
|
| ; |
| 780 |
|
| SV * on_done; |
| 781 |
|
| SV * on_fail; |
| 782 |
|
| SV * RETVAL; |
| 783 |
|
| |
| 784 |
2015 |
▶ | if (items < 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 2) |
0 |
2015 |
2015 |
|
| 785 |
0 |
| on_done = &PL_sv_undef; |
| 786 |
|
| else { |
| 787 |
2015 |
| on_done = ST(1) |
| 788 |
|
| ; |
| 789 |
|
| } |
| 790 |
|
| |
| 791 |
2015 |
▶ | if (items < 3) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 3) |
2015 |
0 |
2015 |
|
| 792 |
2015 |
| on_fail = &PL_sv_undef; |
| 793 |
|
| else { |
| 794 |
0 |
| on_fail = ST(2) |
| 795 |
|
| ; |
| 796 |
|
| } |
| 797 |
|
| #line 161 "./xs/future.xs" |
| 798 |
|
| { |
| 799 |
|
| SV *next; |
| 800 |
|
| /* else($cb): the one argument is the failure handler */ |
| 801 |
|
| if (ix == 1) { on_fail = on_done; on_done = &PL_sv_undef; } |
| 802 |
|
| (void)dbil_future_of(aTHX_ self); /* croak early if not one */ |
| 803 |
|
| next = dbil_future_new(aTHX_ "DBIx::Loop::Future"); |
| 804 |
|
| dbil_then_attach(aTHX_ self, next, on_done, on_fail); |
| 805 |
|
| RETVAL = next; |
| 806 |
|
| } |
| 807 |
|
| #line 808 "Loop.c" |
| 808 |
2015 |
| RETVAL = sv_2mortal(RETVAL); |
| 809 |
2015 |
| ST(0) = RETVAL; |
| 810 |
|
| } |
| 811 |
2015 |
| XSRETURN(1); |
| 812 |
|
| } |
| 813 |
|
| |
| 814 |
|
| |
| 815 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_is_ready); /* prototype to pass -Wmissing-prototypes */ |
| 816 |
1488 |
| XS_EUPXS(XS_DBIx__Loop__Future_is_ready) |
| 817 |
|
| { |
| 818 |
1488 |
| dVAR; dXSARGS; |
| 819 |
1488 |
| dXSI32; |
| 820 |
1488 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
1488 |
1488 |
|
| 821 |
0 |
| croak_xs_usage(cv, "self"); |
| 822 |
|
| { |
| 823 |
1488 |
| SV * self = ST(0) |
| 824 |
|
| ; |
| 825 |
|
| int RETVAL; |
| 826 |
1488 |
▶ | dXSTARG; |
Branch: 1 branch
| Branch | True | False | Total |
| dXSTARG; |
1488 |
0 |
1488 |
|
| 827 |
|
| #line 179 "./xs/future.xs" |
| 828 |
|
| PERL_UNUSED_VAR(ix); |
| 829 |
|
| RETVAL = dbil_future_of(aTHX_ self)->state != 0; |
| 830 |
|
| #line 831 "Loop.c" |
| 831 |
1488 |
▶ | TARGi((IV)RETVAL, 1); |
Branch: 1 branch
| Branch | True | False | Total |
| TARGi((IV)RETVAL, 1); |
1457 |
31 |
1488 |
|
| 832 |
1488 |
| ST(0) = TARG; |
| 833 |
|
| } |
| 834 |
1488 |
| XSRETURN(1); |
| 835 |
|
| } |
| 836 |
|
| |
| 837 |
|
| |
| 838 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_is_done); /* prototype to pass -Wmissing-prototypes */ |
| 839 |
60 |
| XS_EUPXS(XS_DBIx__Loop__Future_is_done) |
| 840 |
|
| { |
| 841 |
60 |
| dVAR; dXSARGS; |
| 842 |
60 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
60 |
60 |
|
| 843 |
0 |
| croak_xs_usage(cv, "self"); |
| 844 |
|
| { |
| 845 |
60 |
| SV * self = ST(0) |
| 846 |
|
| ; |
| 847 |
|
| int RETVAL; |
| 848 |
60 |
▶ | dXSTARG; |
Branch: 1 branch
| Branch | True | False | Total |
| dXSTARG; |
60 |
0 |
60 |
|
| 849 |
|
| #line 188 "./xs/future.xs" |
| 850 |
|
| RETVAL = dbil_future_of(aTHX_ self)->state == 1; |
| 851 |
|
| #line 852 "Loop.c" |
| 852 |
60 |
▶ | TARGi((IV)RETVAL, 1); |
Branch: 1 branch
| Branch | True | False | Total |
| TARGi((IV)RETVAL, 1); |
31 |
29 |
60 |
|
| 853 |
60 |
| ST(0) = TARG; |
| 854 |
|
| } |
| 855 |
60 |
| XSRETURN(1); |
| 856 |
|
| } |
| 857 |
|
| |
| 858 |
|
| |
| 859 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_is_failed); /* prototype to pass -Wmissing-prototypes */ |
| 860 |
527 |
| XS_EUPXS(XS_DBIx__Loop__Future_is_failed) |
| 861 |
|
| { |
| 862 |
527 |
| dVAR; dXSARGS; |
| 863 |
527 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
527 |
527 |
|
| 864 |
0 |
| croak_xs_usage(cv, "self"); |
| 865 |
|
| { |
| 866 |
527 |
| SV * self = ST(0) |
| 867 |
|
| ; |
| 868 |
|
| int RETVAL; |
| 869 |
527 |
▶ | dXSTARG; |
Branch: 1 branch
| Branch | True | False | Total |
| dXSTARG; |
527 |
0 |
527 |
|
| 870 |
|
| #line 196 "./xs/future.xs" |
| 871 |
|
| RETVAL = dbil_future_of(aTHX_ self)->state == 2; |
| 872 |
|
| #line 873 "Loop.c" |
| 873 |
527 |
▶ | TARGi((IV)RETVAL, 1); |
Branch: 1 branch
| Branch | True | False | Total |
| TARGi((IV)RETVAL, 1); |
501 |
26 |
527 |
|
| 874 |
527 |
| ST(0) = TARG; |
| 875 |
|
| } |
| 876 |
527 |
| XSRETURN(1); |
| 877 |
|
| } |
| 878 |
|
| |
| 879 |
|
| |
| 880 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_AWAIT_IS_CANCELLED); /* prototype to pass -Wmissing-prototypes */ |
| 881 |
3 |
| XS_EUPXS(XS_DBIx__Loop__Future_AWAIT_IS_CANCELLED) |
| 882 |
|
| { |
| 883 |
3 |
| dVAR; dXSARGS; |
| 884 |
3 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
3 |
3 |
|
| 885 |
0 |
| croak_xs_usage(cv, "self"); |
| 886 |
|
| { |
| 887 |
3 |
| SV * self = ST(0) |
| 888 |
|
| ; |
| 889 |
|
| int RETVAL; |
| 890 |
3 |
▶ | dXSTARG; |
Branch: 1 branch
| Branch | True | False | Total |
| dXSTARG; |
3 |
0 |
3 |
|
| 891 |
|
| #line 208 "./xs/future.xs" |
| 892 |
|
| (void)dbil_future_of(aTHX_ self); /* croak early if not one */ |
| 893 |
|
| RETVAL = 0; |
| 894 |
|
| #line 895 "Loop.c" |
| 895 |
3 |
▶ | TARGi((IV)RETVAL, 1); |
Branch: 1 branch
| Branch | True | False | Total |
| TARGi((IV)RETVAL, 1); |
0 |
3 |
3 |
|
| 896 |
3 |
| ST(0) = TARG; |
| 897 |
|
| } |
| 898 |
3 |
| XSRETURN(1); |
| 899 |
|
| } |
| 900 |
|
| |
| 901 |
|
| |
| 902 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_AWAIT_ON_CANCEL); /* prototype to pass -Wmissing-prototypes */ |
| 903 |
2 |
| XS_EUPXS(XS_DBIx__Loop__Future_AWAIT_ON_CANCEL) |
| 904 |
|
| { |
| 905 |
2 |
| dVAR; dXSARGS; |
| 906 |
2 |
| dXSI32; |
| 907 |
2 |
▶ | if (items != 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 2) |
0 |
2 |
2 |
|
| 908 |
0 |
| croak_xs_usage(cv, "self, thing"); |
| 909 |
|
| { |
| 910 |
2 |
| SV * self = ST(0) |
| 911 |
|
| ; |
| 912 |
2 |
| SV * thing = ST(1) |
| 913 |
|
| ; |
| 914 |
|
| #line 220 "./xs/future.xs" |
| 915 |
|
| PERL_UNUSED_ARG(self); |
| 916 |
|
| PERL_UNUSED_ARG(thing); |
| 917 |
|
| PERL_UNUSED_VAR(ix); |
| 918 |
|
| #line 919 "Loop.c" |
| 919 |
|
| } |
| 920 |
2 |
| XSRETURN_EMPTY; |
| 921 |
|
| } |
| 922 |
|
| |
| 923 |
|
| |
| 924 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_failure); /* prototype to pass -Wmissing-prototypes */ |
| 925 |
22 |
| XS_EUPXS(XS_DBIx__Loop__Future_failure) |
| 926 |
|
| { |
| 927 |
22 |
| dVAR; dXSARGS; |
| 928 |
22 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
22 |
22 |
|
| 929 |
0 |
| croak_xs_usage(cv, "self"); |
| 930 |
|
| { |
| 931 |
22 |
| SV * self = ST(0) |
| 932 |
|
| ; |
| 933 |
|
| SV * RETVAL; |
| 934 |
|
| #line 228 "./xs/future.xs" |
| 935 |
|
| { |
| 936 |
|
| dbil_future *f = dbil_future_of(aTHX_ self); |
| 937 |
|
| RETVAL = (f->state == 2 && f->error) ? newSVsv(f->error) : newSV(0); |
| 938 |
|
| } |
| 939 |
|
| #line 940 "Loop.c" |
| 940 |
22 |
| RETVAL = sv_2mortal(RETVAL); |
| 941 |
22 |
| ST(0) = RETVAL; |
| 942 |
|
| } |
| 943 |
22 |
| XSRETURN(1); |
| 944 |
|
| } |
| 945 |
|
| |
| 946 |
|
| |
| 947 |
|
| XS_EUPXS(XS_DBIx__Loop__Future_get); /* prototype to pass -Wmissing-prototypes */ |
| 948 |
175 |
| XS_EUPXS(XS_DBIx__Loop__Future_get) |
| 949 |
|
| { |
| 950 |
175 |
| dVAR; dXSARGS; |
| 951 |
175 |
| dXSI32; |
| 952 |
175 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
175 |
175 |
|
| 953 |
0 |
| croak_xs_usage(cv, "self"); |
| 954 |
|
| PERL_UNUSED_VAR(ax); /* -Wall */ |
| 955 |
175 |
| SP -= items; |
| 956 |
|
| { |
| 957 |
175 |
| SV * self = ST(0) |
| 958 |
|
| ; |
| 959 |
|
| #line 247 "./xs/future.xs" |
| 960 |
|
| { |
| 961 |
|
| dbil_future *f = dbil_future_of(aTHX_ self); |
| 962 |
|
| PERL_UNUSED_VAR(ix); |
| 963 |
|
| if (f->state == 0) |
| 964 |
|
| croak("DBIx::Loop::Future->get: future is not ready " |
| 965 |
|
| "(await it on your event loop first)"); |
| 966 |
|
| if (f->state == 2) |
| 967 |
|
| croak_sv(f->error ? f->error : sv_2mortal(newSVpvs("failed"))); |
| 968 |
|
| { |
| 969 |
|
| AV *res = (AV *)SvRV(f->result); |
| 970 |
|
| SSize_t i, n = av_len(res) + 1; |
| 971 |
|
| EXTEND(SP, n); |
| 972 |
|
| for (i = 0; i < n; i++) { |
| 973 |
|
| SV **e = av_fetch(res, i, 0); |
| 974 |
|
| PUSHs(e && *e ? sv_2mortal(newSVsv(*e)) : &PL_sv_undef); |
| 975 |
|
| } |
| 976 |
|
| } |
| 977 |
|
| } |
| 978 |
|
| #line 979 "Loop.c" |
| 979 |
167 |
| PUTBACK; |
| 980 |
167 |
| return; |
| 981 |
|
| } |
| 982 |
|
| } |
| 983 |
|
| |
| 984 |
|
| |
| 985 |
|
| /* INCLUDE: Returning to 'Loop.xs' from 'xs/future.xs' */ |
| 986 |
|
| |
| 987 |
|
| |
| 988 |
|
| /* INCLUDE: Including 'xs/txn.xs' from 'Loop.xs' */ |
| 989 |
|
| |
| 990 |
|
| |
| 991 |
|
| XS_EUPXS(XS_DBIx__Loop__Txn_query); /* prototype to pass -Wmissing-prototypes */ |
| 992 |
3 |
| XS_EUPXS(XS_DBIx__Loop__Txn_query) |
| 993 |
|
| { |
| 994 |
3 |
| dVAR; dXSARGS; |
| 995 |
3 |
▶ | if (items < 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 2) |
0 |
3 |
3 |
|
| 996 |
0 |
| croak_xs_usage(cv, "self, sql, ..."); |
| 997 |
|
| { |
| 998 |
3 |
| SV * self = ST(0) |
| 999 |
|
| ; |
| 1000 |
3 |
| SV * sql = ST(1) |
| 1001 |
|
| ; |
| 1002 |
|
| SV * RETVAL; |
| 1003 |
|
| #line 11 "./xs/txn.xs" |
| 1004 |
|
| { |
| 1005 |
|
| AV *bind = (AV *)sv_2mortal((SV *)newAV()); |
| 1006 |
|
| int i; |
| 1007 |
|
| for (i = 2; i < items; i++) av_push(bind, newSVsv(ST(i))); |
| 1008 |
|
| RETVAL = dbil_txn_stmt(aTHX_ self, 1, sql, bind); |
| 1009 |
|
| } |
| 1010 |
|
| #line 1011 "Loop.c" |
| 1011 |
3 |
| RETVAL = sv_2mortal(RETVAL); |
| 1012 |
3 |
| ST(0) = RETVAL; |
| 1013 |
|
| } |
| 1014 |
3 |
| XSRETURN(1); |
| 1015 |
|
| } |
| 1016 |
|
| |
| 1017 |
|
| |
| 1018 |
|
| XS_EUPXS(XS_DBIx__Loop__Txn_do); /* prototype to pass -Wmissing-prototypes */ |
| 1019 |
16 |
| XS_EUPXS(XS_DBIx__Loop__Txn_do) |
| 1020 |
|
| { |
| 1021 |
16 |
| dVAR; dXSARGS; |
| 1022 |
16 |
▶ | if (items < 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 2) |
0 |
16 |
16 |
|
| 1023 |
0 |
| croak_xs_usage(cv, "self, sql, ..."); |
| 1024 |
|
| { |
| 1025 |
16 |
| SV * self = ST(0) |
| 1026 |
|
| ; |
| 1027 |
16 |
| SV * sql = ST(1) |
| 1028 |
|
| ; |
| 1029 |
|
| SV * RETVAL; |
| 1030 |
|
| #line 26 "./xs/txn.xs" |
| 1031 |
|
| { |
| 1032 |
|
| AV *bind = (AV *)sv_2mortal((SV *)newAV()); |
| 1033 |
|
| int i; |
| 1034 |
|
| for (i = 2; i < items; i++) av_push(bind, newSVsv(ST(i))); |
| 1035 |
|
| RETVAL = dbil_txn_stmt(aTHX_ self, 0, sql, bind); |
| 1036 |
|
| } |
| 1037 |
|
| #line 1038 "Loop.c" |
| 1038 |
16 |
| RETVAL = sv_2mortal(RETVAL); |
| 1039 |
16 |
| ST(0) = RETVAL; |
| 1040 |
|
| } |
| 1041 |
16 |
| XSRETURN(1); |
| 1042 |
|
| } |
| 1043 |
|
| |
| 1044 |
|
| |
| 1045 |
|
| XS_EUPXS(XS_DBIx__Loop__Txn_is_active); /* prototype to pass -Wmissing-prototypes */ |
| 1046 |
1 |
| XS_EUPXS(XS_DBIx__Loop__Txn_is_active) |
| 1047 |
|
| { |
| 1048 |
1 |
| dVAR; dXSARGS; |
| 1049 |
1 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
1 |
1 |
|
| 1050 |
0 |
| croak_xs_usage(cv, "self"); |
| 1051 |
|
| { |
| 1052 |
1 |
| SV * self = ST(0) |
| 1053 |
|
| ; |
| 1054 |
|
| int RETVAL; |
| 1055 |
1 |
▶ | dXSTARG; |
Branch: 1 branch
| Branch | True | False | Total |
| dXSTARG; |
1 |
0 |
1 |
|
| 1056 |
|
| #line 39 "./xs/txn.xs" |
| 1057 |
|
| RETVAL = dbil_tx_iv(aTHX_ self, "active") == 1; |
| 1058 |
|
| #line 1059 "Loop.c" |
| 1059 |
1 |
▶ | TARGi((IV)RETVAL, 1); |
Branch: 1 branch
| Branch | True | False | Total |
| TARGi((IV)RETVAL, 1); |
0 |
1 |
1 |
|
| 1060 |
1 |
| ST(0) = TARG; |
| 1061 |
|
| } |
| 1062 |
1 |
| XSRETURN(1); |
| 1063 |
|
| } |
| 1064 |
|
| |
| 1065 |
|
| |
| 1066 |
|
| /* INCLUDE: Returning to 'Loop.xs' from 'xs/txn.xs' */ |
| 1067 |
|
| |
| 1068 |
|
| |
| 1069 |
|
| /* INCLUDE: Including 'xs/loop_hyperman.xs' from 'Loop.xs' */ |
| 1070 |
|
| |
| 1071 |
|
| |
| 1072 |
|
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_new); /* prototype to pass -Wmissing-prototypes */ |
| 1073 |
0 |
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_new) |
| 1074 |
|
| { |
| 1075 |
0 |
| dVAR; dXSARGS; |
| 1076 |
0 |
▶ | if (items < 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 1) |
0 |
0 |
0 |
|
| 1077 |
0 |
| croak_xs_usage(cv, "class, ..."); |
| 1078 |
|
| { |
| 1079 |
0 |
| SV * class = ST(0) |
| 1080 |
|
| ; |
| 1081 |
|
| SV * RETVAL; |
| 1082 |
|
| #line 12 "./xs/loop_hyperman.xs" |
| 1083 |
|
| { |
| 1084 |
|
| const hm_abi *A = dbil_hm(aTHX); |
| 1085 |
|
| SV *loop_sv = NULL; |
| 1086 |
|
| void *loop; |
| 1087 |
|
| dbil_hm_ctx *c; |
| 1088 |
|
| HV *self; |
| 1089 |
|
| int i; |
| 1090 |
|
| const char *cls = (SvROK(class) && SvOBJECT(SvRV(class))) |
| 1091 |
|
| ? HvNAME(SvSTASH(SvRV(class))) : SvPV_nolen(class); |
| 1092 |
|
| if (!A) |
| 1093 |
|
| croak("DBIx::Loop::Loop::Hyperman: no Hyperman C ABI version %d - " |
| 1094 |
|
| "either Hyperman is not loaded (use Hyperman first) or it " |
| 1095 |
|
| "predates the ABI (needs Hyperman 0.10 or newer)", |
| 1096 |
|
| HM_ABI_VERSION); |
| 1097 |
|
| for (i = 1; i + 1 < items; i += 2) { |
| 1098 |
|
| STRLEN kl; const char *k = SvPV_const(ST(i), kl); |
| 1099 |
|
| if (kl == 4 && memEQ(k, "loop", 4) && SvOK(ST(i + 1))) |
| 1100 |
|
| loop_sv = ST(i + 1); |
| 1101 |
|
| } |
| 1102 |
|
| if (loop_sv) { |
| 1103 |
|
| loop = A->loop_of_sv(aTHX_ loop_sv); /* croaks if not one */ |
| 1104 |
|
| loop_sv = newSVsv(loop_sv); |
| 1105 |
|
| } else if ((loop = A->cur_loop(aTHX))) { |
| 1106 |
|
| loop_sv = A->sv_of_loop(aTHX_ loop); /* +1, we own it */ |
| 1107 |
|
| } else { |
| 1108 |
|
| /* no loop given, none running: make one (IO::Async parity) */ |
| 1109 |
|
| dSP; int n; |
| 1110 |
|
| ENTER; SAVETMPS; PUSHMARK(SP); |
| 1111 |
|
| EXTEND(SP, 1); mPUSHp("Hyperman::Loop", 14); PUTBACK; |
| 1112 |
|
| n = call_method("new", G_SCALAR); |
| 1113 |
|
| SPAGAIN; |
| 1114 |
|
| if (n > 0) { SV *s = POPs; loop_sv = newSVsv(s); } |
| 1115 |
|
| PUTBACK; FREETMPS; LEAVE; |
| 1116 |
|
| if (!loop_sv) |
| 1117 |
|
| croak("DBIx::Loop::Loop::Hyperman: Hyperman::Loop->new " |
| 1118 |
|
| "returned nothing"); |
| 1119 |
|
| loop = A->loop_of_sv(aTHX_ loop_sv); |
| 1120 |
|
| } |
| 1121 |
|
| c = dbil_hm_ctx_new(A, loop); |
| 1122 |
|
| self = newHV(); |
| 1123 |
|
| (void)hv_stores(self, "loop", loop_sv); |
| 1124 |
|
| (void)hv_stores(self, "_ctx", newSViv(PTR2IV(c))); |
| 1125 |
|
| (void)hv_stores(self, "_vt", newSViv(PTR2IV(&c->vt))); |
| 1126 |
|
| RETVAL = sv_bless(newRV_noinc((SV *)self), gv_stashpv(cls, GV_ADD)); |
| 1127 |
|
| } |
| 1128 |
|
| #line 1129 "Loop.c" |
| 1129 |
0 |
| RETVAL = sv_2mortal(RETVAL); |
| 1130 |
0 |
| ST(0) = RETVAL; |
| 1131 |
|
| } |
| 1132 |
0 |
| XSRETURN(1); |
| 1133 |
|
| } |
| 1134 |
|
| |
| 1135 |
|
| |
| 1136 |
|
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_loop); /* prototype to pass -Wmissing-prototypes */ |
| 1137 |
0 |
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_loop) |
| 1138 |
|
| { |
| 1139 |
0 |
| dVAR; dXSARGS; |
| 1140 |
0 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
0 |
0 |
|
| 1141 |
0 |
| croak_xs_usage(cv, "self"); |
| 1142 |
|
| { |
| 1143 |
0 |
| SV * self = ST(0) |
| 1144 |
|
| ; |
| 1145 |
|
| SV * RETVAL; |
| 1146 |
|
| #line 65 "./xs/loop_hyperman.xs" |
| 1147 |
|
| { |
| 1148 |
|
| SV **e; |
| 1149 |
|
| (void)dbil_hm_ctx_of(aTHX_ self); /* validates */ |
| 1150 |
|
| e = hv_fetchs((HV *)SvRV(self), "loop", 0); |
| 1151 |
|
| RETVAL = (e && *e) ? newSVsv(*e) : &PL_sv_undef; |
| 1152 |
|
| } |
| 1153 |
|
| #line 1154 "Loop.c" |
| 1154 |
0 |
| RETVAL = sv_2mortal(RETVAL); |
| 1155 |
0 |
| ST(0) = RETVAL; |
| 1156 |
|
| } |
| 1157 |
0 |
| XSRETURN(1); |
| 1158 |
|
| } |
| 1159 |
|
| |
| 1160 |
|
| |
| 1161 |
|
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_add_reader); /* prototype to pass -Wmissing-prototypes */ |
| 1162 |
0 |
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_add_reader) |
| 1163 |
|
| { |
| 1164 |
0 |
| dVAR; dXSARGS; |
| 1165 |
0 |
| dXSI32; |
| 1166 |
0 |
▶ | if (items != 3) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 3) |
0 |
0 |
0 |
|
| 1167 |
0 |
| croak_xs_usage(cv, "self, fd, cb"); |
| 1168 |
|
| { |
| 1169 |
0 |
| SV * self = ST(0) |
| 1170 |
|
| ; |
| 1171 |
0 |
| int fd = (int)SvIV(ST(1)) |
| 1172 |
|
| ; |
| 1173 |
0 |
▶ | SV * cb = ST(2) |
Branch: 1 branch
| Branch | True | False | Total |
| SV * cb = ST(2) |
0 |
0 |
0 |
|
| 1174 |
|
| ; |
| 1175 |
|
| #line 82 "./xs/loop_hyperman.xs" |
| 1176 |
|
| dbil_hm_add_io(aTHX_ self, fd, ix ? HM_ABI_WRITE : HM_ABI_READ, cb); |
| 1177 |
|
| #line 1178 "Loop.c" |
| 1178 |
|
| } |
| 1179 |
0 |
| XSRETURN_EMPTY; |
| 1180 |
|
| } |
| 1181 |
|
| |
| 1182 |
|
| |
| 1183 |
|
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_remove); /* prototype to pass -Wmissing-prototypes */ |
| 1184 |
0 |
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_remove) |
| 1185 |
|
| { |
| 1186 |
0 |
| dVAR; dXSARGS; |
| 1187 |
0 |
▶ | if (items != 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 2) |
0 |
0 |
0 |
|
| 1188 |
0 |
| croak_xs_usage(cv, "self, fd"); |
| 1189 |
|
| { |
| 1190 |
0 |
| SV * self = ST(0) |
| 1191 |
|
| ; |
| 1192 |
0 |
| int fd = (int)SvIV(ST(1)) |
| 1193 |
|
| ; |
| 1194 |
|
| #line 89 "./xs/loop_hyperman.xs" |
| 1195 |
|
| dbil_hm_remove(aTHX_ self, fd); |
| 1196 |
|
| #line 1197 "Loop.c" |
| 1197 |
|
| } |
| 1198 |
0 |
| XSRETURN_EMPTY; |
| 1199 |
|
| } |
| 1200 |
|
| |
| 1201 |
|
| |
| 1202 |
|
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_timer); /* prototype to pass -Wmissing-prototypes */ |
| 1203 |
0 |
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_timer) |
| 1204 |
|
| { |
| 1205 |
0 |
| dVAR; dXSARGS; |
| 1206 |
0 |
▶ | if (items != 3) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 3) |
0 |
0 |
0 |
|
| 1207 |
0 |
| croak_xs_usage(cv, "self, secs, cb"); |
| 1208 |
|
| { |
| 1209 |
0 |
| SV * self = ST(0) |
| 1210 |
|
| ; |
| 1211 |
0 |
| double secs = (double)SvNV(ST(1)) |
| 1212 |
|
| ; |
| 1213 |
0 |
| SV * cb = ST(2) |
| 1214 |
|
| ; |
| 1215 |
|
| SV * RETVAL; |
| 1216 |
|
| #line 99 "./xs/loop_hyperman.xs" |
| 1217 |
|
| { |
| 1218 |
|
| dbil_hm_ctx *c = dbil_hm_ctx_of(aTHX_ self); |
| 1219 |
|
| dbil_hm_tmr *tm; |
| 1220 |
|
| Newxz(tm, 1, dbil_hm_tmr); |
| 1221 |
|
| tm->cb = newSVsv(cb); |
| 1222 |
|
| tm->t = c->A->timer(aTHX_ c->loop, secs, dbil_hm_timer_tramp, tm); |
| 1223 |
|
| RETVAL = newSViv(PTR2IV(tm)); |
| 1224 |
|
| } |
| 1225 |
|
| #line 1226 "Loop.c" |
| 1226 |
0 |
| RETVAL = sv_2mortal(RETVAL); |
| 1227 |
0 |
| ST(0) = RETVAL; |
| 1228 |
|
| } |
| 1229 |
0 |
| XSRETURN(1); |
| 1230 |
|
| } |
| 1231 |
|
| |
| 1232 |
|
| |
| 1233 |
|
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_cancel_timer); /* prototype to pass -Wmissing-prototypes */ |
| 1234 |
0 |
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_cancel_timer) |
| 1235 |
|
| { |
| 1236 |
0 |
| dVAR; dXSARGS; |
| 1237 |
0 |
▶ | if (items != 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 2) |
0 |
0 |
0 |
|
| 1238 |
0 |
| croak_xs_usage(cv, "self, handle"); |
| 1239 |
|
| { |
| 1240 |
0 |
| SV * self = ST(0) |
| 1241 |
|
| ; |
| 1242 |
0 |
| SV * handle = ST(1) |
| 1243 |
|
| ; |
| 1244 |
|
| #line 115 "./xs/loop_hyperman.xs" |
| 1245 |
|
| { |
| 1246 |
|
| dbil_hm_ctx *c = dbil_hm_ctx_of(aTHX_ self); |
| 1247 |
|
| dbil_hm_tmr *tm; |
| 1248 |
|
| if (!SvIOK(handle)) |
| 1249 |
|
| croak("cancel_timer: not a timer handle"); |
| 1250 |
|
| tm = INT2PTR(dbil_hm_tmr *, SvIV(handle)); |
| 1251 |
|
| c->A->timer_cancel(aTHX_ c->loop, tm->t); |
| 1252 |
|
| SvREFCNT_dec(tm->cb); |
| 1253 |
|
| Safefree(tm); |
| 1254 |
|
| } |
| 1255 |
|
| #line 1256 "Loop.c" |
| 1256 |
|
| } |
| 1257 |
0 |
| XSRETURN_EMPTY; |
| 1258 |
|
| } |
| 1259 |
|
| |
| 1260 |
|
| |
| 1261 |
|
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_new_future); /* prototype to pass -Wmissing-prototypes */ |
| 1262 |
0 |
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_new_future) |
| 1263 |
|
| { |
| 1264 |
0 |
| dVAR; dXSARGS; |
| 1265 |
0 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
0 |
0 |
|
| 1266 |
0 |
| croak_xs_usage(cv, "self"); |
| 1267 |
|
| { |
| 1268 |
0 |
| SV * self = ST(0) |
| 1269 |
|
| ; |
| 1270 |
|
| SV * RETVAL; |
| 1271 |
|
| #line 131 "./xs/loop_hyperman.xs" |
| 1272 |
|
| RETVAL = dbil_hm_ctx_of(aTHX_ self)->A->future_new(aTHX); |
| 1273 |
|
| #line 1274 "Loop.c" |
| 1274 |
0 |
| RETVAL = sv_2mortal(RETVAL); |
| 1275 |
0 |
| ST(0) = RETVAL; |
| 1276 |
|
| } |
| 1277 |
0 |
| XSRETURN(1); |
| 1278 |
|
| } |
| 1279 |
|
| |
| 1280 |
|
| |
| 1281 |
|
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_await); /* prototype to pass -Wmissing-prototypes */ |
| 1282 |
0 |
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_await) |
| 1283 |
|
| { |
| 1284 |
0 |
| dVAR; dXSARGS; |
| 1285 |
0 |
▶ | if (items != 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 2) |
0 |
0 |
0 |
|
| 1286 |
0 |
| croak_xs_usage(cv, "self, future"); |
| 1287 |
|
| { |
| 1288 |
0 |
| SV * self = ST(0) |
| 1289 |
|
| ; |
| 1290 |
0 |
| SV * future = ST(1) |
| 1291 |
|
| ; |
| 1292 |
|
| SV * RETVAL; |
| 1293 |
|
| #line 142 "./xs/loop_hyperman.xs" |
| 1294 |
|
| dbil_hm_await(aTHX_ dbil_hm_ctx_of(aTHX_ self), future); |
| 1295 |
|
| RETVAL = newSVsv(future); |
| 1296 |
|
| #line 1297 "Loop.c" |
| 1297 |
0 |
| RETVAL = sv_2mortal(RETVAL); |
| 1298 |
0 |
| ST(0) = RETVAL; |
| 1299 |
|
| } |
| 1300 |
0 |
| XSRETURN(1); |
| 1301 |
|
| } |
| 1302 |
|
| |
| 1303 |
|
| |
| 1304 |
|
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_DESTROY); /* prototype to pass -Wmissing-prototypes */ |
| 1305 |
0 |
| XS_EUPXS(XS_DBIx__Loop__Loop__Hyperman_DESTROY) |
| 1306 |
|
| { |
| 1307 |
0 |
| dVAR; dXSARGS; |
| 1308 |
0 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
0 |
0 |
|
| 1309 |
0 |
| croak_xs_usage(cv, "self"); |
| 1310 |
|
| { |
| 1311 |
0 |
▶ | SV * self = ST(0) |
Branch: 1 branch
| Branch | True | False | Total |
| SV * self = ST(0) |
0 |
0 |
0 |
|
| 1312 |
|
| ; |
| 1313 |
|
| #line 151 "./xs/loop_hyperman.xs" |
| 1314 |
|
| { |
| 1315 |
|
| HV *h; |
| 1316 |
|
| SV **e; |
| 1317 |
|
| if (!(SvROK(self) && SvTYPE(SvRV(self)) == SVt_PVHV)) XSRETURN_EMPTY; |
| 1318 |
|
| h = (HV *)SvRV(self); |
| 1319 |
|
| e = hv_fetchs(h, "_ctx", 0); |
| 1320 |
|
| if (e && *e && SvIOK(*e)) { |
| 1321 |
|
| dbil_hm_ctx *c = INT2PTR(dbil_hm_ctx *, SvIV(*e)); |
| 1322 |
|
| /* drop any still-registered Perl-seam watchers so the loop never |
| 1323 |
|
| * fires into freed callbacks; skip during global destruction */ |
| 1324 |
|
| if (!PL_dirty) { |
| 1325 |
|
| int m; |
| 1326 |
|
| for (m = 0; m < 2; m++) { |
| 1327 |
|
| HV *cbs = dbil_hm_cbh(aTHX_ self, |
| 1328 |
|
| m ? HM_ABI_WRITE : HM_ABI_READ, 0); |
| 1329 |
|
| if (cbs) { |
| 1330 |
|
| HE *he; |
| 1331 |
|
| hv_iterinit(cbs); |
| 1332 |
|
| while ((he = hv_iternext(cbs))) { |
| 1333 |
|
| I32 kl; |
| 1334 |
|
| const char *k = hv_iterkey(he, &kl); |
| 1335 |
|
| c->A->io_unwatch(aTHX_ c->loop, atoi(k), |
| 1336 |
|
| m ? HM_ABI_WRITE : HM_ABI_READ); |
| 1337 |
|
| } |
| 1338 |
|
| } |
| 1339 |
|
| } |
| 1340 |
|
| } |
| 1341 |
|
| Safefree(c); |
| 1342 |
|
| (void)hv_delete(h, "_ctx", 4, G_DISCARD); |
| 1343 |
|
| (void)hv_delete(h, "_vt", 3, G_DISCARD); |
| 1344 |
|
| } |
| 1345 |
|
| } |
| 1346 |
|
| #line 1347 "Loop.c" |
| 1347 |
|
| } |
| 1348 |
0 |
| XSRETURN_EMPTY; |
| 1349 |
|
| } |
| 1350 |
|
| |
| 1351 |
|
| |
| 1352 |
|
| /* INCLUDE: Returning to 'Loop.xs' from 'xs/loop_hyperman.xs' */ |
| 1353 |
|
| |
| 1354 |
|
| |
| 1355 |
|
| /* INCLUDE: Including 'xs/abi.xs' from 'Loop.xs' */ |
| 1356 |
|
| |
| 1357 |
|
| |
| 1358 |
|
| XS_EUPXS(XS_DBIx__Loop__abi_ptr); /* prototype to pass -Wmissing-prototypes */ |
| 1359 |
2 |
| XS_EUPXS(XS_DBIx__Loop__abi_ptr) |
| 1360 |
|
| { |
| 1361 |
2 |
| dVAR; dXSARGS; |
| 1362 |
2 |
▶ | if (items != 0) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 0) |
0 |
2 |
2 |
|
| 1363 |
0 |
| croak_xs_usage(cv, ""); |
| 1364 |
|
| { |
| 1365 |
|
| IV RETVAL; |
| 1366 |
2 |
▶ | dXSTARG; |
Branch: 2 branches
| Branch | True | False | Total |
| dXSTARG; |
2 |
0 |
2 |
| dXSTARG; |
0 |
2 |
2 |
|
| 1367 |
|
| #line 11 "./xs/abi.xs" |
| 1368 |
|
| RETVAL = PTR2IV(&dbil_abi_table); |
| 1369 |
|
| #line 1370 "Loop.c" |
| 1370 |
2 |
▶ | TARGi((IV)RETVAL, 1); |
Branch: 1 branch
| Branch | True | False | Total |
| TARGi((IV)RETVAL, 1); |
0 |
2 |
2 |
|
| 1371 |
2 |
| ST(0) = TARG; |
| 1372 |
|
| } |
| 1373 |
2 |
| XSRETURN(1); |
| 1374 |
|
| } |
| 1375 |
|
| |
| 1376 |
|
| |
| 1377 |
|
| XS_EUPXS(XS_DBIx__Loop__abi_selftest); /* prototype to pass -Wmissing-prototypes */ |
| 1378 |
1 |
| XS_EUPXS(XS_DBIx__Loop__abi_selftest) |
| 1379 |
|
| { |
| 1380 |
1 |
| dVAR; dXSARGS; |
| 1381 |
1 |
▶ | if (items != 0) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 0) |
0 |
1 |
1 |
|
| 1382 |
0 |
| croak_xs_usage(cv, ""); |
| 1383 |
|
| { |
| 1384 |
|
| IV RETVAL; |
| 1385 |
1 |
▶ | dXSTARG; |
Branch: 1 branch
| Branch | True | False | Total |
| dXSTARG; |
1 |
0 |
1 |
|
| 1386 |
|
| #line 22 "./xs/abi.xs" |
| 1387 |
|
| RETVAL = dbil_abi_selftest(aTHX); |
| 1388 |
|
| #line 1389 "Loop.c" |
| 1389 |
1 |
▶ | TARGi((IV)RETVAL, 1); |
Branch: 1 branch
| Branch | True | False | Total |
| TARGi((IV)RETVAL, 1); |
0 |
1 |
1 |
|
| 1390 |
1 |
| ST(0) = TARG; |
| 1391 |
|
| } |
| 1392 |
1 |
| XSRETURN(1); |
| 1393 |
|
| } |
| 1394 |
|
| |
| 1395 |
|
| |
| 1396 |
|
| XS_EUPXS(XS_DBIx__Loop__abi_version); /* prototype to pass -Wmissing-prototypes */ |
| 1397 |
4 |
| XS_EUPXS(XS_DBIx__Loop__abi_version) |
| 1398 |
|
| { |
| 1399 |
4 |
| dVAR; dXSARGS; |
| 1400 |
4 |
▶ | if (items != 0) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 0) |
0 |
4 |
4 |
|
| 1401 |
0 |
| croak_xs_usage(cv, ""); |
| 1402 |
|
| { |
| 1403 |
|
| IV RETVAL; |
| 1404 |
4 |
▶ | dXSTARG; |
Branch: 2 branches
| Branch | True | False | Total |
| dXSTARG; |
4 |
0 |
4 |
| dXSTARG; |
0 |
4 |
4 |
|
| 1405 |
|
| #line 31 "./xs/abi.xs" |
| 1406 |
|
| RETVAL = dbil_abi_table.abi_version; |
| 1407 |
|
| #line 1408 "Loop.c" |
| 1408 |
4 |
▶ | TARGi((IV)RETVAL, 1); |
Branch: 1 branch
| Branch | True | False | Total |
| TARGi((IV)RETVAL, 1); |
0 |
4 |
4 |
|
| 1409 |
4 |
| ST(0) = TARG; |
| 1410 |
|
| } |
| 1411 |
4 |
| XSRETURN(1); |
| 1412 |
|
| } |
| 1413 |
|
| |
| 1414 |
|
| |
| 1415 |
|
| XS_EUPXS(XS_DBIx__Loop_on_exec); /* prototype to pass -Wmissing-prototypes */ |
| 1416 |
4 |
| XS_EUPXS(XS_DBIx__Loop_on_exec) |
| 1417 |
|
| { |
| 1418 |
4 |
| dVAR; dXSARGS; |
| 1419 |
4 |
▶ | if (items < 2 || items > 3) |
Branch: 2 branches
| Branch | True | False | Total |
| if (items < 2 || items > 3) |
4 |
0 |
4 |
| if (items < 2 || items > 3) |
0 |
4 |
4 |
|
| 1420 |
0 |
| croak_xs_usage(cv, "class, start, done = &PL_sv_undef"); |
| 1421 |
|
| { |
| 1422 |
4 |
| SV * class = ST(0) |
| 1423 |
|
| ; |
| 1424 |
4 |
| SV * start = ST(1) |
| 1425 |
|
| ; |
| 1426 |
|
| SV * done; |
| 1427 |
|
| IV RETVAL; |
| 1428 |
4 |
▶ | dXSTARG; |
Branch: 1 branch
| Branch | True | False | Total |
| dXSTARG; |
4 |
0 |
4 |
|
| 1429 |
|
| |
| 1430 |
4 |
▶ | if (items < 3) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items < 3) |
2 |
2 |
4 |
|
| 1431 |
2 |
| done = &PL_sv_undef; |
| 1432 |
|
| else { |
| 1433 |
2 |
| done = ST(2) |
| 1434 |
|
| ; |
| 1435 |
|
| } |
| 1436 |
|
| #line 46 "./xs/abi.xs" |
| 1437 |
|
| PERL_UNUSED_VAR(class); |
| 1438 |
|
| RETVAL = dbil_obs_add_perl(aTHX_ start, done); |
| 1439 |
|
| #line 1440 "Loop.c" |
| 1440 |
2 |
▶ | TARGi((IV)RETVAL, 1); |
Branch: 1 branch
| Branch | True | False | Total |
| TARGi((IV)RETVAL, 1); |
0 |
2 |
2 |
|
| 1441 |
2 |
| ST(0) = TARG; |
| 1442 |
|
| } |
| 1443 |
2 |
| XSRETURN(1); |
| 1444 |
|
| } |
| 1445 |
|
| |
| 1446 |
|
| |
| 1447 |
|
| XS_EUPXS(XS_DBIx__Loop__abi_observer_install); /* prototype to pass -Wmissing-prototypes */ |
| 1448 |
1 |
| XS_EUPXS(XS_DBIx__Loop__abi_observer_install) |
| 1449 |
|
| { |
| 1450 |
1 |
| dVAR; dXSARGS; |
| 1451 |
1 |
▶ | if (items != 0) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 0) |
0 |
1 |
1 |
|
| 1452 |
0 |
| croak_xs_usage(cv, ""); |
| 1453 |
|
| { |
| 1454 |
|
| IV RETVAL; |
| 1455 |
1 |
▶ | dXSTARG; |
Branch: 1 branch
| Branch | True | False | Total |
| dXSTARG; |
1 |
0 |
1 |
|
| 1456 |
|
| #line 56 "./xs/abi.xs" |
| 1457 |
|
| RETVAL = dbil_obs_selftest_install(aTHX); |
| 1458 |
|
| #line 1459 "Loop.c" |
| 1459 |
1 |
▶ | TARGi((IV)RETVAL, 1); |
Branch: 1 branch
| Branch | True | False | Total |
| TARGi((IV)RETVAL, 1); |
0 |
1 |
1 |
|
| 1460 |
1 |
| ST(0) = TARG; |
| 1461 |
|
| } |
| 1462 |
1 |
| XSRETURN(1); |
| 1463 |
|
| } |
| 1464 |
|
| |
| 1465 |
|
| |
| 1466 |
|
| XS_EUPXS(XS_DBIx__Loop__abi_observer_state); /* prototype to pass -Wmissing-prototypes */ |
| 1467 |
10 |
| XS_EUPXS(XS_DBIx__Loop__abi_observer_state) |
| 1468 |
|
| { |
| 1469 |
10 |
| dVAR; dXSARGS; |
| 1470 |
10 |
▶ | if (items != 0) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 0) |
0 |
10 |
10 |
|
| 1471 |
0 |
| croak_xs_usage(cv, ""); |
| 1472 |
|
| PERL_UNUSED_VAR(ax); /* -Wall */ |
| 1473 |
10 |
▶ | SP -= items; |
Branch: 1 branch
| Branch | True | False | Total |
| SP -= items; |
0 |
10 |
10 |
|
| 1474 |
|
| { |
| 1475 |
|
| #line 64 "./xs/abi.xs" |
| 1476 |
|
| EXTEND(SP, 7); |
| 1477 |
|
| mPUSHi(DBIL_OBS_ST_STARTS); |
| 1478 |
|
| mPUSHi(DBIL_OBS_ST_DONES); |
| 1479 |
|
| mPUSHi(DBIL_OBS_ST_OK); |
| 1480 |
|
| mPUSHi(DBIL_OBS_ST_ERR); |
| 1481 |
|
| mPUSHi(DBIL_OBS_ST_BIND); |
| 1482 |
|
| mPUSHi(DBIL_OBS_ST_QUERY); |
| 1483 |
|
| mPUSHp(DBIL_OBS_ST_SQL, strlen(DBIL_OBS_ST_SQL)); |
| 1484 |
|
| #line 1485 "Loop.c" |
| 1485 |
10 |
| PUTBACK; |
| 1486 |
10 |
| return; |
| 1487 |
|
| } |
| 1488 |
|
| } |
| 1489 |
|
| |
| 1490 |
|
| |
| 1491 |
|
| XS_EUPXS(XS_DBIx__Loop__abi_dbtest); /* prototype to pass -Wmissing-prototypes */ |
| 1492 |
1 |
| XS_EUPXS(XS_DBIx__Loop__abi_dbtest) |
| 1493 |
|
| { |
| 1494 |
1 |
| dVAR; dXSARGS; |
| 1495 |
1 |
▶ | if (items != 2) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 2) |
0 |
1 |
1 |
|
| 1496 |
0 |
| croak_xs_usage(cv, "adapter, dsn"); |
| 1497 |
|
| { |
| 1498 |
1 |
| SV * adapter = ST(0) |
| 1499 |
|
| ; |
| 1500 |
1 |
| SV * dsn = ST(1) |
| 1501 |
|
| ; |
| 1502 |
|
| IV RETVAL; |
| 1503 |
1 |
▶ | dXSTARG; |
Branch: 1 branch
| Branch | True | False | Total |
| dXSTARG; |
1 |
0 |
1 |
|
| 1504 |
|
| #line 81 "./xs/abi.xs" |
| 1505 |
|
| RETVAL = dbil_abi_dbtest(aTHX_ adapter, dsn); |
| 1506 |
|
| #line 1507 "Loop.c" |
| 1507 |
1 |
▶ | TARGi((IV)RETVAL, 1); |
Branch: 1 branch
| Branch | True | False | Total |
| TARGi((IV)RETVAL, 1); |
0 |
1 |
1 |
|
| 1508 |
1 |
| ST(0) = TARG; |
| 1509 |
|
| } |
| 1510 |
1 |
| XSRETURN(1); |
| 1511 |
|
| } |
| 1512 |
|
| |
| 1513 |
|
| |
| 1514 |
|
| /* INCLUDE: Returning to 'Loop.xs' from 'xs/abi.xs' */ |
| 1515 |
|
| |
| 1516 |
|
| #ifdef __cplusplus |
| 1517 |
|
| extern "C" { |
| 1518 |
|
| #endif |
| 1519 |
|
| XS_EXTERNAL(boot_DBIx__Loop); /* prototype to pass -Wmissing-prototypes */ |
| 1520 |
21 |
| XS_EXTERNAL(boot_DBIx__Loop) |
| 1521 |
|
| { |
| 1522 |
|
| #if PERL_VERSION_LE(5, 21, 5) |
| 1523 |
|
| dVAR; dXSARGS; |
| 1524 |
|
| #else |
| 1525 |
21 |
| dVAR; dXSBOOTARGSXSAPIVERCHK; |
| 1526 |
|
| #endif |
| 1527 |
|
| #if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */ |
| 1528 |
|
| char* file = __FILE__; |
| 1529 |
|
| #else |
| 1530 |
21 |
| const char* file = __FILE__; |
| 1531 |
|
| #endif |
| 1532 |
|
| |
| 1533 |
|
| PERL_UNUSED_VAR(file); |
| 1534 |
|
| |
| 1535 |
|
| PERL_UNUSED_VAR(cv); /* -W */ |
| 1536 |
|
| PERL_UNUSED_VAR(items); /* -W */ |
| 1537 |
|
| #if PERL_VERSION_LE(5, 21, 5) |
| 1538 |
|
| XS_VERSION_BOOTCHECK; |
| 1539 |
|
| # ifdef XS_APIVERSION_BOOTCHECK |
| 1540 |
|
| XS_APIVERSION_BOOTCHECK; |
| 1541 |
|
| # endif |
| 1542 |
|
| #endif |
| 1543 |
|
| |
| 1544 |
|
| { |
| 1545 |
|
| CV * cv; |
| 1546 |
|
| |
| 1547 |
21 |
| newXS_deffile("DBIx::Loop::_capability", XS_DBIx__Loop__capability); |
| 1548 |
21 |
| newXS_deffile("DBIx::Loop::new", XS_DBIx__Loop_new); |
| 1549 |
21 |
| newXS_deffile("DBIx::Loop::query", XS_DBIx__Loop_query); |
| 1550 |
21 |
| newXS_deffile("DBIx::Loop::do", XS_DBIx__Loop_do); |
| 1551 |
21 |
| cv = newXS_deffile("DBIx::Loop::selectall_arrayref", XS_DBIx__Loop_selectall_arrayref); |
| 1552 |
21 |
| XSANY.any_i32 = 1; |
| 1553 |
21 |
| cv = newXS_deffile("DBIx::Loop::selectall_hashref", XS_DBIx__Loop_selectall_arrayref); |
| 1554 |
21 |
| XSANY.any_i32 = 6; |
| 1555 |
21 |
| cv = newXS_deffile("DBIx::Loop::selectall_rowhash", XS_DBIx__Loop_selectall_arrayref); |
| 1556 |
21 |
| XSANY.any_i32 = 7; |
| 1557 |
21 |
| cv = newXS_deffile("DBIx::Loop::selectcol_arrayref", XS_DBIx__Loop_selectall_arrayref); |
| 1558 |
21 |
| XSANY.any_i32 = 5; |
| 1559 |
21 |
| cv = newXS_deffile("DBIx::Loop::selectrow_array", XS_DBIx__Loop_selectall_arrayref); |
| 1560 |
21 |
| XSANY.any_i32 = 3; |
| 1561 |
21 |
| cv = newXS_deffile("DBIx::Loop::selectrow_arrayref", XS_DBIx__Loop_selectall_arrayref); |
| 1562 |
21 |
| XSANY.any_i32 = 2; |
| 1563 |
21 |
| cv = newXS_deffile("DBIx::Loop::selectrow_hashref", XS_DBIx__Loop_selectall_arrayref); |
| 1564 |
21 |
| XSANY.any_i32 = 4; |
| 1565 |
21 |
| newXS_deffile("DBIx::Loop::capability", XS_DBIx__Loop_capability); |
| 1566 |
21 |
| newXS_deffile("DBIx::Loop::loop", XS_DBIx__Loop_loop); |
| 1567 |
21 |
| newXS_deffile("DBIx::Loop::dbh", XS_DBIx__Loop_dbh); |
| 1568 |
21 |
| newXS_deffile("DBIx::Loop::disconnect", XS_DBIx__Loop_disconnect); |
| 1569 |
21 |
| newXS_deffile("DBIx::Loop::txn", XS_DBIx__Loop_txn); |
| 1570 |
21 |
| newXS_deffile("DBIx::Loop::_worker_pids", XS_DBIx__Loop__worker_pids); |
| 1571 |
21 |
| newXS_deffile("DBIx::Loop::DESTROY", XS_DBIx__Loop_DESTROY); |
| 1572 |
21 |
| newXS_deffile("DBIx::Loop::Future::new", XS_DBIx__Loop__Future_new); |
| 1573 |
21 |
| newXS_deffile("DBIx::Loop::Future::AWAIT_NEW_DONE", XS_DBIx__Loop__Future_AWAIT_NEW_DONE); |
| 1574 |
21 |
| newXS_deffile("DBIx::Loop::Future::AWAIT_NEW_FAIL", XS_DBIx__Loop__Future_AWAIT_NEW_FAIL); |
| 1575 |
21 |
| newXS_deffile("DBIx::Loop::Future::AWAIT_CLONE", XS_DBIx__Loop__Future_AWAIT_CLONE); |
| 1576 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::AWAIT_DONE", XS_DBIx__Loop__Future_done); |
| 1577 |
21 |
| XSANY.any_i32 = 1; |
| 1578 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::done", XS_DBIx__Loop__Future_done); |
| 1579 |
21 |
| XSANY.any_i32 = 0; |
| 1580 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::AWAIT_FAIL", XS_DBIx__Loop__Future_fail); |
| 1581 |
21 |
| XSANY.any_i32 = 1; |
| 1582 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::fail", XS_DBIx__Loop__Future_fail); |
| 1583 |
21 |
| XSANY.any_i32 = 0; |
| 1584 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::AWAIT_ON_READY", XS_DBIx__Loop__Future_on_ready); |
| 1585 |
21 |
| XSANY.any_i32 = 1; |
| 1586 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::on_ready", XS_DBIx__Loop__Future_on_ready); |
| 1587 |
21 |
| XSANY.any_i32 = 0; |
| 1588 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::else", XS_DBIx__Loop__Future_then); |
| 1589 |
21 |
| XSANY.any_i32 = 1; |
| 1590 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::then", XS_DBIx__Loop__Future_then); |
| 1591 |
21 |
| XSANY.any_i32 = 0; |
| 1592 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::AWAIT_IS_READY", XS_DBIx__Loop__Future_is_ready); |
| 1593 |
21 |
| XSANY.any_i32 = 1; |
| 1594 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::is_ready", XS_DBIx__Loop__Future_is_ready); |
| 1595 |
21 |
| XSANY.any_i32 = 0; |
| 1596 |
21 |
| newXS_deffile("DBIx::Loop::Future::is_done", XS_DBIx__Loop__Future_is_done); |
| 1597 |
21 |
| newXS_deffile("DBIx::Loop::Future::is_failed", XS_DBIx__Loop__Future_is_failed); |
| 1598 |
21 |
| newXS_deffile("DBIx::Loop::Future::AWAIT_IS_CANCELLED", XS_DBIx__Loop__Future_AWAIT_IS_CANCELLED); |
| 1599 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::AWAIT_CHAIN_CANCEL", XS_DBIx__Loop__Future_AWAIT_ON_CANCEL); |
| 1600 |
21 |
| XSANY.any_i32 = 1; |
| 1601 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::AWAIT_ON_CANCEL", XS_DBIx__Loop__Future_AWAIT_ON_CANCEL); |
| 1602 |
21 |
| XSANY.any_i32 = 0; |
| 1603 |
21 |
| newXS_deffile("DBIx::Loop::Future::failure", XS_DBIx__Loop__Future_failure); |
| 1604 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::AWAIT_GET", XS_DBIx__Loop__Future_get); |
| 1605 |
21 |
| XSANY.any_i32 = 1; |
| 1606 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::AWAIT_WAIT", XS_DBIx__Loop__Future_get); |
| 1607 |
21 |
| XSANY.any_i32 = 2; |
| 1608 |
21 |
| cv = newXS_deffile("DBIx::Loop::Future::get", XS_DBIx__Loop__Future_get); |
| 1609 |
21 |
| XSANY.any_i32 = 0; |
| 1610 |
21 |
| newXS_deffile("DBIx::Loop::Txn::query", XS_DBIx__Loop__Txn_query); |
| 1611 |
21 |
| newXS_deffile("DBIx::Loop::Txn::do", XS_DBIx__Loop__Txn_do); |
| 1612 |
21 |
| newXS_deffile("DBIx::Loop::Txn::is_active", XS_DBIx__Loop__Txn_is_active); |
| 1613 |
21 |
| newXS_deffile("DBIx::Loop::Loop::Hyperman::new", XS_DBIx__Loop__Loop__Hyperman_new); |
| 1614 |
21 |
| newXS_deffile("DBIx::Loop::Loop::Hyperman::loop", XS_DBIx__Loop__Loop__Hyperman_loop); |
| 1615 |
21 |
| cv = newXS_deffile("DBIx::Loop::Loop::Hyperman::add_reader", XS_DBIx__Loop__Loop__Hyperman_add_reader); |
| 1616 |
21 |
| XSANY.any_i32 = 0; |
| 1617 |
21 |
| cv = newXS_deffile("DBIx::Loop::Loop::Hyperman::add_writer", XS_DBIx__Loop__Loop__Hyperman_add_reader); |
| 1618 |
21 |
| XSANY.any_i32 = 1; |
| 1619 |
21 |
| newXS_deffile("DBIx::Loop::Loop::Hyperman::remove", XS_DBIx__Loop__Loop__Hyperman_remove); |
| 1620 |
21 |
| newXS_deffile("DBIx::Loop::Loop::Hyperman::timer", XS_DBIx__Loop__Loop__Hyperman_timer); |
| 1621 |
21 |
| newXS_deffile("DBIx::Loop::Loop::Hyperman::cancel_timer", XS_DBIx__Loop__Loop__Hyperman_cancel_timer); |
| 1622 |
21 |
| newXS_deffile("DBIx::Loop::Loop::Hyperman::new_future", XS_DBIx__Loop__Loop__Hyperman_new_future); |
| 1623 |
21 |
| newXS_deffile("DBIx::Loop::Loop::Hyperman::await", XS_DBIx__Loop__Loop__Hyperman_await); |
| 1624 |
21 |
| newXS_deffile("DBIx::Loop::Loop::Hyperman::DESTROY", XS_DBIx__Loop__Loop__Hyperman_DESTROY); |
| 1625 |
21 |
| newXS_deffile("DBIx::Loop::_abi_ptr", XS_DBIx__Loop__abi_ptr); |
| 1626 |
21 |
| newXS_deffile("DBIx::Loop::_abi_selftest", XS_DBIx__Loop__abi_selftest); |
| 1627 |
21 |
| newXS_deffile("DBIx::Loop::_abi_version", XS_DBIx__Loop__abi_version); |
| 1628 |
21 |
| newXS_deffile("DBIx::Loop::on_exec", XS_DBIx__Loop_on_exec); |
| 1629 |
21 |
| newXS_deffile("DBIx::Loop::_abi_observer_install", XS_DBIx__Loop__abi_observer_install); |
| 1630 |
21 |
| newXS_deffile("DBIx::Loop::_abi_observer_state", XS_DBIx__Loop__abi_observer_state); |
| 1631 |
21 |
| newXS_deffile("DBIx::Loop::_abi_dbtest", XS_DBIx__Loop__abi_dbtest); |
| 1632 |
|
| } |
| 1633 |
|
| #if PERL_VERSION_LE(5, 21, 5) |
| 1634 |
|
| # if PERL_VERSION_GE(5, 9, 0) |
| 1635 |
|
| if (PL_unitcheckav) |
| 1636 |
|
| call_list(PL_scopestack_ix, PL_unitcheckav); |
| 1637 |
|
| # endif |
| 1638 |
|
| XSRETURN_YES; |
| 1639 |
|
| #else |
| 1640 |
21 |
| Perl_xs_boot_epilog(aTHX_ ax); |
| 1641 |
|
| #endif |
| 1642 |
21 |
| } |
| 1643 |
|
| |
| 1644 |
|
| #ifdef __cplusplus |
| 1645 |
|
| } |
| 1646 |
|
| #endif |