Merge branch '24.x.x-rc'

This commit is contained in:
Daniel Kochmański 2024-05-10 13:13:55 +02:00
commit e4269ea51f
156 changed files with 3738 additions and 3319 deletions

View file

@ -27,7 +27,61 @@
install ECL on the preferred destination (specified with "--prefix"
parameter given to configure script).
* Pending changes since 23.9.9
* Pending changes since 24.5.10
- Many internal improvements and bug fixes for the native compiler
* 24.5.10 changes since 23.9.9
** Announcement
Dear Community,
We are announcing a new stable ECL release. The release mainly includes a
number of bug fixes, including changes that prevent rare crashes in the
garbage collector on Mac OS X, some bug fixes for gray streams and for
pathname related functionality. Moreover, the release features new
extensions for gray streams (gray:stream-line-length,
gray:stream-file-length, gray:stream-file-string-length and generic
versions of cl:pathname and cl:truename) as well as improved emscripten
support (allowing shared library builds) and small improvements to the
manual.
We'd like to thank all people who contributed to ECL with code, testing,
issue reports and otherwise.
People listed here contributed code in this iteration: Daniel Kochmański,
Kirill A. Korinsky, Marius Gerbershagen, Tarn W. Burton, Mark Shroyer,
Dmitry Solomennikov, Kevin Zheng.
This release is available for download in a form of a source code archive
(we do not ship prebuilt binaries):
- [ECL 24.5.10 tarball archive](https://common-lisp.net/project/ecl/static/files/release/ecl-24.5.10.tgz)
- [The ECL Manual](https://common-lisp.net/project/ecl/static/manual/)
Happy Hacking,
The ECL Developers
** Enhancements
- Add gray-streams module. This makes it possible to load Gray stream
support via ~(require '#:gray-streams)~ versus calling the internal
function ~gray::redefine-cl-functions~.
- Add support for some Gray stream extensions by adding the following
generic functions.
1) ~gray:stream-line-length~ which allows stream specific line lengths
when ~cl:*print-right-margin*~ is NIL.
2) ~gray:stream-file-length~ which allows Gray streams to implement
~cl:file-length~.
3) ~gray:stream-file-string-length~ which allows Gray streams to
implement ~cl:file-string-length~.
4) Generic versions of ~cl:pathname~ and ~cl:truename~.
- The emscripten target now supports shared libraries.
** Bugs fixed
- Various bug fixes for Gray streams.
- The garbarge collector is set up to automatically handle fork calls on
Unix systems, preventing rare crashes on Mac OS X (where bdwgc does not
enable this option by default).
* 23.9.9 changes since 21.2.1
** Announcement
Dear Community,

199
COPYING
View file

@ -1,13 +1,14 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
@ -16,97 +17,109 @@ freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LIBRARY GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
@ -255,7 +268,7 @@ distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
@ -282,23 +295,31 @@ of these things:
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
@ -347,7 +368,7 @@ Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
@ -390,7 +411,7 @@ excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
@ -436,7 +457,7 @@ DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Libraries
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
@ -453,18 +474,18 @@ convey the exclusion of warranty; and each file should have at least the
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.

18
INSTALL
View file

@ -127,9 +127,6 @@ Emscripten target is a little fickle so keep in mind that:
- to build emscripten you need to use their SDK that provides the toolchain, and
set the environment variable EMSDK_PATH
- the optimization level -O0 is forced because otherwsise binaryen miscompiles
ECL
1. Build the host ECL
#+begin_src shell-script
@ -166,21 +163,20 @@ After that activate the toolchain and configure build flags:
--build=x86_64-pc-linux-gnu \
--with-cross-config=`pwd`/src/util/wasm32-unknown-emscripten.cross_config \
--prefix=`pwd`/ecl-emscripten \
--disable-shared \
--with-tcp=no \
--with-cmp=no
emmake make && emmake make install
# some files need to be copied manually
cp build/bin/ecl.js build/bin/ecl.wasm ecl-emscripten/bin
cp build/bin/ecl.js build/bin/ecl.wasm ecl-emscripten/
#+end_src
4. ECL may be hosted on a web page. Assuming that you have quicklisp installed:
#+begin_src shell-script
export WEBSERVER=`pwd`/src/util/webserver.lisp
pushd ecl-emscripten/bin
pushd ecl-emscripten/
lisp --load $WEBSERVER
# After the server is loaded run:
# firefox localhost:8888/ecl.html
@ -189,3 +185,13 @@ After that activate the toolchain and configure build flags:
If the output does not show on the webpage then open the javascript console.
This is a default html website produced by emscripten.
5. Build an external program linked against libecl.so
The default stack size proposed by emscripten is 64KB. This is too little for
ECL, so when you build a program that is linked against libecl.so, then it is
imoprtant to specify a different size. For example:
#+begin_src shell-script
emcc program.c -sSTACK_SIZE=1048576 libecl.so -I./ -o program.o
#+end_src

22
LICENSE
View file

@ -1,25 +1,25 @@
---- BEGINNING OF COPYRIGHT FOR THE ECL CORE ENVIRONMENT ------------
Copyright (c) 2019 Daniel Kochmański and Marius Gerbershagen
Copyright (c) 2019-2024 Daniel Kochmański and Marius Gerbershagen
Copyright (c) 2015-2018, Daniel Kochmański
Copyright (c) 2000-2013, Juan Jose Garcia Ripoll
Copyright (c) 1990, 1991, 1993 Giuseppe Attardi
Copyright (c) 1984 Taiichi Yuasa and Masami Hagiya
All Rights Reserved
ECL is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version; see file 'Copying'.
ECL is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
PLEASE NOTE THAT:

View file

@ -77,6 +77,8 @@ INSTALL_TARGET = @INSTALL_TARGET@
install: build/Makefile
cd build; $(MAKE) $(INSTALL_TARGET)
flatinstall: build/Makefile
cd build; $(MAKE) flatinstall
uninstall:
cd build; $(MAKE) uninstall
@ -115,6 +117,9 @@ realclean: distclean
check:
cd build && $(MAKE) check TESTS="$(TESTS)"
ansi-test:
cd build && $(MAKE) ansi-test
# ==================== Various means of distribution ====================
TAR_DIR=ecl-$(VERSION)

View file

@ -122,8 +122,8 @@
(write binary :stream sout :circle t :escape t :readably t :pretty nil))
(terpri sout)))))
(when load
(load output-file :verbose *compile-verbose*))
(values output-file nil nil))
(si::load-bytecodes output-file *compile-verbose* *load-print* :default))
(values (truename output-file) nil nil))
(defun install-bytecodes-compiler ()
(ext::package-lock (find-package :cl) nil)

View file

@ -10,8 +10,8 @@ srcdir = ..\src
SHORT_SITE_NAME =
LONG_SITE_NAME =
ECL_VERSION = 23.9.9
ECL_VERSION_NUMBER= 230909
ECL_VERSION = 24.5.10
ECL_VERSION_NUMBER= 240510
ARCHITECTURE = PENTIUM4
SOFTWARE_TYPE = NT
SOFTWARE_VERSION = 5.0
@ -274,6 +274,7 @@ compile.lsp: bare.lsp $(srcdir)/compile.lsp.in Makefile
"@LDFLAGS@" "$(LDFLAGS)" \
"@SHARED_LDFLAGS@" "$(SHARED_LDFLAGS)" \
"@BUNDLE_LDFLAGS@" "$(SHARED_LDFLAGS)" \
"@PROGRAM_LDFLAGS@" "" \
"@CLIBS@" "$(CLIBS)" \
"@STATICLIBS@" "$(STATICLIBS)" \
"@LIBS@" "$(LIBS)" \
@ -316,6 +317,7 @@ cmp/cmpdefs.lsp: $(srcdir)/cmp/cmpdefs.lsp Makefile
"@LDFLAGS@" "$(LDFLAGS)" \
"@SHARED_LDFLAGS@" "$(SHARED_LDFLAGS)" \
"@BUNDLE_LDFLAGS@" "$(SHARED_LDFLAGS)" \
"@PROGRAM_LDFLAGS@" "" \
"@CLIBS@" "$(CLIBS)" \
"@STATICLIBS@" "$(STATICLIBS)" \
"@OBJEXT@" "obj" \

View file

@ -1,17 +1,12 @@
/*
config.h.in -- Template configuration file.
* Copyright (c) 1990, Giuseppe Attardi.
* Copyright (c) 2001, Juan Jose Garcia Ripoll.
*
* See file 'LICENSE' for the copyright details.
*
*/
/*
Copyright (c) 1990, Giuseppe Attardi.
Copyright (c) 2001, Juan Jose Garcia Ripoll.
ECoLisp is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
See file '../Copyright' for full details.
*/
/* config.h.in -- Template configuration file. */
#define ECL_MS_WINDOWS_HOST

View file

@ -11,10 +11,10 @@ IF NOT "%1" == "" (
goto LOOP
)
IF %CMDTYPE% == --compile (
IF "%CMDTYPE%" == "--compile" (
cl @ECL_CFLAGS@ -I@includedir@ %CMDARGS%
GOTO END
) ELSE IF %CMDTYPE% == --link (
) ELSE IF "%CMDTYPE%" == "--link" (
cl %CMDARGS% @LDFLAGS@ @libdir@/ecl.lib
GOTO END
)

View file

@ -2,10 +2,10 @@
REM Script converted from ecl-config
REM (Michael Goffioul)
IF %1 == --cflags (
IF "%1" == "--cflags" (
ECHO @ECL_CFLAGS@ -I@includedir@
GOTO END
) ELSE IF %1 == --libs (
) ELSE IF "%1" == "--libs" (
ECHO @LDFLAGS@ /link /LIBPATH:@libdir@ ecl.lib @CLIBS@
GOTO END
)

View file

@ -273,6 +273,9 @@ test_changes:
check:
cd tests && $(MAKE) clean && $(MAKE) check TESTS="$(TESTS)"
ansi-test:
cd tests && $(MAKE) clean && $(MAKE) ansi-test
#
# Rebuild ECL using its own image and compare. Does not work
# right now.

5
src/aclocal.m4 vendored
View file

@ -533,6 +533,11 @@ case "${host}" in
enable_threads='no'
enable_libffi='no'
enable_gmp='portable'
with_c_gmp=yes
SHARED_LDFLAGS="-shared -sSIDE_MODULE ${LDFLAGS}"
BUNDLE_LDFLAGS="-shared -sSIDE_MODULE ${LDFLAGS}"
PROGRAM_LDFLAGS="-sMAIN_MODULE -sERROR_ON_UNDEFINED_SYMBOLS=0 ${LDFLAGS}"
INSTALL_TARGET='flatinstall'
;;
esac

View file

@ -760,10 +760,15 @@ init_alloc(void)
* the begining or to the first byte.
* 3) Out of the incremental garbage collector, we only use the
* generational component.
* 4) GC should handle fork() which is used to run subprocess on
* some platforms.
*/
GC_set_no_dls(1);
GC_set_all_interior_pointers(0);
GC_set_time_limit(GC_TIME_UNLIMITED);
#ifndef ECL_MS_WINDOWS_HOST
GC_set_handle_fork(1);
#endif
GC_init();
#ifdef ECL_THREADS
# if GC_VERSION_MAJOR > 7 || GC_VERSION_MINOR > 1

View file

@ -2,17 +2,12 @@
/* vim: set filetype=c tabstop=8 shiftwidth=4 expandtab: */
/*
fpe_none.c -- Nonportable component of the floating point code (dummy)
*/
/*
Copyright (c) 2005, Juan Jose Garcia Ripoll.
ECL is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
See file '../Copyright' for full details.
* fpe_none.c -- Nonportable component of the floating point code (dummy)
*
* Copyright (c) 2005, Juan Jose Garcia Ripoll.
*
* See file 'LICENSE' for the copyright details.
*
*/
/*

View file

@ -2,22 +2,15 @@
/* vim: set filetype=c tabstop=8 shiftwidth=4 expandtab: */
/*
fpe_x86.c -- Nonportable component of the floating point code
*/
/*
Copyright (c) 2005, Juan Jose Garcia Ripoll.
ECL is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
See file '../Copyright' for full details.
* fpe_x86.c -- Nonportable component of the floating point code
*
* Copyright (c) 2005, Juan Jose Garcia Ripoll.
*
* See file 'LICENSE' for the copyright details.
*
*/
/*
* See fpe_none.c for a description
*/
/* See fpe_none.c for a description. */
#ifdef _MSC_VER
# ifdef _WIN64

View file

@ -224,6 +224,20 @@ not_output_finish_output(cl_object strm)
not_an_output_stream(strm);
}
static cl_object
not_output_string_length(cl_object strm, cl_object string)
{
not_an_output_stream(strm);
return 0;
}
static cl_object
not_file_string_length(cl_object strm, cl_object string)
{
not_a_file_stream(strm);
return 0;
}
static int
unknown_column(cl_object strm)
{
@ -1158,6 +1172,51 @@ utf_8_encoder(cl_object stream, unsigned char *buffer, ecl_character c)
}
#endif
static cl_index
compute_char_size(cl_object stream, ecl_character c)
{
unsigned char buffer[5];
int l = 0;
if (c == ECL_CHAR_CODE_NEWLINE) {
int flags = stream->stream.flags;
if (flags & ECL_STREAM_CR) {
l += stream->stream.encoder(stream, buffer, ECL_CHAR_CODE_RETURN);
if (flags & ECL_STREAM_LF)
l += stream->stream.encoder(stream, buffer,
ECL_CHAR_CODE_LINEFEED);
} else {
l += stream->stream.encoder(stream, buffer, ECL_CHAR_CODE_LINEFEED);
}
} else {
l += stream->stream.encoder(stream, buffer, c);
}
return l;
}
cl_object
file_string_length(cl_object stream, cl_object string)
{
cl_fixnum l = 0;
switch (ecl_t_of(string)) {
#ifdef ECL_UNICODE
case t_string:
#endif
case t_base_string: {
cl_index i;
for (i = 0; i < string->base_string.fillp; i++) {
l += compute_char_size(stream, ecl_char(string, i));
}
break;
}
case t_character:
l = compute_char_size(stream, ECL_CHAR_CODE(string));
break;
default:
FEwrong_type_nth_arg(@[file-string-length], 2, string, @[string]);
}
return ecl_make_fixnum(l);
}
/********************************************************************************
* CLOS STREAMS
*/
@ -1313,7 +1372,11 @@ clos_stream_element_type(cl_object strm)
return _ecl_funcall2(@'gray::stream-element-type', strm);
}
#define clos_stream_length not_a_file_stream
static cl_object
clos_stream_length(cl_object strm)
{
return _ecl_funcall2(@'gray::stream-file-length', strm);
}
static cl_object
clos_stream_get_position(cl_object strm)
@ -1327,6 +1390,12 @@ clos_stream_set_position(cl_object strm, cl_object pos)
return _ecl_funcall3(@'gray::stream-file-position', strm, pos);
}
static cl_object
clos_stream_string_length(cl_object strm, cl_object string)
{
return _ecl_funcall3(@'gray::stream-file-string-length', strm, string);
}
static int
clos_stream_column(cl_object strm)
{
@ -1334,6 +1403,18 @@ clos_stream_column(cl_object strm)
return Null(col)? -1 : ecl_to_size(ecl_floor1(col));
}
static cl_object
clos_stream_pathname(cl_object strm)
{
return _ecl_funcall2(@'gray::pathname', strm);
}
static cl_object
clos_stream_truename(cl_object strm)
{
return _ecl_funcall2(@'gray::truename', strm);
}
static cl_object
clos_stream_close(cl_object strm)
{
@ -1369,7 +1450,12 @@ const struct ecl_file_ops clos_stream_ops = {
clos_stream_length,
clos_stream_get_position,
clos_stream_set_position,
clos_stream_string_length,
clos_stream_column,
clos_stream_pathname,
clos_stream_truename,
clos_stream_close
};
#endif /* ECL_CLOS_STREAMS */
@ -1401,6 +1487,26 @@ str_out_get_position(cl_object strm)
return ecl_make_unsigned_integer(STRING_OUTPUT_STRING(strm)->base_string.fillp);
}
static cl_object
str_out_string_length(cl_object strm, cl_object string)
{
cl_fixnum l = 0;
switch (ecl_t_of(string)) {
#ifdef ECL_UNICODE
case t_string:
#endif
case t_base_string:
l = string->base_string.fillp;
break;
case t_character:
l = 1;
break;
default:
FEwrong_type_nth_arg(@[file-string-length], 2, string, @[string]);
}
return ecl_make_fixnum(l);
}
static cl_object
str_out_set_position(cl_object strm, cl_object pos)
{
@ -1450,7 +1556,12 @@ const struct ecl_file_ops str_out_ops = {
not_a_file_stream, /* length */
str_out_get_position,
str_out_set_position,
str_out_string_length,
generic_column,
not_a_file_stream,
not_a_file_stream,
generic_close
};
@ -1638,7 +1749,12 @@ const struct ecl_file_ops str_in_ops = {
not_a_file_stream, /* length */
str_in_get_position,
str_in_set_position,
not_output_string_length,
unknown_column,
not_a_file_stream,
not_a_file_stream,
generic_close
};
@ -1834,7 +1950,12 @@ const struct ecl_file_ops two_way_ops = {
not_a_file_stream, /* length */
generic_always_nil, /* get_position */
generic_set_position,
not_file_string_length,
two_way_column,
not_a_file_stream,
not_a_file_stream,
two_way_close
};
@ -1971,6 +2092,15 @@ broadcast_set_position(cl_object strm, cl_object pos)
return ecl_file_position_set(ECL_CONS_CAR(l), pos);
}
cl_object
broadcast_string_length(cl_object strm, cl_object string)
{
cl_object l = BROADCAST_STREAM_LIST(strm);
if (Null(l))
return ecl_make_fixnum(1);
return ecl_file_string_length(ECL_CONS_CAR(ecl_last(l, 1)), string);
}
static int
broadcast_column(cl_object strm)
{
@ -2018,7 +2148,12 @@ const struct ecl_file_ops broadcast_ops = {
broadcast_length,
broadcast_get_position,
broadcast_set_position,
broadcast_string_length,
broadcast_column,
not_a_file_stream,
not_a_file_stream,
broadcast_close
};
@ -2203,7 +2338,12 @@ const struct ecl_file_ops echo_ops = {
not_a_file_stream, /* length */
generic_always_nil, /* get_position */
generic_set_position,
not_file_string_length,
echo_column,
not_a_file_stream,
not_a_file_stream,
echo_close
};
@ -2349,7 +2489,12 @@ const struct ecl_file_ops concatenated_ops = {
not_a_file_stream, /* length */
generic_always_nil, /* get_position */
generic_set_position,
not_output_string_length,
unknown_column,
not_a_file_stream,
not_a_file_stream,
concatenated_close
};
@ -2523,12 +2668,30 @@ synonym_set_position(cl_object strm, cl_object pos)
return ecl_file_position_set(SYNONYM_STREAM_STREAM(strm), pos);
}
static cl_object
synonym_string_length(cl_object strm, cl_object string)
{
return ecl_file_string_length(SYNONYM_STREAM_STREAM(strm), string);
}
static int
synonym_column(cl_object strm)
{
return ecl_file_column(SYNONYM_STREAM_STREAM(strm));
}
static cl_object
synonym_pathname(cl_object strm)
{
return ecl_stream_pathname(SYNONYM_STREAM_STREAM(strm));
}
static cl_object
synonym_truename(cl_object strm)
{
return ecl_stream_truename(SYNONYM_STREAM_STREAM(strm));
}
const struct ecl_file_ops synonym_ops = {
synonym_write_byte8,
synonym_read_byte8,
@ -2558,7 +2721,12 @@ const struct ecl_file_ops synonym_ops = {
synonym_length,
synonym_get_position,
synonym_set_position,
synonym_string_length,
synonym_column,
synonym_pathname,
synonym_truename,
generic_close
};
@ -3053,6 +3221,18 @@ io_file_write_vector(cl_object strm, cl_object data, cl_index start, cl_index en
return generic_write_vector(strm, data, start, end);
}
static cl_object
io_file_pathname(cl_object strm)
{
return IO_STREAM_FILENAME(strm);
}
static cl_object
io_file_truename(cl_object strm)
{
return cl_truename(IO_STREAM_FILENAME(strm));
}
const struct ecl_file_ops io_file_ops = {
io_file_write_byte8,
io_file_read_byte8,
@ -3082,7 +3262,12 @@ const struct ecl_file_ops io_file_ops = {
io_file_length,
io_file_get_position,
io_file_set_position,
file_string_length,
generic_column,
io_file_pathname,
io_file_truename,
io_file_close
};
@ -3115,7 +3300,12 @@ const struct ecl_file_ops output_file_ops = {
io_file_length,
io_file_get_position,
io_file_set_position,
file_string_length,
generic_column,
io_file_pathname,
io_file_truename,
io_file_close
};
@ -3148,7 +3338,12 @@ const struct ecl_file_ops input_file_ops = {
io_file_length,
io_file_get_position,
io_file_set_position,
not_output_string_length,
unknown_column,
io_file_pathname,
io_file_truename,
io_file_close
};
@ -3734,7 +3929,12 @@ const struct ecl_file_ops io_stream_ops = {
io_stream_length,
io_stream_get_position,
io_stream_set_position,
file_string_length,
generic_column,
io_file_pathname,
io_file_truename,
io_stream_close
};
@ -3767,7 +3967,12 @@ const struct ecl_file_ops output_stream_ops = {
io_stream_length,
io_stream_get_position,
io_stream_set_position,
file_string_length,
generic_column,
io_file_pathname,
io_file_truename,
io_stream_close
};
@ -3800,7 +4005,12 @@ const struct ecl_file_ops input_stream_ops = {
io_stream_length,
io_stream_get_position,
io_stream_set_position,
not_output_string_length,
unknown_column,
io_file_pathname,
io_file_truename,
io_stream_close
};
@ -3944,8 +4154,12 @@ const struct ecl_file_ops winsock_stream_io_ops = {
not_a_file_stream,
generic_always_nil, /* get_position */
generic_set_position,
file_string_length,
generic_column,
not_a_file_stream,
not_a_file_stream,
winsock_stream_close
};
@ -3978,8 +4192,12 @@ const struct ecl_file_ops winsock_stream_output_ops = {
not_a_file_stream,
generic_always_nil, /* get_position */
generic_set_position,
file_string_length,
generic_column,
not_a_file_stream,
not_a_file_stream,
winsock_stream_close
};
@ -4012,8 +4230,12 @@ const struct ecl_file_ops winsock_stream_input_ops = {
not_a_file_stream,
generic_always_nil, /* get_position */
generic_set_position,
not_output_string_length,
unknown_column,
not_a_file_stream,
not_a_file_stream,
winsock_stream_close
};
#endif
@ -4117,8 +4339,12 @@ const struct ecl_file_ops wcon_stream_io_ops = {
not_a_file_stream,
generic_always_nil, /* get_position */
generic_set_position,
file_string_length,
generic_column,
io_file_pathname,
io_file_truename,
generic_close,
};
@ -4312,7 +4538,7 @@ ecl_make_stream_from_FILE(cl_object fname, void *f, enum ecl_smmode smm,
FEerror("Not a valid mode ~D for ecl_make_stream_from_FILE", 1, ecl_make_fixnum(smm));
}
set_stream_elt_type(stream, byte_size, flags, external_format);
IO_STREAM_FILENAME(stream) = fname; /* not really used */
IO_STREAM_FILENAME(stream) = fname;
stream->stream.column = 0;
IO_STREAM_FILE(stream) = f;
stream->stream.last_op = 0;
@ -4589,7 +4815,12 @@ const struct ecl_file_ops seq_in_ops = {
not_a_file_stream, /* length */
seq_in_get_position,
seq_in_set_position,
not_output_string_length,
unknown_column,
not_a_file_stream,
not_a_file_stream,
generic_close
};
@ -4794,7 +5025,12 @@ const struct ecl_file_ops seq_out_ops = {
not_a_file_stream, /* length */
seq_out_get_position,
seq_out_set_position,
not_output_string_length,
generic_column,
not_a_file_stream,
not_a_file_stream,
generic_close
};
@ -4984,6 +5220,12 @@ ecl_file_position_set(cl_object strm, cl_object pos)
return stream_dispatch_table(strm)->set_position(strm, pos);
}
cl_object
ecl_file_string_length(cl_object strm, cl_object string)
{
return stream_dispatch_table(strm)->string_length(strm, string);
}
bool
ecl_input_stream_p(cl_object strm)
{
@ -5008,6 +5250,18 @@ ecl_interactive_stream_p(cl_object strm)
return stream_dispatch_table(strm)->interactive_p(strm);
}
cl_object
ecl_stream_pathname(cl_object strm)
{
return stream_dispatch_table(strm)->pathname(strm);
}
cl_object
ecl_stream_truename(cl_object strm)
{
return stream_dispatch_table(strm)->truename(strm);
}
/*
* ecl_read_char(s) tries to read a character from the stream S. It outputs
* either the code of the character read, or EOF. Whe compiled with
@ -5046,74 +5300,10 @@ writestr_stream(const char *s, cl_object strm)
si_put_buffer_string(buffer);
}
static cl_index
compute_char_size(cl_object stream, ecl_character c)
{
unsigned char buffer[5];
int l = 0;
if (c == ECL_CHAR_CODE_NEWLINE) {
int flags = stream->stream.flags;
if (flags & ECL_STREAM_CR) {
l += stream->stream.encoder(stream, buffer, ECL_CHAR_CODE_RETURN);
if (flags & ECL_STREAM_LF)
l += stream->stream.encoder(stream, buffer,
ECL_CHAR_CODE_LINEFEED);
} else {
l += stream->stream.encoder(stream, buffer, ECL_CHAR_CODE_LINEFEED);
}
} else {
l += stream->stream.encoder(stream, buffer, c);
}
return l;
}
cl_object
cl_file_string_length(cl_object stream, cl_object string)
{
cl_fixnum l = 0;
/* This is a stupid requirement from the spec. Why returning 1???
* Why not simply leaving the value unspecified, as with other
* streams one cannot write to???
*/
BEGIN:
#ifdef ECL_CLOS_STREAMS
if (ECL_INSTANCEP(stream)) {
@(return ECL_NIL);
}
#endif
unlikely_if (!ECL_ANSI_STREAM_P(stream)) {
FEwrong_type_only_arg(@[file-string-length], stream, @[stream]);
}
if (stream->stream.mode == ecl_smm_broadcast) {
stream = BROADCAST_STREAM_LIST(stream);
if (Null(stream)) {
@(return ecl_make_fixnum(1));
} else {
stream = ECL_CONS_CAR(ecl_last(stream, 1));
goto BEGIN;
}
}
unlikely_if (!ECL_FILE_STREAM_P(stream)) {
not_a_file_stream(stream);
}
switch (ecl_t_of(string)) {
#ifdef ECL_UNICODE
case t_string:
#endif
case t_base_string: {
cl_index i;
for (i = 0; i < string->base_string.fillp; i++) {
l += compute_char_size(stream, ecl_char(string, i));
}
break;
}
case t_character:
l = compute_char_size(stream, ECL_CHAR_CODE(string));
break;
default:
FEwrong_type_nth_arg(@[file-string-length], 2, string, @[string]);
}
@(return ecl_make_fixnum(l));
@(return ecl_file_string_length(stream, string));
}
cl_object

View file

@ -83,7 +83,11 @@ cl_fixnum ecl_option_values[ECL_OPT_LIMIT+1] = {
1, /* ECL_OPT_TRAP_SIGBUS */
1, /* ECL_OPT_TRAP_SIGPIPE */
1, /* ECL_OPT_TRAP_INTERRUPT_SIGNAL */
#if defined(ECL_THREADS) && defined(HAVE_SIGPROCMASK)
1, /* ECL_OPT_SIGNAL_HANDLING_THREAD */
#else
0, /* ECL_OPT_SIGNAL_HANDLING_THREAD */
#endif
16, /* ECL_OPT_SIGNAL_QUEUE_SIZE */
0, /* ECL_OPT_BOOTED */
8192, /* ECL_OPT_BIND_STACK_SIZE */
@ -840,83 +844,6 @@ si_argv(cl_object index)
FEerror("Illegal argument index: ~S.", 1, index);
}
cl_object
si_getenv(cl_object var)
{
const char *value;
/* Strings have to be null terminated base strings */
var = si_copy_to_simple_base_string(var);
value = getenv((char*)var->base_string.self);
@(return ((value == NULL)? ECL_NIL : ecl_make_simple_base_string(value,-1)));
}
#if defined(HAVE_SETENV) || defined(HAVE_PUTENV)
cl_object
si_setenv(cl_object var, cl_object value)
{
const cl_env_ptr the_env = ecl_process_env();
cl_fixnum ret_val;
/* Strings have to be null terminated base strings */
var = si_copy_to_simple_base_string(var);
if (value == ECL_NIL) {
#ifdef HAVE_SETENV
/* Remove the variable when setting to nil, so that
* (si:setenv "foo" nil), then (si:getenv "foo) returns
* the right thing. */
unsetenv((char*)var->base_string.self);
#else
#if defined(ECL_MS_WINDOWS_HOST)
si_setenv(var, cl_core.null_string);
#else
putenv((char*)var->base_string.self);
#endif
#endif
ret_val = 0;
} else {
#ifdef HAVE_SETENV
value = si_copy_to_simple_base_string(value);
ret_val = setenv((char*)var->base_string.self,
(char*)value->base_string.self, 1);
#else
value = cl_format(4, ECL_NIL, @"~A=~A", var,
value);
value = si_copy_to_simple_base_string(value);
putenv((char*)value->base_string.self);
#endif
}
if (ret_val == -1)
CEerror(ECL_T, "SI:SETENV failed: insufficient space in environment.",
1, ECL_NIL);
ecl_return1(the_env, value);
}
#endif
cl_object
si_environ(void)
{
cl_object output = ECL_NIL;
#ifdef HAVE_ENVIRON
char **p;
extern char **environ;
for (p = environ; *p; p++) {
output = CONS(ecl_make_constant_base_string(*p,-1), output);
}
output = cl_nreverse(output);
#else
# if defined(ECL_MS_WINDOWS_HOST)
LPTCH p;
for (p = GetEnvironmentStrings(); *p; ) {
output = CONS(ecl_make_constant_base_string(p,-1), output);
do { (void)0; } while (*(p++));
}
output = cl_nreverse(output);
# endif
#endif /* HAVE_ENVIRON */
@(return output);
}
cl_object
si_pointer(cl_object x)
{

View file

@ -746,27 +746,15 @@ cl_pathname(cl_object x)
x = cl_parse_namestring(1, x);
case t_pathname:
break;
case t_stream:
switch ((enum ecl_smmode)x->stream.mode) {
case ecl_smm_input:
case ecl_smm_output:
case ecl_smm_probe:
case ecl_smm_io:
case ecl_smm_input_file:
case ecl_smm_output_file:
case ecl_smm_io_file:
x = IO_STREAM_FILENAME(x);
goto L;
case ecl_smm_synonym:
x = SYNONYM_STREAM_STREAM(x);
goto L;
default:
;/* Fall through to error message */
}
default: {
if (!Null(cl_streamp(x))) {
x = ecl_stream_pathname(x);
goto L;
} else {
const char *type = "(OR FILE-STREAM STRING PATHNAME)";
FEwrong_type_only_arg(@[pathname], x, ecl_read_from_cstring(type));
}
break;
}
@(return x);
}
@ -785,7 +773,6 @@ cl_logical_pathname(cl_object x)
@(return x);
}
/* FIXME! WILD-PATHNAME-P is missing! */
@(defun wild-pathname-p (pathname &optional component)
bool checked = 0;
@

View file

@ -2,14 +2,10 @@
/* vim: set filetype=c tabstop=8 shiftwidth=4 expandtab: */
/*
Copyright (c) 2010, Juan Jose Garcia Ripoll.
ECL is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
See file '../../Copyright' for full details.
* Copyright (c) 2010, Juan Jose Garcia Ripoll.
*
* See file 'LICENSE' for the copyright details.
*
*/
#define ECL_INCLUDE_MATH_H

View file

@ -1579,7 +1579,8 @@ do_read_delimited_list(int d, cl_object in, bool proper_list)
if (!ECL_ANSI_STREAM_P(strm)) {
value0 = _ecl_funcall2(@'gray::stream-read-line', strm);
value1 = ecl_nth_value(the_env, 1);
if (Null(value0) && !Null(value1)) {
if ((Null(value0) || (ECL_STRINGP(value0) && (ecl_length(value0) == 0))) &&
!Null(value1)) {
if (!Null(eof_errorp))
FEend_of_file(strm);
value0 = eof_value;

View file

@ -807,7 +807,7 @@ si_set_limit(cl_object type, cl_object limit)
} else if (type == @'ext::lisp-stack') {
cl_index the_size = ecl_to_size(limit);
ecl_stack_set_size(env, the_size);
} else {
} else if (type == @'ext::heap-size') {
/*
* size_t can be larger than cl_index, and ecl_to_size()
* creates a fixnum which is too small for size_t on 32-bit.
@ -823,7 +823,7 @@ cl_object
si_get_limit(cl_object type)
{
cl_env_ptr env = ecl_process_env();
cl_index output;
cl_index output = 0;
if (type == @'ext::frame-stack')
output = env->frs_limit_size;
else if (type == @'ext::binding-stack')
@ -832,7 +832,7 @@ si_get_limit(cl_object type)
output = env->cs_limit_size;
else if (type == @'ext::lisp-stack')
output = env->stack_limit_size;
else {
else if (type == @'ext::heap-size') {
/* size_t can be larger than cl_index */
ecl_return1(env, ecl_make_unsigned_integer(cl_core.max_heap_size));
}

View file

@ -1846,6 +1846,8 @@ cl_symbols[] = {
{SYS_ "APPLY-FROM-STACK-FRAME" ECL_FUN("si_apply_from_stack_frame", si_apply_from_stack_frame, 2) ECL_VAR(SI_ORDINARY, OBJNULL)},
#ifdef ECL_CLOS_STREAMS
{GRAY_ "PATHNAME" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "TRUENAME" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "CLOSE" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAMP" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "INPUT-STREAM-P" ECL_FUN(NULL, NULL, 1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
@ -1856,12 +1858,15 @@ cl_symbols[] = {
{GRAY_ "STREAM-CLEAR-OUTPUT" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-ELEMENT-TYPE" ECL_FUN(NULL, NULL, 1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-FILE-DESCRIPTOR" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-FILE-LENGTH" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-FILE-POSITION" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-FILE-STRING-LENGTH" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-FINISH-OUTPUT" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-FORCE-OUTPUT" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-FRESH-LINE" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-INTERACTIVE-P" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-LINE-COLUMN" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-LINE-LENGTH" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-LISTEN" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-PEEK-CHAR" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},
{GRAY_ "STREAM-READ-BYTE" ECL_FUN(NULL, NULL, -1) ECL_VAR(GRAY_ORDINARY, OBJNULL)},

View file

@ -460,6 +460,9 @@ file_truename(cl_object pathname, cl_object filename, int flags)
cl_object
cl_truename(cl_object orig_pathname)
{
if (!Null(cl_streamp(orig_pathname)))
@(return ecl_stream_truename(orig_pathname));
cl_object pathname = make_absolute_pathname(orig_pathname);
cl_object base_dir = make_base_pathname(pathname);
cl_object dir;
@ -749,10 +752,10 @@ ecl_homedir_pathname(cl_object user)
#ifdef HAVE_PWD_H
pwent = getpwnam(p);
if (pwent == NULL)
FEerror("Unknown user ~S.", 1, p);
FEerror("Unknown user ~S.", 1, user);
namestring = ecl_make_simple_filename(pwent->pw_dir,-1);
#endif
FEerror("Unknown user ~S.", 1, p);
FEerror("Unknown user ~S.", 1, user);
} else if ((h = ecl_getenv(ecl_fstr("HOME")))) {
namestring = ecl_make_simple_filename(h,-1);
#if defined(ECL_MS_WINDOWS_HOST)
@ -1012,7 +1015,7 @@ dir_recursive(cl_object base_dir, cl_object directory, cl_object filemask, int f
* for the file part.
*/
if (Null(base_dir))
return ECL_NIL;
return output;
directory = ECL_CONS_CDR(directory);
goto AGAIN;
}

View file

@ -1,21 +1,16 @@
/* -*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*- */
/* vim: set filetype=c tabstop=8 shiftwidth=4 expandtab: */
/* -*- Mode: C; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/* vim: set filetype=c tabstop=2 shiftwidth=2 expandtab: */
/*
unixint.d -- Unix interrupt interface.
*/
/*
Copyright (c) 1984, Taiichi Yuasa and Masami Hagiya.
Copyright (c) 1990, Giuseppe Attardi.
Copyright (c) 2001, Juan Jose Garcia Ripoll.
Copyright (c) 2016, Daniel Kochmański.
ECL is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
See file '../Copyright' for full details.
* unixint.d -- Unix interrupt interface.
*
* Copyright (c) 1984, Taiichi Yuasa and Masami Hagiya.
* Copyright (c) 1990, Giuseppe Attardi.
* Copyright (c) 2001, Juan Jose Garcia Ripoll.
* Copyright (c) 2016, Daniel Kochmański.
*
* See file 'LICENSE' for the copyright details.
*
*/
/**********************************************************************
@ -92,6 +87,7 @@
# endif
# include <sys/mman.h>
#endif
#include <ecl/internal.h>
#include <ecl/ecl-inl.h>
#include <ecl/impl/math_fenv.h>
@ -354,8 +350,9 @@ handle_signal_now(cl_object signal_code)
cl_object
si_handle_signal(cl_object signal_code)
{
const cl_env_ptr the_env = ecl_process_env();
handle_signal_now(signal_code);
@(return)
ecl_return0(the_env);
}
static void
@ -872,8 +869,9 @@ handler_fn_prototype(sigsegv_handler, int sig, siginfo_t *info, void *aux)
cl_object
si_check_pending_interrupts(void)
{
const cl_env_ptr the_env = ecl_process_env();
handle_all_queued(ecl_process_env());
@(return)
ecl_return0(the_env);
}
void
@ -961,28 +959,31 @@ do_catch_signal(int code, cl_object action, cl_object process)
cl_object
si_get_signal_handler(cl_object code)
{
const cl_env_ptr the_env = ecl_process_env();
cl_object handler = ecl_gethash_safe(code, cl_core.known_signals, OBJNULL);
unlikely_if (handler == OBJNULL) {
illegal_signal_code(code);
}
@(return handler)
ecl_return0(the_env);
}
cl_object
si_set_signal_handler(cl_object code, cl_object handler)
{
const cl_env_ptr the_env = ecl_process_env();
cl_object action = ecl_gethash_safe(code, cl_core.known_signals, OBJNULL);
unlikely_if (action == OBJNULL) {
illegal_signal_code(code);
}
ecl_sethash(code, cl_core.known_signals, handler);
si_catch_signal(2, code, ECL_T);
@(return handler)
ecl_return0(the_env);
}
@(defun ext::catch-signal (code flag &key process)
@
{
const cl_env_ptr the_env = ecl_process_env();
int code_int;
unlikely_if (ecl_gethash_safe(code, cl_core.known_signals, OBJNULL) == OBJNULL) {
illegal_signal_code(code);
@ -1012,7 +1013,7 @@ si_set_signal_handler(cl_object code, cl_object handler)
FEerror("The signal handler for SIGPFE cannot be uninstalled. Use SI:TRAP-FPE instead.", 0);
}
#endif
@(return do_catch_signal(code_int, flag, process));
ecl_return1(the_env, do_catch_signal(code_int, flag, process));
}
@)
@ -1283,7 +1284,7 @@ si_trap_fpe(cl_object condition, cl_object flag)
# endif
#endif
the_env->trap_fpe_bits = bits;
@(return ecl_make_fixnum(bits))
ecl_return1(the_env, ecl_make_fixnum(bits));
}
/*
@ -1443,13 +1444,13 @@ install_fpe_signal_handlers()
/* Don't trap underflows */
si_trap_fpe(@'floating-point-underflow', ECL_NIL);
/* # if defined(ECL_IEEE_FP) */
/* /\* By default deactivate errors and accept denormals */
/* * in floating point computations. *\/ */
/* si_trap_fpe(@'floating-point-invalid-operation', ECL_NIL); */
/* si_trap_fpe(@'division-by-zero', ECL_NIL); */
/* si_trap_fpe(@'floating-point-overflow', ECL_NIL); */
/* # endif */
# if 0 && defined(ECL_IEEE_FP)
/* By default deactivate errors and accept denormals
* in floating point computations. */
si_trap_fpe(@'floating-point-invalid-operation', ECL_NIL);
si_trap_fpe(@'division-by-zero', ECL_NIL);
si_trap_fpe(@'floating-point-overflow', ECL_NIL);
# endif
}
#endif
}

View file

@ -57,6 +57,82 @@ si_system(cl_object cmd_string)
#endif
}
cl_object
si_getenv(cl_object var)
{
const char *value;
/* Strings have to be null terminated base strings */
var = si_copy_to_simple_base_string(var);
value = getenv((char*)var->base_string.self);
@(return ((value == NULL)? ECL_NIL : ecl_make_simple_base_string(value,-1)));
}
#if defined(HAVE_SETENV) || defined(HAVE_PUTENV)
cl_object
si_setenv(cl_object var, cl_object value)
{
const cl_env_ptr the_env = ecl_process_env();
cl_fixnum ret_val;
/* Strings have to be null terminated base strings */
var = si_copy_to_simple_base_string(var);
if (value == ECL_NIL) {
#ifdef HAVE_SETENV
/* Remove the variable when setting to nil, so that
* (si:setenv "foo" nil), then (si:getenv "foo) returns
* the right thing. */
unsetenv((char*)var->base_string.self);
#else
#if defined(ECL_MS_WINDOWS_HOST)
si_setenv(var, cl_core.null_string);
#else
putenv((char*)var->base_string.self);
#endif
#endif
ret_val = 0;
} else {
#ifdef HAVE_SETENV
value = si_copy_to_simple_base_string(value);
ret_val = setenv((char*)var->base_string.self,
(char*)value->base_string.self, 1);
#else
value = cl_format(4, ECL_NIL, @"~A=~A", var,
value);
value = si_copy_to_simple_base_string(value);
putenv((char*)value->base_string.self);
#endif
}
if (ret_val == -1)
CEerror(ECL_T, "SI:SETENV failed: insufficient space in environment.",
1, ECL_NIL);
ecl_return1(the_env, value);
}
#endif
cl_object
si_environ(void)
{
cl_object output = ECL_NIL;
#ifdef HAVE_ENVIRON
char **p;
for (p = environ; *p; p++) {
output = CONS(ecl_make_constant_base_string(*p,-1), output);
}
output = cl_nreverse(output);
#else
# if defined(ECL_MS_WINDOWS_HOST)
LPTCH p;
for (p = GetEnvironmentStrings(); *p; ) {
output = CONS(ecl_make_constant_base_string(p,-1), output);
do { (void)0; } while (*(p++));
}
output = cl_nreverse(output);
# endif
#endif /* HAVE_ENVIRON */
@(return output);
}
cl_object
si_getpid(void)
{

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.o
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -4,12 +4,7 @@
;;;;
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; ECoLisp is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -6,12 +6,8 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;
;;; conditions.lsp
;;;

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -4,12 +4,7 @@
;;;;
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.o
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;
;;; COMMON LISP CLASSES HIERARCHY

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(pushnew :cdr-1 *features*)

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.o
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.o
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.o
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1992, Giuseppe Attardi.
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "CLOS")

View file

@ -4,13 +4,7 @@
;;;;
;;;; Copyright (c) 2004, Juan Jose Garcia-Ripoll
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; The CLOS IO library.
;;;; See file 'LICENSE' for the copyright details.
(in-package "GRAY")
@ -95,6 +89,11 @@
stream class that is defined, a method must be defined for this
function, although it is permissible for it to always return NIL."))
;; Extension from CLASP, CMUCL, SBCL, Mezzano and SICL
(defgeneric stream-line-length (stream)
(:documentation "Return the stream line length or NIL."))
(defgeneric stream-listen (stream)
#+sb-doc
(:documentation
@ -203,6 +202,14 @@
(:documentation
"This is like CL:FILE-POSITION, but for Gray streams."))
(defgeneric stream-file-length (stream)
(:documentation
"This is like CL:FILE-LENGTH, but for Gray streams."))
(defgeneric stream-file-string-length (stream string)
(:documentation
"This is like CL:FILE-STRING-LENGTH, but for Gray streams."))
(defgeneric stream-file-descriptor (stream &optional direction)
(:documentation
"Return the file-descriptor underlaying STREAM, or NIL if not
@ -218,6 +225,14 @@
error is signaled. That is, users must add methods to explicitly
decline by returning NIL."))
(defgeneric pathname (pathspec)
(:documentation
"Returns the pathname denoted by pathspec."))
(defgeneric truename (pathspec)
(:documentation
"truename tries to find the file indicated by filespec and returns its truename."))
;;;
;;; Our class hierarchy looks like the one from Gray streams
@ -407,6 +422,16 @@
(declare (ignore stream))
nil)
;; LINE-LENGTH
(defmethod stream-line-length ((stream fundamental-character-output-stream))
nil)
(defmethod stream-line-length ((stream ansi-stream))
nil)
(defmethod stream-line-length ((stream t))
(bug-or-error stream 'stream-line-length))
;; LISTEN
@ -513,9 +538,7 @@
(loop
(let ((ch (stream-read-char stream)))
(cond ((eq ch :eof)
(return (values (if (zerop index)
nil
(si::shrink-vector res index))
(return (values (si::shrink-vector res index)
t)))
(t
(when (char= ch #\newline)
@ -593,6 +616,22 @@
(declare (ignore stream position))
nil)
;; FILE-LENGTH
(defmethod stream-file-length ((stream ansi-stream))
(file-length stream))
(defmethod stream-file-length ((stream t))
(error 'type-error :datum stream :expected-type 'file-stream))
;; FILE-STRING-LENGTH
(defmethod stream-file-string-length ((stream ansi-stream) string)
(file-string-length stream string))
(defmethod stream-file-string-length ((stream fundamental-character-output-stream) string)
nil)
;; STREAM-P
(defmethod streamp ((stream stream))
@ -691,7 +730,8 @@
;; TERPRI
(defmethod stream-terpri ((stream fundamental-character-output-stream))
(stream-write-char stream #\Newline))
(stream-write-char stream #\Newline)
nil)
(defmethod stream-terpri ((stream ansi-stream))
(cl:terpri stream))
@ -741,12 +781,45 @@
(si:file-stream-fd stream))
;;; PATHNAME
(defmethod pathname ((pathspec string))
(cl:pathname pathspec))
(defmethod pathname ((pathspec cl:pathname))
pathspec)
(defmethod pathname ((pathspec ansi-stream))
(cl:pathname pathspec))
(defmethod pathname (pathspec)
(error 'type-error :datum pathspec
:expected-type '(or string cl:pathname file-stream)))
;;; TRUENAME
(defmethod truename ((filespec string))
(cl:truename filespec))
(defmethod truename ((filespec cl:pathname))
(cl:truename filespec))
(defmethod truename ((filespec ansi-stream))
(cl:truename filespec))
(defmethod truename (filespec)
(error 'type-error :datum filespec
:expected-type '(or string cl:pathname file-stream)))
;;; Setup
(eval-when (:compile-toplevel :execute)
(defconstant +conflicting-symbols+
'(cl:close cl:stream-element-type cl:input-stream-p
cl:open-stream-p cl:output-stream-p cl:streamp)))
cl:open-stream-p cl:output-stream-p cl:streamp
cl:pathname cl:truename)))
(let ((p (find-package "GRAY")))
(export '(nil) p)
@ -821,7 +894,19 @@ them so."
(%redefine-cl-functions 'cl:file-position
'gray:stream-file-position
gray-package)
(%redefine-cl-functions 'cl:file-length
'gray:stream-file-length
gray-package)
(si::package-lock "COMMON-LISP" x)
(provide '#:gray-streams)
nil))
(pushnew :gray-streams-module *features*)
(pushnew #'(lambda (module)
(when (string-equal module '#:gray-streams)
(redefine-cl-functions)
t))
sys:*module-provider-functions*)
(setf clos::*clos-booted* t)

View file

@ -6,12 +6,7 @@
;;;; Copyright (c) 2008. Juan Jose Garcia-Ripol
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "COMPILER")

View file

@ -103,7 +103,9 @@ the environment variable TMPDIR to a different value." template))
#+msvc
(defun linker-cc (o-pathname object-files &key
(type :program)
(ld-flags (split-program-options *ld-flags*))
(ld-flags (split-program-options (if (eq type :program)
*ld-program-flags*
*ld-flags*)))
(ld-libs (split-program-options *ld-libs*)))
(safe-run-program
*ld*
@ -126,7 +128,9 @@ the environment variable TMPDIR to a different value." template))
#-msvc
(defun linker-cc (o-pathname object-files &key
(type :program)
(ld-flags (split-program-options *ld-flags*))
(ld-flags (split-program-options (if (eq type :program)
*ld-program-flags*
*ld-flags*)))
(ld-libs (split-program-options *ld-libs*)))
(declare (ignore type))
(safe-run-program

View file

@ -4,12 +4,8 @@
;;;;
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; CMPC-WT -- Routines for writing code to C files.
;;;;

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1984, Taiichi Yuasa and Masami Hagiya.
;;;; Copyright (c) 1990, Giuseppe Attardi.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;; CMPWT Output routines.

View file

@ -6,12 +6,7 @@
;;;; Copyright (c) 2003, Juan Jose Garcia-Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "COMPILER")

View file

@ -4,12 +4,7 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
(in-package #:compiler)

View file

@ -4,13 +4,7 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;;
;;;; See file 'LICENSE' for the copyright details.
(in-package #:compiler)

View file

@ -4,12 +4,7 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
(in-package #:compiler)

View file

@ -6,12 +6,7 @@
;;;; Copyright (c) 2008. Juan Jose Garcia-Ripol
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "COMPILER")

View file

@ -4,12 +4,7 @@
;;;;
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;; CMPDEF -- Definitions created at compile / configuration time
@ -62,6 +57,7 @@ coprocessor).")
(defvar *ld-shared-flags* "@SHARED_LDFLAGS@ @LDFLAGS@")
#+dlopen
(defvar *ld-bundle-flags* "@BUNDLE_LDFLAGS@ @LDFLAGS@")
(defvar *ld-program-flags* "@PROGRAM_LDFLAGS@ @LDFLAGS@")
(defvar +shared-library-prefix+ "@SHAREDPREFIX@")
(defvar +shared-library-extension+ "@SHAREDEXT@")

View file

@ -4,12 +4,8 @@
;;;;
;;;; Copyright (c) 2009, Juan Jose Garcia-Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; CMPENVAPI -- API for creating and manipulating environments
;;;;

View file

@ -6,13 +6,9 @@
;;;; Copyright (c) 1990, Giuseppe Attardi.
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; CMPENV-DECLAIM -- Proclamations local to the current file
;;;;
;;;; One implementation of DECLAIM that uses the compiler environment

View file

@ -4,12 +4,8 @@
;;;;
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; CMPENV-DECLARE -- Declarations for the compiler
;;;;

View file

@ -4,12 +4,9 @@
;;;;
;;;; Copyright (c) 2009, Juan Jose Garcia-Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; See file '../Copyright' for full details.
;;;;
;;;; CMPENV-FUN -- Declarations concerning function types and inlining
;;;;

View file

@ -6,12 +6,8 @@
;;;; Copyright (c) 1990, Giuseppe Attardi.
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; CMPENV-PROCLAIM -- Proclamations for the compiler
;;;;

View file

@ -4,12 +4,8 @@
;;;;
;;;; Copyright (c) 2009, Juan Jose Garcia-Ripoll
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; CMPFORM -- Internal representation of Lisp forms
;;;;

View file

@ -4,12 +4,7 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
(in-package #:compiler)

View file

@ -4,12 +4,8 @@
;;;;
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; CMPGLOBALS -- Global variables and flag definitions
;;;;

View file

@ -7,12 +7,7 @@
;;;; Copyright (c) 2001, Juan Jose Garcia Ripoll
;;;; Copyright (c) 2015, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;; CMPMAIN Compiler main program.
@ -25,6 +20,7 @@
(type nil type-supplied-p)
(system-p nil)
&allow-other-keys)
(setf name (pathname name))
(let* ((format '())
(extension '()))
(unless type-supplied-p

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1984, Taiichi Yuasa and Masami Hagiya.
;;;; Copyright (c) 1990, Giuseppe Attardi.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;; CMPMAP Map functions.

View file

@ -4,12 +4,7 @@
;;;;
;;;; Copyright (c) 2007, Juan Jose Garcia Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;; CMPNAME Unambiguous init names for object files
;;;;

View file

@ -6,12 +6,7 @@
;;;; Copyright (c) 2010. Juan Jose Garcia-Ripol
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "COMPILER")

View file

@ -4,12 +4,8 @@
;;;;
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; CMPOPT-CONSTANTS Constant expressions.
;;;;

View file

@ -6,12 +6,7 @@
;;;;
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "COMPILER")

View file

@ -4,12 +4,7 @@
;;;;
;;;; Copyright (c) 2008. Juan Jose Garcia-Ripol
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; CMPOPT-TYPE -- Optimizations for selected types of expresions
;;;;

View file

@ -6,12 +6,7 @@
;;;; Copyright (c) 2008. Juan Jose Garcia-Ripol
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "COMPILER")

View file

@ -4,12 +4,7 @@
;;;;
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;; CMPFEATURES.LSP -- Gather a list of features from the compiler

View file

@ -4,12 +4,7 @@
;;;;
;;;; Copyright (c) 2010, Juan Jose Garcia Ripoll
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;; CMPOS-RUN Executing auxiliary programs

View file

@ -4,12 +4,7 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
(in-package #:compiler)

View file

@ -4,12 +4,8 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; CMPDATA Data segment.
;;;;

View file

@ -4,12 +4,7 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
(in-package #:compiler)

View file

@ -4,12 +4,7 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
(in-package #:compiler)

View file

@ -4,12 +4,7 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
(in-package #:compiler)

View file

@ -4,12 +4,7 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
(in-package #:compiler)

View file

@ -4,12 +4,7 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
(in-package #:compiler)

View file

@ -4,12 +4,7 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
(in-package #:compiler)

View file

@ -6,12 +6,7 @@
;;;; Copyright (c) 2008. Juan Jose Garcia-Ripol
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "COMPILER")

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1984, Taiichi Yuasa and Masami Hagiya.
;;;; Copyright (c) 1990, Giuseppe Attardi.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;; CMPTYPE-ARITH -- Operations upon and among types

View file

@ -4,12 +4,7 @@
;;;;
;;;; Copyright (c) 2011, Juan Jose Garcia-Ripoll
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;; CMPTYPE-ASSERT Type assertions automatically generated

View file

@ -4,12 +4,8 @@
;;;;
;;;; Copyright (c) 2009, Juan Jose Garcia-Ripoll.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; CMPTYPE-PROP -- Type propagation basic routines and database
;;;;

View file

@ -5,12 +5,7 @@
;;;; Copyright (c) 1984, Taiichi Yuasa and Masami Hagiya.
;;;; Copyright (c) 1990, Giuseppe Attardi.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;; CMPTYPE Type information.

View file

@ -4,12 +4,8 @@
;;;;
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
;;;; CMPTYPES -- Data types for the Lisp core structures
;;;;

View file

@ -7,12 +7,7 @@
;;;; Copyright (c) 1984, Taiichi Yuasa and Masami Hagiya.
;;;; Copyright (c) 1990, Giuseppe Attardi.
;;;;
;;;; ECoLisp is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
(in-package "COMPILER")

View file

@ -4,12 +4,7 @@
;;;; Copyright (c) 2010, Juan Jose Garcia-Ripoll
;;;; Copyright (c) 2021, Daniel Kochmański
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Library General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2 of the License, or (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;;
(in-package #:compiler)

View file

@ -95,7 +95,9 @@
c::*ld-shared-flags*
"@SHARED_LDFLAGS@ @LDFLAGS@"
c::*ld-bundle-flags*
"@BUNDLE_LDFLAGS@ @LDFLAGS@")
"@BUNDLE_LDFLAGS@ @LDFLAGS@"
c::*ld-program-flags*
"@PROGRAM_LDFLAGS@ @LDFLAGS@")
;;; FIXME: The nonstop platform does not support soname
#+(and :wants-dlopen nonstop)
(setf c::*ld-libs*
@ -182,7 +184,7 @@
(push "@LIBPREFIX@eclgmp.@LIBEXT@" extra-args)))
(print extra-args)
(c::shared-cc (compile-file-pathname "ecl" :type :dll)
(list* "c/main.@OBJEXT@"
(list* #-emscripten "c/main.@OBJEXT@"
"c/all_symbols2.@OBJEXT@"
"@LIBPREFIX@lsp.@LIBEXT@"
"@LIBPREFIX@eclmin.@LIBEXT@"

2138
src/configure vendored

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@ dnl AUTOCONF configuration for ECL
dnl Giuseppe Attardi 25.1.1994
dnl
AC_INIT([ecl],[23.9.9],[])
AC_INIT([ecl],[24.5.10],[])
AC_REVISION([$Revision$])
AC_CONFIG_SRCDIR([bare.lsp.in])
AC_CONFIG_AUX_DIR([gmp])
@ -317,6 +317,7 @@ AC_SUBST(CORE_LIBS, []) dnl Locally compiled libs to link into
dnl ecl/ecl_min/libecl.so and nowhere else.
AC_SUBST(SHARED_LDFLAGS) dnl Flags for shared libraries linker
AC_SUBST(BUNDLE_LDFLAGS) dnl Flags for FASL files linker
AC_SUBST(PROGRAM_LDFLAGS) dnl Flags for executable program linker
AC_SUBST(EXTRA_OBJS) dnl Extra *.o files to be compiled into libecl.a
AC_SUBST(TARGETS, ['bin/ecl$(EXE)'])dnl Versions of ECL to be built
AC_SUBST(SUBDIRS, ['c doc']) dnl Subdirectories that make should process

View file

@ -181,10 +181,19 @@ to official gitlab repository:
.
.SH LICENSE
ECL is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version; see file \fICOPYING\fP.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2.1 of the License, or (at your option) any
later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this library; if not, write to the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Please report bugs, comments, suggestions to the ecl mailing list:
.MT ecl-devel@common-lisp.net

View file

@ -4,12 +4,7 @@
;;;; Copyright (c) 1984, Taiichi Yuasa and Masami Hagiya.
;;;; Copyright (c) 1990, Giuseppe Attardi.
;;;;
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; See file '../Copyright' for full details.
;;;; See file 'LICENSE' for the copyright details.
;;;; setdoc.lsp
;;;;

View file

@ -302,12 +302,15 @@ format. In case of @emph{Portable FASL} the bytecodes compiler is needed.
@node Compiling with ASDF
@subsection Compiling with ASDF
First, let's disregard the simple situation in which we write Lisp
without depending on any other Lisp libraries. A more practical example
is to build a library that depends on other
@uref{https://common-lisp.net/project/asdf/,asdf}, systems. ECL provides
a useful extension for asdf called @code{asdf:make-build}, which offers
an abstraction for building libraries directly from system definitions.
For larger systems involving more complex file dependencies, or for systems
that are portable across different Common Lisp implementations, it may be
better to define systems using @uref{https://common-lisp.net/project/asdf/,asdf}.
ECL provides a useful extension for asdf called @code{asdf:make-build}, which
offers an abstraction for building libraries directly from system definitions.
Note that this extension is only available in the ASDF that is shipped with
ECL; it may not be available from an ASDF installed from the system or from
Quicklisp.
To download dependencies you may use
@uref{https://www.quicklisp.org,Quicklisp} to load your system (with
@ -328,14 +331,22 @@ the fact that other libraries may be loaded).
@node Example code to build
@subsubsection Example code to build
We use a simple project that depends on @code{alexandria} to
demonstrate the interface. The example consists of
@code{example-with-dep.asd}, @code{package.lisp} and
@code{example.lisp} (included in the
@code{examples/asdf_with_dependence/} directory in the ECL source
tree). Before any kind of build you need to push the full path of
this directory to @code{asdf:*central-registry*} (or link it in a
location already recognized by ASDF).
An example project is included in the ECL source distribution in the
@code{examples/asdf_with_dependence/} directory.
This project depends on the @code{alexandria} library and consists of a system
definition (@code{example-with-dep.asd}), package definition
(@code{package.lisp}), and the actual library code (@code{example.lisp}).
Before following the steps below, you must
@uref{https://asdf.common-lisp.dev/asdf/Configuring-ASDF-to-find-your-systems.html,configure ASDF to find your systems}.
You can either copy or symlink the example directory in one of the standard
ASDF locations, or push the path of the example directory to your
@code{asdf:*central-registry*}, for example:
@lisp
(push "./" asdf:*central-registry*)
@end lisp
@node Build it as an single executable
@subsubsection Build it as an single executable

View file

@ -196,9 +196,15 @@ This function returns a C pointer for the given Lisp foreign object. Lisp
foreign objects are constructed with functions @code{ecl_make_foreign_data}
and @code{ecl_allocate_foreign_data}.
This data is a subject of the garbage collection (unlike lisp functions like
@code{si:allocate-foreign-object}). This is because the data producer here is
the "C world" and the data consumer is the "Lisp world".
The wrapper created with @code{ecl_make_foreign_data} is a subject of
garbage collection, but the pointer itself is not ``freed'', because
the data producer is ``C world'' and the consumer is ``Lisp world''.
This is different from @code{si:allocate-foreign-object} where the
data producer is ``Lisp world'' and the consumer is ``C world''. In
that case the wrapper is not collected unless explicitly released with
@code{si:free-foreign-object} in which case the allocated foreign data
is also released.
@end deftypefun
@cppdef ecl_base_string_pointer_safe

View file

@ -1,9 +1,61 @@
@node Gray streams
@section Gray streams
@node Gray Streams
@section Gray Streams
@defun{close} {@var{stream} @keys{} :abort}
Unlike the other Gray stream functions, @code{close} is not
specialized on @code{t} for @var{stream}. This decision has been taken
mainly for the compatibility reasons with some libraries.
@defun {close} stream &key abort
Unlike the other Gray stream functions, @code{close} is not specialized
on @code{t} for @var{stream}. This decision has been taken mainly for
the compatibility reasons with some libraries.
@end defun
@defun {stream-file-position} stream &optional position
This is used to implement @code{file-position}. When @code{position}
is not provided it should return the current file position of the
stream as non-negative integer or @code{nil} if the file position
cannot be determined. When @code{position} is supplied the file
position of the stream should be set to that value. If setting the
position is successful then @code{t} should be returned, otherwise
@code{nil} should be returned. The default method always returns
@code{nil}.
@end defun
@defun {stream-file-length} stream
This is used to implement @code{file-length}. It returns either a
non-negative integer or @code{nil} if the concept of file length is
not meaningful for the stream. The default method will signal a
@code{type-error} with an expected type of @code{file-stream}. This is
required to conform with the ``Exceptional Situations'' section of
@code{file-length} in the ANSI specification.
@end defun
@defun {stream-interactive-p} stream
This is used to implement @code{interactive-stream-p}. It returns a
boolean indicating if the stream is interactive. The default method
always returns @code{nil}.
@end defun
@defun {stream-line-length} stream
Allows the default line length to be specified for the stream. It
returns either a non-negative integer or @code{nil} if the concept of
line length is not meaningful for the stream. This value is only used
if @code{*print-right-margin*} is @code{nil}. The line length is used
by the pretty printer and by the format justification directive. The
default method returns @code{nil}.
@end defun
@defun {stream-read-sequence} stream sequence &optional start end
This is used to implement @code{read-sequence}. It should follow the
semantics in the ANSI specification. It returns the position of the
first element in the sequence that was not updated. The default method
calls @code{stream-read-char} or @code{stream-read-byte} repeatedly
based on the type returned by @code{stream-element-type}. Element
access to the sequence is done via @code{elt}.
@end defun
@defun {stream-write-sequence} stream sequence &optional start end
This is used to implement @code{write-sequence}. It should follow the
semantics in the ANSI specification. It returns sequence without
modification. The default method calls @code{stream-write-char} or
@code{stream-write-byte} repeatedly based on the type returned by
@code{stream-element-type}. Element access to the sequence is done via
@code{elt}.
@end defun

View file

@ -53,8 +53,7 @@
@c @node Extensible Sequences
@c @section Extensible Sequences
@node Gray Streams
@section Gray Streams
@include extensions/gray-streams.txi
@c @node Series
@c @section Series

View file

@ -10,31 +10,31 @@ notice which is shipped with ECL.
@verbatim
---- BEGINNING OF COPYRIGHT FOR THE ECL CORE ENVIRONMENT ------------
Copyright (C) 2019, Daniel Kochmanski and Marius Gerbershagen
Copyright (c) 2018, Daniel Kochmański
Copyright (c) 2013, Juan Jose Garcia Ripoll
Copyright (c) 2019-2024 Daniel Kochmański and Marius Gerbershagen
Copyright (c) 2015-2018, Daniel Kochmański
Copyright (c) 2000-2013, Juan Jose Garcia Ripoll
Copyright (c) 1990, 1991, 1993 Giuseppe Attardi
Copyright (c) 1984 Taiichi Yuasa and Masami Hagiya
All Rights Reserved
ECL is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version; see file 'Copying'.
ECL is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
PLEASE NOTE THAT:
This license covers all of the ECL program except for the files
src/lsp/loop2.lsp ; Symbolic's LOOP macro
src/lsp/loop.lsp ; Symbolic's LOOP macro
src/lsp/pprint.lsp ; CMUCL's pretty printer
src/lsp/format.lsp ; CMUCL's format
and the directories

Some files were not shown because too many files have changed in this diff Show more