10.3. QNX 4 or QNX 6 (in lib/qnx4.g, lib/qnx6.g)

10.3.1. Loading Extra Libraries for QNX 4 - anyver_loadlibs, gui_require

The anyver_load_libs function is a wrapper for two function calls which are only necessary in QNX 4. The QNX 6 version of this function is merely a place-holder.

10.3.1.2. For QNX 6 (lib/qnx6.g)

   /*--------------------------------------------------------------------
    * Function:    anyver_loadlibs
    * Application: common
    * Returns:     t or nil
    * Description: Not currently used in QNX 6.  A place-holder for 
    *              functionality needed in QNX 4.
    *------------------------------------------------------------------*/
   function anyver_loadlibs()
   {
     nil;
   }
   

The gui_require function is called from within the lib/qnx6.g file, and thus does not need or have a QNX 4 counterpart. It checks the name of the Controller argument passed in the system command in the demo.g program, and loads the GTK or Photon libraries needed. If the Controller or any other program in the Demo is started independently in QNX 6, this function will ensure that the appropriate GUI libraries still get loaded.

   /*--------------------------------------------------------------------
    * Function:    gui_require
    * Application: common
    * Returns:     function
    * Description: Tests for GUI, and chooses GTK or Photon libraries.
    *------------------------------------------------------------------*/
   function gui_require()
   {
     local str_arg = string(car(argv));
     
     if (strstr(str_arg, "gtk") != -1)
       require("lib/gtk.g");
     else
       require("lib/photon.g");
   }
   
   gui_require();
   

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.