/* Splits the given string into segments. You should call one of the macros coap_split_path() or coap_split_query() instead. */
size_t coap_split_path_impl(coap_parse_iterator_t *parse_iter, segment_handler_t h, void *data)
/* Splits the given string into segments. You should call one of the macros coap_split_path() or coap_split_query() instead. */
size_t coap_split_path_impl(coap_parse_iterator_t *parse_iter, segment_handler_t h, void *data)
{
  unsigned char *seg;
  size_t length;
  assert(parse_iter);
  assert(h);
  length = parse_iter->n;
  while ( (seg = coap_parse_next(parse_iter)) ) {
    h(seg, parse_iter->segment_length, data);
  }
  return length - (parse_iter->n - parse_iter->segment_length);
}