'\"macro stdmacro
.if n .pH g3n.ypupdate @(#)ypupdate	40.3 of 1/29/90
.\" Copyright 1989 AT&T
.\" @(#)ypupdate.3n 1.7 89/09/28 SMI;
.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
.nr X
.if \nX=0 .ds x} ypupdate 3N "" "\&"
.if \nX=1 .ds x} ypupdate 3N ""
.if \nX=2 .ds x} ypupdate 3N "" "\&"
.if \nX=3 .ds x} ypupdate "" "" "\&"
.TH \*(x}
.SH NAME
\f4yp_update\fP \- changes yp information
.SH SYNOPSIS
.nf
\f4#include <rpcsvc/ypclnt.h>\fR
.P
.ft 4
yp_update(domain, map, ypop, key, keylen, data, datalen)
char *domain;
char *map;
unsigned ypop
char *key;
int keylen;
char *data;
int datalen;
.fi
.SH DESCRIPTION
.P
\f4yp_update(\|)\fR
is used to make changes to the
\s-1YP\s0
database.
The syntax is the same as that of
\f4yp_match(\|)\fR
except for the extra parameter
\f2ypop\fR
which may take on one of four values.
If it is
\f4\s0YPOP_CHANGE\s0\fR
then the data associated with the key will
be changed to the new value.
If the key is not found in the database, then
\f4yp_update(\|)\fR
will return
\f4\s-1YPERR_KEY\s0\fR.
If
\f2ypop\fR
has the value
\f4\s0YPOP_INSERT\s0\fR
then the key-value pair will be inserted
into the database.
The error
\f4\s0YPERR_KEY\s0\fR
is returned if the key already exists in the database.
To store an item into the database without
concern for whether it exists already or not, pass
\f2ypop\fR
as
\f4\s0YPOP_STORE\s0\fR
and no error will be returned if the key
already or does not exist.
To delete an entry, the value of
\f2ypop\fR
should be
\f4\s-1YPOP_DELETE\s0\fR.
.P
This routine depends upon secure
\s-1RPC\s0,
and will not work unless the network is running secure
\s-1RPC\s0.
.SH "SEE ALSO"
\f4secure_rpc\fR(3N)
