Deleted Added
sdiff udiff text old ( 12661 ) new ( 15242 )
full compact
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.30 1995/12/07 10:34:09 peter 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
16 * notice, this list of conditions and the following disclaimer,
17 * verbatim and that no modifications are made prior to this
18 * point in the file.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)

--- 172 unchanged lines hidden (view full) ---

202 WINDOW *w;
203
204 errstr = (char *)safe_malloc(FILENAME_MAX);
205 va_start(args, fmt);
206 vsnprintf(errstr, FILENAME_MAX, fmt, args);
207 va_end(args);
208 use_helpline(NULL);
209 use_helpfile(NULL);
210 w = savescr();
211 if (OnVTY) {
212 msgDebug("Switching back to VTY1\n");
213 ioctl(0, VT_ACTIVATE, 1);
214 msgInfo(NULL);
215 }
216 dialog_notify(errstr);
217 restorescr(w);
218 free(errstr);
219}
220
221/* Put up a message in a popup information box */
222void
223msgNotify(char *fmt, ...)
224{
225 va_list args;

--- 22 unchanged lines hidden (view full) ---

248 WINDOW *w;
249
250 errstr = (char *)safe_malloc(FILENAME_MAX);
251 va_start(args, fmt);
252 vsnprintf(errstr, FILENAME_MAX, fmt, args);
253 va_end(args);
254 use_helpline(NULL);
255 use_helpfile(NULL);
256 w = savescr();
257 if (OnVTY) {
258 msgDebug("Switching back to VTY1\n");
259 ioctl(0, VT_ACTIVATE, 1); /* Switch back */
260 msgInfo(NULL);
261 }
262 ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1);
263 restorescr(w);
264 free(errstr);
265 return ret;
266}
267
268/* Put up a message in an input box and return the value */
269char *
270msgGetInput(char *buf, char *fmt, ...)
271{

--- 8 unchanged lines hidden (view full) ---

280 vsnprintf(errstr, FILENAME_MAX, fmt, args);
281 va_end(args);
282 use_helpline(NULL);
283 use_helpfile(NULL);
284 if (buf)
285 strcpy(input_buffer, buf);
286 else
287 input_buffer[0] = '\0';
288 w = savescr();
289 if (OnVTY) {
290 msgDebug("Switching back to VTY1\n");
291 ioctl(0, VT_ACTIVATE, 1); /* Switch back */
292 msgInfo(NULL);
293 }
294 rval = dialog_inputbox("Value Required", errstr, -1, -1, input_buffer);
295 restorescr(w);
296 free(errstr);
297 if (!rval)
298 return input_buffer;
299 else
300 return NULL;
301}
302
303/* Write something to the debugging port */

--- 35 unchanged lines hidden (view full) ---

339 msgInfo("Command output is on VTY2 - type ALT-F2 to see it");
340}
341
342/* Simple versions of msgConfirm() and msgNotify() for calling from scripts */
343int
344msgSimpleConfirm(char *str)
345{
346 msgConfirm(str);
347 return DITEM_SUCCESS;
348}
349
350int
351msgSimpleNotify(char *str)
352{
353 msgNotify(str);
354 return DITEM_SUCCESS;
355}