diff options
author | 2015-09-07 18:14:37 -0400 | |
---|---|---|
committer | 2015-09-07 18:14:37 -0400 | |
commit | 7654f5e7cdbf5edff2f576a59cf04c530dd6efb5 (patch) | |
tree | 8496fd8673d31bac1802d756885a8fc64245a552 /include | |
parent | Merge pull request #172 from taiyu-len/master (diff) | |
parent | strdup + style (diff) | |
download | sway-7654f5e7cdbf5edff2f576a59cf04c530dd6efb5.tar.gz sway-7654f5e7cdbf5edff2f576a59cf04c530dd6efb5.tar.zst sway-7654f5e7cdbf5edff2f576a59cf04c530dd6efb5.zip |
Merge pull request #173 from taiyu-len/config_mode
config modes
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 @@ | |||
5 | 5 | ||
6 | struct cmd_handler { | 6 | struct cmd_handler { |
7 | char *command; | 7 | char *command; |
8 | bool (*handle)(struct sway_config *config, int argc, char **argv); | 8 | bool (*handle)(int argc, char **argv); |
9 | enum { | 9 | enum { |
10 | CMD_COMPOSITOR_READY, | 10 | CMD_COMPOSITOR_READY, |
11 | CMD_KEYBIND, | 11 | CMD_KEYBIND, |
@@ -14,7 +14,7 @@ struct cmd_handler { | |||
14 | }; | 14 | }; |
15 | 15 | ||
16 | struct cmd_handler *find_handler(char *line); | 16 | struct cmd_handler *find_handler(char *line); |
17 | bool handle_command(struct sway_config *config, char *command); | 17 | bool handle_command(char *command); |
18 | 18 | ||
19 | void remove_view_from_scratchpad(); | 19 | void remove_view_from_scratchpad(); |
20 | 20 | ||
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 { | |||
60 | 60 | ||
61 | bool load_config(const char *file); | 61 | bool load_config(const char *file); |
62 | bool read_config(FILE *file, bool is_active); | 62 | bool read_config(FILE *file, bool is_active); |
63 | char *do_var_replacement(struct sway_config *config, char *str); | 63 | char *do_var_replacement(char *str); |
64 | 64 | ||
65 | extern struct sway_config *config; | 65 | extern struct sway_config *config; |
66 | 66 | ||
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 @@ | |||
2 | #define _SWAY_STRINGOP_H | 2 | #define _SWAY_STRINGOP_H |
3 | #include "list.h" | 3 | #include "list.h" |
4 | 4 | ||
5 | char *strip_whitespace(char *str, int *trimmed_start); | 5 | // array of whitespace characters to use for delims |
6 | extern const char *whitespace; | ||
7 | |||
8 | char *strip_whitespace(char *str); | ||
6 | char *strip_comments(char *str); | 9 | char *strip_comments(char *str); |
7 | 10 | ||
8 | // Must be freed with free_flat_list | 11 | // Simply split a string with delims, free with `free_flat_list` |
9 | list_t *split_string(const char *str, const char *delims); | 12 | list_t *split_string(const char *str, const char *delims); |
10 | void free_flat_list(list_t *list); | 13 | void free_flat_list(list_t *list); |
11 | 14 | ||
15 | // Splits an argument string, keeping quotes intact | ||
16 | char **split_args(const char *str, int *argc); | ||
17 | void free_argv(int argc, char **argv); | ||
18 | |||
12 | char *code_strchr(const char *string, char delimiter); | 19 | char *code_strchr(const char *string, char delimiter); |
13 | char *code_strstr(const char *haystack, const char *needle); | 20 | char *code_strstr(const char *haystack, const char *needle); |
14 | int unescape_string(char *string); | 21 | int unescape_string(char *string); |
15 | char *join_args(char **argv, int argc); | 22 | char *join_args(char **argv, int argc); |
16 | char *join_list(list_t *list, char *separator); | 23 | char *join_list(list_t *list, char *separator); |
17 | 24 | ||
25 | char *strdup(const char *); | ||
18 | #endif | 26 | #endif |