// The `is_defined` guard prevents redefining functions #[if(!is_defined("STR")) { const STR = 1; fn strlen(str: &char) -> num { for (let i=0; str[i] != 0; i=i+1) {} return i } fn strcpy(dst: &char, src: &char) { for (let i=0; src[i] != 0; i=i+1) { dst[i] = src[i]; } dst[i] = 0; } fn strcat(dst: &char, src: &char) { let offset = strlen(dst); for (let i=0; src[i] != 0; i=i+1) { dst[offset+i] = src[i]; } dst[offset+i] = 0; } }]