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 
00093 extern u32 packetScanf(u8 * packet, const char * format, ...) ;
00094 
00095 extern u32 vPacketScanf(u8 * packet, const char * format, va_list & ap) ;
00096 
00097 extern void vfaceLogf(int includeTimestamp, int level, u8 face, const char * format, va_list & ap) ;
00098 
00099 /* The 'log*' functions output a timestamp first */
00100 extern void logf(int level, const char * format, ...) ;
00101 extern void logNormal(const char * format, ...) ;
00102 extern void logVerbose(const char * format, ...) ;
00103 extern void logDebug(const char * format, ...) ;
00104 extern void logQuiet(const char * format, ...) ;
00105 
00106 /* The 'msg*' functions print only what you say */
00107 extern void msgf(int level, const char * format, ...) ;
00108 extern void msgNormal(const char * format, ...) ;
00109 extern void msgVerbose(const char * format, ...) ;
00110 extern void msgDebug(const char * format, ...) ;
00111 extern void msgQuiet(const char * format, ...) ;
00112 
00113 #endif /* SFBPRINTF_H */

Generated on Mon Oct 26 10:44:21 2009 for SFB by doxygen 1.5.9