@verb #4:"take_quota" this none this rxd #55 @program #4:"take_quota" this none this "Takes args[2] bytes and args[3] objects from args[1]" "returns actual amount transferred." if (!$perm_utils:controls(caller_perms(), this)) raise(E_PERM) endif {from, bytes, objects, dbytes} = args if (!(from_i = $list_utils:iassoc(from, this.quota_contribs))) return {0, 0, 0} endif itsokayflag = 0 if (this.quota_contribs[from_i][2..4] == {0, 0, 0}) this.quota_contribs = listdelete(this.quota_contribs, from_i) itsokayflag = 1 endif fromerror = `from.quota_contribs ! ANY' if (!(this_i = $list_utils:iassoc(this, typeof(fromerror) == $ERR ? {} | from.quota_contribs))) !itsokayflag && $wiz_utils:wiz_alert(verb, tostr("quota_contribs mis-match! From ", this, " to ", from, ". Contribution of ", toliteral(this.quota_contribs[from_i][2..4]), " has been reset to zero.")) this.quota_contribs = listdelete(this.quota_contribs, from_i) return {0, 0, 0} endif bytes = min(this.quota_contribs[from_i][2], bytes) objects = min(this.quota_contribs[from_i][3], objects) dbytes = min(this.quota_contribs[from_i][4], dbytes) bytes = max(bytes, 0) objects = max(objects, 0) dbytes = max(dbytes, 0) this.quota_contribs[from_i][2] = this.quota_contribs[from_i][2] - bytes this.quota_contribs[from_i][3] = this.quota_contribs[from_i][3] - objects typeof(fromerror) == $ERR || (from.quota_contribs[this_i][2] = from.quota_contribs[this_i][2] + bytes) typeof(fromerror) == $ERR || (from.quota_contribs[this_i][3] = from.quota_contribs[this_i][3] + objects) typeof(fromerror) == $ERR || (from.quota_contribs[this_i][4] = from.quota_contribs[this_i][4] + dbytes) this.quota_contribs[from_i][4] = this.quota_contribs[from_i][4] - dbytes this.quota_contribs[from_i][2..4] == {0, 0, 0} && (this.quota_contribs = listdelete(this.quota_contribs, from_i)) from.quota_contribs[this_i][2..4] == {0, 0, 0} && (from.quota_contribs = listdelete(from.quota_contribs, this_i)) return {bytes, objects, dbytes} "Last modified by Raptor (#6319) on Mon Jan 21 23:50:06 2002 MST." "This verb previously owned by manta (#7165), and chowned to $slacker upon dewizarding (Sat Aug 17 14:50:04 2002 MDT)." "Last modified by Dax (#789) on Tue May 3 13:57:39 2005 MDT." .