| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
debug.h, eval.c, eval.h, filter.c, filter.h, gc.c, gc.h, hash.c,
hash.h, lib.c, lib.h, match.c, match.h, parser.h, parser.l, parser.y,
rand.c, rand.h, regex.c, regex.h, signal.c, signal.h, stream.c,
stream.h, syslog.c, syslog.h, txr.c, txr.h, unwind.c, unwind.h,
utf8.c, utf8.h: Synchronize license header with LICENSE.
|
|
|
|
| |
see the bindings set up by prior -D options.
|
|
|
|
|
|
|
|
|
|
|
|
| |
directory.
* txr.c (help): Help text updated to document --license option.
(license): New function.
(txr_main): Implement --license option.
* unwind.h (uw_catch): Add cast to suppress warning about unused symbol.
* txr.1: Document --license option.
|
|
|
|
|
|
|
|
|
|
|
| |
* match.c (do_txeval): If a variable is not in the bindings, fall
back on treating it as a TXR Lisp dynamic variable. This allows
us to refer to the stdlib variable from a quasistring in a
@(load ...) directive.
* txr.c (sysroot_init): Register new variable, *txr-version*.
* share/txr/stdlib/ver.txr: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
line.
(PREINSTALL): New variable holding a step for the install recipe.
(pax tar zip): New targets.
* configure (txr_ver): Version now added to config.make, passed
through to txr.c.
(gen_config_make): bindir, datadir and mandir are established
using gmake's regular macro assignment (=) rather than
expanding assignment (:=). This allows us to override the
prefix variable after configure time.
* lib.h (wli_noex): New macro.
(wli): Retarget to wli_noex, so that argument is subject
to macro replacement.
* txr.c (version): Use TXR_VER defined on compiler command line,
rather than hard-coded string literal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
Add missing parentheses in expression.
(sysroot_init): On Windows, filter progpath to change
backslashes to forward slashes.
|
|
|
|
|
|
|
|
|
| |
the path based on the "sysroot" where it is actually installed.
* txr.c (progname_8u, progpath): New static variables.
(get_self_path, sysroot_helper, sysroot, sysroot_init): New
static functions. Sysroot creates a stdlib variable.
(main): Initialize progname_u8 value, and call sysroot_init.
|
|
|
|
|
|
| |
Also, put in missing check for -f being erroneously clumped.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
be explicitly requested by the -B option.
* match.c (opt_nobindings): Variable removed.
(opt_print_bindings): New variable.
(extract): Print bindings or "false" if opt_print_bindings is true.
* stream.c (output_produced): Variable removed.
(stdio_put_string, stdio_put_char, stdio_put_byte): Remove
update of output_produced.
* stream.h (output_produced): Declaration removed.
* txr.1: Documentation updated.
* txr.c (txr_main): Option 'b' does nothing. 'B', 'l', 'a',
and '--lisp-bindings' set opt_print_bindings to 1.
* txr.h (opt_nobindings): Declaration removed.
(opt_print_bindings): Declared.
* unwind.c (uw_throw): When exiting due to a query error or
file error, print false when opt_print_bindings is true.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.h (upop): Declared.
* txr.c (txr_main): Two bugfixes. One is that the argument -
was being pushed back twice resulting in *args* being ("-" "-").
This is because the option processing loop checked for "-" and pushed
it back into args, and then some logic after the loop pushed arg back
into args again. But, these pushes were wrong because they push
back a different cons cell; we would like to be able to
do (ldiff *full-args* *args*). This is solved by upop, which provides
one element of undo. After upop, we can restore the prior list
from the undo save location.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version, set date.
* configure (txr_ver): Bumped.
* RELNOTES: Updated
* dep.mk: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
re-binding. C code now has to go through the dynamic environment lookup
to access things like *random-state*, or *stdout*. As part of this,
I'm moving some intrinsic variable and function initializations out of
eval.c and into their respective modules. Macros are are used to make
global variables look like ordinary C variables. This is very similar
to the errno trick in POSIX threads implementations.
* eval.c (looup_var, lookup_var_l): Restructured to eliminate silly
goto, the cobjp handling is gone.
(reg_fun, reg_var): Internal function becomes external.
reg_var registers a simple cons cell binding now, without any
C pointer tricks to real C global variables.
(c_var_mark): Static function removed.
(c_var_ops): Static struct removed.
(eval_init): Numerous initializations for streams, syslog, rand,
signals and others moved to their respective modules.
The new symbol variables user_package_s, keyword_package_s
and system_package_s are interned here, and the variables are
created in a special way.
* eval.h (reg_var, reg_fun): Declared.
* gc.c (prot1): Added assert that the loc pointer isn't null.
This happened, and blew up during garbage collection.
* lib.c (system_package, keyword_package, user_package): Variables
removed these become macros.
(system_package_var, keyword_package_var, user_package_var): New
global variables.
(system_package_s, keyword_package_s, user_package_s): New
symbol globals.
(get_user_package, get_system_package, get_keyword_package): New
functions.
(obj_init): Protect new variables. Initialization order of modules
tweaked: the modules sig_init, stream_init, and rand_init are moved
after eval_init because they register variables.
* lib.h (keyword_package, system_pckage, user_package): Variables
turned into macros.
(system_package_var, keyword_package_var, user_package_var): Declared.
(system_package_s, keyword_package_s, user_package_s): Declared.
(get_user_package, get_system_package, get_keyword_package): Declared.
* rand.c (struct random_state): Renamed to struct rand_state to
avoid clash with new random_state macro.
(random_state): Global variable removed.
(random_state_s): New symbol global.
(make_state, rand32, make_random_state, random_fixnum, random):
Follow rename of struct random_state.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES, txr.vim: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(eval_init): Register env and env_hash functions. Register prog_args
and prog_args_full as *args* and *full-args*.
* lib.c (timegm_hack): Invalidate env_list, after mucking with
the environment via setenv and unsetenv.
* txr.c (prog_args_full, prog_args): New global variables.
(txr_main): Command-line processing converted to use TXR's
library. Populates prog_args_full and prog_args.
* txr.h (prog_args_full, prog_args): Declared.
* txr.1: Documented *args*, *full-args*, env and env-hash.
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES, txr.vim, dep.mk: Updated.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the extension of list operations over vectors and strings.
* eval.c (do_eval_args, bindings_helper, op_each,
subst_vars, supplement_op_syms, mapcarv, mappendv): Switch from
list_collect_* macros to functions.
* lib.c (copy_list): Switch from list_collect* macros to functions.
Use list_collect_nconc for the final terminator. Doing a copy
there with list_collect_append was actually wasteful, and now
that list_collect_append calls copy_list in places, it triggered
runaway recursion.
(make_like): Bugfix: list_vector was used instead of vector_list.
(to_seq, list_collect, list_collect_nconc, list_collect_append): New
functions.
(append2, appendv, nappend2, sub_list, replace_list, ldiff, remq,
remql, remqual, remove_if, keep_if, proper_plist_to_alist,
improper_plist_to_alist, split_str, split_str_set, tok_str,
list_str, chain, andf, orf, lis_vector, mapcar, mapcon, mappend,
merge, set_diff, env): Switch from list_collect* macros to functions.
(replace_str, replace_vec): Allow single item replacement sequence.
* lib.h (to_seq): Declared.
(list_collect, list_collect_nconc, list_collect_append): Macros
removed, replaced by function declarations of the same name.
These functions return the new ptail since they cannot assign
to it, requiring all uses to be updated to do the assignment
of the returned value.
(list_collect_decl): Use val rather than obj_t *.
* match.c (vars_to_bindings, h_coll, subst_vars, extract_vars,
extract_bindings, do_output_line, do_output, v_gather, v_collect):
Switch from list_collect* macros to functions.
* parser.y (o_elems_transform): Likewise.
* regex.c (dv_compile_regex, regsub): Likewise.
* txr.c (txr_main): Likewise.
|
|
|
|
|
|
|
|
|
| |
* eval.h (eval_intrinsic): Declared.
* txr.c (spec_file): Global variable removed.
(txr_main): Support for -e and -p options. Minor code cleanup.
* txr.1: Documented new options.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES, txr.vim, dep.mk: 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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
around November 2009.
* lib.c (lazy_str): Use the efficient lit("...") that
doesn't allocate memory instead of string(L"...").
(lazy_str_get_trailing_list): Likewise.
* stream.c (open_process): Likewise.
* txr.c (remove_hash_bang_line): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
intrinsic function and std_null as new variable.
* parser.h (yylex_destroy): Existing function declared.
* parser.l (regex_parse): New function.
New lexical syntax added which returns SECRET_ESCAPE_R.
* parser.y (SECRET_ESCAPE_R): New token.
(spec): Added syntactic variant which lets us
smuggle a regex into the parser easily.
* stream.c:x (std_null): New global variable.
(null_stream_print): New static function.
(null_ops): New static structure.
(make_null_stream): New function.
(stream_init): Protect and initialize std_null.
* stream.h (std_null, make_null_stream): Declared.
* txr.1: New features documented: regex-parse, *stdnull*.
* txr.c (txr_main): Call yylex_destroy after parsing the program now
that I know about this function; this can free up some memory.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register new open_tail function as intrinsic.
* match.c (complex_snarf, complex_stream): Update calls to
make_stdio_stream and make_pipe_stream to take fewer arguments.
(match_files): Support a stream object as a data source specification
in place of a string.
* parser.l (parse_reset): Update call to make_stdio_stream to take
fewer arguments.
* stream.c: Inclusion of <unistd.h> made properly conditional.
(struct stdio_handle): pid member defined as pid_t only if we have fork
functionality, otherwise defined as int.
(tail_get_line, tail_get_char, tail_get_byte): New static functions.
(tail_ops): New static structure.
(make_stdio_stream_common): New static structure.
(make_stdio_stream, make_pipe_stream): These functions lose the input
and output parameters, which ended up never used. Reimplemented
in terms of new common function.
(make_tail_stream): New function.
(make_pipevp_stream): Reimplemented in terms of new common function.
(open_file, open_command): Simplified by removal of useless local
variables and their computation, which used to be extra arguments to
make_stdio_stream and make_pipe_stream.
(open_tail): New function.
(stream_init): Calls to make_stdio_stream updated.
* stream.h (make_stdio_stream, make_pipe_stream): Declarations updated.
(make_tail_stream, open_tail): Declared.
* txr.c (txr_main): Calls to make_stdio_stream updated.
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES: Updated.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version, set date and documented string-cmp.
* configure (txr_ver): Bumped.
* eval.c (eval_init): Forgotten string-cmp registered as intrinsic.
* txr.vim: Highlighting for string-cmp.
* RELNOTES: Updated.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version and set date.
* configure (txr_ver): Bumped.
* RELNOTES: Updated.
|