MCPcopy Create free account
hub / github.com/apache/trafficserver / TSUserArgIndexLookup

Function TSUserArgIndexLookup

src/api/InkAPI.cc:5095–5112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5093}
5094
5095TSReturnCode
5096TSUserArgIndexLookup(TSUserArgType type, int idx, const char **name, const char **description)
5097{
5098 sdk_assert(0 <= type && type < TS_USER_ARGS_COUNT);
5099 sdk_assert(SanityCheckUserIndex(type, idx));
5100 idx -= get_user_arg_offset(type);
5101 if (sdk_sanity_check_null_ptr(name) == TS_SUCCESS) {
5102 if (idx < UserArgIdx[type]) {
5103 UserArg &arg(UserArgTable[type][idx]);
5104 *name = arg.name.c_str();
5105 if (description) {
5106 *description = arg.description.c_str();
5107 }
5108 return TS_SUCCESS;
5109 }
5110 }
5111 return TS_ERROR;
5112}
5113
5114// Not particularly efficient, but good enough for now.
5115TSReturnCode

Callers 1

vconn_arg_handlerFunction · 0.85

Calls 4

SanityCheckUserIndexFunction · 0.85
get_user_arg_offsetFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected