summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-01 22:27:09 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-01 22:27:09 -0700
commit88698e57f6a41adefd0a75bf8674c2ee065d1acd (patch)
tree149eeb1ff3663a851491cc6e146db128a7a6af88 /txr.1
parentd1805abb3e8fe34728de9de637247eb2f8917cd2 (diff)
downloadtxr-88698e57f6a41adefd0a75bf8674c2ee065d1acd.tar.gz
txr-88698e57f6a41adefd0a75bf8674c2ee065d1acd.tar.bz2
txr-88698e57f6a41adefd0a75bf8674c2ee065d1acd.zip
Unix password database access.
* configure: Detect getpwuid, getpwuid_r and others. * sysif.c (passwd_s, name_s, gecos_s, dir_s, shell_s): New symbol variables. (setpwent_wrap, endpwent_wrap, fill_passwd, make_pwstruct, getpwent_wrap, getpwuid_wrap, getpwnam_wrap): New static functions. (sysif_init): Initialize new symbol variables. Create passwd structure type. Register setpwent, endpwent, getpwent, getpwuid and getpwnam intrinsics. * txr.1: Documented passwd structure and functions.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.179
1 files changed, 79 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index f4e6171a..6e90c97d 100644
--- a/txr.1
+++ b/txr.1
@@ -31034,6 +31034,85 @@ On success, they return
On failure, they throw an exception of type
.codn system-error .
+.SS* Unix Password Database
+
+.coNP Structure * passwd
+.synb
+.mets (defstruct passwd nil
+.mets \ \ name passwd uid gid
+.mets \ \ gecos dir shell)
+.syne
+.desc
+The
+.code passwd
+structure corresponds to the C type
+.codn struct passwd .
+Objects of this struct are produced by the password database
+query functions
+.codn getpwent ,
+.codn getpwuid ,
+and
+.codn getpwnam .
+
+.coNP Functions @, getpwent @ setpwent and @ endpwent
+.synb
+.mets (getpwent)
+.mets (setpwent)
+.mets (endpwent)
+.syne
+.desc
+The first time
+.code getpwent
+function is called, it returns the first password database entry.
+On subsequent calls it returns successive entries.
+Entries are returned as instances of the
+.code passwd
+structure. If the function cannot retrieve an entry for any reason,
+it returns
+.codn nil .
+
+The
+.code setpwent
+function rewinds the database scan.
+
+The
+.code endpwent
+function releases the resources associated with the scan.
+
+.coNP Function @ getpwuid
+.synb
+.mets (getpwuid << uid )
+.syne
+.desc
+The
+.code getpwuid
+searches the password database for an entry whose user ID field
+is equal to the numeric
+.metn uid .
+If the search is successful, then a
+.code passwd
+structure representing the database entry is returned.
+If the search fails,
+.code nil
+is returned.
+
+.coNP Function @ getpwnam
+.synb
+.mets (getpwnam << name )
+.syne
+.desc
+The
+.code getpwuid
+searches the password database for an entry whose user name
+is equal to
+.metn name .
+If the search is successful, then a
+.code passwd
+structure representing the database entry is returned.
+If the search fails,
+.code nil
+is returned.
+
.SS* Unix Signal Handling
On platforms where certain advanced features of POSIX signal handling are