summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
author(no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-01-20 04:59:32 +0000
committer(no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-01-20 04:59:32 +0000
commitaeb049c573be4dc24dd20650f40e4777e0f698cf (patch)
tree3b8560cc0838f916b29941274d52133521f42b6d /sample
parentfd1d8cdc09ed86e4a0812120a17ff0d7b04adcaf (diff)
This commit was manufactured by cvs2svn to create branch 'RUBY'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/RUBY@371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r--sample/mine.rb173
-rw-r--r--sample/rename.rb297
2 files changed, 470 insertions, 0 deletions
diff --git a/sample/mine.rb b/sample/mine.rb
new file mode 100644
index 0000000000..b9557d54a2
--- /dev/null
+++ b/sample/mine.rb
@@ -0,0 +1,173 @@
+class Board
+ def clr
+ print "\e[2J"
+ end
+ def pos(x,y)
+ printf "\e[%d;%dH", y+1, x*2+1
+ end
+ def colorstr(id,s)
+ printf "\e[%dm%s\e[0m", id, s
+ end
+ def put(x, y, col, str)
+ pos(x,y); colorstr(43,str)
+ pos(0,@hi); print "$B;D$j(B:",@mc,"/",@total," "
+ pos(x,y)
+ end
+ private :clr, :pos, :colorstr, :put
+ CHR=["$B!&(B","$B#1(B","$B#2(B","$B#3(B","$B#4(B","$B#5(B","$B#6(B","$B#7(B","$B#8(B","$B!z(B","$B!|(B","@@"]
+ COL=[46,43,45] # default,opened,over
+ def initialize(h,w,m)
+ # $B%2!<%`HW$N@8@.(B(h:$B=D!$(Bw:$B2#!$(Bm:$BGzCF$N?t(B)
+ @hi=h; @wi=w; @m=m
+ reset
+ end
+ def reset
+ # $B%2!<%`HW$r(B($B:F(B)$B=i4|2=$9$k(B
+ srand()
+ @cx=0; @cy=0; @mc=@m
+ @over=false
+ @data=Array.new(@hi*@wi)
+ @state=Array.new(@hi*@wi)
+ @total=@hi*@wi
+ @total.times {|i| @data[i]=0}
+ @m.times do
+ loop do
+ j=rand(@total-1)
+ if @data[j] == 0 then
+ @data[j]=1
+ break
+ end
+ end
+ end
+ clr; pos(0,0)
+ @hi.times{|y| pos(0,y); colorstr(COL[0],CHR[0]*@wi)}
+ pos(@cx,@cy)
+ end
+ def mark
+ # $B8=:_$N%+!<%=%k0LCV$K%^!<%/$r$D$1$k(B
+ if @state[@wi*@cy+@cx] != nil then return end
+ @state[@wi*@cy+@cx] = "MARK"
+ @mc=@mc-1;
+ @total=@total-1;
+ put(@cx, @cy, COL[1], CHR[9])
+ end
+ def open(x=@cx,y=@cy)
+ # $B8=:_$N%+!<%=%k0LCV$r%*!<%W%s$K$9$k(B
+ # $BGzCF$,$"$l$P%2!<%`%*!<%P!<(B
+ if @state[@wi*y+x] =="OPEN" then return 0 end
+ if @state[@wi*y+x] == nil then @total=@total-1 end
+ if @state[@wi*y+x] =="MARK" then @mc=@mc+1 end
+ @state[@wi*y+x]="OPEN"
+ if fetch(x,y) == 1 then @over = 1; return end
+ c = count(x,y)
+ put(x, y, COL[1], CHR[c])
+ return 0 if c != 0
+ if x > 0 && y > 0 then open(x-1,y-1) end
+ if y > 0 then open(x, y-1) end
+ if x < @wi-1 && y > 0 then open(x+1,y-1) end
+ if x > 0 then open(x-1,y) end
+ if x < @wi-1 then open(x+1,y) end
+ if x > 0 && y < @hi-1 then open(x-1,y+1) end
+ if y < @hi -1 then open(x,y+1) end
+ if x < @wi-1 && y < @hi-1 then open(x+1,y+1) end
+ pos(@cx,@cy)
+ end
+ def fetch(x,y)
+ # (x,y)$B$N0LCV$NGzCF$N?t(B(0 or 1)$B$rJV$9(B
+ if x < 0 then 0
+ elsif x >= @wi then 0
+ elsif y < 0 then 0
+ elsif y >= @hi then 0
+ else
+ @data[x*@wi+y]
+ end
+ end
+ def count(x,y)
+ # (x,y)$B$KNY@\$9$kGzCF$N?t$rJV$9(B
+ fetch(x-1,y-1)+fetch(x,y-1)+fetch(x+1,y-1)+
+ fetch(x-1,y) + fetch(x+1,y)+
+ fetch(x-1,y+1)+fetch(x,y+1)+fetch(x+1,y+1)
+ end
+ def over(win)
+ # $B%2!<%`$N=*N;(B
+ quit
+ unless win
+ pos(@cx,@cy); print CHR[11]
+ end
+ pos(0,@hi)
+ if win then print "*** YOU WIN !! ***"
+ else print "*** GAME OVER ***"
+ end
+ end
+ def over?
+ # $B%2!<%`$N=*N;%A%'%C%/(B
+ # $B=*N;=hM}$b8F$S=P$9(B
+ remain = (@mc+@total == 0)
+ if @over || remain
+ over(remain)
+ true
+ else
+ false
+ end
+ end
+ def quit
+ # $B%2!<%`$NCfCG(B($B$^$?$O=*N;(B)
+ # $BHWLL$rA4$F8+$;$k(B
+ @hi.times do|y|
+ pos(0,y)
+ @wi.times do|x|
+ colorstr(if @state[y*@wi+x] == "MARK" then COL[1] else COL[2] end,
+ if fetch(x,y)==1 then CHR[10] else CHR[count(x,y)] end)
+ end
+ end
+ end
+ def down
+ # $B%+!<%=%k$r2<$K(B
+ if @cy < @hi-1 then @cy=@cy+1; pos(@cx, @cy) end
+ end
+ def up
+ # $B%+!<%=%k$r>e$K(B
+ if @cy > 0 then @cy=@cy-1; pos(@cx, @cy) end
+ end
+ def left
+ # $B%+!<%=%k$r:8$K(B
+ if @cx > 0 then @cx=@cx-1; pos(@cx, @cy) end
+ end
+ def right
+ # $B%+!<%=%k$r1&$K(B
+ if @cx < @wi-1 then @cx=@cx+1; pos(@cx, @cy) end
+ end
+end
+
+bd=Board.new(10,10,10)
+system("stty raw -echo")
+begin
+ loop do
+ case getc
+ when ?n # new game
+ bd.reset
+ when ?m # mark
+ bd.mark
+ when ?j
+ bd.down
+ when ?k
+ bd.up
+ when ?h
+ bd.left
+ when ?l
+ bd.right
+ when ?\s
+ bd.open
+ when ?q,?\C-c # quit game
+ bd.quit
+ break
+ end
+ if bd.over?
+ if getc == ?q then break end
+ bd.reset
+ end
+ end
+ensure
+ system("stty -raw echo")
+end
+print "\n"
diff --git a/sample/rename.rb b/sample/rename.rb
new file mode 100644
index 0000000000..9abea7e327
--- /dev/null
+++ b/sample/rename.rb
@@ -0,0 +1,297 @@
+#! /usr/local/bin/ruby -p
+gsub!(/\bary_aref\b/,"rb_ary_aref")
+gsub!(/\bary_assoc\b/,"rb_ary_assoc")
+gsub!(/\bary_concat\b/,"rb_ary_concat")
+gsub!(/\bary_delete\b/,"rb_ary_delete")
+gsub!(/\bary_delete_at\b/,"rb_ary_delete_at")
+gsub!(/\bary_each\b/,"rb_ary_each")
+gsub!(/\bary_entry\b/,"rb_ary_entry")
+gsub!(/\bary_freeze\b/,"rb_ary_freeze")
+gsub!(/\bary_includes\b/,"rb_ary_includes")
+gsub!(/\bary_join\b/,"rb_ary_join")
+gsub!(/\bary_new([234])?\b/,"rb_ary_new\\1")
+gsub!(/\bary_plus\b/,"rb_ary_plus")
+gsub!(/\bary_pop\b/,"rb_ary_pop")
+gsub!(/\bary_push\b/,"rb_ary_push")
+gsub!(/\bary_rassoc\b/,"rb_ary_rassoc")
+gsub!(/\bary_reverse\b/,"rb_ary_reverse")
+gsub!(/\bary_shift\b/,"rb_ary_shift")
+gsub!(/\bary_sort\b/,"rb_ary_sort")
+gsub!(/\bary_store\b/,"rb_ary_store")
+gsub!(/\bary_to_s\b/,"rb_ary_to_s")
+gsub!(/\bary_unshift\b/,"rb_ary_unshift")
+gsub!(/\bassoc_new\b/,"rb_assoc_new")
+gsub!(/\bcArray\b/,"rb_cArray")
+gsub!(/\bmemclear\b/,"rb_mem_clear")
+gsub!(/\bbig2dbl\b/,"rb_big2dbl")
+gsub!(/\bbig2long\b/,"rb_big2long")
+gsub!(/\bbig2str\b/,"rb_big2str")
+gsub!(/\bbig2ulong\b/,"rb_big2ulong")
+gsub!(/\bbig_2comp\b/,"rb_big_2comp")
+gsub!(/\bbig_and\b/,"rb_big_and")
+gsub!(/\bbig_clone\b/,"rb_big_clone")
+gsub!(/\bbig_lshift\b/,"rb_big_lshift")
+gsub!(/\bbig_minus\b/,"rb_big_minus")
+gsub!(/\bbig_mul\b/,"rb_big_mul")
+gsub!(/\bbig_norm\b/,"rb_big_norm")
+gsub!(/\bbig_or\b/,"rb_big_or")
+gsub!(/\bbig_plus\b/,"rb_big_plus")
+gsub!(/\bbig_pow\b/,"rb_big_pow")
+gsub!(/\bbig_rand\b/,"rb_big_rand")
+gsub!(/\bbig_xor\b/,"rb_big_xor")
+gsub!(/\bcBignum\b/,"rb_cBignum")
+gsub!(/\bdbl2big\b/,"rb_dbl2big")
+gsub!(/\bint2big\b/,"rb_int2big")
+gsub!(/\bint2inum\b/,"rb_int2inum")
+gsub!(/\bstr2inum\b/,"rb_str2inum")
+gsub!(/\buint2big\b/,"rb_uint2big")
+gsub!(/\buint2inum\b/,"rb_uint2inum")
+gsub!(/\bclass_instance_methods\b/,"rb_class_instance_methods")
+gsub!(/\bclass_new\b/,"rb_class_new")
+gsub!(/\bclass_private_instance_methods\b/,"rb_class_private_instance_methods")
+gsub!(/\bclass_protected_instance_methods\b/,"rb_class_protected_instance_methods")
+gsub!(/\bmod_ancestors\b/,"rb_mod_ancestors")
+gsub!(/\bmod_included_modules\b/,"rb_mod_included_modules")
+gsub!(/\bmodule_new\b/,"rb_module_new")
+gsub!(/\bobj_singleton_methods\b/,"rb_obj_singleton_methods")
+gsub!(/\bsingleton_class\b/,"rb_singleton_class")
+gsub!(/\bmComparable\b/,"rb_mComparable")
+gsub!(/\bcDir\b/,"rb_cDir")
+gsub!(/\benum_length\b/,"rb_enum_length")
+gsub!(/\bmEnumerable\b/,"rb_mEnumerable")
+gsub!(/\bBug\b/,"rb_bug")
+gsub!(/\brb_check_type\b/,"rb_check_type")
+gsub!(/\beArgError\b/,"rb_eArgError")
+gsub!(/\beException\b/,"rb_eException")
+gsub!(/\beFatal\b/,"rb_eFatal")
+gsub!(/\beIndexError\b/,"rb_eIndexError")
+gsub!(/\beInterrupt\b/,"rb_eInterrupt")
+gsub!(/\beLoadError\b/,"rb_eLoadError")
+gsub!(/\beNameError\b/,"rb_eNameError")
+gsub!(/\beNotImpError\b/,"rb_eNotImpError")
+gsub!(/\beRuntimeError\b/,"rb_eRuntimeError")
+gsub!(/\beSecurityError\b/,"rb_eSecurityError")
+gsub!(/\beStandardError\b/,"rb_eStandardError")
+gsub!(/\beSyntaxError\b/,"rb_eSyntaxError")
+gsub!(/\beSystemCallError\b/,"rb_eSystemCallError")
+gsub!(/\beSystemExit\b/,"rb_eSystemExit")
+gsub!(/\beTypeError\b/,"rb_eTypeError")
+gsub!(/\bexc_new([23]?)\b/,"rb_exc_new\\1")
+gsub!(/\bFatal\b/,"rb_fatal")
+gsub!(/\bLoadError\b/,"rb_loaderror")
+gsub!(/\bmErrno\b/,"rb_mErrno")
+gsub!(/\bRaise\b/,"rb_raise")
+gsub!(/\bWarn(ing)?\b/,"rb_warn\\1")
+gsub!(/\bnerrs\b/,"ruby_nerrs")
+gsub!(/\bcProc\b/,"rb_cProc")
+gsub!(/\bcThread\b/,"rb_cThread")
+gsub!(/\brb_check_safe_str\b/,"rb_check_safe_str")
+gsub!(/\bclass_new_instance\b/,"rb_class_new_instance")
+gsub!(/\bdyna_var_asgn\b/,"rb_dvar_asgn")
+gsub!(/\bdyna_var_defined\b/,"rb_dvar_defined")
+gsub!(/\bdyna_var_push\b/,"rb_dvar_push")
+gsub!(/\bdyna_var_ref\b/,"rb_dvar_ref")
+gsub!(/\bf_lambda\b/,"rb_f_lambda")
+gsub!(/\bf_load\b/,";xxx_need_modify;rb_load")
+gsub!(/\bf_require\b/,"rb_f_require")
+gsub!(/\bgc_mark_threads\b/,"rb_gc_mark_threads")
+gsub!(/\biterator_p\b/,"rb_iterator_p")
+gsub!(/\bobj_call_init\b/,"rb_obj_call_init")
+gsub!(/\brb_set_end_proc\b/,"rb_set_end_proc")
+gsub!(/\brb_set_safe_level\b/,"rb_set_safe_level")
+gsub!(/\bthread_alone\b/,"rb_thread_alone")
+gsub!(/\bthread_create\b/,"rb_thread_create")
+gsub!(/\bthread_critical\b/,"rb_thread_critical")
+gsub!(/\bthread_fd_writable\b/,"rb_thread_fd_writable")
+gsub!(/\bthread_interrupt\b/,"rb_thread_interrupt")
+gsub!(/\bthread_schedule\b/,"rb_thread_schedule")
+gsub!(/\bthread_select\b/,"rb_thread_select")
+gsub!(/\bthread_sleep\b/,"rb_thread_sleep")
+gsub!(/\bthread_sleep_forever\b/,"rb_thread_sleep_forever")
+gsub!(/\bthread_trap_eval\b/,"rb_thread_trap_eval")
+gsub!(/\bthread_wait_fd\b/,"rb_thread_wait_fd")
+gsub!(/\bthread_wait_for\b/,"rb_thread_wait_for")
+gsub!(/\bthe_class\b/,"ruby_class")
+gsub!(/\bthe_dyna_vars\b/,"ruby_dyna_vars")
+gsub!(/\bthe_frame\b/,"ruby_frame")
+gsub!(/\bthe_init\b/,"ruby_init")
+gsub!(/\bthe_scope\b/,"ruby_scope")
+gsub!(/\bcFile\b/,"rb_cFile")
+gsub!(/\bfile_open\b/,"rb_file_open")
+gsub!(/\bfile_s_expand_path\b/,"rb_file_s_expand_path")
+gsub!(/\bmFileTest\b/,"rb_mFileTest")
+gsub!(/\bdata_object_alloc\b/,"rb_data_object_alloc")
+gsub!(/\bgc_call_finalizer_at_exit\b/,"rb_gc_call_finalizer_at_exit")
+gsub!(/\bgc_force_recycle\b/,"rb_gc_force_recycle")
+gsub!(/\bgc_gc\b/,"rb_gc")
+gsub!(/\bgc_mark\b/,"rb_gc_mark")
+gsub!(/\bgc_stack_start\b/,"rb_gc_stack_start")
+gsub!(/\bmGC\b/,"rb_mGC")
+gsub!(/\bcHash\b/,"rb_cHash")
+gsub!(/\benv_path_tainted\b/,"rb_env_path_tainted")
+gsub!(/\bhash_aref\b/,"rb_hash_aref")
+gsub!(/\bhash_aset\b/,"rb_hash_aset")
+gsub!(/\bhash_freeze\b/,"rb_hash_freeze")
+gsub!(/\bhash_new\b/,"rb_hash_new")
+gsub!(/\bcIO\b/,"rb_cIO")
+gsub!(/\beEOFError\b/,"rb_eEOFError")
+gsub!(/\beIOError\b/,"rb_eIOError")
+gsub!(/\beof_error\b/,"rb_eof_error")
+gsub!(/\bf_gets\b/,"rb_f_gets")
+gsub!(/\bio_binmode\b/,"rb_io_binmode")
+gsub!(/\bio_check_closed\b/,"rb_io_check_closed")
+gsub!(/\bio_check_readable\b/,"rb_io_check_readable")
+gsub!(/\bio_check_writable\b/,"rb_io_check_writable")
+gsub!(/\bio_close\b/,"rb_io_close")
+gsub!(/\bio_fptr_finalize\b/,"rb_io_fptr_finalize")
+gsub!(/\bio_getc\b/,"rb_io_getc")
+gsub!(/\bio_gets\b/,"rb_io_gets")
+gsub!(/\bio_gets_method\b/,"rb_io_gets_method")
+gsub!(/\bio_mode_flags\b/,"rb_io_mode_flags")
+gsub!(/\bio_reopen\b/,"rb_io_reopen")
+gsub!(/\bio_unbuffered\b/,"rb_io_unbuffered")
+gsub!(/\bio_ungetc\b/,"rb_io_ungetc")
+gsub!(/\bio_write\b/,"rb_io_write")
+gsub!(/\bRS_default\b/,"ruby_default_rs")
+gsub!(/\bOFS\b/,"ruby_output_fs")
+gsub!(/\bORS\b/,"ruby_output_rs")
+gsub!(/\bFS\b/,"ruby_fs")
+gsub!(/\bRS\b/,"ruby_rs")
+gsub!(/\bmMath\b/,"rb_mMath")
+gsub!(/\bcFixnum\b/,"rb_cFixnum")
+gsub!(/\bcFloat\b/,"rb_cFloat")
+gsub!(/\bcInteger\b/,"rb_cInteger")
+gsub!(/\bcNumeric\b/,"rb_cNumeric")
+gsub!(/\beZeroDiv\b/,"rb_eZeroDiv")
+gsub!(/\bfix2int\b/,"rb_fix2int")
+gsub!(/\bfix2str\b/,"rb_fix2str")
+gsub!(/\bfix_upto\b/,"rb_fix_upto")
+gsub!(/\bfloat_new\b/,"rb_float_new")
+gsub!(/\bnum2fix\b/,"rb_num2fix")
+gsub!(/\bnum2int\b/,"rb_num2int")
+gsub!(/\bnum2long\b/,"rb_num2long")
+gsub!(/\bnum2ulong\b/,"rb_num2ulong")
+gsub!(/\bnum_coerce_bin\b/,"rb_num_coerce_bin")
+gsub!(/\bnum_zerodiv\b/,"rb_num_zerodiv")
+gsub!(/\bany_to_s\b/,"rb_any_to_s")
+gsub!(/\bcClass\b/,"rb_cClass")
+gsub!(/\bcData\b/,"rb_cData")
+gsub!(/\bcFalseClass\b/,"rb_cFalseClass")
+gsub!(/\bcModule\b/,"rb_cModule")
+gsub!(/\bcNilClass\b/,"rb_cNilClass")
+gsub!(/\bcObject\b/,"rb_cObject")
+gsub!(/\bcTrueClass\b/,"rb_cTrueClass")
+gsub!(/\bmKernel\b/,"rb_mKernel")
+gsub!(/\bnum2dbl\b/,"rb_num2dbl")
+gsub!(/\bobj_alloc\b/,"rb_obj_alloc")
+gsub!(/\bobj_equal\b/,"rb_obj_equal")
+gsub!(/\bobj_is_instance_of\b/,"rb_obj_is_instance_of")
+gsub!(/\bobj_is_kind_of\b/,"rb_obj_is_kind_of")
+gsub!(/\bstr2cstr\b/,"rb_str2cstr")
+gsub!(/\bTopSelf\b/,"rb_top_self")
+gsub!(/\bbackref_get\b/,"rb_backref_get")
+gsub!(/\bbackref_set\b/,"rb_backref_set")
+gsub!(/\bcompile_file\b/,"rb_compile_file")
+gsub!(/\bcompile_string\b/,"rb_compile_string")
+gsub!(/\bid_attrset\b/,"rb_id_attrset")
+gsub!(/\bis_const_id\b/,"rb_is_const_id")
+gsub!(/\bis_instance_id\b/,"rb_is_instance_id")
+gsub!(/\blastline_get\b/,"rb_lastline_get")
+gsub!(/\blastline_set\b/,"rb_lastline_set")
+gsub!(/\bnode_newnode\b/,"rb_node_newnode")
+gsub!(/\byyappend_print\b/,"rb_parser_append_print")
+gsub!(/\byywhile_loop\b/,"rb_parser_while_loop")
+gsub!(/\brb_reserved_word\b/,"rb_reserved_word")
+gsub!(/\bsourcefile\b/,"ruby_sourcefile")
+gsub!(/\bsourceline\b/,"ruby_sourceline")
+gsub!(/\bmProcess\b/,"rb_mProcess")
+gsub!(/\bcRange\b/,"rb_cRange")
+gsub!(/\brange_beg_end\b/,"rb_range_beg_end")
+gsub!(/\brange_new\b/,"rb_range_new")
+gsub!(/\bcRegexp\b/,"rb_cRegexp")
+gsub!(/\bignorecase\b/,"rb_ignorecase")
+gsub!(/\breg_free\b/,"rb_reg_free")
+gsub!(/\breg_last_match\b/,"rb_reg_last_match")
+gsub!(/\breg_match\b/,"rb_reg_match")
+gsub!(/\breg_new\b/,"rb_reg_new")
+gsub!(/\breg_nth_defined\b/,"rb_reg_nth_defined")
+gsub!(/\breg_nth_match\b/,"rb_reg_nth_match")
+gsub!(/\breg_options\b/,"rb_reg_options")
+gsub!(/\breg_prepare_re\b/,"rb_reg_prepare_re")
+gsub!(/\breg_regcomp\b/,"rb_reg_regcomp")
+gsub!(/\breg_regsub\b/,"rb_reg_regsub")
+gsub!(/\breg_search\b/,"rb_reg_search")
+gsub!(/\bstr_cicmp\b/,"rb_str_cicmp")
+gsub!(/\bf_kill\b/,"rb_f_kill")
+gsub!(/\bgc_mark_trap_list\b/,"rb_gc_mark_trap_list")
+gsub!(/\bprohibit_interrupt\b/,"rb_prohibit_interrupt")
+gsub!(/\btrap_exec\b/,"rb_trap_exec")
+gsub!(/\btrap_exit\b/,"rb_trap_exit")
+gsub!(/\btrap_immediate\b/,"rb_trap_immediate")
+gsub!(/\btrap_pending\b/,"rb_trap_pending")
+gsub!(/\btrap_restore_mask\b/,"rb_trap_restore_mask")
+gsub!(/\bposix_signal\b/,"ruby_posix_signal")
+gsub!(/\bf_sprintf\b/,"rb_f_sprintf")
+gsub!(/\bcString\b/,"rb_cString")
+gsub!(/\bobj_as_string\b/,"rb_obj_as_string")
+gsub!(/\bstr_cat\b/,"rb_str_cat")
+gsub!(/\bstr_cmp\b/,"rb_str_cmp")
+gsub!(/\bstr_concat\b/,"rb_str_concat")
+gsub!(/\bstr_dup\b/,"rb_str_dup")
+gsub!(/\bstr_dup_frozen\b/,"rb_str_dup_frozen")
+gsub!(/\bstr_freeze\b/,"rb_str_freeze")
+gsub!(/\bstr_hash\b/,"rb_str_hash")
+gsub!(/\bstr_inspect\b/,"rb_str_inspect")
+gsub!(/\bstr_modify\b/,"rb_str_modify")
+gsub!(/\bstr_new([234]?)\b/,"rb_str_new\\1")
+gsub!(/\bstr_plus\b/,"rb_str_plus")
+gsub!(/\bstr_resize\b/,"rb_str_resize")
+gsub!(/\bstr_split\b/,"rb_str_split")
+gsub!(/\bstr_substr\b/,"rb_str_substr")
+gsub!(/\bstr_taint\b/,"rb_str_taint")
+gsub!(/\bstr_tainted\b/,"rb_str_tainted")
+gsub!(/\bstr_times\b/,"rb_str_times")
+gsub!(/\bstr_to_str\b/,"rb_str_to_str")
+gsub!(/\bstr_upto\b/,"rb_str_upto")
+gsub!(/\bcStruct\b/,"rb_cStruct")
+gsub!(/\bstruct_alloc\b/,"rb_struct_alloc")
+gsub!(/\bstruct_aref\b/,"rb_struct_aref")
+gsub!(/\bstruct_aset\b/,"rb_struct_aset")
+gsub!(/\bstruct_define\b/,"rb_struct_define")
+gsub!(/\bstruct_getmember\b/,"rb_struct_getmember")
+gsub!(/\bstruct_new\b/,"rb_struct_new")
+gsub!(/\bcTime\b/,"rb_cTime")
+gsub!(/\btime_new\b/,"rb_time_new")
+gsub!(/\btime_timeval\b/,"rb_time_timeval")
+gsub!(/\bscan_hex\b/,"ruby_scan_hex")
+gsub!(/\bscan_oct\b/,"ruby_scan_oct")
+gsub!(/\bconst_defined\b/,"rb_const_defined")
+gsub!(/\bconst_defined_at\b/,"rb_const_defined_at")
+gsub!(/\bconst_get\b/,"rb_const_get")
+gsub!(/\bconst_get_at\b/,"rb_const_get_at")
+gsub!(/\bconst_set\b/,"rb_const_set")
+gsub!(/\bf_autoload\b/,"rb_f_autoload")
+gsub!(/\bf_global_variables\b/,"rb_f_global_variables")
+gsub!(/\bf_trace_var\b/,"rb_f_trace_var")
+gsub!(/\bf_untrace_var\b/,"rb_f_untrace_var")
+gsub!(/\bmod_const_at\b/,"rb_mod_const_at")
+gsub!(/\bmod_const_of\b/,"rb_mod_const_of")
+gsub!(/\bmod_constants\b/,"rb_mod_constants")
+gsub!(/\bmod_name\b/,"rb_mod_name")
+gsub!(/\bmod_remove_const\b/,"rb_mod_remove_const")
+gsub!(/\bobj_instance_variables\b/,"rb_obj_instance_variables")
+gsub!(/\bobj_remove_instance_variable\b/,"rb_obj_remove_instance_variable")
+gsub!(/\bshow_copyright\b/,"ruby_show_copyright")
+gsub!(/\bshow_version\b/,"ruby_show_version")
+gsub!(/\bdebug\b/,"rb_debug")
+gsub!(/\bverbose\b/,"rb_verbose")
+gsub!(/\bFail\(/,"rb_raise(rb_eRuntimeError, ")
+gsub!(/\bArgError\(/,"rb_raise(rb_eArgError, ")
+gsub!(/\bTypeError\(/,"rb_raise(rb_eTypeError, ")
+gsub!(/\bNameError\(/,"rb_raise(rb_eNameError, ")
+gsub!(/\bIndexError\(/,"rb_raise(rb_eIndexError, ")
+gsub!(/\bError\b/,"rb_compile_error")
+gsub!(/\bErrorAppend\b/,"rb_compile_error_append")
+gsub!(/\bTRUE\b/,"Qtrue")
+gsub!(/\bFALSE\b/,"Qfalse")
+gsub!(/\berrinfo\b/,"rb_errinfo")