com gtk/php-gtk: Make the scintilla extension work again.: ext/scintilla/Makefile.frag ext/scintilla/modifyGenerated.php

[email protected] (David Soria Parra)
Newsgroups php.gtk.cvs
Message-ID <[email protected]>
Commit:    ddea39286ef7bd4097b9334b17bc52f36535e0d6
Author:    Anant Narayanan <[email protected]>         Sun, 9 Apr 2006 21:51:18 +0000
Parents:   474eef7ab48c3a50033815259a86a14ba47ead07
Branches:  master

Link:       http://git.php.net/?p=gtk/php-gtk.git;a=commitdiff;h=ddea39286ef7bd4097b9334b17bc52f36535e0d6

Log:
Make the scintilla extension work again.

Changed paths:
  M  ext/scintilla/Makefile.frag
  A  ext/scintilla/modifyGenerated.php


Diff:
ddea39286ef7bd4097b9334b17bc52f36535e0d6
diff --git a/ext/scintilla/Makefile.frag b/ext/scintilla/Makefile.frag
index 6f7828d..53881d5 100644
--- a/ext/scintilla/Makefile.frag
+++ b/ext/scintilla/Makefile.frag
@@ -10,5 +10,6 @@ $(builddir)/gen_scintilla.c: $(srcdir)/scintilla.defs $(srcdir)/scintilla.overri
 		-o ext/scintilla/scintilla.overrides \
         -p GtkScintilla \
 		-f $@ ext/scintilla/scintilla.defs \
+	 && $(PHP) $(srcdir)/modifyGenerated.php \
      && grep -h "^PHP_GTK_EXPORT_CE" $@ | sed -e "s!^!extern !" > $(@D)/$(*F).h \
 	)
diff --git a/ext/scintilla/modifyGenerated.php b/ext/scintilla/modifyGenerated.php
new file mode 100644
index 0000000..3e741f1
--- /dev/null
+++ b/ext/scintilla/modifyGenerated.php
@@ -0,0 +1,21 @@
+<?php
+
+/* Ugly, Ugly way of exporting classes req for scintilla */
+$contents = file("ext/scintilla/gen_scintilla.c");
+$tmpFile = fopen("ext/scintilla/gen_temp.c", "w+");
+
+for($i=0; $i<5; $i++) {
+    fwrite($tmpFile, $contents[$i]);
+}
+
+fwrite($tmpFile, "\nPHP_GTK_EXPORT_CE(gtkframe_ce);\n");
+
+for($i=5; $i<=count($contents); $i++) {
+    fwrite($tmpFile, $contents[$i]);
+}
+
+fclose($tmpFile);
+$toPut = file("ext/scintilla/gen_temp.c");
+file_put_contents("ext/scintilla/gen_scintilla.c", $toPut);
+
+?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.