[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Communications Technical Reference, Volume 1

yp_match Subroutine

Purpose

Searches for the value associated with a key.

Library

C Library (libc.a)

Syntax

#include <rpcsvc/ypclnt.h>
#include <rpcsvc/yp_prot.h>
yp_match (indomain, inmap, inkey, inkeylen, outval, outvallen)
char *indomain;
char *inmap;
char *inkey;
int inkeylen;
char **outval;
int *outvallen;

Description

The yp_match subroutine searches for the value associated with a key. The input character string entered as the key must match a key in the Network Information Services (NIS) map exactly because pattern matching is not available in NIS.

Parameters

indomain Points to the name of the domain used as input to the subroutine.
inmap Points to the name of the map used as input to the subroutine.
inkey Points to the name of the key used as input to the subroutine.
inkeylen Specifies the length, in bytes, of the key.
outval Specifies the address of the uninitialized string pointer where the values associated with the key are returned. Memory is allocated by the NIS client using the malloc subroutine, and may be freed by the application.
outvallen Returns the length, in bytes, of the outval parameter.

Return Values

Upon successful completion, this subroutine returns a value of 0. If unsuccessful, it returns one of the error codes described in the rpcsvc/yp_prot.h file.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The malloc subroutine.

Network Information Service (NIS) Overview for System Management in AIX Version 4.3 System Management Guide: Communications and Networks.

List of NIS Programming References and Remote Procedure Call (RPC) Overview for Programming in AIX Version 4.3 Communications Programming Concepts.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]