htrdr

Solving radiative transfer in heterogeneous media
git clone git://git.meso-star.fr/htrdr.git
Log | Files | Refs | README | LICENSE

commit 33d12b91fa68c4fb016b68c0b991e3df0a113c67
parent 970cf7849a50f65a0d014c98b35d9927b838fb05
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Sun, 30 Mar 2025 12:26:31 +0200

Make the commands a simple wrapper for their library

The commands were compiled in all cases. But their behaviour was defined
by the compilation process depending on whether the commands were
enabled. Now, when disabled, commands are simply not compiled.  The user
will therefore encounter an error when using them, which the system will
notify by indicating that the command is not present. Previously, it was
the command itself that returned an error.

Even if this "disabled" executable gave an explanation as to why it
could not be used, such an implementation was unfortunate given the
intended functionality, which was simply to notify the user that they
were unable to use the command. Which the system already does very well
without further development.

Diffstat:
Msrc/commands/htrdr_atmosphere_cmd.c | 13+------------
Msrc/commands/htrdr_combustion_cmd.c | 13+------------
Msrc/commands/htrdr_planets_cmd.c | 13+------------
3 files changed, 3 insertions(+), 36 deletions(-)

diff --git a/src/commands/htrdr_atmosphere_cmd.c b/src/commands/htrdr_atmosphere_cmd.c @@ -21,21 +21,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef HTRDR_BUILD_ATMOSPHERE - #include "atmosphere/htrdr_atmosphere.h" -#else - #include <stdio.h> -#endif +#include "atmosphere/htrdr_atmosphere.h" int main(int argc, char** argv) { -#ifdef HTRDR_BUILD_ATMOSPHERE return htrdr_atmosphere_main(argc, argv); -#else - (void)argc, (void)argv; - fprintf(stderr, - "The htrdr-atmosphere command is not available in this htrdr build.\n"); - return 1; -#endif } diff --git a/src/commands/htrdr_combustion_cmd.c b/src/commands/htrdr_combustion_cmd.c @@ -21,21 +21,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef HTRDR_BUILD_COMBUSTION - #include "combustion/htrdr_combustion.h" -#else - #include <stdio.h> -#endif +#include "combustion/htrdr_combustion.h" int main(int argc, char** argv) { -#ifdef HTRDR_BUILD_COMBUSTION return htrdr_combustion_main(argc, argv); -#else - (void)argc, (void)argv; - fprintf(stderr, - "The htrdr-combustion command is not available in this htrdr build.\n"); - return 1; -#endif } diff --git a/src/commands/htrdr_planets_cmd.c b/src/commands/htrdr_planets_cmd.c @@ -21,21 +21,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifdef HTRDR_BUILD_PLANETS - #include "planets/htrdr_planets.h" -#else - #include <stdio.h> -#endif +#include "planets/htrdr_planets.h" int main(int argc, char** argv) { -#ifdef HTRDR_BUILD_PLANETS return htrdr_planets_main(argc, argv); -#else - (void)argc, (void)argv; - fprintf(stderr, - "The htrdr-planets command is not available in this htrdr build.\n"); - return 1; -#endif }