msg.c (9202) | msg.c (12661) |
---|---|
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.28.2.2 1995/06/02 15:31:31 jkh Exp $ | 7 * $Id: msg.c,v 1.29.2.8 1995/10/22 21:38:17 jkh 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 --- 31 unchanged lines hidden (view full) --- 47#include <machine/console.h> 48 49#define VTY_STATLINE 24 50#define TTY_STATLINE 23 51 52Boolean 53isDebug(void) 54{ | 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 --- 31 unchanged lines hidden (view full) --- 47#include <machine/console.h> 48 49#define VTY_STATLINE 24 50#define TTY_STATLINE 23 51 52Boolean 53isDebug(void) 54{ |
55 if (OptFlags & OPT_DEBUG) 56 return TRUE; 57 return FALSE; | 55 char *cp; 56 57 return (cp = variable_get(VAR_DEBUG)) && strcmp(cp, "no"); |
58} 59 60/* Whack up an informational message on the status line, in stand-out */ 61void 62msgYap(char *fmt, ...) 63{ 64 va_list args; 65 char *errstr; --- 145 unchanged lines hidden (view full) --- 211 errstr = (char *)safe_malloc(FILENAME_MAX); 212 va_start(args, fmt); 213 vsnprintf(errstr, FILENAME_MAX, fmt, args); 214 va_end(args); 215 use_helpline(NULL); 216 use_helpfile(NULL); 217 w = dupwin(newscr); 218 if (OnVTY) { | 58} 59 60/* Whack up an informational message on the status line, in stand-out */ 61void 62msgYap(char *fmt, ...) 63{ 64 va_list args; 65 char *errstr; --- 145 unchanged lines hidden (view full) --- 211 errstr = (char *)safe_malloc(FILENAME_MAX); 212 va_start(args, fmt); 213 vsnprintf(errstr, FILENAME_MAX, fmt, args); 214 va_end(args); 215 use_helpline(NULL); 216 use_helpfile(NULL); 217 w = dupwin(newscr); 218 if (OnVTY) { |
219 msgDebug("Switching back to VTY 0\n"); | 219 msgDebug("Switching back to VTY1\n"); |
220 ioctl(0, VT_ACTIVATE, 1); 221 msgInfo(NULL); 222 } 223 dialog_notify(errstr); 224 touchwin(w); 225 wrefresh(w); 226 delwin(w); 227 free(errstr); --- 31 unchanged lines hidden (view full) --- 259 errstr = (char *)safe_malloc(FILENAME_MAX); 260 va_start(args, fmt); 261 vsnprintf(errstr, FILENAME_MAX, fmt, args); 262 va_end(args); 263 use_helpline(NULL); 264 use_helpfile(NULL); 265 w = dupwin(newscr); 266 if (OnVTY) { | 220 ioctl(0, VT_ACTIVATE, 1); 221 msgInfo(NULL); 222 } 223 dialog_notify(errstr); 224 touchwin(w); 225 wrefresh(w); 226 delwin(w); 227 free(errstr); --- 31 unchanged lines hidden (view full) --- 259 errstr = (char *)safe_malloc(FILENAME_MAX); 260 va_start(args, fmt); 261 vsnprintf(errstr, FILENAME_MAX, fmt, args); 262 va_end(args); 263 use_helpline(NULL); 264 use_helpfile(NULL); 265 w = dupwin(newscr); 266 if (OnVTY) { |
267 msgDebug("Switching back to VTY 0\n"); | 267 msgDebug("Switching back to VTY1\n"); |
268 ioctl(0, VT_ACTIVATE, 1); /* Switch back */ 269 msgInfo(NULL); 270 } 271 ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1); 272 touchwin(w); 273 wrefresh(w); 274 delwin(w); 275 free(errstr); --- 17 unchanged lines hidden (view full) --- 293 use_helpline(NULL); 294 use_helpfile(NULL); 295 if (buf) 296 strcpy(input_buffer, buf); 297 else 298 input_buffer[0] = '\0'; 299 w = dupwin(newscr); 300 if (OnVTY) { | 268 ioctl(0, VT_ACTIVATE, 1); /* Switch back */ 269 msgInfo(NULL); 270 } 271 ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1); 272 touchwin(w); 273 wrefresh(w); 274 delwin(w); 275 free(errstr); --- 17 unchanged lines hidden (view full) --- 293 use_helpline(NULL); 294 use_helpfile(NULL); 295 if (buf) 296 strcpy(input_buffer, buf); 297 else 298 input_buffer[0] = '\0'; 299 w = dupwin(newscr); 300 if (OnVTY) { |
301 msgDebug("Switching back to VTY 0\n"); | 301 msgDebug("Switching back to VTY1\n"); |
302 ioctl(0, VT_ACTIVATE, 1); /* Switch back */ 303 msgInfo(NULL); 304 } 305 rval = dialog_inputbox("Value Required", errstr, -1, -1, input_buffer); 306 touchwin(w); 307 wrefresh(w); 308 delwin(w); 309 free(errstr); --- 34 unchanged lines hidden (view full) --- 344 va_end(args); 345 use_helpline(NULL); 346 use_helpfile(NULL); 347 msgDebug("Notify: %s\n", errstr); 348 dialog_clear(); 349 dialog_msgbox("Information Dialog", errstr, -1, -1, 0); 350 free(errstr); 351 if (OnVTY) | 302 ioctl(0, VT_ACTIVATE, 1); /* Switch back */ 303 msgInfo(NULL); 304 } 305 rval = dialog_inputbox("Value Required", errstr, -1, -1, input_buffer); 306 touchwin(w); 307 wrefresh(w); 308 delwin(w); 309 free(errstr); --- 34 unchanged lines hidden (view full) --- 344 va_end(args); 345 use_helpline(NULL); 346 use_helpfile(NULL); 347 msgDebug("Notify: %s\n", errstr); 348 dialog_clear(); 349 dialog_msgbox("Information Dialog", errstr, -1, -1, 0); 350 free(errstr); 351 if (OnVTY) |
352 msgInfo("Command output is on debugging screen - type ALT-F2 to see it"); | 352 msgInfo("Command output is on VTY2 - type ALT-F2 to see it"); |
353} | 353} |
354 355/* Simple versions of msgConfirm() and msgNotify() for calling from scripts */ 356int 357msgSimpleConfirm(char *str) 358{ 359 msgConfirm(str); 360 return RET_SUCCESS; 361} 362 363int 364msgSimpleNotify(char *str) 365{ 366 msgNotify(str); 367 return RET_SUCCESS; 368} |
|