"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.17.5/lib/dns/include/dns/time.h" (4 Sep 2020, 1692 Bytes) of package /linux/misc/dns/bind9/9.17.5/bind-9.17.5.tar.xz:


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 "time.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 #ifndef DNS_TIME_H
   13 #define DNS_TIME_H 1
   14 
   15 /*! \file dns/time.h */
   16 
   17 /***
   18  ***    Imports
   19  ***/
   20 
   21 #include <inttypes.h>
   22 
   23 #include <isc/buffer.h>
   24 #include <isc/lang.h>
   25 
   26 ISC_LANG_BEGINDECLS
   27 
   28 /***
   29  ***    Functions
   30  ***/
   31 
   32 isc_result_t
   33 dns_time64_fromtext(const char *source, int64_t *target);
   34 /*%<
   35  * Convert a date and time in YYYYMMDDHHMMSS text format at 'source'
   36  * into to a 64-bit count of seconds since Jan 1 1970 0:00 GMT.
   37  * Store the count at 'target'.
   38  */
   39 
   40 isc_result_t
   41 dns_time32_fromtext(const char *source, uint32_t *target);
   42 /*%<
   43  * Like dns_time64_fromtext, but returns the second count modulo 2^32
   44  * as per RFC2535.
   45  */
   46 
   47 isc_result_t
   48 dns_time64_totext(int64_t value, isc_buffer_t *target);
   49 /*%<
   50  * Convert a 64-bit count of seconds since Jan 1 1970 0:00 GMT into
   51  * a YYYYMMDDHHMMSS text representation and append it to 'target'.
   52  */
   53 
   54 isc_result_t
   55 dns_time32_totext(uint32_t value, isc_buffer_t *target);
   56 /*%<
   57  * Like dns_time64_totext, but for a 32-bit cyclic time value.
   58  * Of those dates whose counts of seconds since Jan 1 1970 0:00 GMT
   59  * are congruent with 'value' modulo 2^32, the one closest to the
   60  * current date is chosen.
   61  */
   62 
   63 int64_t
   64 dns_time64_from32(uint32_t value);
   65 /*%<
   66  * Covert a 32-bit cyclic time value into a 64 bit time stamp.
   67  */
   68 
   69 ISC_LANG_ENDDECLS
   70 
   71 #endif /* DNS_TIME_H */