VMS Help  —  DCE  DCE_INTRO, dce_svc_intro, dce_assert
 NAME
   dce_assert - Inserts program diagnostics

 SYNOPSIS

   #define DCE_ASSERT
   #include <dce/assert.h>

   void dce_assert( dce_svc_handle_t handle,
                    int expression );

 PARAMETERS

   Input

   handle    A registered serviceability handle.

   expression
             An expression the truth of which is to be tested.

 DESCRIPTION

   The dce_assert macro is used to add runtime "can't happen"
   assertions to programs (that is, programming errors). On
   execution, when expression evaluates to 0 (that is, to "false"),
   then dce_svc_printf() is called with parameters to generate a
   message identifying the expression, source file and line number.
   The message is generated with a severity level of svc_c_sev_fatal,
   with the svc_c_action_abort flag specified (which will cause the
   program to abort when the assertion fails and the message is
   generated).  See the dce_svc_register reference page for more
   information.

   The handle parameter should be a registered serviceability handle; it
   can also be NULL, in which case an internal serviceability handle will
   be used.

   Assertion-checking can be enabled or disabled at compile time.
   The header file dce/assert.h can be included multiple times.
   If DCE_ASSERT is defined before the header is included, assertion
   checking is performed.  If it is not so defined, then the
   assertion-checking code is not compiled in.  The system default is
   set in dce/dce.h.

 ERROR CODES

   See dce_svc_register.

 RELATED INFORMATION

   Functions: dce_svc_register
Close Help