ui/common/context.c

branch
newapi
changeset 406
0ebf9d7b23e8
parent 392
df62b7205bd3
child 420
28a5920bebe0
equal deleted inserted replaced
405:a7f18dda6baf 406:0ebf9d7b23e8
185 CxHashKey key = cx_hash_key(name, strlen(name)); 185 CxHashKey key = cx_hash_key(name, strlen(name));
186 return ctx_getvar(ctx, key); 186 return ctx_getvar(ctx, key);
187 } 187 }
188 188
189 UiVar* uic_create_var(UiContext *ctx, const char *name, UiVarType type) { 189 UiVar* uic_create_var(UiContext *ctx, const char *name, UiVarType type) {
190 if(ctx->vars_unbound) {
191 UiVar *unbound = cxMapGet(ctx->vars_unbound, name);
192 if(unbound) {
193 return unbound;
194 }
195 }
196
190 UiVar *var = uic_get_var(ctx, name); 197 UiVar *var = uic_get_var(ctx, name);
191 if(var) { 198 if(var) {
192 if(var->type == type) { 199 if(var->type == type) {
193 return var; 200 return var;
194 } else { 201 } else {

mercurial