commit db121368383fa3e47ec60eaf126218f15c006c83 parent 5b81cf3259def9af21bd7f27b91f5e825b3e6d9b Author: Vincent Forest <vincent.forest@meso-star.com> Date: Wed, 4 Mar 2026 16:58:11 +0100 Add functions that return C strings of constants Thus the constants name can be printed to output instead of its only value, unspeaking. Diffstat:
| M | src/sln.h | | | 25 | +++++++++++++++++++++++++ |
1 file changed, 25 insertions(+), 0 deletions(-)
diff --git a/src/sln.h b/src/sln.h @@ -394,6 +394,31 @@ sln_compute_voigt_profile return k*sqrt_ln2_over_pi/gamma_d; } +static INLINE const char* +sln_mesh_type_cstr(const enum sln_mesh_type type) +{ + const char* cstr = NULL; + + switch(type) { + case SLN_MESH_FIT: cstr = "fit"; break; + case SLN_MESH_UPPER: cstr = "upper"; break; + default: FATAL("Unreachable code\n"); break; + } + return cstr; +} + +static INLINE const char* +sln_line_profile_cstr(const enum sln_line_profile profile) +{ + const char* cstr = NULL; + + switch(profile) { + case SLN_LINE_PROFILE_VOIGT: cstr = "voigt"; break; + default: FATAL("Unreachable code\n"); break; + } + return cstr; +} + END_DECLS #endif /* SLN_H */