Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

snprintf.h

Go to the documentation of this file.
00001 /* $Id$ */
00002 /*
00003 ** Copyright (C) 2002 Martin Roesch <roesch@sourcefire.com>
00004 **
00005 ** This program is free software; you can redistribute it and/or modify
00006 ** it under the terms of the GNU General Public License as published by
00007 ** the Free Software Foundation; either version 2 of the License, or
00008 ** (at your option) any later version.
00009 **
00010 ** This program 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
00013 ** GNU General Public License for more details.
00014 **
00015 ** You should have received a copy of the GNU General Public License
00016 ** along with this program; if not, write to the Free Software
00017 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */
00019 
00020 
00021 #ifndef __SNPRINTF_H__
00022 #define __SNPRINTF_H__
00023 
00024 #ifndef HAVE_SNPRINTF
00025 
00026 #ifdef HAVE_CONFIG_H
00027 #include "config.h"
00028 #endif
00029 
00030 #include <stdio.h>
00031 #include <sys/types.h>
00032 #include <string.h>
00033 
00034 #ifdef __STDC__
00035 
00036 #include <stdarg.h>
00037 
00038 # define VA_LOCAL_DECL  va_list ap;
00039 # define VA_START(f)    va_start(ap, f)
00040 # define VA_END         va_end(ap)
00041 
00042 #else /* __STDC__ */
00043 
00044 #ifndef WIN32
00045 #include <varargs.h>
00046 #endif  /* WIN32 */
00047 
00048 # define VA_LOCAL_DECL  va_list ap;
00049 # define VA_START(f)    va_start(ap)
00050 # define VA_END         va_end(ap)
00051 
00052 #endif /* __STDC__ */
00053 
00054 #ifndef __P
00055 #include "cdefs.h"
00056 #endif /* ! __P */
00057 
00058 #ifndef QUAD_T
00059 # define QUAD_T unsigned long
00060 #endif /* ! QUAD_T */
00061 
00062 
00063 
00064 #define tTd(flag, level)        (tTdvect[flag] >= (u_char)level)
00065 #define MAXSHORTSTR  203             /* max short string length */
00066 
00067 u_char   tTdvect[100];   /* trace vector */
00068 
00069 int snprintf(char *, size_t , const char *, ...);
00070 #ifndef HAVE_VSNPRINTF
00071 int vsnprintf(char *, size_t, const char *, va_list);
00072 #endif /* HAVE_VSNPRINTF */
00073 char *shortenstring(register const char *, int);
00074 
00075 
00076 #endif /* HAVE_SNPRINTF */
00077 #endif /* __SNPRINTF_H__ */

Generated on Sun May 14 14:51:18 2006 by  doxygen 1.4.2