![]() |
Cyclone Scheme
0.9
|
Value:
string_type cs; \ { int len = strlen(s); \ cs.hdr.mark = gc_color_red; \ cs.hdr.grayed = 0; \ cs.tag = string_tag; \ cs.num_cp = Cyc_utf8_count_code_points((uint8_t *)s); \ Cyc_rt_raise_msg(data, "Invalid UTF-8 characters in string"); \ } \ cs.len = len; \ cs.str = alloca(sizeof(char) * (len + 1)); \ memcpy(cs.str, s, len + 1);}
Definition: types.h:56 int Cyc_utf8_count_code_points(uint8_t *s) Count the number of code points in a string. Based on example code from Bjoern Hoehrmann. Definition: runtime.c:7202 Create a new string in the nursery |