home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 0 / 0980 / message.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  1.4 KB  |  63 lines

  1. /* 
  2.  * message.c, based on the TCL panic.c
  3.  *
  4.  *    Source code for the "panic" library procedure.
  5.  *
  6.  * Copyright 1988 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  */
  15.  
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <varargs.h>
  19.  
  20. /*
  21.  *----------------------------------------------------------------------
  22.  *
  23.  * message --
  24.  *
  25.  *    Print a message on the browse command line.
  26.  *
  27.  * Results:
  28.  *    None.
  29.  *
  30.  *----------------------------------------------------------------------
  31.  */
  32.  
  33. #ifndef lint
  34. void
  35. message(va_alist)
  36.     va_dcl            /* char *format, then any number of additional
  37.                  * values to be printed under the control of
  38.                  * format.  This is all just the same as you'd
  39.                  * pass to printf. */
  40. {
  41.     char *format;
  42.     va_list args;
  43.     extern int display_up;
  44.  
  45.     cmdline();
  46.     va_start(args);
  47.     format = va_arg(args, char *);
  48.     (void) vfprintf(stdout, format, args);
  49.     if(!display_up) putchar('\n');
  50.     (void) fflush(stdout);
  51. }
  52. #else
  53. /* VARARGS1 */
  54. /* ARGSUSED */
  55. void
  56. message(format)
  57.     char *format;
  58. {
  59.     return;
  60. }
  61. #endif /* lint */
  62.  
  63.