"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "putcolb.c" between
cfitsio-3.49.tar.gz and cfitsio-4.0.0.tar.gz

About: CFITSIO is a library of C and Fortran subroutines for reading and writing data files in the FITS (Flexible Image Transport System) data format.

putcolb.c  (cfitsio-3.49):putcolb.c  (cfitsio-4.0.0)
skipping to change at line 358 skipping to change at line 358
array. FITSIO treats a primary array as a binary table with array. FITSIO treats a primary array as a binary table with
2 vector columns: the first column contains the group parameters (often 2 vector columns: the first column contains the group parameters (often
with length = 0) and the second column contains the array of image pixels. with length = 0) and the second column contains the array of image pixels.
Each row of the table represents a group in the case of multigroup FITS Each row of the table represents a group in the case of multigroup FITS
images. images.
The input array of values will be converted to the datatype of the column The input array of values will be converted to the datatype of the column
and will be inverse-scaled by the FITS TSCALn and TZEROn values if necessary. and will be inverse-scaled by the FITS TSCALn and TZEROn values if necessary.
*/ */
{ {
int writemode;
int tcode, maxelem2, hdutype, writeraw; int tcode, maxelem2, hdutype, writeraw;
long twidth, incre; long twidth, incre;
long ntodo; long ntodo;
LONGLONG repeat, startpos, elemnum, wrtptr, rowlen, rownum, remain, next, tn ull, maxelem; LONGLONG repeat, startpos, elemnum, wrtptr, rowlen, rownum, remain, next, tn ull, maxelem;
double scale, zero; double scale, zero;
char tform[20], cform[20]; char tform[20], cform[20];
char message[FLEN_ERRMSG]; char message[FLEN_ERRMSG];
char snull[20]; /* the FITS null value */ char snull[20]; /* the FITS null value */
skipping to change at line 379 skipping to change at line 380
void *buffer; void *buffer;
if (*status > 0) /* inherit input status value if > 0 */ if (*status > 0) /* inherit input status value if > 0 */
return(*status); return(*status);
buffer = cbuff; buffer = cbuff;
/*---------------------------------------------------*/ /*---------------------------------------------------*/
/* Check input and get parameters about the column: */ /* Check input and get parameters about the column: */
/*---------------------------------------------------*/ /*---------------------------------------------------*/
if (ffgcprll( fptr, colnum, firstrow, firstelem, nelem, 1, &scale, &zero,
/* IMPORTANT NOTE: that the special case of using this subroutine
to write bytes to a character column are handled internally
by the call to ffgcprll() below. It will adjust the effective
*tcode, repeats, etc, to appear as a TBYTE column. */
writemode = 17; /* Equivalent to writemode = 1 but allow TSTRING -> TBYTE */
if (ffgcprll( fptr, colnum, firstrow, firstelem, nelem, writemode, &scale, &
zero,
tform, &twidth, &tcode, &maxelem2, &startpos, &elemnum, &incre, tform, &twidth, &tcode, &maxelem2, &startpos, &elemnum, &incre,
&repeat, &rowlen, &hdutype, &tnull, snull, status) > 0) &repeat, &rowlen, &hdutype, &tnull, snull, status) > 0)
return(*status); return(*status);
maxelem = maxelem2; maxelem = maxelem2;
if (tcode == TSTRING) if (tcode == TSTRING)
ffcfmt(tform, cform); /* derive C format for writing strings */ ffcfmt(tform, cform); /* derive C format for writing strings */
/* /*
if there is no scaling if there is no scaling
skipping to change at line 483 skipping to change at line 492
break; break;
case (TDOUBLE): case (TDOUBLE):
ffi1fr8(&array[next], ntodo, scale, zero, ffi1fr8(&array[next], ntodo, scale, zero,
(double *) buffer, status); (double *) buffer, status);
ffpr8b(fptr, ntodo, incre, (double *) buffer, status); ffpr8b(fptr, ntodo, incre, (double *) buffer, status);
break; break;
case (TSTRING): /* numerical column in an ASCII table */ case (TSTRING): /* numerical column in an ASCII table */
if (strchr(tform,'A')) if (strchr(tform,'A'))
{ {
/* write raw input bytes without conversion */ /* write raw input bytes without conversion */
/* This case is a hack to let users write a stream */ /* This case is a hack to let users write a stream */
/* of bytes directly to the 'A' format column */ /* of bytes directly to the 'A' format column */
if (incre == twidth) if (incre == twidth) {
ffpbyt(fptr, ntodo, &array[next], status); ffpbyt(fptr, ntodo, &array[next], status);
else } else {
ffpbytoff(fptr, twidth, ntodo/twidth, incre - twidth, ffpbytoff(fptr, twidth, ntodo/twidth, incre - twidth,
&array[next], status); &array[next], status);
break; }
break;
} }
else if (cform[1] != 's') /* "%s" format is a string */ else if (cform[1] != 's') /* "%s" format is a string */
{ {
ffi1fstr(&array[next], ntodo, scale, zero, cform, ffi1fstr(&array[next], ntodo, scale, zero, cform,
twidth, (char *) buffer, status); twidth, (char *) buffer, status);
if (incre == twidth) /* contiguous bytes */ if (incre == twidth) /* contiguous bytes */
ffpbyt(fptr, ntodo * twidth, buffer, status); ffpbyt(fptr, ntodo * twidth, buffer, status);
else else
ffpbytoff(fptr, twidth, ntodo, incre - twidth, buffer, ffpbytoff(fptr, twidth, ntodo, incre - twidth, buffer,
 End of changes. 6 change blocks. 
5 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)