Changeset 112

Show
Ignore:
Timestamp:
01/17/2007 00:49:22 (22 months ago)
Author:
why
Message:
  • ext/sand_table/sand_table.c: move Sandwick to Sandbox::Wick and get everything using alloc_sandwick(). Remove sandbox_dup_into.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ext/sand_table/sand_table.c

    r111 r112  
    1717 
    1818static VALUE Qimport, Qinit, Qload, Qenv, Qio, Qreal, Qref, Qall; 
    19 VALUE rb_cSandbox, rb_cSandboxFull, rb_cSandboxSafe, rb_eSandboxException, rb_cSandboxRef, rb_cSandwick; 
     19VALUE rb_cSandbox, rb_cSandboxFull, rb_cSandboxSafe, rb_eSandboxException, rb_cSandboxRef, rb_cSandboxWick; 
    2020static ID s_options; 
    2121 
     
    358358  wick->scope = NULL; 
    359359  wick->dyna_vars = NULL; 
    360  
     360  wick->self = Data_Wrap_Struct(rb_cSandboxWick, mark_sandwick, free_sandwick, wick); 
    361361  rb_gc_register_address(&wick->self); 
    362   wick->self = Data_Wrap_Struct(rb_cSandwick, mark_sandwick, free_sandwick, wick); 
    363362 
    364363  return wick; 
     
    429428  VALUE link; 
    430429{ 
    431   sandwick *wick = ALLOC(sandwick); 
     430  sandwick *wick = alloc_sandwick(); 
    432431  wick->calltype = SANDBOX_ACTION; 
    433432  wick->action = action; 
     
    825824  Data_Get_Struct( self, sandkit, kit ); 
    826825  return kit->oMain; 
    827 } 
    828  
    829 VALUE 
    830 sandbox_dup_into( kit, obj ) 
    831   sandkit *kit; 
    832   VALUE obj; 
    833 { 
    834   return sandbox_run(kit, sandbox_action_wick(rb_marshal_load, rb_marshal_dump(obj, Qnil))); 
    835826} 
    836827 
     
    30042995  Init_kit_real(&base, 0); 
    30052996 
    3006   rb_cSandwick = rb_class_new(rb_cObject); 
    3007  
    30082997  rb_cSandbox = rb_define_module("Sandbox"); 
    30092998  rb_cSandboxFull = rb_define_class_under(rb_cSandbox, "Full", rb_cObject); 
     
    30243013  rb_eSandboxException = rb_define_class_under(rb_cSandbox, "Exception", rb_eException); 
    30253014  rb_cSandboxRef = rb_define_class_under(rb_cSandbox, "Ref", rb_cObject); 
     3015  rb_cSandboxWick = rb_define_class_under(rb_cSandbox, "Wick", rb_cObject); 
    30263016 
    30273017  s_options = rb_intern("@options");