MCPcopy Create free account
hub / github.com/apache/cloudberry / split

Function split

src/common/etcdutils.c:21–39  ·  view source on GitHub ↗

* split: function used to split a string with special separator. * parameter src OUT * parameter separator IN * parameter dest OUT * parameter num OUT * return ture if configuration parse succeeded, otherwise retrun false. */

Source from the content-addressed store, hash-verified

19 * return ture if configuration parse succeeded, otherwise retrun false.
20 */
21static bool
22split(char *src, const char *separator, char **dest, int *num)
23{
24 char *pNext;
25 int count = 0;
26 if (src == NULL || src[0] == '\0')
27 return false;
28 if (separator == NULL || separator[0] == '\0')
29 return false;
30 pNext = (char *)strtok(src,separator);
31 while (pNext != NULL)
32 {
33 *dest++ = pNext;
34 ++count;
35 pNext = (char *)strtok(NULL,separator);
36 }
37 *num = count;
38 return true;
39}
40
41/*
42 * parseEtcdHostConfiguration: function used to parse etcdhost and etcdport inforamtion from a ETCD configure parameter.

Callers 1

generateGPSegConfigKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected