php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #52274
Patch scintilla.patch revision 2010-07-07 11:06 UTC by thomas dot sahlin at invented dot se

Patch scintilla.patch for PHP-GTK related Bug #52274

Patch version 2010-07-07 11:06 UTC

Return to Bug #52274 | Download this patch
Patch Revisions:

Developer: thomas.sahlin@invented.se

Index: ext/scintilla/config.m4
===================================================================
--- ext/scintilla/config.m4	(revision 301038)
+++ ext/scintilla/config.m4	(arbetskopia)
@@ -18,80 +18,101 @@
 libscintilla/src/CellBuffer.cxx \
 libscintilla/src/CharClassify.cxx \
 libscintilla/src/ContractionState.cxx \
+libscintilla/src/Decoration.cxx \
+libscintilla/src/DocumentAccessor.cxx \
 libscintilla/src/Document.cxx \
-libscintilla/src/DocumentAccessor.cxx \
 libscintilla/src/Editor.cxx \
 libscintilla/src/ExternalLexer.cxx \
 libscintilla/src/Indicator.cxx \
 libscintilla/src/KeyMap.cxx \
 libscintilla/src/KeyWords.cxx \
+libscintilla/src/LexAbaqus.cxx \
+libscintilla/src/LexAda.cxx \
 libscintilla/src/LexAPDL.cxx \
+libscintilla/src/LexAsm.cxx \
+libscintilla/src/LexAsn1.cxx \
+libscintilla/src/LexASY.cxx \
 libscintilla/src/LexAU3.cxx \
 libscintilla/src/LexAVE.cxx \
-libscintilla/src/LexAda.cxx \
-libscintilla/src/LexAsm.cxx \
-libscintilla/src/LexAsn1.cxx \
 libscintilla/src/LexBaan.cxx \
 libscintilla/src/LexBash.cxx \
 libscintilla/src/LexBasic.cxx \
 libscintilla/src/LexBullant.cxx \
+libscintilla/src/LexCaml.cxx \
 libscintilla/src/LexCLW.cxx \
-libscintilla/src/LexCPP.cxx \
-libscintilla/src/LexCSS.cxx \
-libscintilla/src/LexCaml.cxx \
 libscintilla/src/LexCmake.cxx \
+libscintilla/src/LexCOBOL.cxx \
 libscintilla/src/LexConf.cxx \
+libscintilla/src/LexCPP.cxx \
 libscintilla/src/LexCrontab.cxx \
 libscintilla/src/LexCsound.cxx \
+libscintilla/src/LexCSS.cxx \
 libscintilla/src/LexD.cxx \
-libscintilla/src/LexEScript.cxx \
 libscintilla/src/LexEiffel.cxx \
 libscintilla/src/LexErlang.cxx \
+libscintilla/src/LexEScript.cxx \
 libscintilla/src/LexFlagship.cxx \
 libscintilla/src/LexForth.cxx \
 libscintilla/src/LexFortran.cxx \
+libscintilla/src/LexGAP.cxx \
 libscintilla/src/LexGui4Cli.cxx \
+libscintilla/src/LexHaskell.cxx \
 libscintilla/src/LexHTML.cxx \
-libscintilla/src/LexHaskell.cxx \
 libscintilla/src/LexInno.cxx \
 libscintilla/src/LexKix.cxx \
 libscintilla/src/LexLisp.cxx \
 libscintilla/src/LexLout.cxx \
 libscintilla/src/LexLua.cxx \
+libscintilla/src/LexMagik.cxx \
+libscintilla/src/LexMatlab.cxx \
+libscintilla/src/LexMetapost.cxx \
 libscintilla/src/LexMMIXAL.cxx \
 libscintilla/src/LexMPT.cxx \
 libscintilla/src/LexMSSQL.cxx \
-libscintilla/src/LexMatlab.cxx \
-libscintilla/src/LexMetapost.cxx \
+libscintilla/src/LexMySQL.cxx \
+libscintilla/src/LexNimrod.cxx \
 libscintilla/src/LexNsis.cxx \
 libscintilla/src/LexOpal.cxx \
 libscintilla/src/LexOthers.cxx \
+libscintilla/src/LexPascal.cxx \
 libscintilla/src/LexPB.cxx \
+libscintilla/src/LexPerl.cxx \
+libscintilla/src/LexPLM.cxx \
 libscintilla/src/LexPOV.cxx \
+libscintilla/src/LexPowerPro.cxx \
+libscintilla/src/LexPowerShell.cxx \
+libscintilla/src/LexProgress.cxx \
 libscintilla/src/LexPS.cxx \
-libscintilla/src/LexPascal.cxx \
-libscintilla/src/LexPerl.cxx \
 libscintilla/src/LexPython.cxx \
+libscintilla/src/LexR.cxx \
 libscintilla/src/LexRebol.cxx \
 libscintilla/src/LexRuby.cxx \
-libscintilla/src/LexSQL.cxx \
 libscintilla/src/LexScriptol.cxx \
 libscintilla/src/LexSmalltalk.cxx \
+libscintilla/src/LexSML.cxx \
+libscintilla/src/LexSorcus.cxx \
 libscintilla/src/LexSpecman.cxx \
 libscintilla/src/LexSpice.cxx \
+libscintilla/src/LexSQL.cxx \
+libscintilla/src/LexTACL.cxx \
 libscintilla/src/LexTADS3.cxx \
+libscintilla/src/LexTAL.cxx \
 libscintilla/src/LexTCL.cxx \
 libscintilla/src/LexTeX.cxx \
 libscintilla/src/LexVB.cxx \
+libscintilla/src/LexVerilog.cxx \
 libscintilla/src/LexVHDL.cxx \
-libscintilla/src/LexVerilog.cxx \
 libscintilla/src/LexYAML.cxx \
 libscintilla/src/LineMarker.cxx \
+libscintilla/src/PerLine.cxx \
+libscintilla/src/PositionCache.cxx \
 libscintilla/src/PropSet.cxx \
 libscintilla/src/RESearch.cxx \
+libscintilla/src/RunStyles.cxx \
 libscintilla/src/ScintillaBase.cxx \
+libscintilla/src/Selection.cxx \
+libscintilla/src/StyleContext.cxx \
 libscintilla/src/Style.cxx \
-libscintilla/src/StyleContext.cxx \
 libscintilla/src/UniConversion.cxx \
 libscintilla/src/ViewStyle.cxx \
 libscintilla/src/WindowAccessor.cxx \
Index: ext/scintilla/libscintilla/include/Platform.h
===================================================================
--- ext/scintilla/libscintilla/include/Platform.h	(revision 301038)
+++ ext/scintilla/libscintilla/include/Platform.h	(arbetskopia)
@@ -14,7 +14,7 @@
 // PLAT_WIN = Win32 API on Win32 OS
 // PLAT_WX is wxWindows on any supported platform
 
-#define PLAT_GTK 0
+#define PLAT_GTK 1
 #define PLAT_GTK_WIN32 0
 #define PLAT_MACOSX 0
 #define PLAT_WIN 0
Index: ext/scintilla/libscintilla/src/ExternalLexer.h
===================================================================
--- ext/scintilla/libscintilla/src/ExternalLexer.h	(revision 301038)
+++ ext/scintilla/libscintilla/src/ExternalLexer.h	(arbetskopia)
@@ -19,13 +19,13 @@
 #endif
 
 // External Lexer function definitions...
-typedef void (EXT_LEXER_DECL *ExtLexerFunction)(unsigned int lexer, unsigned int startPos, int length, int initStyle,
+typedef void (*ExtLexerFunction)(unsigned int lexer, unsigned int startPos, int length, int initStyle,
                   char *words[], WindowID window, char *props);
-typedef void (EXT_LEXER_DECL *ExtFoldFunction)(unsigned int lexer, unsigned int startPos, int length, int initStyle,
+typedef void (*ExtFoldFunction)(unsigned int lexer, unsigned int startPos, int length, int initStyle,
                   char *words[], WindowID window, char *props);
-typedef void* (EXT_LEXER_DECL *GetLexerFunction)(unsigned int Index);
-typedef int (EXT_LEXER_DECL *GetLexerCountFn)();
-typedef void (EXT_LEXER_DECL *GetLexerNameFn)(unsigned int Index, char *name, int buflength);
+typedef void* (*GetLexerFunction)(unsigned int Index);
+typedef int (*GetLexerCountFn)();
+typedef void (*GetLexerNameFn)(unsigned int Index, char *name, int buflength);
 
 //class DynamicLibrary;
 
Index: ext/scintilla/sci_generator.php
===================================================================
--- ext/scintilla/sci_generator.php	(revision 301038)
+++ ext/scintilla/sci_generator.php	(arbetskopia)
@@ -49,7 +49,7 @@
 }
 $savefile = dirname(__FILE__) . "/gen_scintilla.c";
 
-if($sfp = new LineOutput(fopen($savefile, 'w'), $savefile)){
+if($sfp = new LineOutput($savefile)){
 	if($handle = fopen("ext/scintilla/scintilla.in", "r")){
 		while (1 && ($data = fgets($handle, 1000)) !== FALSE){
 			$sfp->write($data);
@@ -59,12 +59,12 @@
 	$const = array();
 	if($handle = fopen("$path/include/Scintilla.h", "r")){
 		while (1 && ($data = fgets($handle, 1000)) !== FALSE){
-			preg_match('!\#define\s(SCI_\w+)\s([-]*\d+)!is',$data,$match);
-			$const[$match[2]] = $match[1];
+			if (preg_match('!\#define\s(SCI_\w+)\s([-]*\d+)!is',$data,$match))
+				$const[$match[2]] = $match[1];
 		}
 		fclose($handle);
 	}
-	
+
 	if($handle = fopen("$path/include/Scintilla.iface", "r")){
 		while (1 && ($data = fgets($handle, 1000)) !== FALSE){
 			//echo $data;
@@ -73,12 +73,12 @@
 				continue;
 			}
 			//$cmd = substr($data,0,3);
-			$bits = split(' ',$data);
+			$bits = explode(' ',$data);
 			//print_r($bits);
 			switch($bits[0]){
 				case 'val':
-					$def = split('=',$bits[1]);
-					$np = split('_',$def[0]);
+					$def = explode('=',$bits[1]);
+					$np = explode('_',$def[0]);
 					if(!isset($starts[$np[0]])) $starts[$np[0]] = 1;
 					switch($np[0]){
 						case 'SCI':
@@ -144,7 +144,7 @@
 					preg_match('!'.$bits[0].'\s(\w+)\s(\w+)=(\d+)\((.*?)\)!',$data,$match);
 					$fname = fixFunctionName($match[2]);
 					//print_r($match);
-					$vars = split(',',$match[4]);
+					$vars = explode(',',$match[4]);
 					//print_r($vars);
 					$functions[$fname]['return'] = $match[1];
 					$functions[$fname]['message'] = $match[3];
@@ -153,7 +153,7 @@
 					$functions[$fname]['post'] = array();
 					$x = 0;
 					foreach($vars as $var){
-						$v = split(' ',trim($var));
+						$v = explode(' ',trim($var));
 						if(empty($v[0])){
 							$functions[$fname]['vars'][$x]['org_type'] = 'void';
 							$functions[$fname]['vars'][$x]['type'] = 'void';
@@ -489,9 +489,6 @@
 			}
 			if(isset($arginfo[$fname]['vars']) && count($arginfo[$fname]['vars'])>0){
 				$function_entry[$fname] = "PHP_ME(Scintilla, $fname,";
-				for($x=strlen($fname);$x<30;$x++){
-					$functions[$fname]['function_entry'] .= ' ';
-				}
 				$function_entry[$fname] .= "arginfo_scintilla_$fname, ZEND_ACC_PUBLIC)";
 				
 			}else{
@@ -503,7 +500,7 @@
 			}
 			$sfp->write("\n\tNOT_STATIC_METHOD();\n\n");
 			
-			$chkcount = count($functions[$fname]['chk1']);
+			$chkcount = isset($functions[$fname]['chk1']) ? count($functions[$fname]['chk1']) : 0;
 			if($chkcount){
 				$chk1 = '';
 				$chk2 = '';
@@ -521,7 +518,8 @@
 					$sfp->write("\t$pre\n");
 				}
 			}
-			$sfp->write("\n\t".$functions[$fname]['call']."\n");
+			if (isset($functions[$fname]['call']))
+				$sfp->write("\n\t".$functions[$fname]['call']."\n");
 			if(count($functions[$fname]['post'])> 0){
 				$sfp->write("\n");
 				foreach($functions[$fname]['post'] as $post){
@@ -561,4 +559,6 @@
 		//print_r($function_entry);
 		//print_r($arginfo);
 	}
+
+	$sfp->save();
 }
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 01:01:28 2024 UTC