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

Function sqstd_pushstringf

sqstdlib/sqstdstring.cpp:159–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159void sqstd_pushstringf(HSQUIRRELVM v,const SQChar *s,...)
160{
161 SQInteger n=256;
162 va_list args;
163begin:
164 va_start(args,s);
165 SQChar *b=sq_getscratchpad(v,n);
166 SQInteger r=scvsprintf(b,n,s,args);
167 va_end(args);
168 if (r>=n) {
169 n=r+1;//required+null
170 goto begin;
171 } else if (r<0) {
172 sq_pushnull(v);
173 } else {
174 sq_pushstring(v,b,r);
175 }
176}
177
178static SQInteger _string_printf(HSQUIRRELVM v)
179{

Callers

nothing calls this directly

Calls 3

sq_getscratchpadFunction · 0.85
sq_pushnullFunction · 0.85
sq_pushstringFunction · 0.85

Tested by

no test coverage detected