db2int.c

Go to the documentation of this file.
00001 #include "machine.h"
00002 typedef signed char integer1;
00003 typedef short integer2;
00004 /*     Copyright INRIA */
00005 
00006 #define CONV(Type) {\
00007 Type *DY;\
00008     DY=(Type *)dy;\
00009     --DY;\
00010     if (*incx == 1 && *incy == 1) \
00011       for (i = 1; i <= i1; ++i) DY[i] = (Type) dx[i];\
00012     else {\
00013       ix = 1;iy = 1;\
00014       if (*incx < 0) ix = (-(*n) + 1) * *incx + 1;\
00015       if (*incy < 0) iy = (-(*n) + 1) * *incy + 1;\
00016       for (i = 1; i <= i1; ++i) {\
00017         DY[iy] = (Type) dx[ix];\
00018         ix += *incx;iy += *incy;\
00019       }\
00020    }\
00021 }
00022 
00023 int C2F(db2int)(typ, n, dx, incx, dy, incy)
00024 integer *n;
00025 integer *incx;
00026 integer *incy;
00027 integer *typ;
00028 double *dx;
00029 int *dy;
00030 {
00031   integer i1;
00032   static integer i, ix, iy;
00033 
00034   --dx;
00035   i1 = *n;
00036   if (i1 <= 0) return 0;
00037   switch (*typ) {
00038   case 1:
00039     CONV(integer1);
00040     break;
00041   case 2:
00042     CONV(integer2);
00043     break;
00044   case 4:
00045     CONV(integer);
00046     break;
00047   }
00048   return 0;
00049 }
00050 

Generated on Sun Mar 4 15:03:57 2007 for Scilab [trunk] by  doxygen 1.5.1