Branch: Tag:

2018-04-21

2018-04-21 14:48:33 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Added utf8_string/tUtf8Str.

This type is intended to be used to make it clearer in APIs whether
strings are binary, wide, or contain data encoded with UTF-8.

64:   PMOD_EXPORT struct pike_type *any_type_string;   PMOD_EXPORT struct pike_type *weak_type_string; /* array|mapping|multiset|function */   struct pike_type *sscanf_type_string; + PMOD_EXPORT struct pike_type *utf8_type_string;      PMOD_EXPORT struct pike_string *literal_string_string;   PMOD_EXPORT struct pike_string *literal_int_string;
2387:    MAKE_CONST_STRING(deprecated, "deprecated");    if (((struct pike_string *)t->car) == deprecated) {    string_builder_sprintf(s, "__deprecated__(%T)", t->cdr); +  } else if (t == utf8_type_string) { +  string_builder_sprintf(s, "utf8_string");    } else {    struct svalue sval;    SET_SVAL(sval, PIKE_T_STRING, 0, string,
8726:    tFuncV(tNone,tZero,tOr(tMix,tVoid))));    sscanf_type_string = CONSTTYPE(tFuncV(tStr tAttr("sscanf_format", tStr),    tAttr("sscanf_args", tMix), tIntPos)); +  utf8_type_string = CONSTTYPE(tUtf8Str);       /* add_ref(weak_type_string); *//* LEAK */   
8811:    weak_type_string = NULL;    free_type(sscanf_type_string);    sscanf_type_string = NULL; +  free_type(utf8_type_string); +  utf8_type_string = NULL;       free_string(literal_string_string); literal_string_string = NULL;    free_string(literal_int_string); literal_int_string = NULL;