CommandTool.mx
Copyright Ó 1989, 1991 by Xerox Corporation. All rights reserved.
Created by Michael Plass, April 11, 1989 3:29:11 pm PDT
Michael Plass, January 30, 1992 2:34 pm PST
Last changed by Pavel on April 2, 1990 3:18 pm PDT
Documentation
A completely bogus name, this has nothing to do with the CommandTool anymore. Just a few odds and ends ...
Common types
(cedar-directory "Rope")
(define-ref-type "Scheme" "Symbol")
ROPE: TYPE ~ Rope.ROPE;
CedarProcess
(cedar-imports "CedarProcess")
(define-enum-type "CedarProcess" "Priority" (background normal foreground excited real-time))
(define-proc (
set-priority priority)
"sets priority (background normal foreground excited real-time), returns old priority level"
result ← SymbolForPriority[CedarProcess.GetPriority[]];
CedarProcess.SetPriority[ThePriority[priority]];
)
ThisMachine
(cedar-imports "ThisMachine" "ProcessorFace")
(define-proc (
This-Machine-Name (namespace))
"Returns a string; namespace is 'arpa, 'xns, 'pup, ..."
result ← StringFromRope[ThisMachine.Name[SELECT namespace FROM $arpa => $Arpa, $xns => $XNS, $pup => $Pup, undefined => NIL, ENDCASE => TheSymbol[namespace]]];
)
(define-proc (
This-Machine-Address (namespace))
"Returns a string; namespace is 'arpa, 'xns, 'pup, ..."
result ← StringFromRope[ThisMachine.Address[SELECT namespace FROM $arpa => $Arpa, $xns => $XNS, $pup => $Pup, undefined => NIL, ENDCASE => TheSymbol[namespace]]];
)
(define-proc (
This-Machine-ID)
"Returns a string like \"1-435-140-188\""
result ← StringFromRope[ThisMachine.ProcessorID[$Decimal]];
)
(define-proc (
This-Machine-Type)
"Returns 'sun3, 'sun4, ..."
result ¬ ProcessorFace.GetProcessorTypeName[ProcessorFace.GetProcessorType[]];
)
SafeStorage
(cedar-imports "SafeStorage")
(define-proc (bytes-allocated)
"number of words allocated since the beginning"
RETURN [MakeFixnum[SafeStorage.CurrentByteCount[]]];
)
(define-proc (
gc (trace-and-sweep?))
"call the garbage collector"
SafeStorage.ReclaimCollectibleObjects[suspendMe: TRUE, traceAndSweep: traceAndSweepP=true];
)