Distributed Name Service (DNS) Management Programming Manual

DNS Programming Example, TAL
46958 Tandem Computers Incorporated G–7
!
! Something wrong with the response buffer; close the name
! manager and return SPI error.
!
CALL close(fno);
RETURN dns^spierr(status);
END;
!
! Check RETCODE.
!
IF retcode THEN
BEGIN
!
! Non-zero retcode; close the name manager and return DNS error.
!
CALL close(fno);
RETURN dns^dnserr(retcode);
END;
!
! Get the name manager's version.
!
IF (status := ssgettkn(resp^buf, zspi^tkn^server^version, version))
THEN BEGIN
!
! Something wrong with the response buffer; close the name
! manager and return SPI error.
!
CALL close(fno);
RETURN dns^spierr(status);
END;
!
! Open successful.
!
RETURN dns^noerr;
END;
?PAGE "LOOKUP AN ALIAS"
!
! Looks up an alias; can be used to look up <alias> or
! <alias> on <system>.
!
INT(32) PROC dns^lookup^alias(fno
, name
, defnode
, basic^response
, detailed^response
, ambiguous);