/* base js library functions Copyright Andrew Tridgell 2005 released under the GNU GPL version 3 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)); } /* substitute strings of the form ${NAME} in str, replacing with substitutions from subobj */ function substitute_var(str, subobj) { var list = split("${", str); var i; for (i=1;i