lib/qnx.g - General QNX library

Cogent Tools Demo and Tutorials: Version 4.0
Prev | Chapter 3. View the Code | Next

# 3.14. `lib/qnx.g` - General QNX library

    /*--------------------------------------------------------------------
     * File:        qnx.g
     *
     * Description: Functions that run on both QNX 4 and QNX 6.
     *
     * Functions:
     *              anyos_system
     *              anyos_change_settings
     *              anyos_makemsg
     *              anyos_help
     *------------------------------------------------------------------*/

    /*--------------------------------------------------------------------
     * Function:    anyos_system
     * Application: common
     * Returns:     t or nil
     * Description: A wrapper for the Gamma system() function that blocks
     *              signals while making a call, then reassigns a signal
     *              and unblocks the signals.  This is necessary for QNX4,
     *              and perhaps QNX6, because in that OS a system() call
     *              emits a signal.
     *------------------------------------------------------------------*/
    function anyos_system(call, sig)
    {
      block_signal(sig);
      system(call);
      signal(sig, `anygui_sigchild());
      unblock_signal(sig);
    }

    /*--------------------------------------------------------------------
     * Function:    anyos_help
     * Returns:     t or nil
     * Description: Starts up the Helpviewer and displays the Tutorial docs.
     *------------------------------------------------------------------*/
    function anyos_help()
    {
      local help_url = "/usr/cogent/help/cogent-set/booktu/booktu.html";

      if (is_file(help_url))
        {
          PxHelpTopicRoot("/Cogent Documentation/Cogent Tools Demo and Tutorial");
          PxHelpTopic("booktu.html");
        }
      else
        anygui_makemsg(string("\nSorry, the Cogent Tools Demo and Tutorial",
                              "\nmanual is not available on your system.\n",
                              "\nPlease check your",
                              "\nCogent Documentation installation.\n\n"));
    }

    princ("OS is QNX.\n");

Prev | Home | Next
`lib/linux.g` - Linux library | Up | `lib/qnx4.g` - QNX 4 library

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