00001 #include <string.h>
00002 #include <stdlib.h>
00003
00004 #include "machine.h"
00005 #include "MALLOC.h"
00006
00007 extern void cerro __PARAMS((char *str));
00008
00009 #ifdef _MSC_VER
00010 extern int F2C(frmtrs) ();
00011 #endif
00012
00013 void C2F(transc)(int *lp1,int **lpft,int *ls1,int **lsft,int *m,int *lsftdim,int *lpftdim,int *n)
00014 {
00015 int n1,sdim,mftdim;
00016 int *cfcl,*cfcp,*cw,*inf,nc,*nfcomp,*nn,*num,
00017 *p,*p1,*pile,*s,*som,*suc;
00018 int isize = sizeof(int);
00019
00020 n1 = *n + 1;
00021 sdim = (*n * (*n - 1))/2 + 1;
00022 mftdim = (*n * (*n - 1)) + 1;
00023
00024 if ((*lpft = (int *)MALLOC(n1 * isize)) == NULL) {
00025 cerro("Running out of memory");
00026 return;
00027 }
00028 if ((*lsft = (int *)MALLOC(mftdim * isize)) == NULL) {
00029 cerro("Running out of memory");
00030 return;
00031 }
00032
00033 if ((cfcl = (int *)MALLOC(*n * isize)) == NULL) {
00034 cerro("Running out of memory");
00035 return;
00036 }
00037 if ((cfcp = (int *)MALLOC(n1 * isize)) == NULL) {
00038 cerro("Running out of memory");
00039 return;
00040 }
00041 if ((cw = (int *)MALLOC(*n * isize)) == NULL) {
00042 cerro("Running out of memory");
00043 return;
00044 }
00045 if ((inf = (int *)MALLOC(*n * isize)) == NULL) {
00046 cerro("Running out of memory");
00047 return;
00048 }
00049 if ((nfcomp = (int *)MALLOC(*n * isize)) == NULL) {
00050 cerro("Running out of memory");
00051 return;
00052 }
00053 if ((nn = (int *)MALLOC(*n * isize)) == NULL) {
00054 cerro("Running out of memory");
00055 return;
00056 }
00057 if ((num = (int *)MALLOC(*n * isize)) == NULL) {
00058 cerro("Running out of memory");
00059 return;
00060 }
00061 if ((p = (int *)MALLOC(*n * isize)) == NULL) {
00062 cerro("Running out of memory");
00063 return;
00064 }
00065 if ((p1 = (int *)MALLOC(n1 * isize)) == NULL) {
00066 cerro("Running out of memory");
00067 return;
00068 }
00069 if ((pile = (int *)MALLOC(*n * isize)) == NULL) {
00070 cerro("Running out of memory");
00071 return;
00072 }
00073 if ((s = (int *)MALLOC(sdim * isize)) == NULL) {
00074 cerro("Running out of memory");
00075 return;
00076 }
00077 if ((som = (int *)MALLOC(n1 * isize)) == NULL) {
00078 cerro("Running out of memory");
00079 return;
00080 }
00081 if ((suc = (int *)MALLOC(*m * isize)) == NULL) {
00082 cerro("Running out of memory");
00083 return;
00084 }
00085
00086 F2C(frmtrs)(cfcl,cfcp,cw,inf,lp1,*lpft,ls1,*lsft,m,
00087 &mftdim,n,&nc,nfcomp,nn,num,p,p1,pile,s,
00088 &sdim,som,suc);
00089
00090 FREE(inf); FREE(cw); FREE(nfcomp);FREE(cfcp);
00091 FREE(cfcl); FREE(nn); FREE(num); FREE(p); FREE(p1);
00092 FREE(pile); FREE(s); FREE(som); FREE(suc);
00093
00094 *lpftdim = n1;
00095 *lsftdim = (*lpft)[*n] - 1;
00096 }