MCPcopy Create free account
hub / github.com/SIPp/sipp / createStringTable

Function createStringTable

src/scenario.cpp:1911–1936  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1909}
1910
1911int createStringTable(const char* inputString, char*** stringList, int* sizeOfList)
1912{
1913 if(!inputString) {
1914 return 0;
1915 }
1916
1917 *stringList = nullptr;
1918 *sizeOfList = 0;
1919
1920 /* FIXME: temporary workaround: needs rewrite */
1921 char* input = const_cast<char*>(inputString);
1922 do {
1923 char* p = strchr(input, ',');
1924 if (p) {
1925 *p++ = '\0';
1926 }
1927
1928 *stringList = (char **)realloc(*stringList, sizeof(char *) * (*sizeOfList + 1));
1929 (*stringList)[*sizeOfList] = strdup(input);
1930 (*sizeOfList)++;
1931
1932 input = p;
1933 } while (input);
1934
1935 return 1;
1936}
1937
1938void freeStringTable(char ** stringList, int sizeOfList)
1939{

Callers 2

scenarioMethod · 0.85
parseActionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected