cvs: php4 /ext/satellite object.c php_orbit.c php_orbit.h
| From: | David Eriksson | Date: | Thu, 09 Aug 2001 21:55:09 +0000 |
| Subject: | cvs: php4 /ext/satellite object.c php_orbit.c php_orbit.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6679@lists.php.net to get a copy of this message | ||
eriksson Thu Aug 9 17:55:09 2001 EDT
Modified files:
/php4/ext/satellite object.c php_orbit.c php_orbit.h
Log:
(PHP satellite_object_to_string) Added function to get IOR of object.
Index: php4/ext/satellite/object.c
diff -u php4/ext/satellite/object.c:1.6 php4/ext/satellite/object.c:1.7
--- php4/ext/satellite/object.c:1.6 Mon Feb 26 01:07:15 2001
+++ php4/ext/satellite/object.c Thu Aug 9 17:55:09 2001
@@ -17,7 +17,7 @@
*/
/*
- * $Id: object.c,v 1.6 2001/02/26 06:07:15 andi Exp $
+ * $Id: object.c,v 1.7 2001/08/09 21:55:09 eriksson Exp $
* vim: syntax=c tabstop=2 shiftwidth=2
*/
@@ -33,6 +33,9 @@
*
* -----------------------------------------------------------------------
*/
+#include <php.h>
+#include "php_orbit.h"
+
#include "class.h"
#include "corba.h"
#include "common.h"
@@ -282,7 +285,7 @@
/* check parameter count */
if (parameterCount != 1)
{
- wrong_param_count();
+ zend_wrong_param_count(TSRMLS_C);
goto error;
}
@@ -421,7 +424,7 @@
/* printf("%i, %i, %i\n", i, argumentCount, ParameterType_IsValid(p_parameter));*/
/* bad number of arguments */
- wrong_param_count();
+ zend_wrong_param_count(TSRMLS_C);
goto error;
}
@@ -861,5 +864,45 @@
satellite_release_namedvalue(p_result);
return success;
+}
+
+PHP_FUNCTION(satellite_object_to_string)
+{
+ zval **arg = NULL;
+ char * p_ior = NULL;
+ OrbitObject * p_object = NULL;
+
+ if (zend_get_parameters_ex(1, &arg) != SUCCESS)
+ {
+ zend_error(E_WARNING, "(Satellite) Bad parameter count");
+ goto error;
+ }
+
+ p_object = OrbitObject_RetrieveData(*arg);
+ if (!p_object)
+ {
+ zend_error(E_WARNING, "(Satellite) Object has no data");
+ goto error;
+ }
+
+ if (!p_object->mCorbaObject)
+ {
+ zend_error(E_WARNING, "(Satellite) Object has no CORBA object");
+ goto error;
+ }
+
+ p_ior = CORBA_ORB_object_to_string(orbit_get_orb(), p_object->mCorbaObject,
+ orbit_get_environment());
+
+ if (!p_ior /*|| orbit_caught_exception()*/)
+ {
+ zend_error(E_WARNING, "(Satellite) CORBA call failed");
+ goto error;
+ }
+
+ RETURN_STRING(p_ior, TRUE);
+
+error:
+ RETURN_NULL();
}
Index: php4/ext/satellite/php_orbit.c
diff -u php4/ext/satellite/php_orbit.c:1.7 php4/ext/satellite/php_orbit.c:1.8
--- php4/ext/satellite/php_orbit.c:1.7 Mon Jul 30 02:18:02 2001
+++ php4/ext/satellite/php_orbit.c Thu Aug 9 17:55:09 2001
@@ -17,7 +17,7 @@
*/
/*
- * $Id: php_orbit.c,v 1.7 2001/07/30 06:18:02 zeev Exp $
+ * $Id: php_orbit.c,v 1.8 2001/08/09 21:55:09 eriksson Exp $
* vim: syntax=c tabstop=2 shiftwidth=2
*/
@@ -64,6 +64,7 @@
PHP_FE(satellite_caught_exception, NULL)
PHP_FE(satellite_exception_id, NULL)
PHP_FE(satellite_exception_value, NULL)
+ PHP_FE(satellite_object_to_string, NULL)
/* support the old prefix orbit_ */
PHP_FALIAS(orbit_load_idl, satellite_load_idl, NULL)
Index: php4/ext/satellite/php_orbit.h
diff -u php4/ext/satellite/php_orbit.h:1.4 php4/ext/satellite/php_orbit.h:1.5
--- php4/ext/satellite/php_orbit.h:1.4 Sun Jul 29 21:56:36 2001
+++ php4/ext/satellite/php_orbit.h Thu Aug 9 17:55:09 2001
@@ -17,7 +17,7 @@
*/
/*
- * $Id: php_orbit.h,v 1.4 2001/07/30 01:56:36 zeev Exp $
+ * $Id: php_orbit.h,v 1.5 2001/08/09 21:55:09 eriksson Exp $
* vim: syntax=c tabstop=2 shiftwidth=2
*/
@@ -33,6 +33,7 @@
PHP_FUNCTION(satellite_load_idl);
PHP_FUNCTION(satellite_get_repository_id);
+PHP_FUNCTION(satellite_object_to_string);
/* exception handling */
PHP_FUNCTION(satellite_caught_exception);