'\"macro stdmacro
.if n .pH g3x.putspent @(#)putspent	40.10 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} putspent 3C "" "\&"
.if \nX=1 .ds x} putspent 3C ""
.if \nX=2 .ds x} putspent 3C "" "\&"
.if \nX=3 .ds x} putspent "" "" "\&"
.TH \*(x}
.SH NAME
\f4putspent\f1 \- write shadow password file entry
.SH SYNOPSIS
\f4#include <shadow.h>\f1
.PP
\f4int putspent (const struct spwd \(**p, FILE \(**fp);\f1
.SH DESCRIPTION
The 
\f4putspent\fP
routine is the inverse of
\f4getspent\fP.
Given a pointer to a
\f4spwd\fP
structure created by the
\f4getspent\fP
routine (or the\^
\f4getspnam\fP
routine), the\^
\f4putspent\fP
routine writes a line on the stream
.IR fp ,
which matches the format of
\f4/etc/shadow\f1.
.P
If the \f4sp_min\f1, \f4sp_max\f1, \f4sp_lstchg\f1,
\f4sp_warn\f1, \f4sp_inact\f1, or \f4sp_expire\f1
field of the 
\f4spwd\fP
structure is \-1, or if \f4sp_flag\f1 is 0,
the corresponding 
\f4/etc/shadow\^\f1
field is cleared.
.SH "SEE ALSO"
\f4getspent\fP(3C),
\f4getpwent\fP(3C),
\f4putpwent\fP(3C).
.SH DIAGNOSTICS
The 
\f4putspent\fP
routine returns non-zero if an error was detected during its operation,
otherwise zero.
.SH NOTES
This routine is for internal use only, compatibility is not guaranteed.
.\"	@(#)putspent.3x	6.3 of 7/20/87
.Ee
