diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-01-10 10:12:10 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-01-10 11:19:18 +0000 |
commit | d8ef1fcdce21e8d5905a1ed77bc1caa307b2b79e (patch) | |
tree | b4cbfb1d1239da334e10e1deee3c3fa1d0fe4aba /pp_sys.c | |
parent | 111d382d531b38ae57c1b946e9ab48608cf58309 (diff) | |
download | perl-d8ef1fcdce21e8d5905a1ed77bc1caa307b2b79e.tar.gz |
Merge the implementations of pp_e{host,net,proto,serv}ent.
PL_op_desc[] rather than PL_op_name(), as the OPs are internally named e*ent,
but implement the ent*ent functions, and when unimplemented report themselves
using the function name. No need for OP_DESC(), as the switch statement means
that we can't encounter OP_CUSTOM.
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 53 |
1 files changed, 21 insertions, 32 deletions
@@ -5029,50 +5029,39 @@ PP(pp_sservent) PP(pp_ehostent) { -#ifdef HAS_ENDHOSTENT dVAR; dSP; - PerlSock_endhostent(); - EXTEND(SP,1); - RETPUSHYES; + switch(PL_op->op_type) { + case OP_EHOSTENT: +#ifdef HAS_ENDHOSTENT + PerlSock_endhostent(); #else - DIE(aTHX_ PL_no_sock_func, "endhostent"); + DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]); #endif -} - -PP(pp_enetent) -{ + break; + case OP_ENETENT: #ifdef HAS_ENDNETENT - dVAR; dSP; - PerlSock_endnetent(); - EXTEND(SP,1); - RETPUSHYES; + PerlSock_endnetent(); #else - DIE(aTHX_ PL_no_sock_func, "endnetent"); + DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]); #endif -} - -PP(pp_eprotoent) -{ + break; + case OP_EPROTOENT: #ifdef HAS_ENDPROTOENT - dVAR; dSP; - PerlSock_endprotoent(); - EXTEND(SP,1); - RETPUSHYES; + PerlSock_endprotoent(); #else - DIE(aTHX_ PL_no_sock_func, "endprotoent"); + DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]); #endif -} - -PP(pp_eservent) -{ + break; + case OP_ESERVENT: #ifdef HAS_ENDSERVENT - dVAR; dSP; - PerlSock_endservent(); - EXTEND(SP,1); - RETPUSHYES; + PerlSock_endservent(); #else - DIE(aTHX_ PL_no_sock_func, "endservent"); + DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]); #endif + break; + } + EXTEND(SP,1); + RETPUSHYES; } PP(pp_gpwent) |