Hello Sam,
Tuesday, June 24, 2003, 11:42:03 PM, you wrote:
>> What is the situation with host and device on UNIX ?
> see lispbibl.d:2100 and around.
> there are no hosts and devices on unix, but cygwin defines
> PATHNAME_UNIX_UNC which results in "//host/path/bar" being parsed as
> #s(pathname :directory (:absolute "" "host" "path") :name "bar").
Aha. Got it. .
> it's best to only do what one can test.
> do you have cygwin?
Yes (though I don't always understand its unixisms).
--
Best regards,
Arseny

> * In message <5525744578.20030624183250@...>
> * On the subject of "Re[4]: directory-namestring and pathname-host"
> * Sent on Tue, 24 Jun 2003 18:32:50 +1100
> * Honorable Arseny Slobodjuck <ampy@...> writes:
>
> What is the situation with host and device on UNIX ?
see lispbibl.d:2100 and around.
there are no hosts and devices on unix, but cygwin defines
PATHNAME_UNIX_UNC which results in "//host/path/bar" being parsed as
#s(pathname :directory (:absolute "" "host" "path") :name "bar").
> I tend to change only win32 (well, os2 too) part however ugly and
> nongeneral this change would be.
it's best to only do what one can test.
do you have cygwin?
--
Sam Steingold (http://www.podval.org/~sds) running RedHat9 GNU/Linux
<http://www.camera.org&gt; <http://www.iris.org.il&gt; <http://www.memri.org/&gt;
<http://www.mideasttruth.com/&gt; <http://www.palestine-central.com/links.html&gt;
Those who can't write, write manuals.

> * In message <17221568183.20030624014445@...>
> * On the subject of "Re[2]: directory-namestring and pathname-host"
> * Sent on Tue, 24 Jun 2003 01:44:45 +1000
> * Honorable Arseny Slobodjuck <ampy@...> writes:
>
> Monday, June 23, 2003, 11:39:59 PM, you wrote:
>
> >> problem2:
> >>
> >> what is the purpose of OSnamestring ?
>
> > "returns a namestring of a pathname for the operating system"
> > i.e., its return value should be acceptable to the OS as file name.
>
> But does it mean that result of whole_namestring is unacceptable for
> OS ?
look at the sources.
it appears that the only time when OSnamestring() and
whole_namestring() return different objects is on RiskOS,
where name and type are swapped.
right?
--
Sam Steingold (http://www.podval.org/~sds) running RedHat9 GNU/Linux
<http://www.camera.org&gt; <http://www.iris.org.il&gt; <http://www.memri.org/&gt;
<http://www.mideasttruth.com/&gt; <http://www.palestine-central.com/links.html&gt;
I may be getting older, but I refuse to grow up!

Hi,
Monday, June 23, 2003, 11:39:59 PM, you wrote:
>> problem2:
>>
>> what is the purpose of OSnamestring ?
> "returns a namestring of a pathname for the operating system"
> i.e., its return value should be acceptable to the OS as file name.
But does it mean that result of whole_namestring is unacceptable for
OS ?
--
Best regards,
Arseny

> * In message <1877402063.20030623214839@...>
> * On the subject of "directory-namestring and pathname-host"
> * Sent on Mon, 23 Jun 2003 21:48:39 +1000
> * Honorable Arseny Slobodjuck <ampy@...> writes:
>
> in pathname.d:
>
> local object directory_namestring (object pathname) {
> # The function DIRECTORY-NAMESTRING is totally underspecified.
> # It could return
> # a. just the string for the directory portion,
> # b. the string for the device + directory portions,
> # c. the string for the host + device + directory portions.
> # Before we used hosts, we have traditionally returned (b).
> # Now, with hosts, we still return (b) since HOST-NAMESTRING returns
> # the host part, while there is no way to return just the device
> # This makes most sense, given that CLHS says that programs
> # should not attempt to concatenate the resulting string with anything.
> return string_concat(directory_namestring_parts(pathname));
> }
>
> problem:
>
> directory-namestring currenly includes device, but not host. On win32
> I see no problem to include both since valid is either device or host.
> If smb. shares whole drive, sharename appears which may or may not be
> the same as drive name and goes into directory part of pathname.
> There's no way to address particular devices on network machines. Am I
> wrong here ?
I think you are right.
> solution:
>
> make directory_namestring to use pathname-host. I.e. use device if it
> is valid or host if there's no device or nothing as long as both are
> NIL.
I agree.
Bruno?
> problem2:
>
> what is the purpose of OSnamestring ?
"returns a namestring of a pathname for the operating system"
i.e., its return value should be acceptable to the OS as file name.
> Shouldn't it be called rather
> 'whole_namestring_when_dir_namestring_is_already_known' (and not using
> host) ?
actually, on for UNC pathnames on win32, it _should_ include the host.
--
Sam Steingold (http://www.podval.org/~sds) running RedHat9 GNU/Linux
<http://www.camera.org&gt; <http://www.iris.org.il&gt; <http://www.memri.org/&gt;
<http://www.mideasttruth.com/&gt; <http://www.palestine-central.com/links.html&gt;
(lisp programmers do it better)

Hi,
in pathname.d:
local object directory_namestring (object pathname) {
# The function DIRECTORY-NAMESTRING is totally underspecified.
# It could return
# a. just the string for the directory portion,
# b. the string for the device + directory portions,
# c. the string for the host + device + directory portions.
# Before we used hosts, we have traditionally returned (b).
# Now, with hosts, we still return (b) since HOST-NAMESTRING returns
# the host part, while there is no way to return just the device
# This makes most sense, given that CLHS says that programs
# should not attempt to concatenate the resulting string with anything.
return string_concat(directory_namestring_parts(pathname));
}
problem:
directory-namestring currenly includes device, but not host. On win32
I see no problem to include both since valid is either device or host.
If smb. shares whole drive, sharename appears which may or may not be
the same as drive name and goes into directory part of pathname.
There's no way to address particular devices on network machines. Am
I wrong here ?
solution:
make directory_namestring to use pathname-host. I.e. use device if it
is valid or host if there's no device or nothing as long as both are
NIL.
problem2:
what is the purpose of OSnamestring ? Shouldn't it be called rather
'whole_namestring_when_dir_namestring_is_already_known' (and not
using host) ?
# UP: Converts pathname into string.
# whole_namestring(pathname)
# > pathname: non-logical pathname
# < result: Normal-Simple-String
# can trigger GC
local object whole_namestring (object pathname) {
var uintC stringcount = host_namestring_parts(pathname);
stringcount += directory_namestring_parts(pathname);
stringcount += file_namestring_parts(pathname);
return string_concat(stringcount);
}
# UP: returns a namestring of a pathname for the operating system.
# OSnamestring(dir_namestring)
# > STACK_0: non-logical pathname
# > dir_namestring: directory-namestring (for DOS)
# < result: namestring (for DOS)
# can trigger GC
local object OSnamestring (object dir_namestring) {
var uintC stringcount;
pushSTACK(dir_namestring); # Directory-Namestring as 1. String
stringcount = file_namestring_parts(STACK_(0+1)); # Strings for the filename
return string_concat(1+stringcount); # concatenate
}
--
Best regards,
Arseny

Hi,
Is fehler_something(object_not_in_STACK) legal ? For example
fehler_dir_not_exists(directory_namestring(STACK_0)) ? In general -
is it legal to call a function with nonsafe object as parameter ?
MSDOS version of assure_dir_exists calls fehler so.
--
Best regards,
Arseny

If more than one foreign function has a user-defined struct for a return
type, the C compiler gets confused. When the following file is compiled as a
module:
----[ testffi.lisp ]------
(defpackage "TESTFFI"
(:use "FFI" "COMMON-LISP"))
(in-package "TESTFFI")
(default-foreign-language :stdc)
(def-c-struct type1
(arg1 int))
(def-call-out func1
(:return-type type1))
(def-call-out func2
(:return-type type1))
---[ end testffi.lisp ]----
I get the following function definitions in the testffi.c file:
extern struct TYPE1 { int ARG1; } (func1)();
extern struct TYPE1 { int ARG1; } (func2)();
which results in the following compiler error:
testffi.c:14: redefinition of `struct TYPE1'
make[1]: *** [testffi.o] Error 1
This problem does not occur if TYPE1 is only used in argument declarations.
A possible solution is to output a
struct TYPE1 { int ARG1; };
when the def-c-struct command is encountered, and then refer to that type as
"struct TYPE1" instead of redeclaring the structure each time it is used.
Another possible solution is to avoid naming the struct, which would result in
the following code:
extern struct { int ARG1; } (func1)();
extern struct { int ARG1; } (func2)();
which does not cause a compiler error.
I don't know anything about the internal mechanisms clisp uses to generate
code for the FFI, otherwise i'd fix it myself :o) I hope someone can resolve
the issue!
-Scott Williams
--
+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!