| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (sysroot_init): Don't print "unable to calculate
sysroot" error message in the fallback case, and
use the absolute path of the executable directory
as the sysroot in this case.
(txr_main): Define static area prefixed by @(txr): header. If
a string is present in this data area then process it as an
argument. Treat the *args* variable carefully. If we use the
stored string as the argument, save the args in orig_args
variable, then later bind *args* to that. In the -e, -p and
related options processing, we bind *args* to the original
list so args are available to the expression being evaluated.
If the expression mutates *args* then we keep the mutated args
whether or not we are processing the stored string.
* txr.1: Documented in new sction, STAND-ALONE
APPLICATION SUPPORT.
|
|
|
|
|
|
|
| |
* txr.c (dirname): New static function.
(sysroot_init): Register txr-path variable.
* txr.1: documented txr-path.
|
|
|
|
|
|
|
| |
* parser.l (grammar): Recognize {WS}* between @
and ; (or the legacy #) in comments.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (remove_path): New parameter, throw_on_error.
(stream_init): Update registratino of remove_path intrinsic.
* stream.h (remove_path): Declaration updated.
* txr.1: Updated remove-path documentation to describe
throw-on-error-p parameter.
|
|
|
|
|
| |
txr.1: It wasn't documented that expr in @(next expr)
can produce a stream.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
| |
* txr.1: Replace Expressivity with Expressiveness.
|
|
|
|
| |
* txr.1: Capitalize Boolean everywhere.
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (listener_sel_inclusive_p_s): New symbol variable.
(repl): Install current value of *listener-sel-inclusive-p*
variable into linenoise.
(parse_init): Initialize the symbol variable and register
the Lisp special variable.
* txr.1: Documented special variable and selection mode
semantics.
|
|
|
|
| |
* txr.1: maybe -> may be.
|
|
|
|
|
|
| |
* txr.1: Just list directives that take Lisp;
drop the details. Point out that no @ is needed
for access to Lisp variable.
|
|
|
|
|
| |
* txr.1: @ is not required on Lisp
variables.
|
|
|
|
| |
* txr.1: Mistake in syntax markup.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (self_load_path_s): New symbol variable.
(sys_load): Save, set-up and restore self-load-path
around load.
(set_get_symacro): New function.
(eval_init): Register load function using sys_load_s instead
of redundant intern.
* eval.h (set_get_symacro): Declared.
* match.c (v_load): Save, set-up and restore self-load-path
macro.
* parser.c (load_rcfile): Likewise.
* txr.c (txr_main: Set up self-load-path when opening
file.
* txr.1: Documented self-load-path.
|
|
|
|
|
|
|
| |
* txr.1: In Interactive Listener sections, note what
"character under the cursor" means when a vertical cursor
is in effect, and add notes about how the selection semantics
pairs well with that style of cursor.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (termios.o): New object file.
* lib.c (init): Call termios_init.
* lisplib.c (termios_set_entries, termios_instantiate): New
functions.
(lisplib_init): Register new functions in autoload table.
* share/txr/stdlib/termios.tl: New file.
* termios.c, termios.h: New files.
* txr.1: Documented termios.
|
|
|
|
|
|
|
|
|
|
|
| |
* checkman.txr: Check against blank line after .desc.
Fix incorrect pattern, failing to match one-symbol
Function/Operator/Macro headings. This exposes
errors in the document that were previously undetected.
* txr.1: Fix numerous occurrences of blank lines
after .desc, missing .desc, incorrect headings
and other problems.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
| |
* stream.c (flush_stream): Default the argument to
std_output.
(stream_init): Register flush-stream as having one
optional arg.
* txr.1: Updated flush-stream description.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When subprocesses are created using open-command,
open-process, run or sh, any streams not bound by
those functions are obtained from *stdin*, *stdout*
or *stderr*, as appropriate. Thus manipulating these
variables has the effect of redirecting not only
local output within the program but over coprocesses
as well.
* stream.c (struct save_fds): New type.
(FDS_IN, FDS_OUT, FDS_ERR): New macros.
(fds_init, fds_subst, fds_swizzle, fds_restore): New static
functions.
(open_command, open_process, run): "Swizzle" and restore
the standard file descriptors.
* txr.1: Updated documentation of affected function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (path_test_set_entries): New elements in the list
for path-readable-to-me-p, path-read-writable-to-me-p, and
path-strictly-private-to-me-p.
* share/txr/stdlib/path-test.pl (sys:path-access): Test
bitwise combinations of permissions, so read+write
can be tested in one call.
(path-readable-to-me-p, path-read-writable-to-me-p,
path-strictly-private-to-me-p): New functions.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The purpose is to eliminate any biases in
the PRNG arising out of the regularity of that pattern, so
that the behavior of successive values is good from the
beginning.
This doesn't solve the problem that a short warm-up period
leads to a poor distribution of initial values relative to the
seed space. In other words, that similar seeds lead to
initially similar sequences.
* rand.c (rand_tab): New static array.
(make_random_state): Set uninitialized parts of state from the
corresponding elements in rand_tab, rather than to the
0xAAAAAAAA values.
(rand_compat_fixup): In 139 compatibility mode, clobber
rand_tab with 0xAA bytes.
* tests/013/maze.expected: Updated.
* txr.1: Added some PRNG implementation notes, and
also compatibility notes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (copy): Pass new second argument to make_random_state.
* rand.c (random_warmup): New macro.
(random_warmup_s): New symbol variable.
(make_random_state): New warmup argument. Code restructured to
avoid copy flag. Fill code and initialization of r->cur made
common.
(rand_compat_fixup): Pass second argument to
make_random_state.
(rand_init): Pass second argument to make_random_state.
Initialize random_warmup_s with interned symbol. Register
*random-warmup* special variable. Fix registration of
make-random-state to two-argument function type.
* rand.h (make_random_state): Declaration updated.
* txr.1: Document *random-warmup* variable and warup
argument of make-random-state.
|
|
|
|
|
|
|
|
|
|
| |
* eval.h (call_s): Declared.
* match.c (h_call, v_call): New static function.
(dir_tables_init): Register v_call in v_directive_table
under call symbol. Likewise h_call in h_directive_table.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* arith.c (arith_init): Registered fixnum-min and fixnum-max
variables.
* txr.1: Documented.
|
|
|
|
|
|
| |
* checkman.txr: Check .metn using logic shared with .codn.
* txr.1: Numerous errors fixed.
|
|
|
|
|
|
|
|
| |
* checkman.txr: Check .meta similarly to .code.
* txr.1: Change .meta macro to take only one argument,
so that text with spaces must be quoted.
Errors found and fixed.
|
|
|
|
|
|
|
|
| |
* checkman.txr: Constraint on first character of second
argument coded as a require constraint, enforced
with assert.
* txr.1: Newly discovered errors fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the manual, the .code and .codn macros are no longer
variadic. They take one an two arguments, respectively.
Multiple arguments have to be quoted now.
This makes it easier to detect errors in usage,
using support in checkman.txr.
Numerous errors were found, in fact.
* checkman.txr (check-code): New pattern function
for doing some checks on .code, codn, cod2 and cod3
macro usage.
* txr.1: code and codn macro are no longer variadic.
All variadic uses fixes with quotes. Numerous
errors discovered and corrected.
|
|
|
|
|
|
| |
* txr.1: Fix incorrect function and variable description
headings with spurious commas and inappropriate plurals.
Fix missing .mets in syntax blocks.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
| |
* txr.1: Hunted down and fixed incorrect .code,
.codn, .meta and .metn invocations. Added
missing .desc macros after .coNP Variables ...
|
|
|
|
|
|
|
| |
* ftw.c (ftw_wrap): Handle case when dirpath is a list,
by recursion.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (read_until_match): New argument, include_match.
Three times repeated termination code refactored into block
reached by forward goto.
(regex_init): Registration of read-until-match updated.
* regex.h (read_until_match): Declaration updated.
* stream.c (struct record_adapter_base): New member,
include_match.
(record_adapter_get_line): Pass match to read_until_match
as new argument.
(record_adapater): New argument, include_match.
(stream_init): Update registration of record-adapter.
* stream.h (record_adapter): Declaration updated.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixing read_until_match will require this feature.
* socket.c (dgram_get_char): Treat unget_c as a
cons-based stack; pop a character from it if
available.
(dgram_unget_char): Push the character onto unget_c
rather than storing the characer into unget_c.
* stream.c (stdio_get_char, stdio_unget_char): Closely
analogous changes to the ones in dgram_get_char
and dgram_unget_char, respectively.
* txr.1: Documentation improved and updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Numerous places in match.c are using assoc(sym, bindings)
logic to access a variable, which doesn't see the Lisp
globals, as we would like. For example, if foo is
defined using (defvar foo), @(set foo "A") doesn't work.
This is subject to the compatibility option.
* match.c (tx_lookup_var): New static function.
(dest_set, h_var, h_coll, h_parallel, h_fun, v_next,
v_parallel, v_gather, v_collect, v_flatten, v_cat,
v_output, v_filter, v_fun, match_filter): Use tx_lookup_var
instead of assoc for all lookups that see the full variable
scope. Only variable lists known to be locally consed up
are scanned with just assoc.
* txr.1: Documented new rules and added compatibility notes.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
| |
* txr.1: Remove factually incorrect statements that only
sockets connected with sock-connect or sock-accept have
a peer address. Broadly revise wording.
|
|
|
|
|
| |
* txr.1: Incorrect reference to sys:return* should
of course be to sys:abscond*.
|
|
|
|
|
|
| |
* txr.1: Document that glob's error-func callback can be
terminated by a non-local exit, but may not capture
continuations across glob.
|
|
|
|
|
| |
* txr.1: glob-err, glob-mark and others are global lexical
variables, not special.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (ftw.o): Add to OBJS-y conditionally.
* configure (have_ftw): New variable. New configure test
for nftw.
(gen_config_make): Set up have_ftw make variable.
* ftw.c, ftw.h: New files.
* lib.c (init): Call ftw_init, if compiled in.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (yield_set_entries): Add obtain* and obtain*-block
to autoload list.
* share/txr/stdlib/yield.tl (obtain*, obtain*-block):
New macros.
* txr.1: Documented.
|