print.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004-2007, 2014  Internet Systems Consortium, Inc. ("ISC")
00003  * Copyright (C) 1999-2001, 2003  Internet Software Consortium.
00004  *
00005  * Permission to use, copy, modify, and/or distribute this software for any
00006  * purpose with or without fee is hereby granted, provided that the above
00007  * copyright notice and this permission notice appear in all copies.
00008  *
00009  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
00010  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00011  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
00012  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00013  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00014  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00015  * PERFORMANCE OF THIS SOFTWARE.
00016  */
00017 
00018 /* $Id: print.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */
00019 
00020 #ifndef ISC_PRINT_H
00021 #define ISC_PRINT_H 1
00022 
00023 /*! \file isc/print.h */
00024 
00025 /***
00026  *** Imports
00027  ***/
00028 
00029 #include <isc/formatcheck.h>    /* Required for ISC_FORMAT_PRINTF() macro. */
00030 #include <isc/lang.h>
00031 #include <isc/platform.h>
00032 
00033 /*!
00034  * This block allows lib/isc/print.c to be cleanly compiled even if
00035  * the platform does not need it.  The standard Makefile will still
00036  * not compile print.c or archive print.o, so this is just to make test
00037  * compilation ("make print.o") easier.
00038  */
00039 #if !defined(ISC_PLATFORM_NEEDVSNPRINTF) && defined(ISC__PRINT_SOURCE)
00040 #define ISC_PLATFORM_NEEDVSNPRINTF
00041 #undef snprintf
00042 #undef vsnprintf
00043 #endif
00044 
00045 #if !defined(ISC_PLATFORM_NEEDSPRINTF) && defined(ISC__PRINT_SOURCE)
00046 #define ISC_PLATFORM_NEEDSPRINTF
00047 #undef sprintf
00048 #endif
00049 
00050 /***
00051  *** Macros
00052  ***/
00053 #define ISC_PRINT_QUADFORMAT ISC_PLATFORM_QUADFORMAT
00054 
00055 /***
00056  *** Functions
00057  ***/
00058 
00059 #ifdef ISC_PLATFORM_NEEDVSNPRINTF
00060 #include <stdarg.h>
00061 #include <stddef.h>
00062 #endif
00063 #ifdef ISC_PLATFORM_NEEDSPRINTF
00064 #include <stdio.h>
00065 #endif
00066 
00067 
00068 ISC_LANG_BEGINDECLS
00069 
00070 #ifdef ISC_PLATFORM_NEEDVSNPRINTF
00071 int
00072 isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap)
00073      ISC_FORMAT_PRINTF(3, 0);
00074 #define vsnprintf isc_print_vsnprintf
00075 
00076 int
00077 isc_print_snprintf(char *str, size_t size, const char *format, ...)
00078      ISC_FORMAT_PRINTF(3, 4);
00079 #define snprintf isc_print_snprintf
00080 #endif /* ISC_PLATFORM_NEEDVSNPRINTF */
00081 
00082 #ifdef ISC_PLATFORM_NEEDSPRINTF
00083 int
00084 isc_print_sprintf(char *str, const char *format, ...) ISC_FORMAT_PRINTF(2, 3);
00085 #define sprintf isc_print_sprintf
00086 #endif
00087 
00088 ISC_LANG_ENDDECLS
00089 
00090 #endif /* ISC_PRINT_H */

Generated on Tue Apr 28 17:41:04 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha