Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

htdebug.h

Go to the documentation of this file.
00001 /* 
00002  *      HT Editor
00003  *      htdebug.h
00004  *
00005  *      Copyright (C) 1999-2002 Stefan Weyergraf (stefan@weyergraf.de)
00006  *
00007  *      This program is free software; you can redistribute it and/or modify
00008  *      it under the terms of the GNU General Public License version 2 as
00009  *      published by the Free Software Foundation.
00010  *
00011  *      This program is distributed in the hope that it will be useful,
00012  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *      GNU General Public License for more details.
00015  *
00016  *      You should have received a copy of the GNU General Public License
00017  *      along with this program; if not, write to the Free Software
00018  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 #ifndef __HTDEBUG_H__
00022 #define __HTDEBUG_H__
00023 
00024 #include <stdio.h>
00025 
00026 #include "global.h"
00027 
00028 /****************************************************************************/
00029 #define HTDEBUG
00030 /****************************************************************************/
00031 
00032 void ht_assert_failed(char *file, int line, char *assertion);
00033 void ht_error(char *file, int line, char *format,...);
00034 void ht_trace(char *file, int line, char *format,...);
00035 void ht_warn(char *file, int line, char *format,...);
00036 
00037 typedef qword timepoint;
00038 
00039 typedef int timer_handle;
00040 
00041 timer_handle new_timer();
00042 void start_timer(timer_handle handle);
00043 void stop_timer(timer_handle handle);
00044 void delete_timer(timer_handle handle);
00045 
00046 dword get_timer_sec(timer_handle handle);
00047 dword get_timer_msec(timer_handle handle);
00048 dword get_timer_tick(timer_handle h);
00049 
00050 #define HT_ERROR(a...) ht_error(__FILE__, __LINE__, a)
00051 #define HT_WARN(a...) ht_warn(__FILE__, __LINE__, a)
00052 
00053 #ifdef HTDEBUG
00054 #define HT_TRACE(a...) ht_trace(__FILE__, __LINE__, a)
00055 #else
00056 #define HT_TRACE(a...) ((void)0)
00057 #endif
00058 
00059 #ifdef HTDEBUG
00060 #       define assert(a) if (!(a)) ht_assert_failed(__FILE__, __LINE__, (#a));
00061 #else
00062 #       define assert(a) ((void)0)
00063 #endif
00064 
00065 #endif /* !__HTDEBUG_H__ */
00066 

Generated on Fri May 7 21:15:32 2004 by doxygen 1.3.5