Deleted Added
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.9 1995/05/08 06:06:26 jkh Exp $
7 * $Id: msg.c,v 1.10 1995/05/11 06:10:56 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

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

166 char *errstr;
167
168 errstr = (char *)safe_malloc(FILENAME_MAX);
169 va_start(args, fmt);
170 vsnprintf(errstr, FILENAME_MAX, fmt, args);
171 va_end(args);
172 use_helpline(NULL);
173 use_helpfile(NULL);
174 dialog_mesgbox("User Attention Requested", errstr, -1, -1);
174 dialog_notify(errstr);
175 free(errstr);
176}
177
178/* Put up a message in a popup information box */
179void
180msgNotify(char *fmt, ...)
181{
182 va_list args;
183 char *errstr;
184 WINDOW *w;
185
186 errstr = (char *)safe_malloc(FILENAME_MAX);
187 va_start(args, fmt);
188 vsnprintf(errstr, FILENAME_MAX, fmt, args);
189 va_end(args);
190 use_helpline(NULL);
191 use_helpfile(NULL);
192 w = dupwin(newscr);
193 dialog_msgbox("Information Dialog", errstr, -1, -1, 0);
194 touchwin(w);
195 wrefresh(w);
196 delwin(w);
197 free(errstr);
198}
199
200/* Put up a message in a popup yes/no box and return 1 for YES, 0 for NO */
201int
202msgYesNo(char *fmt, ...)
203{
204 va_list args;
205 char *errstr;
206 int ret;
207 WINDOW *w;
208
209 errstr = (char *)safe_malloc(FILENAME_MAX);
210 va_start(args, fmt);
211 vsnprintf(errstr, FILENAME_MAX, fmt, args);
212 va_end(args);
213 use_helpline(NULL);
214 use_helpfile(NULL);
215 w = dupwin(newscr);
216 ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1);
217 touchwin(w);
218 wrefresh(w);
219 delwin(w);
220 free(errstr);
221 return ret;
222}
223
224/* Put up a message in an input box and return the value */
225char *
226msgGetInput(char *buf, char *fmt, ...)
227{
228 va_list args;
229 char *errstr;
230 static char input_buffer[256];
231 int rval;
232 WINDOW *w;
233
234 errstr = (char *)safe_malloc(FILENAME_MAX);
235 va_start(args, fmt);
236 vsnprintf(errstr, FILENAME_MAX, fmt, args);
237 va_end(args);
238 use_helpline(NULL);
239 use_helpfile(NULL);
240 if (buf)
241 strcpy(input_buffer, buf);
242 else
243 input_buffer[0] = '\0';
244 w = dupwin(newscr);
245 rval = dialog_inputbox("Value Required", errstr, -1, -1, input_buffer);
246 touchwin(w);
247 wrefresh(w);
248 delwin(w);
249 free(errstr);
250 if (!rval)
251 return input_buffer;
252 else
253 return NULL;
254}
255
256/* Write something to the debugging port */

--- 14 unchanged lines hidden ---