+local function callback(username, host, datastore, data)
+ for _, f in ipairs(callbacks) do
+ username, host, datastore, data = f(username, host, datastore, data);
+ if username == false then break; end
+ end
+
+ return username, host, datastore, data;
+end
+function add_callback(func)
+ if not callbacks[func] then -- Would you really want to set the same callback more than once?
+ callbacks[func] = true;
+ callbacks[#callbacks+1] = func;
+ return true;
+ end
+end
+function remove_callback(func)
+ if callbacks[func] then
+ for i, f in ipairs(callbacks) do
+ if f == func then
+ callbacks[i] = nil;
+ callbacks[f] = nil;
+ return true;
+ end
+ end
+ end
+end
+
+function getpath(username, host, datastore, ext, create)