]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/nstreval.c
Virtual selectors
[empserver] / src / lib / common / nstreval.c
index 24d9dda056afc98fa38b79809c68808c895f1560..ab49f84196c80f2ab0f65aa689858baef7aafe98 100644 (file)
@@ -53,7 +53,7 @@
  * WANT.  VAL must be coercible.  That's the case if a previous
  * nstr_coerce_val(VAL, WANT, STR) succeeded.
  */
-void
+struct valstr *
 nstr_exec_val(struct valstr *val, natid cnum, void *ptr, nsc_type want)
 {
     char *memb_ptr;
@@ -69,6 +69,17 @@ nstr_exec_val(struct valstr *val, natid cnum, void *ptr, nsc_type want)
        valtype = val->val_type;
        break;
     case NSC_OFF:
+       if (val->val_as.sym.get) {
+           do {
+               ptr = val->val_as.sym.get(val, cnum, ptr);
+           } while (ptr && val->val_as.sym.get);
+           if (!ptr) {
+               valtype = val->val_type;
+               val->val_cat = NSC_VAL;
+               break;
+           }
+       }
+
        valtype = NSC_LONG;
        memb_ptr = ptr;
        memb_ptr += val->val_as.sym.off;
@@ -158,6 +169,7 @@ nstr_exec_val(struct valstr *val, natid cnum, void *ptr, nsc_type want)
     }
 
     val->val_type = valtype;
+    return val;
 }
 
 /*