summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShane Caraveo <shane@php.net>2003-05-26 02:18:38 (GMT)
committerShane Caraveo <shane@php.net>2003-05-26 02:18:38 (GMT)
commit8e5816936476712e3b8c05b98fa3c90924083923 (patch)
tree3200adb9daf0f03113bc6feae347109ba0d74bc9
parentfb14866796a696aea07434ff935f2da2efdcf687 (diff)
downloadphp-8e5816936476712e3b8c05b98fa3c90924083923.tar.gz
now builds on windows
-rw-r--r--ext/simplexml/simplexml.c26
-rw-r--r--ext/simplexml/simplexml.dsp110
2 files changed, 123 insertions, 13 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index cb0e9a4..e21f5ac 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -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
index 0000000..179bebf
--- /dev/null
+++ b/ext/simplexml/simplexml.dsp
@@ -0,0 +1,110 @@
+# Microsoft Developer Studio Project File - Name="simplexml" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=simplexml - Win32 Debug_TS
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "simplexml.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "simplexml.mak" CFG="simplexml - Win32 Debug_TS"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "simplexml - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "simplexml - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "simplexml - Win32 Debug_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug_TS"
+# PROP BASE Intermediate_Dir "Debug_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_TS"
+# PROP Intermediate_Dir "Debug_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# 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
+# 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
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# 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
+# 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"
+
+!ELSEIF "$(CFG)" == "simplexml - Win32 Release_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_TS"
+# PROP BASE Intermediate_Dir "Release_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_TS"
+# PROP Intermediate_Dir "Release_TS"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /YX /FD /c
+# 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
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# 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
+# 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"
+
+!ENDIF
+
+# Begin Target
+
+# Name "simplexml - Win32 Debug_TS"
+# Name "simplexml - Win32 Release_TS"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\simplexml.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\php_simplexml.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project