From 7234fdbb0cb0dd45ed1d6e7814c91e596126ee25 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 9 Oct 2017 11:54:11 +0200 Subject: Implement matching on the calltrace (#17) * Implement matching on the calltrace--- src/sp_config_utils.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/sp_config_utils.c') diff --git a/src/sp_config_utils.c b/src/sp_config_utils.c index 3ea82d0..b0c7d3c 100644 --- a/src/sp_config_utils.c +++ b/src/sp_config_utils.c @@ -167,3 +167,23 @@ int array_to_list(char **name_ptr, sp_node_t **keys) { *name_ptr = pestrdup(tmp, 1); return in_key; } + + +zend_always_inline sp_node_t *parse_functions_list(char *value) { + const char *sep = ">"; + + if (NULL == strchr(value, sep[0])) { + return NULL; + } + + sp_node_t *list = sp_new_list(); + char* tmp = strdup(value); + char* function_name; + char *next_token = tmp; + while ((function_name = strtok_r(NULL, sep, &next_token))) { + sp_list_prepend(list, strdup(function_name)); + } + free(tmp); + + return list; +} \ No newline at end of file -- cgit v1.3