10.2. Linux, QNX 4, or QNX 6 (in lib/linux.g, lib/qnx4.g, lib/qnx6.g)

Section 10.2.1, “Process Termination - anyos_find_process”
Section 10.2.2, “Reassigning Strings - anyos_assign”

10.2.1. Process Termination - anyos_find_process

The different versions of this function use either the Gamma function qnx_name_locate or the Gamma function access to check if either the qserve or nserve commands, identified by the name or command parameter, are running.

10.2.1.1. For Linux (lib/linux.g)

   /*--------------------------------------------------------------------
    * Function:    anyos_find_process
    * Returns:     t or nil
    * Description: A wrapper for the qnx_name_locate() function used in
    *              anyos_start_qnserves().  Allows for alternate code in
    *              QNX 6.
    *------------------------------------------------------------------*/
   function anyos_find_process(command, name)
   {
     qnx_name_locate (0, name, 0);
   }
   

10.2.1.2. For QNX 4 (lib/qnx4.g)

   /*--------------------------------------------------------------------
    * Function:    anyos_find_process
    * Application: common
    * Returns:     t or nil
    * Description: A wrapper for the qnx_name_locate() function used in
    *              anyos_start_qnserves().  Allows for alternate code in
    *              QNX 6.
    *------------------------------------------------------------------*/
   function anyos_find_process(command, name)
   {
     qnx_name_locate (0, name, 0);
   }
   

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

   /*--------------------------------------------------------------------
    * Function:    anyos_find_process
    * Application: common
    * Returns:     t or nil
    * Description: Finds a process based on the name of a command, rather
    *              than the name of a processes (as is done in QNX 4 and
    *              Linux).  The qnx_name_locate function is not available
    *              in QNX 6 due to its unique kernel architecture.
    *------------------------------------------------------------------*/
   function anyos_find_process(command, name)
   {
     if(access(string("/dev/", command), 0) == -1)
       nil;
     else
       t;        
   }
   

10.2.2. Reassigning Strings - anyos_assign

The QNX versions of this function use the Gamma switch statement to select and reassign strings based on OS-specific needs. The function allows for generic PhabReadWidgetFile calls to Photon 1.14 widget files for QNX 4, or Photon 2 widget files for QNX 6, as well as a few other strings not held in common.

10.2.2.1. For Linux (lib/linux.g)

   /*--------------------------------------------------------------------
    * Function:    anyos_assign
    * Returns:     function
    * Description: Not currently used in Linux.  Used in QNX 4 and QNX 6 
    *              for making OS-dependent assignments.
    *------------------------------------------------------------------*/
   function anyos_assign(str)
   {
     nil;
   }
   

10.2.2.2. For QNX 4 (lib/qnx4.g)

   /*--------------------------------------------------------------------
    * Function:    anyos_assign
    * Application: common
    * Returns:     a string
    * Description: Creates a way to reassign a single string to different
    *              strings, based on the OS.
    *------------------------------------------------------------------*/
   function anyos_assign(str)
   {
     switch(str)
       {
       case "control_widgetfile": "phcontrolwindow/wgt/Ptcontrol.wgtw";
       case "monitor_widgetfile": "phmonitorwin/wgt/Ptmonitor.wgtw";
       case "log_widgetfile": "phlogwin/wgt/Ptlog.wgtw";
       case "history_widgetfile": "phhistorywin/wgt/PtHist.wgtw";
       case "deadband_widgetfile": "phhistorywin/wgt/DeadBandWindow.wgtw";
       case "gamstring": "phgamma";
       case "graph_font": "helv10";
       }
   }
   

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

   /*--------------------------------------------------------------------
    * Function:    anyos_assign
    * Application: common
    * Returns:     a string
    * Description: Creates a way to reassign a single string to different
    *              strings, based on the OS.
    *------------------------------------------------------------------*/
   function anyos_assign(str)
   {
     switch(str)
       {
       case "control_widgetfile": "ph2controlwin/wgt/Ptcontrol.wgtw";
       case "monitor_widgetfile": "ph2monitorwin/wgt/Ptmonitor.wgtw";
       case "log_widgetfile": "ph2logwin/wgt/Ptlog.wgtw";
       case "history_widgetfile": "ph2historywin/wgt/PtHist.wgtw";
       case "deadband_widgetfile": "ph2historywin/wgt/DeadBandWindow.wgtw";
       case "gamstring": "gamma";
       case "graph_font": "TextFont07";
       }
   }