00001 #include <string.h>
00002
00003 #include "stack-c.h"
00004
00005 typedef void (*voidf)();
00006
00007 typedef struct {
00008 char *name;
00009 voidf f;
00010 } FTAB;
00011
00012
00013
00014
00015
00016 #define ARGS_ex17c double,double, double *
00017
00018 typedef int (*funcex) __PARAMS((ARGS_ex17c));
00019 extern int f1c __PARAMS((ARGS_ex17c));
00020 extern int f2c __PARAMS((ARGS_ex17c));
00021 extern int ex17c __PARAMS((double *,integer ,double *,integer,double *, funcex));
00022
00023 FTAB FTab_ex17c[] ={
00024 {"f1c", (voidf) f1c},
00025 {"f2c", (voidf) f2c},
00026 {(char *) 0, (voidf) 0}};
00027
00028
00029
00030
00031
00032 #include <setjmp.h>
00033 static jmp_buf ex17cenv;
00034
00035
00036
00037
00038
00039 static int sci_f, lhs_f, rhs_f;
00040
00041
00042
00043
00044
00045 static int sciex17c __PARAMS((ARGS_ex17c));
00046 static funcex Argex17c;
00047
00048
00049
00050
00051
00052 int intex17c(fname)
00053 char *fname;
00054 {
00055 int returned_from_longjump ;
00056 int m_X,n_X,l_X,m_Y,n_Y,l_Y,m_Z,n_Z,l_Z;
00057 static int minlhs=1, minrhs=3, maxlhs=1, maxrhs=3;
00058
00059
00060 CheckRhs(minrhs,maxrhs) ;
00061 CheckLhs(minlhs,maxlhs) ;
00062
00063
00064 GetRhsVar(1, "d", &m_X, &n_X, &l_X);
00065
00066
00067 GetRhsVar(2, "d", &m_Y, &n_Y, &l_Y);
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 Argex17c = (funcex) GetFuncPtr("ex17c", 3, FTab_ex17c, (voidf) sciex17c, &sci_f, &lhs_f, &rhs_f);
00080 if ( Argex17c == (funcex) 0 ) return 0;
00081
00082 m_Z= m_X*n_X; n_Z= m_Y*n_Y;
00083
00084
00085
00086 CreateVar(4, "d", &m_Z, &n_Z, &l_Z);
00087
00088
00089
00090 if (( returned_from_longjump = setjmp(ex17cenv)) != 0 )
00091 {
00092 Scierror(999,"%s: Internal error \r\n",fname);
00093 return 0;
00094 }
00095
00096
00097
00098
00099
00100 ex17c(stk(l_X), m_X*n_X, stk(l_Y), m_Y*n_Y, stk(l_Z), Argex17c);
00101
00102
00103 LhsVar(1) = 4;
00104 return 0;
00105 }
00106
00107
00108
00109
00110
00111
00112 static int sciex17c(x, y, z)
00113 double x, y, *z;
00114 {
00115 static int lhs=1,rhs=2;
00116 int scilab_i,scilab_j, un=1;
00117
00118 CreateVar(5, "d", &un, &un, &scilab_i);
00119 stk(scilab_i)[0] = x;
00120
00121 CreateVar(6, "d", &un, &un, &scilab_j);
00122 stk(scilab_j)[0] = y;
00123
00124
00125
00126
00127 PExecSciFunction(5, &sci_f, &lhs, &rhs, "ArgFex", ex17cenv);
00128
00129 *z = *stk(scilab_i);
00130 return 0;
00131 }
00132
00133
00134
00135
00136