HP-UX Reference (11i v2 07/12) - 3 Library Functions N-Z (vol 7)

n
nis_tables(3N) nis_tables(3N)
NAME
nis_tables: nis_list(), nis_add_entry(), nis_remove_entry(), nis_modify_entry(), nis_first_entry(),
nis_next_entry() - NIS+ table functions
SYNOPSIS
cc [ flag ... ] file...
-lnsl [ library. . . ]
#include <rpcsvc/nis.h>
nis_result *nis_list(const nis_name
name,
const u_long
flags,
int (*callback)(const nis_name
table_name,
const nis_object *
object,
const void *
userdata),
const void *
userdata));
nis_result *nis_add_entry(const nis_name
table_name,
const nis_object *
object,
const u_long
flags);
nis_result *nis_remove_entry(const nis_name
name,
const nis_object *
object,
const u_long
flags);
nis_result *nis_modify_entry(const nis_name
name,
const nis_object *
object,
const u_long
flags);
nis_result *nis_first_entry(const nis_name
table_name);
nis_result *nis_next_entry(const nis_name
table_name,
const netobj *
cookie);
void nis_freeresult(nis_result *
result);
DESCRIPTION
These functions are used to search and modify NIS+ tables. nis_list() is used to search a table in the
NIS+ namespace. nis_first_entry()
and nis_next_entry() are used to enumerate a table one
entry at a time.
nis_add_entry()
, nis_remove_entry(), and nis_modify_entry()
are
used to change the information stored in a table.
nis_freeresult()
is used to free the memory asso-
ciated with the
nis_result structure.
Entries within a table are named by NIS+ indexed names. An indexed name is a compound name that is
composed of a search criteria and a simple NIS+ name that identifies a table object. A search criteria is a
series of column names and their associated values enclosed in bracket []’ characters. Indexed names have
the following form:
[ colname=value, ... ],tablename
The list function, nis_list() , takes an indexed name as the value for the name parameter. Here, the
tablename should be a fully qualified NIS+ name unless the
EXPAND_NAME flag (described below) is set.
The second parameter, flags, defines how the function will respond to various conditions. The value for this
parameter is created by logically
ORing together one or more flags from the following list.
FOLLOW_LINKS
If the table specified in name resolves to be a LINK type object (see nis_objects(3N)), this
flag specifies that the client library follow that link and do the search at that object. If this
flag is not set and the name resolves to a link, the error NIS_NOTSEARCHABLE will be
returned.
FOLLOW_PATH
This flag specifies that if the entry is not found within this table, the list operation should
follow the path specified in the table object. When used in conjunction with the
ALL_RESULTS flag below, it specifies that the path should be followed regardless of the
result of the search. When used in conjunction with the FOLLOW_LINKS flag above,
named tables in the path that resolve to links will be followed until the table they point to
is located. If a table in the path is not reachable because no server that serves it is avail-
able, the result of the operation will be either a soft success or a soft failure to indicate that
not all tables in the path could be searched. If a name in the path names is either an
HP-UX 11i Version 2: December 2007 Update 1 Hewlett-Packard Company 101