Submitter: Krzysztof Kozminski <kozminski@users.sf.net>
Assignee: <>
Swig seems to generate only the initialization
functions for use
in trusted interpreters, and there seems to be no way to
distinguish unsafe API from safe API. The manuals do
not seem to mention the *_SafeInit functions at all.
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.:
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