aboutsummaryrefslogtreecommitdiffstats
path: root/doc/info/chap/macros.texinfo
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2016-01-05 20:29:12 +0100
committerMattias Andrée <maandree@member.fsf.org>2016-01-05 20:29:12 +0100
commit5fc891fa4214cdeb7f01be274198711c716b29cd (patch)
treec0196d6029dc7a640347c8ef729c4e23edadab96 /doc/info/chap/macros.texinfo
parentm (diff)
downloadlibred-5fc891fa4214cdeb7f01be274198711c716b29cd.tar.gz
libred-5fc891fa4214cdeb7f01be274198711c716b29cd.tar.bz2
libred-5fc891fa4214cdeb7f01be274198711c716b29cd.tar.xz
m + texinfo manual
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--doc/info/chap/macros.texinfo49
1 files changed, 49 insertions, 0 deletions
diff --git a/doc/info/chap/macros.texinfo b/doc/info/chap/macros.texinfo
new file mode 100644
index 0000000..2d4a947
--- /dev/null
+++ b/doc/info/chap/macros.texinfo
@@ -0,0 +1,49 @@
+@node Macros
+@chapter Macros
+
+@file{<libred.h>} defines a small set of macros
+suitable for using a @code{#if} preprocessing directives.
+
+@table @code
+@item LIBRED_IS_TWILIGHT(const double)
+Evaluates to 1 if the given expression is between @math{-18.0}
+and 0.0 (this is, between
+@code{LIBRED_SOLAR_ELEVATION_ASTRONOMICAL_DUSK_DAWN} and
+@code{LIBRED_SOLAR_ELEVATION_SUNSET_SUNRISE}), inclusively,
+otherwise, this macro evaluates to 0. The input should be
+the Sun's apparent elevation, and the macro evaluates to 1
+if it is currently twilight. The given expression is evaluted
+either once or twice, therefore, it must not have side-effects.
+
+@item LIBRED_IS_CIVIL_TWILIGHT(const double)
+Evaluates to 1 if the given expression is between @math{-6.0}
+and 0.0 (this is, between
+@code{LIBRED_SOLAR_ELEVATION_CIVIL_DUSK_DAWN} and
+@code{LIBRED_SOLAR_ELEVATION_SUNSET_SUNRISE}), inclusively,
+otherwise, this macro evaluates to 0. The input should be
+the Sun's apparent elevation, and the macro evaluates to 1
+if it is currently civil twilight. The given expression is
+evaluted either once or twice, therefore, it must not have
+side-effects.
+
+@item LIBRED_IS_NAUTICAL_TWILIGHT(const double)
+Evaluates to 1 if the given expression is between @math{-12.0}
+and @math{-6.0} (this is, between
+@code{LIBRED_SOLAR_ELEVATION_NAUTICAL_DUSK_DAWN} and
+@code{LIBRED_SOLAR_ELEVATION_CIVIL_DUSK_DAWN}), inclusively,
+otherwise, this macro evaluates to 0. The input should be the
+Sun's apparent elevation, and the macro evaluates to 1 if it
+is currently nautical twilight. The given expression is evaluted
+either once or twice, therefore, it must not have side-effects.
+
+@item LIBRED_IS_ASTRONOMICAL_TWILIGHT(const double)
+Evaluates to 1 if the given expression is between @math{-18.0}
+and @math{-12.0} (this is, between
+@code{LIBRED_SOLAR_ELEVATION_ASTRONOMICAL_DUSK_DAWN} and
+@code{LIBRED_SOLAR_ELEVATION_NAUTICAL_DUSK_DAWN}), inclusively,
+otherwise, this macro evaluates to 0. The input should be the
+Sun's apparent elevation, and the macro evaluates to 1 if it is
+currently astronomical twilight. The given expression is evaluted
+either once or twice, therefore, it must not have side-effects.
+@end table
+