"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.11.23/lib/lwres/print_p.h" (7 Sep 2020, 2107 Bytes) of package /linux/misc/dns/bind9/9.11.23/bind-9.11.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "print_p.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 /* $Id: print_p.h,v 1.6 2010/08/16 23:46:52 tbox Exp $ */
   13 
   14 #ifndef LWRES_PRINT_P_H
   15 #define LWRES_PRINT_P_H 1
   16 
   17 /***
   18  *** Imports
   19  ***/
   20 
   21 #include <lwres/lang.h>
   22 #include <lwres/platform.h>
   23 
   24 /*
   25  * This block allows lib/lwres/print.c to be cleanly compiled even if
   26  * the platform does not need it.  The standard Makefile will still
   27  * not compile print.c or archive print.o, so this is just to make test
   28  * compilation ("make print.o") easier.
   29  */
   30 #if !defined(LWRES_PLATFORM_NEEDVSNPRINTF) && defined(LWRES__PRINT_SOURCE)
   31 #define LWRES_PLATFORM_NEEDVSNPRINTF
   32 #endif
   33 
   34 #if !defined(LWRES_PLATFORM_NEEDSPRINTF) && defined(LWRES__PRINT_SOURCE)
   35 #define LWRES_PLATFORM_NEEDSPRINTF
   36 #endif
   37 
   38 /***
   39  *** Macros.
   40  ***/
   41 
   42 #ifdef __GNUC__
   43 #define LWRES_FORMAT_PRINTF(fmt, args) \
   44     __attribute__((__format__(__printf__, fmt, args)))
   45 #else
   46 #define LWRES_FORMAT_PRINTF(fmt, args)
   47 #endif
   48 
   49 /***
   50  *** Functions
   51  ***/
   52 
   53 #ifdef LWRES_PLATFORM_NEEDVSNPRINTF
   54 #include <stdarg.h>
   55 #include <stddef.h>
   56 #endif
   57 
   58 LWRES_LANG_BEGINDECLS
   59 
   60 #ifdef LWRES_PLATFORM_NEEDVSNPRINTF
   61 int
   62 lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap)
   63      LWRES_FORMAT_PRINTF(3, 0);
   64 #ifdef vsnprintf
   65 #undef vsnprintf
   66 #endif
   67 #define vsnprintf lwres__print_vsnprintf
   68 
   69 int
   70 lwres__print_snprintf(char *str, size_t size, const char *format, ...)
   71      LWRES_FORMAT_PRINTF(3, 4);
   72 #ifdef snprintf
   73 #undef snprintf
   74 #endif
   75 #define snprintf lwres__print_snprintf
   76 #endif /* LWRES_PLATFORM_NEEDVSNPRINTF */
   77 
   78 #ifdef LWRES_PLATFORM_NEEDSPRINTF
   79 int
   80 lwres__print_sprintf(char *str, const char *format, ...) LWRES_FORMAT_PRINTF(2, 3);
   81 #ifdef sprintf
   82 #undef sprintf
   83 #endif
   84 #define sprintf lwres__print_sprintf
   85 #endif
   86 
   87 LWRES_LANG_ENDDECLS
   88 
   89 #endif /* LWRES_PRINT_P_H */