| 5093 | } |
| 5094 | |
| 5095 | TSReturnCode |
| 5096 | TSUserArgIndexLookup(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. |
| 5115 | TSReturnCode |
no test coverage detected