/*
 * standard message dialog boxes
 *
 * Copyright (c) 1997 David L Parsons 
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that the above copyright notice and this paragraph are
 * duplicated in all such forms and that any documentation,
 * advertising materials, and other materials related to such
 * distribution and use acknowledge that the software was developed
 * by David L Parsons (orc@pell.chi.il.us).  My name may not be used
 * to endorse or promote products derived from this software without
 * specific prior written permission.  THIS SOFTWARE IS PROVIDED
 * ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.
 */

static const char rcsid[] = "$Id: s.messages.c 1.3 02/06/07 10:12:08-07:00 root@egypt.pell.portland.or.us $";

#include <stdio.h>
#include <dialog.h>
#include <stdarg.h>

/*
 * Error pops up an alert box if something is going wrong
 */
void
Error(char *fmt, ...)
{
    char msg[200];
    va_list ptr;

    va_start(ptr, fmt);
    vsprintf(msg, fmt, ptr);
    va_end(ptr);

    dialog_notify(msg);
} /* Error */


/*
 * Areyousure() pops up an alert box to make completely certain that
 * you know what you're doing
 */
int
Areyousure(char *prompt)
{
    return (dialog_yesno("Confirm",prompt, -1, -1) == 0);
}
