summaryrefslogtreecommitdiff
path: root/src/sp_config_utils.c
blob: e93ef31977dcde6f0b35b126b2a6b12051fb15dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "php_snuffleupagus.h"


sp_list_node *parse_functions_list(char *value) {
  static const char *sep = ">";

  if (NULL == strchr(value, sep[0])) {
    return NULL;
  }

  sp_list_node *list = NULL;
  char *tmp = strdup(value);
  char *function_name;
  char *next_token = tmp;
  while ((function_name = strtok_r(NULL, sep, &next_token))) {
    list = sp_list_prepend(list, strdup(function_name));
  }
  free(tmp);

  return list;
}