wez             Mon May  3 11:51:41 2004 EDT

  Modified files:              
    /php-src/ext/com_dotnet     README com_extension.c com_variant.c 
                                com_wrapper.c 
  Log:
  Fixup some constants and error handling.
  Remove unfinished and un-needed function.
  
  
http://cvs.php.net/diff.php/php-src/ext/com_dotnet/README?r1=1.3&r2=1.4&ty=u
Index: php-src/ext/com_dotnet/README
diff -u php-src/ext/com_dotnet/README:1.3 php-src/ext/com_dotnet/README:1.4
--- php-src/ext/com_dotnet/README:1.3   Tue Jan 20 06:01:16 2004
+++ php-src/ext/com_dotnet/README       Mon May  3 11:51:41 2004
@@ -65,9 +65,6 @@
 
 TODO:
 
-- Mapping PHP arrays as SafeArray's.  This is currently not done.
-  Probably will implement this into $a = new variant($php_array, VT_ARRAY)
-  or something similar.
 - documentation
 
 * dotnet support requires that you have the mscoree.h header from the .net sdk
http://cvs.php.net/diff.php/php-src/ext/com_dotnet/com_extension.c?r1=1.11&r2=1.12&ty=u
Index: php-src/ext/com_dotnet/com_extension.c
diff -u php-src/ext/com_dotnet/com_extension.c:1.11 
php-src/ext/com_dotnet/com_extension.c:1.12
--- php-src/ext/com_dotnet/com_extension.c:1.11 Wed Apr 28 19:24:33 2004
+++ php-src/ext/com_dotnet/com_extension.c      Mon May  3 11:51:41 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: com_extension.c,v 1.11 2004/04/28 23:24:33 wez Exp $ */
+/* $Id: com_extension.c,v 1.12 2004/05/03 15:51:41 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -228,9 +228,11 @@
        COM_CONST(CLSCTX_SERVER);
        COM_CONST(CLSCTX_ALL);
 
+#if 0
        COM_CONST(DISPATCH_METHOD);
        COM_CONST(DISPATCH_PROPERTYGET);
        COM_CONST(DISPATCH_PROPERTYPUT);
+#endif
 
        COM_CONST(VT_NULL);
        COM_CONST(VT_EMPTY);
@@ -269,6 +271,17 @@
        COM_CONST(VARCMP_GT);
        COM_CONST(VARCMP_NULL);
 
+       COM_CONST(NORM_IGNORECASE);
+       COM_CONST(NORM_IGNORENONSPACE);
+       COM_CONST(NORM_IGNORESYMBOLS);
+       COM_CONST(NORM_IGNOREWIDTH);
+       COM_CONST(NORM_IGNOREKANATYPE);
+#ifdef NORM_IGNOREKASHIDA
+       COM_CONST(NORM_IGNOREKASHIDA);
+#endif
+       COM_CONST(DISP_E_DIVBYZERO);
+       COM_CONST(DISP_E_OVERFLOW);
+
        return SUCCESS;
 }
 /* }}} */
http://cvs.php.net/diff.php/php-src/ext/com_dotnet/com_variant.c?r1=1.6&r2=1.7&ty=u
Index: php-src/ext/com_dotnet/com_variant.c
diff -u php-src/ext/com_dotnet/com_variant.c:1.6 
php-src/ext/com_dotnet/com_variant.c:1.7
--- php-src/ext/com_dotnet/com_variant.c:1.6    Thu Apr 22 10:27:11 2004
+++ php-src/ext/com_dotnet/com_variant.c        Mon May  3 11:51:41 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: com_variant.c,v 1.6 2004/04/22 14:27:11 wez Exp $ */
+/* $Id: com_variant.c,v 1.7 2004/05/03 15:51:41 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -312,7 +312,7 @@
 /* }}} */
 
 /* {{{ proto void variant_set(object variant, mixed value)
-   Assigns a new value for a variant object (like "set" in VB) */
+   Assigns a new value for a variant object */
 PHP_FUNCTION(variant_set)
 {
        zval *zobj, *zvalue = NULL;
@@ -443,6 +443,11 @@
 
        if (SUCCEEDED(result)) {
                php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
+       } else {
+               char *werr;
+               werr = php_win_err(result);
+               php_com_throw_exception(result, werr TSRMLS_CC);
+               LocalFree(werr);
        }
 
        VariantClear(&vres);
@@ -468,7 +473,7 @@
 /* }}} */
 
 /* {{{ proto mixed variant_sub(mixed left, mixed right)
-   subjects the value of the right variant from the left variant value and returns 
the result */
+   subtracts the value of the right variant from the left variant value and returns 
the result */
 PHP_FUNCTION(variant_sub)
 {
        variant_binary_operation(VOP_SUB, INTERNAL_FUNCTION_PARAM_PASSTHRU);
@@ -508,7 +513,7 @@
 /* }}} */
 
 /* {{{ proto mixed variant_idiv(mixed left, mixed right)
-   Converts variants to operands and then returns the result from dividing them */
+   Converts variants to integers and then returns the result from dividing them */
 PHP_FUNCTION(variant_idiv)
 {
        variant_binary_operation(VOP_IDIV, INTERNAL_FUNCTION_PARAM_PASSTHRU);
@@ -600,6 +605,11 @@
 
        if (SUCCEEDED(result)) {
                php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
+       } else {
+               char *werr;
+               werr = php_win_err(result);
+               php_com_throw_exception(result, werr TSRMLS_CC);
+               LocalFree(werr);
        }
 
        VariantClear(&vres);
@@ -616,7 +626,7 @@
 /* }}} */
 
 /* {{{ proto mixed variant_fix(mixed left)
-   Returns the ? of a variant */
+   Returns the integer part ? of a variant */
 PHP_FUNCTION(variant_fix)
 {
        variant_unary_operation(VOP_FIX, INTERNAL_FUNCTION_PARAM_PASSTHRU);
@@ -902,19 +912,3 @@
 }
 /* }}} */
 
-/* {{{ proto mixed variant_index_get(object variant, mixed index1 [, mixed index2 [, 
...]])
-   Get the value of a multi dimensional array property */
-PHP_FUNCTION(variant_index_get)
-{
-       zval *zobj;
-       php_com_dotnet_object *obj;
-
-       if (FAILURE == zend_parse_parameters(1 TSRMLS_CC,
-               "O", &zobj, php_com_variant_class_entry)) {
-               return;
-       }
-       obj = CDNO_FETCH(zobj);
-
-       /* TODO: finish... */
-}
-/* }}} */
http://cvs.php.net/diff.php/php-src/ext/com_dotnet/com_wrapper.c?r1=1.3&r2=1.4&ty=u
Index: php-src/ext/com_dotnet/com_wrapper.c
diff -u php-src/ext/com_dotnet/com_wrapper.c:1.3 
php-src/ext/com_dotnet/com_wrapper.c:1.4
--- php-src/ext/com_dotnet/com_wrapper.c:1.3    Wed Mar 17 21:16:34 2004
+++ php-src/ext/com_dotnet/com_wrapper.c        Mon May  3 11:51:41 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: com_wrapper.c,v 1.3 2004/03/18 02:16:34 iliaa Exp $ */
+/* $Id: com_wrapper.c,v 1.4 2004/05/03 15:51:41 wez Exp $ */
 
 /* This module exports a PHP object as a COM object by wrapping it
  * using IDispatchEx */
@@ -314,14 +314,8 @@
                /* return value */
                if (retval) {
                        if (pvarRes) {
-                               if (Z_TYPE_P(retval) == IS_OBJECT) {
-                                       /* export the object using a dispatch like 
ourselves */
-                                       VariantInit(pvarRes);
-                                       V_VT(pvarRes) = VT_DISPATCH;
-                                       V_DISPATCH(pvarRes) = 
php_com_wrapper_export(retval TSRMLS_CC);
-                               } else {
-                                       php_com_variant_from_zval(pvarRes, retval, 
COMG(code_page) TSRMLS_CC);
-                               }
+                               VariantInit(pvarRes);
+                               php_com_variant_from_zval(pvarRes, retval, 
COMG(code_page) TSRMLS_CC);
                        }
                        zval_ptr_dtor(&retval);
                } else if (pvarRes) {
@@ -344,6 +338,8 @@
 
        FETCH_DISP("DeleteMemberByName");
 
+       /* TODO: unset */
+
        return S_FALSE;
 }
 
@@ -355,6 +351,8 @@
 
        FETCH_DISP("DeleteMemberByDispID");
        
+       /* TODO: unset */
+       
        return S_FALSE;
 }
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to