Changeset 99

Show
Ignore:
Timestamp:
09/24/2006 16:07:16 (2 years ago)
Author:
mental
Message:
  • ext/sand_table/sand_table.h: prototype for sandbox_perform()
  • ext/sand_table/sand_table.c: add sandbox_perform(), to run C code under a specific sandbox
Location:
trunk/ext/sand_table
Files:
2 modified

Legend:

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

    r98 r99  
    434434  go->argv = NULL; 
    435435  go->kit = kit; 
     436} 
     437 
     438VALUE 
     439sandbox_perform(kit, action, arg) 
     440  sandkit *kit; 
     441  VALUE (*action)(); 
     442  VALUE arg; 
     443{ 
     444  go_cart go; 
     445  sandbox_begin(kit, &go); 
     446  return rb_ensure(action, arg, sandbox_finish, (VALUE)&go); 
    436447} 
    437448 
  • trunk/ext/sand_table/sand_table.h

    r91 r99  
    175175 
    176176VALUE sandbox_module_new(sandkit *); 
     177VALUE sandbox_perform(sandkit *, VALUE (*)(), VALUE); 
    177178VALUE sandbox_dummy(); 
    178179VALUE sandbox_define_module_id(sandkit *, ID);