~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to routines/stack-c.h

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#ifndef STACK_SCI 
5
5
#define STACK_SCI 
6
6
 
7
 
#if !(defined __ABSC__) && !(defined __MATH__)
 
7
#if  !(defined __LCC__) && !(defined __ABSC__) && ( !(defined __MATH__)  || (defined __APPLE__) || (defined aix) ) 
8
8
#include "graphics/Math.h"
9
9
#else
10
10
#include "machine.h"
14
14
 
15
15
#include "stack-def.h"
16
16
 
 
17
/*-------------------------------------------------
 
18
 * types 
 
19
 * -------------------------------------------------*/
 
20
 
 
21
typedef enum {
 
22
  sci_matrix= 1 ,
 
23
  sci_poly= 2 ,
 
24
  sci_boolean= 4 ,
 
25
  sci_sparse= 5  ,
 
26
  sci_boolean_sparse= 6,
 
27
  sci_ints= 8,
 
28
  sci_handles=9,
 
29
  sci_strings= 10,
 
30
  sci_u_function= 11,
 
31
  sci_c_function= 13 ,
 
32
  sci_lib=  14,
 
33
  sci_list= 15,
 
34
  sci_tlist= 16,
 
35
  sci_mlist= 17
 
36
} sci_types; 
17
37
 
18
38
/*-------------------------------------------------
19
39
 * structure used for sparse matrix 
65
85
#include "interf/stack2.h" 
66
86
#include "interf/stack3.h" 
67
87
 
68
 
/*********************************
69
 
 * to simplify interface design 
70
 
 *********************************/
 
88
 
 
89
/*-------------------------------------------------
 
90
 * set of defines for interface simplication 
 
91
 * -------------------------------------------------*/
71
92
 
72
93
static int c1_local;
73
94
static int c_local;
89
110
#define Lhs C2F(com).lhs
90
111
#define Bot C2F(vstk).bot
91
112
#define Err C2F(iop).err
 
113
#define Leps_sci  *stk(C2F(vstk).leps) 
92
114
 
93
115
#define stk(x)  ( C2F(stack).Stk + x-1 )
94
116
#define istk(x) (((int *) C2F(stack).Stk) + x-1 )
95
117
#define sstk(x) (((float *) C2F(stack).Stk) + x-1 )
96
118
#define cstk(x) (((char *) C2F(stack).Stk) + x-1 )
97
119
typedef struct { double r, i; } doublecomplex;
98
 
#define zstk(x) (doublecomplex *) (C2F(stack).Stk + x-1 )
 
120
/* #define zstk(x) (doublecomplex *) (C2F(stack).Stk + x-1 )  */
 
121
#define zstk(x) (((doublecomplex *) C2F(stack).Stk) + x-1 )
99
122
 
100
123
#define lstk(x) (((integer *) C2F(vstk).Lstk) + x-1 )
101
124
#define infstk(x) (((integer *) C2F(vstk).Infstk) + x-1 )
121
144
 
122
145
#define CreateCVarFromPtr(n,ct,it,mx,nx,lrx,lcx) if ( ! C2F(createcvarfromptr)((c_local=n,&c_local),ct,it,mx,nx,(double *)lrx,(double *) lcx,1L)) \
123
146
                                             { return 0;} 
 
147
#define CreateRefFromName(n,nx) if(! C2F(createreffromname)(n,nx)){return 0;}
 
148
 
 
149
#define CreateRef(num, point) if(! C2F(createreference)(num,point)){return 0;}
 
150
 
 
151
#define ChangeToRef(num, point) C2F(changetoref)(num,point)
124
152
 
125
153
#define FreePtr(lx) C2F(freeptr)((double **) lx)
126
154
 
127
 
#define FreeRhsSVar(S) { c_local =0; while ( S[c_local] != 0) { FREE(S[c_local]);c_local++;}; FREE(S)} 
 
155
#define FreeRhsSVar(S) { c_local =0; while ( S[c_local] != 0) { FREE(S[c_local]);c_local++;}; FREE(S);} 
128
156
 
129
157
#define GetType(n)   C2F(gettype)((c_local = n +Top - Rhs, &c_local))
130
158
 
138
166
#define CreateVar(n,ct,mx,nx,lx) if(! C2F(createvar)((c_local=n,&c_local),ct,mx,nx,(void *)lx, 1L))\
139
167
        { return 0;  }
140
168
 
 
169
 
 
170
#define CreateWork(n,mx,lx) if(! C2F(creatework)((c_local=n,&c_local),mx,(void *)lx))\
 
171
        { return 0;  }
 
172
 
 
173
#define SetWorkSize(n,mx) if(! C2F(setworksize)((c_local=n,&c_local),mx))\
 
174
        { return 0;  }
 
175
 
141
176
#define CreateData(n,nx) if(! C2F(createdata)((c_local=n,&c_local),nx))\
142
177
        { return 0;  }
143
178
 
157
192
 
158
193
#define WriteMatrix(ct,mx,nx,w)  if (! C2F(cwritemat)(ct,mx,nx,w,strlen(ct) )) {        return 0; }
159
194
 
 
195
#define PutVar(num, nam)  if (! C2F(putvar)( (c_local=num, &c_local), nam, strlen(nam) )) {     return 0; }
 
196
 
160
197
#define ReadString(ct,mx,w)  if (! C2F(creadchain)(ct,mx,w,strlen(ct),strlen(w) )) {    return 0; }
161
198
 
162
199
#define WriteString(ct,mx,w)  if (! C2F(cwritechain)(ct,mx,w,strlen(ct),strlen(w) )) {  return 0; }
172
209
 
173
210
#define CreateListVarFrom(n,m,ct,mx,nx,lx,lx1) if (!C2F(createlistvarfrom)((c_local=n,&c_local),(c1_local=m,&c1_local),ct,mx,nx,(void *)lx,(void *) lx1,1L))  { return 0;} 
174
211
 
175
 
#define CreateListCVarFrom(n,m,ct,it,mx,nx,lx,lc,lx1,lc1) if (!C2F(createlistvarfrom)((c_local=n,&c_local),(c1_local=m,&c1_local),ct,it,mx,nx,(void *)lx,(void *) lc,(void *) lx1,(void *)lc1,1L))  { return 0;} 
 
212
#define CreateListCVarFrom(n,m,ct,it,mx,nx,lx,lc,lx1,lc1) if (!C2F(createlistcvarfrom)((c_local=n,&c_local),(c1_local=m,&c1_local),ct,it,mx,nx,(void *)lx,(void *) lc,(void *) lx1,(void *)lc1,1L))  { return 0;} 
176
213
 
177
214
#define CreateListVarFromPtr(n,m,ct,mx,nx,lx1) if (!C2F(createlistvarfromptr)((c_local=n,&c_local),(c1_local=m,&c1_local),ct,mx,nx,(void *) lx1,1L))  { return 0;} 
178
215
 
305
342
 
306
343
extern void *GetData __PARAMS((int lw));
307
344
 
 
345
extern void *GetRawData __PARAMS((int lw));
 
346
 
 
347
extern void *GetDataFromName __PARAMS(( char *name));
 
348
 
308
349
#endif /*  STACK_SCI  */
309
350
 
310
351