Author: baby-guest
Date: 2007-07-29 18:15:22 +0000 (Sun, 29 Jul 2007)
New Revision: 3478

Added:
   packages/trunk/fenix/debian/patches/common_stdfiles.patch
   packages/trunk/fenix/debian/patches/fxi_input.patch
Modified:
   packages/trunk/fenix/debian/changelog
   packages/trunk/fenix/debian/patches/fxc_output.patch
   packages/trunk/fenix/debian/patches/series
Log:
Added patches for handling stdin/stdout



Modified: packages/trunk/fenix/debian/changelog
===================================================================
--- packages/trunk/fenix/debian/changelog       2007-07-29 15:12:59 UTC (rev 
3477)
+++ packages/trunk/fenix/debian/changelog       2007-07-29 18:15:22 UTC (rev 
3478)
@@ -2,6 +2,7 @@
 
   * Renamed package to simply fenix
   * Added patch to synchronize code against the latest CVS version
+  * Added support for reading programs from stdin in the interpreter.
 
  -- Miriam Ruiz <[EMAIL PROTECTED]>  Fri, 13 Jul 2007 21:30:27 +0000
 

Added: packages/trunk/fenix/debian/patches/common_stdfiles.patch
===================================================================
--- packages/trunk/fenix/debian/patches/common_stdfiles.patch                   
        (rev 0)
+++ packages/trunk/fenix/debian/patches/common_stdfiles.patch   2007-07-29 
18:15:22 UTC (rev 3478)
@@ -0,0 +1,35 @@
+diff -ruN Fenix/common/files.c fenix-0.92a.dfsg1/common/files.c
+--- Fenix/common/files.c       2007-04-12 22:07:56.000000000 +0000
++++ fenix-0.92a.dfsg1/common/files.c   2007-07-29 17:55:07.531111567 +0000
+@@ -460,6 +460,31 @@
+       memset (f, 0, sizeof(file)) ;
+       strncpy (f->name, filename, MAX_PATH);
+ 
++      if (strcmp(filename, "-") == 0 && strchr(mode,'r'))
++      {
++              char buffer[1024];
++              size_t buflen;
++              f->type = F_FILE;
++              f->fp = tmpfile();
++              opened_files++;
++
++              while ((buflen = fread(buffer, 1, sizeof(buffer), stdin)))
++              {
++                      fwrite(buffer, 1, buflen, f->fp);
++              }
++              fseek (f->fp, 0, SEEK_SET);
++
++              return f ;
++      }
++
++      if (strcmp(filename, "-") == 0 && strchr(mode,'w'))
++      {
++              f->type = F_STDFILE;
++              f->fp = stdout;
++              opened_files++;
++              return f ;
++      }
++
+       c = filename ;
+       for (n = c+strlen(c) ; n >= c ; n--)
+       {

Modified: packages/trunk/fenix/debian/patches/fxc_output.patch
===================================================================
--- packages/trunk/fenix/debian/patches/fxc_output.patch        2007-07-29 
15:12:59 UTC (rev 3477)
+++ packages/trunk/fenix/debian/patches/fxc_output.patch        2007-07-29 
18:15:22 UTC (rev 3478)
@@ -48,38 +48,3 @@
  
        memset (&dcb, 0, sizeof(dcb));
  
---- fenix0.92-0.92a.dfsg1.orig/common/files.c
-+++ fenix0.92-0.92a.dfsg1/common/files.c
-@@ -460,6 +460,22 @@
-       memset (f, 0, sizeof(file)) ;
-       strncpy (f->name, filename, MAX_PATH);
- 
-+      if (strcmp(filename, "-") == 0 && strchr(mode,'w'))
-+      {
-+              f->type = F_STDFILE;
-+              f->fp = stdout;
-+              opened_files++;
-+              return f ;
-+      }
-+
-+      if (strcmp(filename, "-") == 0 && strchr(mode,'r'))
-+      {
-+              f->type = F_STDFILE;
-+              f->fp = stdin;
-+              opened_files++;
-+              return f ;
-+      }
-+
-       c = filename ;
-       for (n = c+strlen(c) ; n >= c ; n--)
-       {
---- fenix0.92-0.92a.dfsg1.orig/include/files_st.h
-+++ fenix0.92-0.92a.dfsg1/include/files_st.h
-@@ -39,6 +39,7 @@
- #define F_XFILE  1
- #define F_FILE   2
- #define F_GZFILE 3
-+#define F_STDFILE 4
- 
- #include <zlib.h>
- 

Added: packages/trunk/fenix/debian/patches/fxi_input.patch
===================================================================
--- packages/trunk/fenix/debian/patches/fxi_input.patch                         
(rev 0)
+++ packages/trunk/fenix/debian/patches/fxi_input.patch 2007-07-29 18:15:22 UTC 
(rev 3478)
@@ -0,0 +1,24 @@
+diff -ruN fenix-0.92a.raw/fxi/src/dcbr.c fenix-0.92a/fxi/src/dcbr.c
+--- fenix-0.92a.raw/fxi/src/dcbr.c     2007-07-28 11:07:02.566318000 +0000
++++ fenix-0.92a/fxi/src/dcbr.c 2007-07-29 17:40:47.485362067 +0000
+@@ -144,7 +144,7 @@
+       file * fp ;
+ 
+       /* check for existence of the DCB FILE */
+-      if (!file_exists(filename)) return 0 ;
++      if (strcmp(filename,"-")!=0 && !file_exists(filename)) return 0 ;
+ 
+       fp = file_open (filename, "rb0") ;
+       if (!fp)
+diff -ruN fenix-0.92a.raw/fxi/src/main.c fenix-0.92a/fxi/src/main.c
+--- fenix-0.92a.raw/fxi/src/main.c     2007-07-28 11:06:34.620571000 +0000
++++ fenix-0.92a/fxi/src/main.c 2007-07-28 11:10:59.733140328 +0000
+@@ -248,7 +248,7 @@
+ 
+               for (i = 1 ; i < argc ; i++)
+               {
+-                      if (argv[i][0] == '-')
++                      if (argv[i][0] == '-' && argv[i][1])
+                       {
+                               j = 1 ;
+                               while (argv[i][j])

Modified: packages/trunk/fenix/debian/patches/series
===================================================================
--- packages/trunk/fenix/debian/patches/series  2007-07-29 15:12:59 UTC (rev 
3477)
+++ packages/trunk/fenix/debian/patches/series  2007-07-29 18:15:22 UTC (rev 
3478)
@@ -5,5 +5,7 @@
 i18n_map.patch
 fxi_binname.patch
 fxc_nosdlinit.patch
+common_stdfiles.patch
 fxc_output.patch
+fxi_input.patch
 0.92a_to_cvs-20070713.1513.patch


_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

Reply via email to