/* base js library functions Copyright Andrew Tridgell 2005 released under the GNU GPL v2 or later */ if (global["HAVE_BASE_JS"] != undefined) { return; } HAVE_BASE_JS=1 /* bring the string functions into the global frame */ string_init(global); /* an essential function! */ function printf() { print(vsprintf(arguments)); } /* helper function to setup a rpc io object, ready for input */ function irpcObj() { var o = new Object(); o.input = new Object(); return o; } /* check that a status result is OK */ function check_status_ok(status) { if (status.is_ok != true) { printVars(status); } assert(status.is_ok == true); } /* check that two arrays are equal */ function check_array_equal(a1, a2) { assert(a1.length == a2.length); for (i=0; i