fftools: return errors from parse_number_or_die() instead of aborting

Rename the function to just parse_number().
This commit is contained in:
Anton Khirnov
2023-07-14 13:47:23 +02:00
parent 4adbe2d219
commit 9cb47c78d6
6 changed files with 83 additions and 27 deletions

View File

@@ -100,8 +100,6 @@ int opt_timelimit(void *optctx, const char *opt, const char *arg);
/**
* Parse a string and return its corresponding value as a double.
* Exit from the application if the string cannot be correctly
* parsed or the corresponding value is invalid.
*
* @param context the context of the value to be set (e.g. the
* corresponding command line option name)
@@ -111,8 +109,8 @@ int opt_timelimit(void *optctx, const char *opt, const char *arg);
* @param min the minimum valid accepted value
* @param max the maximum valid accepted value
*/
double parse_number_or_die(const char *context, const char *numstr, int type,
double min, double max);
int parse_number(const char *context, const char *numstr, int type,
double min, double max, double *dst);
/**
* Parse a string specifying a time and return its corresponding