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

Method sRepartitionHeader

src/stat.cpp:1091–1116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1089}
1090
1091char* CStat::sRepartitionHeader(T_dynamicalRepartition * tabRepartition,
1092 int sizeOfTab,
1093 const char * P_repartitionName)
1094{
1095 static char *repartitionHeader = nullptr;
1096 char buffer[MAX_CHAR_BUFFER_SIZE];
1097 int dlen = strlen(stat_delimiter);
1098
1099 if(tabRepartition != nullptr) {
1100 repartitionHeader = (char *)realloc(repartitionHeader, strlen(P_repartitionName) + dlen + 1);
1101 sprintf(repartitionHeader, "%s%s", P_repartitionName, stat_delimiter);
1102 for(int i=0; i<(sizeOfTab-1); i++) {
1103 sprintf(buffer, "%s_<%d%s", P_repartitionName, tabRepartition[i].borderMax, stat_delimiter);
1104 repartitionHeader = (char *)realloc(repartitionHeader, strlen(repartitionHeader) + strlen(buffer) + 1);
1105 strcat(repartitionHeader, buffer);
1106 }
1107 sprintf(buffer, "%s_>=%d%s", P_repartitionName, tabRepartition[sizeOfTab-1].borderMax, stat_delimiter);
1108 repartitionHeader = (char *)realloc(repartitionHeader, strlen(repartitionHeader) + strlen(buffer) + 1);
1109 strcat(repartitionHeader, buffer);
1110 } else {
1111 repartitionHeader = (char *)realloc(repartitionHeader, 2);
1112 strcpy(repartitionHeader, "");
1113 }
1114
1115 return(repartitionHeader);
1116}
1117
1118char* CStat::sRepartitionInfo(T_dynamicalRepartition * tabRepartition,
1119 int sizeOfTab)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected