| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES, txr.vim, dep.mk: Updated.
|
|
|
|
| |
the debug-disabled stub function needs six arguments.
|
|
|
|
|
|
|
|
|
| |
* configure: (need_svid_source, need_bsd_source): Variables removed.
(need_darwin_c_source): New variable. Detect Apple environment and add
-D_DARWIN_C_SOURCE, which is needed to reveal some functions in headers.
* signal.c (sig_init): Wrap #ifdefs around SIGPOLL; it is not defined
on Darwin.
|
|
|
|
|
| |
* arith.c (plus, minus, mul, trunc): Optimize cases
where bignum is opposite 1 or 0.
|
|
|
|
|
|
|
|
|
|
| |
(n_choose_k, n_perm_k): New functions.
* arith.h (n_choose_k, n_perm_k): Declared.
* eval.c (eval_init): New functions interned.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
so it doesn't have quotes around it.
(cum_norm_dist): New function.
* arith.h (cum_norm_dist): Declared.
* eval.c: Include arith.h.
(eval_init): Register cum_norm_dist as intrinsic.
* txr.1: Documented cum-norm-dist.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in C headers which are extensions to standard C, like popen or fileno,
in response to standard feature selection macros like -D_POSIX_SOURCE.
MinGW and Cygwin are offenders. These platforms hide the declarations
when gcc is in -ansi mode, by testing for __STRICT_ANSI__. Turns out,
however, that -U__STRICT_ANSI__ on the gcc command line strips this
away, causing the declarations to be revealed.
* lib.c, parser.l, stream.c, utf8.c: Removed the declarations which
compensated for the above problem. Yippee! Fuck you, stupid Cygwin
troglodytes, and the MinGW horse you rode in on.
http://cygwin.com/ml/cygwin/2011-10/msg00131.html
|
|
|
|
|
|
|
|
| |
is retained as an obsolescent synonym. All arguments become optional.
* parser.l (lisp_parse): Handle nil source.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to _POSIX_C_SOURCE=199309L and _BSD_SOURCE.
In the .exe suffix test, try harder to redirect ls's output.
Test for fork stuff now needs <sys/types.h> evidently;
<unistd.h> does not necessarily pid_t, even though it defines
functions that return and accept pid_t!
The timegm test no longer needs _SVID_SOURCE since _BSD_SOURCE
covers it, and so we end up not using _SVID_SOURCE any more.
New tests for usleep and nanosleep.
The test for setenv is not conditional on timegm failing.
* eval.c: Include <time.h> and conditionally <windows.h>.
(usleep_wrap): New function.
(eval_init): New usleep_wrap function registered as usleep intrinsic.
* lib.c: Only define setenv and unsetenv if we don't have timegm,
because only in that situation they are used.
|
|
|
|
|
|
|
|
|
|
| |
language's expression evaluator. Whereas TXR Lisp expressions can be
used int the pattern language, preceded by @, it was not possible
to evaluate TXR Lisp variables this way. So instead of @var,
some clumsy trick had to be used like @(identity var). This is not
necessary any more. Code like @(next @*stdin*) will now work.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
than just fdefined.
* gc.c: Use #if HAVE_VALGRIND instaed of #ifdef HAVE_VALGRIND,
consistently with other HAVE_* config variables.
* lib.c: Likewise.
* lib.h: Likewise.
* txr.c: Likewise.
* txr.h: Likewise.
|
|
|
|
|
|
|
|
| |
* stream.c (vformat): Fix incorrect code for normalizing
exponent fields in the output of sprintf's floating-point
conversion. For ~e, the logic would let through a leading zero.
For ~a/~s conversion, it was comparing to 0 instead of '0',
not squashing leading zeros at all.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile: Use new EXE variable from config.mk.
* configure (exe, have_windows_h): New variables.
Handle situations with .exe suffix; on MiGW, the rm command
doesn't work on executables if the .exe suffix is not given.
New tests for localtime_r and gmtime_r.
* lib.c: Supply declarations which are missing on MinGW because
we use gcc -ansi, because MinGW doesn't follow established conventions
like -D_POSIX_SOURCE. Supply definitions for gmtime_r, localtime_r,
setenv and unsetenv.
* parser.l: Supply declarations which are missing on MinGW.
* signal.h (async_sig_enabled): Declare differently based on
HAVE_POSIX_SIGS.
Misspelled typedef fixed in the code for !HAVE_POSIX_SIGS
that has hitherto not been compiled.
(sig_mask): Wrap declaration in #ifdef HAVE_POSIX_SIGS because
it relies on sigset_t.
* stream.c: Supply declarations which are missing on MinGW.
Include <windows.h> if we have it.
(sleep): Define for Windows.
(statf): Handle missing st_blksize and st_blocks members in struct
stat.
(stream_init): Handle numerous missing S_* macros.
* utf8.c: Supply declarations which are missing on MinGW.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on the same stream to extract multiple objects; the requirement
that the stream must hold exactly one complete Lisp object
with no following material is now lifted.
* parser.l (YY_INPUT): Modified the macro so that it reads no more
than one character. Though this probably makes the lexer less
efficient, it gives us the important property that the lexer does
not scan ahead into the input stream, hogging data into its buffer
which is then destroyed. This is essential if the lisp-parse function
is to support multiple calls to pull objects one by one out of
a stream.
* parser.y (spec): Use YYACCEPT in the SECRET_ESCAPE_E clause for
pulling a single expression out of the token stream. YYACCEPT
is a trick for not invoking the $accept : spec . $end production
which is implicitly built into the grammar, and which causes
a token of lookahead to occur. This allows us to read a full
expression without stealing any further token: but only if the
grammar is structured right.
(exprs): This phrase structure now handles the DOTDOT syntax.
There is no such thing as an expr DOTDOT expr expression any more;
it is in the list syntax (and not supported in the dot position).
(expr): Remove DOTDOT syntax.
* txr.1: Updated description of .. syntax, and relaxed the description
of lisp-parse since it now allows multiple calls to extract
multiple objects.
|
|
|
|
|
| |
have stray scanner state possibly interfering with a subsquent
parse job.
|
|
|
|
| |
* txr.vim: Regenerated.
|
|
|
|
|
|
|
| |
* configure: Avoid using "new" as identifier in signals test case.
* signal.c (set_sig_handler): Fix warning about { 0 } initializer.
(sig_mask): Avoid using "new" as identifier.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: we are using sigsetjmp but with a jmp_buf structure;
it requires sigjmp_buf!
Performance issue: sigsetjmp is a dog which makes system calls.
Solution: let's roll our own cached version of sigprocmask which
only calls the real sigprocmask when the mask changes. Then
our extended_setjmp will just use regular setjmp, plus our own
custom signal saving and restoring based on the cached version.
* signal.c (sig_blocked_cache): New variable.
(set_sig_handler): Use our sig_mask instead of sigprocmask.
(mem_set_bits, mem_clr_bits): New static functions.
(sig_mask): New function.
* signal.h (extended_jmp_buf): New member, blocked.
(extended_setjmp): save blocked signals by peeking into
sig_blocked_cache, and restore using sig_mask.
(sig_blocked_cache, sig_mask): Declared.
|
| |
|
|
|
|
| |
whenever offset is zero, regardless of whence argument.
|
| |
|
| |
|
|
|
|
|
|
| |
no effect if the variable already exists.
* txr.1: Documented defvar and lisp-parse.
|
|
|
|
|
|
|
|
|
|
| |
feeling.
* parser.l (grammar): Recognize package prefixes in symbol tokens.
Got rid of special rule for handling lone colon.
* parser.y (sym_helper): Catch undefined package as a parsing
error rather allowing intern function to throw exception.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
token categories, replaced by a single one called SYMTOK.
Package prefixes are now recognized and processed in tokens.
* lib.c (delete_package): Fix problem in no-such-package
error case: it would always report nil as the name.
(intern): Fix nonsensical error message: in the no-such-package case it
would report that the symbol exists already.
* parser.l (grammar): Occurences of KEYWORD, METAVAR, and IDENT
scrubbed. All rules reporting any of these now return
SYMTOK. The main one of these is greatly simplified.
* parser.y (sym_helper): New function.
(char_from_name): const qualifier inside param's type declaration.
(grammar): IDENT, KEYWORD and METAVAR tokens are gone.
New token SYMTOK. Grammar refactored around SYMTOK and using
the new sym_helper function.
(char_from_name): Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New catenated streams make the Yacc hack possible.
* eval.c (eval_init): Register lisp_parse as intrinsic.
* parser.h (lisp_parse): Declared.
* parser.l: New lexical hack to produce SECRET_ESCAPE_E token.
(regex_parse): Move declaration before statements.
(lisp_parse): New function.
* parser.y (SECRET_ESCAPE_E): New token type.
(spec): New production rule for single expression.
* stream.c (cat_stream_print, cat_get_line, cat_get_char,
cat_get_byte, cat_get_prop): New static functions.
(cat_stream_ops): New static function.
(make_catenated_stream): New function.
* stream.h (make_catenated_stream): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
their name: some kind of string.
* stream.c (name_k): New variable.
(null_get_prop): New static function.
(null_ops): Wire null_get_prop into ops structure.
(stdio_get_prop): Report h->descr as name.
(string_in_get_prop): New function.
(string_in_ops): Wire string_in_get_prop into ops structure.
(stream_init): Initialize name_k.
* stream.h (name_k): Declared.
* syslog.c (syslog_get_prop): Report "syslog" as
stream name.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
handler rather than 1. The new argument is the value t,
telling the handler that it's asynchronously invoked in
a real signal context. If the signal handler returns
true, then mark it deferred so that it can re-trigger
in a synchronous context.
(sig_check): Pass nil as a the second argument to signal handlers,
indicating that they are synchronously called, not
in a signal handler context.
* txr.1: Added documentation.
|
|
|
|
|
| |
function because it manipulates the mask of deferred
signals which can also be manipulated by an async signal.
|
|
|
|
|
|
| |
for a signal that is being set to ignored or default.
* txr.1: Documented signals.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* signal.c (sig_hup, sig_int, sig_quit, sig_ill, sig_trap, sig_abrt,
sig_bus, val sig_fpe, sig_kill, sig_usr1, sig_segv, sig_usr2, sig_pipe,
sig_alrm, val sig_term, sig_chld, sig_cont, sig_stop, sig_tstp,
sig_ttin, val sig_ttou, sig_urg, sig_xcpu, sig_xfsz, sigtalrm,
sig_prof, val sig_poll, sig_sys, sig_winch, sig_iot, sig_stkflt,
sig_io, sig_lost, sig_pwr): New variables.
(sig_init): New variables initialized.
* signal.h: New variables declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (OBJS-y): Include signal.o if have_posix_sigs is "y".
* configure (have_posix_sigs): New variable, set by detecting POSIX
signal stuff.
* dep.mk: Regenerated.
* arith.c, debug.c, eval.c, filter.c, hash.c, match.c, parser.y,
parser.l, rand.c, regex.c, syslog.c, txr.c, utf8.c: Include new
signal.h header, now required by unwind, and the <signal.h> system
header.
* eval.c (exit_wrap): New function.
(eval_init): New functions registered as intrinsics: exit_wrap,
set_sig_handler, get_sig_handler, sig_check.
* gc.c (release): Unused functions removed.
* gc.h (release): Declaration removed.
* lib.c (init): Call sig_init.
* stream.c (set_putc, se_getc, se_fflush): New static functions.
(stdio_put_char_callback, stdio_get_char_callback, stdio_put_byte,
stdio_flush, stdio_get_byte): Use new functions to enable
signals when blocked on I/O.
(tail_strategy): Allow signals across sleep.
(pipev_close): Allow signals across waitpid.
(se_pclose): New static function.
(pipe_close): Use new function to enable signals across pclose.
* unwind.c (uw_unwind_to_exit_point): use extended_longjmp instead of
longjmp.
* unwind.h (struct uw_block, struct uw_catch): jb member changes from
jmp_buf to extended_jmp_buf.
(uw_block_begin, uw_simple_catch_begin, uw_catch_begin): Use
extended_setjmp instead of setjmp.
* signal.c: New file.
* signal.h: New file.
|
|
|
|
|
| |
was worth, and only solved problems caused by not checking that the test
program was made all the way to an executable.
|
|
|
|
|
|
| |
and HAVE_DAEMON.
* eval.c: daemon support must be wrapped in #if HAVE_DAEMON
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* syslog.c (log_authpriv_v): New variable.
(syslog_init): New variable initialized.
* syslog.h (log_authpriv_v): Declared.
* txr.1: Documented log-authpriv, and put in notes about testing
for variables that may not be present, including log-perror.
|
|
|
|
|
|
| |
(eval_init): New functions registred as intrinsics.
* txr.1: Documented.
|
|
|
|
|
| |
include <assert.h> since none of these modules uses the standard C
assert macro.
|
|
|
|
| |
Fixing some errors in copyright comments.
|
|
|
|
|
|
|
|
| |
* syslog.c (closelog_wrap): New function.
* syslog.h (closelog_wrap): Declared.
* txr.1: Documented.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
stream_get_prop and stream_set_prop as intrinsics.
* stream.c (stream_get_prop): New function.
* stream.h (stream_get_prop): Declared.
* syslog.c (syslog_get_prop): Bugfix: check for prio_k not real_time_k.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile: Use -iquote to restrict our #include search paths from
being processed for #include <...>. Add syslog.o to OBJS-y if
have_syslog is y.
* configure (have_syslog): New variable, set by detecting syslog API.
* eval.c (eval_init): logand and logior registrations changed to
go to variadic versions. New syslog variables and functions registered.
* lib.c (logandv, logiorv): New functions.
* lib.h (logandv, logiorv): Declared.
* txr.c (main): Call syslog_init.
* syslog.c: New file.
* syslog.h: New file.
* txr.1: Updated.
* txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile: Use -iquote to restrict our #include search paths from being
processed for #include <...>. Add syslog.o to OBJS-y if have_syslog is y.
* configure (have_syslog): New variable, set by detecting syslog API.
* eval.c (eval_init): logand and logior registrations changed to
go to variadic versions. New syslog variables and functions registered.
* lib.c (logandv, logiorv): New functions.
* lib.h (logandv, logiorv): Declared.
* txr.c (main): Call syslog_init.
* syslog.c: New file.
* syslog.h: New file.
|