r930 - in packages/libastro-fits-cfitsio-perl/branches/upstream/current: . testprog
Gunnar Wolf
gwolf@costa.debian.org
Wed, 13 Apr 2005 16:08:47 +0000
Author: gwolf
Date: 2005-04-13 16:08:45 +0000 (Wed, 13 Apr 2005)
New Revision: 930
Added:
packages/libastro-fits-cfitsio-perl/branches/upstream/current/META.yml
Modified:
packages/libastro-fits-cfitsio-perl/branches/upstream/current/CFITSIO.pm
packages/libastro-fits-cfitsio-perl/branches/upstream/current/CFITSIO.xs
packages/libastro-fits-cfitsio-perl/branches/upstream/current/ChangeLog
packages/libastro-fits-cfitsio-perl/branches/upstream/current/INSTALL
packages/libastro-fits-cfitsio-perl/branches/upstream/current/MANIFEST
packages/libastro-fits-cfitsio-perl/branches/upstream/current/Makefile.PL
packages/libastro-fits-cfitsio-perl/branches/upstream/current/README
packages/libastro-fits-cfitsio-perl/branches/upstream/current/announce
packages/libastro-fits-cfitsio-perl/branches/upstream/current/test.pl
packages/libastro-fits-cfitsio-perl/branches/upstream/current/testprog/runtests
packages/libastro-fits-cfitsio-perl/branches/upstream/current/typemap
Log:
Load /tmp/tmp.HsphD4/libastro-fits-cfitsio-perl-1.03 into
packages/libastro-fits-cfitsio-perl/branches/upstream/current.
Modified: packages/libastro-fits-cfitsio-perl/branches/upstream/current/CFITSIO.pm
===================================================================
--- packages/libastro-fits-cfitsio-perl/branches/upstream/current/CFITSIO.pm 2005-04-13 01:20:42 UTC (rev 929)
+++ packages/libastro-fits-cfitsio-perl/branches/upstream/current/CFITSIO.pm 2005-04-13 16:08:45 UTC (rev 930)
@@ -1,5 +1,5 @@
package Astro::FITS::CFITSIO;
-$VERSION = '1.02';
+$VERSION = '1.03';
use strict;
use Carp;
@@ -45,6 +45,7 @@
ffflsh => 'fits_flush_buffer',
ffclos => 'fits_close_file',
ffdelt => 'fits_delete_file',
+ ffexist => 'fits_file_exists',
ffflnm => 'fits_file_name',
ffflmd => 'fits_file_mode',
ffurlt => 'fits_url_type',
@@ -573,6 +574,7 @@
KEY_NO_EXIST
KEY_OUT_BOUNDS
LONG_IMG
+ LONGLONG_IMG
MAXHDU
MEMBER_NOT_FOUND
MEMORY_ALLOCATION
Modified: packages/libastro-fits-cfitsio-perl/branches/upstream/current/CFITSIO.xs
===================================================================
--- packages/libastro-fits-cfitsio-perl/branches/upstream/current/CFITSIO.xs 2005-04-13 01:20:42 UTC (rev 929)
+++ packages/libastro-fits-cfitsio-perl/branches/upstream/current/CFITSIO.xs 2005-04-13 16:08:45 UTC (rev 930)
@@ -583,6 +583,12 @@
#else
goto not_there;
#endif
+ if (strEQ(name, "LONGLONG_IMG"))
+#ifdef LONGLONG_IMG
+ return LONGLONG_IMG;
+#else
+ goto not_there;
+#endif
break;
case 'M':
if (strEQ(name, "MAXHDU"))
@@ -1008,7 +1014,7 @@
goto not_there;
#endif
if (strEQ(name, "TSBYTE"))
-#ifdef TBYTE
+#ifdef TSBYTE
return TSBYTE;
#else
goto not_there;
@@ -1295,11 +1301,17 @@
#define NewFitsFile(fptr) \
do \
-{ New(0, fptr, 1, FitsFile);\
- fptr->perlyunpacking = -1;\
- fptr->is_open = 1;\
+{ New(0, fptr, 1, FitsFile);\
+ fptr->perlyunpacking = -1;\
+ fptr->is_open = 1;\
} while(0)
+#define AbortFitsFile(fptr) \
+do \
+{ Safefree(fptr);\
+ fptr = 0;\
+} while(0)
+
MODULE = Astro::FITS::CFITSIO PACKAGE = Astro::FITS::CFITSIO
PROTOTYPES: DISABLE
@@ -1659,25 +1671,29 @@
char * name
int status
PREINIT:
- FitsFile * fptr;
+ FitsFile* fptr;
CODE:
NewFitsFile(fptr);
- ffinit(&(fptr->fptr),name,&status);
+ if (ffinit(&(fptr->fptr),name,&status))
+ AbortFitsFile(fptr);
RETVAL = fptr;
+
OUTPUT:
RETVAL
status
int
ffinit(fptr,name,status)
- FitsFile * &fptr = NO_INIT
+ FitsFile * fptr = NO_INIT
char * name
- int &status
+ int status
ALIAS:
Astro::FITS::CFITSIO::fits_create_file = 1
CODE:
NewFitsFile(fptr);
RETVAL = ffinit(&(fptr->fptr),name,&status);
+ if (RETVAL)
+ AbortFitsFile(fptr);
OUTPUT:
RETVAL
fptr
@@ -1744,7 +1760,8 @@
FitsFile * fptr;
CODE:
NewFitsFile(fptr);
- fftplt(&(fptr->fptr),filename,tpltfile,&status);
+ if (fftplt(&(fptr->fptr),filename,tpltfile,&status))
+ AbortFitsFile(fptr);
RETVAL = fptr;
OUTPUT:
RETVAL
@@ -1760,7 +1777,9 @@
Astro::FITS::CFITSIO::fits_create_template = 1
CODE:
NewFitsFile(fptr);
- fftplt(&(fptr->fptr),filename,tpltfile,&status);
+ RETVAL = fftplt(&(fptr->fptr),filename,tpltfile,&status);
+ if (RETVAL)
+ AbortFitsFile(fptr);
OUTPUT:
RETVAL
fptr
@@ -1942,6 +1961,17 @@
ascii
int
+ffexist(filename, exists, status)
+ char* filename
+ int &exists = NO_INIT
+ int &status
+ ALIAS:
+ Astro::FITS::CFITSIO::fits_file_exists = 1
+ OUTPUT:
+ exists
+ status
+
+int
ffflmd(fptr,iomode,status)
fitsfile * fptr
int &iomode = NO_INIT
@@ -3191,29 +3221,23 @@
OUTPUT:
status
-void
+FitsFile*
open_file(filename,iomode,status)
char * filename
int iomode
int status
PREINIT:
FitsFile * fptr;
- SV *retval;
- PPCODE:
+ CODE:
if (!filename) /* undef passed */
filename = "";
NewFitsFile(fptr);
- ffopen(&(fptr->fptr),filename,iomode,&status);
- sv_setiv(ST(2), (IV)status);
- SvSETMAGIC(ST(2));
- EXTEND(SP, 1);
- if (status > 0)
- PUSHs(&PL_sv_undef);
- else {
- retval = sv_newmortal();
- sv_setref_pv(retval,"fitsfilePtr",fptr);
- PUSHs(retval);
- }
+ if (ffopen(&(fptr->fptr),filename,iomode,&status))
+ AbortFitsFile(fptr);
+ RETVAL = fptr;
+ OUTPUT:
+ RETVAL
+ status
int
ffopen(fptr,filename,iomode,status)
@@ -3228,13 +3252,11 @@
filename = "";
NewFitsFile(fptr);
RETVAL = ffopen(&(fptr->fptr),filename,iomode,&status);
- if (status==0) {
- sv_setref_pv(ST(0),"fitsfilePtr",fptr);
- }
- else
- sv_setsv(ST(0), &PL_sv_undef);
+ if (RETVAL)
+ AbortFitsFile(fptr);
OUTPUT:
RETVAL
+ fptr
status
int
@@ -3250,13 +3272,11 @@
filename = "";
NewFitsFile(fptr);
RETVAL = ffdopn(&(fptr->fptr),filename,iomode,&status);
- if (status==0) {
- sv_setref_pv(ST(0),"fitsfilePtr",fptr);
- }
- else
- sv_setsv(ST(0), &PL_sv_undef);
+ if (RETVAL)
+ AbortFitsFile(fptr);
OUTPUT:
RETVAL
+ fptr
status
int
@@ -3272,13 +3292,11 @@
filename = "";
NewFitsFile(fptr);
RETVAL = ffiopn(&(fptr->fptr),filename,iomode,&status);
- if (status==0) {
- sv_setref_pv(ST(0),"fitsfilePtr",fptr);
- }
- else
- sv_setsv(ST(0), &PL_sv_undef);
+ if (RETVAL)
+ AbortFitsFile(fptr);
OUTPUT:
RETVAL
+ fptr
status
int
@@ -3294,13 +3312,11 @@
filename = "";
NewFitsFile(fptr);
RETVAL = fftopn(&(fptr->fptr),filename,iomode,&status);
- if (status==0) {
- sv_setref_pv(ST(0),"fitsfilePtr",fptr);
- }
- else
- sv_setsv(ST(0), &PL_sv_undef);
+ if (RETVAL)
+ AbortFitsFile(fptr);
OUTPUT:
RETVAL
+ fptr
status
int
@@ -3315,13 +3331,12 @@
CODE:
NewFitsFile(gfptr);
RETVAL = ffgtop(mfptr,group,&(gfptr->fptr),&status);
- if (status > 0)
- sv_setsv(ST(2), &PL_sv_undef);
- else
- sv_setref_pv(ST(2),"fitsfilePtr",gfptr);
+ if (RETVAL)
+ AbortFitsFile(gfptr);
OUTPUT:
+ RETVAL
+ gfptr
status
- RETVAL
int
ffgmop(gfptr,member,mfptr,status)
@@ -3335,12 +3350,11 @@
CODE:
NewFitsFile(mfptr);
RETVAL = ffgmop(gfptr,member,&(mfptr->fptr),&status);
- if (status > 0)
- sv_setsv(ST(2), &PL_sv_undef);
- else
- sv_setref_pv(ST(2),"fitsfilePtr",mfptr);
+ if (RETVAL)
+ AbortFitsFile(mfptr);
OUTPUT:
status
+ mfptr
RETVAL
int
@@ -5244,19 +5258,19 @@
else
array = get_mortalspace(nelem,TCOMPLEX);
if (ST(6) != &PL_sv_undef) {
- SvGROW(ST(6),2*nelem*sizeof_datatype(TLOGICAL));
+ SvGROW(ST(6),nelem*sizeof_datatype(TLOGICAL));
nularray = (logical*)(SvPV(ST(6),PL_na));
}
else
- nularray = get_mortalspace(2*nelem,TLOGICAL);
+ nularray = get_mortalspace(nelem,TLOGICAL);
RETVAL=ffgcfc(fptr->fptr,colnum,frow,felem,nelem,array,nularray,&anynul,&status);
}
else {
array = get_mortalspace(nelem,TCOMPLEX);
- nularray = get_mortalspace(nelem*2,TLOGICAL);
+ nularray = get_mortalspace(nelem,TLOGICAL);
RETVAL=ffgcfc(fptr->fptr,colnum,frow,felem,nelem,array,nularray,&anynul,&status);
if (ST(5) != &PL_sv_undef) unpack1D(ST(5),array,nelem,TCOMPLEX,fptr->perlyunpacking);
- if (ST(6) != &PL_sv_undef) unpack1D(ST(6),nularray,nelem*2,TLOGICAL,fptr->perlyunpacking);
+ if (ST(6) != &PL_sv_undef) unpack1D(ST(6),nularray,nelem,TLOGICAL,fptr->perlyunpacking);
}
if (ST(7) != &PL_sv_undef) sv_setiv(ST(7),anynul);
OUTPUT:
@@ -5286,19 +5300,19 @@
else
array = get_mortalspace(nelem,TDBLCOMPLEX);
if (ST(6) != &PL_sv_undef) {
- SvGROW(ST(6),2*nelem*sizeof_datatype(TLOGICAL));
+ SvGROW(ST(6),nelem*sizeof_datatype(TLOGICAL));
nularray = (logical*)(SvPV(ST(6),PL_na));
}
else
- nularray = get_mortalspace(2*nelem,TLOGICAL);
+ nularray = get_mortalspace(nelem,TLOGICAL);
RETVAL=ffgcfm(fptr->fptr,colnum,frow,felem,nelem,array,nularray,&anynul,&status);
}
else {
array = get_mortalspace(nelem,TDBLCOMPLEX);
- nularray = get_mortalspace(nelem*2,TLOGICAL);
+ nularray = get_mortalspace(nelem,TLOGICAL);
RETVAL=ffgcfm(fptr->fptr,colnum,frow,felem,nelem,array,nularray,&anynul,&status);
if (ST(5) != &PL_sv_undef) unpack1D(ST(5),array,nelem,TDBLCOMPLEX,fptr->perlyunpacking);
- if (ST(6) != &PL_sv_undef) unpack1D(ST(6),nularray,nelem*2,TLOGICAL,fptr->perlyunpacking);
+ if (ST(6) != &PL_sv_undef) unpack1D(ST(6),nularray,nelem,TLOGICAL,fptr->perlyunpacking);
}
if (ST(7) != &PL_sv_undef) sv_setiv(ST(7),anynul);
OUTPUT:
@@ -7720,12 +7734,11 @@
CODE:
NewFitsFile(newfptr);
RETVAL = ffreopen(openfptr,&(newfptr->fptr),&status);
- if (status > 0)
- sv_setsv(ST(1), &PL_sv_undef);
- else
- sv_setref_pv(ST(1),"fitsfilePtr",newfptr);
+ if (RETVAL)
+ AbortFitsFile(newfptr);
OUTPUT:
status
+ newfptr
RETVAL
void
Modified: packages/libastro-fits-cfitsio-perl/branches/upstream/current/ChangeLog
===================================================================
--- packages/libastro-fits-cfitsio-perl/branches/upstream/current/ChangeLog 2005-04-13 01:20:42 UTC (rev 929)
+++ packages/libastro-fits-cfitsio-perl/branches/upstream/current/ChangeLog 2005-04-13 16:08:45 UTC (rev 930)
@@ -1,3 +1,29 @@
+2004-08-16 Pete Ratzlaff <pratzlaff@cfa.harvard.edu>
+
+ * CFITSIO.pm: $VERSION = '1.0.3';
+
+2004-08-02 Pete Ratzlaff <pratzlaff@cfa.harvard.edu>
+
+ * CFITSIO.xs: add fits_file_exists() from cfitsio 2500.
+ fits_read_colnull_cmp() and fits_read_colnull_dblcmp() null arrays
+ should contain nelem as per cfitsio 2500 changes.
+
+ * Makefile.PL: add -I$ENV{CFITSIO}/include, -L$ENV{CFITSIO}/lib
+
+2004-04-08 Pete Ratzlaff <pratzlaff@cfa.harvard.edu>
+
+ * CFITSIO.xs: added AbortFitsFile macro to complement NewFitsFile
+ in cases where create/open of a file fails. FitsFile* output
+ typemap changed accordingly. The AbortFitsFile macro frees the
+ memory that NewFitsFile allocated, sets the argument to NULL, and
+ the output typemap will not bless the scalar - undef is returned
+ instead of an invalid FitsFile object (which DESTROY would croak
+ at).
+
+2004-04-07 Diab Jerius <djerius@cfa.harvard.edu>
+
+ * CFITSIO.xs: LONGLONG_IMG constant added
+
2004-03-25 Pete Ratzlaff <pratzlaff@cfa.harvard.edu>
* CFITSIO.pm: $VERSION = '1.02';
Modified: packages/libastro-fits-cfitsio-perl/branches/upstream/current/INSTALL
===================================================================
--- packages/libastro-fits-cfitsio-perl/branches/upstream/current/INSTALL 2005-04-13 01:20:42 UTC (rev 929)
+++ packages/libastro-fits-cfitsio-perl/branches/upstream/current/INSTALL 2005-04-13 16:08:45 UTC (rev 930)
@@ -1,33 +1,42 @@
+NOTE: Astro::FITS::CFITSIO v1.03 requires cfitsio library version
+ 2.500 or later. It can be obtained from
+ http://heasarc.gsfc.nasa.gov/fitsio
+
NOTE: gcc takes a very long time to compile CFITSIO.c (created from
CFITSIO.xs) with -O2 optimization on ix86. With -O, it takes
- about one tenth the time. This is the explanation for the optimization
- flag below. Use whatever flag you want, of course...
+ about one tenth the time. This is the explanation for the
+ optimization flag below. Use whatever flag you want, of
+ course...
1. Set the CFITSIO environment variable pointing to the location of
- your cfitsio library and headers.
+ your cfitsio library and headers (e.g., /usr/local/cfitsio), or a
+ prefix with include and lib subdirectories containing the cfitsio
+ headers and library, respectively (e.g., /usr/local).
- $ export CFITSIO=/path/to/cfitsio # Bourne shell and friends
- % setenv CFITSIO /path/to/cfitsio # C shell variants
+ $ CFITSIO=/usr/local/cfitsio # Bourne shell and friends
+ $ export CFITSIO
+ % setenv CFITSIO /usr/local/cfitsio # C shell variants
+
2. perl Makefile.PL OPTIMIZE=-O
3. make
4. make test
-5. If you want, compare the output of the testprog/testprog*.pl scripts
- to cfitsio's testprog.c. There is a small shell script (heresy!) -
- runtests - included to make this easier.
+5. If you want, compare the output of the testprog/testprog*.pl
+ scripts to cfitsio's testprog.c. There is a small shell script -
+ "runtests" - included to make this easier.
6. make install
-If compilation fails, please make sure the version of cfitsio you're using
-matches that listed in README as a requirement for this version of the
-module.
+If compilation fails, please make sure the version of cfitsio you're
+using matches that listed in README as a requirement for this version
+of the module.
-If compilaton succeeds but 'make test' fails due to unresolved symbols, you
-should try explicity setting the libcfitsio.a to link to. In Makefile.PL, add
-the following key to the WriteMakefile() argument list:
+If compilaton succeeds but 'make test' fails due to unresolved
+symbols, you should try explicity setting the libcfitsio.a to link
+to. In Makefile.PL, add the following key to the WriteMakefile()
+argument list:
'MYEXTLIB' => '/path/to/libcfitsio.a',
-
Modified: packages/libastro-fits-cfitsio-perl/branches/upstream/current/MANIFEST
===================================================================
--- packages/libastro-fits-cfitsio-perl/branches/upstream/current/MANIFEST 2005-04-13 01:20:42 UTC (rev 929)
+++ packages/libastro-fits-cfitsio-perl/branches/upstream/current/MANIFEST 2005-04-13 16:08:45 UTC (rev 930)
@@ -27,3 +27,4 @@
testprog/testprog_pdl.pl
testprog/runtests
TODO
+META.yml Module meta-data (added by MakeMaker)
Added: packages/libastro-fits-cfitsio-perl/branches/upstream/current/META.yml
===================================================================
--- packages/libastro-fits-cfitsio-perl/branches/upstream/current/META.yml 2005-04-13 01:20:42 UTC (rev 929)
+++ packages/libastro-fits-cfitsio-perl/branches/upstream/current/META.yml 2005-04-13 16:08:45 UTC (rev 930)
@@ -0,0 +1,10 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
+name: Astro-FITS-CFITSIO
+version: 1.03
+version_from: CFITSIO.pm
+installdirs: site
+requires:
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.17
Modified: packages/libastro-fits-cfitsio-perl/branches/upstream/current/Makefile.PL
===================================================================
--- packages/libastro-fits-cfitsio-perl/branches/upstream/current/Makefile.PL 2005-04-13 01:20:42 UTC (rev 929)
+++ packages/libastro-fits-cfitsio-perl/branches/upstream/current/Makefile.PL 2005-04-13 16:08:45 UTC (rev 930)
@@ -3,8 +3,8 @@
my ($inc, $libs);
if (exists $ENV{CFITSIO}) {
- $inc = "-I$ENV{CFITSIO}";
- $libs = "-L$ENV{CFITSIO} -lcfitsio -lm";
+ $inc = "-I$ENV{CFITSIO} -I$ENV{CFITSIO}/include";
+ $libs = "-L$ENV{CFITSIO} -L$ENV{CFITSIO}/lib -lcfitsio -lm";
}
else {
warn("CFITSIO environment variable not found, assuming /usr/local/cfitsio\n");
Modified: packages/libastro-fits-cfitsio-perl/branches/upstream/current/README
===================================================================
--- packages/libastro-fits-cfitsio-perl/branches/upstream/current/README 2005-04-13 01:20:42 UTC (rev 929)
+++ packages/libastro-fits-cfitsio-perl/branches/upstream/current/README 2005-04-13 16:08:45 UTC (rev 930)
@@ -13,13 +13,13 @@
What version of cfitsio does this module require?
----------------------------------------------
- Astro::FITS::CFITSIO version 1.02 requires at least cfitsio v2.490.
+ Astro::FITS::CFITSIO version 1.03 requires at least cfitsio v2.500.
Installation
------------
For installation instructions, see the 'INSTALL' file in the base
- distribution directory. Essentially, it just tells you to tidy up
- the INC and LIBS keys in Makefile.PL and then do
+ distribution directory. Essentially, it just tells you to set the
+ CFITSIO environment variable, and then do
$ perl Makefile.PL OPTIMIZE=-O
$ make
@@ -28,6 +28,6 @@
Acknowledgement
---------------
- m51.fits is included as a demonstration by kind permission of the IRAF
- group at the National Optical and Astronomical Observatories, in particular
- Pat Seitzer, who retain ownership.
+ m51.fits is included as a demonstration by kind permission of the
+ IRAF group at the National Optical and Astronomical Observatories,
+ in particular Pat Seitzer, who retain ownership.
Modified: packages/libastro-fits-cfitsio-perl/branches/upstream/current/announce
===================================================================
--- packages/libastro-fits-cfitsio-perl/branches/upstream/current/announce 2005-04-13 01:20:42 UTC (rev 929)
+++ packages/libastro-fits-cfitsio-perl/branches/upstream/current/announce 2005-04-13 16:08:45 UTC (rev 930)
@@ -4,7 +4,7 @@
subroutine library is available. For more information on the cfitsio
subroutine library, see http://heasarc.gsfc.nasa.gov/fitsio
-New features in Astro::FITS::CFITSIO 1.01 include:
+New features in Astro::FITS::CFITSIO 1.03 include:
* Added new cfitsio 2.420 and 2.410 routines:
fits_flush_buffer
Modified: packages/libastro-fits-cfitsio-perl/branches/upstream/current/test.pl
===================================================================
--- packages/libastro-fits-cfitsio-perl/branches/upstream/current/test.pl 2005-04-13 01:20:42 UTC (rev 929)
+++ packages/libastro-fits-cfitsio-perl/branches/upstream/current/test.pl 2005-04-13 16:08:45 UTC (rev 930)
@@ -92,6 +92,7 @@
$status = 0;
my $fptr;
ffopen($fptr,'tq123x.kjl',READWRITE,$status);
+print "\nSTATUS = $status\n";
post_test(104 == $status);
# fits_create_file
Property changes on: packages/libastro-fits-cfitsio-perl/branches/upstream/current/testprog/runtests
___________________________________________________________________
Name: svn:executable
-
+ *
Modified: packages/libastro-fits-cfitsio-perl/branches/upstream/current/typemap
===================================================================
--- packages/libastro-fits-cfitsio-perl/branches/upstream/current/typemap 2005-04-13 01:20:42 UTC (rev 929)
+++ packages/libastro-fits-cfitsio-perl/branches/upstream/current/typemap 2005-04-13 16:08:45 UTC (rev 930)
@@ -96,4 +96,5 @@
sv_setpv((SV *)$arg, $var);
T_PTROBJ_FitsFile
- sv_setref_pv($arg, \"fitsfilePtr\", (void*)$var);
+ if ($var != NULL)
+ sv_setref_pv($arg, \"fitsfilePtr\", (void*)$var);