[svn:PHP-Sandwich] rev 1405 - in PHP-Sandwich/trunk: . PHP
[email protected] 15 Jul 2005 04:54:29 -0000
| Newsgroups | perl.php.sandwich.dev |
|---|---|
| Message-ID | <[email protected]> |
Author: gschlossnagle
Date: Thu Jul 14 21:54:29 2005
New Revision: 1405
Modified:
PHP-Sandwich/trunk/PHP.xs
PHP-Sandwich/trunk/PHP/Interpreter.pm
PHP-Sandwich/trunk/phpfuncs.c
PHP-Sandwich/trunk/phpinterp.h
Log:
cleanup
Modified: PHP-Sandwich/trunk/PHP.xs
==============================================================================
--- PHP-Sandwich/trunk/PHP.xs (original)
+++ PHP-Sandwich/trunk/PHP.xs Thu Jul 14 21:54:29 2005
@@ -137,7 +137,6 @@ zval *SvZval(SV *sv TSRMLS_DC)
}
break;
case SVt_PVCV: /* code */
- fprintf(stderr, "SVt_PVCV\n");
break;
case SVt_PVGV: /* glob */
/* use orig_sv here to avoid losing your bless */
@@ -153,12 +152,24 @@ zval *SvZval(SV *sv TSRMLS_DC)
plsv_wrap_sv(retval, orig_sv TSRMLS_CC);
}
} else {
- fprintf(stderr, "[%s:%d] can I be here?\n", __FILE__, __LINE__);
+ if(SvPOK(sv)) {
+ STRLEN strlen;
+ char *str = SvPV(sv, strlen);
+ ZVAL_STRINGL(retval, str, strlen, 1);
+ }
+ else if(SvNOK(sv)) {
+ ZVAL_DOUBLE(retval, SvNV(sv));
+ } else if(SvIOK(sv)) {
+ ZVAL_LONG(retval, SvIV(sv));
+ } else {
+ plsv_wrap_sv(retval, orig_sv TSRMLS_CC);
+ }
+ /*
plsv_wrap_sv(retval, orig_sv TSRMLS_CC);
+ */
}
break;
case SVt_PVLV:
- fprintf(stderr, "SVt_PVLV\n");
break;
default:
ZVAL_NULL(retval);
@@ -299,12 +310,10 @@ SV *newSVzval(zval *zptr, PHP_Interprete
retval = newSVpv(Z_STRVAL_P(zptr), Z_STRLEN_P(zptr));
break;
case IS_CONSTANT_ARRAY:
- fprintf(stderr, "Unimplemented type: IS_CONSTANT_ARRAY\n");
/* FIXME: return by copy, not by reference */
retval = &PL_sv_undef;
break;
default:
- fprintf(stderr, "Unknown type %d in newSVzval()\n", zptr->type);
{ char *ptr = NULL; *ptr = 1; }
retval = &PL_sv_undef;
break;
@@ -515,8 +524,6 @@ SV *SAND_include(interp, file)
char *file;
CODE:
{
- sv_dump(SvRV(ST(0)));
- fprintf(stderr, "calling include(%s)\n", file);
if(sandwich_include(interp, file) == 0) {
RETVAL = newSVsv(ST(0));
}
@@ -570,8 +577,6 @@ void SAND_DESTROY(interp)
PHP_Interpreter interp;
CODE:
{
- sv_dump(ST(0));
- sv_dump(SvRV(ST(0)));
sandwich_interp_dec_ref(interp);
}
@@ -1110,7 +1115,6 @@ void PHP_V_R_STORE(zptr, new)
SV *new;
CODE:
{
- sv_dump(new);
}
void PHP_V_R_DESTROY(prsrc)
Modified: PHP-Sandwich/trunk/PHP/Interpreter.pm
==============================================================================
--- PHP-Sandwich/trunk/PHP/Interpreter.pm (original)
+++ PHP-Sandwich/trunk/PHP/Interpreter.pm Thu Jul 14 21:54:29 2005
@@ -1,11 +1,8 @@
package PHP::Interpreter;
-#use AutoLoader;
-
use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
-#@ISA = qw(AutoLoader);
sub AUTOLOAD {
my $sub = $AUTOLOAD;
Modified: PHP-Sandwich/trunk/phpfuncs.c
==============================================================================
--- PHP-Sandwich/trunk/phpfuncs.c (original)
+++ PHP-Sandwich/trunk/phpfuncs.c Thu Jul 14 21:54:29 2005
@@ -354,7 +354,6 @@ PHP_METHOD(perl, eval)
aTHX = pl->perl;
#endif
if((rv = sandwich_perl_eval(aTHX_ func)) == NULL) {
- fprintf(stderr, "eval returned null\n");
} else {
zval *retval = SvZval(rv TSRMLS_CC);
RETURN_ZVAL(retval, 1, 0);
@@ -621,9 +620,7 @@ PHP_METHOD(perlsv, __tostring)
#ifdef USE_ITHREADS
aTHX = pl->perl;
#endif
- fprintf(stderr, "looking at plsv: %p\n", pl->sv);
string = SvPV(pl->sv, stringlen);
- fprintf(stderr, "string: %s\n", string);
RETURN_STRINGL(string, stringlen, 1);
}
@@ -935,7 +932,6 @@ void plsv_wrap_sv(zval *retval, SV *sv T
pl = (struct plsv *) zend_object_store_get_object(retval TSRMLS_CC);
SvREFCNT_inc(sv);
pl->sv = sv;
- fprintf(stderr, "stashing %p\n", sv);
}
Modified: PHP-Sandwich/trunk/phpinterp.h
==============================================================================
--- PHP-Sandwich/trunk/phpinterp.h (original)
+++ PHP-Sandwich/trunk/phpinterp.h Thu Jul 14 21:54:29 2005
@@ -36,8 +36,8 @@ int sandwich_include(sandwich_per_interp
/* NOTE: caller must tsrm_set_interpreter_context and reset the old one */
zval *sandwich_call_function(sandwich_per_interp *interp, zval *method, zval **params, zend_uint param_count);
-#define sandwich_interp_inc_ref(interp) fprintf(stderr, "inc [%s:%d] refcnt = %d\n", __FILE__, __LINE__, interp->ref+1); interp->ref++
-#define sandwich_interp_dec_ref(interp) fprintf(stderr, "dec [%s:%d] refcnt = %d\n", __FILE__, __LINE__, interp->ref-1);if(--interp->ref == 0) sandwich_per_interp_shutdown(interp)
+#define sandwich_interp_inc_ref(interp) interp->ref++
+#define sandwich_interp_dec_ref(interp) if(--interp->ref == 0) sandwich_per_interp_shutdown(interp)
zval *SvZval(SV *sv TSRMLS_DC);
SV *newSVzval(zval *param, sandwich_per_interp *interp);