boot.zc

来自「实现树形结构」· ZC 代码 · 共 87 行

ZC
87
字号
//[c]sys-box - base for widgets//[c]//[of]:license//[c]    Code Browser - a folding text editor for programmers//[c]    Copyright (C) 2003-07 Marc Kerbiquet//[c]//[c]    This program is free software; you can redistribute it and/or modify//[c]    it under the terms of the GNU General Public License as published by//[c]    the Free Software Foundation; either version 2 of the License, or//[c]    (at your option) any later version.//[c]//[c]    This program is distributed in the hope that it will be useful,//[c]    but WITHOUT ANY WARRANTY; without even the implied warranty of//[c]    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the//[c]    GNU General Public License for more details.//[c]//[c]    You should have received a copy of the GNU General Public License//[c]    along with this program; if not, write to the Free Software//[c]    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA//[cf]//[of]:importsimport "base/types"import "base/memory"import "base/memory-allocator"import "text/string"import "text/string-buffer"import "sys-command"import "user/command"import "toolbox/clipboard"import "glib/glib"import "glib/glib-object"import "gtk/gtk"import "libc/stdio"//[cf]//[c]//[of]:mainprivate import func run (int, [][]char): intpublic [name="c", entry point="true"] func main (argc: int, argv: [][]char)	// Don't touch my args !	def ac : [1] int	def av : [1] [][]char	ac[] = argc	av[] = argv	gtk_init (ac, av)		initialize allocator	initialize string buffer	initialize system commands	initialize commands	initialize clipboard	def result = run (ac[], av[])	release clipboard	release commands	release system commands	release string buffer		def show mem info = false	if show mem info || left block > 0		// copy stats before creating string buffer		def tc = total block		def lc = left block		def lb = left bytes		def mb = max bytes				def stats = temp string buffer		stats << "Number of allocations...: " << tc << \n		stats << "Max allocated...: " << mb << " (" << (mb+1023)/1024 << "K)" << \n		stats << "Left bytes...: " << lb << " (" << (lb+1023)/1024 << "K)" << \n		stats << "Left blocks...: " << lc << \n		puts (as string (stats))		release (stats)	end		release allocator	gtk_exit (0)	return 0end//[cf]

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?