Hello community, here is the log from the commit of package erfa for openSUSE:Factory checked in at 2020-01-01 14:59:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/erfa (Old) and /work/SRC/openSUSE:Factory/.erfa.new.6675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "erfa" Wed Jan 1 14:59:54 2020 rev:7 rq:760238 version:1.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/erfa/erfa.changes 2019-11-07 23:16:29.504532492 +0100 +++ /work/SRC/openSUSE:Factory/.erfa.new.6675/erfa.changes 2020-01-01 14:59:59.697984278 +0100 @@ -1,0 +2,7 @@ +Tue Dec 31 18:27:32 UTC 2019 - Sebastian Wagner <[email protected]> + +- Update to version 1.7.0: + * Based on "20190722" except for the added `eraVersion`, + `eraSofaVersion`, and leap second functions. + +------------------------------------------------------------------- Old: ---- erfa-1.6.0.tar.gz New: ---- erfa-1.7.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ erfa.spec ++++++ --- /var/tmp/diff_new_pack.Wg432k/_old 2020-01-01 15:00:00.301984594 +0100 +++ /var/tmp/diff_new_pack.Wg432k/_new 2020-01-01 15:00:00.305984596 +0100 @@ -1,7 +1,7 @@ # # spec file for package erfa # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %define lname liberfa1 Name: erfa -Version: 1.6.0 +Version: 1.7.0 Release: 0 Summary: Essential Routines for Fundamental Astronomy License: BSD-3-Clause ++++++ erfa-1.6.0.tar.gz -> erfa-1.7.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erfa-1.6.0/README.rst new/erfa-1.7.0/README.rst --- old/erfa-1.6.0/README.rst 2019-10-04 22:14:53.000000000 +0200 +++ new/erfa-1.7.0/README.rst 2019-12-05 23:45:20.000000000 +0100 @@ -28,12 +28,36 @@ All C macros used in ERFA are the same as their SOFA equivalents, but with an ``ERFA_`` prefix to prevent namespace collisions. +Version information +^^^^^^^^^^^^^^^^^^^ + +ERFA provides a few utility functions for accessing version information at +runtime which are not a part of SOFA. Specifically, these are the +``eraVersion`,` ``eraVersion*``, and ``eraSofaVersion`` functions that are +exposed in the ``erfaextra.h`` header. + +Runtime leap second modification +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +ERFA provides the capability to modify at runtime the leap seconds assumed for +various calculations. These are accessed via the ``eraGetLeapSeconds`` and +``eraSetLeapSeconds`` functions that are exposed in the ``erfaextra.h`` header. +This functionality is currently considered somewhat experimental, meaning an +improved API might be available in the future, but the current API can also be +counted on for the near future. + Bugfixes ^^^^^^^^ ERFA includes smaller changes that may or may not eventually make it into SOFA, addressing localized bugs or similar smaller issues: +* ERFA 1.7.0 and SOFA "20190722" + + + There are no differences between ERFA 1.7.0 and SOFA "20190722" except + for the added ``eraVersion``, ``eraSofaVersion``, and leap second functions + noted above. + * ERFA 1.6.0 and SOFA "20190722" + There are no differences between ERFA 1.6.0 and SOFA "20190722" except diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erfa-1.6.0/configure new/erfa-1.7.0/configure --- old/erfa-1.6.0/configure 2019-10-04 22:32:54.000000000 +0200 +++ new/erfa-1.7.0/configure 2019-12-05 23:45:58.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for erfa 1.6.0. +# Generated by GNU Autoconf 2.69 for erfa 1.7.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='erfa' PACKAGE_TARNAME='erfa' -PACKAGE_VERSION='1.6.0' -PACKAGE_STRING='erfa 1.6.0' +PACKAGE_VERSION='1.7.0' +PACKAGE_STRING='erfa 1.7.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1315,7 +1315,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures erfa 1.6.0 to adapt to many kinds of systems. +\`configure' configures erfa 1.7.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1385,7 +1385,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of erfa 1.6.0:";; + short | recursive ) echo "Configuration of erfa 1.7.0:";; esac cat <<\_ACEOF @@ -1495,7 +1495,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -erfa configure 1.6.0 +erfa configure 1.7.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1773,7 +1773,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by erfa $as_me 1.6.0, which was +It was created by erfa $as_me 1.7.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2640,7 +2640,7 @@ # Define the identity of the package. PACKAGE='erfa' - VERSION='1.6.0' + VERSION='1.7.0' cat >>confdefs.h <<_ACEOF @@ -11886,9 +11886,9 @@ -VI_CURR='7' +VI_CURR='8' VI_REL='0' -VI_AGE='6' +VI_AGE='7' vi_all=`echo $VI_CURR:$VI_REL:$VI_AGE` VI_ALL=$vi_all @@ -12491,7 +12491,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by erfa $as_me 1.6.0, which was +This file was extended by erfa $as_me 1.7.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12557,7 +12557,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -erfa config.status 1.6.0 +erfa config.status 1.7.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erfa-1.6.0/configure.ac new/erfa-1.7.0/configure.ac --- old/erfa-1.6.0/configure.ac 2019-10-04 22:15:03.000000000 +0200 +++ new/erfa-1.7.0/configure.ac 2019-12-05 23:45:21.000000000 +0100 @@ -2,7 +2,7 @@ AC_PREREQ([2.68]) ## Follow the instructions in RELEASE.rst to change package version -AC_INIT([erfa],[1.6.0]) +AC_INIT([erfa],[1.7.0]) AC_CONFIG_SRCDIR([src/erfa.h]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_MACRO_DIR([m4]) @@ -17,7 +17,7 @@ ## A library supports interfaces from current downto current - age ## Revision is the version of the current interface ## Follow the instructions in RELEASE.rst to change the version info -ERFA_LIB_VERSION_INFO(7, 0, 6) +ERFA_LIB_VERSION_INFO(8, 0, 7) ## SOFA version, update if needed in new relases AC_DEFINE([SOFA_VERSION], ["20190722"], [Define to the version of SOFA]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erfa-1.6.0/src/Makefile.am new/erfa-1.7.0/src/Makefile.am --- old/erfa-1.6.0/src/Makefile.am 2019-10-04 22:14:53.000000000 +0200 +++ new/erfa-1.7.0/src/Makefile.am 2019-12-05 23:24:48.000000000 +0100 @@ -30,9 +30,9 @@ tpstv.c tpxes.c tpxev.c tr.c trxp.c trxpv.c tttai.c \ tttcg.c tttdb.c ttut1.c ut1tai.c ut1tt.c ut1utc.c utctai.c utcut1.c \ xy06.c xys00a.c xys00b.c xys06a.c zp.c zpv.c zr.c \ -erfaversion.c +erfaversion.c erfadatextra.c -include_HEADERS = erfa.h erfam.h erfaextra.h +include_HEADERS = erfa.h erfam.h erfaextra.h erfadatextra.h ## Version info is in current : revision : age form ## A library supports interfaces from current downto current - age @@ -44,8 +44,9 @@ ## Check program -TESTS = t_erfa_c -check_PROGRAMS = t_erfa_c +TESTS = t_erfa_c t_erfa_c_extra +check_PROGRAMS = t_erfa_c t_erfa_c_extra t_erfa_c_SOURCES = t_erfa_c.c +t_erfa_c_extra_SOURCES = t_erfa_c_extra.c AM_CPPFLAGS = -I$(top_srcdir) LDADD = $(top_builddir)/src/liberfa.la diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erfa-1.6.0/src/Makefile.in new/erfa-1.7.0/src/Makefile.in --- old/erfa-1.6.0/src/Makefile.in 2019-10-04 22:32:55.000000000 +0200 +++ new/erfa-1.7.0/src/Makefile.in 2019-12-05 23:45:59.000000000 +0100 @@ -89,8 +89,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -TESTS = t_erfa_c$(EXEEXT) -check_PROGRAMS = t_erfa_c$(EXEEXT) +TESTS = t_erfa_c$(EXEEXT) t_erfa_c_extra$(EXEEXT) +check_PROGRAMS = t_erfa_c$(EXEEXT) t_erfa_c_extra$(EXEEXT) subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/erfa-numver.m4 \ @@ -172,7 +172,7 @@ tr.lo trxp.lo trxpv.lo tttai.lo tttcg.lo tttdb.lo ttut1.lo \ ut1tai.lo ut1tt.lo ut1utc.lo utctai.lo utcut1.lo xy06.lo \ xys00a.lo xys00b.lo xys06a.lo zp.lo zpv.lo zr.lo \ - erfaversion.lo + erfaversion.lo erfadatextra.lo liberfa_la_OBJECTS = $(am_liberfa_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -185,6 +185,10 @@ t_erfa_c_OBJECTS = $(am_t_erfa_c_OBJECTS) t_erfa_c_LDADD = $(LDADD) t_erfa_c_DEPENDENCIES = $(top_builddir)/src/liberfa.la +am_t_erfa_c_extra_OBJECTS = t_erfa_c_extra.$(OBJEXT) +t_erfa_c_extra_OBJECTS = $(am_t_erfa_c_extra_OBJECTS) +t_erfa_c_extra_LDADD = $(LDADD) +t_erfa_c_extra_DEPENDENCIES = $(top_builddir)/src/liberfa.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -219,8 +223,10 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(liberfa_la_SOURCES) $(t_erfa_c_SOURCES) -DIST_SOURCES = $(liberfa_la_SOURCES) $(t_erfa_c_SOURCES) +SOURCES = $(liberfa_la_SOURCES) $(t_erfa_c_SOURCES) \ + $(t_erfa_c_extra_SOURCES) +DIST_SOURCES = $(liberfa_la_SOURCES) $(t_erfa_c_SOURCES) \ + $(t_erfa_c_extra_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -579,11 +585,12 @@ tpstv.c tpxes.c tpxev.c tr.c trxp.c trxpv.c tttai.c \ tttcg.c tttdb.c ttut1.c ut1tai.c ut1tt.c ut1utc.c utctai.c utcut1.c \ xy06.c xys00a.c xys00b.c xys06a.c zp.c zpv.c zr.c \ -erfaversion.c +erfaversion.c erfadatextra.c -include_HEADERS = erfa.h erfam.h erfaextra.h +include_HEADERS = erfa.h erfam.h erfaextra.h erfadatextra.h liberfa_la_LDFLAGS = -version-info $(VI_ALL) t_erfa_c_SOURCES = t_erfa_c.c +t_erfa_c_extra_SOURCES = t_erfa_c_extra.c AM_CPPFLAGS = -I$(top_srcdir) LDADD = $(top_builddir)/src/liberfa.la all: all-am @@ -671,6 +678,10 @@ @rm -f t_erfa_c$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t_erfa_c_OBJECTS) $(t_erfa_c_LDADD) $(LIBS) +t_erfa_c_extra$(EXEEXT): $(t_erfa_c_extra_OBJECTS) $(t_erfa_c_extra_DEPENDENCIES) $(EXTRA_t_erfa_c_extra_DEPENDENCIES) + @rm -f t_erfa_c_extra$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(t_erfa_c_extra_OBJECTS) $(t_erfa_c_extra_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -754,6 +765,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eqec06.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eqeq94.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/era00.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erfadatextra.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erfaversion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fad03.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fae03.Plo@am__quote@ @@ -889,6 +901,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sxp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sxpv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_erfa_c.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_erfa_c_extra.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taitt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taiut1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/taiutc.Plo@am__quote@ @@ -1171,6 +1184,13 @@ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +t_erfa_c_extra.log: t_erfa_c_extra$(EXEEXT) + @p='t_erfa_c_extra$(EXEEXT)'; \ + b='t_erfa_c_extra'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erfa-1.6.0/src/dat.c new/erfa-1.7.0/src/dat.c --- old/erfa-1.6.0/src/dat.c 2019-10-04 22:14:53.000000000 +0200 +++ new/erfa-1.7.0/src/dat.c 2019-12-05 23:24:48.000000000 +0100 @@ -1,4 +1,5 @@ #include "erfa.h" +#include "erfadatextra.h" int eraDat(int iy, int im, int id, double fd, double *deltat) /* @@ -144,10 +145,7 @@ enum { NERA1 = (int) (sizeof drift / sizeof (double) / 2) }; /* Dates and Delta(AT)s */ - static const struct { - int iyear, month; - double delat; - } changes[] = { + static const eraLEAPSECOND _changes[] = { { 1960, 1, 1.4178180 }, { 1961, 1, 1.4228180 }, { 1961, 8, 1.3728180 }, @@ -193,7 +191,13 @@ }; /* Number of Delta(AT) changes */ - enum { NDAT = (int) (sizeof changes / sizeof changes[0]) }; + enum { _NDAT = (int) (sizeof _changes / sizeof _changes[0]) }; + +/* Get/initialise leap-second if needed */ + int NDAT; + eraLEAPSECOND *changes; + + NDAT = eraDatini(_changes, _NDAT, &changes); /* Miscellaneous local variables */ int j, i, m; @@ -243,15 +247,15 @@ } /*---------------------------------------------------------------------- -** -** +** +** ** Copyright (C) 2013-2019, NumFOCUS Foundation. ** All rights reserved. -** +** ** This library is derived, with permission, from the International ** Astronomical Union's "Standards of Fundamental Astronomy" library, ** available from http://www.iausofa.org. -** +** ** The ERFA version is intended to retain identical functionality to ** the SOFA library, but made distinct through different function and ** file names, as set out in the SOFA license conditions. The SOFA @@ -260,36 +264,36 @@ ** state. The ERFA version is not subject to this restriction and ** therefore can be included in distributions which do not support the ** concept of "read only" software. -** +** ** Although the intent is to replicate the SOFA API (other than ** replacement of prefix names) and results (with the exception of ** bugs; any that are discovered will be fixed), SOFA is not ** responsible for any errors found in this version of the library. -** +** ** If you wish to acknowledge the SOFA heritage, please acknowledge ** that you are using a library derived from SOFA, rather than SOFA ** itself. -** -** +** +** ** TERMS AND CONDITIONS -** +** ** Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions ** are met: -** +** ** 1 Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. -** +** ** 2 Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. -** +** ** 3 Neither the name of the Standards Of Fundamental Astronomy Board, ** the International Astronomical Union nor the names of its ** contributors may be used to endorse or promote products derived ** from this software without specific prior written permission. -** +** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -302,5 +306,5 @@ ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ** POSSIBILITY OF SUCH DAMAGE. -** +** */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erfa-1.6.0/src/erfadatextra.c new/erfa-1.7.0/src/erfadatextra.c --- old/erfa-1.6.0/src/erfadatextra.c 1970-01-01 01:00:00.000000000 +0100 +++ new/erfa-1.7.0/src/erfadatextra.c 2019-12-05 23:24:48.000000000 +0100 @@ -0,0 +1,93 @@ +/* +** Copyright (C) 2019, NumFOCUS Foundation. +** +** Licensed under a 3-clause BSD style license - see LICENSE +** +** This file is NOT derived from SOFA sources. +** +** The eraGetLeapSeconds and eraSetLeapSeconds functions are used as an +** experimental interface for getting and setting the leap second table in +** astropy 4.0. They will be supported as long as astropy 4.0 is supported +** (until 2021), but not necessarily beyond. Comments and ideas about the +** best way to keep the leap second tables up to date for all users of erfa +** are welcome (https://github.com/liberfa/erfa). +** +** The eraDatini function is used internally in dat.c; it is strictly an +** implementation detail and should not be used elsewhere. +*/ +#include "erfa.h" +#include "erfaextra.h" + +static eraLEAPSECOND *changes; +static int NDAT = -1; + + +int eraGetLeapSeconds(eraLEAPSECOND **leapseconds) +/* +** Get the current leap second table. +** +** Returned: +** leapseconds eraLEAPSECOND* Array of year, month, TAI minus UTC +** +** Returned (function value): +** int NDAT Number of entries/status +** >0 = number of entries +** -1 = internal error +*/ +{ + if (NDAT <= 0) { + double delat; + int stat = eraDat(2000, 1, 1, 0., &delat); + if (stat != 0 || NDAT <= 0) { + return -1; + } + } + *leapseconds = changes; + return NDAT; +} + +void eraSetLeapSeconds(eraLEAPSECOND *leapseconds, int count) +/* +** Set the current leap second table. +** +** Given: +** leapseconds eraLEAPSECOND* Array of year, month, TAI minus UTC +** count int Number of entries. If <= 0, causes +** a reset of the table to the built-in +** version. +** +** Notes: +** *No* sanity checks are performed. +*/ +{ + changes = leapseconds; + NDAT = count; +} + +int eraDatini(const eraLEAPSECOND *builtin, int n_builtin, + eraLEAPSECOND **leapseconds) +/* +** Get the leap second table, initializing it to the built-in version +** if necessary. +** +** This function is for internal use in dat.c only and should +** not be used elsewhere. +** +** Given: +** builtin eraLEAPSECOND Array of year, month, TAI minus UTC +** n_builtin int Number of entries of the table. +** +** Returned: +** leapseconds eraLEAPSECOND* Current array, set to the builtin one +** if not yet initialized. +** +** Returned (function value): +** int NDAT Number of entries +*/ +{ + if (NDAT <= 0) { + eraSetLeapSeconds((eraLEAPSECOND *)builtin, n_builtin); + } + *leapseconds = changes; + return NDAT; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erfa-1.6.0/src/erfadatextra.h new/erfa-1.7.0/src/erfadatextra.h --- old/erfa-1.6.0/src/erfadatextra.h 1970-01-01 01:00:00.000000000 +0100 +++ new/erfa-1.7.0/src/erfadatextra.h 2019-12-05 23:24:48.000000000 +0100 @@ -0,0 +1,18 @@ +/* +** Copyright (C) 2019, NumFOCUS Foundation. +** +** Licensed under a 3-clause BSD style license - see LICENSE +** +** This file is NOT derived from SOFA sources. +** +*/ + +/* +** Get the leap second table, initializing it to the built-in version +** if necessary. +** +** This function is for internal use in dat.c only and should +** not be used elsewhere. +*/ +int eraDatini(const eraLEAPSECOND *builtin, int n_builtin, + eraLEAPSECOND **leapseconds); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erfa-1.6.0/src/erfaextra.h new/erfa-1.7.0/src/erfaextra.h --- old/erfa-1.6.0/src/erfaextra.h 2019-07-24 20:50:34.000000000 +0200 +++ new/erfa-1.7.0/src/erfaextra.h 2019-12-05 23:24:48.000000000 +0100 @@ -1,9 +1,20 @@ /* -** Copyright (C) 2016-2017, NumFOCUS Foundation. +** Copyright (C) 2016-2019, NumFOCUS Foundation. ** ** Licensed under a 3-clause BSD style license - see LICENSE ** -** This file is NOT derived from SOFA sources +** This file is NOT derived from SOFA sources. +** +** The functions here provide an interface to ERFA and SOFA version +** information, and for updating the leap second table. +** +** The eraGetLeapSeconds and eraSetLeapSeconds functions are used as an +** experimental interface for getting and setting the leap second table in +** astropy 4.0. They will be supported as long as astropy 4.0 is supported +** (until 2021), but not necessarily beyond. Comments and ideas about the +** best way to keep the leap second tables up to date for all users of erfa +** are welcome (https://github.com/liberfa/erfa). +** */ @@ -15,45 +26,50 @@ #endif -/* +/* ** Returns the package version ** as defined in configure.ac ** in string format */ -const char* eraVersion(); +const char* eraVersion(void); -/* +/* ** Returns the package major version ** as defined in configure.ac ** as integer */ -int eraVersionMajor(); +int eraVersionMajor(void); -/* +/* ** Returns the package minor version ** as defined in configure.ac ** as integer */ -int eraVersionMinor(); +int eraVersionMinor(void); -/* +/* ** Returns the package micro version ** as defined in configure.ac ** as integer */ -int eraVersionMicro(); +int eraVersionMicro(void); -/* +/* ** Returns the orresponding SOFA version ** as defined in configure.ac ** in string format */ -const char* eraSofaVersion(); +const char* eraSofaVersion(void); + +/* +** Get and set leap seconds (not supported by SOFA; EXPERIMENTAL) +*/ +int eraGetLeapSeconds(eraLEAPSECOND **leapseconds); +void eraSetLeapSeconds(eraLEAPSECOND *leapseconds, int count); #ifdef __cplusplus } #endif #endif /* _ERFA_EXTRA_H */ - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erfa-1.6.0/src/erfam.h new/erfa-1.7.0/src/erfam.h --- old/erfa-1.6.0/src/erfam.h 2019-07-24 23:00:51.000000000 +0200 +++ new/erfa-1.7.0/src/erfam.h 2019-12-05 23:24:48.000000000 +0100 @@ -41,6 +41,12 @@ double pv[2][3]; /* barycentric PV of the body (au, au/day) */ } eraLDBODY; +/* Leap second definition */ +typedef struct { + int iyear, month; + double delat; +} eraLEAPSECOND; + /* Pi */ #define ERFA_DPI (3.141592653589793238462643) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erfa-1.6.0/src/erfaversion.c new/erfa-1.7.0/src/erfaversion.c --- old/erfa-1.6.0/src/erfaversion.c 2019-07-24 20:50:34.000000000 +0200 +++ new/erfa-1.7.0/src/erfaversion.c 2019-12-05 23:24:48.000000000 +0100 @@ -1,38 +1,51 @@ /* ** Copyright (C) 2016-2017, NumFOCUS Foundation. ** -** Licensed under a 3-clause BSD style license - see LICENSE +** Licensed under a 3-clause BSD style license - see LICENSE ** ** This file is NOT derived from SOFA sources */ +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.6.0" + +/* Define to the major version of this package. */ +#define PACKAGE_VERSION_MAJOR 1 + +/* Define to the micro version of this package. */ +#define PACKAGE_VERSION_MICRO 0 + +/* Define to the minor version of this package. */ +#define PACKAGE_VERSION_MINOR 6 + +/* Define to the version of SOFA */ +#define SOFA_VERSION "20190722" #ifdef HAVE_CONFIG_H #include <config.h> #endif /* HAVE_CONFIG_H */ -const char* eraVersion() { +const char* eraVersion(void) { return PACKAGE_VERSION; } -int eraVersionMajor() { +int eraVersionMajor(void) { return PACKAGE_VERSION_MAJOR; } -int eraVersionMinor() { +int eraVersionMinor(void) { return PACKAGE_VERSION_MINOR; } -int eraVersionMicro() { +int eraVersionMicro(void) { return PACKAGE_VERSION_MICRO; } -const char* eraSofaVersion() { +const char* eraSofaVersion(void) { return SOFA_VERSION; } - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erfa-1.6.0/src/t_erfa_c_extra.c new/erfa-1.7.0/src/t_erfa_c_extra.c --- old/erfa-1.6.0/src/t_erfa_c_extra.c 1970-01-01 01:00:00.000000000 +0100 +++ new/erfa-1.7.0/src/t_erfa_c_extra.c 2019-12-05 23:24:48.000000000 +0100 @@ -0,0 +1,180 @@ +/* +** Copyright (C) 2019, NumFOCUS Foundation. +** +** Licensed under a 3-clause BSD style license - see LICENSE +** +** This file is NOT derived from SOFA sources. +*/ + +#include <stdio.h> +#include <string.h> +#include <erfa.h> +#include <erfaextra.h> + +static int verbose = 0; + +/* +** +** Validate the ERFA C functions that are not derived from SOFA (SOFA-derived tests are in t_erfa_c) +** +*/ + +static void t_versions(int *status) +/* +** Test that the version-checking functions yield something. +*/ +{ + char buf[3]; + char* res; + const char* version_str = eraVersion(); + + sprintf(buf, "%d", eraVersionMajor()); + res = strstr(version_str, buf); + if (!res) { + *status = 1; + printf("t_versions failed - major version not in version string %s\n", version_str); + } + + sprintf(buf, "%d", eraVersionMinor()); + res = strstr(version_str, buf); + if (!res) { + *status = 1; + printf("t_versions failed - minor version not in version string %s\n", version_str); + } + + sprintf(buf, "%d", eraVersionMicro()); + res = strstr(version_str, buf); + if (!res) { + *status = 1; + printf("t_versions failed - micro version not in version string %s\n", version_str); + } + + if (*status == 0) { + printf("t_versions passed\n"); + } + +} + +static void t_leap_seconds(int *status) +/* +** Test that the leap-second machinery yields something +*/ +{ + int count_init, count_postset, count_postreset; + eraLEAPSECOND* leapseconds_init; + eraLEAPSECOND* leapseconds_postset; + eraLEAPSECOND* leapseconds_postreset; + + eraLEAPSECOND fake_leapsecond[1] = {{ 2050, 5, 55.0 }}; + + count_init = eraGetLeapSeconds(&leapseconds_init); + + eraSetLeapSeconds(fake_leapsecond, 1); + count_postset = eraGetLeapSeconds(&leapseconds_postset); + + if (count_postset == 1) { + printf("t_leap_seconds set passed\n"); + } else { + *status = 1; + printf("t_leap_seconds set failed - leap second table has %d entries instead of %d\n", count_postreset, 1); + } + + eraSetLeapSeconds(fake_leapsecond, -1); + count_postreset = eraGetLeapSeconds(&leapseconds_postreset); + + if (count_postreset == count_init) { + printf("t_leap_seconds reset passed\n"); + } else { + *status = 1; + printf("t_leap_seconds reset failed - leap second table has %d entries instead of %d\n", count_postreset, count_init); + } +} + +int main(int argc, char *argv[]) +{ + int status; + + +/* If any command-line argument, switch to verbose reporting. */ + if (argc > 1) { + verbose = 1; + argv[0][0] += 0; /* to avoid compiler warnings */ + } + +/* Preset the &status to FALSE = success. */ + status = 0; + +/* Test all of the extra functions. */ + t_versions(&status); + t_leap_seconds(&status); + +/* Report, set up an appropriate exit status, and finish. */ + if (status) { + printf("t_erfa_c_extra validation failed!\n"); + } else { + printf("t_erfa_c_extra validation successful\n"); + } + return status; +} +/*---------------------------------------------------------------------- +** +** +** Copyright (C) 2013-2019, NumFOCUS Foundation. +** All rights reserved. +** +** This library is derived, with permission, from the International +** Astronomical Union's "Standards of Fundamental Astronomy" library, +** available from http://www.iausofa.org. +** +** The ERFA version is intended to retain identical functionality to +** the SOFA library, but made distinct through different function and +** file names, as set out in the SOFA license conditions. The SOFA +** original has a role as a reference standard for the IAU and IERS, +** and consequently redistribution is permitted only in its unaltered +** state. The ERFA version is not subject to this restriction and +** therefore can be included in distributions which do not support the +** concept of "read only" software. +** +** Although the intent is to replicate the SOFA API (other than +** replacement of prefix names) and results (with the exception of +** bugs; any that are discovered will be fixed), SOFA is not +** responsible for any errors found in this version of the library. +** +** If you wish to acknowledge the SOFA heritage, please acknowledge +** that you are using a library derived from SOFA, rather than SOFA +** itself. +** +** +** TERMS AND CONDITIONS +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1 Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** +** 2 Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** +** 3 Neither the name of the Standards Of Fundamental Astronomy Board, +** the International Astronomical Union nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +** POSSIBILITY OF SUCH DAMAGE. +** +*/
