/* 
 * Motif Tools Library, Version 2.0
 * $Id: AssertClass.c,v 2.9 1994/07/04 03:03:50 david Exp $
 * 
 * Written by David Flanagan.
 * Copyright (c) 1992, 1993, 1994 by Dovetail Systems.
 * All Rights Reserved.  See the file COPYRIGHT for details.
 * This is not free software.  See the file SHAREWARE for details.
 * There is no warranty for this software.  See NO_WARRANTY for details.
 */

#include <Xmt/Xmt.h>
#include <X11/IntrinsicP.h>

#if NeedFunctionPrototypes
void XmtAssertWidgetClass(Widget w, WidgetClass c, String procname)
#else
void XmtAssertWidgetClass(w, c, procname)
Widget w;
WidgetClass c;
String procname;
#endif
{
    extern void abort();
    
    if (!XtIsSubclass(w, c)) {
	XmtWarningMsg("XmtAssertWidgetClass", "typeMismatch",
		      "\n\tA widget of class %s was passed to procedure %s.\n\tA widget of class %s was expected.\n\tAborting.",
		      XtClass(w)->core_class.class_name,
		      procname,
		      c->core_class.class_name);
	(void) abort();
    }
}
