aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libred.h5
-rw-r--r--libred.h.02
-rw-r--r--libred_solar_elevation.32
-rw-r--r--solar.c19
4 files changed, 23 insertions, 5 deletions
diff --git a/libred.h b/libred.h
index 21920ff..9d59d39 100644
--- a/libred.h
+++ b/libred.h
@@ -3,6 +3,9 @@
#define LIBRED_H
+/* bug fix: */
+#define libred_solar_elevation libred_solar_elevation__int
+
/**
* Approximate apparent size of the Sun in degrees
@@ -143,7 +146,7 @@
* @return 0 on success, -1 on failure
* @throws Any error specified for clock_gettime(3) on error
*/
-double libred_solar_elevation(double, double, double *);
+int libred_solar_elevation(double, double, double *);
/**
diff --git a/libred.h.0 b/libred.h.0
index c4f8a93..606e234 100644
--- a/libred.h.0
+++ b/libred.h.0
@@ -126,7 +126,7 @@ This header defines the following functions:
.BR libred_get_temperature (3)
.TP
*
-.BR libred_get_temperature (3)
+.BR libred_get_temperature_xy (3)
.TP
*
.BR libred_solar_elevation (3)
diff --git a/libred_solar_elevation.3 b/libred_solar_elevation.3
index f72f8e5..fa2df7e 100644
--- a/libred_solar_elevation.3
+++ b/libred_solar_elevation.3
@@ -5,7 +5,7 @@ libred_solar_elevation \- Calculate the Sun's apparent elevation
.nf
#include <libred.h>
-int \fBlibred_solar_elevation\fP(double \fIlatitude\fP, double \fIlongitude\fP, double *\felevation\fP);
+int \fBlibred_solar_elevation\fP(double \fIlatitude\fP, double \fIlongitude\fP, double *\fIelevation\fP);
.fi
.PP
Link with
diff --git a/solar.c b/solar.c
index 1b316bb..97c6dd7 100644
--- a/solar.c
+++ b/solar.c
@@ -1,5 +1,6 @@
/* See LICENSE file for copyright and license details. */
#include "libred.h"
+#undef libred_solar_elevation
#include <math.h>
#include <time.h>
#include <errno.h>
@@ -21,6 +22,10 @@
#endif
+/* old erroneous function declarations: */
+double libred_solar_elevation(double latitude, double longitude, double *elevation);
+
+
/**
* Get current Julian Centuries time (100 Julian Days since J2000)
* and Julian Day time
@@ -297,8 +302,8 @@ solar_elevation_from_time(double tc, double td, double latitude, double longitud
* @return 0 on success, -1 on failure
* @throws Any error specified for clock_gettime(3) on error
*/
-double
-libred_solar_elevation(double latitude, double longitude, double *elevation)
+int
+libred_solar_elevation__int(double latitude, double longitude, double *elevation)
{
double tc, td;
if (julian_time(&tc, &td))
@@ -308,6 +313,16 @@ libred_solar_elevation(double latitude, double longitude, double *elevation)
}
/**
+ * Kept for binary compatibility
+ */
+double
+libred_solar_elevation(double latitude, double longitude, double *elevation)
+{
+ int r = libred_solar_elevation__int(latitude, longitude, elevation);
+ return (double)r;
+}
+
+/**
* This function is obsolete
*/
int