kkaempf / swig-issues

Issues from SWIG (testing)
0 stars 0 forks source link

Enhancement request: safe interpreter init in Tcl #106

Open SwigAtSF opened 11 years ago

SwigAtSF commented 11 years ago

It would be nice to be able to distinguish Tcl APIs that should be present in safe interpreters versus those to be present only in trusted interpreters. Two implemetation possibilities occur to me:

1) Specifying APIs to be available only in trusted (and not in safe) interpreters via some construct in Swig config files, e,g.:

%trusted { void remove_home_directory(char *userid); }

2) Using #pragma in the source code (probably a better idea, since it avoids code duplication), e.g:

pragma SWIG trusted

void remove_home_directory(char *userid);

pragma SWIG safe

where the scope of the pragma effect would extend from the occurrence to the next occurrence or to the end of the file.

KK