SFBPrintf.h

Go to the documentation of this file.
00001 /*                                             -*- mode:C++; fill-column:100 -*-
00002   SFBPrintf.h - Crappy cheapo knockoff printf-like routines
00003   Copyright (C) 2009 The Regents of the University of New Mexico
00004  
00005   This library is free software; you can redistribute it and/or
00006   modify it under the terms of the GNU Lesser General Public
00007   License as published by the Free Software Foundation; either
00008   version 2.1 of the License, or (at your option) any later version.
00009 
00010   This library is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013   Lesser General Public License for more details.
00014 
00015   You should have received a copy of the GNU General Public License
00016   along with this library; if not, write to the Free Software
00017   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
00018   USA
00019 
00020   $Id$
00021  */
00022 
00029 #ifndef SFBPRINTF_H
00030 #define SFBPRINTF_H
00031 
00032 #include "SFBTypes.h"
00033 #include <stdarg.h>
00034 
00035 enum { LOGLEVEL_NONE, LOGLEVEL_QUIET, LOGLEVEL_NORMAL, LOGLEVEL_VERBOSE, LOGLEVEL_DEBUG };
00036 extern void setLogLevel(int n) ;
00037 extern int getLogLevel() ;
00038 
00039 extern void setLogFace(u8 face) ;
00040 extern u8 getLogFace() ;
00041 
00046 extern void pprintf(const char * format, ...) ;
00047 
00048 extern void facePrintf(u8 face, const char * format, ...) ;
00049 extern void vfacePrintf(u8 face, const char * format, va_list & ap) ;
00050 
00063 extern u32 packetScanf(u8 * packet, const char * format, ...) ;
00064 
00065 extern u32 vPacketScanf(u8 * packet, const char * format, va_list & ap) ;
00066 
00067 extern void vfaceLogf(int includeTimestamp, int level, u8 face, const char * format, va_list & ap) ;
00068 
00069 /* The 'log*' functions output a timestamp first */
00070 extern void logf(int level, const char * format, ...) ;
00071 extern void logNormal(const char * format, ...) ;
00072 extern void logVerbose(const char * format, ...) ;
00073 extern void logDebug(const char * format, ...) ;
00074 extern void logQuiet(const char * format, ...) ;
00075 
00076 /* The 'msg*' functions print only what you say */
00077 extern void msgf(int level, const char * format, ...) ;
00078 extern void msgNormal(const char * format, ...) ;
00079 extern void msgVerbose(const char * format, ...) ;
00080 extern void msgDebug(const char * format, ...) ;
00081 extern void msgQuiet(const char * format, ...) ;
00082 
00083 #endif /* SFBPRINTF_H */

Generated on Sun Oct 18 09:58:55 2009 for SFB by doxygen 1.5.9