home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / wp_dtp / xdme1821.lha / XDME / amiga.c < prev    next >
C/C++ Source or Header  |  1993-03-23  |  2KB  |  139 lines

  1. /******************************************************************************
  2.  
  3.     MODUL
  4.     amiga.c
  5.  
  6.     DESCRIPTION
  7.  
  8.     NOTES
  9.  
  10.     BUGS
  11.  
  12.     TODO
  13.  
  14.     EXAMPLES
  15.  
  16.     SEE ALSO
  17.  
  18.     INDEX
  19.  
  20.     HISTORY
  21.     10. Oct 1992    ada created
  22.  
  23. ******************************************************************************/
  24.  
  25. /**************************************
  26.         Includes
  27. **************************************/
  28. #include <defs.h>
  29.  
  30.  
  31. /**************************************
  32.         Globale Variable
  33. **************************************/
  34.  
  35.  
  36. /**************************************
  37.       Interne Defines & Strukturen
  38. **************************************/
  39.  
  40.  
  41. /**************************************
  42.         Interne Variable
  43. **************************************/
  44.  
  45.  
  46. /**************************************
  47.        Interne Prototypes
  48. **************************************/
  49. Prototype void set_pubscreen (void);
  50.  
  51.  
  52. /*****************************************************************************
  53.  
  54.     NAME
  55.     set_pubscreen
  56.  
  57.     PARAMETER
  58.     void
  59.  
  60.     RESULT
  61.  
  62.     RETURN
  63.     void
  64.  
  65.     DESCRIPTION
  66.     Sets the name for the pubscreen XDME should open its windows on.
  67.  
  68.     NOTES
  69.  
  70.     BUGS
  71.     This is only a dummy (Sorry).
  72.  
  73.     EXAMPLES
  74.  
  75.     SEE ALSO
  76.  
  77.     INTERNALS
  78.  
  79.     HISTORY
  80.     10. Oct 1992    ada created
  81.  
  82. ******************************************************************************/
  83.  
  84. void set_pubscreen (void)
  85. {
  86.     static char * name = NULL;
  87.  
  88.     /* If there is already a name, free it first */
  89.  
  90.     if (name)
  91.     {
  92.     free (name);
  93.     name = NULL;
  94.     }
  95.  
  96.     /* If there is a new name, get it */
  97.  
  98.     if (av[1][0])
  99.     {
  100.     /* Make a copy of the name */
  101.     if (name = strdup (av[1]))
  102.     {
  103.  
  104.         /* always set the new name. If we couldn't get memory,
  105.            name = NULL and the feature is disabled. (the old name
  106.            is lost !) */
  107.  
  108.         if (XDMEArgs.publicscreenname)
  109.         free (XDMEArgs.publicscreenname);
  110.  
  111.         XDMEArgs.publicscreenname = name;
  112.  
  113.         /* give user a hint what we did */
  114.  
  115.         if (name)
  116.         {
  117.         sprintf (tmp_buffer, "Set PubScreen to `%s'", name);
  118.         title (tmp_buffer);
  119.         } else
  120.         warn ("PUBSCREEN: out of memory !");
  121.     }
  122.     } else
  123.     {
  124.     /* Disable PubScreens */
  125.  
  126.     if (XDMEArgs.publicscreenname)
  127.         free (XDMEArgs.publicscreenname);
  128.  
  129.     XDMEArgs.publicscreenname = NULL;
  130.  
  131.     title ("turned PubScreen OFF");
  132.     }
  133. } /* set_pubscreen */
  134.  
  135.  
  136. /******************************************************************************
  137. *****  ENDE amiga.c
  138. ******************************************************************************/
  139.