uim_agent_context * create_uim_agent_context(const char *encoding) { uim_agent_context *ret; const char *im; debug_printf(DEBUG_NOTE, "create_uim_agent_context\n"); ret = uim_malloc(sizeof(uim_agent_context)); if (encoding) { ret->encoding = uim_strdup(encoding); } else { if (debug_level > 0) ret->encoding = uim_strdup("EUC-JP"); else ret->encoding = uim_strdup("UTF-8"); } ret->context = create_context(ret->encoding, ret); if ((im = uim_get_default_im_name(setlocale(LC_CTYPE, NULL)))) ret->im = uim_strdup(im); else ret->im = NULL; ret->pe = create_preedit(); ret->cand = create_candidate(); ret->prop = create_prop(); ret->comstr = (char *)NULL; return ret; }
struct property * menu_add_prop(int token, char *prompt, struct symbol *def, struct expr *dep) { struct property *prop = create_prop(token); struct property **propp; prop->sym = current_entry->sym; prop->menu = current_entry; prop->text = prompt; prop->def = def; E_EXPR(prop->visible) = dep; if (prompt) current_entry->prompt = prop; /* append property to the prop list of symbol */ if (prop->sym) { for (propp = &prop->sym->prop; *propp; propp = &(*propp)->next); *propp = prop; } return prop; }