MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / utfrune

Function utfrune

extern/re2/util/rune.cc:232–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232char*
233utfrune(const char *s, Rune c)
234{
235 long c1;
236 Rune r;
237 int n;
238
239 if(c < Runesync) /* not part of utf sequence */
240 return strchr((char*)s, c);
241
242 for(;;) {
243 c1 = *(unsigned char*)s;
244 if(c1 < Runeself) { /* one byte rune */
245 if(c1 == 0)
246 return 0;
247 if(c1 == c)
248 return (char*)s;
249 s++;
250 continue;
251 }
252 n = chartorune(&r, s);
253 if(r == c)
254 return (char*)s;
255 s += n;
256 }
257 return 0;
258}
259
260} // namespace re2

Callers 1

RunTestFunction · 0.85

Calls 1

chartoruneFunction · 0.85

Tested by 1

RunTestFunction · 0.68