6
* C wrapper routines. In general, f2c_foo_ is called by FORTRAN routine
7
* MA_foo, performs any necessary argument munging, then calls C routine
16
#ifdef F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS
17
public Boolean FATR f2c_alloc_get_(datatype, nelem, name, memhandle, index, namesize)
22
MA_AccessIndex *index;
23
int namesize; /* implicitly passed by FORTRAN */
24
#else /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
25
public Boolean FATR f2c_alloc_get_(datatype, nelem, name, namesize, memhandle, index)
29
int namesize; /* implicitly passed by FORTRAN */
31
MA_AccessIndex *index;
32
#endif /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
35
char buf[MA_NAMESIZE];
37
/* ensure that name is NUL-terminated */
38
ga_f2cstring(name, namesize, buf, (Integer)sizeof(buf));
40
value = MA_alloc_get(*datatype, *nelem, buf, memhandle, index);
42
/* FORTRAN array indexing is 1-based, so increment index */
49
#ifdef F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS
50
public Boolean FATR f2c_allocate_heap_(datatype, nelem, name, memhandle, namesize)
55
int namesize; /* implicitly passed by FORTRAN */
56
#else /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
57
public Boolean FATR f2c_allocate_heap_(datatype, nelem, name, namesize, memhandle)
61
int namesize; /* implicitly passed by FORTRAN */
63
#endif /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
65
char buf[MA_NAMESIZE];
67
/* ensure that name is NUL-terminated */
68
ga_f2cstring(name, namesize, buf, (Integer)sizeof(buf));
70
return MA_allocate_heap(*datatype, *nelem, buf, memhandle);
74
public Boolean FATR f2c_chop_stack_(memhandle)
77
return MA_chop_stack(*memhandle);
81
public Boolean FATR f2c_free_heap_(memhandle)
84
return MA_free_heap(*memhandle);
88
public Boolean FATR f2c_free_heap_piece_(memhandle, nelem)
92
return MA_free_heap_piece(*memhandle, *nelem);
96
public Boolean FATR f2c_get_index_(memhandle, index)
98
MA_AccessIndex *index;
100
Boolean value = MA_get_index(*memhandle, index);
102
/* FORTRAN array indexing is 1-based, so increment index */
109
public Boolean FATR f2c_get_next_memhandle_(ithandle, memhandle)
113
return MA_get_next_memhandle(ithandle, memhandle);
117
public Boolean FATR f2c_get_numalign_(value)
120
return MA_get_numalign(value);
124
public Boolean FATR f2c_inform_base_(datatype, address1, address2)
129
return MAi_inform_base(*datatype, address1, address2);
133
public Boolean FATR f2c_init_(datatype, nominal_stack, nominal_heap)
135
Integer *nominal_stack;
136
Integer *nominal_heap;
138
return MA_init(*datatype, *nominal_stack, *nominal_heap);
142
public Boolean FATR f2c_initialized_()
144
return MA_initialized();
148
public Boolean FATR f2c_init_memhandle_iterator_(ithandle)
151
return MA_init_memhandle_iterator(ithandle);
155
public Integer FATR f2c_inquire_avail_(datatype)
158
return MA_inquire_avail(*datatype);
162
public Integer FATR f2c_inquire_heap_(datatype)
165
return MA_inquire_heap(*datatype);
169
public Integer FATR f2c_inquire_heap_check_stack_(datatype)
172
return MA_inquire_heap_check_stack(*datatype);
176
public Integer FATR f2c_inquire_heap_no_partition_(datatype)
179
return MA_inquire_heap_no_partition(*datatype);
183
public Integer FATR f2c_inquire_stack_(datatype)
186
return MA_inquire_stack(*datatype);
190
public Integer FATR f2c_inquire_stack_check_heap_(datatype)
193
return MA_inquire_stack_check_heap(*datatype);
197
public Integer FATR f2c_inquire_stack_no_partition_(datatype)
200
return MA_inquire_stack_no_partition(*datatype);
204
public Boolean FATR f2c_pop_stack_(memhandle)
207
return MA_pop_stack(*memhandle);
211
public void FATR f2c_print_stats_(printroutines)
212
Boolean *printroutines;
214
MA_print_stats(*printroutines);
218
#ifdef F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS
219
public Boolean FATR f2c_push_get_(datatype, nelem, name, memhandle, index, namesize)
224
MA_AccessIndex *index;
225
int namesize; /* implicitly passed by FORTRAN */
226
#else /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
227
public Boolean FATR f2c_push_get_(datatype, nelem, name, namesize, memhandle, index)
231
int namesize; /* implicitly passed by FORTRAN */
233
MA_AccessIndex *index;
234
#endif /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
237
char buf[MA_NAMESIZE];
239
/* ensure that name is NUL-terminated */
240
ga_f2cstring(name, namesize, buf, (Integer)sizeof(buf));
242
value = MA_push_get(*datatype, *nelem, buf, memhandle, index);
244
/* FORTRAN array indexing is 1-based, so increment index */
251
#ifdef F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS
252
public Boolean FATR f2c_push_stack_(datatype, nelem, name, memhandle, namesize)
257
int namesize; /* implicitly passed by FORTRAN */
258
#else /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
259
public Boolean FATR f2c_push_stack_(datatype, nelem, name, namesize, memhandle)
265
#endif /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
267
char buf[MA_NAMESIZE];
269
/* ensure that name is NUL-terminated */
270
ga_f2cstring(name, namesize, buf, (Integer)sizeof(buf));
272
return MA_push_stack(*datatype, *nelem, buf, memhandle);
276
public Boolean FATR f2c_set_auto_verify_(value)
279
return MA_set_auto_verify((Boolean)*value);
283
public Boolean FATR f2c_set_error_print_(value)
286
return MA_set_error_print((Boolean)*value);
290
public Boolean FATR f2c_set_hard_fail_(value)
293
return MA_set_hard_fail((Boolean)*value);
297
public Boolean FATR f2c_set_numalign_(value)
300
return MA_set_numalign(*value);
304
public Integer FATR f2c_sizeof_(datatype1, nelem1, datatype2)
309
return MA_sizeof(*datatype1, *nelem1, *datatype2);
313
public Integer FATR f2c_sizeof_overhead_(datatype)
316
return MA_sizeof_overhead(*datatype);
320
public void FATR f2c_summarize_allocated_blocks_()
322
/* FORTRAN indices are 1-based */
323
MAi_summarize_allocated_blocks(1);
327
public void FATR f2c_trace_(value)
330
MA_trace((Boolean)*value);
334
public Boolean FATR f2c_verify_allocator_stuff_()
336
return MA_verify_allocator_stuff();