| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
* lisplib.c (sock_set_entries): Add str-inaddr and str-in6addr
to list of autoload identifiers.
* share/txr/stdlib/socket.tl (str-inaddr, str-in6addr): New
functions.
|
|
|
|
|
| |
* eval.c (op_each): Use list_collect_append not
list_collect_nconc. Ouch!
|
|
|
|
|
|
|
|
| |
* eval.c (expand_left, nexpand_left): New static functions.
(eval_init): Registered expand-left and nexpand-left
intrinsics.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* match.c (v_next): If argument to @(next) is nil, then
evaluate remaining query in context with no list of files,
and no data.
* txr.1: Documented @(next nil).
|
|
|
|
|
| |
* sysif.h (repress_privilege, drop_privilege): Add missing
void.
|
|
|
|
| |
* configure: it's, not its.
|
|
|
|
|
|
| |
* txr.1: Refer to parameter as options, not option,
and use .meta consistently. Don't refer to Syslog section in
all caps.
|
|
|
|
| |
* txr.1: replace nonexistent @(elsif) in example with @(elif).
|
|
|
|
| |
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (struct stdio_handle): New member, peer.
(stdio_stream_mark): Mark the new member.
(sock_peer, sock_set_peer): New functions.
(stream_init): Registered sock-peer intrinsic.
* stream.h (sock_peer, sock_set_peer): Declared.
* socket.c (sock_connect): If the connect is successful,
then store the address into the stream as the peer.
|
|
|
|
|
| |
* socket.c (sock_bind): Set the SO_REUSEADDR option before
binding the socket, to thwart the EADDRINUSE nuisance.
|
|
|
|
|
| |
* stream.c (open_fileno): If w_fdopen fails, close the
file descriptor before throwing exception.
|
|
|
|
| |
* stream.c (open_fileno): clear errno to 0 before fdopen.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* socket.c, socket.h: New files.
* Makefile: include new socket.o among objects if have_objects
variable is defined to 'y'.
* configure (have_sockets): New variable. New configure test
for socket-related functionality.
(HAVE_SOCKETS, HAVE_GETADDRINFO): New configuration
preprocessor symbols.
Also, reordering the shell probing so that /usr/xpg4/bin/sh
is the last fallback. On Solaris, it chokes on some code
that is needed for Solaris.
* lisplib.c (sock_set_entries, sock_instantiate): New static
functions.
(lisplib_init): Register new functions as autoload hooks.
* share/txr/stdlib/socket.tl: New file.
* stream.c (socket_error_s): New symbol variable.
(struct stdio_handle): New members, family and type, helping
stdio streams represent sockets too.
(stdio_stream_mark): Mark new members of struct stdio_handle.
(make_stdio_stream_common): Initialize new members.
(make_sock_stream, stream_fd, sock_family, sock_type,
open_socket, open_sockfd): New functions.
(stream_init): Initialize socket_error_s variable. Register
sock-family, sock-type and open-socket intrinsic functions.
Register socket-error subtype.
* stream.h (socket_error_s, make_sock_stream, stream_fd,
sock_family, sock_type, open_socket, open_sockfd):
Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (subtypep): Handle subtype check here between
stream and stdio-stream as a special case, since streams
aren't structures related by inheritance, but built-ins.
(class_check): If the type of obj doesn't match the class
exactly, use a subtypep check. We need this because stream
functions use this check, and stdio streams are not of the
stream type now.
* stream.c (stdio_stream_s): New global symbol variable.
(make_stdio_stream_common): Use stdio_stream_s symbol for the
type of stdio streams.
(stream_init): Intern the stdio-stream symbol, and store in
stdio_stream_s variable.
(streamp): Replace exact check with typep.
* stream.h (stdio_stream_s): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions convert between positive integers, and
fixed-size memory buffers representing pure binary numbers in
big endian byte order.
This functionality will be used in some upcoming networking
code.
* arith.c (num_from_buffer, num_to_buffer): New functions.
* arith.h (num_from_buffer, num_to_buffer): Declared.
* mpi/mpi.c (mp_to_unsigned_buf): New function.
* mpi/mpi.h (mp_to_unsigned_buf): Declared.
|
|
|
|
|
|
| |
* txr.c (txr_main): Implement --eargs.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* struct.c (make_struct_type): Use find_struct_type rather
than direct lookup in struct_type_hash.
(find_struct_type): Use lisplib_try_load if a type is
not found to trigger autoloading on the symbol.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* match.c (v_require): Produce trace when require fails.
|
|
|
|
|
|
|
|
|
| |
I caught this when doing a @(require (boundp 'var)).
* match.c (v_require): The correct evaluation was being
done here, with the value discarded, followed by an incorrect
evaluation in which the TXR bindings are not visible, whose
value *is* then used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unwind.c (unhandled_ex): New static structure.
(unwind_to_exit_point): The code to print the unhandled exception info
and bail the process is moved here out of uw_throw. We do this in the
situation when we have an unhandled exception, which is represented
by the fact that the exception pointer points to the unhandled_ex
structure.
(uw_throw): If unhandled hook isn't a function, we don't abort; we go
through the unwinding and unhandled processing. Also, ditto if the
unhandled function returns, ditto. Unhandled processing is entered
by substituting unhandled_ex for the not-found exception, and
allowing unwind_to_exit point to be called.
* txr.1: Document new behavior for unhandled exceptions
and *unhandled-hook*.
|
|
|
|
|
|
|
| |
* arith.c, cadr.c, debug.c, eval.c, filter.c, gencadr.txr, glob.c,
hash.c, linenoise/linenoise.c, lisplib.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: Remove unncessary header files.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c: include <assert.h> that was previously coming
via "mpi.h".
* mpi/mpi.c: Includes of <stdio.h>, <ctype.h> and <assert.h>
moved here.
* mpi/mpi.h: Remove include of <stdio.h>, <ctype.h> and
<assert.h>. Keeping <limits.h> for now; needed for CHAR_BIT.
* mpi/mplogic.c: Needs <assert.h>
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* filter.c (tobase64_k, frombase64_k): New keyword symbol variables.
(col_check, get_base64_char, b64_code): New static functions.
(base64_decode, base64_encode): New functions.
(filter_init): Initialize new keyword symbol variables, and register
base64-encode and base64-decode intrinsic functions.
* filter.h (base64_encode, base64_decode): Declared.
* txr.1: Documented base64-encode, base64-decode,
as well as :tobase64 and :frombase64.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is responsible for behaviors like Ctrl-C being
subsequently ignored after the first time a read is
interrupted that way.
* signal.c (sig_reload_cache): Eliminate the return
statement which was making the memcpy expression
unreachable! No warning from gcc. Also, since
nobody checks the return value of this function and
it doesn't provide one, let's make it void.
There is no reason the sigprocmask would fail since
the arguments are correct, but let's check its
return value anyway.
|
|
|
|
|
|
| |
* genvim.txr: Add missing single, first, last and other output
repeat modifiers. Removing rep, since it's scraped from the
table registration in match.c.
|
|
|
|
| |
* txr.1: "variables substitutions".
|
|
|
|
| |
* txr.1: "They encodes" fixed.
|
|
|
|
|
|
|
|
|
|
| |
This happened on 2015-07-29, before TXR 111,
"Deriving streams from the same base" commit.
* stream.c (string_in_get_char): Must retrieve the character
at the previous position, not the incremented one. Otherwise
we lose the first character, and of course we blow up with an
out of range access when we hit the end of the string.
|
|
|
|
|
|
|
| |
* lib.c (vec_list): Don't require input to be specifically a
list, just any sequence that can be marched with cdr until
nil. This commit also fixes the problem that the error message
was still referring to the function as vector-list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (UINT_PTR_MAX_MP): New static variable.
(biggnum_from_uintptr): New function.
(in_uint_ptr_range): New static function.
(c_uint_ptr_num): New function.
(arith_init): Initialize UINT_PTR_MAX_MP.
* arith.h (bignum_from_uintptr, c_uint_ptr_num): Declared.
* eval.c (eval_init): Register random-state-get-vec.
* mpi/mpi.c (mp_set_uintptr, mp_get_uintptr): New functions.
(mp_set_intptr, mp_get_intptr): Expressed in terms of
mp_set_uintptr and mp_get_uintptr.
* mpi/mpi.h (mp_set_uintptr, mp_get_uintptr): Declared.
* rand.c (make_random_state): Handle vector seed.
(random_state_get_vec): New function.
* rand.h (random_state_get_vec): Declared.
* txr.1: Documented new feature in make-random-state
and new random-state-get-vec function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This mistake causes wasteful behavior for power-of-two
moduli in the random function, in both the bignum and
fixnum cases. For instance, the modulus 16 is taken
to be 17 bits wide. But we really want the width 16:
the number of bits needed for values in the range [0, 16).
The result isn't wrong, but the loop generates 17-bit
random numbers, and then throws away those which equal
or exceed the modulus, which is wasteful.
* mpi/mpi.c (mp_is_pow_two): New function.
* mpi/mpi.h (mp_is_pow_two): Declared.
* rand.c (random): In bignum case, after counting
bits in the modulus, subtract 1 if the modulus is a power
of two. In the fixnum case, subtract 1 from the modulus
and then count the bits in the reduced value.
* tests/013/maze.expected: regenerate due to different
prng behavior.
|
|
|
|
|
|
|
|
|
|
| |
* rand.c (random): In fixnum case, allow only m >= 1.
The code is restructured so that this check is done
before we do some arithmetic with derived values,
where the behavior can become undefined.
* txr.1: Document the restriction on modulus range
for rand and random.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register split*.
* lib.c (split_star_func): New static function.
(partition_split_common): Take pointer-to-function argument
instead of boolean. Hoist this C function into the lazy cons.
(partition): Pass pointer to partition_func ito
partition_split_common, intsead of a flag requesting the use
of partition_func.
(split): Pass apointer to split_func into
partition_split_common.
(split_star): New function.
* lib.h (split_star): Declared.
* txr.1: Documented split*.
|
|
|
|
|
|
|
| |
* txr.1: examples were calling split as if it were
variadic, accepting multiple indices as separate
arguments. This is not the case; a sequence of indices
must be passed as one argument.
|
|
|
|
|
| |
* lib.c (partition_star): Eliminate strange behaviors
when a negative index is given as an argument.
|
|
|
|
|
|
|
| |
lib.c (partition_star): In the special case that the indices
argument is given as the integer zero, the function wrongly
returned just the remaining piece of the sequence after zero,
rather than a list containing this piece.
|
|
|
|
|
|
| |
* lib.c (partition_star): The same issues that were addressed
in TXR 126 in 2015-11-29 commits and 2015-11-24 commits
must also be addressed here.
|
|
|
|
|
| |
* sysif.c (make_hash): Fix incorrect treatment of env values
which contain equal signs, due to careless use of split_str.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* match.c (mandatory_k): New keyword variable.
(h_coll, v_gather, v_collect): Implement :mandatory logic.
(syms_init): Initialize mandatory_k.
* parser.l (grammar): The UNTIL and LAST tokens must be
matched similarly to collect, without consuming the
closing parenthesis, allowing a list of items to be parsed
between the symbol and the closure, in the NESTED state.
* parser.y (gather_clause, collect_clause, elem,
repeat_parts_opt, rep_parts_opt): Adjust to new until/last
syntax. In the matching productions, the abstract syntax
changes to incorporate the options. In the output productions,
we throw an error if options are present.
* txr.1: Documented :mandatory for collect, coll and gather.
|
|
|
|
|
|
|
|
| |
* match.c (v_gather): Use getplist_f to distinguish the :vars
nil case just like v_collect does. A :vars nil gather could be
useful; it says none of the variables are strictly required.
In any case, it is not correct to treat :vars nil as if :vars
weren't there.
|
|
|
|
|
| |
* lib.c (obj_print_impl): Handle NUM and BGNUM separately from
FLNUM, thorugh a hard-coded "~s" format.
|
|
|
|
|
|
| |
* lib.c (minusv): Avoid reduce_left overhead in
common two-argument case, and just call binary
minus function directly.
|
|
|
|
|
| |
* lib.c (nary_op): Avoid the overhead of reduce_left in the
two-argument case and just call the binary function.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register / function to divv instead of divi.
* lib.c (divv): New function.
* lib.h (divv): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* eval.c (do_expand): Add missing rlcp in the construction
of the return value of the clause which expands a dohash.
Let's make it a rlcp_tree. Test case: (dohash (a b c) d e)
with c unbound.
|