MorePalmOS
A development library for developing Palm OS applications

MoreErrorMgr.c

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 
00017 #include "MorePrefix.h"
00018 #include "MoreErrorMgr.h"
00019 #include "MorePrivate.h"
00020 
00021 #include <StringMgr.h>
00022 
00023 #if MOREPALMOS_INCLUDE_DEFAULT_FLOW_NOTIFICATIONS
00024 
00025 void __NotifyOfErrorVerbose( const char* file, Int16 line )
00026 {
00027         char text [ 255 ];
00028         char lineStr [ 6 ];
00029         StrCopy( text, "Debug event at ");
00030         StrCat( text, file );
00031         StrCat( text, "-");
00032         StrIToA( lineStr, line );
00033         ErrAlertCustom(0, text, NULL, NULL );
00034 }
00035 
00036 void __NotifyOfError( )
00037 {
00038         ErrAlertCustom(0, "Debug event.", NULL, NULL );
00039 }
00040 
00041 #endif
00042 
00043 #if ERROR_CHECK_LEVEL == ERROR_CHECK_FULL
00044 
00045 FormType* merr_validate_form_ptr( FormType* formP )
00046 {
00047         _check ( ECFrmValidatePtr( formP ) );
00048         return formP;
00049 }
00050 
00051 const FormType* merr_validate_const_form_ptr( const FormType* formP )
00052 {
00053         _check ( ECFrmValidatePtr( formP ) );
00054         return formP;
00055 }
00056 
00057 FrmObjectID_t merr_validate_object_id( const FormType* formP, FrmObjectID_t objID )
00058 {
00059         merr_validate_const_form_ptr( formP );
00060         return objID;
00061 }
00062 
00063 FrmObjectIdx_t merr_validate_object_idx( const FormType* formP, FrmObjectIdx_t objIdx )
00064 {
00065         merr_validate_const_form_ptr( formP );
00066         _check ( objIdx != frmInvalidObjectId );
00067         return objIdx;
00068 }
00069 
00070 void* merr_validate_object_ptr( void* objP )
00071 {
00072         _check ( objP );
00073         return objP;
00074 }
00075 
00076 const void* merr_validate_const_object_ptr( const void* objP )
00077 {
00078         _check ( objP );
00079         return objP;
00080 }
00081 
00082 FieldType* merr_validate_field_ptr( FieldType* fieldP )
00083 {
00084         _check ( fieldP );
00085         return fieldP;
00086 }
00087 
00088 const FieldType* merr_validate_const_field_ptr( const FieldType* fieldP )
00089 {
00090         _check ( fieldP );
00091         return fieldP;
00092 }
00093 
00094 MemHandle merr_validate_memhandle( MemHandle memH )
00095 {
00096         _check ( memH );
00097         return memH;
00098 }
00099 
00100 const MemHandle merr_validate_const_memhandle( const MemHandle memH )
00101 {
00102         _check ( memH );
00103         return memH;
00104 }
00105 
00106 #endif

SourceForge.net Logo