⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mkopts.tcl

📁 sqlite-3.4.1,嵌入式数据库.是一个功能强大的开源数据库,给学习和研发以及小型公司的发展带来了全所未有的好处.
💻 TCL
字号:
#!/usr/bin/tclsh## This script is used to generate the array of strings and the enum# that appear at the beginning of the C code implementation of a# a TCL command and that define the available subcommands for that# TCL command.set prefix {}while {![eof stdin]} {  set line [gets stdin]  if {$line==""} continue  regsub -all "\[ \t\n,\]+" [string trim $line] { } line  foreach token [split $line { }] {    if {![regexp {(([a-zA-Z]+)_)?([_a-zA-Z]+)} $token all px p2 name]} continue    lappend namelist [string tolower $name]    if {$px!=""} {set prefix $p2}  }}puts "  static const char *${prefix}_strs\[\] = \173"set col 0proc put_item x {  global col  if {$col==0} {puts -nonewline "   "}  if {$col<2} {    puts -nonewline [format " %-21s" $x]    incr col  } else {    puts $x    set col 0  }}proc finalize {} {  global col  if {$col>0} {puts {}}  set col 0}foreach name [lsort $namelist] {  put_item \"$name\",}put_item 0finalizeputs "  \175;"puts "  enum ${prefix}_enum \173"foreach name [lsort $namelist] {  regsub -all {@} $name {} name  put_item ${prefix}_[string toupper $name],}finalizeputs "  \175;"

⌨️ 快捷键说明

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