include/hiker/fail.h File Reference


Detailed Description

Header file for asserts equivalent.

>

#include <stdarg.h>
#include <hiker/config.h>
#include <hiker/traces.h>

Go to the source code of this file.

Defines

#define ALP_FAIL_FATAL_IF(cond, msg,)
 This macro calls alp_fail_raise for when the ALP_MODEL is defined to be ALP_MODEL_DEVELOPMENT and ALP_MODEL_PRODUCTION.
#define ALP_FAIL_NON_FATAL_IF(cond, msg,)
 This macro calls alp_fail_raise for when the ALP_MODEL is defined to be ALP_MODEL_DEVELOPMENT. Otherwise, it does nothing.

Functions

void alp_fail_raise (const char *file, int line, const char *cond, const char *fmt,...)
 This function shows a dialog with the options to generate a report (and quit), quit the application or hold for debugging. Option to hold for debugging is only displayed when ALP_MODEL is equal to ALP_MODEL_DEVELOPMENT. The combination of file, line and condition is output to sdtout. For ALP_MODEL_DEVELOPMENT, it is also displayed in the dialog. Otherwise, a generic runtime error message is displayed.


Define Documentation

#define ALP_FAIL_FATAL_IF cond,
msg   ) 
 

Value:

do { if (cond) { \
                                ALP_LOG(ALP_LOG_ERROR, msg, ## __VA_ARGS__); \
                                alp_fail_raise(__FILE__, __LINE__, #cond, msg, ## __VA_ARGS__); \
                } } while (0)
This macro calls alp_fail_raise for when the ALP_MODEL is defined to be ALP_MODEL_DEVELOPMENT and ALP_MODEL_PRODUCTION.

Parameters:
[in] cond A condition that evaluates to true or false.
[in] msg A printf formatted string describing the condition.
[in] ... A variable number of parameters to go along with the msg.
Returns:
No return value.

#define ALP_FAIL_NON_FATAL_IF cond,
msg   ) 
 

Value:

do { if (cond) { \
                                ALP_LOG(ALP_LOG_WARNING, msg, ## __VA_ARGS__); \
                                alp_fail_raise(__FILE__, __LINE__, #cond, msg, ## __VA_ARGS__); \
                } } while (0)
This macro calls alp_fail_raise for when the ALP_MODEL is defined to be ALP_MODEL_DEVELOPMENT. Otherwise, it does nothing.

Parameters:
[in] cond A condition that evaluates to true or false.
[in] msg A printf formatted string describing the condition.
[in] ... A variable number of parameters to go along with the msg.
Returns:
No return value.


Function Documentation

void alp_fail_raise const char *  file,
int  line,
const char *  cond,
const char *  fmt,
  ...
 

This function shows a dialog with the options to generate a report (and quit), quit the application or hold for debugging. Option to hold for debugging is only displayed when ALP_MODEL is equal to ALP_MODEL_DEVELOPMENT. The combination of file, line and condition is output to sdtout. For ALP_MODEL_DEVELOPMENT, it is also displayed in the dialog. Otherwise, a generic runtime error message is displayed.

Parameters:
[in] file A string indicating the name of the file where the condition occurred.
[in] line An integer indicating the line in the file where the condition occurred.
[in] cond A condition that evaluates to true or false.
[in] fmt A printf formatted string describing the condition.
[in] ... A variable number of parameters to go along with the fmt.
Returns:
No return value.


Generated on Wed Jul 30 07:06:40 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.