First step towards generalizing NSC_TYPEID to arbitrary dictionaries.

(nsc_cat) New category NSC_ID.
(nstr_comp): Resolve identifiers instead of relying on nstr_comp_val()
and nstr_coerce_val().
(valstr, nstr_coerce_val): Remove valstr member val_as_type.
(nstr_parse_val, nstr_match_ca, nstr_match_val, nstr_resolve_id)
(nstr_resolve_sel, nstr_mkselval): New.
(nstr_comp_val): Rewrite using the above.
This commit is contained in:
Markus Armbruster 2005-02-24 16:14:53 +00:00
parent 446d4ed394
commit 58512e4813
3 changed files with 228 additions and 103 deletions

View file

@ -286,7 +286,6 @@ xdeval(struct valstr *val, nsc_type type, void *ptr, ptrdiff_t off, int idx)
{
val->val_type = type;
val->val_cat = NSC_OFF;
val->val_as_type = -1;
val->val_as.sym.off = off;
val->val_as.sym.idx = idx;
nstr_exec_val(val, player->cnum, ptr, NSC_NOTYPE);
@ -457,7 +456,6 @@ xdchr(int chridx)
for (p = cm->chr; ; p += cm->size) {
val.val_type = cm->ca[0].ca_type;
val.val_cat = NSC_OFF;
val.val_as_type = -1;
val.val_as.sym.off = cm->ca[0].ca_off;
val.val_as.sym.idx = 0;
nstr_exec_val(&val, player->cnum, p, NSC_STRING);