|
From: <cli...@li...> - 2005-06-15 03:12:06
|
Send clisp-cvs mailing list submissions to cli...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/clisp-cvs or, via email, send a message with subject or body 'help' to cli...@li... You can reach the person managing the list at cli...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of clisp-cvs digest..." CLISP CVS commits for today Today's Topics: 1. clisp/src socket.d,1.94,1.95 lispbibl.d,1.650,1.651 TODO,1.91,1.92 (Sam Steingold) 2. clisp/src stream.d,1.525,1.526 lispbibl.d,1.651,1.652 TODO,1.92,1.93 (Sam Steingold) 3. clisp/src lispbibl.d,1.652,1.653 (Sam Steingold) 4. clisp/src TODO,1.93,1.94 ChangeLog,1.4702,1.4703 (Sam Steingold) 5. clisp/modules/syscalls calls.c,1.128,1.129 (Sam Steingold) --__--__-- Message: 1 From: Sam Steingold <sd...@us...> To: cli...@li... Subject: clisp/src socket.d,1.94,1.95 lispbibl.d,1.650,1.651 TODO,1.91,1.92 Date: Tue, 14 Jun 2005 17:11:08 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15898/src Modified Files: socket.d lispbibl.d TODO Log Message: documented string_to_addr, addr_to_string, resolve_host Index: socket.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/socket.d,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- socket.d 6 Jun 2005 21:57:32 -0000 1.94 +++ socket.d 14 Jun 2005 17:11:02 -0000 1.95 @@ -168,9 +168,13 @@ #endif #endif -/* FIXME: Add documentation */ -/* for syscalls & rawsock modules */ -global object addr_to_string (short type, char *addr) { +/* Convert the IP address from C format to Lisp + > type: address type (AF_INET..) + > addr: whatever the address is for this type + < lisp string representing the address in a human-readable format + for syscalls & rawsock modules + can trigger GC */ +global maygc object addr_to_string (short type, char *addr) { var char buffer[MAXHOSTNAMELEN]; #ifdef HAVE_IPV6 if (type == AF_INET6) @@ -345,7 +349,11 @@ return 0; } -/* FIXME: Add documentation */ +/* Convert the IP address from C format to Lisp + > name: FQDN or dotted quad or IPv6 address + < lisp string for FQDN or integer for IPv[46] numerics + for syscalls & rawsock modules + can trigger GC */ global object string_to_addr (const char* name) { object ret; begin_system_call(); @@ -362,7 +370,15 @@ return 0; } -/* FIXME: Add documentation */ +/* Return the hostent specified by the host designator + > arg: host name designator: + :DEFAULT - current host + string/symbol: FQDN is resolved (gethostbyname) + uint32: raw IPv4 address (gethostbyaddr) + uint128: raw IPv6 address (gethostbyaddr) + bit vector: raw IPv4[46] address (gethostbyaddr) + < static hostent descriptor from LIBC + for syscalls & rawsock modules */ global struct hostent* resolve_host (object arg) { var struct hostent* he; if (eq(arg,S(Kdefault))) { Index: TODO =================================================================== RCS file: /cvsroot/clisp/clisp/src/TODO,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- TODO 7 Jun 2005 14:25:47 -0000 1.91 +++ TODO 14 Jun 2005 17:11:05 -0000 1.92 @@ -8,11 +8,11 @@ use LockFile instead of LockFileEx [sds] -comments for addr_to_string, string_to_addr [sds] - comments for open_file_stream_handle, file_stream_truename [sds] -workaround for extra comma in _clisp.1 [sds] +resolve_host/IPv6 [bruno] + +workaround for an extra comma in _clisp.1 [sds] regression: resolution of logical pathnames is broken, try (compile-file (logical-pathname "FOO.LISP")) [sds] @@ -25,7 +25,7 @@ (print (list '*error-output* *error-output*)) (print (list '*terminal-io* *terminal-io*)) (print (list '*debug-io* *debug-io*)) -(print "tell me something...") +(print "tell me something...") (print (read-line *standard-input*)) "first" (with-open-stream (in (make-stream :input)) Index: lispbibl.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/lispbibl.d,v retrieving revision 1.650 retrieving revision 1.651 diff -u -d -r1.650 -r1.651 --- lispbibl.d 7 Jun 2005 11:00:31 -0000 1.650 +++ lispbibl.d 14 Jun 2005 17:11:03 -0000 1.651 @@ -16686,11 +16686,16 @@ # ###################### SOCKBIBL for SOCKET.D ############################# # #if defined(UNIX) || defined(WIN32_NATIVE) -/* FIXME: Add documentation */ -extern object addr_to_string (short type, char *addr); +/* Convert the IP address from C format to Lisp + > type: address type (AF_INET..) + > addr: whatever the address is for this type + < lisp string representing the address in a human-readable format + for syscalls & rawsock modules + can trigger GC */ +extern maygc object addr_to_string (short type, char *addr); #endif %% #if defined(UNIX) || defined(WIN32_NATIVE) -%% printf("extern object addr_to_string (short type, char *addr);\n"); +%% printf("extern maygc object addr_to_string (short type, char *addr);\n"); %% #endif #if (defined(UNIX) || defined(WIN32_NATIVE)) && defined(HAVE_GETHOSTBYNAME) @@ -16700,15 +16705,27 @@ #endif #if (defined(UNIX) || defined(WIN32_NATIVE)) && defined(HAVE_GETHOSTBYNAME) && defined(TCPCONN) -/* FIXME: Add documentation */ -extern object string_to_addr (const char* name); +/* Convert the IP address from C format to Lisp + > name: FQDN or dotted quad or IPv6 address + < lisp string for FQDN or integer for IPv[46] numerics + for syscalls & rawsock modules + can trigger GC */ +extern maygc object string_to_addr (const char* name); #endif %% #if (defined(UNIX) || defined(WIN32_NATIVE)) && defined(HAVE_GETHOSTBYNAME) && defined(TCPCONN) -%% printf("extern object string_to_addr (const char *name);\n"); +%% printf("extern maygc object string_to_addr (const char *name);\n"); %% #endif #if (defined(UNIX) || defined(WIN32_NATIVE)) && defined(HAVE_GETHOSTBYNAME) && defined(TCPCONN) -/* FIXME: Add documentation */ +/* Return the hostent specified by the host designator + > arg: host name designator: + :DEFAULT - current host + string/symbol: FQDN is resolved (gethostbyname) + uint32: raw IPv4 address (gethostbyaddr) + uint128: raw IPv6 address (gethostbyaddr) + bit vector: raw IPv4[46] address (gethostbyaddr) + < static hostent descriptor from LIBC + for syscalls & rawsock modules */ extern struct hostent* resolve_host (object arg); #endif %% #if (defined(UNIX) || defined(WIN32_NATIVE)) && defined(HAVE_GETHOSTBYNAME) && defined(TCPCONN) --__--__-- Message: 2 From: Sam Steingold <sd...@us...> To: cli...@li... Subject: clisp/src stream.d,1.525,1.526 lispbibl.d,1.651,1.652 TODO,1.92,1.93 Date: Tue, 14 Jun 2005 17:17:21 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19708/src Modified Files: stream.d lispbibl.d TODO Log Message: documented open_file_stream_handle, file_stream_truename Index: TODO =================================================================== RCS file: /cvsroot/clisp/clisp/src/TODO,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- TODO 14 Jun 2005 17:11:05 -0000 1.92 +++ TODO 14 Jun 2005 17:17:19 -0000 1.93 @@ -8,8 +8,6 @@ use LockFile instead of LockFileEx [sds] -comments for open_file_stream_handle, file_stream_truename [sds] - resolve_host/IPv6 [bruno] workaround for an extra comma in _clisp.1 [sds] Index: lispbibl.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/lispbibl.d,v retrieving revision 1.651 retrieving revision 1.652 diff -u -d -r1.651 -r1.652 --- lispbibl.d 14 Jun 2005 17:11:03 -0000 1.651 +++ lispbibl.d 14 Jun 2005 17:17:18 -0000 1.652 @@ -16472,9 +16472,14 @@ /* used by STREAM */ %% printf("extern Handle stream_lend_handle (object stream, bool inputp, int * handletype);\n"); -/* FIXME: Add documentation */ -extern object open_file_stream_handle (object stream, Handle *fd); -%% printf("extern object open_file_stream_handle (object stream, Handle *fd);\n"); +/* extract the OS file handle from the file stream + > stream: open Lisp file stream + < fd: OS file handle + < stream: corrected stream in case stream was invalid + for syscall module + can trigger GC */ +extern maygc object open_file_stream_handle (object stream, Handle *fd); +%% printf("extern maygc object open_file_stream_handle (object stream, Handle *fd);\n"); /* Function: Reads several bytes from a stream. read_byte_array(&stream,&bytearray,start,len,persev) @@ -16531,7 +16536,10 @@ extern object var_stream (object sym, uintB strmflags); # is used by IO, PACKAGE, ERROR, DEBUG, SPVW -/* FIXME: Add documentation */ +/* return the file stream truename + > s: file stream (open or closed) - no type check is done! + < truename of the file associated with the stream + for syscall module */ extern object file_stream_truename (object s); %% printf("extern object file_stream_truename (object s);\n"); Index: stream.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/stream.d,v retrieving revision 1.525 retrieving revision 1.526 diff -u -d -r1.525 -r1.526 --- stream.d 7 Jun 2005 11:00:32 -0000 1.525 +++ stream.d 14 Jun 2005 17:17:01 -0000 1.526 @@ -5954,8 +5954,10 @@ # File-Stream in general # ====================== -/* FIXME: Add documentation */ -/* for syscall module */ +/* return the file stream truename + > s: file stream (open or closed) - no type check is done! + < truename of the file associated with the stream + for syscall module */ global object file_stream_truename (object s) { return FileStream_truename(s); } @@ -17096,9 +17098,13 @@ fehler(type_error,GETTEXT("~S: argument ~S is not an open file stream")); } -/* FIXME: Add documentation */ -/* for syscall module */ -global object open_file_stream_handle (object stream, Handle *fd) { +/* extract the OS file handle from the file stream + > stream: open Lisp file stream + < fd: OS file handle + < stream: corrected stream in case stream was invalid + for syscall module + can trigger GC */ +global maygc object open_file_stream_handle (object stream, Handle *fd) { stream = check_open_file_stream(stream,true); *fd = ChannelStream_ihandle(stream); return stream; --__--__-- Message: 3 From: Sam Steingold <sd...@us...> To: cli...@li... Subject: clisp/src lispbibl.d,1.652,1.653 Date: Tue, 14 Jun 2005 17:42:02 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1449/src Modified Files: lispbibl.d Log Message: do not put "maygc" into clisp.h Index: lispbibl.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/lispbibl.d,v retrieving revision 1.652 retrieving revision 1.653 diff -u -d -r1.652 -r1.653 --- lispbibl.d 14 Jun 2005 17:17:18 -0000 1.652 +++ lispbibl.d 14 Jun 2005 17:41:57 -0000 1.653 @@ -16479,7 +16479,7 @@ for syscall module can trigger GC */ extern maygc object open_file_stream_handle (object stream, Handle *fd); -%% printf("extern maygc object open_file_stream_handle (object stream, Handle *fd);\n"); +%% printf("extern object open_file_stream_handle (object stream, Handle *fd);\n"); /* Function: Reads several bytes from a stream. read_byte_array(&stream,&bytearray,start,len,persev) @@ -16703,7 +16703,7 @@ extern maygc object addr_to_string (short type, char *addr); #endif %% #if defined(UNIX) || defined(WIN32_NATIVE) -%% printf("extern maygc object addr_to_string (short type, char *addr);\n"); +%% printf("extern object addr_to_string (short type, char *addr);\n"); %% #endif #if (defined(UNIX) || defined(WIN32_NATIVE)) && defined(HAVE_GETHOSTBYNAME) @@ -16721,7 +16721,7 @@ extern maygc object string_to_addr (const char* name); #endif %% #if (defined(UNIX) || defined(WIN32_NATIVE)) && defined(HAVE_GETHOSTBYNAME) && defined(TCPCONN) -%% printf("extern maygc object string_to_addr (const char *name);\n"); +%% printf("extern object string_to_addr (const char *name);\n"); %% #endif #if (defined(UNIX) || defined(WIN32_NATIVE)) && defined(HAVE_GETHOSTBYNAME) && defined(TCPCONN) --__--__-- Message: 4 From: Sam Steingold <sd...@us...> To: cli...@li... Subject: clisp/src TODO,1.93,1.94 ChangeLog,1.4702,1.4703 Date: Tue, 14 Jun 2005 20:35:00 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27991/src Modified Files: TODO ChangeLog Log Message: make executables built on NT run on w95 Index: TODO =================================================================== RCS file: /cvsroot/clisp/clisp/src/TODO,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- TODO 14 Jun 2005 17:17:19 -0000 1.93 +++ TODO 14 Jun 2005 20:34:49 -0000 1.94 @@ -6,8 +6,6 @@ bind-eval.tst failure on Linux/amd64 [bruno] -use LockFile instead of LockFileEx [sds] - resolve_host/IPv6 [bruno] workaround for an extra comma in _clisp.1 [sds] Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.4702 retrieving revision 1.4703 diff -u -d -r1.4702 -r1.4703 --- ChangeLog 13 Jun 2005 13:13:14 -0000 1.4702 +++ ChangeLog 14 Jun 2005 20:34:49 -0000 1.4703 @@ -1,3 +1,12 @@ +2005-06-14 Sam Steingold <sd...@gn...> + + make executables built on NT run on w95 + * modules/syscalls/calls.c (LockFileExFuncType, UnlockFileExFuncType): + new typedefs + (LockFileExFunc, UnlockFileExFunc): new statis variables + (STREAM-LOCK): use them instead of the NT functions + (module__syscalls__init_function_2): init them + 2005-06-12 Bruno Haible <br...@cl...> Avoid "gcc -missing-declarations" warnings. --__--__-- Message: 5 From: Sam Steingold <sd...@us...> To: cli...@li... Subject: clisp/modules/syscalls calls.c,1.128,1.129 Date: Tue, 14 Jun 2005 20:35:01 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/modules/syscalls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27991/modules/syscalls Modified Files: calls.c Log Message: make executables built on NT run on w95 Index: calls.c =================================================================== RCS file: /cvsroot/clisp/clisp/modules/syscalls/calls.c,v retrieving revision 1.128 retrieving revision 1.129 diff -u -d -r1.128 -r1.129 --- calls.c 13 Jun 2005 13:13:14 -0000 1.128 +++ calls.c 14 Jun 2005 20:34:58 -0000 1.129 @@ -104,6 +104,38 @@ # include <fcntl.h> #endif +#if defined(WIN32_NATIVE) +/* LockFileEx does not exist on Windows95/98/ME. */ +typedef BOOL (WINAPI * LockFileExFuncType) + (HANDLE hFile, DWORD dwFlags, DWORD dwReserved, + DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, + LPOVERLAPPED lpOverlapped); +static LockFileExFuncType LockFileExFunc = NULL; +static BOOL my_LockFileEx +(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, + DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, + LPOVERLAPPED lpOverlapped) +{ + (void)dwFlags; (void)dwReserved; + return LockFile(hFile,lpOverlapped->Offset,lpOverlapped->OffsetHigh, + nNumberOfBytesToLockLow,nNumberOfBytesToLockHigh); +} +typedef BOOL (WINAPI * UnlockFileExFuncType) + (HANDLE hFile, DWORD dwReserved, + DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh, + LPOVERLAPPED lpOverlapped); +static UnlockFileExFuncType UnlockFileExFunc = NULL; +static BOOL my_UnlockFileEx +(HANDLE hFile, DWORD dwReserved, + DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh, + LPOVERLAPPED lpOverlapped) +{ + (void)dwReserved; + return UnlockFile(hFile,lpOverlapped->Offset,lpOverlapped->OffsetHigh, + nNumberOfBytesToUnlockLow,nNumberOfBytesToUnlockHigh); +} +#endif + DEFUN(POSIX::STREAM-LOCK, stream lockp &key BLOCK SHARED START LENGTH) { /* the interface to fcntl(2) */ Handle fd = (Handle)-1; @@ -171,12 +203,11 @@ begin_system_call(); #if defined(WIN32_NATIVE) if (lock_p) { - /* FIXME: LockFileEx does not exist on Windows95/98/ME. */ - failed_p = !LockFileEx(fd,flags,0,length,0,&ol); + failed_p = !(*LockFileExFunc)(fd,flags,0,length,0,&ol); if (failed_p && nullp(STACK_3) && GetLastError() == ERROR_LOCK_VIOLATION) failed_p = lock_p = false; /* failed to lock, :BLOCK NIL */ } else - failed_p = !UnlockFileEx(fd,0,length,0,&ol); + failed_p = !(*UnlockFileExFunc)(fd,0,length,0,&ol); #else fl.l_len = length; if ((failed_p = (-1 == fcntl(fd,cmd,&fl))) @@ -1559,8 +1590,8 @@ }; #define HAVE_STATVFS_F_VOLNAME #define HAVE_STATVFS_F_FSTYPE -int statvfs (const char *fname, struct statvfs *sfs) -{ +int statvfs (const char *fname, struct statvfs *sfs); +int statvfs (const char *fname, struct statvfs *sfs) { /* GetDiskFreeSpaceEx must be called before GetDiskFreeSpace on WinME, to avoid the MS KB 314417 bug */ ULARGE_INTEGER availb, freeb, totalb; @@ -1952,6 +1983,14 @@ GetProcAddress (kernel32, "CreateHardLinkA"); BackupWriteFunc = (BackupWriteFuncType) GetProcAddress (kernel32, "BackupWrite"); + LockFileExFunc = (LockFileExFuncType) + GetProcAddress (kernel32, "LockFileEx"); + if (LockFileExFunc == NULL) + LockFileExFunc = (LockFileExFuncType) &my_LockFileEx; + UnlockFileExFunc = (UnlockFileExFuncType) + GetProcAddress (kernel32, "UnlockFileEx"); + if (UnlockFileExFunc == NULL) + UnlockFileExFunc = (UnlockFileExFuncType) &my_UnlockFileEx; } #endif #if defined(WIN32_NATIVE) || defined(UNIX_CYGWIN32) --__--__-- _______________________________________________ clisp-cvs mailing list cli...@li... https://lists.sourceforge.net/lists/listinfo/clisp-cvs End of clisp-cvs Digest |