Commit graph

168 commits

Author SHA1 Message Date
Daniel Kochmański
4a760a06dd core: split cl_core_struct in two structure cl_core and ecl_core
ecl_core contains early global environment that is meant to be shared by all
runtimes, while cl_core contains an environment relevant to common lisp.
2025-05-14 13:44:01 +02:00
Daniel Kochmański
0b473f57ef core: move defacto constants from cl_core structure to global space 2025-05-14 13:44:01 +02:00
Marius Gerbershagen
7d695eae76 pathname: fix bug in handling streams
ecl_stream_pathname returns a string and not a pathname, so we have to
check for that again.
2024-03-10 19:19:56 +01:00
Tarn W. Burton
bc6e31f926
Add generic pathname/truename 2024-01-25 14:05:27 -05:00
Marius Gerbershagen
d437bd0779 speed up looking up and setting values of dynamic variables
Introduce ecl_cmp_symbol_value and ecl_cmp_setq which do the minimal
amount of work needed to implement symbol-value and setq for dynamic
variables which we have checked to be non-null and of type symbol in
the compiler.

Also introduce a type check in ecl_symbol_value to be consistent with
ecl_setq which also checks the type. These two functions are mainly
used for the embedding interface now, so for that reason it is also
useful to have a type check in there.
2023-10-30 12:01:18 +01:00
Marius Gerbershagen
cd14663e7e directory: fix a bug leading to missing matches in some cases
If a directory component followed :wild-inferior for paths
like **/some-dir/some-file, we were not finding all possible matches.
This came about because if we did not match in dir_recursive, we were
returning nil instead of the list of previously found matches.

Fixes #712.
2023-09-10 20:57:52 +02:00
Marius Gerbershagen
ded1d1ee07 si:coerce-to-file-pathname: make sure that device component is not empty if necessary
Needed to so that the device component of pathnames returned by
truename is not empty on Windows.
2023-07-15 18:31:49 +02:00
Daniel Kochmański
2b52fe3ecb pathname_translations: use ecl_assqlp instead of @assoc
ecl_assqlp is sufficient and does not require argument parsing at runtime. host
is always checked to be a string, so the ecl_assoc test EQUAL will have the same
effect as the previously checked STRING-EQUAL.
2022-11-24 18:32:58 +01:00
Marius Gerbershagen
ff8cf4d3c1 pathnames: handle unicode characters
On Unix, pathnames are converted into the default encoding specified
by ext:*default-external-format* and back. On Windows, the operating
system already gives us utf16 encoded pathnames, so we use those.

ecl_namestring with ECL_NAMESTRING_FORCE_BASE_STRING encodes with the
specified encoding. Decoding is handled individually in the filesystem
functions.

Includes a minor refactor of list_directory, changing the
PARSE_DIRECTORY_ENTRY macro into an inline function.

Closes #609, #549.
2021-08-19 14:00:28 +02:00
Marius Gerbershagen
36a9c95c80 tree-wide: use new dpp @"" specifier for constant base strings where appropriate 2021-03-12 19:53:33 +01:00
Marius Gerbershagen
fc4054d734 fix some compiler warnings
__attribute__((unused)) suppresses unused variable warnings for
the_env in dpp generated code.

:case keyword argument in translate-pathname is unused and not
required by the ANSI spec.

espace_flag in sharp_colon_reader is unused and not necessary for the
current implementation.

ihs_function_name is unused and duplicated as ihs-fname in lsp/top.lsp
2020-12-29 18:18:26 +01:00
Christopher Chavez
0f3d6e08d1 Fix spelling 2020-09-11 02:11:26 +00:00
Marius Gerbershagen
c6b4296bb8 cosmetic: fix some compiler warnings 2020-04-29 20:35:37 +02:00
Marius Gerbershagen
24dcb778cf clean up functions creating base strings from C strings
Make functions behave as documented, remove use of legacy names.
    Fixes #462.
2019-01-07 18:43:55 +01:00
Daniel Kochmanski
436e6a62ca pathname-match-p: fix invalid comparison
(pathname-match-p "foo" "foo?") returned T, because we had too weak
comparison. Now it returns NIL.
2017-08-18 07:59:57 +02:00
Fabrizio Fabbri
390caa3e51
Revert "Revert "Merge branch 'develop' into 'develop'""
This reverts commit cf416f6fd4.
2017-06-03 12:57:17 +02:00
Daniel Kochmanski
cf416f6fd4 Revert "Merge branch 'develop' into 'develop'"
This reverts commit b75802f122, reversing
changes made to 5e3ccb1955.
2017-05-26 14:38:52 +02:00
Fabrizio Fabbri
73ed08df0b
fix coverity issue 1434897 Uninitialized scalar variable
https://scan7.coverity.com/reports.htm#v29377/p15116/fileInstanceId=18706960&defectInstanceId=4324855&mergedDefectId=1434897&eventIds=4324837-8
2017-05-16 18:31:55 +02:00
Daniel Kochmański
5e8ec11bdd cosmetic: fix indent (rest of C) 2016-05-06 08:41:52 +02:00
Matthew Mondor
8f07cd58d8 The ECL code no longer uses tabulator characters, they were replaced
by spaces.

A custom script was used to insert/replace Emacs and ViM per-file editor
settings according to their type and the new ECL coding style.
2015-09-03 07:35:47 -04:00
Matthew Mondor
fb09755db4 FIXNUM_BITS -> ECL_FIXNUM_BITS consistently, second try 2015-08-30 16:35:14 -04:00
Daniel Kochmański
6c0860b3cf pathname: fix logical translation wrt wildcards
Fixes #103.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-08-19 10:09:17 +02:00
Daniel Kochmański
4d19a27424 cosmetic: untabify
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-21 14:38:20 +02:00
Daniel Kochmański
88b8ad015a pathname: Make type of pathname being (simple-array character (*)).
Removes coercion to base-string and improves some use cases. Due to
recent change in double-quote reader (conformity fix), now type of
each read string is (simple-array character (*)), so when pathnames
were created, it were copying it to (simple-array base-char (*)), lead
to buggy results. Consider:

(let ((path
       (let ((x "foo"))
	 (make-pathname :name x :type x))))
  (eql (pathname-name path)
       (pathname-type path))) ; => T

Before change, this construct was returning NIL, what in case of
serialization might be a problem, and wasn't `the right thing`® to do.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-05-03 11:52:08 +02:00
Juanjo Garcia-Ripoll
3dd9b227bd Fixed typo 2013-10-15 09:57:25 +02:00
Juan Jose Garcia Ripoll
e54d9a6173 Rename type_of -> ecl_t_of 2012-07-05 23:07:34 +02:00
Juan Jose Garcia Ripoll
825fc8cbd3 Cnil and Ct are now part of legacy 2012-06-30 23:01:40 +02:00
Juan Jose Garcia Ripoll
738d844fc0 Prefix the smm_ enumeration values 2012-06-30 22:11:48 +02:00
Juan Jose Garcia Ripoll
288d5e8ce6 Force LISTP,CONSP,ATOM and SYMBOLP into legacy.h 2012-06-30 21:59:10 +02:00
Juan Jose Garcia-Ripoll
8441a08c97 VALUES() is now part of legacy.h 2012-06-30 11:48:01 +02:00
Juan Jose Garcia Ripoll
cb1cf92713 Rename ecl_fix() to ecl_fixnum(), just like ecl_long_float() or ecl_double_float() 2012-06-07 23:55:43 +02:00
Juan Jose Garcia Ripoll
64a9168434 CHARACTERP, BASE_CHAR_P, BASE_CHAR_CODE_P, CODE_CHAR, CHAR_CODE, REAL_TYPE, IMMEDIATE, IMMEDIATE_TAG, FIXNUM_TAG, FIXNUM_MINUSP, FIXNUM_PLUSP, FIXNUMP and fix get the ecl_ prefix 2012-06-06 11:19:55 +02:00
Juan Jose Garcia Ripoll
ac518d8e33 MAKE-PATHNAME should not simplify :BACK in the directory part. 2012-04-14 19:30:12 +02:00
Juan Jose Garcia Ripoll
036cb55928 Fixes to remove warnings about unused variables. Replaced some uses of @(return) with ecl_return*() 2012-04-10 23:20:40 +02:00
Juan Jose Garcia Ripoll
f37055af48 New function to detect wild pathname components. 2012-03-18 16:53:44 +01:00
Juan Jose Garcia Ripoll
01f333fa87 In pathnames, .. is translated to :UP, not :BACK. 2011-12-31 16:21:17 +01:00
Juan Jose Garcia Ripoll
0d1de5ba90 Dots are removed from pathnames when parsing them. 2011-12-31 03:23:14 +01:00
Juan Jose Garcia Ripoll
5fcd784bb9 Slightly more verbose message when coercing to filenames. 2011-03-06 23:57:53 +01:00
Juan Jose Garcia Ripoll
37c4e79d1a Fixed path with uninitialized variable in ecl_make_pathname (J. James) 2011-01-21 16:58:34 +01:00
Juan Jose Garcia Ripoll
bfbde7508c The code for removing redundant :BACK items in MERGE-PATHNAMES had disappeared 2010-12-25 21:57:48 +01:00
Juan Jose Garcia Ripoll
13a5dfc5b5 When doing pathname translations, missing components must be filled using the from-pathname 2010-12-15 19:39:17 +01:00
Juan Jose Garcia Ripoll
eaeec27748 When possible, coerce all pathname elements from (array character) to (array base-char), so that they can be manipulated by the ANSI C routines directly -- otherwise they complain. 2010-12-12 20:07:16 +01:00
Juan Jose Garcia Ripoll
f042896b53 Fixed changing of cases in pathname translations. 2010-12-01 22:35:15 +01:00
Juan Jose Garcia Ripoll
f1d3f7f953 Merging of pathnames takes care of the case. 2010-11-27 19:05:51 +01:00
Juan Jose Garcia Ripoll
bd4b329908 Fixed handling of pathname case when retreiving components and building pathnames. 2010-11-27 18:08:47 +01:00
Juan Jose Garcia Ripoll
5c63cd8345 When compiling for the Windows API, define ECL_MS_WINDOWS_HOST instead of checking for mingw or _MSC_VER separately (Gabriel Dos Reis) 2010-08-22 22:29:21 +02:00
Juan Jose Garcia Ripoll
8ce8d5aeb4 When chaining pathname translations, case was not properly translated. 2010-07-01 22:02:02 +02:00
Juan Jose Garcia Ripoll
24a6ae8c4e Fixes in the implementation of MAKE-PATHNAME and NAMESTRING 2010-06-28 21:33:04 +02:00
Juan Jose Garcia Ripoll
2e1b5463e0 Logical pathnames are now uppercased 2010-06-03 20:41:21 +02:00
Trail@.(none)
973090bc55 Use __MINGW32__ instead of mingw32 as preprocessor criterion of MinGW-ness. 2010-04-05 22:31:53 +02:00