home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / elm / elm2.4 / src / out_utils.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-02-03  |  2.9 KB  |  155 lines

  1.  
  2. static char rcsid[] = "@(#)$Id: out_utils.c,v 5.2 1993/02/03 19:06:31 syd Exp $";
  3.  
  4. /*******************************************************************************
  5.  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  6.  *
  7.  *            Copyright (c) 1988-1992 USENET Community Trust
  8.  *            Copyright (c) 1986,1987 Dave Taylor
  9.  *******************************************************************************
  10.  * Bug reports, patches, comments, suggestions should be sent to:
  11.  *
  12.  *    Syd Weinstein, Elm Coordinator
  13.  *    elm@DSI.COM            dsinc!elm
  14.  *
  15.  *******************************************************************************
  16.  * $Log: out_utils.c,v $
  17.  * Revision 5.2  1993/02/03  19:06:31  syd
  18.  * Remove extra strchr/strcat/strcpy et al declarations
  19.  * From: Syd
  20.  *
  21.  * Revision 5.1  1992/10/03  22:58:40  syd
  22.  * Initial checkin as of 2.4 Release at PL0
  23.  *
  24.  *
  25.  ******************************************************************************/
  26.  
  27. /** This file contains routines used for output in the ELM program.
  28.  
  29. **/
  30.  
  31. #include "headers.h"
  32.  
  33.  
  34. static char err_buffer[SLEN];        /* store last error message */
  35.  
  36. static char central_message_buffer[SLEN];
  37.  
  38. show_last_error()
  39. {
  40.     /** rewrite last error message! **/
  41.  
  42.     error(err_buffer);
  43. }
  44.  
  45. clear_error()
  46. {
  47.     MoveCursor(LINES,0);
  48.     CleartoEOLN();
  49.     err_buffer[0] = '\0';
  50. }
  51.  
  52. set_error(s)
  53. char *s;
  54. {
  55.     strcpy(err_buffer, s);
  56. }
  57.  
  58. error(s)
  59. char *s;
  60. {
  61.     /** outputs error 's' to screen at line 22, centered! **/
  62.  
  63.     if(batch_only)
  64.       printf("%s\n\r", s);
  65.     else {
  66.       MoveCursor(LINES,0);
  67.       CleartoEOLN();
  68.       PutLine0(LINES,(COLUMNS-strlen(s))/2,s);
  69.       fflush(stdout);
  70.     }
  71.     strcpy(err_buffer, s);    /* save it too! */
  72. }
  73.  
  74. /*VARARGS1*/
  75.  
  76. error1(s, a)
  77. char *s, *a;
  78. {
  79.     /** same as error, but with a 'printf' argument **/
  80.     char buffer[SLEN];
  81.  
  82.     sprintf(buffer,s,a);
  83.     error(buffer);
  84. }
  85.  
  86. /*VARARGS1*/
  87.  
  88. error2(s, a1, a2)
  89. char *s, *a1, *a2;
  90. {
  91.     /** same as error, but with two 'printf' arguments **/
  92.     char buffer[SLEN];
  93.  
  94.     MCsprintf(buffer,s, a1, a2);
  95.     error(buffer);
  96. }
  97.  
  98. /*VARARGS1*/
  99.  
  100. error3(s, a1, a2, a3)
  101. char *s, *a1, *a2, *a3;
  102. {
  103.     /** same as error, but with three 'printf' arguments **/
  104.     char buffer[SLEN];
  105.  
  106.     MCsprintf(buffer,s, a1, a2, a3);
  107.     error(buffer);
  108. }
  109.  
  110. lower_prompt(s)
  111. char *s;
  112. {
  113.     /** prompt user for input on LINES-1 line, left justified **/
  114.  
  115.     PutLine0(LINES-1,0,s);
  116.     CleartoEOLN();
  117. }
  118.  
  119. prompt(s)
  120. char *s;
  121. {
  122.     /** prompt user for input on LINES-3 line, left justified **/
  123.  
  124.     PutLine0(LINES-3,0,s);
  125.     CleartoEOLN();
  126. }
  127.  
  128.  
  129. set_central_message(string, arg)
  130. char *string, *arg;
  131. {
  132.     /** set up the given message to be displayed in the center of
  133.         the current window **/ 
  134.  
  135.     sprintf(central_message_buffer, string, arg);
  136. }
  137.  
  138. display_central_message()
  139. {
  140.     /** display the message if set... **/
  141.  
  142.     if (central_message_buffer[0] != '\0') {
  143.       ClearLine(LINES-15);
  144.       Centerline(LINES-15, central_message_buffer);
  145.       fflush(stdout);
  146.     }
  147. }
  148.  
  149. clear_central_message()
  150. {
  151.     /** clear the central message buffer **/
  152.  
  153.     central_message_buffer[0] = '\0';
  154. }
  155.