*
* -----------------------------------------------------------------------
*/
+#include <php.h>
+#include "php_orbit.h"
+
#include "class.h"
#include "corba.h"
#include "common.h"
/* check parameter count */
if (parameterCount != 1)
{
- wrong_param_count();
+ zend_wrong_param_count(TSRMLS_C);
goto error;
}
/* 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;
}
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();
+}
+
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)