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

Method find

src/variables.cpp:310–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310int AllocVariableTable::find(const char *varName, bool allocate)
311{
312 /* If this variable has already been used, then we have nothing to do. */
313 str_int_map::iterator var_it = variableMap.find(varName);
314 if (var_it != variableMap.end()) {
315 variableReferences[var_it->second]++;
316 return var_it->second;
317 }
318 if (av_parent) {
319 int ret = av_parent->find(varName, false);
320 if (ret > 0) {
321 return ret;
322 }
323 }
324
325 if (allocate) {
326 int varNum = size + 1;
327 expand(varNum);
328 varNum = (varNum << LEVEL_BITS) | level;
329 variableMap[varName] = varNum;
330 variableReferences[varNum] = 1;
331 variableRevMap[varNum] = strdup(varName);
332 return varNum;
333 }
334
335 return -1;
336}
337
338char *AllocVariableTable::getName(int i)
339{

Callers 15

CleanseCommentsFunction · 0.80
CheckPosixThreadingFunction · 0.80
UpdateMethod · 0.80
CheckSpacingFunction · 0.80
CheckBracesFunction · 0.80
CheckEmptyLoopBodyFunction · 0.80
CheckCheckFunction · 0.80
CheckAltTokensFunction · 0.80
CheckStyleFunction · 0.80
CheckLanguageFunction · 0.80
setRTPEchoActInfoMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected