Distributed Name Service (DNS) Management Programming Manual

DNS Programming Example, TACL
F–18 46958 Tandem Computers Incorporated
==
== Inner loop of dns^lookup: looks for another data list in response.
== If there is one, invoke dns^lookup^4 to examine it.
==
== Look for next data list.
==
#SET l^status [dns^ssget l^response^buf zspi^tkn^datalist]
[#CASE [l^status]
|0| {Found Datalist} dns^lookup^4
|-8| {zspi^err^mistkn} #SET l^done^1 0
#SET l^status [dns^ssget
l^response^buf
zspi^tkn^context]
[#IF NOT l^status |THEN|
#SET l^continued -1
|ELSE|
[#IF (l^status = zspi^err^mistkn) |THEN|
#SET l^done -1
|ELSE|
dns^spierr SSGET l^status
]
]
|OTHERWISE| dns^spierr SSGET l^status
]
?SECTION dns^lookup^4 MACRO
==
== Get ZSPI^TKN^RETCODE.
==
#SET l^status [dns^ssget l^response^buf zspi^tkn^retcode l^retcode]
dns^check^status SSGET
[#CASE [l^retcode]
==
== Good response; get INFO NAME basic response.
==
|0| dns^ssgetv l^response^buf zdns^map^info^name^br l^candidate
==
== Is this name's type one of the ones we're looking for?
==
[#IF [dns^lookup^type l^candidate:zdnstype [l^types]] |THEN|
==
== Yes; record the fact that we found a name.
==