cfgcadsz
Purpose
Adds or replaces a stanza in an attribute file.
Library
Run-time Services Library (librts.a)
Syntax
#include <cfg04.h>
int cfgcadsz (atfile, stanza, stname,after)
CFG__SFT *atfile;
char *stanza;
char *stname;
char *after;
Description
The cfgcadsz subroutine adds a new stanza or replaces an
existing stanza in an attribute file. (For details about
attribute files, see "attributes.")
The atfile parameter points to an open attribute file
structure. The stanza parameter points to the buffer
that contains the stanza to be written. The stname
parameter points to the name of the stanza to be added to
the file.
The after parameter points to the name of the stanza
after which the new stanza is to be inserted. If this
parameter is NULL, then the stanza is added to the end of
the file.
All information that is repeated in the default stanza of
the attribute file is removed from the new stanza before
it is written to the file.
The calling program must have an effective user ID of
superuser to access system customization files such as
/etc/master, /etc/system, and /etc/predefined.
Return Value
Upon successful completion, the value CFG_SUCC is
returned. If the cfgcadsz subroutine fails, then the
following value is returned:
CFG_ECLS An error occurred while closing a file.
CFG_EOPN An error occurred while opening a file.
CFG_SPCE Memory allocation failed because of insuffi-
cient space.
CFG_UNIO An unrecoverable I/O error occurred during
processing.
Related Information
In this book: "cfgadev," "cfgamni," "cfgcclsf,"
"cfgcdlsz," "cfgcopsf," "cfgcrdsz," and "attributes."