MorePalmOS
A development library for developing Palm OS applications

MorePrivate.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * MorePalmOS
00003  * Copyright (c) 2004 Steven Fisher
00004  *
00005  * Distributed under the Boost Software License, Version 1.0. See accompanying
00006  * license file License.txt or <http://www.boost.org/LICENSE_1_0.txt>.
00007  *
00008  * http://morepalmos.sourceforge.net
00009  *
00010  *   MorePalmOS is the humble begining of an attempt to provide a library for
00011  *   Palm OS development which works around system bugs, illustrate how to
00012  *   use system calls, and provide "glue code" for programming Palm OS
00013  *   applications in a more straightforward way while minimally impacting
00014  *   code size.
00015  *****************************************************************************/
00016 
00030 #ifndef MOREPREFIX_H
00031 #error Do not use MorePrivate directly!
00032 #endif
00033 
00034 #ifndef MOREPRIVATE_H
00035 #define MOREPRIVATE_H
00036 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 #include "MoreErrorMgr.h"
00042 
00043 /* Define some shorthand macros for MoreError. Not useful to other programs
00044    since they operate off the MOREPALMOS_SELF_NOTIFY switch. If you want
00045    shorthand macros, set MOREPALMOS_ERROR_MACROS and use the ones in
00046    MoreErrorMgr.h instead. */
00047 
00048 #if ERROR_CHECK_LEVEL == ERROR_CHECK_FULL
00049 #define _ifdebug( statement )\
00050         statement
00051 #else
00052 #define _ifdebug( statement )
00053 #endif
00054 
00055 #define _check( assertion )\
00056         merr_checkf( assertion )
00057 
00058 #define _validate_form_ptr( formP )\
00059         merr_validate_form_ptr( formP )
00060 #define _validate_const_form_ptr( formP )\
00061         merr_validate_const_form_ptr( formP )
00062 #define _validate_object_id( formP, objID )\
00063         merr_validate_object_id( formP, objID )
00064 #define _validate_object_idx( formP, objIdx )\
00065         merr_validate_object_idx( formP, objIdx )
00066 #define _validate_object_ptr( objP )\
00067         merr_validate_object_ptr( objP )
00068 #define _validate_const_object_ptr( objP )\
00069         merr_validate_const_object_ptr( objP )
00070 #define _validate_field_ptr( fieldP )\
00071         merr_validate_field_ptr( fieldP )
00072 #define _validate_memhandle( hand )\
00073         merr_validate_memhandle( hand )
00074 
00075 #define _require( success, label )\
00076         merr_require( success, label, MOREPALMOS_SELF_NOTIFY )
00077 #define _reject( failure, label )\
00078         merr_reject( failure, label, MOREPALMOS_SELF_NOTIFY )
00079 #define _require_action( success, action, label )\
00080         merr_require_action( success, action, label, MOREPALMOS_SELF_NOTIFY )
00081 #define _reject_action( failure, action, label )\
00082         merr_reject_action( failure, action, label, MOREPALMOS_SELF_NOTIFY )
00083 
00084 #define _notify_of_error( )\
00085         _NotifyOfError( MOREPALMOS_SELF_NOTIFY )
00086 
00091 #define _min(a, b) (((a) < (b)) ? (a) : (b))
00092 
00097 #define _max(a, b) (((a) > (b)) ? (a) : (b))
00098 
00102 #if DEBUG_LEVEL > DEBUG_LEVEL_NONE
00103 #define _rinline
00104 #else
00105 #define _rinline inline
00106 #endif
00107 
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111 
00112 #endif

SourceForge.net Logo