[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re:Find AShare & machine name
- To: INFO-MCL@cambridge.apple.com
- Subject: Re:Find AShare & machine name
- From: CAMPER@AppleLink.Apple.COM (Camper, Dan)
- Date: 16 Feb 95 12:22 GMT
- Sender: owner-info-mcl@digitool.com
Chuck,
You can obtain the Mac's name with a call to #'machine-instance, a function
that's documented somewhere in the Lisp language. MCL will get the name right,
whether running under System 7 or System 6.
Here is some code that returns your current zone:
(defun get-my-zone-name ()
(let ((zone-name "")
(result nil))
(%stack-block ((zone-buffer 33))
(rlet ((xpb :XPPParamBlock
:ioCompletion (%null-ptr)
:ioResult 0
:ioRefNum #$xppRefNum
:xppRetry 3
:xppTimeOut 4
:csCode #$xCall
:xppSubCode #$zipGetMyZone
:zipBuffPtr zone-buffer))
(%put-byte zone-buffer 0)
(rarset xpb 0 :XPPParamBlock.zipInfoField 0)
(rarset xpb 0 :XPPParamBlock.zipInfoField 1)
(#_GetMyZone xpb #$false)
(loop while (= (pref xpb :XPPParamBlock.ioResult) 1))
(setf result (pref xpb :XPPParamBlock.ioResult))
(cond ((= result #$noErr)
(setf zone-name (%get-string zone-buffer)))
((= result #$noBridgeErr)
(setf zone-name "*"))
(t
(setf zone-name "Uknown Zone")))))
zone-name))
Cheers,
Dan
------------------------------------------------------------------------------
In MCL 2.0.1, System 7.1:
Is there a built-in function or trap call that returns the AppleShare
zone name and machine name for the machine on which you're running
MCL? (Yes, I'm a Mac novice. "RTFM" is an acceptable answer,
provided you tell me which FM.)
-- Chuck Fry Chucko@ptolemy.arc.nasa.gov