From:	CSBVAX::MRGATE!@KL.SRI.Com,@wiscvm.wisc.edu:JOE@FHCRCVAX.BITNET@SMTP 22-AUG-1987 04:59
To:	EVERHART
Subj:	routine to convert UIC string to longword value

Received: from wiscvm.wisc.edu by KL.SRI.COM with TCP; Sat 22 Aug 87 00:37:36-PDT
Received: from FHCRCVAX.BITNET by wiscvm.wisc.edu ; Sat, 22 Aug 87 02:38:09 CDT
Date: Sat, 22 Aug 87 00:38 PDT
From: Joe Meadows <JOE%FHCRCVAX.BITNET@wiscvm.wisc.edu>
Subject: routine to convert UIC string to longword value
To: info-vax@kl.sri.COM
X-VMS-To: INFO-VAX

        I recently needed to parse a UIC and convert it from a string
to a numeric value.. Being lazy I looked all over but couldn't find
a routine to do it for me, so I checked how it was done in the
SET command, and came up with this routine (translated from Bliss).
The calling sequence should be:
  status = parse_uic(uic-text,uic-value)

  where uic-text is a string passed by descriptor, and uic-value is the
  address of a longword to receive the UIC value.

        Hope this saves someone a little effort..

  Cheers,
  Joe Meadows Jr.
  Fred Hutchinson Cancer Research Center
     bitnet - JOE@FHCRCVAX
     arpa   - JOE%FHCRCVAX.BITNET@WISCVM.WISC.EDU
     voice  - (206) 467-4970

;---------------------------------------------
        .title  parse_uic
;---------------------------------------------
$tpadef

tparse_init:
        .long   tpa$k_count0
        .long   tpa$m_blanks!tpa$m_abbrev
tparse: .blkb   tpa$k_length0

        $init_state     uic_stb,uic_ktb
        $state
        $tran   tpa$_ident,,,,uic
        $state
        $tran   tpa$_eos,tpa$_exit
        $end_state

uic:    .long

        .entry  parse_uic,^m<r2,r3,r4,r5>

        ; initialize tparse block
        movc5   #8,tparse_init,#0,#tpa$k_length0,tparse

        ; set the tparse block string info
        movl    4(ap),r0
        movzwl  (r0),tparse+tpa$l_stringcnt
        movl    4(r0),tparse+tpa$l_stringptr

        ; call lib$tparse
        pushab  uic_ktb
        pushab  uic_stb
        pushab  tparse
        calls   #3,g^lib$tparse

        movl    uic,@8(ap)
        ret

        .end
