Distributed Name Service (DNS) Management Programming Manual
DNS Programming Example, TACL
F–14 46958 Tandem Computers Incorporated
dns^endtransaction
#UNFRAME
?SECTION dns^lookup^type ROUTINE
==
== Utility routine for dns^lookup:
==
== dns^lookup^type <lookup^type> <type-1> <type-2> ... <type-n>
==
== Expands to -1 if <lookup^type> = <type-i> for any i {1:n};
== expands to 0 otherwise.
==
#FRAME
#PUSH l^arg
#PUSH l^num
==
== Get <lookup-type>.
==
SINK [#ARGUMENT /VALUE l^arg/ NUMBER]
==
== Examine each <type-i> and return -1 if it matches <lookup-type>.
==
[#LOOP |DO|
[#CASE [#ARGUMENT/VALUE l^num/ NUMBER END]
|1| [#IF (l^num = l^arg) |THEN|
#RESULT -1
#UNFRAME
#RETURN]
|2| #RESULT 0
#UNFRAME
#RETURN
]
|UNTIL| 0
]
?SECTION dns^lookup ROUTINE
==
== Look up a name in the DNS database:
==
== dns^lookup <name> [ <defnode> ] [ <type-list> ]
==
== where:
==
== <name> name to look up.
== <defnode> definition node of name; if omitted, any definition node.