#include "sys/link.h" jove_obj_t link_unlink(jove_owned_obj_t *link) { struct obj_link *linkval = obj_deref(link); if(--linkval->refcount == 1) { jove_obj_t held_obj = linkval->obj; link->locked = held_obj; return (jove_obj_t) { .lock = 0, .type = JOVE_OBJ_UNTYPED, .value = (uintptr_t)linkval }; }else{ obj_settype(link, JOVE_OBJ_NONE); } return (jove_obj_t) { 0 }; }