Set svn:eol-style to native
Pierre Marechal [Thu, 26 Jul 2007 06:33:54 +0000 (06:33 +0000)]
13 files changed:
scilab/VS-2005-settings/rename-vc-files.rules
scilab/modules/differential_equations/src/c/rk4.c
scilab/modules/differential_equations/src/c/rk4.h
scilab/modules/differential_equations/src/fortran/lsrgk.f
scilab/modules/differential_equations/src/fortran/odeint.f
scilab/modules/differential_equations/src/fortran/rkqc.f
scilab/modules/differential_equations/src/fortran/writbufode.f
scilab/modules/elementaries_functions/includes/xerhlt.h
scilab/modules/elementaries_functions/src/cpp/sortTemplate.cpp
scilab/modules/fileio/sci_gateway/c/sci_filesep.c
scilab/modules/fileio/sci_gateway/c/sci_pathsep.c
scilab/modules/shell/sci_gateway/c/sci_historysize.c
scilab/modules/shell/sci_gateway/c/sci_removelinehistory.c

index 6af189d..db4e524 100644 (file)
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<VisualStudioToolFile\r
-       Name="Rename .vc Files"\r
-       Version="8,00"\r
-       >\r
-       <Rules>\r
-               <CustomBuildRule\r
-                       Name="rename .vc files"\r
-                       DisplayName="Rename .vc files"\r
-                       CommandLine="copy &quot;$(InputDir)$(InputFileName)&quot; &quot;$(InputDir)$(InputName)&quot; 1&gt;NUL"\r
-                       Outputs="$(InputDir)$(InputName) "\r
-                       FileExtensions="*.vc"\r
-                       ExecutionDescription="Copy $(InputDir)$(InputFileName) --&gt; $(InputDir)$(InputName)"\r
-                       >\r
-                       <Properties>\r
-                       </Properties>\r
-               </CustomBuildRule>\r
-       </Rules>\r
-</VisualStudioToolFile>\r
+<?xml version="1.0" encoding="utf-8"?>
+<VisualStudioToolFile
+       Name="Rename .vc Files"
+       Version="8,00"
+       >
+       <Rules>
+               <CustomBuildRule
+                       Name="rename .vc files"
+                       DisplayName="Rename .vc files"
+                       CommandLine="copy &quot;$(InputDir)$(InputFileName)&quot; &quot;$(InputDir)$(InputName)&quot; 1&gt;NUL"
+                       Outputs="$(InputDir)$(InputName) "
+                       FileExtensions="*.vc"
+                       ExecutionDescription="Copy $(InputDir)$(InputFileName) --&gt; $(InputDir)$(InputName)"
+                       >
+                       <Properties>
+                       </Properties>
+               </CustomBuildRule>
+       </Rules>
+</VisualStudioToolFile>
index 696ece5..c622321 100644 (file)
@@ -1,53 +1,53 @@
-/*-----------------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/*-----------------------------------------------------------------------------------*/\r
-#include "rk4.h"\r
-#include "stack-c.h"\r
-/*-----------------------------------------------------------------------------------*/\r
-/* Runge-Kutta (RK4) method */\r
-/* http://media4.obspm.fr/public/DEA/cours/chapitre3/souschapitre2/section4/page5/section3_2_4_5.html */\r
-/*-----------------------------------------------------------------------------------*/\r
-int C2F(rk4)(double *y, double *dydx, int *n,double *x, double *h, double *yout,void (*derivs)())\r
-{\r
-    double d = 0.0;\r
-    int i;\r
-    double h6 = 0.0, hh = 0.0, xh = 0.0, yt[10], dym[10], dyt[10];\r
-\r
-    /* Parameter adjustments (fortran)*/\r
-    --yout;\r
-    --dydx;\r
-    --y;\r
-\r
-    C2F(ierode).iero = 0;\r
-    hh = *h * 0.5;\r
-    h6 = *h / 6.0;\r
-    xh = *x + hh;\r
-\r
-    for (i = 1; i <= *n; ++i) yt[i - 1] = y[i] + hh * dydx[i];\r
-\r
-    (*derivs)(n, &xh, yt, dyt);\r
-\r
-    if (C2F(ierode).iero > 0) return 0;\r
-\r
-    for (i = 1; i <= *n; ++i) yt[i - 1] = y[i] + hh * dyt[i - 1];\r
-\r
-    (*derivs)(n, &xh, yt, dym);\r
-\r
-    if (C2F(ierode).iero > 0) return 0;\r
-\r
-    for (i = 1; i <= *n; ++i) \r
-    {\r
-               yt[i - 1] = y[i] + *h * dym[i - 1];\r
-               dym[i - 1] = dyt[i - 1] + dym[i - 1];\r
-    }\r
-    d = *x + *h;\r
-\r
-    (*derivs)(n, &d, yt, dyt);\r
-\r
-    if (C2F(ierode).iero > 0) return 0;\r
-\r
-    for (i = 1; i <= *n; ++i) yout[i] = y[i] + h6 * (dydx[i] + dyt[i - 1] + dym[i - 1] * 2.0);\r
-\r
-    return 0;\r
-}\r
-/*-----------------------------------------------------------------------------------*/\r
+/*-----------------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/*-----------------------------------------------------------------------------------*/
+#include "rk4.h"
+#include "stack-c.h"
+/*-----------------------------------------------------------------------------------*/
+/* Runge-Kutta (RK4) method */
+/* http://media4.obspm.fr/public/DEA/cours/chapitre3/souschapitre2/section4/page5/section3_2_4_5.html */
+/*-----------------------------------------------------------------------------------*/
+int C2F(rk4)(double *y, double *dydx, int *n,double *x, double *h, double *yout,void (*derivs)())
+{
+    double d = 0.0;
+    int i;
+    double h6 = 0.0, hh = 0.0, xh = 0.0, yt[10], dym[10], dyt[10];
+
+    /* Parameter adjustments (fortran)*/
+    --yout;
+    --dydx;
+    --y;
+
+    C2F(ierode).iero = 0;
+    hh = *h * 0.5;
+    h6 = *h / 6.0;
+    xh = *x + hh;
+
+    for (i = 1; i <= *n; ++i) yt[i - 1] = y[i] + hh * dydx[i];
+
+    (*derivs)(n, &xh, yt, dyt);
+
+    if (C2F(ierode).iero > 0) return 0;
+
+    for (i = 1; i <= *n; ++i) yt[i - 1] = y[i] + hh * dyt[i - 1];
+
+    (*derivs)(n, &xh, yt, dym);
+
+    if (C2F(ierode).iero > 0) return 0;
+
+    for (i = 1; i <= *n; ++i) 
+    {
+               yt[i - 1] = y[i] + *h * dym[i - 1];
+               dym[i - 1] = dyt[i - 1] + dym[i - 1];
+    }
+    d = *x + *h;
+
+    (*derivs)(n, &d, yt, dyt);
+
+    if (C2F(ierode).iero > 0) return 0;
+
+    for (i = 1; i <= *n; ++i) yout[i] = y[i] + h6 * (dydx[i] + dyt[i - 1] + dym[i - 1] * 2.0);
+
+    return 0;
+}
+/*-----------------------------------------------------------------------------------*/
index e826a1c..ca03064 100644 (file)
@@ -1,24 +1,24 @@
-/*-----------------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Allan CORNET */\r
-/*-----------------------------------------------------------------------------------*/\r
-#ifndef __RK4_H__\r
-#define __RK4_H__\r
-/*-----------------------------------------------------------------------------------*/\r
-#include "machine.h" /* C2F */\r
-\r
-/**\r
-* Runge-Kutta (RK4) method\r
-* @param y\r
-* @param dydx\r
-* @param n\r
-* @param x\r
-* @param h\r
-* @param yout\r
-* @param derivs\r
-* @return 0\r
-*/\r
-int C2F(rk4)(double *y, double *dydx, int *n,double *x, double *h, double *yout,void (*derivs)());\r
-/*-----------------------------------------------------------------------------------*/\r
-#endif /* __RK4_H__ */\r
-/*-----------------------------------------------------------------------------------*/\r
+/*-----------------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Allan CORNET */
+/*-----------------------------------------------------------------------------------*/
+#ifndef __RK4_H__
+#define __RK4_H__
+/*-----------------------------------------------------------------------------------*/
+#include "machine.h" /* C2F */
+
+/**
+* Runge-Kutta (RK4) method
+* @param y
+* @param dydx
+* @param n
+* @param x
+* @param h
+* @param yout
+* @param derivs
+* @return 0
+*/
+int C2F(rk4)(double *y, double *dydx, int *n,double *x, double *h, double *yout,void (*derivs)());
+/*-----------------------------------------------------------------------------------*/
+#endif /* __RK4_H__ */
+/*-----------------------------------------------------------------------------------*/
index bc9b2e0..f195bc1 100644 (file)
@@ -1,22 +1,22 @@
-c     ====================================\r
-c     runge kutta d'ordre 4 adaptatif \r
-c     l'interface lsrgk a ete fait en s'inspirant de lsode \r
-c     voir lsode.f pour comprendre le sens des variables \r
-c     ====================================\r
-      subroutine lsrgk (f, neq, y, t, tout, itol, rtol, atol, itask,\r
-     1            istate, iopt, rwork, lrw, iwork, liw, jac, mf)\r
-     \r
-      external f, jac,rkqc\r
-      integer neq, itol, itask, istate, iopt, lrw, iwork, liw, mf\r
-      double precision y, t, tout, rtol, atol, rwork\r
-      integer nok,nbad\r
-      dimension neq(*), y(*), rtol(*), atol(*), rwork(lrw), iwork(liw)\r
-      integer iero\r
-      common/ierode/iero\r
-      iero=0\r
-      call odeint(y,neq,t,tout,atol(1),1.0d-4,0.0d0,nok,nbad,f,rkqc)\r
-      t=tout\r
-      if (iero.gt.0) istate=-1\r
-      return\r
-      end\r
-c     ====================================\r
+c     ====================================
+c     runge kutta d'ordre 4 adaptatif 
+c     l'interface lsrgk a ete fait en s'inspirant de lsode 
+c     voir lsode.f pour comprendre le sens des variables 
+c     ====================================
+      subroutine lsrgk (f, neq, y, t, tout, itol, rtol, atol, itask,
+     1            istate, iopt, rwork, lrw, iwork, liw, jac, mf)
+     
+      external f, jac,rkqc
+      integer neq, itol, itask, istate, iopt, lrw, iwork, liw, mf
+      double precision y, t, tout, rtol, atol, rwork
+      integer nok,nbad
+      dimension neq(*), y(*), rtol(*), atol(*), rwork(lrw), iwork(liw)
+      integer iero
+      common/ierode/iero
+      iero=0
+      call odeint(y,neq,t,tout,atol(1),1.0d-4,0.0d0,nok,nbad,f,rkqc)
+      t=tout
+      if (iero.gt.0) istate=-1
+      return
+      end
+c     ====================================
index 7a8481e..b746f73 100644 (file)
@@ -1,78 +1,78 @@
-c     ====================================\r
-      subroutine odeint(ystart,nvar,x1,x2,eps,h1,hmin,nok,nbad,derivs,rk\r
-     *qc)\r
-C      implicit undefined (a-z)\r
-      external derivs,rkqc\r
-      integer maxstp,nmax,kmax,kount,nvar,i,nok,nbad,nstp\r
-      double precision two,zero,tiny,dxsav,xp(200),yp(10,200),x,h\r
-      parameter (maxstp=10000,nmax=10,two=2.0,zero=0.0,tiny=1.e-30)\r
-      double precision x1,x2,eps,h1,hmin,xsav,hdid,hnext\r
-      double precision ystart(nvar),yscal(nmax),y(nmax),dydx(nmax)\r
-      character*80 messag\r
-      common /path/ kmax,kount,dxsav,xp,yp\r
-      integer iero\r
-      common/ierode/iero\r
-      iero=0\r
-      if ( abs(x2-x1).le.tiny) return\r
-      x=x1\r
-      h=sign(h1,x2-x1)\r
-      nok=0\r
-      nbad=0\r
-      kount=0\r
-      do 11 i=1,nvar\r
-        y(i)=ystart(i)\r
-11    continue\r
-      xsav=x-dxsav*two\r
-      do 16 nstp=1,maxstp\r
-        call derivs(nvar,x,y,dydx)\r
-        if (iero.gt.0) return \r
-        do 12 i=1,nvar\r
-          yscal(i)=abs(y(i))+abs(h*dydx(i))+tiny\r
-12      continue\r
-        if(kmax.gt.0)then\r
-          if(abs(x-xsav).gt.abs(dxsav)) then\r
-            if(kount.lt.kmax-1)then\r
-              kount=kount+1\r
-              xp(kount)=x\r
-              do 13 i=1,nvar\r
-                yp(i,kount)=y(i)\r
-13            continue\r
-              xsav=x\r
-            endif\r
-          endif\r
-        endif\r
-        if((x+h-x2)*(x+h-x1).gt.zero) h=x2-x\r
-        call rkqc(y,dydx,nvar,x,h,eps,yscal,hdid,hnext,derivs)\r
-        if(iero.gt.0) return\r
-        if(hdid.eq.h)then\r
-          nok=nok+1\r
-        else\r
-          nbad=nbad+1\r
-        endif\r
-        if((x-x2)*(x2-x1).ge.zero)then\r
-          do 14 i=1,nvar\r
-            ystart(i)=y(i)\r
-14        continue\r
-          if(kmax.ne.0)then\r
-            kount=kount+1\r
-            xp(kount)=x\r
-            do 15 i=1,nvar\r
-              yp(i,kount)=y(i)\r
-15          continue\r
-          endif\r
-          return\r
-        endif\r
-        if(abs(hnext).lt.hmin) then\r
-           write(messag, 17) hnext,hmin\r
-           hnext=hmin\r
-        endif\r
-        h=hnext\r
-16    continue\r
-      iero=-1\r
-c      print *, 'Trop d''iterations a faire pour la precision demandee.'\r
-      return\r
- 17   format('stepsize ',e10.3,' smaller than minimum ',e10.3)\r
-      end\r
-c     ====================================\r
-      \r
+c     ====================================
+      subroutine odeint(ystart,nvar,x1,x2,eps,h1,hmin,nok,nbad,derivs,rk
+     *qc)
+C      implicit undefined (a-z)
+      external derivs,rkqc
+      integer maxstp,nmax,kmax,kount,nvar,i,nok,nbad,nstp
+      double precision two,zero,tiny,dxsav,xp(200),yp(10,200),x,h
+      parameter (maxstp=10000,nmax=10,two=2.0,zero=0.0,tiny=1.e-30)
+      double precision x1,x2,eps,h1,hmin,xsav,hdid,hnext
+      double precision ystart(nvar),yscal(nmax),y(nmax),dydx(nmax)
+      character*80 messag
+      common /path/ kmax,kount,dxsav,xp,yp
+      integer iero
+      common/ierode/iero
+      iero=0
+      if ( abs(x2-x1).le.tiny) return
+      x=x1
+      h=sign(h1,x2-x1)
+      nok=0
+      nbad=0
+      kount=0
+      do 11 i=1,nvar
+        y(i)=ystart(i)
+11    continue
+      xsav=x-dxsav*two
+      do 16 nstp=1,maxstp
+        call derivs(nvar,x,y,dydx)
+        if (iero.gt.0) return 
+        do 12 i=1,nvar
+          yscal(i)=abs(y(i))+abs(h*dydx(i))+tiny
+12      continue
+        if(kmax.gt.0)then
+          if(abs(x-xsav).gt.abs(dxsav)) then
+            if(kount.lt.kmax-1)then
+              kount=kount+1
+              xp(kount)=x
+              do 13 i=1,nvar
+                yp(i,kount)=y(i)
+13            continue
+              xsav=x
+            endif
+          endif
+        endif
+        if((x+h-x2)*(x+h-x1).gt.zero) h=x2-x
+        call rkqc(y,dydx,nvar,x,h,eps,yscal,hdid,hnext,derivs)
+        if(iero.gt.0) return
+        if(hdid.eq.h)then
+          nok=nok+1
+        else
+          nbad=nbad+1
+        endif
+        if((x-x2)*(x2-x1).ge.zero)then
+          do 14 i=1,nvar
+            ystart(i)=y(i)
+14        continue
+          if(kmax.ne.0)then
+            kount=kount+1
+            xp(kount)=x
+            do 15 i=1,nvar
+              yp(i,kount)=y(i)
+15          continue
+          endif
+          return
+        endif
+        if(abs(hnext).lt.hmin) then
+           write(messag, 17) hnext,hmin
+           hnext=hmin
+        endif
+        h=hnext
+16    continue
+      iero=-1
+c      print *, 'Trop d''iterations a faire pour la precision demandee.'
+      return
+ 17   format('stepsize ',e10.3,' smaller than minimum ',e10.3)
+      end
+c     ====================================
+      
       
\ No newline at end of file
index 341d26b..c34fc3d 100644 (file)
@@ -1,57 +1,57 @@
-c     ====================================\r
-      subroutine rkqc(y,dydx,n,x,htry,eps,yscal,hdid,hnext,derivs)\r
-C      implicit undefined (a-z)\r
-      integer nmax,n,i\r
-      double precision fcor,one,safety,errcon\r
-      parameter (nmax=10,fcor=.0666666667,\r
-     $     one=1.0,safety=0.9,errcon=6.e-4)\r
-      double precision x,htry,eps,hdid,hnext,pgrow,pshrnk,xsav,hh\r
-      double precision errmax,h,dysav(nmax)\r
-      double precision y(n),dydx(n),yscal(n),ytemp(nmax),ysav(nmax)\r
-     \r
-      external derivs\r
-      integer iero\r
-      common/ierode/iero\r
-      iero=0\r
-      pgrow=-0.20\r
-      pshrnk=-0.25\r
-      xsav=x\r
-      do 11 i=1,n\r
-        ysav(i)=y(i)\r
-        dysav(i)=dydx(i)\r
-11    continue\r
-      h=htry\r
-1     hh=0.5*h\r
-      call rk4(ysav,dysav,n,xsav,hh,ytemp,derivs)\r
-      x=xsav+hh\r
-      call derivs(n,x,ytemp,dydx)\r
-      if (iero.gt.0) return \r
-      call rk4(ytemp,dydx,n,x,hh,y,derivs)\r
-      x=xsav+h\r
-      if(x.eq.xsav) then \r
-         iero=1\r
-         return\r
-      endif\r
-      call rk4(ysav,dysav,n,xsav,h,ytemp,derivs)\r
-      errmax=0.\r
-      do 12 i=1,n\r
-        ytemp(i)=y(i)-ytemp(i)\r
-        errmax=max(errmax,abs(ytemp(i)/(yscal(i)*eps)))\r
-12    continue\r
-      if(errmax.gt.one) then\r
-        h=safety*h*(errmax**pshrnk)\r
-        goto 1\r
-      else\r
-        hdid=h\r
-        if(errmax.gt.errcon)then\r
-          hnext=safety*h*(errmax**pgrow)\r
-        else\r
-          hnext=4.*h\r
-        endif\r
-      endif\r
-      do 13 i=1,n\r
-        y(i)=y(i)+ytemp(i)*fcor\r
-13    continue\r
-      return\r
-      end\r
-c     ====================================\r
+c     ====================================
+      subroutine rkqc(y,dydx,n,x,htry,eps,yscal,hdid,hnext,derivs)
+C      implicit undefined (a-z)
+      integer nmax,n,i
+      double precision fcor,one,safety,errcon
+      parameter (nmax=10,fcor=.0666666667,
+     $     one=1.0,safety=0.9,errcon=6.e-4)
+      double precision x,htry,eps,hdid,hnext,pgrow,pshrnk,xsav,hh
+      double precision errmax,h,dysav(nmax)
+      double precision y(n),dydx(n),yscal(n),ytemp(nmax),ysav(nmax)
+     
+      external derivs
+      integer iero
+      common/ierode/iero
+      iero=0
+      pgrow=-0.20
+      pshrnk=-0.25
+      xsav=x
+      do 11 i=1,n
+        ysav(i)=y(i)
+        dysav(i)=dydx(i)
+11    continue
+      h=htry
+1     hh=0.5*h
+      call rk4(ysav,dysav,n,xsav,hh,ytemp,derivs)
+      x=xsav+hh
+      call derivs(n,x,ytemp,dydx)
+      if (iero.gt.0) return 
+      call rk4(ytemp,dydx,n,x,hh,y,derivs)
+      x=xsav+h
+      if(x.eq.xsav) then 
+         iero=1
+         return
+      endif
+      call rk4(ysav,dysav,n,xsav,h,ytemp,derivs)
+      errmax=0.
+      do 12 i=1,n
+        ytemp(i)=y(i)-ytemp(i)
+        errmax=max(errmax,abs(ytemp(i)/(yscal(i)*eps)))
+12    continue
+      if(errmax.gt.one) then
+        h=safety*h*(errmax**pshrnk)
+        goto 1
+      else
+        hdid=h
+        if(errmax.gt.errcon)then
+          hnext=safety*h*(errmax**pgrow)
+        else
+          hnext=4.*h
+        endif
+      endif
+      do 13 i=1,n
+        y(i)=y(i)+ytemp(i)*fcor
+13    continue
+      return
+      end
+c     ====================================
index 44e16b7..075f4ec 100644 (file)
@@ -1,31 +1,31 @@
-c     ====================================\r
-c     INRIA 2007\r
-c     Allan CORNET\r
-c     ====================================\r
-      subroutine writebufodea(buf,itask,meth,jactyp,ml,mu,iopt)\r
-      character*(*) buf\r
-      integer itask\r
-      integer meth\r
-      integer jactyp\r
-      integer ml\r
-      integer mu\r
-      integer iopt\r
-      \r
-      write(buf,'(''itask = '',i3,'' meth = '',i3,'' jactyp = '','//\r
-     $     'i3,'' ml = '',i3,'' mu = '',i3,'' iopt = '',i3)') \r
-     $           itask,meth,jactyp,ml,mu,iopt\r
-     \r
-      \r
-      end\r
-c     ====================================           \r
-      subroutine writebufodeb(buf,tcrit,ho,hmax,hmin)\r
-      character*(*) buf      \r
-      double precision tcrit\r
-      double precision ho\r
-      double precision hmax\r
-      double precision hmin\r
-      write(buf,'(''tcrit= '',e9.4,'' h0= '',e9.4, '' hmax= '','//\r
-     $       'e9.4,'' hmin = '',e9.4)')\r
-     $    tcrit,ho,hmax,hmin\r
-      end\r
-c     ====================================           \r
+c     ====================================
+c     INRIA 2007
+c     Allan CORNET
+c     ====================================
+      subroutine writebufodea(buf,itask,meth,jactyp,ml,mu,iopt)
+      character*(*) buf
+      integer itask
+      integer meth
+      integer jactyp
+      integer ml
+      integer mu
+      integer iopt
+      
+      write(buf,'(''itask = '',i3,'' meth = '',i3,'' jactyp = '','//
+     $     'i3,'' ml = '',i3,'' mu = '',i3,'' iopt = '',i3)') 
+     $           itask,meth,jactyp,ml,mu,iopt
+     
+      
+      end
+c     ====================================           
+      subroutine writebufodeb(buf,tcrit,ho,hmax,hmin)
+      character*(*) buf      
+      double precision tcrit
+      double precision ho
+      double precision hmax
+      double precision hmin
+      write(buf,'(''tcrit= '',e9.4,'' h0= '',e9.4, '' hmax= '','//
+     $       'e9.4,'' hmin = '',e9.4)')
+     $    tcrit,ho,hmax,hmin
+      end
+c     ====================================           
index 1f7f90b..6381748 100644 (file)
@@ -1,25 +1,25 @@
-/*-----------------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Allan CORNET */\r
-/*-----------------------------------------------------------------------------------*/ \r
-#ifndef __XERHLT_H__\r
-#define __XERHLT_H__\r
-\r
-#include "machine.h" /* C2F */\r
-\r
-/**\r
-* do a long jump (slatec)\r
-* @param messg a message \r
-* @param l lenght of messg\r
-*/\r
-void C2F(xerhlt) (char *messg, unsigned long l);\r
-\r
-/**\r
-* setjmp slatec\r
-* @returns the value 0 if returning directly and  non-zero\r
-* when returning from longjmp() using the saved context\r
-*/\r
-int setjmp_slatec_jmp_env(void);\r
-\r
-#endif /* __XERHLT_H__ */\r
-/*-----------------------------------------------------------------------------------*/ \r
+/*-----------------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Allan CORNET */
+/*-----------------------------------------------------------------------------------*/ 
+#ifndef __XERHLT_H__
+#define __XERHLT_H__
+
+#include "machine.h" /* C2F */
+
+/**
+* do a long jump (slatec)
+* @param messg a message 
+* @param l lenght of messg
+*/
+void C2F(xerhlt) (char *messg, unsigned long l);
+
+/**
+* setjmp slatec
+* @returns the value 0 if returning directly and  non-zero
+* when returning from longjmp() using the saved context
+*/
+int setjmp_slatec_jmp_env(void);
+
+#endif /* __XERHLT_H__ */
+/*-----------------------------------------------------------------------------------*/ 
index 21b91f7..cfd1a25 100644 (file)
-#include <stdio.h>\r
-#include <iostream>\r
-#include <string.h>\r
-#include "stack-c.h"\r
-#include "sortTemplate.h"\r
-\r
-using namespace std;\r
-/*------------------------------------------------------------------------------------------*/\r
-template <class T>\r
-T GetMax (T a, T b) {\r
-  return (a>b?1:0);\r
-}\r
-/*------------------------------------------------------------------------------------------*/\r
-template <class D>\r
-void swap (D *a, D *b) {\r
-  D *p;\r
-  *p=*a;\r
-  *a=*b;\r
-  *b=*p;\r
-}\r
-/*------------------------------------------------------------------------------------------*/\r
-template <class T>\r
-void mutisort (T *keys1,int indices[20],int m1,int n1,char *typex, char *iord)\r
-{\r
-    int i,j,p,f;\r
-    T keys[20][20];\r
-       if (typex[1]=='r') \r
-       {\r
-           for (i=0;i<m1;i++)  indices[i]=i+1;\r
-               for (i=1;i<=n1;i++)\r
-               for (j=1;j<=m1;j++)  keys[j-1][i-1]=keys1[(i-1)*m1+j-1];\r
-               for(i=m1-1;i>0;i--)\r
-                 for(j=0;j<i;j++)\r
-                 {\r
-                         for (p=0;keys[j][p]==keys[j+1][p] ;p++);\r
-                         if (iord[0]=='i')\r
-                         {\r
-                                 if (GetMax(keys[j][p],keys[j+1][p])) \r
-                                 {\r
-                                       swap(indices[j],indices[j+1]);  \r
-                                          for (f=0;f<n1;f++)\r
-                                               {                \r
-                                                 \r
-                                                 swap(keys[j][f],keys[j+1][f]);                        \r
-                                               }\r
-                                 }\r
-                         }\r
-                         else if (iord[0]=='d')\r
-                                 if (!GetMax(keys[j][p],keys[j+1][p])) \r
-                                 {\r
-                                       swap(indices[j],indices[j+1]);  \r
-                                         for (f=0;f<n1;f++)\r
-                                               {                \r
-                                                 \r
-                                                 swap(keys[j][f],keys[j+1][f]);                        \r
-                                               }\r
-                                 }\r
-                  }\r
-                 for (i=1;i<=n1;i++)\r
-                         for (j=1;j<=m1;j++)  keys1[(i-1)*m1+j-1]=keys[j-1][i-1];\r
-       }\r
-       if (typex[1]=='c') \r
-       {\r
-               for (i=0;i<n1;i++)  indices[i]=i+1;\r
-               for (i=1;i<=n1;i++)\r
-                       for (j=1;j<=m1;j++)  keys[i-1][j-1]=keys1[(i-1)*m1+j-1];\r
-               for(i=n1-1;i>0;i--)\r
-                 for(j=0;j<i;j++)\r
-                 {\r
-                         for (p=0;keys[j][p]==keys[j+1][p] ;p++);\r
-                         if (iord[0]=='i')\r
-                         {\r
-                                 if (GetMax(keys[j][p],keys[j+1][p])) \r
-                                 {\r
-                                         swap(indices[j],indices[j+1]);        \r
-                                         for (f=0;f<m1;f++)\r
-                                               {                \r
-                                                 swap(keys[j][f],keys[j+1][f]);                        \r
-                                               }\r
-                                 }\r
-                         }\r
-                         else if (iord[0]=='d')\r
-                                 if (!GetMax(keys[j][p],keys[j+1][p])) \r
-                                 {\r
-                                         swap(indices[j],indices[j+1]);\r
-                                         for (f=0;f<m1;f++)\r
-                                               {                \r
-                                                 swap(keys[j][f],keys[j+1][f]);                        \r
-                                               }\r
-                                 }\r
-                 }\r
-                 for (i=1;i<=n1;i++)\r
-                         for (j=1;j<=m1;j++)  keys1[(i-1)*m1+j-1]=keys[i-1][j-1];\r
-       }\r
-       \r
-}\r
-/*------------------------------------------------------------------------------------------*/\r
-template <class T>\r
-void mutirowsort (T *keys1,int indices[20],int m1,int n1,char *typex, char *iord)\r
-\r
-{\r
-    int i,j,p;\r
-    T keys[20][20];\r
-       int Xindices[20][20];\r
-       if (typex[0]=='r') \r
-       {\r
-           for (i=0;i<m1;i++)\r
-                  for (j=0;j<n1;j++) Xindices[i][j]=i+1;\r
-               for (i=1;i<=n1;i++)\r
-                  for (j=1;j<=m1;j++)  keys[j-1][i-1]=keys1[(i-1)*m1+j-1];\r
-               for (p=0;p<n1;p++) \r
-           { \r
-                       for(i=m1-1;i>0;i--)\r
-                         for(j=0;j<i;j++)\r
-                         {\r
-                                 if (iord[0]=='i')\r
-                                 {\r
-                                         if (GetMax(keys[j][p],keys[j+1][p])) \r
-                                         {\r
-                                                         swap(Xindices[j][p],Xindices[j+1][p]);\r
-                                                         swap(keys[j][p],keys[j+1][p]);                        \r
-                                         }\r
-                                 }\r
-                                 else if (iord[0]=='d')\r
-                                         if (!GetMax(keys[j][p],keys[j+1][p])) \r
-                                         {\r
-                                                         swap(Xindices[j][p],Xindices[j+1][p]);\r
-                                                         swap(keys[j][p],keys[j+1][p]);                        \r
-                                         }\r
-                          }\r
-               }\r
-                 for (i=1;i<=n1;i++)\r
-                         for (j=1;j<=m1;j++)\r
-                         {\r
-                                 keys1[(i-1)*m1+j-1]=keys[j-1][i-1];\r
-                                 indices[(i-1)*m1+j-1]=Xindices[j-1][i-1];\r
-                         }   \r
-       }\r
-       if (typex[0]=='c') \r
-       {\r
-                for (i=0;i<m1;i++)\r
-                  for (j=0;j<n1;j++) Xindices[j][i]=j+1;\r
-               for (i=1;i<=n1;i++)\r
-                       for (j=1;j<=m1;j++)  keys[i-1][j-1]=keys1[(i-1)*m1+j-1];\r
-               for (p=0;p<m1;p++) \r
-           { \r
-                       for(i=n1-1;i>0;i--)\r
-                         for(j=0;j<i;j++)\r
-                         {\r
-                                 if (iord[0]=='i')\r
-                                 {\r
-                                         if (GetMax(keys[j][p],keys[j+1][p])) \r
-                                         {\r
-                                                         swap(Xindices[j][p],Xindices[j+1][p]);\r
-                                                         swap(keys[j][p],keys[j+1][p]);                        \r
-                                         }\r
-                                 }\r
-                                 else if (iord[0]=='d')\r
-                                         if (!GetMax(keys[j][p],keys[j+1][p])) \r
-                                         {\r
-                                                         swap(Xindices[j][p],Xindices[j+1][p]);\r
-                                                         swap(keys[j][p],keys[j+1][p]);                        \r
-                                         }\r
-                          }\r
-               }\r
-                 for (i=1;i<=n1;i++)\r
-                         for (j=1;j<=m1;j++) \r
-                         {\r
-                                 keys1[(i-1)*m1+j-1]=keys[i-1][j-1];\r
-                                 indices[(i-1)*m1+j-1]=Xindices[i-1][j-1];\r
-                         }\r
-       }\r
-       \r
-}\r
-/*------------------------------------------------------------------------------------------*/\r
-template <class T>\r
-void wholesort (T *keys,int indices[20],int m1,int n1,char *typex, char *iord)\r
-\r
-{\r
-    int i,j,k;\r
-       k=0;\r
-    for (i=1;i<=m1;i++)\r
-    for (j=1;j<=n1;j++) indices[k++]=(i-1)*n1+j;\r
-       for(i=m1*n1-1;i>0;i--)\r
-         for(j=0;j<i;j++)\r
-         {\r
-                 if (iord[0]=='i')\r
-                 {\r
-                         if (GetMax(keys[j],keys[j+1])) \r
-                         {\r
-                                         swap(indices[j],indices[j+1]);\r
-                                         swap(keys[j],keys[j+1]);                      \r
-                         }\r
-                 }\r
-                 else if (iord[0]=='d')\r
-                         if (!GetMax(keys[j],keys[j+1])) \r
-                         {\r
-                                         swap(indices[j],indices[j+1]);\r
-                                         swap(keys[j],keys[j+1]);                      \r
-                         }\r
-          }\r
-       \r
-}\r
-/*------------------------------------------------------------------------------------------*/\r
-void lgsortd(double *keys1,int indices[20],int m1,int n1,char *typex, char *iord)\r
-{\r
-  mutisort (keys1,indices,m1,n1,typex,iord);\r
-}\r
-/*------------------------------------------------------------------------------------------*/\r
-\r
-void lgsorts1(char *keys1,int indices[20],int m1,int n1,char *typex, char *iord)\r
-{\r
-  mutisort (keys1,indices,m1,n1,typex,iord);\r
-}\r
-/*------------------------------------------------------------------------------------------*/\r
-void rowcolsortd(double *keys1, int indices[20], int m1, int n1, char *typex, char *iord)\r
-{\r
-     mutirowsort(keys1,indices,m1,n1,typex,iord);\r
-}\r
-/*------------------------------------------------------------------------------------------*/\r
-void wholesortd(double *keys1, int indices[20], int m1, int n1, char *typex, char *iord)\r
-{\r
-     wholesort(keys1,indices,m1,n1,typex,iord);\r
-}\r
-/*------------------------------------------------------------------------------------------*/\r
-void wholesorts(char **keys, int indices[20], int m1, int n1, char *typex, char *iord)\r
-{\r
-    int i,j,k,p,f;\r
-       k=0;\r
-    for (i=1;i<=m1;i++)\r
-      for (j=1;j<=n1;j++) indices[k++]=(i-1)*n1+j;\r
-       for(i=m1*n1-1;i>0;i--)\r
-         for(j=0;j<i;j++)\r
-         {\r
-                 for (p=0;keys[j][p]==keys[j+1][p] ;p++);\r
-                 if (iord[0]=='i')\r
-                 {\r
-                         if (GetMax(keys[j][p],keys[j+1][p])) \r
-                         {\r
-                                         swap(indices[j],indices[j+1]);\r
-                                         for (f=0;f<max(strlen(keys[j]),strlen(keys[j+1]));f++)\r
-                                               {                \r
-                                                 swap(keys[j][f],keys[j+1][f]);                        \r
-                                               }\r
-                       \r
-                         }\r
-                 }\r
-                 else if (iord[0]=='d')\r
-                         if (!GetMax(keys[j][p],keys[j+1][p])) \r
-                         {\r
-                                         swap(indices[j],indices[j+1]);\r
-                                         for (f=0;f<max(strlen(keys[j]),strlen(keys[j+1]));f++)\r
-                                               {                \r
-                                                 swap(keys[j][f],keys[j+1][f]);                        \r
-                                               }\r
-                       \r
-                         }\r
-          }\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-}\r
-/*------------------------------------------------------------------------------------------*/\r
-void rowcolsorts(char *keys1, int indices[20], int m1, int n1, char *typex, char *iord)\r
-{\r
-     mutirowsort(keys1,indices,m1,n1,typex,iord);\r
-}\r
-/*------------------------------------------------------------------------------------------*/\r
+#include <stdio.h>
+#include <iostream>
+#include <string.h>
+#include "stack-c.h"
+#include "sortTemplate.h"
+
+using namespace std;
+/*------------------------------------------------------------------------------------------*/
+template <class T>
+T GetMax (T a, T b) {
+  return (a>b?1:0);
+}
+/*------------------------------------------------------------------------------------------*/
+template <class D>
+void swap (D *a, D *b) {
+  D *p;
+  *p=*a;
+  *a=*b;
+  *b=*p;
+}
+/*------------------------------------------------------------------------------------------*/
+template <class T>
+void mutisort (T *keys1,int indices[20],int m1,int n1,char *typex, char *iord)
+{
+    int i,j,p,f;
+    T keys[20][20];
+       if (typex[1]=='r') 
+       {
+           for (i=0;i<m1;i++)  indices[i]=i+1;
+               for (i=1;i<=n1;i++)
+               for (j=1;j<=m1;j++)  keys[j-1][i-1]=keys1[(i-1)*m1+j-1];
+               for(i=m1-1;i>0;i--)
+                 for(j=0;j<i;j++)
+                 {
+                         for (p=0;keys[j][p]==keys[j+1][p] ;p++);
+                         if (iord[0]=='i')
+                         {
+                                 if (GetMax(keys[j][p],keys[j+1][p])) 
+                                 {
+                                       swap(indices[j],indices[j+1]);  
+                                          for (f=0;f<n1;f++)
+                                               {                
+                                                 
+                                                 swap(keys[j][f],keys[j+1][f]);                        
+                                               }
+                                 }
+                         }
+                         else if (iord[0]=='d')
+                                 if (!GetMax(keys[j][p],keys[j+1][p])) 
+                                 {
+                                       swap(indices[j],indices[j+1]);  
+                                         for (f=0;f<n1;f++)
+                                               {                
+                                                 
+                                                 swap(keys[j][f],keys[j+1][f]);                        
+                                               }
+                                 }
+                  }
+                 for (i=1;i<=n1;i++)
+                         for (j=1;j<=m1;j++)  keys1[(i-1)*m1+j-1]=keys[j-1][i-1];
+       }
+       if (typex[1]=='c') 
+       {
+               for (i=0;i<n1;i++)  indices[i]=i+1;
+               for (i=1;i<=n1;i++)
+                       for (j=1;j<=m1;j++)  keys[i-1][j-1]=keys1[(i-1)*m1+j-1];
+               for(i=n1-1;i>0;i--)
+                 for(j=0;j<i;j++)
+                 {
+                         for (p=0;keys[j][p]==keys[j+1][p] ;p++);
+                         if (iord[0]=='i')
+                         {
+                                 if (GetMax(keys[j][p],keys[j+1][p])) 
+                                 {
+                                         swap(indices[j],indices[j+1]);        
+                                         for (f=0;f<m1;f++)
+                                               {                
+                                                 swap(keys[j][f],keys[j+1][f]);                        
+                                               }
+                                 }
+                         }
+                         else if (iord[0]=='d')
+                                 if (!GetMax(keys[j][p],keys[j+1][p])) 
+                                 {
+                                         swap(indices[j],indices[j+1]);
+                                         for (f=0;f<m1;f++)
+                                               {                
+                                                 swap(keys[j][f],keys[j+1][f]);                        
+                                               }
+                                 }
+                 }
+                 for (i=1;i<=n1;i++)
+                         for (j=1;j<=m1;j++)  keys1[(i-1)*m1+j-1]=keys[i-1][j-1];
+       }
+       
+}
+/*------------------------------------------------------------------------------------------*/
+template <class T>
+void mutirowsort (T *keys1,int indices[20],int m1,int n1,char *typex, char *iord)
+
+{
+    int i,j,p;
+    T keys[20][20];
+       int Xindices[20][20];
+       if (typex[0]=='r') 
+       {
+           for (i=0;i<m1;i++)
+                  for (j=0;j<n1;j++) Xindices[i][j]=i+1;
+               for (i=1;i<=n1;i++)
+                  for (j=1;j<=m1;j++)  keys[j-1][i-1]=keys1[(i-1)*m1+j-1];
+               for (p=0;p<n1;p++) 
+           { 
+                       for(i=m1-1;i>0;i--)
+                         for(j=0;j<i;j++)
+                         {
+                                 if (iord[0]=='i')
+                                 {
+                                         if (GetMax(keys[j][p],keys[j+1][p])) 
+                                         {
+                                                         swap(Xindices[j][p],Xindices[j+1][p]);
+                                                         swap(keys[j][p],keys[j+1][p]);                        
+                                         }
+                                 }
+                                 else if (iord[0]=='d')
+                                         if (!GetMax(keys[j][p],keys[j+1][p])) 
+                                         {
+                                                         swap(Xindices[j][p],Xindices[j+1][p]);
+                                                         swap(keys[j][p],keys[j+1][p]);                        
+                                         }
+                          }
+               }
+                 for (i=1;i<=n1;i++)
+                         for (j=1;j<=m1;j++)
+                         {
+                                 keys1[(i-1)*m1+j-1]=keys[j-1][i-1];
+                                 indices[(i-1)*m1+j-1]=Xindices[j-1][i-1];
+                         }   
+       }
+       if (typex[0]=='c') 
+       {
+                for (i=0;i<m1;i++)
+                  for (j=0;j<n1;j++) Xindices[j][i]=j+1;
+               for (i=1;i<=n1;i++)
+                       for (j=1;j<=m1;j++)  keys[i-1][j-1]=keys1[(i-1)*m1+j-1];
+               for (p=0;p<m1;p++) 
+           { 
+                       for(i=n1-1;i>0;i--)
+                         for(j=0;j<i;j++)
+                         {
+                                 if (iord[0]=='i')
+                                 {
+                                         if (GetMax(keys[j][p],keys[j+1][p])) 
+                                         {
+                                                         swap(Xindices[j][p],Xindices[j+1][p]);
+                                                         swap(keys[j][p],keys[j+1][p]);                        
+                                         }
+                                 }
+                                 else if (iord[0]=='d')
+                                         if (!GetMax(keys[j][p],keys[j+1][p])) 
+                                         {
+                                                         swap(Xindices[j][p],Xindices[j+1][p]);
+                                                         swap(keys[j][p],keys[j+1][p]);                        
+                                         }
+                          }
+               }
+                 for (i=1;i<=n1;i++)
+                         for (j=1;j<=m1;j++) 
+                         {
+                                 keys1[(i-1)*m1+j-1]=keys[i-1][j-1];
+                                 indices[(i-1)*m1+j-1]=Xindices[i-1][j-1];
+                         }
+       }
+       
+}
+/*------------------------------------------------------------------------------------------*/
+template <class T>
+void wholesort (T *keys,int indices[20],int m1,int n1,char *typex, char *iord)
+
+{
+    int i,j,k;
+       k=0;
+    for (i=1;i<=m1;i++)
+    for (j=1;j<=n1;j++) indices[k++]=(i-1)*n1+j;
+       for(i=m1*n1-1;i>0;i--)
+         for(j=0;j<i;j++)
+         {
+                 if (iord[0]=='i')
+                 {
+                         if (GetMax(keys[j],keys[j+1])) 
+                         {
+                                         swap(indices[j],indices[j+1]);
+                                         swap(keys[j],keys[j+1]);                      
+                         }
+                 }
+                 else if (iord[0]=='d')
+                         if (!GetMax(keys[j],keys[j+1])) 
+                         {
+                                         swap(indices[j],indices[j+1]);
+                                         swap(keys[j],keys[j+1]);                      
+                         }
+          }
+       
+}
+/*------------------------------------------------------------------------------------------*/
+void lgsortd(double *keys1,int indices[20],int m1,int n1,char *typex, char *iord)
+{
+  mutisort (keys1,indices,m1,n1,typex,iord);
+}
+/*------------------------------------------------------------------------------------------*/
+
+void lgsorts1(char *keys1,int indices[20],int m1,int n1,char *typex, char *iord)
+{
+  mutisort (keys1,indices,m1,n1,typex,iord);
+}
+/*------------------------------------------------------------------------------------------*/
+void rowcolsortd(double *keys1, int indices[20], int m1, int n1, char *typex, char *iord)
+{
+     mutirowsort(keys1,indices,m1,n1,typex,iord);
+}
+/*------------------------------------------------------------------------------------------*/
+void wholesortd(double *keys1, int indices[20], int m1, int n1, char *typex, char *iord)
+{
+     wholesort(keys1,indices,m1,n1,typex,iord);
+}
+/*------------------------------------------------------------------------------------------*/
+void wholesorts(char **keys, int indices[20], int m1, int n1, char *typex, char *iord)
+{
+    int i,j,k,p,f;
+       k=0;
+    for (i=1;i<=m1;i++)
+      for (j=1;j<=n1;j++) indices[k++]=(i-1)*n1+j;
+       for(i=m1*n1-1;i>0;i--)
+         for(j=0;j<i;j++)
+         {
+                 for (p=0;keys[j][p]==keys[j+1][p] ;p++);
+                 if (iord[0]=='i')
+                 {
+                         if (GetMax(keys[j][p],keys[j+1][p])) 
+                         {
+                                         swap(indices[j],indices[j+1]);
+                                         for (f=0;f<max(strlen(keys[j]),strlen(keys[j+1]));f++)
+                                               {                
+                                                 swap(keys[j][f],keys[j+1][f]);                        
+                                               }
+                       
+                         }
+                 }
+                 else if (iord[0]=='d')
+                         if (!GetMax(keys[j][p],keys[j+1][p])) 
+                         {
+                                         swap(indices[j],indices[j+1]);
+                                         for (f=0;f<max(strlen(keys[j]),strlen(keys[j+1]));f++)
+                                               {                
+                                                 swap(keys[j][f],keys[j+1][f]);                        
+                                               }
+                       
+                         }
+          }
+
+
+
+
+
+
+
+
+}
+/*------------------------------------------------------------------------------------------*/
+void rowcolsorts(char *keys1, int indices[20], int m1, int n1, char *typex, char *iord)
+{
+     mutirowsort(keys1,indices,m1,n1,typex,iord);
+}
+/*------------------------------------------------------------------------------------------*/
index 0185abd..5d705d5 100644 (file)
@@ -1,31 +1,31 @@
-/*-----------------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Allan CORNET */\r
-/*-----------------------------------------------------------------------------------*/\r
-#include "gw_fileio.h"\r
-#include "stack-c.h"\r
-#include "MALLOC.h"\r
-#include "Scierror.h"\r
-/*-----------------------------------------------------------------------------------*/\r
-int C2F(sci_filesep) _PARAMS((char *fname,unsigned long fname_len))\r
-{\r
-       static int n1,m1;\r
-       char *separator=NULL;\r
-\r
-       CheckRhs(0,0);\r
-       CheckLhs(1,1);\r
-\r
-       separator=(char*)MALLOC(sizeof(char)*(strlen(DIR_SEPARATOR)+1));\r
-       if (separator) strcpy(separator,DIR_SEPARATOR);\r
-\r
-       n1 = 1;\r
-       CreateVarFromPtr(Rhs+1, "c",(m1=(int)strlen(separator), &m1),&n1,&separator);\r
-       LhsVar(1)=Rhs+1;\r
-       C2F(putlhsvar)();\r
-\r
-       if (separator) {FREE(separator);separator=NULL;}\r
-\r
-       return 0;\r
-}\r
-/*-----------------------------------------------------------------------------------*/\r
-\r
+/*-----------------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Allan CORNET */
+/*-----------------------------------------------------------------------------------*/
+#include "gw_fileio.h"
+#include "stack-c.h"
+#include "MALLOC.h"
+#include "Scierror.h"
+/*-----------------------------------------------------------------------------------*/
+int C2F(sci_filesep) _PARAMS((char *fname,unsigned long fname_len))
+{
+       static int n1,m1;
+       char *separator=NULL;
+
+       CheckRhs(0,0);
+       CheckLhs(1,1);
+
+       separator=(char*)MALLOC(sizeof(char)*(strlen(DIR_SEPARATOR)+1));
+       if (separator) strcpy(separator,DIR_SEPARATOR);
+
+       n1 = 1;
+       CreateVarFromPtr(Rhs+1, "c",(m1=(int)strlen(separator), &m1),&n1,&separator);
+       LhsVar(1)=Rhs+1;
+       C2F(putlhsvar)();
+
+       if (separator) {FREE(separator);separator=NULL;}
+
+       return 0;
+}
+/*-----------------------------------------------------------------------------------*/
+
index 4dabf79..aeba56d 100644 (file)
@@ -1,30 +1,30 @@
-/*-----------------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Allan CORNET */\r
-/*-----------------------------------------------------------------------------------*/\r
-#include "gw_fileio.h"\r
-#include "stack-c.h"\r
-#include "MALLOC.h"\r
-#include "Scierror.h"\r
-/*-----------------------------------------------------------------------------------*/\r
-int C2F(sci_pathsep) _PARAMS((char *fname,unsigned long fname_len))\r
-{\r
-       static int n1,m1;\r
-       char *separator=NULL;\r
-\r
-       CheckRhs(0,0);\r
-       CheckLhs(1,1);\r
-\r
-       separator=(char*)MALLOC(sizeof(char)*(strlen(PATH_SEPARATOR)+1));\r
-       if (separator) strcpy(separator,PATH_SEPARATOR);\r
-       \r
-       n1 = 1;\r
-       CreateVarFromPtr(Rhs+1, "c",(m1=(int)strlen(separator), &m1),&n1,&separator);\r
-       LhsVar(1)=Rhs+1;\r
-       C2F(putlhsvar)();\r
-\r
-       if (separator) {FREE(separator);separator=NULL;}\r
-\r
-       return 0;\r
-}\r
-/*-----------------------------------------------------------------------------------*/\r
+/*-----------------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Allan CORNET */
+/*-----------------------------------------------------------------------------------*/
+#include "gw_fileio.h"
+#include "stack-c.h"
+#include "MALLOC.h"
+#include "Scierror.h"
+/*-----------------------------------------------------------------------------------*/
+int C2F(sci_pathsep) _PARAMS((char *fname,unsigned long fname_len))
+{
+       static int n1,m1;
+       char *separator=NULL;
+
+       CheckRhs(0,0);
+       CheckLhs(1,1);
+
+       separator=(char*)MALLOC(sizeof(char)*(strlen(PATH_SEPARATOR)+1));
+       if (separator) strcpy(separator,PATH_SEPARATOR);
+       
+       n1 = 1;
+       CreateVarFromPtr(Rhs+1, "c",(m1=(int)strlen(separator), &m1),&n1,&separator);
+       LhsVar(1)=Rhs+1;
+       C2F(putlhsvar)();
+
+       if (separator) {FREE(separator);separator=NULL;}
+
+       return 0;
+}
+/*-----------------------------------------------------------------------------------*/
index 1e142c4..4b883f5 100644 (file)
@@ -1,31 +1,31 @@
-/*------------------------------------------------------------------------*/\r
-/* Copyright INRIA 2007                                                   */\r
-/* Authors : Allan Cornet                                                                                    */\r
-/* desc : interface for historysize primitive                             */\r
-/*------------------------------------------------------------------------*/\r
-#include "gw_shell.h"\r
-#include "machine.h"\r
-#include "stack-c.h"\r
-#include "HistoryManager.h"\r
-#include "MALLOC.h"\r
-/*-----------------------------------------------------------------------------------*/\r
-int C2F(sci_historysize) _PARAMS((char *fname,unsigned long fname_len))\r
-{\r
-       int *paramoutINT=NULL;\r
-       int n = 1;\r
-       Rhs = Max(Rhs,0);\r
-       CheckRhs(0,0);\r
-       CheckLhs(0,1);\r
-\r
-       paramoutINT=(int*)MALLOC(sizeof(int));\r
-\r
-       *paramoutINT = getSizeScilabHistory();\r
-\r
-       CreateVarFromPtr(Rhs+1, "i", &n, &n, &paramoutINT);\r
-       LhsVar(1) = Rhs+1;\r
-       C2F(putlhsvar)();\r
-\r
-       if (paramoutINT) {FREE(paramoutINT);paramoutINT = NULL;}\r
-       return 0 ;\r
-}\r
-/*-----------------------------------------------------------------------------------*/\r
+/*------------------------------------------------------------------------*/
+/* Copyright INRIA 2007                                                   */
+/* Authors : Allan Cornet                                                                                    */
+/* desc : interface for historysize primitive                             */
+/*------------------------------------------------------------------------*/
+#include "gw_shell.h"
+#include "machine.h"
+#include "stack-c.h"
+#include "HistoryManager.h"
+#include "MALLOC.h"
+/*-----------------------------------------------------------------------------------*/
+int C2F(sci_historysize) _PARAMS((char *fname,unsigned long fname_len))
+{
+       int *paramoutINT=NULL;
+       int n = 1;
+       Rhs = Max(Rhs,0);
+       CheckRhs(0,0);
+       CheckLhs(0,1);
+
+       paramoutINT=(int*)MALLOC(sizeof(int));
+
+       *paramoutINT = getSizeScilabHistory();
+
+       CreateVarFromPtr(Rhs+1, "i", &n, &n, &paramoutINT);
+       LhsVar(1) = Rhs+1;
+       C2F(putlhsvar)();
+
+       if (paramoutINT) {FREE(paramoutINT);paramoutINT = NULL;}
+       return 0 ;
+}
+/*-----------------------------------------------------------------------------------*/
index f98e65f..dd1f1a5 100644 (file)
@@ -1,45 +1,45 @@
-/*-----------------------------------------------------------------------------------*/\r
-/* Copyright INRIA 2007                                                              */\r
-/* Author : Allan Cornet                                                             */\r
-/* desc : interface for removelinehistory primitive                                  */\r
-/*-----------------------------------------------------------------------------------*/\r
-#include "gw_shell.h"\r
-#include "stack-c.h"\r
-#include "Scierror.h"\r
-#include "HistoryManager.h"\r
-/*-----------------------------------------------------------------------------------*/\r
-int C2F(sci_removelinehistory) _PARAMS((char *fname,unsigned long fname_len))\r
-{\r
-       Rhs = Max(Rhs,0);\r
-       CheckRhs(1,1);\r
-       CheckLhs(0,1);\r
-\r
-       if ( GetType(1) == sci_matrix )\r
-       {\r
-               int N = -1;\r
-               int l1,m1=1,n1=1;\r
-               GetRhsVar(1,"i",&m1,&n1,&l1);\r
-               N=*istk(l1);\r
-\r
-               if ( (N < 0) || (N > getSizeScilabHistory()) )\r
-               {\r
-                       Scierror(999,"Invalid parameter.\n");\r
-                       return 0;\r
-               }\r
-               else\r
-               {\r
-                       deleteNthLineScilabHistory(N);\r
-               }\r
-       }\r
-       else\r
-       {\r
-               Scierror(999,"Invalid parameter.\n");\r
-               return 0;\r
-       }\r
-\r
-\r
-       LhsVar(1) = 0;\r
-       C2F(putlhsvar)();\r
-       return 0;\r
-}\r
-/*-----------------------------------------------------------------------------------*/\r
+/*-----------------------------------------------------------------------------------*/
+/* Copyright INRIA 2007                                                              */
+/* Author : Allan Cornet                                                             */
+/* desc : interface for removelinehistory primitive                                  */
+/*-----------------------------------------------------------------------------------*/
+#include "gw_shell.h"
+#include "stack-c.h"
+#include "Scierror.h"
+#include "HistoryManager.h"
+/*-----------------------------------------------------------------------------------*/
+int C2F(sci_removelinehistory) _PARAMS((char *fname,unsigned long fname_len))
+{
+       Rhs = Max(Rhs,0);
+       CheckRhs(1,1);
+       CheckLhs(0,1);
+
+       if ( GetType(1) == sci_matrix )
+       {
+               int N = -1;
+               int l1,m1=1,n1=1;
+               GetRhsVar(1,"i",&m1,&n1,&l1);
+               N=*istk(l1);
+
+               if ( (N < 0) || (N > getSizeScilabHistory()) )
+               {
+                       Scierror(999,"Invalid parameter.\n");
+                       return 0;
+               }
+               else
+               {
+                       deleteNthLineScilabHistory(N);
+               }
+       }
+       else
+       {
+               Scierror(999,"Invalid parameter.\n");
+               return 0;
+       }
+
+
+       LhsVar(1) = 0;
+       C2F(putlhsvar)();
+       return 0;
+}
+/*-----------------------------------------------------------------------------------*/