PCE version 4C man_modulenamespaceid_tablemodified current_idOIxNtopicsN referenceC hash_tablerefersizeOIxaIysICman_topic_card identifiermodule last_modifiednamesummary descriptionsee_alsoinheritsupersubsOIxIRICdateOIx(NOtN predicatesCstringOIx Prolog predicates to support PCEnnnCchainsizeOIxIXOIxIXsIOIxIRIOI x(NOtNnew/2OI xCreate a PCE objectnnnOI xIXnsIOI xIRIOI x(NOtNProlog InterfaceOIxInterface to @prolognnnOIxIENrootXOIxI eIqeIeIVeIeIEeIDEIWeIeIXsIOIxIRIOIx(NOtN PredicatesOIxInterfacing PredicatesnnnOIxIEIXOIxIeIEIXsIOIxIRIOIx(NOtN PrincipalOIxBasic interfacing predicatesnOIxIeN $predicates$6eN $predicates$5eN $predicates$4EN $predicates$3eN $predicates$2eN $predicates$1XnOIxIEIXOIxIeIeIeI eI EI eIHXsIOIxIRIOIx(NOtN UtilitiesOIx.Predicates defined in the principal predicatesnOIxIeN $predicates$9eN $predicates$8eN $predicates$7XnOI xIEIXOI!xIeI EIGeIFeI XsIOI"xIRIOI#x,}>NCalling PrologOI$xObject to represent PrologOI%xPCE can invoke Prolog predicates via the predefined object @prolog by sending a message there. When a message is sent to @prolog, the selector of the message will be used as predicate name and the arguments will be transformed in `reference' mode (see `T Object -> Term') to Prolog terms and then passed as arguments to the predicate. Normally, the message to Prolog will be activated through a message object associated with a UI object (similar to call-back in many C-based window packages). Examples: 1 ?- new(B, button(ok, message(@prolog, do_xyz))). 2 ?- new(T, text_item(file, '', message(@prolog, consult, @arg1))). The first example invokes the predicate do_xyz/0 when the user presses the button. The second invokes consult/1 when the user hits RETURN with the typed value as argument. The examples above illustrate how PCE can invoke predicates in Prolog. Sending the PCE message succeeds or fails, depending on success or failure of the Prolog predicate invoked. PCE may also obtain information from Prolog by invoking a get method on @prolog. The return value is passed through the last argument. Normally, Prolog is called like this through an obtainer used to implement a get-method of a Prolog-defined class. Example: area2(Gr, Area) :- get(Gr, width, W), get(Gr, height, H), Area is W * H. ?(@prolog, area2, Gr) In this example the obtainer evaluates to the area of the graphical.OI&xIeIEeN $objects$2EIUXnOI'xIEIXnsIOI(xIRIOI)x(NOtNWarningsOI*x)Warnings that may come from the interfacennnOI+xIEIXnsIOI,xIRIOI-x(NOtN ExceptionsOI.xTrapping interface exceptionsnOI/xIeN$predicates$11EN$predicates$10XnOI0xIEIXOI1xIeIEIXsIOI2xIRIOI3x(NOtNProgramming StyleOI4xNotes on programming stylennnOI5xIENrootXOI6xIeIeIfeI#EIeI"eI!eI XsIOI7xIRIOI8x(NOtNGlobal referencesOI9xNamed global object referencesnOI:xIEN'$class/object$M.object.S.name_referenceXnOI;xIEIXnsIOIxPredefined global objectsnnnOI?xIENrootXOI@xIeIEIUeIeIeIXsIOIAxIRIOIBx,}>"N Fill PatternsOICxBitmaps used to fill graphicalsOIDx1PCE predefines a number of bitmaps that may be used as fill_patterns for graphical objects (see Graphical ->fill_pattern). These bitmaps are of depth one (e.g. they contain only 0's and 1's). Though not protected, it is not allowed to modify or destroy these bitmaps as they are also used by PCE itself.OIExIeN $objects$6eN $objects$10eN $objects$9eN $objects$8eN $objects$7EN $objects$5XnOIFxIEIXOIGxIeIeIeIeIeIEIXsI OIHxI RIOIIx(NOtN AttributesOIJxUsing attributes to objectsnnnOIKxIEIXnsI!OILxI!RIOIMx(NOtNMethodsOINx&Defining methods to individual objectsnnnOIOxIEIXnsI"OIPxI"RIOIQx(NOtNClassesOIRxUsing PCE user-defined classesnnnOISxIEIXnsI#OITxI#RIOIUx(NOtNNaming conventionsOIVxHow to name you objectsnnnOIWxIEIXnsI$OIXxI$RIOIYx(NOtNClass HierarchyOIZxConceptual hierarchy of classesnnnOI[xIeNrootXOI\xI eIbeI(eI+eI)eI'eI&eI-eI*eI,eI%XsI%OI]xI%RIOI^x(NOtN ProgrammingOI_xClasses for programming PCEnnnOI`xIEI$XOIaxIeI1eI0eI/EI.XsI&OIbxI&RIOIcx(NOtNData RepresentationOIdxClasses to represent datannnOIexIEI$XOIfxIeIeI2EI4eI3XsI'OIgxI'RIOIhx(NOuNWindowsOIixFrames and window classesnnnOIjxIEI$XOIkxIEIXsI(OIlxI(RIOImx(NOuNGraphicsOInxClasses to do graphicsnnnOIoxIEI$XOIpxIeIeIpeIoeI6EIeI5XsI)OIqxI)RIOIrx(NOuNText ManipulationOIsx*Editors and other text manipulation issuesnnnOItxIEI$XOIuxIeI9eI8EI7XsI*OIvxI*RIOIwx(NOuN ArithmeticOIxxClasses to do arithmeticnnnOIyxIEI$XnsI+OIzxI+RIOI{x(NOuNDialogsOI|x(Windows and commanders to create dialogsnnnOI}xIEI$XOI~xIeI:EICeIEI=XsI-OIxI-RIOIx(NOuN ConstraintsOIx Constraints between object pairsnnnOIxIEI$XOIxIeIBEIAXsI.OIxI.RIOIx(NOuNClassesOIxHow to create new classesnnnOIxIEI%XnsI/OIxI/RIOIx(NOuNMethodsOIx%Adding methods to classes and objectsnOIxIeN"$class/object$M.object.G.get_superEN#$class/object$M.object.S.send_superXnOIxIEI%XnsI0OIxI0RIOIx(NOuN VariablesOIx0Adding instance variables to classes and objectsnnnOIxIEI%XOIxIXsI1OIxI1RIOIx(NOuN ResourcesOIxAdding X-resources to classesnnnOIxIeI%XnsI2OIxI2RIOIx(NOuNPrimitive TypesOIx#Primitive data representation typesnnnOIxIEI&XOIxIeITEISXsI3OIxI3RIOIx(NOuN CollectionsOIxCollections of ObjectsnnnOIxIEI&XOIxIEIXsI4OIxI4RIOIx(NOuNTablesOIxMapping/Association tablesnnnOIxIEI&XnsI5OIxI5RIOIx(NOuNGraphics DevicesOIxCollections of GraphicalsnnnOIxIEI(XnsI6OIxI6RIOIx(NOuNPrimitive GraphicsOIxPrimitive graphical objectsnnnOIxIEI(XnsI7OIxI7RIOIx(NOuNEditorsOIxEMACS-look alike editingnnnOIxIEI)XnsI8OIxI8RIOIx(NOuNText Entry FieldsOIxText entry fields for a dialognnnOIxIEI)XnsI9OIxI9RIOIx(NOuNText as GraphicsOIxDisplaying text in picturesnnnOIxIEI)XnsI:OIxI:RIOIx(NOuNDialog windowsOIxWindows to display Dialog ItemsnnnOIxIEI+XnsI;OIxI;RIOIx(NOuNAutomatic layoutOIx Automatic layout of Dialog ItemsnnnOIxIEI+XnsIOIxI>RIOIx(NOuN The displayOIx#Interface to the X-display (screen)nnnOIxIEI,XnsI?OIxI?RIOIx(NOuNThe PCE environmentOIxInterface to PCE's internalsnnnOIxIEI,XnsI@OIxI@RIOIx(NOuNUnixOIxInterface to UnixnnnOIxIeI,XnsIAOIxIARIOIx(NOuNRelating AttributesOIx Constraints to relate attributesnnnOIxIEI-XnsIBOIxIBRIOIx(NOuNLinking GraphicalsOIx"Creating a link between graphicalsnnnOIxIEI-XnsICOIxICRIOIx(NOuN CommandersOIxGraphicals with predefined UInnnOIxIEI+XnsIDOIxIDRIOIx,}>NTerm -> ObjectOIx*Transforming a Prolog term to a PCE objectOIx}Some of the interface predicates create PCE objects from Prolog terms. This creation can be done in two modes: either by implicit transformation if an argument is required (mode `arg') or explicit transformation if an object reference is to be produced (mode `new'). Normally, Prolog primitive data types are transformed into corresponding PCE data types. Complex terms are transformed into instances. For this transformation, the functor determines the classname and the arguments serve as arguments to the ->initialise method of the class. Below is the table of transformations as performed by new/2, send/[2-12] and get/[3-13]. New/2 does the outermost argument in `new' mode. All other arguments are processed in `arg' mode. Mode Prolog Data Pce Object ======================================================= - integer integer - real number Real object new atom Instance of the class (no arguments) arg atom name - Class(...Arguments...) Instance of Class from arguments - new(Data) Transform in `new' mode. - new(?Ref, Data) Transform in `new' mode, unify `Ref'OIxIeIEeIHeIeIeI XnOIxIEIXnsIEOIxIERIOIx,}>#NObject -> TermOIx*Transforming a PCE object to a Prolog termOIxThe principal predicates that request a value from PCE can either request a reference or a Prolog term representing the object. In either case, primitive types (integer and name) are given as their corresponding Prolog primitive types. Get requests its value in `reference' mode. The other predicates request their value in `term' mode. In both cases, when the prolog argument is not a variable nor a term @/1, the PCE value is converted to a Prolog term and unified with the Prolog argument. When a PCE object is transformed into a Prolog term, the functor determines the classname. The arguments normally correspond to the arguments that must be provided to create the object. Actually the number of arguments is determined by `Object <-_arity' and the successive arguments by `Object <-_arg: Nth1'. These behaviours are either provided by the class itself, or by class `object', that uses the class attribute `term_names', which is a vector of selectors to be used to extract the successive arguments.OIxIeIeN$predicates$13eN $tools$11eN$tools$3eN $class/object$M.object.G.functoreN$class/object$M.object.G._arityeN$class/object$M.object.G._argeN$class/class$V.class.term_nameseN!$class/class$V.class.term_functoreIDeIHeIFeI EI XnOIxIEIXnsIIOIxIIRIOIx(NOuN ExceptionsOIxHandling runtime exceptionsnOIxIEN$class/pce$C.pceXnOIxIENrootXnsIJOIxIJRIOIx(NOuNErrorsOIxHandling runtime errorsnOIxIEN$class/pce$C.pceXnOIxIENrootXnsIKOIxIKRIOIx(NOuN DebuggingOIx'Tools for debugging PCE/Prolog programsnOIxIeN$class/pce$C.pceEN $tools$11XnOIxIENrootXOIxIeIeIeIEIRXsILOIxILRIOIx(NOuNManualOIxOnline Manual DocumentationnOIxIEN$tools$1XnOIxIENrootXOIxIeIMeIPEIOeIQeINXsNrootOIxNrootRIOIx(NOuNContentsOI xRoot of the topic indexnnnnOI xIeIeI$eIeIeI_eIgeIseIleIJeIIeIKeILeIeIyeIeI|eI{XsIROI xIRRIOI x(NOuN InspectorOI x%Inspect individual objects at runtimennnOIxIEIKXnsISOIxISRIOIx(NOuNAtomOIxCharacter constantnnnOIxIEI2XnsITOIxITRIOIx,}F NIntegerOIxInteger numbernnnOIxIEI2XnsIVOIxIVRIOIx,}>N DirectivesOIxPCE related directivesOIxThe PCE/Prolog interface defines a number of special directives: pce_global(Ref, Pred|New) % Declare global object pce_autoload(Class, File) % File defines class pce_begin_class(Class, Super) % Start class definition pce_end_class. % End class definitionOIxIeN$predicates$17eN$predicates$14eN$predicates$13EN$predicates$12XnOIxIEIXOIxIXsIWOIxIWRIOIx(xNDefining ClassesOI x Defining PCE classes from PrologOI!xThis section deals with the definition of classes in Prolog. Studying example programs is probably the fastest way to learn about Prolog defined classes. There are two large example programs in the distribution. The first is PceDraw, a drawing tool. It's sources are in the subdirectory `draw' of the PCE/Prolog library. The second example is the online manual tools you are reading now. Its sources are in a subdirectory `man' of the PCE/Prolog library.OI"xIeN$class/class$C.classeN $examples$6eN$predicates$14eN$predicates$13XnOI#xIeIXOI$xI eIXeIYeIZeI[eI\EI]eIreI^eIXsIXOI%xIXRIOI&x(NOuNOverviewOI'x Skeleton of a User-Defined classnnnOI(xIEIWXnsIYOI)xIYRIOI*x(?N VariablesOI+x&Adding instance variables to the classOI,xInstance variables (slots, attributes) are attached to the new class using the variable/[3,4] declaration. The instance variables of a class cannot be changed when there are subclasses or instances of the class. Examples: variable(name, name, both, "Name of the person"). variable(photo, bitmap*, both, "Image of photo"). This example declares two variables. The first is the name, which must always be filled with an atom. The second is an image which may be @nil (if not available) or a bitmap object.OI-xIeI^EN$predicates$18XnOI.xIEIWXnsIZOI/xIZRIOI0x(NOuN ResourcesOI1xAdding resources to the classnnnOI2xIEIWXnsI[OI3xI[RIOI4x,}>#NHandlesOI5xAdding handles for connectionsOI6xGraphical classes only.OI7xIeN$class/class$M.class.S.handleEN$predicates$20XnOI8xIEIWXnsI\OI9xI\RIOI:x(NOuN Send MethodsOI;xDefining send methods in ProlognOIxI]RIOI?x(NOuN Get MethodOI@xdefining get methods in ProlognnnOIAxIEIWXnsI^OIBxI^RIOICx,}FNTypesOIDxSpecifying a typeOIExBoth the declaration of send- and get methods requires type declarations. The type declarations for methods look very similar than those that can be found in this manual. A type either denotes a primitive type or a classname. In the latter case, any instance of a the referred class or a subclass thereof is a value satisfying the typecheck. While declaring a type using a classname, the class itself does not need to exist yet. This facilitate the definition of classes that are mutually dependent and thus want to use each other's name for typechecking. The available primitive types are: bool a boolean (@on or @off). int Integer value name Atomic name (`atom' is a synonym). This basic type declaration can be augmented with some modifiers, indicating what should be done with the various special objects: [Type] Argument may be @default (or, in other words, argument is optional). Type* Argument may be @nil. Type? Special arguments (@receiver, @arg1, ... and obtainers are not evaluated, but passed themselves Both `*' and `?' are declared as postfix operators, which allows you to specify the type without using quotes. EXAMPLES point An instance of class point string* Either a string object or @nil [font] Either a font or @default code? An executable object; pass obtainersOIFxIeIYeN$predicates$18eIteN$predicates$22EN$predicates$21XnOIGxIEIWXnsI_OIHxI_RIOIIx(NOuNProgramming PCEOIJx#Extending objects or classes in PCEnnnOIKxIENrootXOILxIeIaEI`XsI`OIMxI`RIOINx(NOuNClass-level ProgrammingOIOxCreating and extending ClassesnOIPxIeN$class/sheet$C.sheeteN$class/class$C.classeN"$class/object$M.object.G.get_superEN#$class/object$M.object.S.send_superXnOIQxIEI_XnsIaOIRxIaRIOISx(NOuNObject-level ProgrammingOITxExtending individual objectsnOIUxIeN$class/sheet$C.sheetEN$class/object$C.objectXnOIVxIEI_XnsIbOIWxIbRIOIXx(NOuNExecutable ObjectsOIYx"Classes of objects for programmingnnnOIZxIEI$XOI[xIeIxeIeeIdEIcXsIcOI\xIcRIOI]x(NOuN PrimitivesOI^xPrimitive executable objectsnnnOI_xIEIbXnsIdOI`xIdRIOIax(NOuN ConditionsOIbxConditions expressionsnOIcxI eN&$class/primitive_code$C.primitive_codeeN$class/greateq$C.>=eN$class/lesseq$C.=] Specified type or @default * Specified type or @nil ? Specified type, obtainer or @arg1...@arg10 EXAMPLES 'graphical*' Any graphical object or @nil '[point]' Any point object or @default '[name]*' Name, @default or @nil NOTE: Type `object' refers to any valid PCE data-type. This will be changed to: object Any object (i.e. instance of some class) any Any valid PCE data typeOIxIeIveN$class/variable$C.variableeN$class/method$C.methodEI^XnOIxIEIsXnsIuOIxIuRIOIx(S`NCheckingOIxChecking a typenOIxIeN$class/method$V.method.typesEN$class/obtain$C.?XnOIxIEIsXnsIvOIxIvRIOIx,}FN ConversionOIxAutomatic type conversionsOIxMIf the type-checker detects a type-error, the type-converter in activated. Depending on the required type, PCE does the following data conversions: # name Translates string-objects, integers and real numbers. # int Translates number objects, real numbers or text (name, string) who's string represents an integer. # bool Converts 0/1, and the texts `true/false'. # type Converts the normal type specification into an internal type specifier. # class-name Invokes `Object <-convert'. Consult the <-convert method of a class to find out which data-types are converted.OIxIeIteN#$class/class$V.class.convert_methodeN$class/method$V.method.typesEN$class/pce$M.pce.G.convertXnOIxIEIsXnsIwOIxIwRIOIx(S`NWarningsOIxTypc checking errors/warningsnnnOIxIEIsXnsIxOIxIxRIOIx(SgN ParametersOIxForwarding argumentsnOIxIEN$class/code$C.codeXnOIxIEIbXnsIyOIxIyRIOIx(S9N TechniquesOIxVarious programming techniquesnnnOIxIENrootXOIxIEIzXsIzOIxIzRIOIx(SlN EnumerateOIx!Enumerate members of a collectionnOIxIEN$class/while$C.whileXnOIxIEIyXnsI{OIxI{RIOIx(SN X-windowsOIx(Description of X-window interface policynOIxIEN$class/display$C.displayXnOIxIENrootXOIxIeIEIXsI|OIxI|RIOIx(S&NEventsOIx$Creating and dispatching user eventsnOIxIEN$class/event$C.eventXnOIxIENrootXOIxIeIeI~EI}XsI}OIxI}RIOIx(SINHandling EventsOIxCreation and dispatching eventsnOIxIEN$class/recogniser$C.recogniserXnOIxIEI|XOIxIEIXsI~OIxI~RIOIx(SdNEvents vs. MessagesOIx!How do events relate to messages?nnnOIxIEI|XnsIOIxIRIOIx(N The compilerOIxHow the class compiler worksOIx This card provides a brief explanation of the transformations used when defining a class with :- pce_begin_class, ... :- pce_end_class. This is especially useful to understand and debug code written with user-defined classes. TERM EXPANSION AND OPERATORS The expansion is realised by `:- pce_begin_class/[2,3]'. This predicate extends the definition of the Prolog primitive term_expansion/2 using asserta/2 to make sure it is in front of any other expansion. The returned term is a list, containing a directive that should be sent to PCE and a clause that realised the implementing predicate. Pce_begin_class/3 also declares a number of operators, notably :->, :<-, ::, * and ?. CONSTRUCTING THE PROLOG HEAD AND THE SEND_METHOD The head is used to construct a send_method object. The selector of this send method is the functor of the head. The type specification is used to create the type-check vector for the send_method. The implementing method is a message to @prolog. The selector (which equals the predicate name) is `send_Selector_Class' and the arguments are @receiver, @arg1, @arg2, ... (just as many arguments as the method has). EXAMPLE Consider the following code fragment: :- pce_begin_class(label_text(string, name), text). resource(label_font, font, '@helvetica_bold_14', "Font used for labels"). initialise(Text, String:string, Format:[name]) :-> "Initialise from string and format":: send(Text, send_super, initialise(String, Format, ?(Text, resource_value, label_font))). :- pce_end_class. The call to pce_begin_class/2 will create the class and set the <->term_names variable of the class. The resource/4 declaration will attach a resource (e.i. interface to the X-windows default database) to the class) using `Class ->resource'. The `initialise' declaration will attach a method to the class and assert a clause in the Prolog database. The result of the translation will be: send(@label_text_class, send_method, send_method(initialise, vector(string, '[name]'), message(@prolog, send_initialise_label_font, @receiver, @arg1, @arg2))). and the clause send_initialise_label_text(Text, String, Format) :- send(Text, send_super, initialise(String, Format, ?(Text, resource_value, label_font))). The call to pce_end_class/0 deletes the term_expansion/2 clause inserted by pce_begin_class/3 and destroys all operator declarations inserted by this call.OIxIeN$predicates$20eN$predicates$19eN$predicates$18eN$predicates$22eN$predicates$21EN$predicates$13XnOIxIEIWXnsIOIxIRIOIx(Ubelow', `Window ->above', `Window ->left' and `Window ->right'. How the windows are resized when the frame is resized is determined by their stretchabilities and schrinkabilities (`Window <->hor_stretch', `Window <->ver_stretch', `Window <->ver_shrink' and `Window <->hor_shrink'). The layout of windows in a frame is viewed as an `consists_of' hierarchy of rows of windows that are either stacked left-to-right or top-to-bottom. The layout specification starts by building the inner-most stack. Suppose we want to make the following layout: ------------------------- | Dialog | ------------------------- | | Picture | | browser |----------------- | | View | ------------------------- This is realised by the following sequence of messages: new(F, frame('My Frame')), % Create the frame send(F, new(P, picture)), % Start with picture (or view) send(new(view), below, P), % Stack the view send(new(browser, left, P), % Put the browser left send(new(dialog, above, P). % And the dialog on top Thus, if two simple windows are related, a `horizontal' or `vertical' stack is created. Each new window that is related in the same direction to one of the outermost windows enlarges the stack. If a window is related in a different direction to any member of the stack, a new stack is created with the window and the old stack as members.OIxI eN$class/frame$M.frame.S.appendeN$class/window$M.window.S.righteN$class/window$M.window.S.lefteN$class/window$M.window.S.beloweN$class/window$M.window.S.aboveeN $examples$11eN$class/tile$C.tileeN$class/window$C.windowEN$class/frame$C.frameXnOIxIEI'XnsIOIxIRIOIx(q7NGesturesOIxHandle sequences of eventsnOIxIEN$class/gesture$C.gestureXnOIxIEI}XnsIOIxIRIOIx(z"NCompound GraphicalsOIx(Using devices to create compound objectsnOIxIEN$class/device$C.deviceXnOIxIEI(XnsIOIxIRIOIx,}>$N ConnectionsOIxConnecting graphicalsOIxConnections define a line connecting two graphical objects. Changing either of the graphical objects will update the connection automatically. The END-POINTS of the connections on each of the graphicals is determined using a `HANDLE'. A handle has a `name' and a `kind'. The `name' of a handle should be unique over all handles attached to a graphical. The `kind' need not be unique. Each side of a connection can attach to a handle of specified type and possible only with a given name. When only the kind is determined and there are more than one handle of the specified kind, the connection will attach to that handle that `looks best'. Handles can be attached both at the class level using `Class ->handle' or at the instance level using `Graphical ->handle'. The initial ATTRIBUTES of the line (arrows, pen, texture) may be instantiated from a `link'. See `E Linking Graphicals'.OI xI eN $examples$10eN$class/class$M.class.S.handleeN$class/class$V.class.handleseN%$class/graphical$M.graphical.S.layouteN$$class/graphical$V.graphical.handleseN%$class/graphical$M.graphical.S.handleeN)$class/graphical$M.graphical.S.disconnecteN($class/graphical$V.graphical.connectionseN($class/graphical$M.graphical.S.connectedeN&$class/graphical$M.graphical.S.connecteN$class/link$C.linkEN$class/connection$C.connectionXnOI!xIEI(XnsIOI"xIRIOI#x,}>NKloning objectsOI$xCreating a clone of an objectnOI%xIeN $class/class$V.class.klone_styleEN#$class/class$V.class.klone_functionXnOI&xIEIgXnsIOI'xIRIOI(x("NActivating commandsOI)x Menus, direct manipulation, etc.nOI*xIEN$class/menu_bar$C.menu_barXnOI+xIEIXnsIOI,xIRIOI-x)IANHost InterfaceOI.x2Interface description for host-language connectionnnnOI/xIENrootXOI0xIeIEIXsIOI1xIRIOI2x,}>N hostQuery()OI3xPCE queries the host systemOI4xThe host-language interface must define a C-function hostQuery, which allows PCE to acquire information about the environment. Below is a skeleton of this function: int hostQuery(what, value) int what; PceValue *value; { switch(what) { case HOST_SYMBOLFILE: return PCE_FAIL; case HOST_GETC: return PCE_SUCCEED; default: fprintf(stderr, "Unknown query from PCE: %d", what); return PCE_FAIL; } } The defined requests are: # HOST_SYMBOLFILE Assign a char * describing a path-name to a Unix symbol-file describing the current process. Used by PCE to produce a C-stack-trace when a fatal error occurs # HOST_GETC Read a character from the terminal.OI5xIEN$class/pce$V.pce.print_c_stackXnOI6xIEIXnsIOI7xIRIOI8x)I4N hostAction()OI9x+Pce asks host system to perform some actionnnnOI:xIEIXnsIOI;xIRIOIxIEIXOI?xIEIXsIOI@xIRIOIAx,}>%NCurrentOIBxUsing the notion of `current'OICxG`Long Time Ago', there was a system called PCE that could not handle multiple arguments to methods and had little flexibility in code objects. With those restrictions, the notion of `current' (cell, dialog_item, menu_item, ...) has been introduced to avoid the need for multiple arguments. The use of this notion is dubious: mutual recursive procedures both using this technique will not behave properly. Also, the current is not really a describing attribute of the object. The methods -being present for so long- have been retained in this version, but please avoid using them.OIDxIeN$class/chain$M.chain.G.nexteN$class/chain$M.chain.S.inserteN%$class/chain$M.chain.S.delete_currenteN!$class/chain$M.chain.G.current_noeN!$class/chain$M.chain.S.current_noeN$class/chain$M.chain.G.currenteN$class/chain$M.chain.S.currentEN$class/chain$V.chain.currentXnOIExIEIXnsIOIFxIRIOIGx*6NVisual HierarchyOIHx$Examine visual consists-of hierarchynnnOIIxIEIKXnsIOIJxIRIOIKx*NNTracingOILxTracing PCE's executionnOIMxIeN $class/pce$M.pce.S.debug_subjecteN$class/pce$M.pce.S.debugeN$class/pce$M.pce.S.spyeN$class/pce$M.pce.S.traceeN&$class/method$M.method.G.trace_messageeN $class/method$M.method.S.notraceEN$class/method$M.method.S.traceXnOINxIEIKXnsIOIOxIRIOIPx*JNFinding ReferencesOIQx Finding references of graphicalsnOIRxIEN*$class/display$M.display.S.inspect_handlerXnOISxIEIKXnXuCnumberOITxx