/* * Neko Tools * Copyright (c)2005 Motion-Twin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License or the LICENSE file for more details. */ readdir = $loader.loadprim("std@sys_read_dir",1); command = $loader.loadprim("std@sys_command",1); exec = function(cmd) { $print(cmd,"\n"); var ecode = command(cmd); if( ecode != 0 ) $throw("Error "+ecode+" : aborted"); } makedoc = function(file) { exec("nekoc -o ../www/libs -doc ../"+file); } files = $array( "vm/builtins.c", ); var i = 0; var l = $asize(files); while i < l { makedoc(files[i]); i = i + 1; } var libs = readdir("../libs"); while( libs != null ) { var l = libs[0]; var k = try readdir("../libs/"+l) catch _ { null }; while( k != null ) { var f = k[0]; var len = $ssize(f); if( $ssub(f,len-2,2) == ".c" ) makedoc("libs/"+l+"/"+f); k = k[1]; } libs = libs[1]; }