mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c, keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c, objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c, ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c, stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c, symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c, weaks.c: Converted docstrings to ANSI C format. * filesys.c (scm_chmod), simpos.c (s_scm_system), version (scm_version), vports (scm_make_soft_port): Escape " occuring inside docstring.
This commit is contained in:
parent
b380b88547
commit
d3818c2982
4 changed files with 243 additions and 264 deletions
|
@ -124,18 +124,17 @@
|
||||||
|
|
||||||
SCM_DEFINE (scm_chown, "chown", 3, 0, 0,
|
SCM_DEFINE (scm_chown, "chown", 3, 0, 0,
|
||||||
(SCM object, SCM owner, SCM group),
|
(SCM object, SCM owner, SCM group),
|
||||||
"Change the ownership and group of the file referred to by @var{obj} to
|
"Change the ownership and group of the file referred to by @var{obj} to\n"
|
||||||
the integer userid values @var{owner} and @var{group}. @var{obj} can be
|
"the integer userid values @var{owner} and @var{group}. @var{obj} can be\n"
|
||||||
a string containing a file name or a port or integer file descriptor
|
"a string containing a file name or a port or integer file descriptor\n"
|
||||||
which is open on the file (in which case fchown is used as the underlying
|
"which is open on the file (in which case fchown is used as the underlying\n"
|
||||||
system call). The return value
|
"system call). The return value\n"
|
||||||
is unspecified.
|
"is unspecified.\n\n"
|
||||||
|
"If @var{obj} is a symbolic link, either the\n"
|
||||||
If @var{obj} is a symbolic link, either the
|
"ownership of the link or the ownership of the referenced file will be\n"
|
||||||
ownership of the link or the ownership of the referenced file will be
|
"changed depending on the operating system (lchown is\n"
|
||||||
changed depending on the operating system (lchown is
|
"unsupported at present). If @var{owner} or @var{group} is specified\n"
|
||||||
unsupported at present). If @var{owner} or @var{group} is specified
|
"as @code{-1}, then that ID is not changed.")
|
||||||
as @code{-1}, then that ID is not changed.")
|
|
||||||
#define FUNC_NAME s_scm_chown
|
#define FUNC_NAME s_scm_chown
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
@ -169,13 +168,13 @@ as @code{-1}, then that ID is not changed.")
|
||||||
|
|
||||||
SCM_DEFINE (scm_chmod, "chmod", 2, 0, 0,
|
SCM_DEFINE (scm_chmod, "chmod", 2, 0, 0,
|
||||||
(SCM object, SCM mode),
|
(SCM object, SCM mode),
|
||||||
"Changes the permissions of the file referred to by @var{obj}.
|
"Changes the permissions of the file referred to by @var{obj}.\n"
|
||||||
@var{obj} can be a string containing a file name or a port or integer file
|
"@var{obj} can be a string containing a file name or a port or integer file\n"
|
||||||
descriptor which is open on a file (in which case @code{fchmod} is used
|
"descriptor which is open on a file (in which case @code{fchmod} is used\n"
|
||||||
as the underlying system call).
|
"as the underlying system call).\n"
|
||||||
@var{mode} specifies
|
"@var{mode} specifies\n"
|
||||||
the new permissions as a decimal number, e.g., @code{(chmod "foo" #o755)}.
|
"the new permissions as a decimal number, e.g., @code{(chmod \"foo\" #o755)}.\n"
|
||||||
The return value is unspecified.")
|
"The return value is unspecified.")
|
||||||
#define FUNC_NAME s_scm_chmod
|
#define FUNC_NAME s_scm_chmod
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
@ -206,11 +205,10 @@ The return value is unspecified.")
|
||||||
|
|
||||||
SCM_DEFINE (scm_umask, "umask", 0, 1, 0,
|
SCM_DEFINE (scm_umask, "umask", 0, 1, 0,
|
||||||
(SCM mode),
|
(SCM mode),
|
||||||
"If @var{mode} is omitted, retuns a decimal number representing the current
|
"If @var{mode} is omitted, retuns a decimal number representing the current\n"
|
||||||
file creation mask. Otherwise the file creation mask is set to
|
"file creation mask. Otherwise the file creation mask is set to\n"
|
||||||
@var{mode} and the previous value is returned.
|
"@var{mode} and the previous value is returned.\n\n"
|
||||||
|
"E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.")
|
||||||
E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.")
|
|
||||||
#define FUNC_NAME s_scm_umask
|
#define FUNC_NAME s_scm_umask
|
||||||
{
|
{
|
||||||
mode_t mask;
|
mode_t mask;
|
||||||
|
@ -232,8 +230,8 @@ E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.")
|
||||||
|
|
||||||
SCM_DEFINE (scm_open_fdes, "open-fdes", 2, 1, 0,
|
SCM_DEFINE (scm_open_fdes, "open-fdes", 2, 1, 0,
|
||||||
(SCM path, SCM flags, SCM mode),
|
(SCM path, SCM flags, SCM mode),
|
||||||
"Similar to @code{open} but returns a file descriptor instead of a
|
"Similar to @code{open} but returns a file descriptor instead of a\n"
|
||||||
port.")
|
"port.")
|
||||||
#define FUNC_NAME s_scm_open_fdes
|
#define FUNC_NAME s_scm_open_fdes
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
@ -253,33 +251,30 @@ port.")
|
||||||
|
|
||||||
SCM_DEFINE (scm_open, "open", 2, 1, 0,
|
SCM_DEFINE (scm_open, "open", 2, 1, 0,
|
||||||
(SCM path, SCM flags, SCM mode),
|
(SCM path, SCM flags, SCM mode),
|
||||||
"Open the file named by @var{path} for reading and/or writing.
|
"Open the file named by @var{path} for reading and/or writing.\n"
|
||||||
@var{flags} is an integer specifying how the file should be opened.
|
"@var{flags} is an integer specifying how the file should be opened.\n"
|
||||||
@var{mode} is an integer specifying the permission bits of the file, if
|
"@var{mode} is an integer specifying the permission bits of the file, if\n"
|
||||||
it needs to be created, before the umask is applied. The default is 666
|
"it needs to be created, before the umask is applied. The default is 666\n"
|
||||||
(Unix itself has no default).
|
"(Unix itself has no default).\n\n"
|
||||||
|
"@var{flags} can be constructed by combining variables using @code{logior}.\n"
|
||||||
@var{flags} can be constructed by combining variables using @code{logior}.
|
"Basic flags are:\n\n"
|
||||||
Basic flags are:
|
"@defvar O_RDONLY\n"
|
||||||
|
"Open the file read-only.\n"
|
||||||
@defvar O_RDONLY
|
"@end defvar\n"
|
||||||
Open the file read-only.
|
"@defvar O_WRONLY\n"
|
||||||
@end defvar
|
"Open the file write-only. \n"
|
||||||
@defvar O_WRONLY
|
"@end defvar\n"
|
||||||
Open the file write-only.
|
"@defvar O_RDWR\n"
|
||||||
@end defvar
|
"Open the file read/write.\n"
|
||||||
@defvar O_RDWR
|
"@end defvar\n"
|
||||||
Open the file read/write.
|
"@defvar O_APPEND\n"
|
||||||
@end defvar
|
"Append to the file instead of truncating.\n"
|
||||||
@defvar O_APPEND
|
"@end defvar\n"
|
||||||
Append to the file instead of truncating.
|
"@defvar O_CREAT\n"
|
||||||
@end defvar
|
"Create the file if it does not already exist.\n"
|
||||||
@defvar O_CREAT
|
"@end defvar\n\n"
|
||||||
Create the file if it does not already exist.
|
"See the Unix documentation of the @code{open} system call\n"
|
||||||
@end defvar
|
"for additional flags.")
|
||||||
|
|
||||||
See the Unix documentation of the @code{open} system call
|
|
||||||
for additional flags.")
|
|
||||||
#define FUNC_NAME s_scm_open
|
#define FUNC_NAME s_scm_open
|
||||||
{
|
{
|
||||||
SCM newpt;
|
SCM newpt;
|
||||||
|
@ -313,11 +308,11 @@ for additional flags.")
|
||||||
|
|
||||||
SCM_DEFINE (scm_close, "close", 1, 0, 0,
|
SCM_DEFINE (scm_close, "close", 1, 0, 0,
|
||||||
(SCM fd_or_port),
|
(SCM fd_or_port),
|
||||||
"Similar to close-port (@pxref{Generic Port Operations, close-port}),
|
"Similar to close-port (@pxref{Generic Port Operations, close-port}),\n"
|
||||||
but also works on file descriptors. A side
|
"but also works on file descriptors. A side\n"
|
||||||
effect of closing a file descriptor is that any ports using that file
|
"effect of closing a file descriptor is that any ports using that file\n"
|
||||||
descriptor are moved to a different file descriptor and have
|
"descriptor are moved to a different file descriptor and have\n"
|
||||||
their revealed counts set to zero.")
|
"their revealed counts set to zero.")
|
||||||
#define FUNC_NAME s_scm_close
|
#define FUNC_NAME s_scm_close
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
@ -446,60 +441,56 @@ scm_stat2scm (struct stat *stat_temp)
|
||||||
|
|
||||||
SCM_DEFINE (scm_stat, "stat", 1, 0, 0,
|
SCM_DEFINE (scm_stat, "stat", 1, 0, 0,
|
||||||
(SCM object),
|
(SCM object),
|
||||||
"Returns an object containing various information
|
"Returns an object containing various information\n"
|
||||||
about the file determined by @var{obj}.
|
"about the file determined by @var{obj}.\n"
|
||||||
@var{obj} can be a string containing a file name or a port or integer file
|
"@var{obj} can be a string containing a file name or a port or integer file\n"
|
||||||
descriptor which is open on a file (in which case @code{fstat} is used
|
"descriptor which is open on a file (in which case @code{fstat} is used\n"
|
||||||
as the underlying system call).
|
"as the underlying system call).\n\n"
|
||||||
|
"The object returned by @code{stat} can be passed as a single parameter\n"
|
||||||
The object returned by @code{stat} can be passed as a single parameter
|
"to the following procedures, all of which return integers:\n\n"
|
||||||
to the following procedures, all of which return integers:
|
"@table @code\n"
|
||||||
|
"@item stat:dev\n"
|
||||||
@table @code
|
"The device containing the file.\n"
|
||||||
@item stat:dev
|
"@item stat:ino\n"
|
||||||
The device containing the file.
|
"The file serial number, which distinguishes this file from all other\n"
|
||||||
@item stat:ino
|
"files on the same device.\n"
|
||||||
The file serial number, which distinguishes this file from all other
|
"@item stat:mode\n"
|
||||||
files on the same device.
|
"The mode of the file. This includes file type information\n"
|
||||||
@item stat:mode
|
"and the file permission bits. See @code{stat:type} and @code{stat:perms}\n"
|
||||||
The mode of the file. This includes file type information
|
"below.\n"
|
||||||
and the file permission bits. See @code{stat:type} and @code{stat:perms}
|
"@item stat:nlink\n"
|
||||||
below.
|
"The number of hard links to the file.\n"
|
||||||
@item stat:nlink
|
"@item stat:uid\n"
|
||||||
The number of hard links to the file.
|
"The user ID of the file's owner.\n"
|
||||||
@item stat:uid
|
"@item stat:gid\n"
|
||||||
The user ID of the file's owner.
|
"The group ID of the file.\n"
|
||||||
@item stat:gid
|
"@item stat:rdev\n"
|
||||||
The group ID of the file.
|
"Device ID; this entry is defined only for character or block\n"
|
||||||
@item stat:rdev
|
"special files.\n"
|
||||||
Device ID; this entry is defined only for character or block
|
"@item stat:size\n"
|
||||||
special files.
|
"The size of a regular file in bytes.\n"
|
||||||
@item stat:size
|
"@item stat:atime\n"
|
||||||
The size of a regular file in bytes.
|
"The last access time for the file.\n"
|
||||||
@item stat:atime
|
"@item stat:mtime\n"
|
||||||
The last access time for the file.
|
"The last modification time for the file.\n"
|
||||||
@item stat:mtime
|
"@item stat:ctime\n"
|
||||||
The last modification time for the file.
|
"The last modification time for the attributes of the file.\n"
|
||||||
@item stat:ctime
|
"@item stat:blksize\n"
|
||||||
The last modification time for the attributes of the file.
|
"The optimal block size for reading or writing the file, in bytes.\n"
|
||||||
@item stat:blksize
|
"@item stat:blocks\n"
|
||||||
The optimal block size for reading or writing the file, in bytes.
|
"The amount of disk space that the file occupies measured in units of\n"
|
||||||
@item stat:blocks
|
"512 byte blocks.\n"
|
||||||
The amount of disk space that the file occupies measured in units of
|
"@end table\n\n"
|
||||||
512 byte blocks.
|
"In addition, the following procedures return the information\n"
|
||||||
@end table
|
"from stat:mode in a more convenient form:\n\n"
|
||||||
|
"@table @code\n"
|
||||||
In addition, the following procedures return the information
|
"@item stat:type\n"
|
||||||
from stat:mode in a more convenient form:
|
"A symbol representing the type of file. Possible values are\n"
|
||||||
|
"regular, directory, symlink, block-special, char-special,\n"
|
||||||
@table @code
|
"fifo, socket and unknown\n"
|
||||||
@item stat:type
|
"@item stat:perms\n"
|
||||||
A symbol representing the type of file. Possible values are
|
"An integer representing the access permission bits.\n"
|
||||||
regular, directory, symlink, block-special, char-special,
|
"@end table")
|
||||||
fifo, socket and unknown
|
|
||||||
@item stat:perms
|
|
||||||
An integer representing the access permission bits.
|
|
||||||
@end table")
|
|
||||||
#define FUNC_NAME s_scm_stat
|
#define FUNC_NAME s_scm_stat
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
@ -543,9 +534,9 @@ An integer representing the access permission bits.
|
||||||
|
|
||||||
SCM_DEFINE (scm_link, "link", 2, 0, 0,
|
SCM_DEFINE (scm_link, "link", 2, 0, 0,
|
||||||
(SCM oldpath, SCM newpath),
|
(SCM oldpath, SCM newpath),
|
||||||
"Creates a new name @var{path-to} in the file system for the file
|
"Creates a new name @var{path-to} in the file system for the file\n"
|
||||||
named by @var{path-from}. If @var{path-from} is a symbolic link, the
|
"named by @var{path-from}. If @var{path-from} is a symbolic link, the\n"
|
||||||
link may or may not be followed depending on the system.")
|
"link may or may not be followed depending on the system.")
|
||||||
#define FUNC_NAME s_scm_link
|
#define FUNC_NAME s_scm_link
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
|
@ -569,8 +560,8 @@ link may or may not be followed depending on the system.")
|
||||||
|
|
||||||
SCM_DEFINE (scm_rename, "rename-file", 2, 0, 0,
|
SCM_DEFINE (scm_rename, "rename-file", 2, 0, 0,
|
||||||
(SCM oldname, SCM newname),
|
(SCM oldname, SCM newname),
|
||||||
"Renames the file specified by @var{path-from} to @var{path-to}.
|
"Renames the file specified by @var{path-from} to @var{path-to}.\n"
|
||||||
The return value is unspecified.")
|
"The return value is unspecified.")
|
||||||
#define FUNC_NAME s_scm_rename
|
#define FUNC_NAME s_scm_rename
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
@ -599,7 +590,7 @@ The return value is unspecified.")
|
||||||
|
|
||||||
SCM_DEFINE (scm_delete_file, "delete-file", 1, 0, 0,
|
SCM_DEFINE (scm_delete_file, "delete-file", 1, 0, 0,
|
||||||
(SCM str),
|
(SCM str),
|
||||||
"Deletes (or \"unlinks\") the file specified by @var{path}.")
|
"Deletes (or \"unlinks\") the file specified by @var{path}.")
|
||||||
#define FUNC_NAME s_scm_delete_file
|
#define FUNC_NAME s_scm_delete_file
|
||||||
{
|
{
|
||||||
int ans;
|
int ans;
|
||||||
|
@ -615,10 +606,10 @@ SCM_DEFINE (scm_delete_file, "delete-file", 1, 0, 0,
|
||||||
#ifdef HAVE_MKDIR
|
#ifdef HAVE_MKDIR
|
||||||
SCM_DEFINE (scm_mkdir, "mkdir", 1, 1, 0,
|
SCM_DEFINE (scm_mkdir, "mkdir", 1, 1, 0,
|
||||||
(SCM path, SCM mode),
|
(SCM path, SCM mode),
|
||||||
"Create a new directory named by @var{path}. If @var{mode} is omitted
|
"Create a new directory named by @var{path}. If @var{mode} is omitted\n"
|
||||||
then the permissions of the directory file are set using the current
|
"then the permissions of the directory file are set using the current\n"
|
||||||
umask. Otherwise they are set to the decimal value specified with
|
"umask. Otherwise they are set to the decimal value specified with\n"
|
||||||
@var{mode}. The return value is unspecified.")
|
"@var{mode}. The return value is unspecified.")
|
||||||
#define FUNC_NAME s_scm_mkdir
|
#define FUNC_NAME s_scm_mkdir
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
@ -646,8 +637,8 @@ umask. Otherwise they are set to the decimal value specified with
|
||||||
#ifdef HAVE_RMDIR
|
#ifdef HAVE_RMDIR
|
||||||
SCM_DEFINE (scm_rmdir, "rmdir", 1, 0, 0,
|
SCM_DEFINE (scm_rmdir, "rmdir", 1, 0, 0,
|
||||||
(SCM path),
|
(SCM path),
|
||||||
"Remove the existing directory named by @var{path}. The directory must
|
"Remove the existing directory named by @var{path}. The directory must\n"
|
||||||
be empty for this to succeed. The return value is unspecified.")
|
"be empty for this to succeed. The return value is unspecified.")
|
||||||
#define FUNC_NAME s_scm_rmdir
|
#define FUNC_NAME s_scm_rmdir
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
|
@ -670,8 +661,8 @@ long scm_tc16_dir;
|
||||||
|
|
||||||
SCM_DEFINE (scm_directory_stream_p, "directory-stream?", 1, 0, 0,
|
SCM_DEFINE (scm_directory_stream_p, "directory-stream?", 1, 0, 0,
|
||||||
(SCM obj),
|
(SCM obj),
|
||||||
"Returns a boolean indicating whether @var{object} is a directory stream
|
"Returns a boolean indicating whether @var{object} is a directory stream\n"
|
||||||
as returned by @code{opendir}.")
|
"as returned by @code{opendir}.")
|
||||||
#define FUNC_NAME s_scm_directory_stream_p
|
#define FUNC_NAME s_scm_directory_stream_p
|
||||||
{
|
{
|
||||||
return SCM_BOOL(SCM_DIRP (obj));
|
return SCM_BOOL(SCM_DIRP (obj));
|
||||||
|
@ -680,8 +671,8 @@ as returned by @code{opendir}.")
|
||||||
|
|
||||||
SCM_DEFINE (scm_opendir, "opendir", 1, 0, 0,
|
SCM_DEFINE (scm_opendir, "opendir", 1, 0, 0,
|
||||||
(SCM dirname),
|
(SCM dirname),
|
||||||
"Open the directory specified by @var{path} and return a directory
|
"Open the directory specified by @var{path} and return a directory\n"
|
||||||
stream.")
|
"stream.")
|
||||||
#define FUNC_NAME s_scm_opendir
|
#define FUNC_NAME s_scm_opendir
|
||||||
{
|
{
|
||||||
DIR *ds;
|
DIR *ds;
|
||||||
|
@ -697,9 +688,9 @@ stream.")
|
||||||
|
|
||||||
SCM_DEFINE (scm_readdir, "readdir", 1, 0, 0,
|
SCM_DEFINE (scm_readdir, "readdir", 1, 0, 0,
|
||||||
(SCM port),
|
(SCM port),
|
||||||
"Return (as a string) the next directory entry from the directory stream
|
"Return (as a string) the next directory entry from the directory stream\n"
|
||||||
@var{stream}. If there is no remaining entry to be read then the
|
"@var{stream}. If there is no remaining entry to be read then the\n"
|
||||||
end of file object is returned.")
|
"end of file object is returned.")
|
||||||
#define FUNC_NAME s_scm_readdir
|
#define FUNC_NAME s_scm_readdir
|
||||||
{
|
{
|
||||||
struct dirent *rdent;
|
struct dirent *rdent;
|
||||||
|
@ -717,8 +708,8 @@ end of file object is returned.")
|
||||||
|
|
||||||
SCM_DEFINE (scm_rewinddir, "rewinddir", 1, 0, 0,
|
SCM_DEFINE (scm_rewinddir, "rewinddir", 1, 0, 0,
|
||||||
(SCM port),
|
(SCM port),
|
||||||
"Reset the directory port @var{stream} so that the next call to
|
"Reset the directory port @var{stream} so that the next call to\n"
|
||||||
@code{readdir} will return the first directory entry.")
|
"@code{readdir} will return the first directory entry.")
|
||||||
#define FUNC_NAME s_scm_rewinddir
|
#define FUNC_NAME s_scm_rewinddir
|
||||||
{
|
{
|
||||||
SCM_VALIDATE_OPDIR (1,port);
|
SCM_VALIDATE_OPDIR (1,port);
|
||||||
|
@ -731,8 +722,8 @@ SCM_DEFINE (scm_rewinddir, "rewinddir", 1, 0, 0,
|
||||||
|
|
||||||
SCM_DEFINE (scm_closedir, "closedir", 1, 0, 0,
|
SCM_DEFINE (scm_closedir, "closedir", 1, 0, 0,
|
||||||
(SCM port),
|
(SCM port),
|
||||||
"Close the directory stream @var{stream}.
|
"Close the directory stream @var{stream}.\n"
|
||||||
The return value is unspecified.")
|
"The return value is unspecified.")
|
||||||
#define FUNC_NAME s_scm_closedir
|
#define FUNC_NAME s_scm_closedir
|
||||||
{
|
{
|
||||||
int sts;
|
int sts;
|
||||||
|
@ -781,8 +772,8 @@ scm_dir_free (SCM p)
|
||||||
|
|
||||||
SCM_DEFINE (scm_chdir, "chdir", 1, 0, 0,
|
SCM_DEFINE (scm_chdir, "chdir", 1, 0, 0,
|
||||||
(SCM str),
|
(SCM str),
|
||||||
"Change the current working directory to @var{path}.
|
"Change the current working directory to @var{path}.\n"
|
||||||
The return value is unspecified.")
|
"The return value is unspecified.")
|
||||||
#define FUNC_NAME s_scm_chdir
|
#define FUNC_NAME s_scm_chdir
|
||||||
{
|
{
|
||||||
int ans;
|
int ans;
|
||||||
|
@ -799,7 +790,7 @@ The return value is unspecified.")
|
||||||
#ifdef HAVE_GETCWD
|
#ifdef HAVE_GETCWD
|
||||||
SCM_DEFINE (scm_getcwd, "getcwd", 0, 0, 0,
|
SCM_DEFINE (scm_getcwd, "getcwd", 0, 0, 0,
|
||||||
(),
|
(),
|
||||||
"Returns the name of the current working directory.")
|
"Returns the name of the current working directory.")
|
||||||
#define FUNC_NAME s_scm_getcwd
|
#define FUNC_NAME s_scm_getcwd
|
||||||
{
|
{
|
||||||
char *rv;
|
char *rv;
|
||||||
|
@ -922,29 +913,26 @@ retrieve_select_type (SELECT_TYPE *set, SCM list)
|
||||||
/* Static helper functions above refer to s_scm_select directly as s_select */
|
/* Static helper functions above refer to s_scm_select directly as s_select */
|
||||||
SCM_DEFINE (scm_select, "select", 3, 2, 0,
|
SCM_DEFINE (scm_select, "select", 3, 2, 0,
|
||||||
(SCM reads, SCM writes, SCM excepts, SCM secs, SCM usecs),
|
(SCM reads, SCM writes, SCM excepts, SCM secs, SCM usecs),
|
||||||
"@var{reads}, @var{writes} and @var{excepts} can be lists or vectors: it
|
"@var{reads}, @var{writes} and @var{excepts} can be lists or vectors: it\n"
|
||||||
doesn't matter which, but the corresponding object returned will be
|
"doesn't matter which, but the corresponding object returned will be\n"
|
||||||
of the same type.
|
"of the same type.\n"
|
||||||
Each element is a port or file descriptor on which to wait for
|
"Each element is a port or file descriptor on which to wait for\n"
|
||||||
readability, writeability
|
"readability, writeability\n"
|
||||||
or exceptional conditions respectively. @var{secs} and @var{usecs}
|
"or exceptional conditions respectively. @var{secs} and @var{usecs}\n"
|
||||||
optionally specify a timeout: @var{secs} can be specified alone, as
|
"optionally specify a timeout: @var{secs} can be specified alone, as\n"
|
||||||
either an integer or a real number, or both @var{secs} and @var{usecs}
|
"either an integer or a real number, or both @var{secs} and @var{usecs}\n"
|
||||||
can be specified as integers, in which case @var{usecs} is an additional
|
"can be specified as integers, in which case @var{usecs} is an additional\n"
|
||||||
timeout expressed in microseconds.
|
"timeout expressed in microseconds.\n\n"
|
||||||
|
"Buffered input or output data is (currently, but this may change)\n"
|
||||||
Buffered input or output data is (currently, but this may change)
|
"ignored: select uses the underlying file descriptor of a port\n"
|
||||||
ignored: select uses the underlying file descriptor of a port
|
"(@code{char-ready?} will check input buffers, output buffers are\n"
|
||||||
(@code{char-ready?} will check input buffers, output buffers are
|
"problematic).\n\n"
|
||||||
problematic).
|
"The return value is a list of subsets of the input lists or vectors for\n"
|
||||||
|
"which the requested condition has been met.\n\n"
|
||||||
The return value is a list of subsets of the input lists or vectors for
|
"It is not quite compatible with scsh's select: scsh checks port buffers,\n"
|
||||||
which the requested condition has been met.
|
"doesn't accept input lists or a microsecond timeout, returns multiple\n"
|
||||||
|
"values instead of a list and has an additional select! interface.\n"
|
||||||
It is not quite compatible with scsh's select: scsh checks port buffers,
|
"")
|
||||||
doesn't accept input lists or a microsecond timeout, returns multiple
|
|
||||||
values instead of a list and has an additional select! interface.
|
|
||||||
")
|
|
||||||
#define FUNC_NAME s_scm_select
|
#define FUNC_NAME s_scm_select
|
||||||
{
|
{
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
|
@ -1025,29 +1013,27 @@ values instead of a list and has an additional select! interface.
|
||||||
|
|
||||||
SCM_DEFINE (scm_fcntl, "fcntl", 2, 0, 1,
|
SCM_DEFINE (scm_fcntl, "fcntl", 2, 0, 1,
|
||||||
(SCM object, SCM cmd, SCM value),
|
(SCM object, SCM cmd, SCM value),
|
||||||
"Apply @var{command} to the specified file descriptor or the underlying
|
"Apply @var{command} to the specified file descriptor or the underlying\n"
|
||||||
file descriptor of the specified port. @var{value} is an optional
|
"file descriptor of the specified port. @var{value} is an optional\n"
|
||||||
integer argument.
|
"integer argument.\n\n"
|
||||||
|
"Values for @var{command} are:\n\n"
|
||||||
Values for @var{command} are:
|
"@table @code\n"
|
||||||
|
"@item F_DUPFD\n"
|
||||||
@table @code
|
"Duplicate a file descriptor\n"
|
||||||
@item F_DUPFD
|
"@item F_GETFD\n"
|
||||||
Duplicate a file descriptor
|
"Get flags associated with the file descriptor.\n"
|
||||||
@item F_GETFD
|
"@item F_SETFD\n"
|
||||||
Get flags associated with the file descriptor.
|
"Set flags associated with the file descriptor to @var{value}.\n"
|
||||||
@item F_SETFD
|
"@item F_GETFL\n"
|
||||||
Set flags associated with the file descriptor to @var{value}.
|
"Get flags associated with the open file.\n"
|
||||||
@item F_GETFL
|
"@item F_SETFL\n"
|
||||||
Get flags associated with the open file.
|
"Set flags associated with the open file to @var{value}\n"
|
||||||
@item F_SETFL
|
"@item F_GETOWN\n"
|
||||||
Set flags associated with the open file to @var{value}
|
"Get the process ID of a socket's owner, for @code{SIGIO} signals.\n"
|
||||||
@item F_GETOWN
|
"@item F_SETOWN\n"
|
||||||
Get the process ID of a socket's owner, for @code{SIGIO} signals.
|
"Set the process that owns a socket to @var{value}, for @code{SIGIO} signals.\n"
|
||||||
@item F_SETOWN
|
"@item FD_CLOEXEC\n"
|
||||||
Set the process that owns a socket to @var{value}, for @code{SIGIO} signals.
|
"The value used to indicate the "close on exec" flag with @code{F_GETFL} or
|
||||||
@item FD_CLOEXEC
|
|
||||||
The value used to indicate the "close on exec" flag with @code{F_GETFL} or
|
|
||||||
@code{F_SETFL}.
|
@code{F_SETFL}.
|
||||||
@end table")
|
@end table")
|
||||||
#define FUNC_NAME s_scm_fcntl
|
#define FUNC_NAME s_scm_fcntl
|
||||||
|
@ -1082,10 +1068,10 @@ The value used to indicate the "close on exec" flag with @code{F_GETFL} or
|
||||||
|
|
||||||
SCM_DEFINE (scm_fsync, "fsync", 1, 0, 0,
|
SCM_DEFINE (scm_fsync, "fsync", 1, 0, 0,
|
||||||
(SCM object),
|
(SCM object),
|
||||||
"Copies any unwritten data for the specified output file descriptor to disk.
|
"Copies any unwritten data for the specified output file descriptor to disk.\n"
|
||||||
If @var{port/fd} is a port, its buffer is flushed before the underlying
|
"If @var{port/fd} is a port, its buffer is flushed before the underlying\n"
|
||||||
file descriptor is fsync'd.
|
"file descriptor is fsync'd.\n"
|
||||||
The return value is unspecified.")
|
"The return value is unspecified.")
|
||||||
#define FUNC_NAME s_scm_fsync
|
#define FUNC_NAME s_scm_fsync
|
||||||
{
|
{
|
||||||
int fdes;
|
int fdes;
|
||||||
|
@ -1111,8 +1097,8 @@ The return value is unspecified.")
|
||||||
#ifdef HAVE_SYMLINK
|
#ifdef HAVE_SYMLINK
|
||||||
SCM_DEFINE (scm_symlink, "symlink", 2, 0, 0,
|
SCM_DEFINE (scm_symlink, "symlink", 2, 0, 0,
|
||||||
(SCM oldpath, SCM newpath),
|
(SCM oldpath, SCM newpath),
|
||||||
"Create a symbolic link named @var{path-to} with the value (i.e., pointing to)
|
"Create a symbolic link named @var{path-to} with the value (i.e., pointing to)\n"
|
||||||
@var{path-from}. The return value is unspecified.")
|
"@var{path-from}. The return value is unspecified.")
|
||||||
#define FUNC_NAME s_scm_symlink
|
#define FUNC_NAME s_scm_symlink
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
|
@ -1132,9 +1118,9 @@ SCM_DEFINE (scm_symlink, "symlink", 2, 0, 0,
|
||||||
#ifdef HAVE_READLINK
|
#ifdef HAVE_READLINK
|
||||||
SCM_DEFINE (scm_readlink, "readlink", 1, 0, 0,
|
SCM_DEFINE (scm_readlink, "readlink", 1, 0, 0,
|
||||||
(SCM path),
|
(SCM path),
|
||||||
"Returns the value of the symbolic link named by
|
"Returns the value of the symbolic link named by\n"
|
||||||
@var{path} (a string), i.e., the
|
"@var{path} (a string), i.e., the\n"
|
||||||
file that the link points to.")
|
"file that the link points to.")
|
||||||
#define FUNC_NAME s_scm_readlink
|
#define FUNC_NAME s_scm_readlink
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
@ -1162,9 +1148,9 @@ file that the link points to.")
|
||||||
#ifdef HAVE_LSTAT
|
#ifdef HAVE_LSTAT
|
||||||
SCM_DEFINE (scm_lstat, "lstat", 1, 0, 0,
|
SCM_DEFINE (scm_lstat, "lstat", 1, 0, 0,
|
||||||
(SCM str),
|
(SCM str),
|
||||||
"Similar to @code{stat}, but does not follow symbolic links, i.e.,
|
"Similar to @code{stat}, but does not follow symbolic links, i.e.,\n"
|
||||||
it will return information about a symbolic link itself, not the
|
"it will return information about a symbolic link itself, not the \n"
|
||||||
file it points to. @var{path} must be a string.")
|
"file it points to. @var{path} must be a string.")
|
||||||
#define FUNC_NAME s_scm_lstat
|
#define FUNC_NAME s_scm_lstat
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
@ -1189,8 +1175,8 @@ file it points to. @var{path} must be a string.")
|
||||||
|
|
||||||
SCM_DEFINE (scm_copy_file, "copy-file", 2, 0, 0,
|
SCM_DEFINE (scm_copy_file, "copy-file", 2, 0, 0,
|
||||||
(SCM oldfile, SCM newfile),
|
(SCM oldfile, SCM newfile),
|
||||||
"Copy the file specified by @var{path-from} to @var{path-to}.
|
"Copy the file specified by @var{path-from} to @var{path-to}.\n"
|
||||||
The return value is unspecified.")
|
"The return value is unspecified.")
|
||||||
#define FUNC_NAME s_scm_copy_file
|
#define FUNC_NAME s_scm_copy_file
|
||||||
{
|
{
|
||||||
int oldfd, newfd;
|
int oldfd, newfd;
|
||||||
|
@ -1237,7 +1223,7 @@ SCM scm_dot_string;
|
||||||
|
|
||||||
SCM_DEFINE (scm_dirname, "dirname", 1, 0, 0,
|
SCM_DEFINE (scm_dirname, "dirname", 1, 0, 0,
|
||||||
(SCM filename),
|
(SCM filename),
|
||||||
"")
|
"")
|
||||||
#define FUNC_NAME s_scm_dirname
|
#define FUNC_NAME s_scm_dirname
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
|
@ -1263,7 +1249,7 @@ SCM_DEFINE (scm_dirname, "dirname", 1, 0, 0,
|
||||||
|
|
||||||
SCM_DEFINE (scm_basename, "basename", 1, 1, 0,
|
SCM_DEFINE (scm_basename, "basename", 1, 1, 0,
|
||||||
(SCM filename, SCM suffix),
|
(SCM filename, SCM suffix),
|
||||||
"")
|
"")
|
||||||
#define FUNC_NAME s_scm_basename
|
#define FUNC_NAME s_scm_basename
|
||||||
{
|
{
|
||||||
char *f, *s = 0;
|
char *f, *s = 0;
|
||||||
|
|
|
@ -66,13 +66,12 @@ extern int system();
|
||||||
#ifdef HAVE_SYSTEM
|
#ifdef HAVE_SYSTEM
|
||||||
SCM_DEFINE (scm_system, "system", 0, 1, 0,
|
SCM_DEFINE (scm_system, "system", 0, 1, 0,
|
||||||
(SCM cmd),
|
(SCM cmd),
|
||||||
"Executes @var{cmd} using the operating system's "command processor".
|
"Executes @var{cmd} using the operating system's \"command processor\".\n"
|
||||||
Under Unix this is usually the default shell @code{sh}. The value
|
"Under Unix this is usually the default shell @code{sh}. The value\n"
|
||||||
returned is @var{cmd}'s exit status as returned by @code{waitpid}, which
|
"returned is @var{cmd}'s exit status as returned by @code{waitpid}, which\n"
|
||||||
can be interpreted using the functions above.
|
"can be interpreted using the functions above.\n\n"
|
||||||
|
"If @code{system} is called without arguments, it returns a boolean\n"
|
||||||
If @code{system} is called without arguments, it returns a boolean
|
"indicating whether the command processor is available.")
|
||||||
indicating whether the command processor is available.")
|
|
||||||
#define FUNC_NAME s_scm_system
|
#define FUNC_NAME s_scm_system
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
@ -99,10 +98,10 @@ indicating whether the command processor is available.")
|
||||||
extern char *getenv();
|
extern char *getenv();
|
||||||
SCM_DEFINE (scm_getenv, "getenv", 1, 0, 0,
|
SCM_DEFINE (scm_getenv, "getenv", 1, 0, 0,
|
||||||
(SCM nam),
|
(SCM nam),
|
||||||
"Looks up the string @var{name} in the current environment. The return
|
"Looks up the string @var{name} in the current environment. The return\n"
|
||||||
value is @code{#f} unless a string of the form @code{NAME=VALUE} is
|
"value is @code{#f} unless a string of the form @code{NAME=VALUE} is\n"
|
||||||
found, in which case the string @code{VALUE} is
|
"found, in which case the string @code{VALUE} is\n"
|
||||||
returned.")
|
"returned.")
|
||||||
#define FUNC_NAME s_scm_getenv
|
#define FUNC_NAME s_scm_getenv
|
||||||
{
|
{
|
||||||
char *val;
|
char *val;
|
||||||
|
@ -116,9 +115,9 @@ returned.")
|
||||||
/* simple exit, without unwinding the scheme stack or flushing ports. */
|
/* simple exit, without unwinding the scheme stack or flushing ports. */
|
||||||
SCM_DEFINE (scm_primitive_exit, "primitive-exit", 0, 1, 0,
|
SCM_DEFINE (scm_primitive_exit, "primitive-exit", 0, 1, 0,
|
||||||
(SCM status),
|
(SCM status),
|
||||||
"Terminate the current process without unwinding the Scheme stack.
|
"Terminate the current process without unwinding the Scheme stack.\n"
|
||||||
This is would typically be useful after a fork. The exit status
|
"This is would typically be useful after a fork. The exit status\n"
|
||||||
is @var{status} if supplied, otherwise zero.")
|
"is @var{status} if supplied, otherwise zero.")
|
||||||
#define FUNC_NAME s_scm_primitive_exit
|
#define FUNC_NAME s_scm_primitive_exit
|
||||||
{
|
{
|
||||||
int cstatus = 0;
|
int cstatus = 0;
|
||||||
|
|
|
@ -76,16 +76,15 @@ SCM_DEFINE (scm_minor_version, "minor-version", 0, 0, 0,
|
||||||
|
|
||||||
SCM_DEFINE (scm_version, "version", 0, 0, 0,
|
SCM_DEFINE (scm_version, "version", 0, 0, 0,
|
||||||
(),
|
(),
|
||||||
"@deffnx primitive major-version
|
"@deffnx primitive major-version\n"
|
||||||
@deffnx primitive minor-version
|
"@deffnx primitive minor-version\n"
|
||||||
Return a string describing Guile's version number, or its major or minor
|
"Return a string describing Guile's version number, or its major or minor\n"
|
||||||
version numbers, respectively.
|
"version numbers, respectively.\n\n"
|
||||||
|
"@example\n"
|
||||||
@example
|
"(version) @result{} \"1.3a\"\n"
|
||||||
(version) @result{} "1.3a"
|
"(major-version) @result{} \"1\"\n"
|
||||||
(major-version) @result{} "1"
|
"(minor-version) @result{} \"3a\"\n"
|
||||||
(minor-version) @result{} "3a"
|
"@end example")
|
||||||
@end example")
|
|
||||||
#define FUNC_NAME s_scm_version
|
#define FUNC_NAME s_scm_version
|
||||||
{
|
{
|
||||||
return scm_makfrom0str (GUILE_VERSION);
|
return scm_makfrom0str (GUILE_VERSION);
|
||||||
|
|
|
@ -139,46 +139,41 @@ sf_close (SCM port)
|
||||||
|
|
||||||
SCM_DEFINE (scm_make_soft_port, "make-soft-port", 2, 0, 0,
|
SCM_DEFINE (scm_make_soft_port, "make-soft-port", 2, 0, 0,
|
||||||
(SCM pv, SCM modes),
|
(SCM pv, SCM modes),
|
||||||
"Returns a port capable of receiving or delivering characters as
|
"Returns a port capable of receiving or delivering characters as\n"
|
||||||
specified by the @var{modes} string (@pxref{File Ports,
|
"specified by the @var{modes} string (@pxref{File Ports,\n"
|
||||||
open-file}). @var{vector} must be a vector of length 6. Its components
|
"open-file}). @var{vector} must be a vector of length 6. Its components\n"
|
||||||
are as follows:
|
"are as follows:\n\n"
|
||||||
|
"@enumerate 0\n"
|
||||||
@enumerate 0
|
"@item\n"
|
||||||
@item
|
"procedure accepting one character for output\n"
|
||||||
procedure accepting one character for output
|
"@item\n"
|
||||||
@item
|
"procedure accepting a string for output\n"
|
||||||
procedure accepting a string for output
|
"@item\n"
|
||||||
@item
|
"thunk for flushing output\n"
|
||||||
thunk for flushing output
|
"@item\n"
|
||||||
@item
|
"thunk for getting one character\n"
|
||||||
thunk for getting one character
|
"@item\n"
|
||||||
@item
|
"thunk for closing port (not by garbage collection)\n"
|
||||||
thunk for closing port (not by garbage collection)
|
"@end enumerate\n\n"
|
||||||
@end enumerate
|
"For an output-only port only elements 0, 1, 2, and 4 need be\n"
|
||||||
|
"procedures. For an input-only port only elements 3 and 4 need be\n"
|
||||||
For an output-only port only elements 0, 1, 2, and 4 need be
|
"procedures. Thunks 2 and 4 can instead be @code{#f} if there is no useful\n"
|
||||||
procedures. For an input-only port only elements 3 and 4 need be
|
"operation for them to perform.\n\n"
|
||||||
procedures. Thunks 2 and 4 can instead be @code{#f} if there is no useful
|
"If thunk 3 returns @code{#f} or an @code{eof-object} (@pxref{Input,\n"
|
||||||
operation for them to perform.
|
"eof-object?, ,r4rs, The Revised^4 Report on Scheme}) it indicates that\n"
|
||||||
|
"the port has reached end-of-file. For example:\n\n"
|
||||||
If thunk 3 returns @code{#f} or an @code{eof-object} (@pxref{Input,
|
"@example\n"
|
||||||
eof-object?, ,r4rs, The Revised^4 Report on Scheme}) it indicates that
|
"(define stdout (current-output-port))\n"
|
||||||
the port has reached end-of-file. For example:
|
"(define p (make-soft-port\n"
|
||||||
|
" (vector\n"
|
||||||
@example
|
" (lambda (c) (write c stdout))\n"
|
||||||
(define stdout (current-output-port))
|
" (lambda (s) (display s stdout))\n"
|
||||||
(define p (make-soft-port
|
" (lambda () (display \".\" stdout))\n"
|
||||||
(vector
|
" (lambda () (char-upcase (read-char)))\n"
|
||||||
(lambda (c) (write c stdout))
|
" (lambda () (display \"@@\" stdout)))\n"
|
||||||
(lambda (s) (display s stdout))
|
" \"rw\"))\n\n"
|
||||||
(lambda () (display "." stdout))
|
"(write p p) @result{} #<input-output-soft#\space45d10#\>\n"
|
||||||
(lambda () (char-upcase (read-char)))
|
"@end example")
|
||||||
(lambda () (display "@@" stdout)))
|
|
||||||
"rw"))
|
|
||||||
|
|
||||||
(write p p) @result{} #<input-output-soft#\space45d10#\>
|
|
||||||
@end example")
|
|
||||||
#define FUNC_NAME s_scm_make_soft_port
|
#define FUNC_NAME s_scm_make_soft_port
|
||||||
{
|
{
|
||||||
scm_port *pt;
|
scm_port *pt;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue