guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Missing core functions filled in


From: Martin Grabmueller
Subject: Missing core functions filled in
Date: Wed, 07 Mar 2001 11:16:25 +0100

Hello list,

I have now implemented the following procedures, but not (yet)
included into the core.  They are implemented in a shared object right
now, and work fine.  

I wanted to ask what others think of their inclusion into libguile.

List of procedures:

crypt
chroot
getlogin
cuserid
getpriority
setpriority
getpass
flock
fnmatch
glob
sethostname
gethostname
sethostid
gethostid

Some of these (especially the last two) are not very important to most
people, but I had them lying around, so I added them to the module.

Please let me know if you think they should go into the core, or if
you think they should not.  The only reason for inclusion of most of
the procedures is completeness, I think, but procedures like crypt or
getpass seem to be quite useful.

If the developers/maintainers think they should not be merged in, but
someone is interested in them, I can make a package with the current C
module.

For further reference, I have attached the docstrings for the
procedures as they are currently implemented.

Regards,
  'martin

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

SCM_DEFINE (scm_crypt, "crypt", 2, 0, 0, 
            (SCM key, SCM salt),
            "Encrypt @var{key} using @var{salt} as the salt value to the\n"
            "crypt(3) library call\n")
SCM_DEFINE (scm_chroot, "chroot", 1, 0, 0, 
            (SCM path),
            "Change the root directory to that specified in @var{path}.\n"
            "This directory will be used for path names beginning with\n"
            "@file{/}.  The root directory is inherited by all children\n"
            "of the current process.  Only the superuser may change the\n"
            "root directory.")
SCM_DEFINE (scm_getlogin, "getlogin", 0, 0, 0, 
            (void),
            "Return a string containing the name of the user logged in on\n"
            "the controlling terminal of the process, or @code{#f} if this\n"
            "information cannot be obtained.")
SCM_DEFINE (scm_cuserid, "cuserid", 0, 0, 0, 
            (void),
            "Return a string containing a user name associated with the\n"
            "effective user id of the process.  Return @code{#f} if this\n"
            "information cannot be obtained.")
SCM_DEFINE (scm_getpriority, "getpriority", 2, 0, 0, 
            (SCM which, SCM who),
            "Return the scheduling priority of the process, process group\n"
            "or user, as indicated by @var{which} and @var{who}. @var{which}\n"
            "is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}\n"
            "or @code{PRIO_USER}, and @var{who} is interpreted relative to\n"
            "@var{which} (a process identifier for @code{PRIO_PROCESS},\n"
            "process group identifier for @code{PRIO_PGRP}, and a user\n"
            "identifier for @code{PRIO_USER}.  A zero value of @var{who}\n"
            "denotes the current process, process group, or user.  Return\n"
            "the highest priority (lowest numerical value) of any of the\n"
            "specified processes.")
SCM_DEFINE (scm_setpriority, "setpriority", 3, 0, 0, 
            (SCM which, SCM who, SCM prio),
            "Set the scheduling priority of the process, process group\n"
            "or user, as indicated by @var{which} and @var{who}. @var{which}\n"
            "is one of the variables @code{PRIO_PROCESS}, @code{PRIO_PGRP}\n"
            "or @code{PRIO_USER}, and @var{who} is interpreted relative to\n"
            "@var{which} (a process identifier for @code{PRIO_PROCESS},\n"
            "process group identifier for @code{PRIO_PGRP}, and a user\n"
            "identifier for @code{PRIO_USER}.  A zero value of @var{who}\n"
            "denotes the current process, process group, or user.\n"
            "@var{prio} is a value in the range -20 and 20, the default\n"
            "priority is 0; lower priorities cause more favorable\n"
            "scheduling.  Sets the priority of all of the specified\n"
            "processes.  Only the super-user may lower priorities.\n"
            "The return value is not specified.")
SCM_DEFINE (scm_getpass, "getpass", 1, 0, 0, 
            (SCM prompt),
            "Display @var{prompt} to the standard error output and read\n"
            "a password from @file{/dev/tty}.  If this file is not\n"
            "accessible, it reads from standard input.  The password may be\n"
            "up to 127 characters in length.  Additional characters and the\n"
            "terminating newline character are discarded.  While reading\n"
            "the password, echoing and the generation of signals by special\n"
            "characters is disabled.")
SCM_DEFINE (scm_flock, "flock", 2, 0, 0, 
            (SCM file, SCM operation),
            "Apply or remove an advisory lock on an open file.\n"
            "@var{operation} specifies the action to be done:\n"
            "@table @code\n"
            "@item LOCK_SH\n"
            "Shared lock.  More than one process may hold a shared lock\n"
            "for a given file at a given time.\n"
            "@item LOCK_EX\n"
            "Exclusive lock.  Only one process may hold an exclusive lock\n"
            "for a given file at a given time.\n"
            "@item LOCK_UN\n"
            "Unlock the file.\n"
            "@item LOCK_NB\n"
            "Don't block when locking.  May be specified by bitwise OR'ing\n"
            "it to one of the other operations.  The return value is not\n"
            "specified. @var{file} may be an open file descriptor or an\n"
            "open file descriptior port.")
SCM_DEFINE (scm_fnmatch, "fnmatch", 2, 1, 0, 
            (SCM pattern, SCM string, SCM flags),
            "Check whether @var{string} matches @var{pattern}, which is a\n"
            "shell wildcard pattern.  The @var{flags} argument modifies the\n"
            "behaviour, it is the bitwise OR of zero or more of the\n"
            "following flags:\n"
            "@table @code\n"
            "@item FNM_NOESCAPE\n"
            "Tread backslash as an ordinary character, instead of an escape\n"
            "character.\n"
            "@item FNM_PATHNAME\n"
            "Match a slash in @var{string} only with a slash in\n"
            "@var{pattern}, and not with any pattern matching slashes.\n"
            "@item FNM_PERIOD\n"
            "A leading period in @var{string} has to be matched exactly\n"
            "by a period in pattern.\n"
            "@item FNM_FILE_NAME\n"
            "A GNU synonym for @code{FNM_PATHNAME}.\n"
            "@item FNM_LEADING_DIR\n"
            "(GNU extension) The @var{pattern} is considered to be matched\n"
            "if it matches an initiali segment of @var{string} which is\n"
            "followed by a slash.\n"
            "@item FNM_CASEFOLD\n"
            "(GNU extension)  @var{pattern is matched case-insensitively.\n"
            "@end table\n"
            "@var{flags} defaults to zero.\n"
            "Return @code{#t} if the pattern matches, @code{#f} otherwise.")
SCM_DEFINE (scm_glob, "glob", 1, 1, 0, 
            (SCM pattern, SCM flags),
            "Search for all the pathnames matching @var{pattern} according\n"
            "to the rules used by the shell.  No tilde expansion or\n"
            "parameter substitution is done.  The paramter @var{flas} is\n"
            "made up of bitwise OR of zero or mre of the following\n"
            "variables:\n"
            "@table @code\n"
            "@item GLOB_MARK\n"
            "Append a slash to each path which corresponds to a directory.\n"
            "@item GLOB_NOSORT\n"
            "Do not sort the pathnames.\n"
            "@item GLOB_NOESCAPE\n"
            "Meta characters cannot be quoted by backslashes.\n"
            "@item GLOB_PERIOD\n"
            "(GNU extension) A leading period can be matched by meta\n"
            "characters.\n"
            "@item GLOB_BRACE\n"
            "(GNU extension) csh style brace expressions @{a,address@hidden 
are\n"
            "expanded.\n"
            "@item GLOB_TILDE\n"
            "(GNU extension) Tilde expansion is carried out.\n"
            "@item GLOB_ONLYDIR\n"
            "(GNU extension) Only directories are matched.\n"
            "@end table\n"
            "@var{flags} defaults to 0.  Returned is a list of the matched\n"
            "pathnames, or @code{#f} if an error occurred.")
SCM_DEFINE (scm_sethostname, "sethostname", 1, 0, 0, 
            (SCM name),
            "Set the host name of the current processor to @var{name}. May\n"
            "only be used by the superuser.  The return value is not\n"
            "specified.")
SCM_DEFINE (scm_gethostname, "gethostname", 0, 0, 0, 
            (void),
            "Return the host name of the current processor.")
/* FIXME::martin: sethostid does not work on my linux box, it signals
   a `nos uch file or directory error'.  */
SCM_DEFINE (scm_sethostid, "sethostid", 1, 0, 0, 
            (SCM id),
            "Set a unique 32-bit identifier for the current machine.\n"
            "The 32-bit identifier is intended to be unique among all\n"
            "UNIX systems in existence.  The return value is not specified.")
SCM_DEFINE (scm_gethostid, "gethostid", 0, 0, 0, 
            (void),
            "Return the  unique 32-bit identifier for the current machine.\n"
            "The 32-bit identifier is intended to be unique among all\n"
            "UNIX systems in existence.")

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



reply via email to

[Prev in Thread] Current Thread [Next in Thread]