File: transc.c

package info (click to toggle)
scilab 4.0-12
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 100,640 kB
  • ctags: 57,333
  • sloc: ansic: 377,889; fortran: 242,862; xml: 179,819; tcl: 42,062; sh: 10,593; ml: 9,441; makefile: 4,377; cpp: 1,354; java: 621; csh: 260; yacc: 247; perl: 130; lex: 126; asm: 72; lisp: 30
file content (105 lines) | stat: -rw-r--r-- 2,534 bytes parent folder | download | duplicates (2)
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;
}