| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (PROG): Removing ./ prefix from variable name; adding it
to invocations of $(PROG) in some rules.
(txr.o): Pass several strings as macros on the command line:
TXR_REL_PATH, EXE_SUFF and PROG_NAME.
* configure (bindir, datadir, mandir): These variables become
just relative paths from the prefix.
* txr.c (sysroot): Use the TXR_REL_PATH, EXE_SUFF and PROG_NAME
preprocessor symbols defined on the command line to avoid
hard-coding strings like "bin/txr" and "bin/txr.exe" which
actually should reflect the value of the bindir variable.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
from lang_flags. Adding a test for determining
which flag reveals BSD functions. This is due to the
braindamaged way feature selection macros work on
FreeBSD. There is no way to say "give me only the
functions from a certain version of the Unix spec,
plus traditional BSD functions", so we have to resort to
using the internal symbol __BSD_VISIBLE. Also, changing
the detection test for daemon function to the
pointer-based approach.
|
|
|
|
| |
This is subsumed by -D_XOPEN_SOURCE=500.
|
| |
|
|
|
|
|
|
|
|
|
| |
* configure: Use pointer-based test for timegm, because
-Werror=implicit-function-declaration does not work in the
gcc 4.2 used on FreeBSD 9.
* parser.l: Check for Flex 2.5.9 and earlier which don't
have yylex_destroy. Thanks to Marcus Breiing.
|
|
|
|
|
|
|
|
|
| |
/usr/bin/xpg4/sh shell. Solaris' /bin/sh does not like test
-e. Adding break to the new shell existence testing loop so we
use the first shell in the list. Solaris wants _XOPEN_SOURCE=500
to reveal certain functions. Fix breakage in the make utility
detection, and also use the $make variable everywhere instead
of make.
|
|
|
|
|
|
|
| |
We boostrap using #!/bin/sh, but try to detect a better shell
and re-execute the script with that shell. Furthermore, we now
set up the SHELL variable in config.make, so that make uses that
shell for executing build recipes.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* stream.c (run): Implement using _wspawnvp on MinGW.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
segmentation fault that occurs when running out of stack space,
and escape by throwing an exception.
Also, bugfix: save and restore the gc enable/disable state. Without
this, if we are ever running cod in a gc disabled state and it jumps
out, gc stays disabled.
* configure: added check for sigaltstack.
* gc.h (gc_enabled): Declaration added for existing variable.
* signal.c (is_cpu_exception): New static function.
(sig_handler): For cpu_exception type signals that pertain
to the execution of some instruction, turn on async_sig_enabled,
so that the signal is not deferred. Otherwise we will just
return without calling the user-defined handler, restart
the instruction and get into a loop. Also, disable gc around
the handler just in case. One issue is that we might be on
an alternate stack, which gc won't like.
(setup_alt_stack, teardown_alt_stack): New static functions.
(set_sig_handler): If we have sigaltstack, and are asked
to set up a SEGV handler, then set it up on the alternate
stack.
* signal.h (extended_jmp_buf): Adding new member, gc.
(extended_setjmp, extended_longjmp): use gc member
to save and restore the gc_enable state across
setjmp and longjmp.
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (open_process): Fixed off-by one erroneous value of nargs,
causing memory leak of one string. Fixed memory leak on fork failure.
Fixed a deadlock that can occur in the pipe close function when
multiple pipes are in existence. This is fixed by setting the
FD_CLOEXEC flag on the pipe file descriptor. Without this, one child
process can hold another's pipe open, causing that other one not to
terminate when we're trying to shut it down, resulting in that child
blocked on a write, while we block on waitpid.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version, set date.
* configure (txr_ver): Bumped.
* RELNOTES: Updated
* dep.mk: Updated.
|
|
|
|
| |
swapping around the consequent and alternative clauses.
|
|
|
|
|
|
| |
Use functions throughout tests instead of repeated code for removing
target, invoking make with redirection and testing for existence of
target.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES, txr.vim: Updated.
|
|
|
|
|
|
|
|
|
|
|
| |
means of -Werror=implicit-function-declarations. Fix broken mkdir and
mknod tests. Regenerate config.make if we add -U__STRICT_ANSI__
to the compiler options, so that later tests benefit from this.
Regenerate config.make right away if adding -D_DARWIN_C_SOURCE.
This allows the makedev test to pass.
* stream.c: Include <sys/types.h> for makedev.
(mknod_wrap): Don't rely on makedev wrappers to be there; test.
|
|
|
|
| |
strict prototypes warnings; these should be errors.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mkdir and mknod.
* eval.c (eval_init): Wrap #ifdefs around the registrations of
the wrappers for these functions.
* stream.c (mkdir_wrap): Wrap in #ifdef HAVE_MKDIR, and
provide a Windows version if HAVE_MKDIR is missing, but
HAVE_WINDOWS_H is true.
(makedev_wrap, major_wrap, minor_wrap): Wrap with #if HAVE_MAKEDEV.
(mknod): Use #if HAVE_MKNOD.
(symlink_wrap, link_wrap, readlink_wrap): Wrap with #if HAVE_SYMLINK.
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES, txr.vim, dep.mk: Updated.
|
| |
|
| |
|
|
|
|
| |
GNU Make check. This was introduced in May 2012.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES, txr.vim, dep.mk: Updated.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
Fixing some errors in copyright comments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem is that accurate lazy lists are not suitable for
real time use, where we want the TXR program to respond immediately
to matching some datum.
I'm implementing a simple, naive variant of lazy stream lists
which simply populates the lazy cons by reading from the stream when
the car or cdr fields are accessed. This type of stream can never
be nil (empty list) even if the file is empty; in that case
it will be (nil) and in general, it will have a spurious nil
item at the end instead of ending in a string.
(An adjustment was made in match.c to detect this; more
will be needed.)
I'm adding attributes to streams so streams can now have a
"real-time" attribute. When a lazy string list is constructed over
a real-time stream, the simple implementation is used.
File streams are automatically real-time if (on Unix) they are tied
to tty streams. Tail streams are also real-time.
More work is needed to achieve the goal of this change,
but this is a big step in the right direction.
* configure: Detect isatty function.
* lib.c (simple_lazy_stream_func): New static function.
(lazy_stream_cons): Use simple implementation for real-time streams.
* match.c (match_files): Do not call match_line_completely
with a data line that is nil (as a result of simple lazy list
over a real-time stream). A nil item in a lazy list of strings
is treated as eof.
* stream.c (real_time_k): New symbol variable.
(struct strm_ops): New members: get_prop, set_prop.
(struct stdio_handle): New member: is_real_time.
(stdio_get_prop, stdio_set_prop): New static function.
(stdio_ops, tail_ops, pipe_ops): stdio_get_prop and
stdio_set_prop funtions wired in.
(make_stdio_stream_common): Attribute streams as real-time
if they are tty devices.
(make_tail_stream): Tail streams are real-time attributed.
(stream_set_prop, real_time_stream_p): New functions.
(stream_init): Initialize real_time_k.
* stream.h (real_time_k): Declared.
(real_time_stream_p, stream_set_prop): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
have stricter diagnosis for configure tests.
(have_timegm, need_svid_source, need_bsd_source): New
variables. sys/stat.h test only declares static data and
compiles an object file. Adding tests for timegm, tzset,
setenv and unsetenv.
* eval.c (eval_init): Register new intrinsic, make_time_utc.
* lib.c (make_time_impl): New static function.
(make_time): Reimplemented as call to make_time_impl.
(timegm_hack): New conditionally-defined static function.
(make_time_utc): New function.
* lib.h (make_time_utc): Declared.
* txr.1: make-time-utc documented.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c: Include <unistd.h> conditionally.
(errno_wrap, daemon_wrap): New functions.
(eval_init): Registered errno_wrap and daemon_wrap as intrinsics
under the names daemon and errno.
* txr.1: Documented errno and daemon in new UNIX PROGRAMMING
section.
|