Distributed Name Service (DNS) Management Programming Manual
DNS Programming Example, C
H–24 46958 Tandem Computers Incorporated
/*----------------------------------------------------------*/
/* Name manager detected error; abort the transaction and */
/* return */
/*----------------------------------------------------------*/
ABORTTRANSACTION();
return dns_return(dns_err, retcode);
}
/*-----------------------------------*/
/* Try to commit the TMF transaction */
/*-----------------------------------*/
if (status = ENDTRANSACTION())
return dns_return(tmf_err, status);
/*------------------------------*/
/* Return indication of success */
/*------------------------------*/
return dns_return(no_err, 0);
}
/*===================================================================*/
/* This program demonstrates use of the sample DNS functions above. */
/* */
/* The program optionally accepts the name of the name manager as */
/* a startup parameter. If this name is omitted, $ZDNS is assumed. */
/* */
/* The program: */
/* */
/* a) Opens the name manager. */
/* b) Calls DNS_LOOKUP to locate an object or ssmanager called */
/* SOMETHING. SOMETHING may be the name of an SSOBJECT or it */
/* may be an alias. If SOMETHING is ambiguous, a warning is */
/* issued. */
/* c) Adds an untyped alias "TEST_ALIAS" which refers to SOMETHING. */
/* d) Alters the domain of TEST_ALIAS to local. */
/* e) Deletes TEST_ALIAS. */
/*===================================================================*/
int main(int argc, char *argv[])
{
int file_desc;
unsigned int version;
error_return_def result;
char *dns_manager_name;
zdns_ddl_info_name_br_def name_br;
int ambiguous = false;
if (argc > 1)