1
/*===========================================================================
2
Copyright (C) 1995-2009 European Southern Observatory (ESO)
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License as
6
published by the Free Software Foundation; either version 2 of
7
the License, or (at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public
15
License along with this program; if not, write to the Free
16
Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
19
Correspondence concerning ESO-MIDAS should be addressed as follows:
20
Internet e-mail: midas@eso.org
21
Postal address: European Southern Observatory
22
Data Management Division
23
Karl-Schwarzschild-Strasse 2
24
D 85748 Garching bei Muenchen
26
===========================================================================*/
28
/*++++++++++++++++++++++++ std.fc +++++++++++++++++++++++++++++++++++++++
30
.IDENTIFICATION Module std.fc
32
Module contains layer between the descriptor related FORTRAN STxxxx interfaces
33
and the SC_interfaces written in (hopefully independent) C
34
.AUTHOR K. Banse ESO - Garching
35
.KEYWORDS standard interfaces.
36
.ENVIRONMENT FORTRAN and C standards
37
.VERSION [1.00] 871207: created from SXFTOC.C
40
-----------------------------------------------------------------------------*/
42
#include <midas_def.h>
46
static int dunit = 0, dnull = -1;
58
/*==========================================================================*/
60
/*** stat = SCDRDI(no,descr,felem,maxvals,actvals,values,dunit,dnull) ***/
62
ROUTINE STD1(no,felem,maxvals,actvals,values,status)
63
int *no; /* IN : no. of data frame */
64
int *felem; /* IN : first data item to be read */
65
int *maxvals; /* IN : max. vals to read */
66
int *actvals; /* OUT: actual no. of elements returned */
67
int *values; /* OUT: buffer for data values */
71
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
73
*status = SCDRDI(*no,ptr1,*felem,*maxvals,actvals,values,&dunit,&dnull);
78
/*==========================================================================*/
80
/*** stat = SCDRDL(no,descr,felem,maxvals,actvals,values,dunit,dnull) ***/
82
ROUTINE STD2(no,felem,maxvals,actvals,values,status)
83
int *no; /* IN : no. of data frame */
84
int *felem; /* IN : first data item to be read */
85
int *maxvals; /* IN : max. vals to read */
86
int *actvals; /* OUT: actual no. of elements returned */
87
int *values; /* OUT: buffer for data values */
91
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
93
*status = SCDRDL(*no,ptr1,*felem,*maxvals,actvals,values,&dunit,&dnull);
98
/*==========================================================================*/
100
/*** stat = SCDRDR(no,descr,felem,maxvals,actvals,values,dunit,dnull) ***/
102
ROUTINE STD3(no,felem,maxvals,actvals,values,status)
103
int *no; /* IN : no. of data frame */
104
int *felem; /* IN : first data item to be read */
105
int *maxvals; /* IN : max. vals to read */
106
int *actvals; /* OUT: actual no. of elements returned */
107
float *values; /* OUT: buffer for data values */
111
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
113
*status = SCDRDR(*no,ptr1,*felem,*maxvals,actvals,values,&dunit,&dnull);
119
/*==========================================================================*/
121
/*** stat = SCDRDD(no,descr,felem,maxvals,actvals,values,dunit,dnull) ***/
123
ROUTINE STD4(no,felem,maxvals,actvals,values,status)
124
int *no; /* IN : no. of data frame */
125
int *felem; /* IN : first data item to be read */
126
int *maxvals; /* IN : max. vals to read */
127
int *actvals; /* OUT: actual no. of elements returned */
128
double *values; /* OUT: buffer for data values */
132
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
134
*status = SCDRDD(*no,ptr1,*felem,*maxvals,actvals,values,&dunit,&dnull);
140
/*==========================================================================*/
142
/*** stat = SCDRDS(no,descr,felem,maxvals,actvals,values,dunit,dnull) ***/
144
ROUTINE STD4a(no,felem,maxvals,actvals,values,status)
145
int *no; /* IN : no. of data frame */
146
int *felem; /* IN : first data item to be read */
147
int *maxvals; /* IN : max. vals to read */
148
int *actvals; /* OUT: actual no. of elements returned */
149
size_t *values; /* OUT: buffer for data values */
153
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
155
*status = SCDRDS(*no,ptr1,*felem,*maxvals,actvals,values,&dunit,&dnull);
161
/*==========================================================================*/
163
/*** stat = SCDRDC(no,descr,noelm,felem,maxvals,actvals,values,dunit,dnull) ***/
165
ROUTINE STD5(no,noelm,felem,maxvals,actvals,status)
166
int *no; /* IN : no. of data frame */
167
int *noelm; /* IN : no. of data frame */
168
int *felem; /* IN : first data item to be read */
169
int *maxvals; /* IN : max. vals to read */
170
int *actvals; /* OUT: actual no. of elements returned */
176
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
177
ptr2 = loc_pntr(1,&mm); /* get location of "values" */
180
*status = SCDRDC(*no,ptr1,n,*felem,*maxvals,actvals,ptr2,&dunit,&dnull);
183
if ((n > 0) && (n < mm)) *(ptr2+n) = ' ';
188
/*==========================================================================*/
190
/*** stat = SCDRDH(no,descr,felem,maxvals,actvals,values,total) ***/
192
ROUTINE STD6(no,felem,maxvals,actvals,total,status)
193
int *no; /* IN : no. of data frame */
194
int *felem; /* IN : first data item to be read */
195
int *maxvals; /* IN : max. vals to read */
196
int *actvals; /* OUT: actual no. of elements returned */
197
int *total; /* OUT : total size of help text */
204
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
205
ptr2 = loc_pntr(1,&mm); /* get location of "values" */
207
*status = SCDRDH(*no,ptr1,*felem,*maxvals,actvals,ptr2,total);
210
if ((n > 0) && (n < mm)) *(ptr2+n) = ' ';
215
/*==========================================================================*/
217
/*** stat = SCDFND(no,descr,type,noelem,bytelem) ***/
219
ROUTINE STD7(no,noelem,bytelem,status)
220
int *no; /* IN : no. of data frame */
221
int *noelem; /* OUT: no. of elements */
222
int *bytelem; /* OUT: no. of bytes per element */
229
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
230
ptr2 = loc_pntr(1,&mm); /* get location of "type" */
232
*status = SCDFND(*no,ptr1,ptr2,noelem,bytelem);
235
n = (int) strlen(ptr2);
236
if ((n > 0) && (n < mm)) *(ptr2+n) = ' ';
241
/*==========================================================================*/
243
/*** stat = SCDINF(no,npos,field,buf,numbuf) ***/
245
ROUTINE STD8(no,npos,field,numbuf,status)
246
int *no; /* IN : no. of data frame */
247
int *npos; /* IN: position of descr */
248
int *field; /* IN: specify info,1 = NAME, 2 = TYPE, 3 = SIZE */
249
int *numbuf; /* IN : return buffer for numerical data */
255
ptr1 = loc_pntr(1,&mm); /* get location of "buf", available space */
258
*status = SCDINF(*no,*npos,n,ptr1,(mm-1),numbuf);
260
if (n != 3) /* treat char. result buffer */
262
n = (int) strlen(ptr1);
263
if ((n > 0) && (n < mm)) *(ptr1+n) = ' ';
269
/*==========================================================================*/
271
/*** stat = SCDRDX(no,flag,descr,type,bytel,noel,hnc) ***/
273
ROUTINE STD9(no,flag,bytel,noel,hnc,status)
274
int *no; /* IN: imno of data frame */
275
int *flag; /* IN: action flag
276
= 0, free space again
277
= 1, read in complete descr. directory
278
= 2, as 1 and also return total no. of descriptors
279
= 10, return descr. info of next descr. */
280
int *bytel; /* OUT: no. of bytes per element */
281
int *noel; /* OUT: no. of elements */
282
int *hnc; /* OUT: no. of help text chars */
288
ptr1 = loc_pntr(1,&m1); /* get location of "name" */
289
ptr2 = loc_pntr(2,&m2); /* get location of "ident" */
291
*status = SCDRDX(*no,*flag,ptr1,ptr2,bytel,noel,hnc);
293
n = (int) strlen(ptr1);
294
if ((n > 0) && (n < m1)) *(ptr1+n) = ' ';
296
n = (int) strlen(ptr2);
297
if ((n > 0) && (n < m1)) *(ptr2+n) = ' ';
302
/*==========================================================================*/
304
/*** stat = SCDWRC(no,descr,noelm,values,felem,maxvals,dunit) ***/
306
ROUTINE STD10(no,noelm,felem,maxvals,status)
307
int *no; /* IN: imno of data frame */
308
int *noelm; /* IN: no. of chars (bytes) per data value */
309
int *felem; /* IN : first data item to be read */
310
int *maxvals; /* IN : max. vals to read */
314
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
315
ptr2 = loc_pntr(1,&mm); /* get location of "values" */
318
*status = SCDWRC(*no,ptr1,*noelm,ptr2,*felem,*maxvals,&dunit);
323
/*==========================================================================*/
325
/*** stat = SCDWRD(no,descr,values,felem,maxvals,dunit) ***/
327
ROUTINE STD11(no,values,felem,maxvals,status)
328
int *no; /* IN: imno of data frame */
329
double *values; /* IN: data values */
330
int *felem; /* IN : first data item to be read */
331
int *maxvals; /* IN : max. vals to read */
335
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
337
*status = SCDWRD(*no,ptr1,values,*felem,*maxvals,&dunit);
342
/*==========================================================================*/
344
/*** stat = SCDWRH(no,descr,values,felem,maxvals) ***/
346
ROUTINE STD12(no,felem,maxvals,status)
347
int *no; /* IN: imno of data frame */
348
int *felem; /* IN : first data item to be read */
349
int *maxvals; /* IN : max. vals to read */
353
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
354
ptr2 = strp_pntr(2); /* get stripped string of "values" */
356
*status = SCDWRH(*no,ptr1,ptr2,*felem,*maxvals);
361
/*==========================================================================*/
363
/*** stat = SCDWRI(no,descr,values,felem,maxvals,dunit) ***/
365
ROUTINE STD13(no,values,felem,maxvals,status)
366
int *no; /* IN: imno of data frame */
367
int *values; /* IN: data values */
368
int *felem; /* IN : first data item to be read */
369
int *maxvals; /* IN : max. vals to read */
373
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
375
*status = SCDWRI(*no,ptr1,values,*felem,*maxvals,&dunit);
381
/*==========================================================================*/
383
/*** stat = SCDWRL(no,descr,values,felem,maxvals,dunit) ***/
385
ROUTINE STD14(no,values,felem,maxvals,status)
386
int *no; /* IN: imno of data frame */
387
int *values; /* IN: data values */
388
int *felem; /* IN : first data item to be read */
389
int *maxvals; /* IN : max. vals to read */
393
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
395
*status = SCDWRL(*no,ptr1,values,*felem,*maxvals,&dunit);
400
/*==========================================================================*/
402
/*** stat = SCDWRR(no,descr,values,felem,maxvals,dunit) ***/
404
ROUTINE STD15(no,values,felem,maxvals,status)
405
int *no; /* IN: imno of data frame */
406
float *values; /* IN: data values */
407
int *felem; /* IN : first data item to be read */
408
int *maxvals; /* IN : max. vals to read */
412
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
414
*status = SCDWRR(*no,ptr1,values,*felem,*maxvals,&dunit);
420
ROUTINE STD16(no,status)
421
int *no; /* IN: no. of data frame */
425
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
427
*status = SCDDEL(*no,ptr1);
432
ROUTINE STD17(from,to,mask,status)
433
int *from; /* IN: no. of source frame */
434
int *to; /* IN: no. of destination frame */
435
int *mask; /* IN: copy_mask */
439
ptr1 = strp_pntr(1); /* get stripped string of "descr" */
441
*status = SCDCOP(*from,*to,*mask,ptr1);
447
ROUTINE STDRDZ(no,dirsize,direlem,status)
448
int *no; /* IN : no. of data frame */
449
int *dirsize; /* OUT : no. of chars used by descr-directory */
450
int *direlem; /* OUT : no. of descr. (incl directory) */
454
*status = SCDRDZ(*no,dirsize,direlem);