/* * W I D - S E T - N A M E * Ficl ( wid c-addr -- ) * Set wid's name pointer to the \0 terminated string address supplied */ static void ficlPrimitiveWidSetName(ficlVm *vm) { char *name = (char *)ficlVmPop(vm).p; ficlHash *hash = ficlVmPop(vm).p; hash->name = name; }
/* * W I D - G E T - N A M E * Ficl ( wid -- c-addr u ) * Get wid's (optional) name and push onto stack as a counted string */ static void ficlPrimitiveWidGetName(ficlVm *vm) { ficlHash *hash; char *name; ficlInteger length; ficlCell c; hash = ficlVmPop(vm).p; name = hash->name; if (name != NULL) length = strlen(name); else length = 0; c.p = name; ficlVmPush(vm, c); c.i = length; ficlVmPush(vm, c); }
FICL_PLATFORM_EXTERN ficlCell vmPop (ficlVm *vm) { return ficlVmPop(vm); }