-- XStartup.mesa

DIRECTORY
  CRuntime,
  CString,
  Heap,
  MStream,
  PilotClient,
  Runtime,
  XMKDriver;
  
XStartup:PROGRAM IMPORTS CRuntime, CString, Heap, MStream, Runtime, XMKDriver EXPORTS PilotClient =

  BEGIN
  p:PROCESS;
  h:MStream.Handle;
  h1:MStream.Handle;
  name:CString.CString;
  xname:CString.CString;
  
  Run: PUBLIC PROCEDURE =
    BEGIN
    END;
    
  p ← FORK XMKDriver.XMKDriverProc[];
  h ← MStream.WriteOnly[name:"<Tajo>X11out.log", release:[NIL,NIL], type:text];
  h1 ← MStream.ReadOnly[name:"<Tajo>HOSTS.TXT", release:[NIL,NIL]];
  name ← CString.LongStringToCString["X11Server", Heap.systemZone];
  
  xname ← CString.LongStringToCString["<tajo>X11.bcd", Heap.systemZone];
  [] ← CRuntime.StartProgram[xname, 1, @name, h1, h, h];
  Runtime.Interrupt[];
  
  END.