NAME
XtCheckSubclass − verify an object’s class, if compiled with DEBUG defined.
SYNOPSIS
void XtCheckSubclass(object, object_class, message)
Widget object;
WidgetClass object_class;
String message;
Inputs
objectSpecifies the object; may be of class Object or any subclass thereof.
object_class
Specifies the widget class to test against; may be objectClass or any subclass thereof.
messageSpecifies the message to be displayed if object is not a subclass of object_class.
DESCRIPTION
XtCheckSubclass() checks that object is of class object_class or a subclass. If it is not, XtCheckSubclass() calls XtErrorMsg() passing message as the default message to be displayed. XtErrorMsg() displays the message and terminates the application.
XtCheckSubclass() is implemented as a macro which only performs the check if compiled with the symbol DEBUG defined (i.e., if the C compiler is invoked with the flag
−DDEBUG).
USAGE
XtCheckSubclass() is intended for use similar to the POSIX assert() macro while developing and debugging a widget or an application. It should be used in all application and widget-internal functions that might inadvertently be passed an object of the wrong type. Public functions exported by a widget should always check a widget’s class (not just when DEBUG is defined) using XtIsSubclass() or a related function because even if a widget is bug-free, an application programmer may still pass an object of the wrong type to the widget.
SEE ALSO
XtClassUNIX SYSTEM V/68, XtIsSubclassUNIX SYSTEM V/68, XtSuperclassUNIX SYSTEM V/68,
CoreUNIX SYSTEM V/68 and V/88 Release 4.