Instrument Neutral Distributed Interface INDI 2.2.5
Macros
indimacros.h File Reference
#include <math.h>
#include <unistd.h>

Go to the source code of this file.

Macros

#define J2000   2451545.0
 
#define ERRMSG_SIZE   1024
 
#define STELLAR_DAY   86164.098903691
 
#define TRACKRATE_SIDEREAL   ((360.0 * 3600.0) / STELLAR_DAY)
 
#define SOLAR_DAY   86400
 
#define TRACKRATE_SOLAR   ((360.0 * 3600.0) / SOLAR_DAY)
 
#define TRACKRATE_LUNAR   14.511415
 
#define EARTHRADIUSEQUATORIAL   6378137.0
 
#define EARTHRADIUSPOLAR   6356752.0
 
#define EARTHRADIUSMEAN   6372797.0
 
#define SUNMASS   1.98847E+30
 
#define PLANK_H   6.62607015E-34
 
#define DIRAC_H   (PLANK_H / (2 * M_PI))
 
#define EINSTEIN_G   6.67408E-11
 
#define EULER   2.71828182845904523536028747135266249775724709369995
 
#define ROOT2   1.41421356237309504880168872420969807856967187537694
 
#define AIRY   1.21966
 
#define ASTRONOMICALUNIT   1.495978707E+11
 
#define LIGHTSPEED   299792458.0
 
#define CIRCLE_DEG   360
 
#define CIRCLE_AM   (CIRCLE_DEG * 60)
 
#define CIRCLE_AS   (CIRCLE_AM * 60)
 
#define RAD_AS   (CIRCLE_AS / (M_PI * 2))
 
#define HOURS_TO_DEG(h)   ((h) * 15.0)
 
#define DEG_TO_HOURS(d)   ((d) / 15.0)
 
#define ARCMIN_TO_DEG(am)   ((am) / 60.0)
 
#define DEG_TO_ARCMIN(d)   ((d) * 60.0)
 
#define ARCSEC_TO_DEG(as)   ((as) / 3600.0)
 
#define DEG_TO_ARCSEC(d)   ((d) * 3600.0)
 
#define HOURS_TO_RAD(h)   ((h) * M_PI / 12.0)
 
#define RAD_TO_HOURS(r)   ((r) * 12.0 / M_PI)
 
#define DEG_TO_RAD(d)   ((d) * M_PI / 180.0)
 
#define RAD_TO_DEG(r)   ((r) * 180.0 / M_PI)
 
#define PARSEC   (ASTRONOMICALUNIT * RAD_AS)
 
#define JULIAN_LY   (LIGHTSPEED * SOLAR_DAY * 365)
 
#define STELLAR_LY   (LIGHTSPEED * STELLAR_DAY * 365)
 
#define FLUX(wavelength)   ((wavelength) / (PLANK_H * LIGHTSPEED))
 
#define CANDLE   ((1.0 / 683.0) * FLUX(555))
 
#define LUMEN(wavelength)   (CANDLE / (4 * M_PI) * pow((FLUX(wavelength) / FLUX(555)), 0.25))
 
#define REDSHIFT(wavelength, reference)   (1.0 - ((reference) / (wavelength)))
 
#define DOPPLER(shift, speed)   ((speed) * (shift))
 
#define INDI_UNUSED(x)   (void)x
 Unused variable.
 
#define INDI_HAS_CPP_ATTRIBUTE(x)   0
 The POSIX C type "ssize_t" is available on Unix-like systems in unistd.h. For Windows Visual Studio based compilers without unistd.h, the following stanza allows use of ssize_t.
 
#define INDI_HAS_ATTRIBUTE(x)   0
 Expressions to test whether the attribute is recognized by the C compiler.
 
#define INDI_FALLTHROUGH   do {} while (0)
 Allows attributes to be set on null statements.
 
#define ATTRIBUTE_FORMAT_PRINTF(A, B)
 Opaque pointer.
 
#define INDI_DEPRECATED(message)   __attribute__ ((deprecated))
 

Macro Definition Documentation

◆ AIRY

#define AIRY   1.21966

Definition at line 78 of file indimacros.h.

◆ ARCMIN_TO_DEG

#define ARCMIN_TO_DEG (   am)    ((am) / 60.0)

Definition at line 110 of file indimacros.h.

◆ ARCSEC_TO_DEG

#define ARCSEC_TO_DEG (   as)    ((as) / 3600.0)

Definition at line 116 of file indimacros.h.

◆ ASTRONOMICALUNIT

#define ASTRONOMICALUNIT   1.495978707E+11

Definition at line 81 of file indimacros.h.

◆ ATTRIBUTE_FORMAT_PRINTF

#define ATTRIBUTE_FORMAT_PRINTF (   A,
  B 
)

Opaque pointer.

The D_PTR macro is part of a design pattern called the d-pointer (also called the opaque pointer) where the implementation details of a library may be hidden from its users and changes to the implementation can be made to a library without breaking binary compatibility.

Definition at line 300 of file indimacros.h.

◆ CANDLE

#define CANDLE   ((1.0 / 683.0) * FLUX(555))

Definition at line 154 of file indimacros.h.

◆ CIRCLE_AM

#define CIRCLE_AM   (CIRCLE_DEG * 60)

Definition at line 94 of file indimacros.h.

◆ CIRCLE_AS

#define CIRCLE_AS   (CIRCLE_AM * 60)

Definition at line 97 of file indimacros.h.

◆ CIRCLE_DEG

#define CIRCLE_DEG   360

Definition at line 91 of file indimacros.h.

◆ DEG_TO_ARCMIN

#define DEG_TO_ARCMIN (   d)    ((d) * 60.0)

Definition at line 113 of file indimacros.h.

◆ DEG_TO_ARCSEC

#define DEG_TO_ARCSEC (   d)    ((d) * 3600.0)

Definition at line 119 of file indimacros.h.

◆ DEG_TO_HOURS

#define DEG_TO_HOURS (   d)    ((d) / 15.0)

Definition at line 107 of file indimacros.h.

◆ DEG_TO_RAD

#define DEG_TO_RAD (   d)    ((d) * M_PI / 180.0)

Definition at line 128 of file indimacros.h.

◆ DIRAC_H

#define DIRAC_H   (PLANK_H / (2 * M_PI))

Definition at line 66 of file indimacros.h.

◆ DOPPLER

#define DOPPLER (   shift,
  speed 
)    ((speed) * (shift))

Definition at line 163 of file indimacros.h.

◆ EARTHRADIUSEQUATORIAL

#define EARTHRADIUSEQUATORIAL   6378137.0

Definition at line 51 of file indimacros.h.

◆ EARTHRADIUSMEAN

#define EARTHRADIUSMEAN   6372797.0

Definition at line 57 of file indimacros.h.

◆ EARTHRADIUSPOLAR

#define EARTHRADIUSPOLAR   6356752.0

Definition at line 54 of file indimacros.h.

◆ EINSTEIN_G

#define EINSTEIN_G   6.67408E-11

Definition at line 69 of file indimacros.h.

◆ ERRMSG_SIZE

#define ERRMSG_SIZE   1024

Definition at line 33 of file indimacros.h.

◆ EULER

#define EULER   2.71828182845904523536028747135266249775724709369995

Definition at line 72 of file indimacros.h.

◆ FLUX

#define FLUX (   wavelength)    ((wavelength) / (PLANK_H * LIGHTSPEED))

Definition at line 151 of file indimacros.h.

◆ HOURS_TO_DEG

#define HOURS_TO_DEG (   h)    ((h) * 15.0)

Definition at line 104 of file indimacros.h.

◆ HOURS_TO_RAD

#define HOURS_TO_RAD (   h)    ((h) * M_PI / 12.0)

Definition at line 122 of file indimacros.h.

◆ INDI_DEPRECATED

#define INDI_DEPRECATED (   message)    __attribute__ ((deprecated))

Definition at line 309 of file indimacros.h.

◆ INDI_FALLTHROUGH

#define INDI_FALLTHROUGH   do {} while (0)

Allows attributes to be set on null statements.

The fallthrough attribute with a null statement serves as a fallthrough statement. It hints to the compiler that a statement that falls through to another case label, or user-defined label in a switch statement is intentional and thus the -Wimplicit-fallthrough warning must not trigger. The fallthrough attribute may appear at most once in each attribute list, and may not be mixed with other attributes. It can only be used in a switch statement (the compiler will issue an error otherwise), after a preceding statement and before a logically succeeding case label, or user-defined label.

switch (cond) { case 1: bar (1); INDI_FALLTHROUGH; case 2: ... }

Definition at line 247 of file indimacros.h.

◆ INDI_HAS_ATTRIBUTE

#define INDI_HAS_ATTRIBUTE (   x)    0

Expressions to test whether the attribute is recognized by the C compiler.

Definition at line 209 of file indimacros.h.

◆ INDI_HAS_CPP_ATTRIBUTE

#define INDI_HAS_CPP_ATTRIBUTE (   x)    0

The POSIX C type "ssize_t" is available on Unix-like systems in unistd.h. For Windows Visual Studio based compilers without unistd.h, the following stanza allows use of ssize_t.

Expressions to test whether the attribute is recognized by the C++ compiler

Definition at line 198 of file indimacros.h.

◆ INDI_UNUSED

#define INDI_UNUSED (   x)    (void)x

Unused variable.

Indicates to the compiler that the parameter with the specified name is not used in the body of a function. This can be used to suppress compiler warnings while allowing functions to be defined with meaningful parameter names in their signatures.

Definition at line 175 of file indimacros.h.

◆ J2000

#define J2000   2451545.0

Definition at line 30 of file indimacros.h.

◆ JULIAN_LY

#define JULIAN_LY   (LIGHTSPEED * SOLAR_DAY * 365)

Definition at line 141 of file indimacros.h.

◆ LIGHTSPEED

#define LIGHTSPEED   299792458.0

Definition at line 84 of file indimacros.h.

◆ LUMEN

#define LUMEN (   wavelength)    (CANDLE / (4 * M_PI) * pow((FLUX(wavelength) / FLUX(555)), 0.25))

Definition at line 157 of file indimacros.h.

◆ PARSEC

#define PARSEC   (ASTRONOMICALUNIT * RAD_AS)

Definition at line 138 of file indimacros.h.

◆ PLANK_H

#define PLANK_H   6.62607015E-34

Definition at line 63 of file indimacros.h.

◆ RAD_AS

#define RAD_AS   (CIRCLE_AS / (M_PI * 2))

Definition at line 100 of file indimacros.h.

◆ RAD_TO_DEG

#define RAD_TO_DEG (   r)    ((r) * 180.0 / M_PI)

Definition at line 131 of file indimacros.h.

◆ RAD_TO_HOURS

#define RAD_TO_HOURS (   r)    ((r) * 12.0 / M_PI)

Definition at line 125 of file indimacros.h.

◆ REDSHIFT

#define REDSHIFT (   wavelength,
  reference 
)    (1.0 - ((reference) / (wavelength)))

Definition at line 160 of file indimacros.h.

◆ ROOT2

#define ROOT2   1.41421356237309504880168872420969807856967187537694

Definition at line 75 of file indimacros.h.

◆ SOLAR_DAY

#define SOLAR_DAY   86400

Definition at line 42 of file indimacros.h.

◆ STELLAR_DAY

#define STELLAR_DAY   86164.098903691

Definition at line 36 of file indimacros.h.

◆ STELLAR_LY

#define STELLAR_LY   (LIGHTSPEED * STELLAR_DAY * 365)

Definition at line 144 of file indimacros.h.

◆ SUNMASS

#define SUNMASS   1.98847E+30

Definition at line 60 of file indimacros.h.

◆ TRACKRATE_LUNAR

#define TRACKRATE_LUNAR   14.511415

Definition at line 48 of file indimacros.h.

◆ TRACKRATE_SIDEREAL

#define TRACKRATE_SIDEREAL   ((360.0 * 3600.0) / STELLAR_DAY)

Definition at line 39 of file indimacros.h.

◆ TRACKRATE_SOLAR

#define TRACKRATE_SOLAR   ((360.0 * 3600.0) / SOLAR_DAY)

Definition at line 45 of file indimacros.h.