msg.c (8658) | msg.c (8702) |
---|---|
1/* 2 * The new sysinstall program. 3 * 4 * This is probably the last program in the `sysinstall' line - the next 5 * generation being essentially a complete rewrite. 6 * | 1/* 2 * The new sysinstall program. 3 * 4 * This is probably the last program in the `sysinstall' line - the next 5 * generation being essentially a complete rewrite. 6 * |
7 * $Id: msg.c,v 1.20 1995/05/20 14:05:31 jkh Exp $ | 7 * $Id: msg.c,v 1.21 1995/05/20 19:12:12 phk Exp $ |
8 * 9 * Copyright (c) 1995 10 * Jordan Hubbard. All rights reserved. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 * 1. Redistributions of source code must retain the above copyright --- 23 unchanged lines hidden (view full) --- 39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 40 * SUCH DAMAGE. 41 * 42 */ 43 44#include "sysinstall.h" 45#include <stdarg.h> 46 | 8 * 9 * Copyright (c) 1995 10 * Jordan Hubbard. All rights reserved. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 * 1. Redistributions of source code must retain the above copyright --- 23 unchanged lines hidden (view full) --- 39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 40 * SUCH DAMAGE. 41 * 42 */ 43 44#include "sysinstall.h" 45#include <stdarg.h> 46 |
47#define VTY_STATLINE 24 48#define TTY_STATLINE 23 49 |
|
47/* Whack up an informational message on the status line, in stand-out */ 48void 49msgYap(char *fmt, ...) 50{ 51 va_list args; 52 char *errstr; 53 int attrs; 54 55 errstr = (char *)safe_malloc(FILENAME_MAX); 56 va_start(args, fmt); 57 vsnprintf(errstr, FILENAME_MAX, fmt, args); 58 va_end(args); 59 attrs = getattrs(stdscr); 60 attrset(A_REVERSE); | 50/* Whack up an informational message on the status line, in stand-out */ 51void 52msgYap(char *fmt, ...) 53{ 54 va_list args; 55 char *errstr; 56 int attrs; 57 58 errstr = (char *)safe_malloc(FILENAME_MAX); 59 va_start(args, fmt); 60 vsnprintf(errstr, FILENAME_MAX, fmt, args); 61 va_end(args); 62 attrs = getattrs(stdscr); 63 attrset(A_REVERSE); |
61 mvaddstr(23, 0, errstr); | 64 mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); |
62 attrset(attrs); 63 refresh(); 64 free(errstr); 65} 66 67/* Whack up an informational message on the status line */ 68void 69msgInfo(char *fmt, ...) 70{ 71 va_list args; 72 char *errstr; 73 int attrs; 74 75 /* NULL is a special convention meaning "erase the old stuff" */ 76 if (!fmt) { | 65 attrset(attrs); 66 refresh(); 67 free(errstr); 68} 69 70/* Whack up an informational message on the status line */ 71void 72msgInfo(char *fmt, ...) 73{ 74 va_list args; 75 char *errstr; 76 int attrs; 77 78 /* NULL is a special convention meaning "erase the old stuff" */ 79 if (!fmt) { |
77 move(23, 0); | 80 move(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0); |
78 clrtoeol(); 79 return; 80 } 81 errstr = (char *)safe_malloc(FILENAME_MAX); 82 va_start(args, fmt); 83 vsnprintf(errstr, FILENAME_MAX, fmt, args); 84 va_end(args); 85 attrs = getattrs(stdscr); 86 attrset(A_NORMAL); | 81 clrtoeol(); 82 return; 83 } 84 errstr = (char *)safe_malloc(FILENAME_MAX); 85 va_start(args, fmt); 86 vsnprintf(errstr, FILENAME_MAX, fmt, args); 87 va_end(args); 88 attrs = getattrs(stdscr); 89 attrset(A_NORMAL); |
87 mvaddstr(23, 0, errstr); | 90 mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); |
88 attrset(attrs); 89 refresh(); 90 if (OnVTY) { 91 msgDebug("Information: `%s'\n", errstr); 92 msgInfo(NULL); 93 } 94 free(errstr); 95} --- 9 unchanged lines hidden (view full) --- 105 errstr = (char *)safe_malloc(FILENAME_MAX); 106 strcpy(errstr, "Warning: "); 107 va_start(args, fmt); 108 vsnprintf((char *)(errstr + strlen(errstr)), FILENAME_MAX, fmt, args); 109 va_end(args); 110 attrs = getattrs(stdscr); 111 beep(); 112 attrset(A_REVERSE); | 91 attrset(attrs); 92 refresh(); 93 if (OnVTY) { 94 msgDebug("Information: `%s'\n", errstr); 95 msgInfo(NULL); 96 } 97 free(errstr); 98} --- 9 unchanged lines hidden (view full) --- 108 errstr = (char *)safe_malloc(FILENAME_MAX); 109 strcpy(errstr, "Warning: "); 110 va_start(args, fmt); 111 vsnprintf((char *)(errstr + strlen(errstr)), FILENAME_MAX, fmt, args); 112 va_end(args); 113 attrs = getattrs(stdscr); 114 beep(); 115 attrset(A_REVERSE); |
113 mvaddstr(23, 0, errstr); | 116 mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); |
114 attrset(attrs); 115 refresh(); 116 if (OnVTY) 117 msgDebug("Warning message `%s'\n", errstr); 118 free(errstr); 119} 120 121/* Whack up an error on the status line */ --- 7 unchanged lines hidden (view full) --- 129 errstr = (char *)safe_malloc(FILENAME_MAX); 130 strcpy(errstr, "Error: "); 131 va_start(args, fmt); 132 vsnprintf((char *)(errstr + strlen(errstr)), FILENAME_MAX, fmt, args); 133 va_end(args); 134 beep(); 135 attrs = getattrs(stdscr); 136 attrset(A_REVERSE); | 117 attrset(attrs); 118 refresh(); 119 if (OnVTY) 120 msgDebug("Warning message `%s'\n", errstr); 121 free(errstr); 122} 123 124/* Whack up an error on the status line */ --- 7 unchanged lines hidden (view full) --- 132 errstr = (char *)safe_malloc(FILENAME_MAX); 133 strcpy(errstr, "Error: "); 134 va_start(args, fmt); 135 vsnprintf((char *)(errstr + strlen(errstr)), FILENAME_MAX, fmt, args); 136 va_end(args); 137 beep(); 138 attrs = getattrs(stdscr); 139 attrset(A_REVERSE); |
137 mvaddstr(23, 0, errstr); | 140 mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); |
138 attrset(attrs); 139 refresh(); 140 if (OnVTY) 141 msgDebug("Error message `%s'\n", errstr); 142 free(errstr); 143} 144 145/* Whack up a fatal error on the status line */ --- 7 unchanged lines hidden (view full) --- 153 errstr = (char *)safe_malloc(FILENAME_MAX); 154 strcpy(errstr, "Fatal Error: "); 155 va_start(args, fmt); 156 vsnprintf((char *)(errstr + strlen(errstr)), FILENAME_MAX, fmt, args); 157 va_end(args); 158 beep(); 159 attrs = getattrs(stdscr); 160 attrset(A_REVERSE); | 141 attrset(attrs); 142 refresh(); 143 if (OnVTY) 144 msgDebug("Error message `%s'\n", errstr); 145 free(errstr); 146} 147 148/* Whack up a fatal error on the status line */ --- 7 unchanged lines hidden (view full) --- 156 errstr = (char *)safe_malloc(FILENAME_MAX); 157 strcpy(errstr, "Fatal Error: "); 158 va_start(args, fmt); 159 vsnprintf((char *)(errstr + strlen(errstr)), FILENAME_MAX, fmt, args); 160 va_end(args); 161 beep(); 162 attrs = getattrs(stdscr); 163 attrset(A_REVERSE); |
161 mvaddstr(23, 0, errstr); | 164 mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); |
162 addstr(" - "); 163 addstr("PRESS ANY KEY TO "); 164 if (getpid() == 1) 165 addstr("REBOOT"); 166 else 167 addstr("QUIT"); 168 attrset(attrs); 169 refresh(); --- 133 unchanged lines hidden --- | 165 addstr(" - "); 166 addstr("PRESS ANY KEY TO "); 167 if (getpid() == 1) 168 addstr("REBOOT"); 169 else 170 addstr("QUIT"); 171 attrset(attrs); 172 refresh(); --- 133 unchanged lines hidden --- |