1 // Copyright 2009, 2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
10 #define charntorune(pv, str, len) __go_get_rune(str, len, pv)
13 runtime_findnull(const byte *s)
17 return __builtin_strlen((const char*) s);
21 runtime_gostringnocopy(const byte *str)
25 s.__data = (const unsigned char *) str;
26 s.__length = runtime_findnull(str);
35 func stringiter(s String, k int32) (retk int32) {
39 // retk=0 is end of iteration
51 n = charntorune(&l, s.__data+k, s.__length-k);
52 retk = k + (n ? n : 1);
57 func stringiter2(s String, k int32) (retk int32, retv int32) {
61 // retk=0 is end of iteration
74 n = charntorune(&retv, s.__data+k, s.__length-k);
75 retk = k + (n ? n : 1);