1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
#include <string.h>
#ifdef __STDC__
#include <stdlib.h>
#else
#include <malloc.h>
#endif
#include "../machine.h"
#ifdef WIN32
#include "../os_specific/win_mem_alloc.h" /* MALLOC */
#else
#include "../os_specific/sci_mem_alloc.h" /* MALLOC */
#endif
#ifdef WIN32
extern void cerro __PARAMS((char *str));
extern int F2C(frmtrs) ();
#endif
void C2F(transc)(lp1,lpft,ls1,lsft,m,lsftdim,lpftdim,n)
int *lp1,**lpft,*ls1,**lsft,*m,*lsftdim,*lpftdim,*n;
{
int n1,sdim,mftdim;
int *cfcl,*cfcp,*cw,*inf,nc,*nfcomp,*nn,*num,
*p,*p1,*pile,*s,*som,*suc;
int isize = sizeof(int);
n1 = *n + 1;
sdim = (*n * (*n - 1))/2 + 1;
mftdim = (*n * (*n - 1)) + 1;
if ((*lpft = (int *)MALLOC(n1 * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((*lsft = (int *)MALLOC(mftdim * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((cfcl = (int *)MALLOC(*n * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((cfcp = (int *)MALLOC(n1 * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((cw = (int *)MALLOC(*n * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((inf = (int *)MALLOC(*n * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((nfcomp = (int *)MALLOC(*n * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((nn = (int *)MALLOC(*n * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((num = (int *)MALLOC(*n * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((p = (int *)MALLOC(*n * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((p1 = (int *)MALLOC(n1 * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((pile = (int *)MALLOC(*n * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((s = (int *)MALLOC(sdim * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((som = (int *)MALLOC(n1 * isize)) == NULL) {
cerro("Running out of memory");
return;
}
if ((suc = (int *)MALLOC(*m * isize)) == NULL) {
cerro("Running out of memory");
return;
}
F2C(frmtrs)(cfcl,cfcp,cw,inf,lp1,*lpft,ls1,*lsft,m,
&mftdim,n,&nc,nfcomp,nn,num,p,p1,pile,s,
&sdim,som,suc);
FREE(inf); FREE(cw); FREE(nfcomp);FREE(cfcp);
FREE(cfcl); FREE(nn); FREE(num); FREE(p); FREE(p1);
FREE(pile); FREE(s); FREE(som); FREE(suc);
*lpftdim = n1;
*lsftdim = (*lpft)[*n] - 1;
}
|