diff options
Diffstat (limited to 'src/config.h')
| -rw-r--r-- | src/config.h | 68 |
1 files changed, 53 insertions, 15 deletions
diff --git a/src/config.h b/src/config.h index bfd7029..6594618 100644 --- a/src/config.h +++ b/src/config.h @@ -3,6 +3,8 @@ #include "../config.h" +#include "log.h" + #include <stdio.h> #if HAVE_STDBOOL_H @@ -14,19 +16,6 @@ typedef char * path_t; typedef char * dir_t; typedef char ** searchpath_t; -enum sk_log_verb { - LOG_OFF = 0, - LOG_ERROR, - LOG_WARNING, - LOG_INFO, - LOG_VERBOSE, - LOG_DEBUG, - LOG_TRACE, - - SK_LOG_MIN = LOG_OFF, - SK_LOG_MAX = LOG_TRACE -}; - enum sk_colour_output { SK_COLOUR_NEVER = 0, SK_COLOUR_ALWAYS, @@ -38,7 +27,10 @@ enum sk_archiving_mode { SK_ARCHIVING_TAR, SK_ARCHIVING_TGZ, SK_ARCHIVING_TBZ2, - SK_ARCHIVING_TXZ + SK_ARCHIVING_TXZ, + + SK_ARCHIVING_MIN = SK_ARCHIVING_NONE, + SK_ARCHIVING_MAX = SK_ARCHIVING_TXZ }; struct sk_config_global { @@ -53,7 +45,7 @@ struct sk_config_global { command_t remote_exec; dir_t inventory_dir; unsigned int jobs; - enum sk_log_verb verbosity_level; + sk_log_level verbosity_level; enum sk_archiving_mode archiving; bool save_output_streams; bool log_timestamp; @@ -63,6 +55,52 @@ struct sk_config { struct sk_config_global global; }; +/* type conversion functions */ + +/** + * sk_archiving_mode_to_string: + * return the string representation of an sk_archiving_mode. + * + * @param a: an sk_archiving_mode. + * @return the string representation of a. + */ +const char *sk_archiving_mode_to_string(enum sk_archiving_mode a); + +/** + * sk_archiving_mode_of_string: + * returns an sk_archiving_mode of a string representation. + * + * In case an invalid string representation is given, + * SK_ARCHIVING_NONE is returned. + * + * @param s: the string representation of an sk_archiving_mode. + * @return an sk_archiving_mode. + */ +enum sk_archiving_mode sk_archiving_mode_of_string(const char *s); + +/** + * sk_colour_output_to_string: + * returns the string representation of an sk_colour_output. + * + * @param c: the sk_colour_output. + * @return the string representation of c. + */ +const char *sk_colour_output_to_string(enum sk_colour_output c); + +/** + * sk_colour_output_of_string: + * convert a string to sk_colour_output. + * + * s is interpreted case-insensitively. + * In case an invalid string representation is given, + * SK_COLOUR_NEVER is returned. + * + * @param s: the string representation of an sk_colour_output. + * @return sk_colour_output + */ +enum sk_colour_output sk_colour_output_of_string(const char *s); + + /* functions */ /** |
