summaryrefslogtreecommitdiff
path: root/libhal/libhal.h
diff options
context:
space:
mode:
authorDavid Zeuthen <david@fubar.dk>2005-07-21 19:03:34 +0000
committerDavid Zeuthen <david@fubar.dk>2005-07-21 19:03:34 +0000
commitae6cedfe56f56a4b805eb563e98f7420eb10487f (patch)
tree64f03089518f00287fb5166b7ad5166d5e4a9d61 /libhal/libhal.h
parent81e09a3ba1c7bcf374dd6fc4639c638de180122e (diff)
Patch from Danny Kukawka <danny.kukawka@web.de>: here the new patch with a
macro instead of always the same codeblock in so many funtions.
Diffstat (limited to 'libhal/libhal.h')
-rw-r--r--libhal/libhal.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libhal/libhal.h b/libhal/libhal.h
index 11e41bc2..c79f8ec2 100644
--- a/libhal/libhal.h
+++ b/libhal/libhal.h
@@ -35,6 +35,17 @@ extern "C" {
#endif
#endif
+/** Checks if LibHalContext *ctx == NULL */
+#define LIBHAL_CHECK_LIBHALCONTEXT(_ctx_, _ret_) \
+ do { \
+ if (_ctx_ == NULL) { \
+ fprintf (stderr, \
+ "%s %d : LibHalContext *ctx is NULL\n", \
+ __FILE__, __LINE__); \
+ return _ret_; \
+ } \
+ } while(0)
+
/**
* @addtogroup LibHal
*