| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (weave_while): Pass third arg to remq as nil.
(eval_init): Update registrations of remq, remql and
remqual.
* lib.c (remq, remql, remqual): Implement key function
argument.
* lib.h (remq, remql, remqual): Declarations updated.
* sysif.c (at_exit_call): Pass third arg to remq as nil.
* debug.c (debug): Pass third argument to remqual as nil.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Detect utsname and uname.
* sysif.c (utsname_s, sysname_s, nodename_s, release_s,
version_s, machine_s): New symbol variables.
(uname_wrap): New static function.
(sysif_init): Initialize new symbol variables.
Instantiate utsname struct type. Register uname_wrap
as uname intrinsic function.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Let's use our usleep_wrap function which uses nanosleep.
The old sleep can interact with SIGALRM.
* stream.c (tail_calc): Calculate microseconds instead
of seconds.
(sleep): Wrapper for Windows gone.
(tail_strategy): Rename sec variable to usec. Use
usleep_wrap instead of sleep.
* sysif.c (usleep_wrap): Change to extern.
* sysif.h (usleep_wrap): Declaration updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (at_exit_list): New static variable.
(at_exit_call, at_exit_do_not_call): New functions.
(at_exit_handler): New static function.
(sysif_init): GC-protect at_exit_list.
Register at_exit_handler with C atexit function.
Register intrinsic functions at-exit-call and
at-exit-do-not-call.
* sysif.h (at_exit_call, at_exit_do_not_call): Registered.
* txr.1: Documented.
|
|
|
|
|
|
| |
* sysif.c (drop_privilege): If bailing due to a privilege
management problem, use panic with a descriptive message
instead of a plain abort.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This helps with setuid hash bang scripting on Mac OS,
and other plaforms where the interpreter executed out
of a hash bang script runs with orinary privilege,
even if marked setuid.
* sysif.c (exec_wrap): Static function turns extern.
* sysif.h (exec-wrap): Declared.
* txr.1: Documented --reexec. Added notes about setuid under
Hash Bang Support.
* txr.c (help): List --reexec option.
(txr_main): Implement --reexec option.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TXR now notices that it's running setgid, and
implements setgid logic for scripts.
* sysif.c (orig_egid, real_gid, is_setgid): New static
variables.
(repress_privilege): Treat real and effective
group ID similarly to user ID. Save them in global
variables, and set the is_setgid flag.
(drop_privilege): Drop setgid privilege similarly
to setuid. Operate selectively: if neither setuid
nor setgid is in effect, do nothing, but if just
one is in effect, don't do anything for the other.
(simulate_setuid): Function renamed to simulate_setuid_setgid.
A small change is made here: if the fstat fails, just drop
privilege, don't abort. Implement setgid operation
independently of setuid. The is_setgid and is_setuid
flags are manipulated here now to get the drop_privileges
function to selectively drop setuid if we are running
a script which is only segid, or drop setgid if we are running
a setuid only script.
* sysif.h (simulate_setuid): Declaration name change to
simulate_setuid_setgid.
* txr.c (txr_main): Follow rename of simulate_setuid.
* txr.1: SETUID OPERATION section changed to SETUID/SETGID
operation, and setgid description worked into the text.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (repress_privilege): Eliminate redundant
getuid call.
(drop_privilege): On some platforms,
setuid(getuid()) will not drop setuid non-root privilege. This
is fixed by using setresuid, if we have it, which we do on
Linux. On platforms where we don't have setresuid,
we try setuid(getuid()). Then after that if we are able
to change our effective user ID to the one we dropped,
we conclude that it didn't work and abort.
(simulate_setuid): Call drop_privilege instead of
repeating the naive privilege-dropping logic.
Check the result of seteuid; if it fails, then
drop privilege! Otherwise a txr that is setuid bob
will continue running as bob, if it fails to enact
setuid on a script owned by alice.
* txr.1: Rewrite SETUID OPERATION section in an attempt
to clarify the wording, fix formatting issues, and
describe the current implemenation of privilege dropping.
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Test for these functions.
* sysif.c (getresuid_wrap, getresgid_wrap, setresuid_wrap,
setresgid_wrap): New static function.
(sysif_init): Registered getresuid, setresgid, setresuid and
setresgid intrinsics.
* txr.1: Documented all four functions.
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Test for setgroups. New HAVE_SETGROUPS
preprocessor symbol for config/config.h.
* sysif.c (setgroups_wrap): New static function.
(sysif_init): Register intrinsic setgroups function.
* txr.1: Documented setgroups. Rearranged sections
so getgroups and setgroups descriptions are consecutive.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* glob.c (glob_wrap): Perform argument conversions
that might throw before allocating UTF-8 string.
* parser.y (text): In the action for SPACE, the lexeme
is not needed so free($1) right away. If regex_compile
were to throw an exception, that lexeme will leak.
* socket.c (getaddrinfo_wrap): Harden against leakage of
node_u8 and service_u8 strings with an unwind block.
For instance, the hints structure could contain
bad values which cause addrinfo_in to throw.
* stream.c (make_string_byte_input_stream): Perform
possibly throwing argument conversions before allocating
resources.
* sysif.c (mkdir_wrap, mknod_wrap, chmod_wrap, symlink_wrap,
link_wrap, setenv_wrap, crypt_wrap): Likewise.
* syslog.c (openlog_wrap, syslog_wrapv): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: new test for fnmatch, introducing HAVE_FNMATCH
configure variable into config/config.h.
* sysif.c (fnmatch_wrap): New function.
(sysif_init): Register intrinsic variables fnm-pathname, fnm-noescape,
fnm-period, fnm-leading-dir, fnm-casefold and fnm-extmatch.
Register intrinsic function fnmatch.
* txr.1: Documented.
|
|
|
|
|
|
| |
* sysif.c (stat_to_struct): Change to external linkage.
* sysif.h (stat_to_struct): Declared.
|
|
|
|
|
|
|
| |
* sysif.c (setenv_wrap): We must use default_arg_strict,
not default_arg, because default_arg treats a nil value
as missing. We do not want to replace an explicit nil
with the default t.
|
|
|
|
|
|
|
| |
* sysif.c (setenv_wrap): If value is nil, and overwrite is
missing or t, call unsetenv.
* txr.1: Documented.
|
|
|
|
|
| |
* sysif.c (repress_called, is_setuid): Change to unsigned int,
so comparison with RC_MAGIC constant doesn't elicit warning
|
|
|
|
|
|
|
| |
* sysif.c (umask_wrap): New function.
(sysif_init): Register umask intrinsic.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (orig_euid, real_uid, repress_called, is_setuid):
New static variables.
(repress_privilege, drop_privilage, simulate_setuid):
New functions.
(RC_MAGIC): New preprocessor symbol.
* sysif.c (repress_privilege, drop_privilage,
simulate_setuid): Declared.
* txr.c (txr_main): Call repress_privilege to check
and remember whether we are in setuid mode, and temporarily
drop the effective uid to the real one.
(txr_main): Permanently drop privileges in all cases except
script execution. In script execution cases, go through
simulate_setuid to either set or preserve the effective
user ID, or else drop privs.
* txr.1: Documented setuid operation in new section.
|
|
|
|
|
| |
* sysif.c (make_hash): Fix incorrect treatment of env values
which contain equal signs, due to careless use of split_str.
|
|
|
|
|
|
|
|
|
|
| |
* configure: Check for availability of crypt,
and what library must be used.
* sysif.c (crypt_wrap): New static function.
(sysif_init): Register crypt intrinsic.
* txr.1: Documented crypt.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* LICENSE, METALICENSE, Makefile, args.c, args.h, arith.c,
arith.h, cadr.c, cadr.h, combi.c, combi.h, configure,
debug.c, debug.h, eval.c, eval.h, filter.c, filter.h, gc.c,
gc.h, glob.c, glob.h, hash.c, hash.h, jmp.S, lib.c, lib.h,
lisplib.c, lisplib.h, match.c, match.h, parser.c, parser.h,
parser.l, parser.y, rand.c, rand.h, regex.c, regex.h,
share/txr/stdlib/cadr.tl, share/txr/stdlib/except.tl,
share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl,
share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl,
share/txr/stdlib/struct.tl, share/txr/stdlib/txr-case.tl,
share/txr/stdlib/type.tl, share/txr/stdlib/with-resources.tl,
share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl,
signal.c, signal.h, stream.c, stream.h, struct.c, struct.h,
sysif.c, sysif.h, syslog.c, syslog.h, txr.1, txr.c, txr.h,
unwind.c, unwind.h, utf8.c, utf8.h: Add 2016 copyright.
* linenoise/LICENSE, linenoise/linenoise.c,
linenoise/linenoise.h: Bump one principal author's copyright
from 2014 to 2015. The code is based on a snapshot of 2015
upstream work.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (name_s): Defined here now.
(obj_init): name_s initialized here.
* lib.h (name_s): Declared.
* match.c (name_s): Definition removed.
(syms_init): Initialization of name_s removed.
* sysif.c (name_s): Definition removed.
(sysif_init): Initialization of name_s removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Structs can now have code which executes after an object is
initialized, which is useful for doing work like registering
objects in global lists and whatever, when those actions need
access to the initialized slots of the object.
* share/txr/stdlib/struct.tl (defstruct): Handle :posinit
syntax, by generating lambda as eighth argument of sys:make-struct
call.
* struct.c (struct struct_type): New member, postinitfun.
(struct_init): Adjust registrations of make_struct_type
to account for new parameter. The user visible
make-struct-type is registered as having one optional
argument, for backward compat.
(make_struct_type): New argument, postinitfun. Store this
in the structure. For backward compatibility, the argument
is defaulted.
(struct_type_mark): Mark the new postinitfun member.
(call_postinitfun_chain): New static function.
(make_struct, lazy_struct_init): Call call_postinitfun_chain
after slots are initialized, and after the boa function is
called.
* struct.h (make_struct_type): Declaration updated.
* lib.c (time_init): Pass eighth argument to make_struct type.
* sysif.c (sysif_init): Likewise.
* unwind.c (uw_late_init): Likewise.
* tests/012/struct.tl: Update defstruct expansion test case.
* txr.1: Document new argument of make-struct-type,
and clarify ordering of initfun with regard to
other actions. Likewise, document :postinit, and clarify
ordering of :init actions with regard to other actions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.h (struct strm_ops): seek operation's second argument
is now just a val.
* stream.c (unimpl_seek, null_seek): Second argument is a val,
not cnum, to conform with function pointer in stream
structure.
(stdio_seek): Accept offset as val, which could be a fixnum
or bignum. Use new stdio_ftell and stdio_fseek functions
so large values work.
(seek_stream): No need to convert offset argument to cnum;
pass the val directly to seek virtual function.
* sysif.c (off_t_num, num_off_t, stdio_ftell,
stdio_fseek): New functions.
* sysif.h (OFF_T_MAX, OFF_T_MIN): New preprocessor symbols.
(off_t_num, num_off_t, stdio_ftell, stdio_fseek): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* debug.c (show_bindings): Use ~d for level, so as
not to be influenced by *print-base*.
(debug): Use ~d for line numbers.
* lib.c (gensym): Use ~d conversion specifier
for formatting gensym counter into symbol name.
* match.c (LOG_MISMATCH, LOG_MATCH): Use ~d for
line number references.
(h_skip, h_coll, h_fun, h_chr, match_line_completely, v_skip,
v_fuzz, v_gather, v_collect, v_output, v_filter, v_fun,
v_assert, v_load, v_line, h_assert, open_data_source): Use ~d
for line refs, number of iterations, errno values.
* parser.c (repl): Use ~d for prompt line numbers,
numbered variables and the expr-<n> string in error
messages.
* parser.l (yyerrorf, source_loc_str): Use ~d for line
numbers.
* stream.c (print_base_s): New symbol variable.
(formatv): Implement *print-base*.
(stdio_maybe_read_error, stdio_maybe_error, stdio_close,
pipe_close, open_directory, open_file, open_fileno, open_tail,
open_process, run, remove_path): Use ~d for errno values.
(stream_init): Initialize print_base_s and register
*print-base* special variable.
sysif.c (mkdir_wrap, ensure_dir, getcwd_wrap, mknod_wrap,
chmod_wrap, symlink_wrap, link_wrap, readlink_wrap,
excec_wrap, stat_impl, pipe_wrap, poll_wrap, getgroups_wrap,
setuid_wrap, seteuid_wrap, setgid_wrap): Use ~d for
errno values and system function results.
* txr.1: Documented *print-base* and ~d conversion specifier.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TXR is moving to custom assembly-language routines.
This is mainly motivated by a very dubious thing done in the
GNU C Library setjmp and longjmp in the name of security.
Evidently, glibc's setjmp "mangles" certain pointer values
which are stored into the jmp_buf buffer. It's been that way
since 2005, evidently. This means that, firstly, all along,
the use of setjmp in gc.c to get registers into a buffer so
they can be scanned has not actually worked properly. More
importantly, this pointer mangling in setjmp and longjmp is
very hostile to a stack copying implementation of delimited
continuations. The reason is that continuations contain
jmp_buf buffers, which get relocated in the process of
capturing and reviving a continuation. Any pointers in a
jmp_buf which point into the captured stack segment have to be
fixed up to point into the relocated location. Mangled
pointers make this difficult, requiring hacks which are
specific to glibc and the machine architecture. We might as
well implement a clean, well-behaved setjmp and longjmp.
* Makefile (jmp.o): New object file.
(dbg/%.o, opt/%.o): New rules for .S prerequisites.
* args.c, arith.c, cadr.c, combi.c, cadr.c, combi.c, debug.c,
eval.c, filter.c, glob.c, hash.c, lib.c, match.c, parser.c,
rand.c, regex.c, signal.c, stream.c, struct.c, sysif.c,
syslog.c, txr.c, unwind.c, utf8.c: Removed <setjmp.h>
include.
* gc.c: Switch to struct jmp and jmp_save, instead
of jmp_buf and setjmp.
* jmp.S: New source file.
* signal.h (struct jmp): New struct type.
(jmp_save, jmp_restore): New function declarations
denoting assembly language routines in jmp.S.
(extended_jmp_buf): Uses struct jmp instead of
setjmp.
(extended_setjmp): Use jmp_save instead of setjmp.
(extended_longjmp): Use jmp_restore instead of
longjmp.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (sys:bad-slot-syntax): New helper function.
(defstruct): Macro revamped with new slot specifier syntax for
writing static slots as well as methods.
* struct.c (STATIC_SLOT_BASE): New preprocessor symbol.
(struct struct_type): New members, nstslots, stinitfun, stslot.
(make_struct_type_compat): New static function.
(struct_init): Register make-struct-type to make_struct_type_compat
if compatibility is 117 or lower.
Register new intrinsics static-slot, static-slot-set, call-super-method,
call-super-fun, slot-p and static-slot-p.
(call_stinitfun_chain): New static function.
(make_struct_type): Two new arguments for specifying static slots and
an initialization function for them. Logic added for setting
up static slots and handling inheritance.
(struct_type_destroy): New static function.
(struct_type_mark): Mark the new stinitfun member of struct type.
Also iterate over the static slots in the new stslot array and
mark them.
(lookup_slot): Altered to return a loc instead of a raw pointer,
and also to accept the instance object as a member.
Now resolves static slots: it can return a loc which references
a static slot in the structure type, or an instance slot in
the structure.
(lookup_static_slot): New static function.
(slot, slotset): Implementation adjusted due to new lookup_slot interface.
(static_slot, static_slot_set, slot_p, static_slot_p): New functions.
(call_super_method, call_super_fun): New static functions.
(struct_inst_print): This function can no longer assume that the slots
list lines up with the array of slots, since it contains a mixture of
static and instance slots. Earnest slot lookup has to be performed.
(struct_type_ops): Point the destroy function to struct_type_destroy
instead of cobj_destroy_free_op. A structure type now has an array
of static slots to free.
* struct.h (make_struct_type): Declaration updated.
(static_slot, static_slot_set, slot_p, static_slot_p): Declared.
* lib.c (time_init): Update call to make_struct_type with new
arguments.
* sysif.c (sysif_init): Likewise.
* tests/012/struct.tl: Update defstruct macro expansion test.
* txr.1: Documented static slots and new functions.
|
|
|
|
|
| |
* sysif.c (poll_wrap): We must coerce mem_t * return value
of chk_calloc, not convert.
|
|
|
|
|
|
|
|
| |
* sysif.c (statf): Linkage changed to
external. Also, fixed wrong name being passed
down to stat_impl.
* sysif.h (statf): Declaration updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure (have_grgid): New variable.
New tests added for getgrent and the rest.
(HAVE_GRGID, HAVE_GRGID_R): New preprocessor symbols
conditionally deposited into config/config.h.
* sysif.c (group_s, mem_s): New global symbol variables.
(setgrent_wrap, endgrent_wrap, fill_group, make_grstruct,
get_grent_wrap, getgrgid_wrap, getgrnam_wrap): New static
functions.
(sysif_init): New global symbol variables initialized.
New group struct type instantiated.
Intrinsic functions setgrent, endgrent, getgrent,
getgrgid and getgrnam registered.
* txr.1: Documented group structure and functions.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (load_rcfile): New function.
(repl): Compute profile file name and try to load it before
entering loop.
* sysif.c (statp): Linkage becomes external.
* sysif.h (statp): Declaration updated.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (repl): If a HOME environment variable
exists, then load the .txr_history file from the user's home
directory and save it when exiting.
* sysif.c (getenv_wrap): Static function changed to extern.
* sysif.h (getenv_wrap): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Detect getpwuid, getpwuid_r and others.
* sysif.c (passwd_s, name_s, gecos_s, dir_s, shell_s): New
symbol variables.
(setpwent_wrap, endpwent_wrap, fill_passwd, make_pwstruct,
getpwent_wrap, getpwuid_wrap, getpwnam_wrap): New static
functions.
(sysif_init): Initialize new symbol variables. Create
passwd structure type. Register setpwent, endpwent,
getpwent, getpwuid and getpwnam intrinsics.
* txr.1: Documented passwd structure and functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (init): Move hash_init and struct init
before sysif_init.
* share/txr/stdlib/path-test.tl (sys:path-test-mode,
path-mine-p, path-my-group-p, sys:path-access,
path-newer, path-examine): Convert to struct return
of stat functions.
* stream.c (dev_k, ino_k, mode_k, nlink_k, uid_k,
gid_k, rdev_k, size_k, blksize_k, blocks_k, atime_k,
mtime_k, ctime_k): Global variable definitions removed from here.
(stream_init): Initializations of moved global
variables removed from here.
* stream.h (dev_k, ino_k, mode_k, nlink_k, uid_k,
gid_k, rdev_k, size_k, blksize_k, blocks_k, atime_k,
mtime_k, ctime_k): Declarations removed from here.
* sysif.c (stat_s, dev_s, ino_s, mode_s, nlink_s,
uid_s, gid_s, rdev_s, size_s, blksize_s, blocks_s,
atime_s, mtime_s, ctime_s): New global variables.
(dev_k, ino_k, mode_k, nlink_k, uid_k, gid_k, rdev_k,
size_k, blksize_k, blocks_k, atime_k, mtime_k,
ctime_k): Existing variables moved here.
(stat_to_struct): New static function.
(stat_impl): Use stat_to_struct, except under
113 compatibility.
(sysif_init): Initialize new symbol variables.
Make stat struct type.
* sysif.h (stat_s, dev_s, ino_s, mode_s, nlink_s,
uid_s, gid_s, rdev_s, size_s, blksize_s, blocks_s,
atime_s, mtime_s, ctime_s): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Macros called c_* should produce C counterparts of
Lisp val objects, like c_num and c_str.
* lib.h (c_true): Renamed to tnil.
* eval.c (lexical_var_p, lexical_fun_p): c_true to tnil.
* lib.c (less, chr_isalnum, chr_isalnum, chr_isalpha,
chr_isascii, chr_iscntrl, chr_isdigit, chr_isgraph,
chr_islower, chr_isprint, chr_ispunct, chr_isspace,
chr_isblank, chr_isunisp, chr_isupper, chr_isxdigit,
chr_toupper, keywordp): Likewise.
* stream.c (catenated_stream_p): Likewise.
* sysif.c (wifexited, wifsignaled, wcoredump, wifstopped,
wifcontinued): Likewise.
|
|
|
|
|
|
|
|
|
| |
* glob.c (glob_wrap): Fix signed/unsigned comparison.
* stream.c (make_null_stream): Fix convert beign used
where coerce is needed.
* sysif.c (dup_wrap): Fix use of C++ new keyword.
|
|
|
|
| |
w_lstat as an alias to w_stat. This helps build on MinGW.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Added check for geteuid and related functions.
* sysif.c (getuid_wrap, geteuid_wrap, getgid_wrap, getegid_wrap,
getgroups_wrap, setuid_wrap, seteuid_wrap, setgid_wrap, setegid_wrap):
New static functions.
(sysif_init): Register intrinsics getuid, geteuid, getgid,
getegid, getgroups, setuid, seteuid, setgid, setegid.
* txr.1: Documented new functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (arith-init): Changing *flo-...* from special to
lexical, and adding un-earmuffed variants. The earmuffed
versions are obsolescent.
Adding %pi% and %e% global lexicals. Earmuffed versions are
also made global lexical, and obsolescent.
* eval.c (lookup_global_var, lookup_global_var_l): New functions.
(lookup_var): Uses lookup_global_var.
(reg_varl): New function.
(reg_var): Uses reg_var.
(eval_init): Register global lexicals user-package, system-package
and keyword-package. Old symbols with earmuffs are obsoleted,
and also turned into global lexicals.
(top-vb, top-fb): Changed to lexical.
* eval.h (lookup_global_var, lookup_global_var_l, reg_varl):
Declared.
* genvim.txr: Scan ver.tl so that the lib-version variable
is included. Extract reg_varl calls.
* glob.c (glob_init): glob-err and other variables made lexical.
* lib.c (get_user_package, get_system_package, get_keyword_package):
Use lookup_global_var_l to avoid searching dynamic scope for
lexicals which cannot be dynamically rebound.
* share/txr/stdlib/ver.tl (lib-version): New global lexical variable.
(*lib-version*): Turned lexical. Obsolescent.
* signal.c (sig-init): sig-* variables turned lexical.
* sysif.c (sysif-init): s-*, poll-* and w-* variables turned lexical.
* syslog.c (syslog-init): log-* variables turned lexical.
* txr.c (sysroot-init): stdlib and *txr-version* variables turned
lexical. txr-version variable added, and *txr-version* is
obsolescent.
(txr-main): self-path variable added. *self-path* turns lexical
and is obsolescent.
* txr.1: Documentation updated. Lexical variables not referred
to as special. Special variables referred to as special.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.h (statf): Declaration removed.
* sysif.c (w_stat): Function takes val instead of const wchar_t *
as leftmost argument.
(w_lstat, w_fstat): New static functions, with same interface as w_stat.
(stat_to_list, stat_impl): New static functions.
(statp, statl): New static functions.
(statf): Function removed, name re-used for new static function.
(sysif_init): stat intrinsic registered to statp function, not statf.
lstat and fstat intrinsics registered to statl and statf.
* txr.1: Documented lstat and fstat.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Check for the poll function and set
HAVE_POLL accordingly in config.h.
* stream.h (fd_k): External declaration added.
* sysif.c (poll_wrap): New function.
(sysif_init): Registered poll-in, poll-out, poll-err,
poll-pri, poll-rdhup, poll-nval, poll-rdband, poll-wrband
variables and poll function.
* txr.1: Documented poll.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (setenv, unsetenv): Changed static functions to external.
Moved them out of the #if !HAVE_TIMEGM block.
* lib.h (setenv, unsetenv): Declared.
* sysif.c (getenv_wrap, setenv_wrap, unsetenv_wrap): New functions.
(sysif_init): Registered getenv, setenv and unsetenv.
* txr.1: Documented getenv, setenv and unsetenv.
* tl.vim, txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
| |
* sysif.c (exit_star_wrap): New static function.
(sysif_init): Registered exit* intrinsic.
* txr.1: Documented exit*.
* tl.vim, txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Check for pipe.
* sysif.c (exec_wrap, pipe_wrap): New static functions.
(sysif_init): Register exec and pipe intrinsics.
* txr.1: Documented exec and pipe.
* tl.vim, txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: Detect chmod.
* sysif.c (chmod_wrap): New function.
(sysif_init): Register chmod intrinsic.
* txr.1: Documented.
* tl.vim, txr.vim: Regenerated.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (dup_wrap): New static function.
(sysif_init): Register dup_wrap as dupfd. The name dup
conflicts with an existing function.
* txr.1: Documented dupfd.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (work_wrap, wait_wrap, wifexited, wexitstatus,
wifsignaled, wtermsig, wcoredump, wifstopped, wstopsig,
wifcontinued): New static functions.
(sysif_init): Register new intrinsics: functions fork, wait,
w-ifexited, w-exitstatus, w-ifsignaled, w-termsig,
w-coredump, w-ifstopped, w-stopsig, w-ifcontinued; and
variables w-nohang, w-untraced, w-continued.
* txr.1: Documented.
* tl.vim, txr.vim: Regenerated.
|
|
|
|
|
|
|
| |
(ensure_dir): New function.
(sysif_init): ensure_dir registered as intrinsic.
* txr.1: ensure_dir documented.
|
|
|
|
|
|
|
|
|
|
| |
(sysif_init): Registered abort intrinsic.
* txr.1: Documented abort. Changed Unix Programming heading
to System Programming, since exit, abort and errno are not
Unix-specific, but C-specific.
* tl.vim, txr.vim: Updated.
|