Lines Matching defs:stash

97 Perl_gv_init(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, int multi)
120 GvSTASH(gv) = (HV*)SvREFCNT_inc(stash);
171 C<NULL>. The glob lives in the given C<stash>, or in the stashes
175 side-effect creates a glob with the given C<name> in the given C<stash>
179 This function grants C<"SUPER"> token as a postfix of the stash name. The
189 Perl_gv_fetchmeth(pTHX_ HV *stash, const char *name, STRLEN len, I32 level)
197 /* UNIVERSAL methods should be callable without a stash */
198 if (!stash) {
200 if(!(stash = gv_stashpvn("UNIVERSAL", 9, FALSE)))
206 name, HvNAME(stash));
208 DEBUG_o( Perl_deb(aTHX_ "Looking for method %s in package %s\n",name,HvNAME(stash)) );
210 gvp = (GV**)hv_fetch(stash, name, len, (level >= 0));
216 gv_init(topgv, stash, name, len, TRUE);
230 gvp = (GV**)hv_fetch(stash, "ISA", 3, FALSE);
235 char* packname = HvNAME(stash);
245 gvp = (GV**)hv_fetch(stash, "ISA", 3, TRUE);
247 Perl_croak(aTHX_ "Cannot create %s::ISA", HvNAME(stash));
249 gv_init(gv, stash, "ISA", 3, TRUE);
266 sv, HvNAME(stash));
327 Perl_gv_fetchmeth_autoload(pTHX_ HV *stash, const char *name, STRLEN len, I32 level)
329 GV *gv = gv_fetchmeth(stash, name, len, level);
337 if (!stash)
341 if (!(gv = gv_fetchmeth(stash, autoload, autolen, FALSE)))
348 gv_fetchmeth(stash, name, len, 0);
349 gvp = (GV**)hv_fetch(stash, name, len, (level >= 0));
366 Perl_gv_fetchmethod(pTHX_ HV *stash, const char *name)
368 return gv_fetchmethod_autoload(stash, name, TRUE);
375 on the C<stash>. In fact in the presence of autoloading this may be the
400 Perl_gv_fetchmethod_autoload(pTHX_ HV *stash, const char *name, I32 autoload)
405 HV* ostash = stash;
407 if (stash && SvTYPE(stash) < SVt_PVHV)
408 stash = Nullhv;
422 /* ->SUPER::method should really be looked up in original stash */
425 /* __PACKAGE__::SUPER stash should be autovivified */
426 stash = gv_stashpvn(SvPVX(tmpstr), SvCUR(tmpstr), TRUE);
428 origname, HvNAME(stash), name) );
432 stash = gv_stashpvn(origname, nsplit - origname, FALSE);
436 if (!stash && (nsplit - origname) >= 7 &&
439 stash = gv_stashpvn(origname, nsplit - origname, TRUE);
441 ostash = stash;
444 gv = gv_fetchmeth(stash, name, nend - name, 0);
475 Perl_gv_autoload4(pTHX_ HV *stash, const char *name, STRLEN len, I32 method)
488 if (stash) {
489 if (SvTYPE(stash) < SVt_PVHV) {
490 packname = SvPV_nolen((SV*)stash);
491 stash = Nullhv;
494 packname = HvNAME(stash);
497 if (!(gv = gv_fetchmeth(stash, autoload, autolen, FALSE)))
508 (GvCVGEN(gv) || GvSTASH(gv) != stash))
520 CvSTASH(cv) = stash;
560 HV* stash = gv_stashpvn("Errno",5,FALSE);
562 if (!stash || !(gv_fetchmethod(stash, "TIEHASH"))) {
571 stash = gv_stashpvn("Errno",5,FALSE);
572 if (!stash || !(gv_fetchmethod(stash, "TIEHASH")))
580 Returns a pointer to the stash for a specified package. C<name> should
599 HV *stash;
617 stash = GvHV(tmpgv);
618 if (!HvNAME(stash))
619 HvNAME(stash) = savepv(name);
620 return stash;
626 Returns a pointer to the stash for a specified package, which must be a
650 HV *stash = 0;
659 if (!stash)
660 stash = PL_defstash;
661 if (!stash || !SvREFCNT(stash)) /* symbol table under destruction */
677 gvp = (GV**)hv_fetch(stash,tmpbuf,len,add);
681 gv_init(gv, stash, tmpbuf, len, (add & GV_ADDMULTI));
690 if (!(stash = GvHV(gv)))
691 stash = GvHV(gv) = newHV();
693 if (!HvNAME(stash))
694 HvNAME(stash) = savepvn(nambeg, namend - nambeg);
707 /* No stash in name, so see how we can default */
709 if (!stash) {
733 stash = PL_defstash;
735 stash = PL_curstash;
743 gvp = (GV**)hv_fetch(stash,name,len,0);
748 stash = 0;
760 stash = 0;
765 stash = CopSTASH(PL_curcop);
768 stash = PL_defstash;
771 /* By this point we should have a stash and a name */
773 if (!stash) {
784 stash = PL_nullstash;
790 if (!SvREFCNT(stash)) /* symbol table under destruction */
793 gvp = (GV**)hv_fetch(stash,name,len,add);
813 gv_init(gv, stash, name, len, add & GV_ADDMULTI);
1155 Perl_gv_check(pTHX_ HV *stash)
1162 if (!HvARRAY(stash))
1164 for (i = 0; i <= (I32) HvMAX(stash); i++) {
1165 for (entry = HvARRAY(stash)[i]; entry; entry = HeNEXT(entry)) {
1169 if (hv != PL_defstash && hv != stash)
1199 HvNAME(stash), GvNAME(gv));
1295 Perl_Gv_AMupdate(pTHX_ HV *stash)
1299 MAGIC* mg=mg_find((SV*)stash, PERL_MAGIC_overload_table);
1306 sv_unmagic((SV*)stash, PERL_MAGIC_overload_table);
1308 DEBUG_o( Perl_deb(aTHX_ "Recalcing overload magic in package %s\n",HvNAME(stash)) );
1324 gv = gv_fetchmeth(stash, PL_AMG_names[0], 2, -1);
1344 cp, HvNAME(stash)) );
1353 gv = Perl_gv_fetchmeth_autoload(aTHX_ stash, cooky, l, 0);
1355 gv = Perl_gv_fetchmeth(aTHX_ stash, cooky, l, -1);
1367 GvSV(gv), cp, HvNAME(stash)) );
1369 || !(ngv = gv_fetchmethod_autoload(stash, SvPVX(GvSV(gv)),
1379 name, cp, HvNAME(stash));
1384 cp, HvNAME(stash), HvNAME(GvSTASH(CvGV(cv))),
1399 sv_magic((SV*)stash, 0, PERL_MAGIC_overload_table,
1407 sv_magic((SV*)stash, 0, PERL_MAGIC_overload_table,
1414 Perl_gv_handler(pTHX_ HV *stash, I32 id)
1420 if (!stash)
1422 mg = mg_find((SV*)stash, PERL_MAGIC_overload_table);
1425 Gv_AMupdate(stash);
1426 mg = mg_find((SV*)stash, PERL_MAGIC_overload_table);
1439 GV *gv = gv_fetchmethod(stash, (char*)PL_AMG_names[id]);
1463 HV* stash=NULL;
1465 && (stash = SvSTASH(SvRV(left)))
1466 && (mg = mg_find((SV*)stash, PERL_MAGIC_overload_table))
1583 && (stash = SvSTASH(SvRV(right)))
1584 && (mg = mg_find((SV*)stash, PERL_MAGIC_overload_table))
1683 stash ? HvNAME(stash) : "null",