| 1 |
/*=========================================================================== |
| 2 |
Copyright (C) 1995-2009 European Southern Observatory (ESO) |
| 3 |
|
| 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. |
| 8 |
|
| 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. |
| 13 |
|
| 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, |
| 17 |
MA 02139, USA. |
| 18 |
|
| 19 |
Correspondence concerning ESO-MIDAS should be addressed as follows: |
| 20 |
Internet e-mail: [email protected] |
| 21 |
Postal address: European Southern Observatory |
| 22 |
Data Management Division |
| 23 |
Karl-Schwarzschild-Strasse 2 |
| 24 |
D 85748 Garching bei Muenchen |
| 25 |
GERMANY |
| 26 |
===========================================================================*/ |
| 27 |
|
| 28 |
/*+++++++++++++++++++++ Module MIDINFO +++++++++++++++++++++++++++++++++++++++ |
| 29 |
.LANGUAGE C |
| 30 |
.IDENTIFICATION Module MIDINFO.C |
| 31 |
.AUTHOR Klaus Banse ESO - Garching |
| 32 |
.COMMENTS |
| 33 |
holds TYPINFO, SHOWFCB, SHOWFCT |
| 34 |
.KEYWORDS MIDAS Descriptors, Keywords |
| 35 |
.ENVIRONMENT VMS and UNIX |
| 36 |
|
| 37 |
.VERSION |
| 38 |
|
| 39 |
090331 last modif |
| 40 |
------------------------------------------------------------------------*/ |
| 41 |
|
| 42 |
#include <fileexts.h> |
| 43 |
|
| 44 |
#include <stdio.h> |
| 45 |
#include <string.h> |
| 46 |
|
| 47 |
static struct FCT_STRUCT FCT_X, *fctpntr; |
| 48 |
|
| 49 |
/* |
| 50 |
|
| 51 |
*/ |
| 52 |
|
| 53 |
#ifdef __STDC__ |
| 54 |
void MID_TYPINFO(char dtype , int dbytes , char * type , int ltype) |
| 55 |
#else |
| 56 |
void MID_TYPINFO(dtype,dbytes,type,ltype) |
| 57 |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 58 |
.PURPOSE |
| 59 |
return descriptor/keyword type at current position |
| 60 |
.RETURNS |
| 61 |
nothing |
| 62 |
-----------------------------------------------------------------*/ |
| 63 |
char dtype /* IN: input character type I, R, D, L or C */; |
| 64 |
int dbytes /* IN: no. of bytes per descriptor element */; |
| 65 |
char *type /* OUT: expanded descriptor type (e.g CHARACTER*22) */; |
| 66 |
int ltype /* IN: max length of above */; |
| 67 |
#endif |
| 68 |
{ |
| 69 |
|
| 70 |
static char charac[9] = {'C','H','A','R','A','C','T','E','R'}; |
| 71 |
|
| 72 |
int n, mm, cl; |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
/* first we clear the type string */ |
| 78 |
|
| 79 |
memset((void *)type,32,(size_t)ltype); |
| 80 |
|
| 81 |
*type = dtype; |
| 82 |
|
| 83 |
|
| 84 |
/* already done for integer, logical, real + double precision */ |
| 85 |
|
| 86 |
if (dtype != 'C') return; |
| 87 |
|
| 88 |
|
| 89 |
/* here for character arrays - that's where all the work is */ |
| 90 |
|
| 91 |
if (dbytes == 1) return; |
| 92 |
|
| 93 |
|
| 94 |
if (dbytes < 10) |
| 95 |
mm = 1; |
| 96 |
else if (dbytes < 100) |
| 97 |
mm = 2; |
| 98 |
else if (dbytes < 1000) |
| 99 |
mm = 3; |
| 100 |
else if (dbytes < 10000) |
| 101 |
mm = 4; |
| 102 |
else |
| 103 |
mm = 5; |
| 104 |
|
| 105 |
cl = mm + 1; /* bytes needed for *xxx */ |
| 106 |
|
| 107 |
|
| 108 |
/* now see, how much is left */ |
| 109 |
|
| 110 |
n = ltype - cl; |
| 111 |
if (n < 1) |
| 112 |
{ |
| 113 |
*type = '*'; |
| 114 |
*(type+1) = '*'; |
| 115 |
*(type+2) = '*'; |
| 116 |
return; |
| 117 |
} |
| 118 |
else |
| 119 |
if (n > 9) n = 9; /* minimize with length of charac */ |
| 120 |
|
| 121 |
(void) strncpy(type,charac,(size_t)n); |
| 122 |
(void) snprintf((type+n),(size_t)6,"%d\n",dbytes); |
| 123 |
} |
| 124 |
|
| 125 |
/* |
| 126 |
|
| 127 |
*/ |
| 128 |
|
| 129 |
|
| 130 |
#ifdef __STDC__ |
| 131 |
int MID_SHOWFCB(char *name) |
| 132 |
#else |
| 133 |
int MID_SHOWFCB(name) |
| 134 |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 135 |
.PURPOSE |
| 136 |
display contents of FCB of that file |
| 137 |
.RETURNS |
| 138 |
= 0 (ERR_NORMAL), if o.k. |
| 139 |
else, there is a problem |
| 140 |
= 999, if outdated, not supported file format |
| 141 |
-----------------------------------------------------------------*/ |
| 142 |
char *name; /* IN: file name */ |
| 143 |
#endif |
| 144 |
|
| 145 |
|
| 146 |
{ |
| 147 |
char cbuf[32], tbuf[64], outbuf[80]; |
| 148 |
|
| 149 |
int stat, imnoa; |
| 150 |
long int *lptr; |
| 151 |
|
| 152 |
size_t *sptr; |
| 153 |
|
| 154 |
struct FCB_STRUCT myFCB, *fcbp; |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
stat = SCFOPN(name,D_OLD_FORMAT,0,F_OLD_TYPE,&imnoa); |
| 160 |
fctpntr = FCT.ENTRIES + imnoa; |
| 161 |
fcbp = fctpntr->FZP; |
| 162 |
|
| 163 |
(void) snprintf(outbuf,(size_t)80,"FCB of file %s (imno %d)",name,imnoa); |
| 164 |
SCTPUT(outbuf); |
| 165 |
SCTPUT(" {"); |
| 166 |
(void) snprintf(outbuf,(size_t)80," CLONY = %d",fcbp->CLONY); |
| 167 |
SCTPUT(outbuf); |
| 168 |
(void) strncpy(cbuf,fcbp->BDTYPE,8); |
| 169 |
cbuf[8] = '\0'; |
| 170 |
(void) snprintf(outbuf,(size_t)80," BDTYPE[8] = '%s'",cbuf); |
| 171 |
SCTPUT(outbuf); |
| 172 |
sptr = (size_t *) fcbp->XNDVAL; |
| 173 |
(void) snprintf(outbuf,(size_t)80," NDVAL = %d (as unsigned int), %zd (as size_t)", fcbp->NDVAL, *sptr); |
| 174 |
SCTPUT(outbuf); |
| 175 |
(void) snprintf(outbuf,(size_t)80," SWPSHORT = '%c'",fcbp->SWPSHORT); |
| 176 |
SCTPUT(outbuf); |
| 177 |
(void) snprintf(outbuf,(size_t)80," SWPINT = '%c'",fcbp->SWPINT); |
| 178 |
SCTPUT(outbuf); |
| 179 |
(void) snprintf(outbuf,(size_t)80," FLOTFMT = '%c'",fcbp->FLOTFMT); |
| 180 |
SCTPUT(outbuf); |
| 181 |
(void) snprintf(outbuf,(size_t)80," DSCFLAG = '%c'",fcbp->DSCFLAG); |
| 182 |
SCTPUT(outbuf); |
| 183 |
(void) strncpy(cbuf,fcbp->VERSION,8); |
| 184 |
cbuf[8] = '\0'; |
| 185 |
if ((strcmp(&cbuf[5],"006") == 0) || |
| 186 |
(strcmp(&cbuf[5],"007") == 0)) |
| 187 |
(void) strcpy(tbuf,"very old - before 96NOV"); |
| 188 |
else if (strcmp(&cbuf[5],"010") == 0) |
| 189 |
(void) strcpy(tbuf,"old - before 01SEP"); |
| 190 |
else if (strcmp(&cbuf[5],"100") == 0) |
| 191 |
(void) strcpy(tbuf,"before 02SEP"); |
| 192 |
else if (strcmp(&cbuf[5],"101") == 0) |
| 193 |
(void) strcpy(tbuf,"before 03FEB"); |
| 194 |
else if (strcmp(&cbuf[5],"105") == 0) |
| 195 |
(void) strcpy(tbuf,"before 06SEP"); |
| 196 |
else if (strcmp(&cbuf[5],"110") == 0) |
| 197 |
(void) strcpy(tbuf,"since 06SEP"); |
| 198 |
else if (strcmp(&cbuf[5],"120") == 0) |
| 199 |
(void) strcpy(tbuf,"since 09SEP"); |
| 200 |
else |
| 201 |
{ |
| 202 |
(void) strcpy(tbuf,"very, very old descr. format - not supported anymore!"); |
| 203 |
stat = 999; |
| 204 |
} |
| 205 |
(void) snprintf(outbuf,(size_t)80," VERSION[8] = '%s (%s)'",cbuf,tbuf); |
| 206 |
SCTPUT(outbuf); |
| 207 |
(void) snprintf(outbuf,(size_t)80," PROT = %d",fcbp->PROT); |
| 208 |
SCTPUT(outbuf) ; |
| 209 |
(void) snprintf(outbuf,(size_t)80, |
| 210 |
" DATAINFO = %d, %d, %d, %d, %d, %d (Naxis, Npix,d_fmt,1. d_byte)", |
| 211 |
fcbp->DATAINFO[0],fcbp->DATAINFO[1],fcbp->DATAINFO[2], |
| 212 |
fcbp->DATAINFO[3],fcbp->DATAINFO[4],fcbp->DATAINFO[5]); |
| 213 |
SCTPUT(outbuf); |
| 214 |
(void) snprintf(outbuf,(size_t)80," INCARN = %d",fcbp->INCARN); |
| 215 |
SCTPUT(outbuf); |
| 216 |
(void) snprintf(outbuf,(size_t)80," PTRLDB = %d",fcbp->PTRLDB); |
| 217 |
SCTPUT(outbuf); |
| 218 |
(void) snprintf(outbuf,(size_t)80," LEXBDF = %d", fcbp->LEXBDF); |
| 219 |
SCTPUT(outbuf); |
| 220 |
(void) snprintf(outbuf,(size_t)80," PEXBDF = %d", fcbp->PEXBDF); |
| 221 |
SCTPUT(outbuf); |
| 222 |
(void) snprintf(outbuf,(size_t)80," ENDLDB = %d, %d", |
| 223 |
fcbp->ENDLDB,fcbp->ENDLDB_OFF); |
| 224 |
SCTPUT(outbuf); |
| 225 |
(void) snprintf(outbuf,(size_t)80," NOLDB = %d",fcbp->NOLDB); |
| 226 |
SCTPUT(outbuf); |
| 227 |
(void) snprintf(outbuf,(size_t)80," DIREXT = %d",fcbp->DIREXT); |
| 228 |
SCTPUT(outbuf); |
| 229 |
(void) snprintf(outbuf,(size_t)80," DIRENTRY = %d",fcbp->DIRENTRY); |
| 230 |
SCTPUT(outbuf); |
| 231 |
(void) snprintf(outbuf,(size_t)80, |
| 232 |
" INLDB = %d (dscr-dir), %d dscr-data)", |
| 233 |
fcbp->INLDB[0],fcbp->INLDB[1]); |
| 234 |
SCTPUT(outbuf); |
| 235 |
(void) snprintf(outbuf,(size_t)80," DBEGIN = %d",fcbp->DBEGIN); |
| 236 |
SCTPUT(outbuf); |
| 237 |
(void) snprintf(outbuf,(size_t)80, |
| 238 |
" DFILLED = %d (dscdir in use)",fcbp->DFILLED); |
| 239 |
SCTPUT(outbuf); |
| 240 |
(void) snprintf(outbuf,(size_t)80, |
| 241 |
" DSIZE = %d (dscdir allocated)",fcbp->DSIZE); |
| 242 |
SCTPUT(outbuf) ; |
| 243 |
(void) snprintf(outbuf,(size_t)80," NOBYT = %d", fcbp->NOBYT); |
| 244 |
SCTPUT(outbuf); |
| 245 |
(void) snprintf(outbuf,(size_t)80," DFORMAT = %d",fcbp->DFORMAT); |
| 246 |
SCTPUT(outbuf); |
| 247 |
(void) snprintf(outbuf,(size_t)80," PIXPBL = %d",fcbp->PIXPBL); |
| 248 |
SCTPUT(outbuf); |
| 249 |
(void) snprintf(outbuf,(size_t)80," D1BLOCK = %d", fcbp->D1BLOCK); |
| 250 |
SCTPUT(outbuf); |
| 251 |
(void) snprintf(outbuf,(size_t)80," DLBLOCK = %d", fcbp->DLBLOCK); |
| 252 |
SCTPUT(outbuf); |
| 253 |
(void) strncpy(cbuf,fcbp->CREATE,28); |
| 254 |
cbuf[28] = '\0'; |
| 255 |
(void) snprintf(outbuf,(size_t)80," CREATE[28] = '%s'",cbuf); |
| 256 |
SCTPUT(outbuf); |
| 257 |
lptr = (long int *) fcbp->CRETIM; |
| 258 |
(void) snprintf(outbuf,(size_t)80," CRETIM = %ld (above in seconds)",*lptr); |
| 259 |
SCTPUT(outbuf); |
| 260 |
sptr = (size_t *) fcbp->XFITSINF1; |
| 261 |
(void) snprintf(outbuf,(size_t)80, |
| 262 |
" FITSINF1 = %d (nopix in FITS file), %zd (as size_t)", |
| 263 |
fcbp->FITSINF1,*sptr); |
| 264 |
SCTPUT(outbuf); |
| 265 |
(void) snprintf(outbuf,(size_t)80, |
| 266 |
" FITSINF2 = %d (offset in FITS file)", fcbp->FITSINF2); |
| 267 |
SCTPUT(outbuf); |
| 268 |
(void) snprintf(outbuf,(size_t)80," NEXT = %d",fcbp->NEXT); |
| 269 |
SCTPUT(outbuf); |
| 270 |
(void) snprintf(outbuf,(size_t)80," } size of FCB = %d bytes", |
| 271 |
(int) sizeof(myFCB)); |
| 272 |
SCTPUT(outbuf); |
| 273 |
SCTPUT(" "); |
| 274 |
|
| 275 |
/* |
| 276 |
if (sizeof(myFCB) > 0) |
| 277 |
{ |
| 278 |
char *cpt1, *cpt2; |
| 279 |
|
| 280 |
cpt1 = (char *) &fcbp->CLONY; |
| 281 |
cpt2 = (char *) fcbp->RESERV2; |
| 282 |
if (cpt2 > cpt1) |
| 283 |
stat = (cpt2 - cpt1); |
| 284 |
else |
| 285 |
stat = (cpt1 - cpt2); |
| 286 |
printf("&fcb->CLONY = %x, fcb->RESERV2 = %x, offset = %d\n", cpt1,cpt2,stat); |
| 287 |
cpt2 = (char *) &fcbp->DLBLOCK; |
| 288 |
if (cpt2 > cpt1) |
| 289 |
stat = (cpt2 - cpt1); |
| 290 |
else |
| 291 |
stat = (cpt1 - cpt2); |
| 292 |
printf("&fcb->CLONY = %x, fcb->DLBLOCK = %x, offset = %d\n", cpt1,cpt2,stat); |
| 293 |
cpt2 = (char *) &fcbp->NEXT; |
| 294 |
if (cpt2 > cpt1) |
| 295 |
stat = (cpt2 - cpt1); |
| 296 |
else |
| 297 |
stat = (cpt1 - cpt2); |
| 298 |
printf("&fcb->CLONY = %x, fcb->NEXT = %x, offset = %d\n", cpt1,cpt2,stat); |
| 299 |
} |
| 300 |
*/ |
| 301 |
|
| 302 |
|
| 303 |
return stat; |
| 304 |
} |
| 305 |
|
| 306 |
|
| 307 |
#ifdef __STDC__ |
| 308 |
void MID_SHOWFCT(char *name) |
| 309 |
#else |
| 310 |
void MID_SHOWFCT(name) |
| 311 |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 312 |
.PURPOSE |
| 313 |
display contents of FCT of that file |
| 314 |
.RETURNS |
| 315 |
nothing |
| 316 |
-----------------------------------------------------------------*/ |
| 317 |
char *name; /* IN: file name */ |
| 318 |
#endif |
| 319 |
|
| 320 |
{ |
| 321 |
char outbuf[80]; |
| 322 |
|
| 323 |
int imnoa; |
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
(void) SCFOPN(name,D_OLD_FORMAT,0,F_OLD_TYPE,&imnoa); |
| 330 |
|
| 331 |
(void) snprintf(outbuf,(size_t)80,"FCT of file %s (imno %d)",name,imnoa); |
| 332 |
SCTPUT(outbuf); |
| 333 |
SCTPUT(" {"); |
| 334 |
|
| 335 |
fctpntr = FCT.ENTRIES + imnoa; |
| 336 |
(void) snprintf(outbuf,(size_t)80," NAMLEN = %d",fctpntr->NAMLEN); |
| 337 |
SCTPUT(outbuf); |
| 338 |
(void) snprintf(outbuf,(size_t)80," IOCHAN = %d",fctpntr->IOCHAN); |
| 339 |
SCTPUT(outbuf); |
| 340 |
|
| 341 |
#if vms |
| 342 |
(void) snprintf(outbuf,(size_t)80," FILEID(a),(b) = %d,%d", |
| 343 |
fctpntr->FILEIDA,fctpntr->FILEIDB); |
| 344 |
#else |
| 345 |
(void) snprintf(outbuf,(size_t)80," FILEID = %d",fctpntr->FILEID); |
| 346 |
#endif |
| 347 |
|
| 348 |
SCTPUT(outbuf); |
| 349 |
(void) snprintf(outbuf,(size_t)80," KAUX = %d, %d, %d, %d", |
| 350 |
fctpntr->KAUX[0],fctpntr->KAUX[1],fctpntr->KAUX[2],fctpntr->KAUX[3]); |
| 351 |
SCTPUT(outbuf); |
| 352 |
(void) snprintf(outbuf,(size_t)80," SIZE = %zd",fctpntr->SIZE); |
| 353 |
SCTPUT(outbuf); |
| 354 |
(void) snprintf(outbuf,(size_t)80," PROT = %d",fctpntr->PROT); |
| 355 |
SCTPUT(outbuf); |
| 356 |
(void) snprintf(outbuf,(size_t)80," COMPRESS = %d",fctpntr->COMPRESS); |
| 357 |
SCTPUT(outbuf); |
| 358 |
(void) snprintf(outbuf,(size_t)80," NOBYTE = %d",fctpntr->NOBYTE); |
| 359 |
SCTPUT(outbuf); |
| 360 |
(void) snprintf(outbuf,(size_t)80," FORMAT = %d",fctpntr->FORMAT); |
| 361 |
SCTPUT(outbuf); |
| 362 |
(void) snprintf(outbuf,(size_t)80," PIXPBL = %d",fctpntr->PIXPBL); |
| 363 |
SCTPUT(outbuf); |
| 364 |
(void) snprintf(outbuf,(size_t)80," STBLOK = %d",fctpntr->STBLOK); |
| 365 |
SCTPUT(outbuf); |
| 366 |
(void) snprintf(outbuf,(size_t)80," DATTYP = %d",fctpntr->DATTYP); |
| 367 |
SCTPUT(outbuf); |
| 368 |
(void) snprintf(outbuf,(size_t)80," FILTYP = %d",fctpntr->FILTYP); |
| 369 |
SCTPUT(outbuf); |
| 370 |
(void) snprintf(outbuf,(size_t)80," FITSEXT = %d",fctpntr->FITSEXT); |
| 371 |
SCTPUT(outbuf); |
| 372 |
(void) snprintf(outbuf,(size_t)80," LINK = %d, %d", |
| 373 |
fctpntr->LINK[0],fctpntr->LINK[1]); |
| 374 |
SCTPUT(outbuf); |
| 375 |
(void) snprintf(outbuf,(size_t)80," CR_FLAG = %d",fctpntr->CR_FLAG); |
| 376 |
SCTPUT(outbuf); |
| 377 |
(void) snprintf(outbuf,(size_t)80," O_NAMLEN = %d",fctpntr->O_NAMLEN); |
| 378 |
SCTPUT(outbuf); |
| 379 |
(void) snprintf(outbuf,(size_t)80," NAME = '%s'",fctpntr->NAME); |
| 380 |
SCTPUT(outbuf); |
| 381 |
(void) snprintf(outbuf,(size_t)80," BDADDR = %p, %p, %p, %p", |
| 382 |
fctpntr->BDADDR[0],fctpntr->BDADDR[1], |
| 383 |
fctpntr->BDADDR[2],fctpntr->BDADDR[3]); |
| 384 |
SCTPUT(outbuf); |
| 385 |
(void) snprintf(outbuf,(size_t)80," PNTR = %p",fctpntr->PNTR); |
| 386 |
SCTPUT(outbuf); |
| 387 |
(void) snprintf(outbuf,(size_t)80," CATALOG = '%c%c'", |
| 388 |
fctpntr->CATALOG[0],fctpntr->CATALOG[1]); |
| 389 |
SCTPUT(outbuf); |
| 390 |
(void) snprintf(outbuf,(size_t)80," ACCESS = '%c'",fctpntr->ACCESS); |
| 391 |
SCTPUT(outbuf); |
| 392 |
(void) snprintf(outbuf,(size_t)80," } size of FCT = %d bytes", |
| 393 |
(int) sizeof(FCT_X)); |
| 394 |
SCTPUT(outbuf); |
| 395 |
SCTPUT(" "); |
| 396 |
|
| 397 |
} |
| 398 |
|
| 399 |
|
| 400 |
#ifdef __STDC__ |
| 401 |
void MID_SHOWFCT1(int imno) |
| 402 |
#else |
| 403 |
void MID_SHOWFCT1(imno) |
| 404 |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 405 |
.PURPOSE |
| 406 |
display contents of FCT of file with FCT entry = imno |
| 407 |
this is like MID_SHOWFCT with FCT entry already known |
| 408 |
.RETURNS |
| 409 |
nothing |
| 410 |
-----------------------------------------------------------------*/ |
| 411 |
int imno; /* IN: entry in FCT */ |
| 412 |
#endif |
| 413 |
|
| 414 |
{ |
| 415 |
char outbuf[80]; |
| 416 |
|
| 417 |
|
| 418 |
|
| 419 |
|
| 420 |
|
| 421 |
|
| 422 |
fctpntr = FCT.ENTRIES + imno; |
| 423 |
|
| 424 |
(void) |
| 425 |
snprintf(outbuf,(size_t)80,"FCT of file %s (imno %d)",fctpntr->NAME,imno); |
| 426 |
SCTPUT(outbuf); |
| 427 |
|
| 428 |
SCTPUT(" {"); |
| 429 |
(void) snprintf(outbuf,(size_t)80," NAMLEN = %d",fctpntr->NAMLEN); |
| 430 |
SCTPUT(outbuf); |
| 431 |
(void) snprintf(outbuf,(size_t)80," IOCHAN = %d",fctpntr->IOCHAN); |
| 432 |
SCTPUT(outbuf); |
| 433 |
|
| 434 |
#if vms |
| 435 |
(void) snprintf(outbuf,(size_t)80," FILEID(a),(b) = %d,%d", |
| 436 |
fctpntr->FILEIDA,fctpntr->FILEIDB); |
| 437 |
#else |
| 438 |
(void) snprintf(outbuf,(size_t)80," FILEID = %d",fctpntr->FILEID); |
| 439 |
#endif |
| 440 |
|
| 441 |
SCTPUT(outbuf); |
| 442 |
(void) snprintf(outbuf,(size_t)80," KAUX = %d, %d, %d, %d", |
| 443 |
fctpntr->KAUX[0],fctpntr->KAUX[1],fctpntr->KAUX[2],fctpntr->KAUX[3]); |
| 444 |
SCTPUT(outbuf); |
| 445 |
(void) snprintf(outbuf,(size_t)80," SIZE = %zd",fctpntr->SIZE); |
| 446 |
SCTPUT(outbuf); |
| 447 |
(void) snprintf(outbuf,(size_t)80," PROT = %d",fctpntr->PROT); |
| 448 |
SCTPUT(outbuf); |
| 449 |
(void) snprintf(outbuf,(size_t)80," COMPRESS = %d",fctpntr->COMPRESS); |
| 450 |
SCTPUT(outbuf); |
| 451 |
(void) snprintf(outbuf,(size_t)80," NOBYTE = %d",fctpntr->NOBYTE); |
| 452 |
SCTPUT(outbuf); |
| 453 |
(void) snprintf(outbuf,(size_t)80," FORMAT = %d",fctpntr->FORMAT); |
| 454 |
SCTPUT(outbuf); |
| 455 |
(void) snprintf(outbuf,(size_t)80," PIXPBL = %d",fctpntr->PIXPBL); |
| 456 |
SCTPUT(outbuf); |
| 457 |
(void) snprintf(outbuf,(size_t)80," STBLOK = %d",fctpntr->STBLOK); |
| 458 |
SCTPUT(outbuf); |
| 459 |
(void) snprintf(outbuf,(size_t)80," DATTYP = %d",fctpntr->DATTYP); |
| 460 |
SCTPUT(outbuf); |
| 461 |
(void) snprintf(outbuf,(size_t)80," FILTYP = %d",fctpntr->FILTYP); |
| 462 |
SCTPUT(outbuf); |
| 463 |
(void) snprintf(outbuf,(size_t)80," FITSEXT = %d",fctpntr->FITSEXT); |
| 464 |
SCTPUT(outbuf); |
| 465 |
(void) snprintf(outbuf,(size_t)80," LINK = %d, %d", |
| 466 |
fctpntr->LINK[0],fctpntr->LINK[1]); |
| 467 |
SCTPUT(outbuf); |
| 468 |
(void) snprintf(outbuf,(size_t)80," CR_FLAG = %d",fctpntr->CR_FLAG); |
| 469 |
SCTPUT(outbuf); |
| 470 |
(void) snprintf(outbuf,(size_t)80," O_NAMLEN = %d",fctpntr->O_NAMLEN); |
| 471 |
SCTPUT(outbuf); |
| 472 |
(void) snprintf(outbuf,(size_t)80," NAME = '%s'",fctpntr->NAME); |
| 473 |
SCTPUT(outbuf); |
| 474 |
(void) snprintf(outbuf,(size_t)80," BDADDR = %p, %p, %p, %p", |
| 475 |
fctpntr->BDADDR[0],fctpntr->BDADDR[1], |
| 476 |
fctpntr->BDADDR[2],fctpntr->BDADDR[3]); |
| 477 |
SCTPUT(outbuf); |
| 478 |
(void) snprintf(outbuf,(size_t)80," PNTR = %p",fctpntr->PNTR); |
| 479 |
SCTPUT(outbuf); |
| 480 |
(void) snprintf(outbuf,(size_t)80," CATALOG = '%c%c'", |
| 481 |
fctpntr->CATALOG[0],fctpntr->CATALOG[1]); |
| 482 |
SCTPUT(outbuf); |
| 483 |
(void) snprintf(outbuf,(size_t)80," ACCESS = '%c'",fctpntr->ACCESS); |
| 484 |
SCTPUT(outbuf); |
| 485 |
(void) snprintf(outbuf,(size_t)80," } size of FCT = %d bytes", |
| 486 |
(int) sizeof(FCT_X)); |
| 487 |
SCTPUT(outbuf); |
| 488 |
SCTPUT(" "); |
| 489 |
|
| 490 |
} |
| 491 |
|
| 492 |
|
| 493 |
#ifdef __STDC__ |
| 494 |
void MID_SHOWFCT2(int imno) |
| 495 |
#else |
| 496 |
void MID_SHOWFCT2(imno) |
| 497 |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 498 |
.PURPOSE |
| 499 |
display contents of FCT of file with FCT entry = imno |
| 500 |
this is a reduced version of MID_SHOWFCT1 |
| 501 |
.RETURNS |
| 502 |
nothing |
| 503 |
-----------------------------------------------------------------*/ |
| 504 |
int imno; /* IN: entry in FCT */ |
| 505 |
#endif |
| 506 |
|
| 507 |
{ |
| 508 |
char outbuf[80]; |
| 509 |
|
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
fctpntr = FCT.ENTRIES + imno; |
| 514 |
(void) |
| 515 |
snprintf(outbuf,(size_t)80,"FCT of file %s (imno %d)",fctpntr->NAME,imno); |
| 516 |
SCTPUT(outbuf); |
| 517 |
|
| 518 |
SCTPUT(" {"); |
| 519 |
(void) snprintf(outbuf,(size_t)80," IOCHAN = %d",fctpntr->IOCHAN); |
| 520 |
SCTPUT(outbuf); |
| 521 |
(void) snprintf(outbuf,(size_t)80," SIZE = %zd",fctpntr->SIZE); |
| 522 |
SCTPUT(outbuf); |
| 523 |
(void) snprintf(outbuf,(size_t)80," FILTYP = %d",fctpntr->FILTYP); |
| 524 |
SCTPUT(outbuf); |
| 525 |
(void) snprintf(outbuf,(size_t)80," FITSEXT = %d",fctpntr->FITSEXT); |
| 526 |
SCTPUT(outbuf); |
| 527 |
(void) snprintf(outbuf,(size_t)80," O_NAMLEN = %d",fctpntr->O_NAMLEN); |
| 528 |
SCTPUT(outbuf); |
| 529 |
(void) snprintf(outbuf,(size_t)80," ACCESS = '%c'",fctpntr->ACCESS); |
| 530 |
SCTPUT(outbuf); |
| 531 |
(void) snprintf(outbuf,(size_t)80," } size of FCT = %d bytes", |
| 532 |
(int) sizeof(FCT_X)); |
| 533 |
SCTPUT(outbuf); |
| 534 |
SCTPUT(" "); |
| 535 |
|
| 536 |
} |
| 537 |
|
| 538 |
|