| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2015-09-02 10:57:48 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2015-09-02 10:57:48 +0200 | 
| commit | 265053e2a4394b20d82aa1170ec3a9901f437d81 (patch) | |
| tree | 022440b6bc0d1ad36e36429573ec17e589fb791c /src/config.h | |
| parent | d9656cc86505b6f2bba57e04a4c99430a945a70d (diff) | |
Adds some comments, as well as minor code improvements.
Diffstat (limited to 'src/config.h')
| -rw-r--r-- | src/config.h | 31 | 
1 files changed, 27 insertions, 4 deletions
| diff --git a/src/config.h b/src/config.h index ffdfebb..558ea98 100644 --- a/src/config.h +++ b/src/config.h @@ -15,23 +15,41 @@ struct relabsd_config_axis  };  /* - * There are no relabsd_config_free function so be careful about using dynamic + * There is no relabsd_config_free function, so be careful about using dynamic   * memory for input_file or device_name.   */  struct relabsd_config  { -   char * input_file; -   char * device_name; +   const char * input_file; +   const char * device_name;     struct relabsd_config_axis axis[6];  }; +/* + * Parses the invocation parameters and the config file into 'conf'. + * + * Returns -1 on (fatal) error, + *          0 on successfully parsed config. + * + * 'conf' does not need to be initialized, as the function will only write to + * it. + * As one would expect, argc is the number of elements in argv. + */  int relabsd_config_parse  (     struct relabsd_config * const conf,     int const argc, -   char ** const argv +   char * const * const argv  ); +/* + * This function aims at preventing us from emitting values that are incoherent + * with our REV_ABS axis configuration, such as the axis' minimum or maximum + * values. + * + * Returns 1 if 'conf' allows the axis to have this value, + *         0 otherwise. + */  int relabsd_config_allows  (     const struct relabsd_config * const conf, @@ -39,6 +57,11 @@ int relabsd_config_allows     int const value  ); +/* + * Copies all the ABS event parameters of 'axis' into 'absinfo'. + * 'absinfo' does not need to be initialized, as the function will only write to + * it. + */  void relabsd_config_get_absinfo  (     const struct relabsd_config * const conf, | 


