gdjn  Diff

Differences From Artifact [79dbc22466]:

To Artifact [bf54805293]:


    33     33   	return r;
    34     34   }
    35     35   
    36     36   static inline gd_stringName
    37     37   gdu_intern (const char* str) {
    38     38   	return gdu_intern_sz(str, 0);
    39     39   }
           40  +
           41  +static inline gd_stringName
           42  +gdu_internp (pstr p) {
           43  +	return gdu_intern_sz(p.v, p.sz);
           44  +}
    40     45   
    41     46   static inline gd_stringName
    42     47   gdu_sym_null(void) {
    43     48   	gd_stringName n;
    44     49   	_t(stringName).empty(&n, nullptr);
    45     50   	return n;
    46     51   }
................................................................................
    55     60   static inline gd_string
    56     61   gdu_str_sz (const char* str, const size_t sz) {
    57     62   	gd_string r = {};
    58     63   	if (sz == 0) _t(string).newWithUtf8Chars(&r, str);
    59     64   	        else _t(string).newWithUtf8CharsAndLen(&r, str, sz);
    60     65   	return r;
    61     66   }
           67  +
           68  +static inline gd_string
           69  +gdu_pstr (pstr p) {
           70  +	return gdu_str_sz(p.v, p.sz);
           71  +}
    62     72   
    63     73   static inline gd_string
    64     74   gdu_str (const char* str) {
    65     75   	return gdu_str_sz(str, 0);
    66     76   }
    67     77   
    68     78   #define _gdu_intern(x) (gdu_intern_sz((x), sizeof(x)-1))
................................................................................
   368    378   	gd_variant v = gd_variant_of_dictionary(*dict);
   369    379   	_withSym(keyName, key, {
   370    380   		uint8_t ok = false;
   371    381   		_t(variant).setNamed(&v, &keyName, val, &ok);
   372    382   	});
   373    383   }
   374    384   
          385  +static inline void
          386  +gdu_setKey_str
          387  +(	gd_dictionary* const dict,
          388  +	pstr           const key,
          389  +	pstr           const val
          390  +) {
          391  +	gd_string s = gdu_str_sz(val.v, val.sz);
          392  +	gd_variant v = gd_variant_of_string(s);
          393  +	gdu_setKey(dict, key, &v);
          394  +	_t(string).dtor(&s);
          395  +}