MCPcopy Create free account
hub / github.com/chrxh/alien / getCmdLineArgumentString

Function getCmdLineArgumentString

external/cuda/helper_string.h:258–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258inline bool getCmdLineArgumentString(const int argc, const char **argv,
259 const char *string_ref, char **string_retval)
260{
261 bool bFound = false;
262
263 if (argc >= 1)
264 {
265 for (int i=1; i < argc; i++)
266 {
267 int string_start = stringRemoveDelimiter('-', argv[i]);
268 char *string_argv = (char *)&argv[i][string_start];
269 int length = (int)strlen(string_ref);
270
271 if (!STRNCASECMP(string_argv, string_ref, length))
272 {
273 *string_retval = &string_argv[length+1];
274 bFound = true;
275 continue;
276 }
277 }
278 }
279
280 if (!bFound)
281 {
282 *string_retval = NULL;
283 }
284
285 return bFound;
286}
287
288//////////////////////////////////////////////////////////////////////////////
289//! Find the path for a file assuming that

Callers

nothing calls this directly

Calls 1

stringRemoveDelimiterFunction · 0.85

Tested by

no test coverage detected