diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/commands.h | 4 | ||||
-rw-r--r-- | include/config.h | 2 | ||||
-rw-r--r-- | include/stringop.h | 12 |
3 files changed, 13 insertions, 5 deletions
diff --git a/include/commands.h b/include/commands.h index 808e64eb..8fb0c1d8 100644 --- a/include/commands.h +++ b/include/commands.h @@ -5,7 +5,7 @@ struct cmd_handler { char *command; - bool (*handle)(struct sway_config *config, int argc, char **argv); + bool (*handle)(int argc, char **argv); enum { CMD_COMPOSITOR_READY, CMD_KEYBIND, @@ -14,7 +14,7 @@ struct cmd_handler { }; struct cmd_handler *find_handler(char *line); -bool handle_command(struct sway_config *config, char *command); +bool handle_command(char *command); void remove_view_from_scratchpad(); diff --git a/include/config.h b/include/config.h index 653e790f..4070c9ef 100644 --- a/include/config.h +++ b/include/config.h @@ -60,7 +60,7 @@ struct sway_config { bool load_config(const char *file); bool read_config(FILE *file, bool is_active); -char *do_var_replacement(struct sway_config *config, char *str); +char *do_var_replacement(char *str); extern struct sway_config *config; diff --git a/include/stringop.h b/include/stringop.h index 7d17af95..dde50f13 100644 --- a/include/stringop.h +++ b/include/stringop.h @@ -2,17 +2,25 @@ #define _SWAY_STRINGOP_H #include "list.h" -char *strip_whitespace(char *str, int *trimmed_start); +// array of whitespace characters to use for delims +extern const char *whitespace; + +char *strip_whitespace(char *str); char *strip_comments(char *str); -// Must be freed with free_flat_list +// Simply split a string with delims, free with `free_flat_list` list_t *split_string(const char *str, const char *delims); void free_flat_list(list_t *list); +// Splits an argument string, keeping quotes intact +char **split_args(const char *str, int *argc); +void free_argv(int argc, char **argv); + char *code_strchr(const char *string, char delimiter); char *code_strstr(const char *haystack, const char *needle); int unescape_string(char *string); char *join_args(char **argv, int argc); char *join_list(list_t *list, char *separator); +char *strdup(const char *); #endif |