|
YAC 3.20.0
Yet Another Coupler
|


Go to the source code of this file.
Data Structures | |
| struct | yac_param_vtable |
Macros | |
| #define | YAC_PARAM_ASSERT(COND, ...) |
| #define | YAC_PARAM_CHECK_BASIC() |
| #define | ERROR_BUF_SIZE (256) |
Enumerations | |
| enum | yac_param_angle_unit { YAC_PARAM_ANGLE_UNIT_DEG = 0 , YAC_PARAM_ANGLE_UNIT_RAD = 1 } |
Functions | |
| void | yac_param_get_error_buffer (char **buffer, size_t *buffer_size) |
| int | yac_param_parse_dble (const char *value_str, const char *param_name, double *value) |
| int | yac_param_parse_dble_with_unit (const char *value_str, const char *param_name, double *value, enum yac_param_angle_unit *unit) |
| int | yac_param_format_scalar_dble (char *buf, size_t buflen, double value, const char *value_desc, const char *param_name) |
| double | yac_wrap_rad (double value, char const *param_name) |
| double | yac_wrap_deg (double value, char const *param_name) |
| double | yac_deg_to_rad (double deg, char const *param_name) |
| double | yac_rad_to_deg (double rad, char const *param_name) |
| #define ERROR_BUF_SIZE (256) |
Definition at line 178 of file param_internal.h.
| #define YAC_PARAM_ASSERT | ( | COND, | |
| ... ) |
Definition at line 58 of file param_internal.h.
| #define YAC_PARAM_CHECK_BASIC | ( | ) |
Definition at line 172 of file param_internal.h.
| enum yac_param_angle_unit |
Unit of an angle value used in the parameter string API.
| Enumerator | |
|---|---|
| YAC_PARAM_ANGLE_UNIT_DEG | degrees |
| YAC_PARAM_ANGLE_UNIT_RAD | radians |
Definition at line 84 of file param_internal.h.
| double yac_deg_to_rad | ( | double | deg, |
| char const * | param_name ) |
Convert degrees to radians
Will try to use a precise value from math.h if available, otherwise falls back to the standard formula. All angles are automatically warped to the range [-180, 180) degrees or [-pi, pi) radians by the caller, so no special handling for values outside that range is needed here.
| deg | angle in degrees |
| param_name | parameter name for error messages (can be NULL) |
Definition at line 372 of file param.c.


| int yac_param_format_scalar_dble | ( | char * | buf, |
| size_t | buflen, | ||
| double | value, | ||
| const char * | value_desc, | ||
| const char * | param_name ) |
Format a double scalar value into buf
| buf | target output buffer |
| buflen | size of buf in bytes |
| value | value to be formatted |
| value_desc | description of the value for error messages |
| param_name | parameter name for error messages (can be NULL) |
Definition at line 247 of file param.c.

| void yac_param_get_error_buffer | ( | char ** | buffer, |
| size_t * | buffer_size ) |
| int yac_param_parse_dble | ( | const char * | value_str, |
| const char * | param_name, | ||
| double * | value ) |
Parse a double from value_str.
| value_str | string to parse; if NULL the call fails with an error |
| param_name | name of the parameter, used in error messages |
| value | receives the parsed double on success |
Definition at line 177 of file param.c.

| int yac_param_parse_dble_with_unit | ( | const char * | value_str, |
| const char * | param_name, | ||
| double * | value, | ||
| enum yac_param_angle_unit * | unit ) |
Parse a double and optional angle unit suffix from value_str.
Accepted forms: "<double>", "<double> <unit>", "<double><unit>" with unit in {deg, rad, d, r} (case-insensitive).
| [in] | value_str | string to parse; if NULL the call fails with an error |
| [in] | param_name | name of the parameter, used in error messages |
| [out] | value | receives the parsed double on success |
| [out] | unit | receives parsed/default unit on success |
Definition at line 191 of file param.c.


| double yac_rad_to_deg | ( | double | rad, |
| char const * | param_name ) |
Convert radians to degrees
Will try to use a precise value from math.h if available, otherwise falls back to the standard formula. All angles are automatically warped to the range [-180, 180) degrees or [-pi, pi) radians by the caller, so no special handling for values outside that range is needed here.
| rad | angle in radians |
| param_name | parameter name for error messages (can be NULL) |
Definition at line 385 of file param.c.


| double yac_wrap_deg | ( | double | value, |
| char const * | param_name ) |
| double yac_wrap_rad | ( | double | value, |
| char const * | param_name ) |