[PHP-CVS] cvs: php4 /ext/satellite namedvalue_to_zval.c typecode.c

2001-01-29 Thread David Eriksson

erikssonMon Jan 29 22:43:36 2001 EDT

  Modified files:  
/php4/ext/satellite namedvalue_to_zval.c typecode.c 
  Log:
  Applied patch from Oleg Sharoiko <[EMAIL PROTECTED]> to fix bug in 
satellite_any_to_zval_sequence
  
  
Index: php4/ext/satellite/namedvalue_to_zval.c
diff -u php4/ext/satellite/namedvalue_to_zval.c:1.2 
php4/ext/satellite/namedvalue_to_zval.c:1.3
--- php4/ext/satellite/namedvalue_to_zval.c:1.2 Fri Sep  1 15:29:00 2000
+++ php4/ext/satellite/namedvalue_to_zval.c Mon Jan 29 22:43:35 2001
@@ -17,7 +17,7 @@
  */
 
 /*
- * $Id: namedvalue_to_zval.c,v 1.2 2000/09/01 22:29:00 eriksson Exp $
+ * $Id: namedvalue_to_zval.c,v 1.3 2001/01/30 06:43:35 eriksson Exp $
  * vim: syntax=c tabstop=2 shiftwidth=2
  */
 
@@ -83,7 +83,7 @@
const CORBA_any * pSource, zval * pDestination)
 {
int i;
-   int length = 0;
+   int length = 0, step;
void ** pp_members = NULL;
zend_bool success = FALSE;
CORBA_NamedValue source_item;
@@ -121,13 +121,17 @@
array_init(pDestination);
 #endif
 
+   step = content_type->length ? content_type->length : 1;
+
for (i = 0; i < length; i++)
{
p_destination_item = NULL;
memset(&source_item, 0, sizeof(CORBA_NamedValue));
 
source_item.argument._type = content_type;
-   source_item.argument._value = &pp_members[i];
+   source_item.argument._value = pp_members;
+
+   pp_members += step;
 
ALLOC_ZVAL(p_destination_item);

@@ -236,6 +240,7 @@
}
}
 
+   return TRUE;
 
 error: 
return FALSE;
@@ -292,7 +297,7 @@
 
default:
 /* printf("unsupported corba TCKind %i\n", kind);*/
-/* php_error(E_WARNING, "unsupported corba TCKind %i", kind);*/
+   zend_error(E_WARNING, "(satellite) unsupported corba TCKind 
+%i", kind);
}
 
return success;
Index: php4/ext/satellite/typecode.c
diff -u php4/ext/satellite/typecode.c:1.2 php4/ext/satellite/typecode.c:1.3
--- php4/ext/satellite/typecode.c:1.2   Fri Sep  1 15:29:00 2000
+++ php4/ext/satellite/typecode.c   Mon Jan 29 22:43:35 2001
@@ -17,7 +17,7 @@
  */
 
 /*
- * $Id: typecode.c,v 1.2 2000/09/01 22:29:00 eriksson Exp $
+ * $Id: typecode.c,v 1.3 2001/01/30 06:43:35 eriksson Exp $
  * vim: syntax=c tabstop=2 shiftwidth=2
  */
 
@@ -132,8 +132,7 @@
 
if (type_code == NULL)
{
-/* printf("unknown type for member %s\n", 
-   IDL_IDENT(IDL_LIST(declaration).data).str);*/
+   zend_error(E_WARNING, "(Satellite) unknown type for member 
+%s", IDL_IDENT(IDL_LIST(declaration).data).str);
goto error;
}




-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/satellite config.m4

2001-02-20 Thread David Eriksson

erikssonTue Feb 20 07:12:30 2001 EDT

  Modified files:  
/php4/ext/satellite config.m4 
  Log:
  Corrected typo in config.m4
  
Index: php4/ext/satellite/config.m4
diff -u php4/ext/satellite/config.m4:1.2 php4/ext/satellite/config.m4:1.3
--- php4/ext/satellite/config.m4:1.2Thu Nov 30 14:03:17 2000
+++ php4/ext/satellite/config.m4Tue Feb 20 07:12:30 2001
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.2 2000/11/30 22:03:17 eriksson Exp $
+dnl $Id: config.m4,v 1.3 2001/02/20 15:12:30 eriksson Exp $
 
 dnl My first config.m4 - be nice to me... :-)
 
@@ -17,7 +17,7 @@
 
dnl check for symbol giop_skip_atexit in libIIOP
AC_CHECK_LIB(IIOP, giop_skip_atexit, [true], [
-   AC_MSG_ERROR([You need a CVS version of ORBit, please read 
ext/satallite/README])
+   AC_MSG_ERROR([You need a CVS version of ORBit, please read 
+ext/satellite/README])
], `$orbit_config --libs client`)
 
dnl ORBIT_CFLAGS=`$orbit_config --cflags client`



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/satellite object.c

2001-02-20 Thread David Eriksson

erikssonTue Feb 20 07:18:26 2001 EDT

  Modified files:  
/php4/ext/satellite object.c 
  Log:
  Stop leaking ParameterType data
  
Index: php4/ext/satellite/object.c
diff -u php4/ext/satellite/object.c:1.4 php4/ext/satellite/object.c:1.5
--- php4/ext/satellite/object.c:1.4 Thu Nov 30 14:01:57 2000
+++ php4/ext/satellite/object.c Tue Feb 20 07:18:26 2001
@@ -17,7 +17,7 @@
  */
 
 /*
- * $Id: object.c,v 1.4 2000/11/30 22:01:57 eriksson Exp $
+ * $Id: object.c,v 1.5 2001/02/20 15:18:26 eriksson Exp $
  * vim: syntax=c tabstop=2 shiftwidth=2
  */
 
@@ -391,13 +391,18 @@
CORBA_Request request, OperationType * pOperation, int argumentCount, 
const zval ** ppArguments, CORBA_NamedValue ** ppNamedValue)
 {
-   ParameterType * p_parameter = OperationType_GetFirstParameter(pOperation);
+   ParameterType * p_parameter = NULL;
int i = 0;
-   zend_bool success;
+   zend_bool success = FALSE;
 
if (argumentCount < 1)
return TRUE;/* nothing to do */
 
+   p_parameter = OperationType_GetFirstParameter(pOperation);
+
+   if (NULL == p_parameter)
+   return FALSE; /* oups! */
+   
do
{
ppNamedValue[i] = satellite_new(CORBA_NamedValue);
@@ -405,7 +410,7 @@
request, p_parameter, ppArguments[i], ppNamedValue[i]);
 
if (!success)
-   return FALSE;
+   goto error;
 
i++;
} while (i < argumentCount && ParameterType_GetNext(p_parameter));
@@ -417,10 +422,19 @@

/* bad number of arguments */
wrong_param_count();
-   return FALSE;
+   goto error;
}
 
-   return TRUE;
+   success = TRUE;
+   goto exit;
+
+error:
+   success = FALSE;
+
+exit:
+   orbit_delete(p_parameter);
+   return success;
+
 }
 
 /*



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/satellite typemanager.c

2001-02-20 Thread David Eriksson

erikssonTue Feb 20 07:35:55 2001 EDT

  Modified files:  
/php4/ext/satellite typemanager.c 
  Log:
  Patch for inherited interfaces by Daniel Stodden <[EMAIL PROTECTED]>
  
Index: php4/ext/satellite/typemanager.c
diff -u php4/ext/satellite/typemanager.c:1.2 php4/ext/satellite/typemanager.c:1.3
--- php4/ext/satellite/typemanager.c:1.2Fri Sep  1 15:29:00 2000
+++ php4/ext/satellite/typemanager.cTue Feb 20 07:35:55 2001
@@ -17,7 +17,7 @@
  */
 
 /*
- * $Id: typemanager.c,v 1.2 2000/09/01 22:29:00 eriksson Exp $
+ * $Id: typemanager.c,v 1.3 2001/02/20 15:35:55 eriksson Exp $
  * vim: syntax=c tabstop=2 shiftwidth=2
  */
 
@@ -219,19 +219,63 @@
return pException;
 }
 
+
+   
+/* 
+   find an operation in an interface tree, 
+   recursing into inherited interfaces  
+*/
+static CORBA_boolean
+findoperation_recurse( IDL_tree tree, const char *name,
+  IdlInfo *pIdlInfo )
+{
+   IDL_tree inherited;
+   CORBA_boolean success;
+
+   success = orbit_find_type( IDL_INTERFACE(tree).body,
+  name, IDLN_OP_DCL, 
+  pIdlInfo );
+   if ( success ) 
+   return CORBA_TRUE;
+
+   for ( inherited = IDL_INTERFACE(tree).inheritance_spec;
+ inherited != NULL;
+ inherited = IDL_LIST(inherited).next ) {
+   IDL_tree ident = IDL_LIST(inherited).data;
+   InterfaceType *iface;
+
+   iface = TypeManager_FindInterface( IDL_IDENT(ident).repo_id );
+   success = findoperation_recurse( iface->mIdlInfo.mType, 
+name, 
+pIdlInfo );
+   orbit_delete( iface );
+
+   if ( success )
+   return CORBA_TRUE;
+
+   zend_error( E_WARNING, "operation %s not found in iface %s\n", 
+   name, IDL_IDENT(ident).repo_id );
+   }
+
+   return CORBA_FALSE;
+}
+
 /* find an operation in an interface based on case-insensitive name */
-OperationType * InterfaceType_FindOperation(InterfaceType * pInterface, 
-   const char * name)
+OperationType * InterfaceType_FindOperation( InterfaceType * pInterface, 
+const char * name )
 {
-   OperationType * pOperation = orbit_new(OperationType);
-   CORBA_boolean success = orbit_find_type(
-   pInterface->mIdlInfo.mType, name, IDLN_OP_DCL, 
&pOperation->mIdlInfo);
-   if (!success)
-   {
-   orbit_delete(pOperation);
-   pOperation = NULL;
-   }
-   return pOperation;
+   OperationType *pOperation = orbit_new(OperationType);
+   IDL_tree tree = pInterface->mIdlInfo.mType;
+   CORBA_boolean success;
+
+   success = findoperation_recurse( tree, name, 
+&pOperation->mIdlInfo );
+   
+   if ( success )
+   return pOperation;
+
+   orbit_delete(pOperation);
+   return NULL;
 }
 
 /* find an attribute in an interface based on case-insensitive name */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]