]> granicus.if.org Git - php/commitdiff
now builds on windows
authorShane Caraveo <shane@php.net>
Mon, 26 May 2003 02:18:38 +0000 (02:18 +0000)
committerShane Caraveo <shane@php.net>
Mon, 26 May 2003 02:18:38 +0000 (02:18 +0000)
ext/simplexml/simplexml.c
ext/simplexml/simplexml.dsp [new file with mode: 0644]

index cb0e9a45d9041b8308f023f7135e1039a0e29662..e21f5ac540af8e58bfe4db59d5094a43b16d78c4 100644 (file)
@@ -26,7 +26,8 @@
 #include "php_ini.h"
 #include "ext/standard/info.h"
 #include "php_simplexml.h"
-
+//#include "zend.h"
+//#include "zend_fast_cache.h"
 
 zend_class_entry *sxe_class_entry;
 
@@ -45,7 +46,7 @@ php_sxe_fetch_object(zval *object TSRMLS_DC)
 /* {{{ _node_as_zval()
  */
 static void
-_node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value)
+_node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value TSRMLS_DC)
 {
        php_sxe_object *subnode;
 
@@ -118,7 +119,7 @@ sxe_property_read(zval *object, zval *member TSRMLS_DC)
                        APPEND_PREV_ELEMENT(counter, value);
 
                        MAKE_STD_ZVAL(value);
-                       _node_as_zval(sxe, node, value);
+                       _node_as_zval(sxe, node, value TSRMLS_CC);
 
                        APPEND_CUR_ELEMENT(counter, value);
                }
@@ -280,12 +281,8 @@ static HashTable *
 sxe_properties_get(zval *object TSRMLS_DC)
 {
        HashTable      *rv;
-       zval           *value;
        php_sxe_object *sxe;
-       char           *name;
-       char           *contents;
        xmlNodePtr      node;
-       xmlAttrPtr      attr;
        int             counter = 0;
 
        ALLOC_HASHTABLE_REL(rv);
@@ -311,6 +308,7 @@ sxe_properties_get(zval *object TSRMLS_DC)
 static int
 sxe_objects_compare(zval *object1, zval *object2 TSRMLS_DC)
 {
+       return 0;
 }
 /* }}} */
 
@@ -346,7 +344,7 @@ sxe_method_get(zval *object, char *name, int len TSRMLS_DC)
 static int
 sxe_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
 {
-       RETURN_NULL();
+       RETVAL_NULL();
        return 1;
 }
 /* }}} */
@@ -442,7 +440,7 @@ sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_
                }
        }
 
-       cast_object_with_contents(writeobj, type, contents);
+       cast_object_with_contents(writeobj, type, contents TSRMLS_CC);
 }
 /* }}} */
 
@@ -535,7 +533,7 @@ php_sxe_register_object(php_sxe_object *intern TSRMLS_DC)
 {
        zend_object_value rv;
 
-       rv.handle = zend_objects_store_put(intern, sxe_object_dtor, sxe_object_clone);
+       rv.handle = zend_objects_store_put(intern, sxe_object_dtor, sxe_object_clone TSRMLS_CC);
        rv.handlers = (zend_object_handlers *) &sxe_object_handlers;
 
        return rv;
@@ -548,7 +546,6 @@ static zend_object_value
 sxe_object_new(zend_class_entry *ce TSRMLS_DC)
 {
        php_sxe_object    *intern;
-       zend_object_value  rv;
 
        intern = php_sxe_object_new(TSRMLS_C);
        return php_sxe_register_object(intern TSRMLS_CC);
@@ -643,12 +640,16 @@ PHP_FUNCTION(simplexml_save_document_string)
 }
 /* }}} */
 
+/* this is lame, first_arg_force_ref (and others) doesn't 
+   work through dll linkage on windows.  no other extension 
+   outside basic_functions uses first_arg_force_ref.  */
+unsigned char fix_first_arg_force_ref[] = { 1, BYREF_FORCE };
 
 function_entry simplexml_functions[] = {
        PHP_FE(simplexml_load_file, NULL)
        PHP_FE(simplexml_load_string, NULL)
        PHP_FE(simplexml_save_document_file, NULL)
-       PHP_FE(simplexml_save_document_string, first_arg_force_ref)
+       PHP_FE(simplexml_save_document_string, fix_first_arg_force_ref)
        {NULL, NULL, NULL}
 };
 
@@ -675,7 +676,6 @@ ZEND_GET_MODULE(simplexml)
 PHP_MINIT_FUNCTION(simplexml)
 {
        zend_class_entry sxe;
-       zend_internal_function sxe_constructor;
 
        INIT_CLASS_ENTRY(sxe, "simplexml_element", NULL);
        sxe.create_object = sxe_object_new;
diff --git a/ext/simplexml/simplexml.dsp b/ext/simplexml/simplexml.dsp
new file mode 100644 (file)
index 0000000..179bebf
--- /dev/null
@@ -0,0 +1,110 @@
+# Microsoft Developer Studio Project File - Name="simplexml" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102\r
+\r
+CFG=simplexml - Win32 Debug_TS\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "simplexml.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "simplexml.mak" CFG="simplexml - Win32 Debug_TS"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "simplexml - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")\r
+!MESSAGE "simplexml - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+MTL=midl.exe\r
+RSC=rc.exe\r
+\r
+!IF  "$(CFG)" == "simplexml - Win32 Debug_TS"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Debug_TS"\r
+# PROP BASE Intermediate_Dir "Debug_TS"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Debug_TS"\r
+# PROP Intermediate_Dir "Debug_TS"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /YX /FD /GZ  /c\r
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\php5" /I "..\..\..\php5\main" /I "..\..\..\php5\Zend" /I "..\..\..\php5\TSRM" /D ZEND_DEBUG=1 /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /YX /FD /GZ  /c\r
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 php4ts_debug.lib libxml2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\php5\Debug_TS"\r
+\r
+!ELSEIF  "$(CFG)" == "simplexml - Win32 Release_TS"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "Release_TS"\r
+# PROP BASE Intermediate_Dir "Release_TS"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Release_TS"\r
+# PROP Intermediate_Dir "Release_TS"\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /YX /FD /c\r
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\php5\main" /I "..\..\..\php5\Zend" /I "..\..\..\php5\TSRM" /I "..\..\..\php5\win32" /I "..\..\..\php5" /D ZTS=1 /D ZEND_DEBUG=0 /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /YX /FD /c\r
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386\r
+# ADD LINK32 php4ts.lib libxml2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /libpath:"..\..\..\php5\Release_TS" /libpath:"..\..\..\php5\Release_TS_Inline"\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "simplexml - Win32 Debug_TS"\r
+# Name "simplexml - Win32 Release_TS"\r
+# Begin Group "Source Files"\r
+\r
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+# Begin Source File\r
+\r
+SOURCE=.\simplexml.c\r
+# End Source File\r
+# End Group\r
+# Begin Group "Header Files"\r
+\r
+# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
+# Begin Source File\r
+\r
+SOURCE=.\php_simplexml.h\r
+# End Source File\r
+# End Group\r
+# Begin Group "Resource Files"\r
+\r
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
+# End Group\r
+# End Target\r
+# End Project\r