MCPcopy Create free account
hub / github.com/albertodemichelis/squirrel / _string_startswith

Function _string_startswith

sqstdlib/sqstdstring.cpp:358–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358static SQInteger _string_startswith(HSQUIRRELVM v)
359{
360 const SQChar *str,*cmp;
361 sq_getstring(v,2,&str);
362 sq_getstring(v,3,&cmp);
363 SQInteger len = sq_getsize(v,2);
364 SQInteger cmplen = sq_getsize(v,3);
365 SQBool ret = SQFalse;
366 if(cmplen <= len) {
367 ret = memcmp(str,cmp,sq_rsl(cmplen)) == 0 ? SQTrue : SQFalse;
368 }
369 sq_pushbool(v,ret);
370 return 1;
371}
372
373static SQInteger _string_endswith(HSQUIRRELVM v)
374{

Callers

nothing calls this directly

Calls 3

sq_getstringFunction · 0.85
sq_getsizeFunction · 0.85
sq_pushboolFunction · 0.85

Tested by

no test coverage detected