summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-01-10 10:12:10 +0000
committerNicholas Clark <nick@ccl4.org>2011-01-10 11:19:18 +0000
commitd8ef1fcdce21e8d5905a1ed77bc1caa307b2b79e (patch)
treeb4cbfb1d1239da334e10e1deee3c3fa1d0fe4aba /pp_sys.c
parent111d382d531b38ae57c1b946e9ab48608cf58309 (diff)
downloadperl-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.c53
1 files changed, 21 insertions, 32 deletions
diff --git a/pp_sys.c b/pp_sys.c
index f8c50d6615..7359f95c48 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -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)