diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-03-17 22:09:20 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-03-17 22:09:20 -0700 |
commit | 1417fd8d7b07bba0ffe574d42e3c787ce067f9c5 (patch) | |
tree | a01dc6f5515fcac5c7382d5ae6fa7e7c715847b2 /lib.h | |
parent | 3f4586d1ee813ecd23456956d5f2c7f4759a5922 (diff) | |
download | txr-1417fd8d7b07bba0ffe574d42e3c787ce067f9c5.tar.gz txr-1417fd8d7b07bba0ffe574d42e3c787ce067f9c5.tar.bz2 txr-1417fd8d7b07bba0ffe574d42e3c787ce067f9c5.zip |
Sandboxing support via *package-alist*.
* eval.c (eval_init): Register *package-alist* variable,
taking on the contents of the packages variable.
* lib.c (package_alist_s): New symbol variable.
(make_package, packagep, find_package, package_alist); Work
with dynamic package alist variable via cur_package_alist_loc
macro.
(get_current_package_alist_loc): New function.
* lib.h (cur_package_alist_loc): New macro.
(packages, package_alist_s, get_current_package_alist_loc):
Declared.
* txr.1: Documented *package-alist* along with notes about
sandboxing. Documented that the package-alist function is
now obsolescent.
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -417,8 +417,10 @@ INLINE val chr(wchar_t ch) #define user_package user_package_var #define system_package system_package_var #define cur_package (get_current_package()) +#define cur_package_alist_loc (get_current_package_alist_loc()) -extern val system_package_var, keyword_package_var, user_package_var; +extern val packages, system_package_var, keyword_package_var, user_package_var; +extern val package_alist_s; extern val package_s, keyword_package_s, system_package_s, user_package_s; extern val null_s, t, cons_s, str_s, chr_s, fixnum_sl; extern val sym_s, pkg_s, fun_s, vec_s; @@ -811,6 +813,7 @@ val symbol_name(val sym); val symbol_package(val sym); val keywordp(val sym); val get_current_package(void); +loc get_current_package_alist_loc(void); val func_f0(val, val (*fun)(val env)); val func_f1(val, val (*fun)(val env, val)); val func_f2(val, val (*fun)(val env, val, val)); |