| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-01-03 03:50:24 +0100 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-01-03 03:50:24 +0100 |
| commit | a4841776b6e1751232d46482731836a7c17b896f (patch) | |
| tree | bd818e08f2c145dc1629d0d568feb7106ff274d8 /include | |
| parent | 63016ce5c71019de315434de3e91adbf535d4986 (diff) | |
Still working on it...
Diffstat (limited to 'include')
| -rw-r--r-- | include/relabsd/config.h | 5 | ||||
| -rw-r--r-- | include/relabsd/config/parameters.h | 2 | ||||
| -rw-r--r-- | include/relabsd/config/parameters_types.h | 3 | ||||
| -rw-r--r-- | include/relabsd/device/axis.h | 13 | ||||
| -rw-r--r-- | include/relabsd/util/string.h | 7 |
5 files changed, 28 insertions, 2 deletions
diff --git a/include/relabsd/config.h b/include/relabsd/config.h index e69de29..6558ebb 100644 --- a/include/relabsd/config.h +++ b/include/relabsd/config.h @@ -0,0 +1,5 @@ +#pragma once + +#ifndef RELABSD_CONF_AXIS_CODE_SIZE +#define RELABSD_CONF_AXIS_CODE_SIZE 2 +#endif diff --git a/include/relabsd/config/parameters.h b/include/relabsd/config/parameters.h index 5a12be4..e1c67a4 100644 --- a/include/relabsd/config/parameters.h +++ b/include/relabsd/config/parameters.h @@ -28,7 +28,7 @@ void relabsd_parameters_print_usage (const char exec [const restrict static 1]); /**** Accessors ***************************************************************/ void relabsd_parameters_initialize_options ( - const struct relabsd_parameters parameters [const restrict static 1] + struct relabsd_parameters parameters [const restrict static 1] ); int relabsd_parameters_get_run_as_daemon diff --git a/include/relabsd/config/parameters_types.h b/include/relabsd/config/parameters_types.h index ab07bfa..e6c4009 100644 --- a/include/relabsd/config/parameters_types.h +++ b/include/relabsd/config/parameters_types.h @@ -18,5 +18,6 @@ struct relabsd_parameters const char * device_name; const char * physical_device_file_name; const char * configuration_file; - struct relabsd_axis axes[RELABSD_AXIS_VALID_AXES_COUNT] + int timeout; /* TODO: use time structure + enabled flag */ + struct relabsd_axis axes[RELABSD_AXIS_VALID_AXES_COUNT]; }; diff --git a/include/relabsd/device/axis.h b/include/relabsd/device/axis.h index fee8522..815bbb8 100644 --- a/include/relabsd/device/axis.h +++ b/include/relabsd/device/axis.h @@ -52,3 +52,16 @@ enum relabsd_axis_name relabsd_axis_parse_name * Returned values should be coherent with the configuration file syntax. */ const char * relabsd_axis_name_to_string (const enum relabsd_axis_name e); + +/* + * Returns -1 if the option was discarded (an error has been reported), + * 0 if the option was successfully parsed. + */ +int relabsd_axis_enable_option_from_name +( + const char option_name [const restrict static 1], + const char axis_name [const restrict static 1], + struct relabsd_axis axis [const restrict static 1] +); + +void relabsd_axis_enable (struct relabsd_axis axis [const restrict static 1]); diff --git a/include/relabsd/util/string.h b/include/relabsd/util/string.h index d632720..a0ffde3 100644 --- a/include/relabsd/util/string.h +++ b/include/relabsd/util/string.h @@ -16,3 +16,10 @@ int relabsd_util_parse_int const int max, int output [const restrict static 1] ); + +/* + * Returns -1 on error, + * 0 on EOF, + * 1 on newline. + */ +int relabsd_util_reach_next_line_or_eof (FILE f [const restrict static 1]); |


