00001 /****************************************************************************** 00002 ** 00003 ** trace.c 00004 ** 00005 ** This file is part of the ABYSS Web server project. 00006 ** 00007 ** Copyright (C) 2000 by Moez Mahfoudh <mmoez@bigfoot.com>. 00008 ** All rights reserved. 00009 ** 00010 ** Redistribution and use in source and binary forms, with or without 00011 ** modification, are permitted provided that the following conditions 00012 ** are met: 00013 ** 1. Redistributions of source code must retain the above copyright 00014 ** notice, this list of conditions and the following disclaimer. 00015 ** 2. Redistributions in binary form must reproduce the above copyright 00016 ** notice, this list of conditions and the following disclaimer in the 00017 ** documentation and/or other materials provided with the distribution. 00018 ** 3. The name of the author may not be used to endorse or promote products 00019 ** derived from this software without specific prior written permission. 00020 ** 00021 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 00022 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00023 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00024 ** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 00025 ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00026 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00027 ** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00028 ** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00029 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00030 ** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00031 ** SUCH DAMAGE. 00032 ** 00033 ******************************************************************************/ 00034 00035 #include <stdlib.h> 00036 #include <stdio.h> 00037 #include <stdarg.h> 00038 00039 #include "abyss_trace.h" 00040 00041 /********************************************************************* 00042 ** Tracing functions 00043 *********************************************************************/ 00044 00045 static void 00046 TraceVMsg(const char * const fmt, 00047 va_list argptr) { 00048 00049 vprintf(fmt,argptr); 00050 00051 printf("\n"); 00052 } 00053 00054 00055 00056 void 00057 TraceMsg(const char * const fmt, ...) { 00058 00059 va_list argptr; 00060 00061 va_start(argptr,fmt); 00062 TraceVMsg(fmt,argptr); 00063 va_end(argptr); 00064 } 00065 00066 00067 00068 void 00069 TraceExit(const char * const fmt, ...) { 00070 00071 va_list argptr; 00072 00073 va_start(argptr,fmt); 00074 TraceVMsg(fmt,argptr); 00075 va_end(argptr); 00076 00077 exit(1); 00078 }
1.5.6