home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / layers.zoo / layers.2 / layertitle.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-11  |  1.2 KB  |  42 lines

  1. /*             Copyright (C) 1989 by David W. Trissel
  2.  *
  3.  *  Not derived from licensed software.
  4.  *
  5.  * Permission is granted to freely use, copy, modify, and redistribute
  6.  * this software, provided that no attempt is made to gain profit from it,
  7.  * the author is not construed to be liable for any results of using the
  8.  * software, alterations are clearly marked as such, and this notice is
  9.  * not modified.
  10.  *
  11.  */
  12.                 /*         All rights reserved.        */
  13.  
  14.             /* layertitle - utility to specify window title */
  15.  
  16. #include <stdio.h>
  17.  
  18. #define ESC 0x1b
  19.  
  20.             /* main() - send string designating layers window title */
  21.  
  22. main(ac, av)
  23. int         ac;                         /* argument count */
  24. char        **av;                       /* argument vector */
  25. {
  26.     char        *ap;                    /* argument scan pointer */
  27.  
  28.     if (--ac != 1)
  29.       { printf("usage: layertitle \"new window title\"\n");
  30.         exit(1);
  31.       }
  32.        
  33.     ap = *++av;                         /* point to argument string */
  34.  
  35.     /* Transmit the title string in the ANSI Private Message format
  36.     ** which is
  37.     **              ESC '^' message ESC '\'
  38.     */
  39.     printf("%c%c%s%c%c", ESC, '^', ap, ESC, '\\');
  40.  
  41. }  /* main() */
  42.